智慧水务管理系统 - 精河县供水工程综合管理平台

operation-dashboard.html 31KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>供水运营专题大屏</title>
  7. <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  8. <script src="https://unpkg.com/echarts@5.5.0/dist/echarts.min.js"></script>
  9. <script src="https://unpkg.com/echarts-liquidfill@3.0.0/dist/echarts-liquidfill.min.js"></script>
  10. <link rel="stylesheet" href="https://unpkg.com/element-plus@2.8.0/dist/index.css">
  11. <script src="https://unpkg.com/element-plus@2.8.0/dist/index.full.js"></script>
  12. <style>
  13. * {
  14. margin: 0;
  15. padding: 0;
  16. box-sizing: border-box;
  17. }
  18. body {
  19. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  20. overflow: hidden;
  21. }
  22. .operation-dashboard {
  23. padding: 20px;
  24. background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  25. color: #fff;
  26. min-height: 100vh;
  27. }
  28. .dashboard-header {
  29. text-align: center;
  30. margin-bottom: 30px;
  31. }
  32. .dashboard-header h1 {
  33. font-size: 36px;
  34. margin-bottom: 10px;
  35. text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  36. }
  37. .header-info {
  38. font-size: 16px;
  39. opacity: 0.9;
  40. }
  41. .status-normal {
  42. color: #67c23a;
  43. font-weight: bold;
  44. }
  45. .core-metrics {
  46. display: grid;
  47. grid-template-columns: repeat(6, 1fr);
  48. gap: 20px;
  49. margin-bottom: 30px;
  50. }
  51. .metric-card {
  52. background: rgba(255,255,255,0.1);
  53. border-radius: 12px;
  54. padding: 20px;
  55. backdrop-filter: blur(10px);
  56. border: 1px solid rgba(255,255,255,0.2);
  57. display: flex;
  58. align-items: center;
  59. transition: all 0.3s;
  60. }
  61. .metric-card:hover {
  62. transform: translateY(-2px);
  63. background: rgba(255,255,255,0.15);
  64. }
  65. .metric-icon {
  66. width: 50px;
  67. height: 50px;
  68. border-radius: 10px;
  69. display: flex;
  70. align-items: center;
  71. justify-content: center;
  72. margin-right: 15px;
  73. color: white;
  74. font-size: 24px;
  75. }
  76. .metric-content {
  77. flex: 1;
  78. }
  79. .metric-value {
  80. font-size: 24px;
  81. font-weight: bold;
  82. margin-bottom: 5px;
  83. }
  84. .metric-unit {
  85. font-size: 14px;
  86. opacity: 0.8;
  87. margin-left: 4px;
  88. }
  89. .metric-title {
  90. font-size: 14px;
  91. opacity: 0.9;
  92. margin-bottom: 5px;
  93. }
  94. .metric-trend {
  95. font-size: 12px;
  96. display: flex;
  97. align-items: center;
  98. gap: 4px;
  99. }
  100. .trend-up {
  101. color: #67c23a;
  102. }
  103. .trend-down {
  104. color: #f56c6c;
  105. }
  106. .charts-grid {
  107. display: grid;
  108. grid-template-columns: 1fr 1.5fr 1fr;
  109. gap: 20px;
  110. margin-bottom: 30px;
  111. }
  112. .chart-panel {
  113. background: rgba(255,255,255,0.1);
  114. border-radius: 12px;
  115. padding: 20px;
  116. backdrop-filter: blur(10px);
  117. border: 1px solid rgba(255,255,255,0.2);
  118. display: flex;
  119. flex-direction: column;
  120. }
  121. .chart-panel.large-panel {
  122. grid-row: span 2;
  123. }
  124. .panel-header {
  125. display: flex;
  126. justify-content: space-between;
  127. align-items: center;
  128. margin-bottom: 15px;
  129. }
  130. .panel-header h3 {
  131. font-size: 18px;
  132. font-weight: 600;
  133. margin: 0;
  134. }
  135. .chart-container {
  136. flex: 1;
  137. min-height: 200px;
  138. }
  139. .map-container {
  140. flex: 1;
  141. min-height: 300px;
  142. background: rgba(0,0,0,0.2);
  143. border-radius: 8px;
  144. display: flex;
  145. align-items: center;
  146. justify-content: center;
  147. color: rgba(255,255,255,0.7);
  148. }
  149. .alarm-list {
  150. flex: 1;
  151. overflow-y: auto;
  152. }
  153. .alarm-item {
  154. background: rgba(255,255,255,0.1);
  155. border-radius: 8px;
  156. padding: 12px;
  157. margin-bottom: 10px;
  158. border-left: 4px solid;
  159. }
  160. .alarm-item.warning {
  161. border-left-color: #e6a23c;
  162. background: rgba(230, 162, 60, 0.1);
  163. }
  164. .alarm-item.danger {
  165. border-left-color: #f56c6c;
  166. background: rgba(245, 108, 108, 0.1);
  167. }
  168. .alarm-item.info {
  169. border-left-color: #909399;
  170. background: rgba(144, 147, 153, 0.1);
  171. }
  172. .alarm-time {
  173. font-size: 12px;
  174. opacity: 0.8;
  175. margin-bottom: 4px;
  176. }
  177. .alarm-title {
  178. font-size: 14px;
  179. font-weight: bold;
  180. margin-bottom: 4px;
  181. }
  182. .alarm-location {
  183. font-size: 12px;
  184. opacity: 0.8;
  185. margin-bottom: 2px;
  186. }
  187. .alarm-status {
  188. font-size: 12px;
  189. opacity: 0.7;
  190. }
  191. .bottom-stats {
  192. display: grid;
  193. grid-template-columns: repeat(4, 1fr);
  194. gap: 20px;
  195. }
  196. .stat-item {
  197. background: rgba(255,255,255,0.1);
  198. border-radius: 12px;
  199. padding: 20px;
  200. text-align: center;
  201. backdrop-filter: blur(10px);
  202. border: 1px solid rgba(255,255,255,0.2);
  203. }
  204. .stat-label {
  205. font-size: 14px;
  206. opacity: 0.9;
  207. margin-bottom: 8px;
  208. }
  209. .stat-value {
  210. font-size: 28px;
  211. font-weight: bold;
  212. margin-bottom: 8px;
  213. }
  214. .time-selector {
  215. display: flex;
  216. gap: 10px;
  217. }
  218. .time-selector .el-radio {
  219. margin-right: 0;
  220. }
  221. .time-selector .el-radio__label {
  222. padding: 0 8px;
  223. }
  224. /* 响应式设计 */
  225. @media (max-width: 1400px) {
  226. .core-metrics {
  227. grid-template-columns: repeat(3, 1fr);
  228. }
  229. .charts-grid {
  230. grid-template-columns: 1fr;
  231. }
  232. .bottom-stats {
  233. grid-template-columns: repeat(2, 1fr);
  234. }
  235. }
  236. @media (max-width: 768px) {
  237. .core-metrics {
  238. grid-template-columns: 1fr;
  239. }
  240. .bottom-stats {
  241. grid-template-columns: 1fr;
  242. }
  243. .metric-card, .chart-panel, .stat-item {
  244. padding: 15px;
  245. }
  246. }
  247. .map-placeholder {
  248. text-align: center;
  249. }
  250. .map-placeholder .el-icon {
  251. font-size: 48px;
  252. margin-bottom: 10px;
  253. }
  254. </style>
  255. </head>
  256. <body>
  257. <div id="app">
  258. <div class="operation-dashboard">
  259. <div class="dashboard-header">
  260. <h1>供水运营专题大屏</h1>
  261. <div class="header-info">
  262. <span>{{ currentTime }}</span>
  263. <span>•</span>
  264. <span>在线设备: {{ onlineDevices }}/{{ totalDevices }}</span>
  265. <span>•</span>
  266. <span>系统状态: <span class="status-normal">正常运行</span></span>
  267. </div>
  268. </div>
  269. <!-- 核心指标行 -->
  270. <div class="core-metrics">
  271. <div class="metric-card" v-for="metric in coreMetrics" :key="metric.name">
  272. <div class="metric-icon" :style="{ backgroundColor: metric.color }">
  273. <el-icon><component :is="metric.icon" /></el-icon>
  274. </div>
  275. <div class="metric-content">
  276. <div class="metric-value">{{ metric.value }} <span class="metric-unit">{{ metric.unit }}</span></div>
  277. <div class="metric-title">{{ metric.title }}</div>
  278. <div class="metric-trend" :class="metric.trend">
  279. <el-icon><trend-arrow /></el-icon>
  280. {{ metric.change }}
  281. </div>
  282. </div>
  283. </div>
  284. </div>
  285. <!-- 主要图表区域 -->
  286. <div class="charts-grid">
  287. <!-- 左侧图表区域 -->
  288. <div class="left-charts">
  289. <!-- 供水趋势图 -->
  290. <div class="chart-panel">
  291. <div class="panel-header">
  292. <h3>供水趋势分析</h3>
  293. <div class="time-selector">
  294. <el-radio-group v-model="timeRange" size="small">
  295. <el-radio-button label="day">今日</el-radio-button>
  296. <el-radio-button label="week">本周</el-radio-button>
  297. <el-radio-button label="month">本月</el-radio-button>
  298. </el-radio-group>
  299. </div>
  300. </div>
  301. <div class="chart-container" ref="supplyTrendChart" style="width: 100%; height: 300px;"></div>
  302. </div>
  303. <!-- 水质分布 -->
  304. <div class="chart-panel">
  305. <div class="panel-header">
  306. <h3>水质监测分布</h3>
  307. </div>
  308. <div class="chart-container" ref="waterQualityChart" style="width: 100%; height: 300px;"></div>
  309. </div>
  310. <!-- 报警统计 -->
  311. <div class="chart-panel">
  312. <div class="panel-header">
  313. <h3>报警统计</h3>
  314. </div>
  315. <div class="chart-container" ref="alarmChart" style="width: 100%; height: 300px;"></div>
  316. </div>
  317. </div>
  318. <!-- 中间图表区域 -->
  319. <div class="center-charts">
  320. <!-- 空间分布 -->
  321. <div class="chart-panel large-panel">
  322. <div class="panel-header">
  323. <h3>管网空间分布</h3>
  324. </div>
  325. <div class="map-container" ref="spatialMap">
  326. <div class="map-placeholder">
  327. <el-icon><map-location /></el-icon>
  328. <p>GIS地图集成区域</p>
  329. </div>
  330. </div>
  331. </div>
  332. <!-- 设备状态 -->
  333. <div class="chart-panel">
  334. <div class="panel-header">
  335. <h3>设备运行状态</h3>
  336. </div>
  337. <div class="chart-container" ref="deviceStatusChart" style="width: 100%; height: 300px;"></div>
  338. </div>
  339. </div>
  340. <!-- 右侧图表区域 -->
  341. <div class="right-charts">
  342. <!-- 营收分析 -->
  343. <div class="chart-panel">
  344. <div class="panel-header">
  345. <h3>营收指标分析</h3>
  346. </div>
  347. <div class="chart-container" ref="revenueChart" style="width: 100%; height: 300px;"></div>
  348. </div>
  349. <!-- 实时报警 -->
  350. <div class="chart-panel">
  351. <div class="panel-header">
  352. <h3>实时报警监控</h3>
  353. </div>
  354. <div class="alarm-list">
  355. <div v-for="alarm in realTimeAlarms" :key="alarm.id" class="alarm-item" :class="alarm.level">
  356. <div class="alarm-time">{{ alarm.time }}</div>
  357. <div class="alarm-title">{{ alarm.title }}</div>
  358. <div class="alarm-location">{{ alarm.location }}</div>
  359. <div class="alarm-status">{{ alarm.status }}</div>
  360. </div>
  361. </div>
  362. </div>
  363. <!-- 能耗分析 -->
  364. <div class="chart-panel">
  365. <div class="panel-header">
  366. <h3>能耗分析</h3>
  367. </div>
  368. <div class="chart-container" ref="energyChart" style="width: 100%; height: 300px;"></div>
  369. </div>
  370. </div>
  371. </div>
  372. <!-- 底部统计 -->
  373. <div class="bottom-stats">
  374. <div class="stat-item" v-for="stat in bottomStats" :key="stat.name">
  375. <div class="stat-label">{{ stat.label }}</div>
  376. <div class="stat-value">{{ stat.value }}</div>
  377. <div class="stat-trend" :class="stat.trend">
  378. <el-icon><trend-arrow /></el-icon>
  379. {{ stat.change }}
  380. </div>
  381. </div>
  382. </div>
  383. </div>
  384. </div>
  385. <script>
  386. const { createApp } = Vue;
  387. createApp({
  388. data() {
  389. return {
  390. currentTime: '',
  391. onlineDevices: 156,
  392. totalDevices: 178,
  393. coreMetrics: [
  394. {
  395. title: '进水总量',
  396. value: '12,580',
  397. unit: 'm³',
  398. icon: 'WaterFilled',
  399. color: '#409eff',
  400. change: '+5.2%',
  401. trend: 'trend-up'
  402. },
  403. {
  404. title: '出水总量',
  405. value: '11,230',
  406. unit: 'm³',
  407. icon: 'WaterFilled',
  408. color: '#67c23a',
  409. change: '+3.8%',
  410. trend: 'trend-up'
  411. },
  412. {
  413. title: '产销差率',
  414. value: '10.8',
  415. unit: '%',
  416. icon: 'TrendCharts',
  417. color: '#e6a23c',
  418. change: '-2.1%',
  419. trend: 'trend-down'
  420. },
  421. {
  422. title: '营收额',
  423. value: '85.2',
  424. unit: '万元',
  425. icon: 'Money',
  426. color: '#67c23a',
  427. change: '+12.5%',
  428. trend: 'trend-up'
  429. },
  430. {
  431. title: '平均水质',
  432. value: '98.5',
  433. unit: '分',
  434. icon: 'DataLine',
  435. color: '#409eff',
  436. change: '+1.2',
  437. trend: 'trend-up'
  438. },
  439. {
  440. title: '报警次数',
  441. value: '3',
  442. unit: '次',
  443. icon: 'WarningFilled',
  444. color: '#f56c6c',
  445. change: '-15.8%',
  446. trend: 'trend-down'
  447. }
  448. ],
  449. timeRange: 'day',
  450. realTimeAlarms: [
  451. {
  452. id: 1,
  453. time: '08:23:45',
  454. title: '压力异常波动',
  455. location: '精芒片区',
  456. level: 'warning',
  457. status: '处理中'
  458. },
  459. {
  460. id: 2,
  461. time: '08:15:32',
  462. title: '浊度超标',
  463. location: '一体化水厂',
  464. level: 'danger',
  465. status: '紧急处理'
  466. },
  467. {
  468. id: 3,
  469. time: '07:58:21',
  470. title: '设备离线',
  471. location: '托里片区',
  472. level: 'info',
  473. status: '已恢复'
  474. },
  475. {
  476. id: 4,
  477. time: '07:45:18',
  478. title: '流量异常',
  479. location: '八家户片区',
  480. level: 'warning',
  481. status: '监控中'
  482. }
  483. ],
  484. bottomStats: [
  485. {
  486. label: '覆盖率',
  487. value: '98.2%',
  488. change: '+0.5%',
  489. trend: 'trend-up'
  490. },
  491. {
  492. label: '漏损率',
  493. value: '5.8%',
  494. change: '-1.2%',
  495. trend: 'trend-down'
  496. },
  497. {
  498. label: '投诉率',
  499. value: '0.3%',
  500. change: '-0.1%',
  501. trend: 'trend-down'
  502. },
  503. {
  504. label: '设备完好率',
  505. value: '95.6%',
  506. change: '+1.8%',
  507. trend: 'trend-up'
  508. }
  509. ],
  510. charts: {}
  511. }
  512. },
  513. methods: {
  514. updateTime() {
  515. const now = new Date();
  516. this.currentTime = now.toLocaleString('zh-CN', {
  517. year: 'numeric',
  518. month: '2-digit',
  519. day: '2-digit',
  520. hour: '2-digit',
  521. minute: '2-digit',
  522. second: '2-digit'
  523. });
  524. },
  525. initCharts() {
  526. // 供水趋势图
  527. const trendChart = echarts.init(document.getElementById('supplyTrendChart'));
  528. trendChart.setOption({
  529. backgroundColor: 'transparent',
  530. tooltip: {
  531. trigger: 'axis',
  532. backgroundColor: 'rgba(255,255,255,0.9)',
  533. borderColor: '#ddd',
  534. textStyle: { color: '#333' }
  535. },
  536. grid: {
  537. top: '60px',
  538. right: '20px',
  539. bottom: '40px',
  540. left: '60px',
  541. containLabel: true
  542. },
  543. xAxis: {
  544. type: 'category',
  545. data: ['00:00', '04:00', '08:00', '12:00', '16:00', '20:00'],
  546. axisLine: { lineStyle: { color: '#ddd' } },
  547. axisLabel: { color: '#666' }
  548. },
  549. yAxis: {
  550. type: 'value',
  551. name: '流量(m³/h)',
  552. nameTextStyle: { color: '#666' },
  553. axisLine: { show: false },
  554. splitLine: { lineStyle: { type: 'dashed', color: '#eee' } }
  555. },
  556. series: [{
  557. name: '进水',
  558. type: 'line',
  559. smooth: true,
  560. data: [320, 280, 450, 520, 480, 380],
  561. itemStyle: { color: '#409eff' },
  562. areaStyle: {
  563. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  564. { offset: 0, color: 'rgba(64, 158, 255, 0.3)' },
  565. { offset: 1, color: 'rgba(64, 158, 255, 0.05)' }
  566. ])
  567. }
  568. }, {
  569. name: '出水',
  570. type: 'line',
  571. smooth: true,
  572. data: [300, 260, 420, 480, 450, 350],
  573. itemStyle: { color: '#67c23a' },
  574. areaStyle: {
  575. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  576. { offset: 0, color: 'rgba(103, 194, 58, 0.3)' },
  577. { offset: 1, color: 'rgba(103, 194, 58, 0.05)' }
  578. ])
  579. }
  580. }]
  581. });
  582. // 水质监测分布
  583. const qualityChart = echarts.init(document.getElementById('waterQualityChart'));
  584. qualityChart.setOption({
  585. backgroundColor: 'transparent',
  586. tooltip: {
  587. trigger: 'item',
  588. backgroundColor: 'rgba(255,255,255,0.9)',
  589. borderColor: '#ddd',
  590. textStyle: { color: '#333' }
  591. },
  592. radar: {
  593. indicator: [
  594. { name: '浊度', max: 5 },
  595. { name: 'pH值', max: 14 },
  596. { name: '余氯', max: 1 },
  597. { name: '菌落', max: 100 },
  598. { name: '色度', max: 15 },
  599. { name: '嗅味', max: 3 }
  600. ],
  601. radius: '60%',
  602. splitNumber: 4,
  603. axisLine: { lineStyle: { color: '#ddd' } },
  604. splitLine: { lineStyle: { color: '#eee' } },
  605. name: { textStyle: { color: '#666' } }
  606. },
  607. series: [{
  608. type: 'radar',
  609. data: [{
  610. value: [1.2, 7.2, 0.3, 25, 3, 1],
  611. name: '当前水质',
  612. areaStyle: { color: 'rgba(64, 158, 255, 0.3)' },
  613. lineStyle: { color: '#409eff', width: 2 }
  614. }]
  615. }]
  616. });
  617. // 报警统计
  618. const alarmChart = echarts.init(document.getElementById('alarmChart'));
  619. alarmChart.setOption({
  620. backgroundColor: 'transparent',
  621. tooltip: {
  622. trigger: 'axis',
  623. axisPointer: { type: 'shadow' }
  624. },
  625. grid: {
  626. top: '60px',
  627. right: '20px',
  628. bottom: '40px',
  629. left: '60px',
  630. containLabel: true
  631. },
  632. xAxis: {
  633. type: 'category',
  634. data: ['压力报警', '水质报警', '设备报警', '漏损报警', '通讯报警'],
  635. axisLabel: { color: '#666' }
  636. },
  637. yAxis: {
  638. type: 'value',
  639. axisLabel: { color: '#666' },
  640. splitLine: { lineStyle: { type: 'dashed', color: '#eee' } }
  641. },
  642. series: [{
  643. type: 'bar',
  644. data: [12, 8, 15, 5, 3],
  645. itemStyle: {
  646. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  647. { offset: 0, color: '#f56c6c' },
  648. { offset: 1, color: '#e6a23c' }
  649. ])
  650. }
  651. }]
  652. });
  653. // 设备状态
  654. const deviceChart = echarts.init(document.getElementById('deviceStatusChart'));
  655. deviceChart.setOption({
  656. backgroundColor: 'transparent',
  657. tooltip: {
  658. trigger: 'item',
  659. formatter: '{a}<br/>{b}: {c} ({d}%)'
  660. },
  661. series: [{
  662. name: '设备状态',
  663. type: 'pie',
  664. radius: ['50%', '70%'],
  665. center: ['50%', '50%'],
  666. data: [
  667. { value: 142, name: '正常运行', itemStyle: { color: '#67c23a' } },
  668. { value: 10, name: '维护中', itemStyle: { color: '#e6a23c' } },
  669. { value: 4, name: '故障', itemStyle: { color: '#f56c6c' } },
  670. { value: 22, name: '离线', itemStyle: { color: '#909399' } }
  671. ],
  672. label: {
  673. show: true,
  674. formatter: '{b}\n{c}',
  675. color: '#666'
  676. }
  677. }]
  678. });
  679. // 营收分析
  680. const revenueChart = echarts.init(document.getElementById('revenueChart'));
  681. revenueChart.setOption({
  682. backgroundColor: 'transparent',
  683. tooltip: {
  684. trigger: 'axis'
  685. },
  686. grid: {
  687. top: '60px',
  688. right: '20px',
  689. bottom: '40px',
  690. left: '60px',
  691. containLabel: true
  692. },
  693. xAxis: {
  694. type: 'category',
  695. data: ['1月', '2月', '3月', '4月', '5月', '6月'],
  696. axisLabel: { color: '#666' }
  697. },
  698. yAxis: {
  699. type: 'value',
  700. name: '营收(万元)',
  701. axisLabel: { color: '#666' },
  702. splitLine: { lineStyle: { type: 'dashed', color: '#eee' } }
  703. },
  704. series: [{
  705. name: '营收',
  706. type: 'line',
  707. smooth: true,
  708. data: [850, 920, 980, 1050, 1120, 1200],
  709. itemStyle: { color: '#67c23a' },
  710. areaStyle: {
  711. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  712. { offset: 0, color: 'rgba(103, 194, 58, 0.3)' },
  713. { offset: 1, color: 'rgba(103, 194, 58, 0.05)' }
  714. ])
  715. }
  716. }]
  717. });
  718. // 能耗分析
  719. const energyChart = echarts.init(document.getElementById('energyChart'));
  720. energyChart.setOption({
  721. backgroundColor: 'transparent',
  722. tooltip: {
  723. trigger: 'axis'
  724. },
  725. grid: {
  726. top: '60px',
  727. right: '20px',
  728. bottom: '40px',
  729. left: '60px',
  730. containLabel: true
  731. },
  732. xAxis: {
  733. type: 'category',
  734. data: ['00:00', '04:00', '08:00', '12:00', '16:00', '20:00'],
  735. axisLabel: { color: '#666' }
  736. },
  737. yAxis: {
  738. type: 'value',
  739. name: '能耗(kWh)',
  740. axisLabel: { color: '#666' },
  741. splitLine: { lineStyle: { type: 'dashed', color: '#eee' } }
  742. },
  743. series: [{
  744. name: '能耗',
  745. type: 'line',
  746. smooth: true,
  747. data: [120, 80, 200, 180, 160, 100],
  748. itemStyle: { color: '#e6a23c' },
  749. areaStyle: {
  750. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  751. { offset: 0, color: 'rgba(230, 162, 60, 0.3)' },
  752. { offset: 1, color: 'rgba(230, 162, 60, 0.05)' }
  753. ])
  754. }
  755. }]
  756. });
  757. this.charts = {
  758. trend: trendChart,
  759. quality: qualityChart,
  760. alarm: alarmChart,
  761. device: deviceChart,
  762. revenue: revenueChart,
  763. energy: energyChart
  764. };
  765. }
  766. },
  767. mounted() {
  768. this.updateTime();
  769. setInterval(this.updateTime, 1000);
  770. this.$nextTick(() => {
  771. this.initCharts();
  772. window.addEventListener('resize', () => {
  773. Object.values(this.charts).forEach(chart => {
  774. chart && chart.resize();
  775. });
  776. });
  777. });
  778. }
  779. }).use(ElementPlus).mount('#app');
  780. </script>
  781. </body>
  782. </html>