workerFace.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. <template>
  2. <div class="center-container">
  3. <div class="lr-box left-box">
  4. <!-- <div class="container-title">
  5. <a-select class="title-select" ref="select" v-model:value="currentTitleValue" @change="handleTitleChange">
  6. <a-select-option value="2">15212工作面</a-select-option>
  7. <a-select-option value="1598491318007898113">采煤工作面</a-select-option>
  8. <a-select-option value="3">掘进工作面</a-select-option>
  9. </a-select>
  10. </div> -->
  11. <div class="item">
  12. <dv-decoration7 style="height: 30px">
  13. <div class="base-title">监测信息</div>
  14. </dv-decoration7>
  15. <div class="need-air-group vent-flex-row">
  16. <div class="air-box">
  17. <div class="title">总进风量</div>
  18. <div class="air-num">10000</div>
  19. </div>
  20. <div class="air-box">
  21. <div class="title">总回风量</div>
  22. <div class="air-num">80000</div>
  23. </div>
  24. <div class="air-box">
  25. <div class="title">总需风量</div>
  26. <div class="air-num">90000</div>
  27. </div>
  28. </div>
  29. <div class="item-container">
  30. <BarAndLineCustom xAxisPropType="time" :chartData="monitorData" height="240px" :propTypeArr="['jin', 'hui']" :option="echartsOption" />
  31. </div>
  32. </div>
  33. <div class="item">
  34. <dv-decoration7 style="height: 30px">
  35. <div class="base-title">基本信息</div>
  36. </dv-decoration7>
  37. <div class="base-information-box">
  38. <div class="base-information">
  39. <div v-for="(device, index) in workerFaceDeviceList" :key="index" class="device-num-box">
  40. <div class="icon"></div>
  41. <div class="text-box">
  42. <div class="title">{{ device.title }}</div>
  43. <div class="value">{{ device.value }}套</div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="lr-box right-box">
  51. <div class="warning-box">
  52. <dv-decoration7 style="height: 30px">
  53. <div class="base-title">报警信息</div>
  54. </dv-decoration7>
  55. <div class="warning-top">
  56. <div class="warning-icon">
  57. <div class="title">告警信息</div>
  58. <div class="num-box">
  59. <div class="num">20</div>
  60. <div class="rate-box">
  61. <div class="day-rate">日环比: +2%</div>
  62. <div class="week-rate">周环比: +2%</div>
  63. <div class="moth-rate">月环比: +2%</div>
  64. </div>
  65. </div>
  66. </div>
  67. <div class="warning-icon">
  68. <div class="title">预警信息</div>
  69. <div class="num-box">
  70. <div class="num">20</div>
  71. <div class="rate-box">
  72. <div class="day-rate">日环比: +2%</div>
  73. <div class="week-rate">周环比: +2%</div>
  74. <div class="moth-rate">月环比: +2%</div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="warning-monitor">
  81. <dv-scroll-board ref="scrollBoard" :config="warningConfig" style="width: 100%; height: 220px" />
  82. </div>
  83. <div class="device-monitor-box">
  84. <dv-decoration7 style="height: 30px">
  85. <div class="base-title">设备信息</div>
  86. </dv-decoration7>
  87. <div class="device-btn-group">
  88. <div
  89. v-for="deviceType in deviceTypes"
  90. class="device-btn"
  91. :class="{ 'device-active': deviceActive === deviceType.type }"
  92. :key="deviceType.type"
  93. @click="showDeviceMonitor(deviceType)"
  94. >{{ deviceType.text }}</div
  95. >
  96. </div>
  97. <div class="device-table" :class="{ 'device-table-open': deviceActive, 'device-table-close': !deviceActive }">
  98. <div class="vent-flex-row device-tab">
  99. <div class="tab tab-active">设备监测</div>
  100. <a-divider type="vertical" style="height: 10px; background-color: #aaa" />
  101. <div class="tab">历史信息</div>
  102. </div>
  103. <div class="device-animation">
  104. <MonitorTable
  105. class="monitor-table"
  106. :columnsType="deviceColumnsType"
  107. :dataSource="deviceMonitorData"
  108. title="风门监测"
  109. :isShowSelect="false"
  110. :isShowPagination="true"
  111. :isShowActionColumn="true"
  112. :scroll="{ y: 160 }"
  113. >
  114. <template #filterCell="{ column, record }">
  115. <template v-if="record.frontGateOpenCtrl">
  116. <a-tag v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0" color="red"
  117. >正在打开</a-tag
  118. >
  119. <a-tag v-else-if="column.dataIndex === 'frontGateOpen'" color="processing">打开</a-tag>
  120. </template>
  121. <template v-else>
  122. <a-tag v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0" color="red"
  123. >正在关闭</a-tag
  124. >
  125. <a-tag v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 1" color="default"
  126. >关闭</a-tag
  127. >
  128. <a-tag v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 1 && record.frontGateClose == 0" color="default"
  129. >打开</a-tag
  130. >
  131. </template>
  132. <template v-if="record.rearGateOpenCtrl">
  133. <a-tag v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0" color="red"
  134. >正在打开</a-tag
  135. >
  136. <a-tag v-else-if="column.dataIndex === 'rearGateOpen'" color="processing">打开</a-tag>
  137. </template>
  138. <template v-else>
  139. <a-tag v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0" color="red"
  140. >正在关闭</a-tag
  141. >
  142. <a-tag v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 1" color="default"
  143. >关闭</a-tag
  144. >
  145. <a-tag v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 1 && record.rearGateClose == 0" color="default"
  146. >打开</a-tag
  147. >
  148. </template>
  149. <a-tag v-if="column.dataIndex === 'warnFlag'" :color="record.warnFlag == 0 ? 'green' : 'red'">{{
  150. record.warnFlag == 0 ? '正常' : '报警'
  151. }}</a-tag>
  152. <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == 0 ? 'default' : 'green'">{{
  153. record.netStatus == 0 ? '断开' : '连接'
  154. }}</a-tag>
  155. </template>
  156. <template #action="{ record }">
  157. <TableAction
  158. :actions="[
  159. {
  160. label: '详情',
  161. onClick: goDetail.bind(null, record),
  162. },
  163. {
  164. label: '定位',
  165. onClick: goDetail.bind(null, record),
  166. },
  167. ]"
  168. />
  169. </template>
  170. </MonitorTable>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. </template>
  177. <script lang="ts" setup>
  178. import { TableAction } from '/@/components/Table';
  179. import { onMounted, onUnmounted, ref, reactive } from 'vue';
  180. import { Decoration7 as DvDecoration7, ScrollBoard as DvScrollBoard, BorderBox7 as DvBorderBox7 } from '@kjgl77/datav-vue3';
  181. import { workerFaceDeviceList } from '../home.data';
  182. import BarAndLineCustom from '/@/components/chart/BarAndLineCustom.vue';
  183. import { list, deviceMonitor } from '../home.api';
  184. import echarts from '/@/utils/lib/echarts';
  185. import MonitorTable from '/@/views/vent/monitorManager/comment/MonitorTable.vue';
  186. const currentTitleValue = ref('2'); // 监测工作面id
  187. const monitorData = ref([]); // 存放监测数据
  188. const echartsOption = reactive({
  189. tooltip: { trigger: 'axis', axisPointer: { lineStyle: { color: '#fff' } } },
  190. legend: {
  191. top: '10',
  192. icon: 'rect',
  193. // itemWidth: 14, itemHeight: 5, itemGap: 10,
  194. data: ['进风', '回风'],
  195. right: '10px',
  196. textStyle: { fontSize: 12, color: '#fff' },
  197. },
  198. grid: { x: 50, y: 50, x2: 12, y2: 40 },
  199. xAxis: {
  200. type: 'category',
  201. boundaryGap: false,
  202. axisLine: { lineStyle: { color: '#57617B' } },
  203. axisLabel: { textStyle: { color: '#ffffffcc' } },
  204. splitLine: { show: true, lineStyle: { color: '#57617B22', type: 'dashed' } },
  205. data: [],
  206. },
  207. yAxis: [
  208. {
  209. type: 'value',
  210. name: 'm³/min',
  211. axisTick: {
  212. show: false,
  213. },
  214. axisLine: { lineStyle: { show: true, color: '#57617B' } },
  215. axisLabel: { margin: 10, textStyle: { fontSize: 12, color: '#ffffffcc' } },
  216. splitLine: { show: true, lineStyle: { color: '#57617B22', type: 'dashed' } },
  217. },
  218. ],
  219. series: [
  220. {
  221. name: '进风',
  222. type: 'line',
  223. smooth: true,
  224. lineStyle: { width: 2 },
  225. yAxisIndex: 0,
  226. areaStyle: {
  227. color: new echarts.graphic.LinearGradient(
  228. 0,
  229. 0,
  230. 0,
  231. 1,
  232. [
  233. {
  234. offset: 0,
  235. color: 'rgba(185,150,248,0.3)',
  236. },
  237. {
  238. offset: 0.8,
  239. color: 'rgba(185,150,248,0)',
  240. },
  241. ],
  242. false
  243. ),
  244. shadowColor: 'rgba(0, 0, 0, 0.1)',
  245. shadowBlur: 10,
  246. },
  247. itemStyle: { color: '#B996F8' },
  248. data: [],
  249. },
  250. {
  251. name: '回风',
  252. type: 'line',
  253. smooth: true,
  254. lineStyle: { width: 2 },
  255. yAxisIndex: 0,
  256. areaStyle: {
  257. color: new echarts.graphic.LinearGradient(
  258. 0,
  259. 0,
  260. 0,
  261. 1,
  262. [
  263. {
  264. offset: 0,
  265. color: 'rgba(3, 194, 236, 0.3)',
  266. },
  267. {
  268. offset: 0.8,
  269. color: 'rgba(3, 194, 236, 0)',
  270. },
  271. ],
  272. false
  273. ),
  274. shadowColor: 'rgba(0, 0, 0, 0.1)',
  275. shadowBlur: 10,
  276. },
  277. itemStyle: { color: '#03C2EC' },
  278. data: [],
  279. },
  280. ],
  281. });
  282. const warningConfig = reactive({
  283. data: [
  284. ['15211辅运顺槽', '测风装置', '异常信息'],
  285. ['2-2煤辅运大巷4联巷对面胶运联巷', '气源压力', '异常信息'],
  286. ['3-1煤回风延伸', '平均风速', '异常信息'],
  287. ['2-4煤辅运大巷水仓', '风门', '异常信息'],
  288. ['4-2煤南部集中回风二联巷', '测风装置', '异常信息'],
  289. ['5-2煤回风大巷西侧', '测风装置', '异常信息'],
  290. ['2-2煤辅运大巷三联巷', '风门', '异常信息'],
  291. ['利民风窗', '风窗', '异常信息'],
  292. ],
  293. index: false,
  294. columnWidth: [150],
  295. oddRowBGC: '#003B5155',
  296. evenRowBGC: '#0A273255',
  297. align: ['center', 'center', 'center'],
  298. });
  299. // 监测设备类型集合
  300. const deviceTypes = ref([
  301. {
  302. text: '风门',
  303. type: 'gate_normal',
  304. columnsType: 'gate_monitor',
  305. },
  306. {
  307. text: '风窗',
  308. type: 'window_normal',
  309. columnsType: 'window_monitor',
  310. },
  311. {
  312. text: '测风装置',
  313. type: 'windrect_rect',
  314. columnsType: 'windrect_monitor',
  315. },
  316. ]);
  317. const deviceActive = ref(''); //当前监测的设备
  318. const deviceColumnsType = ref(''); //存放当前监测的Columns的key值
  319. const deviceMonitorData = ref([]); //存放监测的数据集合
  320. // const deviceType =
  321. // 标题选择
  322. function handleTitleChange() {
  323. //
  324. }
  325. function showDeviceMonitor(deviceType) {
  326. if (deviceActive.value === deviceType.type) {
  327. deviceActive.value = '';
  328. } else {
  329. deviceColumnsType.value = deviceType.columnsType;
  330. deviceActive.value = deviceType.type;
  331. }
  332. }
  333. let timer: null | NodeJS.Timeout | undefined = null;
  334. function getMonitor() {
  335. if (timer == null) {
  336. timer = setTimeout(async () => {
  337. // 首页监测
  338. const result = await list({});
  339. if (result) {
  340. const list = result['sys_surface'];
  341. const currentObj = list.find((item) => {
  342. return item.deviceID == currentTitleValue.value;
  343. });
  344. if (currentObj) {
  345. monitorData.value = currentObj['history'];
  346. }
  347. }
  348. // 设备监测
  349. const deviceMonitorList = await deviceMonitor({ devicetype: 'sys', pagetype: 'normal', systemID: '2' });
  350. deviceMonitorList.forEach((item) => {
  351. if (item['msgTxt']['type'] === deviceActive.value) {
  352. deviceMonitorData.value = item['msgTxt']['datalist'];
  353. }
  354. });
  355. if (timer) {
  356. timer = null;
  357. }
  358. getMonitor();
  359. }, 1000);
  360. }
  361. }
  362. function goDetail() {}
  363. onMounted(() => {
  364. getMonitor();
  365. });
  366. onUnmounted(() => {
  367. if (timer) timer = undefined;
  368. });
  369. </script>
  370. <style lang="less" scoped>
  371. @ventSpace: zxm;
  372. .center-container {
  373. width: 100%;
  374. height: calc(100% - 100px);
  375. display: flex;
  376. justify-content: space-between;
  377. position: absolute;
  378. top: 90px;
  379. .lr-box {
  380. height: 100%;
  381. width: 347px;
  382. color: #fff;
  383. display: flex;
  384. flex-direction: column;
  385. pointer-events: auto;
  386. // .container-title {
  387. // width: 398px;
  388. // height: 34px;
  389. // position: relative;
  390. // top: -30px;
  391. // background: url('/@/assets/images/vent/new-home/container-title-bg.png') no-repeat;
  392. // background-size: contain;
  393. // padding: 0 0 0 180px;
  394. // font-size: 20px;
  395. // pointer-events: auto;
  396. // position: relative;
  397. // .title-select {
  398. // width: 198px;
  399. // position: absolute;
  400. // top: 0;
  401. // left: 180px;
  402. // }
  403. // }
  404. .item {
  405. // flex: 1;
  406. width: 100%;
  407. display: flex;
  408. justify-content: center;
  409. flex-direction: column;
  410. margin-bottom: 20px;
  411. align-items: center;
  412. .item-container {
  413. width: 100%;
  414. height: 100%;
  415. }
  416. }
  417. .need-air-group {
  418. width: calc(100% - 20px);
  419. display: flex;
  420. justify-content: space-between;
  421. border: 1px solid #20dbfd22;
  422. box-shadow: 0 0 5px #00d8ff22 inset;
  423. padding: 10px;
  424. margin: 10px 10px 0 10px;
  425. .air-box {
  426. display: flex;
  427. flex-direction: column;
  428. justify-content: center;
  429. align-items: center;
  430. .title {
  431. margin-left: 5px;
  432. }
  433. .air-num {
  434. font-family: 'numberFont';
  435. color: #20dbfd;
  436. text-shadow: 0 0 25px #00d8ff;
  437. font-size: 28px;
  438. font-weight: bolder;
  439. }
  440. }
  441. }
  442. .base-title {
  443. width: calc(100% - 60px);
  444. text-align: center;
  445. color: #00d8ff;
  446. }
  447. .base-information-box {
  448. display: flex;
  449. margin-left: 5px;
  450. .base-information {
  451. display: flex;
  452. flex-direction: row;
  453. flex-wrap: wrap;
  454. .device-num-box {
  455. width: 170px;
  456. height: 82px;
  457. background: url('/@/assets/images/vent/new-home/num-bg.png') no-repeat;
  458. background-size: contain;
  459. margin: 5px 0px;
  460. position: relative;
  461. .icon {
  462. position: absolute;
  463. width: 40px;
  464. height: 40px;
  465. background: url('/@/assets/images/vent/new-home/base-icon1.png') no-repeat;
  466. background-size: contain;
  467. top: 22px;
  468. left: 16px;
  469. }
  470. .text-box {
  471. height: 100%;
  472. margin-left: 70px;
  473. display: flex;
  474. justify-content: center;
  475. flex-direction: column;
  476. margin-top: 2px;
  477. .value {
  478. font-family: 'douyuFont';
  479. color: #28dce4;
  480. margin-top: 5px;
  481. }
  482. }
  483. }
  484. }
  485. }
  486. .warning-box {
  487. .warning-top {
  488. display: flex;
  489. justify-content: space-between;
  490. padding: 10px 2px 0px 2px;
  491. .warning-icon {
  492. width: 168px;
  493. height: 105px;
  494. display: flex;
  495. flex-direction: column;
  496. background: url('/@/assets/images/vent/new-home/warning-bg.png') no-repeat;
  497. background-size: contain;
  498. .title {
  499. font-size: 13px;
  500. margin: 5px 0 5px 14px;
  501. }
  502. .num-box {
  503. display: flex;
  504. margin-left: 20px;
  505. .num {
  506. font-family: 'numberFont';
  507. font-size: 34px;
  508. color: #20dbfd;
  509. text-shadow: 0 0 25px #00d8ff;
  510. margin-right: 10px;
  511. }
  512. .rate-box {
  513. font-size: 12px;
  514. .day-rate {
  515. color: #fe3e12;
  516. }
  517. .week-rate {
  518. color: #fadb3e;
  519. }
  520. .moth-rate {
  521. color: #12fe81;
  522. }
  523. }
  524. }
  525. }
  526. }
  527. }
  528. .device-monitor-box {
  529. margin-top: 20px;
  530. position: reactive;
  531. .device-btn-group {
  532. display: flex;
  533. flex-wrap: wrap;
  534. margin-top: 10px;
  535. .device-active {
  536. &::before {
  537. border-color: #0efcff;
  538. box-shadow: 1px 1px 3px 1px #0efcff inset;
  539. }
  540. }
  541. .device-btn {
  542. width: 100px;
  543. height: 40px;
  544. position: relative;
  545. display: flex;
  546. justify-content: center;
  547. align-items: center;
  548. font-size: 14px;
  549. color: #0efcff;
  550. cursor: pointer;
  551. margin: 0 6px;
  552. &::before {
  553. content: '';
  554. position: absolute;
  555. top: 0;
  556. right: 0;
  557. bottom: 0;
  558. left: 0;
  559. border: 1px solid #6176af;
  560. transform: skewX(-38deg);
  561. }
  562. }
  563. }
  564. .device-table {
  565. position: absolute;
  566. width: 1550px;
  567. height: 270px;
  568. right: 0;
  569. bottom: 0;
  570. backdrop-filter: blur(30px);
  571. border: 1px solid #8b8b8b22;
  572. padding: 2px 0 10px 10px;
  573. z-index: 9999;
  574. &::before {
  575. position: absolute;
  576. content: '';
  577. width: 10px;
  578. height: 10px;
  579. border-top: 1px solid #00d8ff;
  580. border-left: 1px solid #00d8ff;
  581. left: 0px;
  582. top: -1px;
  583. }
  584. &::after {
  585. position: absolute;
  586. content: '';
  587. width: 10px;
  588. height: 10px;
  589. border-bottom: 1px solid #00d8ff;
  590. border-left: 1px solid #00d8ff;
  591. left: 0px;
  592. bottom: -1px;
  593. }
  594. .device-tab {
  595. width: 100%;
  596. .tab {
  597. margin: 5px;
  598. cursor: pointer;
  599. }
  600. .tab-active {
  601. color: #00d8ff;
  602. }
  603. }
  604. .device-animation {
  605. border-bottom: 1px solid #91e9fe44;
  606. }
  607. .monitor-table {
  608. background-color: #67e6fd05;
  609. }
  610. }
  611. .device-table-open {
  612. width: 1550;
  613. animation-name: open;
  614. /* 持续时间 */
  615. animation-duration: 2s;
  616. transition: all 2s linear 1s;
  617. }
  618. .device-table-close {
  619. width: 0px;
  620. animation-name: close;
  621. /* 持续时间 */
  622. animation-duration: 2s;
  623. transition: all 2s linear 1s;
  624. }
  625. }
  626. }
  627. .left-box {
  628. margin-top: 30px;
  629. }
  630. }
  631. :deep(.@{ventSpace}-table-thead) {
  632. background-color: transparent !important;
  633. th {
  634. color: #00d8ff !important;
  635. border-color: #91e9fe44 !important;
  636. border: none !important;
  637. border-top: 1px solid #91e9fe44 !important;
  638. &:first-child {
  639. border-left: 1px solid #91e9fe44 !important;
  640. }
  641. &:last-child {
  642. border-right: 1px solid #91e9fe44 !important;
  643. }
  644. .@{ventSpace}-table-column-title {
  645. color: #00d8ff !important;
  646. }
  647. .@{ventSpace}-table-cell-scrollbar {
  648. box-shadow: none !important;
  649. }
  650. }
  651. }
  652. :deep(.@{ventSpace}-table-tbody) {
  653. tr {
  654. td {
  655. background-color: transparent !important;
  656. border-bottom: 1px solid #91e9fe33 !important;
  657. // border-top: none !important;
  658. // border-left: none !important;
  659. &:first-child {
  660. border-left: 1px solid #91e9fe44 !important;
  661. }
  662. &:last-child {
  663. border-right: 1px solid #91e9fe44 !important;
  664. }
  665. }
  666. &:last-child {
  667. td {
  668. border-bottom: 1px solid #91e9fe44 !important;
  669. }
  670. }
  671. }
  672. }
  673. @keyframes open {
  674. /* 开始状态 */
  675. 0% {
  676. opacity: 0;
  677. width: 0px;
  678. }
  679. /* 结束状态 */
  680. 100% {
  681. opacity: 1;
  682. width: 1550px;
  683. }
  684. }
  685. @keyframes close {
  686. /* 开始状态 */
  687. 0% {
  688. opacity: 1;
  689. width: 1550px;
  690. }
  691. /* 结束状态 */
  692. 100% {
  693. opacity: 0;
  694. width: 0px;
  695. }
  696. }
  697. </style>