index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <div class="gas-pipe-net">
  4. <CustomHeader> 瓦斯管网监控系统 </CustomHeader>
  5. <div style="width: 100%; height: 100%; position: absolute; left: 0; top: 0; z-index: 0">
  6. <VentModal />
  7. </div>
  8. <ModuleCommon
  9. v-for="cfg in moduleConfigs"
  10. :key="cfg.deviceType"
  11. :show-style="cfg.showStyle"
  12. :module-data="cfg.moduleData"
  13. :module-name="cfg.moduleName"
  14. :device-type="cfg.deviceType"
  15. :data="pumpDataSource"
  16. :visible="true"
  17. :style="{ zIndex: 3 }"
  18. />
  19. <div class="scene-box">
  20. <div class="bottom-tabs-box" @mousedown="setDivHeight($event, 175, scroll, 0)">
  21. <DvBorderBox8 class="dv_border_8 p-5px" :dur="5" :style="{ height: `${scroll.y + 128}px` }">
  22. <a-tabs class="tabs-box" v-model:activeKey="activeKey">
  23. <a-tab-pane key="1" tab="瓦斯管道监测">
  24. <GasPipeTable :scroll="scroll" @locate="goLocation($event)" />
  25. </a-tab-pane>
  26. <!-- <a-tab-pane key="2" tab="瓦斯网络解算" disabled> 1212312312313321 </a-tab-pane> -->
  27. <a-tab-pane key="2" tab="管道阀门监控">
  28. <MonitorTable
  29. columnsType="gasvalve_monitor"
  30. :dataSource="gasValveDataSource"
  31. design-scope="device_monitor"
  32. :isShowActionColumn="true"
  33. :isShowSelect="false"
  34. title="设备监测"
  35. :scroll="{ y: scroll.y - 30 }"
  36. >
  37. <template #action="{ record }">
  38. <TableAction
  39. :actions="[
  40. {
  41. label: '定位',
  42. onClick: goLocation.bind(null, record),
  43. },
  44. ]"
  45. />
  46. </template>
  47. <template #filterCell="{ column, record }">
  48. <a-tag v-if="column.dataIndex === 'warnFlag'" :color="record.warnFlag == 0 ? 'green' : record.warnFlag == 1 ? '#FF5812' : 'gray'">
  49. {{ record.warnFlag == 0 ? '正常' : record.warnFlag == 1 ? '报警' : record.warnFlag == 2 ? '断开' : '未监测' }}</a-tag
  50. >
  51. <template v-else-if="column.dataIndex === 'warnLevel'">
  52. <a-tag v-if="record.warnLevel == '101'" color="green">低风险</a-tag>
  53. <a-tag v-else-if="record.warnLevel == '102'" color="#FF5812">一般风险</a-tag>
  54. <a-tag v-else-if="record.warnLevel == '103'" color="#FF5812">较大风险</a-tag>
  55. <a-tag v-else-if="record.warnLevel == '104'" color="#FF5812">重大风险</a-tag>
  56. <a-tag v-else-if="record.warnLevel == '201'" color="#FF0000">报警</a-tag>
  57. <a-tag v-else-if="record.warnLevel == '10000'" color="#FF5812">数据超限</a-tag>
  58. <a-tag v-else-if="record.warnLevel == '1001'" color="default">网络中断</a-tag>
  59. <a-tag v-else color="green">正常</a-tag>
  60. </template>
  61. <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == '0' ? '#f00' : 'green'">{{
  62. record.netStatus == '0' ? '断开' : '连接'
  63. }}</a-tag>
  64. </template>
  65. </MonitorTable>
  66. </a-tab-pane>
  67. </a-tabs>
  68. </DvBorderBox8>
  69. </div>
  70. </div>
  71. </div>
  72. </template>
  73. <script setup lang="ts">
  74. import CustomHeader from '/@/components/vent/customHeader.vue';
  75. import { setDivHeight } from '/@/utils/event';
  76. import { onMounted, ref } from 'vue';
  77. import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
  78. import ModuleCommon from '../../home/configurable/components/ModuleCommon.vue';
  79. import { moduleConfigs } from './gasPipeNet.data';
  80. import GasPipeTable from '../../monitorManager/comment/GasPipeTable.vue';
  81. import MonitorTable from '../../monitorManager/comment/MonitorTable.vue';
  82. import VentModal from '/@/components/vent/micro/ventModal.vue';
  83. import { getTableList, list } from './gasPipeNet.api';
  84. import { get } from 'lodash-es';
  85. import { getActions } from '/@/qiankun/state';
  86. import { TableAction } from '/@/components/Table';
  87. const scroll = ref<{ x: true; y: number }>({ x: true, y: 202 });
  88. const activeKey = ref('1');
  89. const pumpDataSource = ref<any[]>([]);
  90. const gasValveDataSource = ref<any[]>([]);
  91. async function getSysDataSource() {
  92. const res = await getTableList({ strtype: 'sys_gaspipenet', pagetype: 'normal' });
  93. const { deviceInfo } = await list({ devicetype: 'sys', systemID: get(res, 'records[0].id', ''), type: 'all' });
  94. pumpDataSource.value = get(deviceInfo, 'pump', { datalist: [] });
  95. gasValveDataSource.value = get(deviceInfo, 'gasvalve.datalist', []).map((e) => {
  96. return Object.assign(e, e.readData);
  97. });
  98. }
  99. const actions = getActions();
  100. function goLocation(record) {
  101. // debugger;
  102. actions.setGlobalState({ locationId: record.deviceID, locationObj: null, pageObj: null });
  103. }
  104. onMounted(() => {
  105. getSysDataSource();
  106. });
  107. </script>
  108. <style scoped lang="less">
  109. @import '/@/design/theme.less';
  110. @import '/@/design/vent/modal.less';
  111. // @{theme-deepblue} {
  112. // .gas-pipe-net {
  113. // }
  114. // }
  115. .gas-pipe-net {
  116. width: 100%;
  117. height: 100%;
  118. }
  119. </style>