index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886
  1. <template>
  2. <div class="table_item">
  3. <a-page-header sub-title="趋势图" @back="goBack" style="padding: 0 0 20px">
  4. <template #title>
  5. <span style="font-size: 18px; cursor: pointer" @click="goBack">返回</span>
  6. </template>
  7. </a-page-header>
  8. <div class="table_head">
  9. <div class="head_name">{{ data.regionName }}</div>
  10. <div class="head_row">
  11. <div class="label">
  12. <img src="/src/assets/images/monitor/01.png" v-if="data.sensorData && data.sensorData.temperature" />
  13. <img src="/src/assets/images/monitor/01-1.png" v-else />
  14. </div>
  15. <div class="value">
  16. <div>温度</div>
  17. <div class="num" v-if="data.sensorData && data.sensorData.temperature">
  18. {{ data.sensorData.temperature + '℃' }}
  19. </div>
  20. </div>
  21. </div>
  22. <div class="head_row">
  23. <div class="label">
  24. <img src="/src/assets/images/monitor/02.png" v-if="data.sensorData && data.sensorData.humidity" />
  25. <img src="/src/assets/images/monitor/02-2.png" v-else />
  26. </div>
  27. <div class="value">
  28. <div>湿度</div>
  29. <div class="num" v-if="data.sensorData && data.sensorData.humidity">{{ data.sensorData.humidity + '%' }}</div>
  30. </div>
  31. </div>
  32. <div class="head_row">
  33. <div class="label">
  34. <img src="/src/assets/images/monitor/03.png" v-if="data.sensorData && data.sensorData.co2" />
  35. <img src="/src/assets/images/monitor/03-3.png" v-else />
  36. </div>
  37. <div class="value">
  38. <div>二氧化碳</div>
  39. <div class="num" v-if="data.sensorData && data.sensorData.co2">{{ data.sensorData.co2 + 'ppm' }}</div>
  40. </div>
  41. </div>
  42. <div class="head_time">
  43. {{ '更新时间 :' + data.updateTime }}
  44. </div>
  45. </div>
  46. <div class="table_search">
  47. <div class="search_left">
  48. <span>查询范围:</span>
  49. <a-range-picker
  50. v-model:value="timeValue"
  51. style="width: 250px"
  52. format="YYYY-MM-DD"
  53. value-format="YYYY-MM-DD"
  54. :disabled-date="disabledDate"
  55. :allowClear="false"
  56. @change="getEchartData"
  57. />
  58. <a-radio-group v-model:value="periodValue" button-style="solid">
  59. <a-radio-button value="week">最近一周</a-radio-button>
  60. <a-radio-button value="halfaMonth">最近半月</a-radio-button>
  61. <a-radio-button value="oneMonth">最近一月</a-radio-button>
  62. <a-radio-button value="threeMonths">最近三月</a-radio-button>
  63. </a-radio-group>
  64. </div>
  65. <div class="search_right">
  66. <span>数据维度:</span>
  67. <a-radio-group v-model:value="radioValue" button-style="solid">
  68. <a-radio-button value="null">系统默认</a-radio-button>
  69. <a-radio-button value="1m">分钟</a-radio-button>
  70. <a-radio-button value="1h">小时</a-radio-button>
  71. <a-radio-button value="1d">天</a-radio-button>
  72. <a-radio-button value="1w">自然周</a-radio-button>
  73. <a-radio-button value="1mo">月度</a-radio-button>
  74. <a-radio-button value="3mo">季度</a-radio-button>
  75. </a-radio-group>
  76. <a-button class="xn-mg08">
  77. <template #icon><download-outlined /></template>导出
  78. </a-button>
  79. </div>
  80. </div>
  81. <!-- 折线图 -->
  82. <div class="chart">
  83. <div class="echart" id="temperature"></div>
  84. <div class="echart" id="humidity"></div>
  85. <div class="echart" id="CO2"></div>
  86. </div>
  87. </div>
  88. </template>
  89. <script setup>
  90. import * as echarts from 'echarts'
  91. import alarmTrendApi from '@/api/coldchain/alarmTrendApi.js'
  92. import { useRoute } from 'vue-router'
  93. import router from '@/router'
  94. import dayjs from 'dayjs' // 用于处理日期和时间
  95. const Route = useRoute()
  96. const queryValue = ref({}) //监控对象的参数
  97. const radioValue = ref('null') //时间段
  98. const data = ref({})
  99. const periodValue = ref('week')
  100. const timeValue = ref([])
  101. onBeforeMount(() => {
  102. calculateDateRange()
  103. if (Route.query.id) {
  104. queryValue.value = { ...Route.query }
  105. }
  106. })
  107. onMounted(() => {
  108. if (queryValue.value.id) {
  109. getData()
  110. getEchartData()
  111. }
  112. })
  113. // 监听 查询范围 变化,重新计算日期范围
  114. watch(periodValue, () => {
  115. calculateDateRange()
  116. getEchartData()
  117. })
  118. // 监听 数据维度 变化,重新计算日期范围
  119. watch(radioValue, () => {
  120. getEchartData()
  121. })
  122. // 计算时间范围
  123. const calculateDateRange = () => {
  124. const now = new Date()
  125. let startDate
  126. const endDate = new Date(now)
  127. endDate.setHours(23, 59, 59, 999) // 设置结束时间为当天的23:59:59
  128. // 根据不同的选择设置开始时间
  129. switch (periodValue.value) {
  130. case 'week':
  131. startDate = new Date(now)
  132. startDate.setDate(now.getDate() - 6) // 最近一周
  133. break
  134. case 'halfaMonth':
  135. startDate = new Date(now)
  136. startDate.setDate(now.getDate() - 14) // 最近半个月
  137. break
  138. case 'oneMonth':
  139. startDate = new Date(now)
  140. startDate.setMonth(now.getMonth() - 1) // 最近一个月
  141. break
  142. case 'threeMonths':
  143. startDate = new Date(now)
  144. startDate.setMonth(now.getMonth() - 3) // 最近三个月
  145. break
  146. default:
  147. startDate = new Date(now) // 默认值是今天
  148. }
  149. startDate.setHours(0, 0, 0, 0) // 设置开始时间为当天的00:00:00
  150. timeValue.value = [formatDate(startDate), formatDate(endDate)]
  151. }
  152. const today = dayjs() // 获取当前时间和90天前的时间
  153. const ninetyDaysAgo = today.subtract(90, 'day') // 90天前的日期
  154. // 禁用超过90天之前的日期和今天之后的日期
  155. const disabledDate = (current) => {
  156. if (!current) return false
  157. // 禁用当前日期早于90天之前的日期或今天之后的日期
  158. return current.isBefore(ninetyDaysAgo, 'day') || current.isAfter(today, 'day')
  159. }
  160. // 格式化日期为 "YYYY-MM-DD"
  161. const formatDate = (date) => {
  162. const year = date.getFullYear()
  163. const month = String(date.getMonth() + 1).padStart(2, '0')
  164. const day = String(date.getDate()).padStart(2, '0')
  165. return `${year}-${month}-${day}`
  166. }
  167. // 获取基础信息
  168. const getData = () => {
  169. const parameter = {
  170. deviceId: queryValue.value.id,
  171. roads: queryValue.value.roads
  172. }
  173. alarmTrendApi.realTimeData(parameter).then((res) => {
  174. data.value = res
  175. })
  176. }
  177. // 获取折线图数据
  178. const getEchartData = () => {
  179. const parameter = {
  180. deviceId: queryValue.value.id,
  181. roads: queryValue.value.roads,
  182. startTime: timeValue.value[0],
  183. endTime: timeValue.value[1],
  184. aggregationWindow: radioValue.value === 'null' ? null : radioValue.value
  185. }
  186. alarmTrendApi
  187. .pointDataTrend(parameter)
  188. .then((res) => {
  189. if (res) {
  190. // 温度
  191. if (
  192. res.sensorEchartDataResult.temperature &&
  193. res.sensorEchartDataResult.temperature.x &&
  194. res.sensorEchartDataResult.temperature.x.length
  195. ) {
  196. getEcharts1({
  197. up: res.temperatureUp,
  198. down: res.temperatureDown,
  199. data: res.sensorEchartDataResult.temperature
  200. })
  201. }
  202. // 湿度
  203. if (
  204. res.sensorEchartDataResult.humidity &&
  205. res.sensorEchartDataResult.humidity.x &&
  206. res.sensorEchartDataResult.humidity.x.length
  207. ) {
  208. getEcharts2({
  209. up: res.humidityUp,
  210. down: res.humidityDown,
  211. data: res.sensorEchartDataResult.humidity
  212. })
  213. }
  214. // co2
  215. if (
  216. res.sensorEchartDataResult.co2 &&
  217. res.sensorEchartDataResult.co2.x &&
  218. res.sensorEchartDataResult.co2.x.length
  219. ) {
  220. getEcharts3({
  221. up: res.co2Up,
  222. down: res.co2Down,
  223. data: res.sensorEchartDataResult.co2
  224. })
  225. }
  226. }
  227. })
  228. .finally(() => {})
  229. }
  230. // 温度
  231. const getEcharts1 = (val) => {
  232. let EchartsA = echarts.init(document.getElementById('temperature'))
  233. const option = {
  234. tooltip: {
  235. trigger: 'axis',
  236. axisPointer: {
  237. type: 'cross',
  238. crossStyle: {
  239. color: '#999'
  240. },
  241. label: {
  242. show: false
  243. }
  244. },
  245. formatter: function (params) {
  246. let date = params[0].axisValueLabel
  247. let value = params[0].value
  248. return `${date}<br/>温度 :${value} °C`
  249. }
  250. },
  251. grid: {
  252. top: '15%',
  253. left: '5%',
  254. right: '7%',
  255. bottom: '25%'
  256. },
  257. xAxis: {
  258. type: 'category',
  259. data: val.data.x,
  260. axisLine: {
  261. show: true,
  262. lineStyle: {
  263. color: '#7e848e'
  264. }
  265. },
  266. axisLabel: {
  267. color: '#A1A7B3',
  268. interval: 0,
  269. rotate: '10'
  270. },
  271. axisTick: {
  272. show: false
  273. },
  274. splitLine: {
  275. show: true
  276. },
  277. name: '日期',
  278. nameTextStyle: {
  279. color: '#484848',
  280. fontSize: 14,
  281. fontWeight: 'bold'
  282. }
  283. },
  284. yAxis: {
  285. type: 'value',
  286. scale: true,
  287. minInterval: 1,
  288. axisLabel: {
  289. formatter: '{value} °C'
  290. },
  291. splitLine: {
  292. show: true
  293. },
  294. name: '温度',
  295. nameTextStyle: {
  296. color: '#484848',
  297. fontSize: 14,
  298. fontWeight: 'bold',
  299. align: 'left',
  300. padding: [0, 0, 0, -50]
  301. }
  302. },
  303. dataZoom: [
  304. {
  305. show: true,
  306. height: 10,
  307. xAxisIndex: [0],
  308. left: '10%',
  309. right: '10%',
  310. bottom: '6%',
  311. start: 70,
  312. end: 100,
  313. handleIcon:
  314. 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
  315. handleSize: '110%',
  316. handleStyle: {
  317. color: '#d3dee5'
  318. },
  319. textStyle: {
  320. color: '#000'
  321. },
  322. borderColor: '#90979c'
  323. },
  324. {
  325. type: 'inside',
  326. show: true,
  327. height: 15,
  328. start: 1,
  329. end: 35
  330. }
  331. ],
  332. series: [
  333. {
  334. name: '温度',
  335. data: val.data.y,
  336. type: 'line',
  337. symbol: 'circle',
  338. lineStyle: {
  339. color: '#4362f0',
  340. cap: 'round'
  341. },
  342. itemStyle: {
  343. normal: {
  344. color: 'transparent',
  345. borderColor: '#4362f0',
  346. borderWidth: 3
  347. }
  348. },
  349. areaStyle: {
  350. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  351. {
  352. offset: 0,
  353. color: '#4362f0'
  354. },
  355. {
  356. offset: 1,
  357. color: '#fff'
  358. }
  359. ])
  360. },
  361. symbolSize: 6,
  362. label: {
  363. show: false
  364. },
  365. markLine: {
  366. data: [
  367. {
  368. name: '温度上限',
  369. yAxis: val.up,
  370. lineStyle: {
  371. color: '#f3956e',
  372. width: 2,
  373. type: 'solid',
  374. shadowColor: 'rgba(243, 149, 110, 1)',
  375. shadowBlur: 5
  376. },
  377. label: {
  378. formatter: '温度上限: {c}°C',
  379. color: '#f3956e'
  380. }
  381. },
  382. {
  383. name: '温度下限',
  384. yAxis: val.down,
  385. lineStyle: {
  386. color: '#41b982',
  387. width: 2,
  388. type: 'solid',
  389. shadowColor: 'rgba(4, 188, 111, 1)',
  390. shadowBlur: 5
  391. },
  392. label: {
  393. formatter: '温度下限: {c}°C',
  394. color: '#41b982'
  395. }
  396. }
  397. ]
  398. }
  399. }
  400. ]
  401. }
  402. // 绘制图表
  403. EchartsA.setOption(option)
  404. // 自适应大小
  405. EchartsA.resize()
  406. window.addEventListener('resize', () => {
  407. EchartsA.resize()
  408. })
  409. }
  410. // 湿度
  411. const getEcharts2 = (val) => {
  412. let EchartsB = echarts.init(document.getElementById('humidity'))
  413. const option = {
  414. tooltip: {
  415. trigger: 'axis',
  416. axisPointer: {
  417. type: 'cross',
  418. crossStyle: {
  419. color: '#999'
  420. },
  421. label: {
  422. show: false
  423. }
  424. },
  425. formatter: function (params) {
  426. let date = params[0].axisValueLabel
  427. let value = params[0].value
  428. return `${date}<br/>湿度 :${value} %`
  429. }
  430. },
  431. grid: {
  432. top: '15%',
  433. left: '5%',
  434. right: '7%',
  435. bottom: '25%'
  436. },
  437. xAxis: {
  438. type: 'category',
  439. data: val.data.x,
  440. axisLine: {
  441. show: true,
  442. lineStyle: {
  443. color: '#7e848e'
  444. }
  445. },
  446. axisTick: {
  447. show: false
  448. },
  449. splitLine: {
  450. show: true
  451. },
  452. axisLabel: {
  453. color: '#A1A7B3',
  454. interval: 0,
  455. rotate: '10'
  456. },
  457. name: '日期',
  458. nameTextStyle: {
  459. color: '#484848',
  460. fontSize: 14,
  461. fontWeight: 'bold'
  462. }
  463. },
  464. yAxis: {
  465. type: 'value',
  466. scale: true,
  467. minInterval: 1,
  468. axisLabel: {
  469. formatter: '{value} %'
  470. },
  471. splitLine: {
  472. show: true
  473. },
  474. name: '湿度',
  475. nameLocation: 'end',
  476. nameGap: 15,
  477. nameTextStyle: {
  478. color: '#484848',
  479. fontSize: 14,
  480. fontWeight: 'bold',
  481. align: 'left',
  482. padding: [0, 0, 0, -50]
  483. }
  484. },
  485. dataZoom: [
  486. {
  487. show: true,
  488. height: 10,
  489. xAxisIndex: [0],
  490. left: '10%',
  491. right: '10%',
  492. bottom: '6%',
  493. start: 70,
  494. end: 100,
  495. handleIcon:
  496. 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
  497. handleSize: '110%',
  498. handleStyle: {
  499. color: '#d3dee5'
  500. },
  501. textStyle: {
  502. color: '#000'
  503. },
  504. borderColor: '#90979c'
  505. },
  506. {
  507. type: 'inside',
  508. show: true,
  509. height: 15,
  510. start: 1,
  511. end: 35
  512. }
  513. ],
  514. series: [
  515. {
  516. name: '湿度',
  517. data: val.data.y,
  518. type: 'line',
  519. symbol: 'circle',
  520. lineStyle: {
  521. color: '#11def7',
  522. cap: 'round'
  523. },
  524. itemStyle: {
  525. normal: {
  526. color: 'transparent',
  527. borderColor: '#11def7',
  528. borderWidth: 3
  529. }
  530. },
  531. areaStyle: {
  532. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  533. {
  534. offset: 0,
  535. color: '#11def7'
  536. },
  537. {
  538. offset: 1,
  539. color: '#fff'
  540. }
  541. ])
  542. },
  543. symbolSize: 6,
  544. label: {
  545. show: false
  546. },
  547. markLine: {
  548. data: [
  549. {
  550. name: '湿度上限',
  551. yAxis: val.up,
  552. lineStyle: {
  553. color: '#f3956e',
  554. width: 2,
  555. type: 'solid',
  556. shadowColor: 'rgba(243, 149, 110, 1)',
  557. shadowBlur: 5
  558. },
  559. label: {
  560. formatter: '湿度上限: {c}%',
  561. color: '#f3956e'
  562. }
  563. },
  564. {
  565. name: '湿度下限',
  566. yAxis: val.down,
  567. lineStyle: {
  568. color: '#41b982',
  569. width: 2,
  570. type: 'solid',
  571. shadowColor: 'rgba(4, 188, 111, 1)',
  572. shadowBlur: 5
  573. },
  574. label: {
  575. formatter: '湿度下限: {c}%',
  576. color: '#41b982'
  577. }
  578. }
  579. ]
  580. }
  581. }
  582. ]
  583. }
  584. // 绘制图表
  585. EchartsB.setOption(option)
  586. // 自适应大小
  587. EchartsB.resize()
  588. window.addEventListener('resize', () => {
  589. EchartsB.resize()
  590. })
  591. }
  592. // CO2
  593. const getEcharts3 = (val) => {
  594. let EchartsC = echarts.init(document.getElementById('CO2'))
  595. const option = {
  596. tooltip: {
  597. trigger: 'axis',
  598. axisPointer: {
  599. type: 'cross',
  600. crossStyle: {
  601. color: '#999'
  602. },
  603. label: {
  604. show: false
  605. }
  606. },
  607. formatter: function (params) {
  608. let date = params[0].axisValueLabel
  609. let value = params[0].value
  610. return `${date}<br/>二氧化碳 :${value} ppm`
  611. }
  612. },
  613. grid: {
  614. top: '15%',
  615. left: '5%',
  616. right: '7%',
  617. bottom: '25%'
  618. },
  619. xAxis: {
  620. type: 'category',
  621. data: val.data.x,
  622. axisLine: {
  623. show: true,
  624. lineStyle: {
  625. color: '#7e848e'
  626. }
  627. },
  628. axisLabel: {
  629. color: '#A1A7B3',
  630. interval: 0,
  631. rotate: '10'
  632. },
  633. axisTick: {
  634. show: false
  635. },
  636. splitLine: {
  637. show: true
  638. },
  639. name: '日期',
  640. nameTextStyle: {
  641. color: '#484848',
  642. fontSize: 14,
  643. fontWeight: 'bold'
  644. }
  645. },
  646. yAxis: {
  647. type: 'value',
  648. scale: true,
  649. minInterval: 1,
  650. axisLabel: {
  651. formatter: '{value} ppm'
  652. },
  653. splitLine: {
  654. show: true
  655. },
  656. name: '二氧化碳',
  657. nameLocation: 'end',
  658. nameGap: 15,
  659. nameTextStyle: {
  660. color: '#484848',
  661. fontSize: 14,
  662. fontWeight: 'bold',
  663. align: 'left',
  664. padding: [0, 0, 0, -50]
  665. }
  666. },
  667. dataZoom: [
  668. {
  669. show: true,
  670. height: 10,
  671. xAxisIndex: [0],
  672. left: '10%',
  673. right: '10%',
  674. bottom: '6%',
  675. start: 70,
  676. end: 100,
  677. handleIcon:
  678. 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
  679. handleSize: '110%',
  680. handleStyle: {
  681. color: '#d3dee5'
  682. },
  683. textStyle: {
  684. color: '#000'
  685. },
  686. borderColor: '#90979c'
  687. },
  688. {
  689. type: 'inside',
  690. show: true,
  691. height: 15,
  692. start: 1,
  693. end: 35
  694. }
  695. ],
  696. series: [
  697. {
  698. name: '二氧化碳',
  699. data: val.data.y,
  700. type: 'line',
  701. symbol: 'circle',
  702. lineStyle: {
  703. color: '#7f3fd5',
  704. cap: 'round'
  705. },
  706. itemStyle: {
  707. normal: {
  708. color: 'transparent',
  709. borderColor: '#7f3fd5',
  710. borderWidth: 3
  711. }
  712. },
  713. areaStyle: {
  714. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  715. {
  716. offset: 0,
  717. color: '#7f3fd5'
  718. },
  719. {
  720. offset: 1,
  721. color: '#fff'
  722. }
  723. ])
  724. },
  725. symbolSize: 6,
  726. label: {
  727. show: false
  728. },
  729. markLine: {
  730. data: [
  731. {
  732. name: '二氧化碳上限',
  733. yAxis: val.up,
  734. lineStyle: {
  735. color: '#f3956e',
  736. width: 2,
  737. type: 'solid',
  738. shadowColor: 'rgba(243, 149, 110, 1)',
  739. shadowBlur: 5
  740. },
  741. label: {
  742. formatter: '二氧化碳上限: {c}ppm',
  743. color: '#f3956e'
  744. }
  745. },
  746. {
  747. name: '二氧化碳下限',
  748. yAxis: val.down,
  749. lineStyle: {
  750. color: '#41b982',
  751. width: 2,
  752. type: 'solid',
  753. shadowColor: 'rgba(4, 188, 111, 1)',
  754. shadowBlur: 5
  755. },
  756. label: {
  757. formatter: '二氧化碳下限: {c}ppm',
  758. color: '#41b982'
  759. }
  760. }
  761. ]
  762. }
  763. }
  764. ]
  765. }
  766. // 绘制图表
  767. EchartsC.setOption(option)
  768. // 自适应大小
  769. EchartsC.resize()
  770. window.addEventListener('resize', () => {
  771. EchartsC.resize()
  772. })
  773. }
  774. // 返回上一页
  775. const goBack = () => {
  776. router.go(-1)
  777. }
  778. </script>
  779. <style lang="less" scoped>
  780. .table_item {
  781. padding: 15px 20px;
  782. background-color: #ffffff;
  783. .table_head {
  784. width: 100%;
  785. height: 100px;
  786. padding: 0 10px;
  787. background-image: url('/src/assets/images/monitor/bg.png');
  788. background-size: cover;
  789. background-position: center;
  790. border-radius: 10px;
  791. display: flex;
  792. align-items: center;
  793. .head_name,
  794. .head_time {
  795. flex: 2;
  796. text-align: center;
  797. white-space: nowrap;
  798. overflow: hidden;
  799. text-overflow: ellipsis;
  800. }
  801. .head_name {
  802. font-size: 20px;
  803. font-weight: bold;
  804. color: #4362f0;
  805. }
  806. .head_row {
  807. flex: 3;
  808. display: flex;
  809. align-items: center;
  810. justify-content: center;
  811. .label {
  812. img {
  813. width: 50px;
  814. height: 50px;
  815. }
  816. }
  817. .value {
  818. padding: 0 20px;
  819. display: flex;
  820. align-items: center;
  821. .num {
  822. font-weight: bold;
  823. font-size: 26px;
  824. padding: 0 20px;
  825. width: 180px;
  826. white-space: nowrap;
  827. overflow: hidden;
  828. text-overflow: ellipsis;
  829. }
  830. }
  831. }
  832. }
  833. .table_search {
  834. width: 100%;
  835. margin: 20px 0;
  836. display: flex;
  837. align-items: center;
  838. justify-content: space-between;
  839. .search_left {
  840. :deep(.ant-radio-button-wrapper) {
  841. margin: 0 10px;
  842. }
  843. }
  844. }
  845. // 图表
  846. .chart {
  847. width: 100%;
  848. height: 950px;
  849. .echart {
  850. width: 100%;
  851. height: 30%;
  852. margin-bottom: 50px;
  853. }
  854. }
  855. }
  856. </style>