monitor.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <div class="monitor-container">
  4. <div class="lr left-box">
  5. <ventBox1>
  6. <template #title>
  7. <div>抽采泵信息</div>
  8. </template>
  9. <template #container>
  10. <BaseTab :tabs="pumpSelection" v-model:id="activedPumpID" />
  11. <List v-bind="pumpListProp" />
  12. </template>
  13. </ventBox1>
  14. <ventBox1 class="vent-margin-t-10">
  15. <template #title>
  16. <div>泵站环境</div>
  17. </template>
  18. <template #container>
  19. <List v-bind="pumpStationListProp">
  20. <template #title></template>
  21. </List>
  22. </template>
  23. </ventBox1>
  24. </div>
  25. <CategoryBoard v-bind="pumpCategoryProp" />
  26. <div class="lr right-box">
  27. <div class="item-box sensor-container">
  28. <ventBox1>
  29. <template #title>
  30. <div>自动模式</div>
  31. </template>
  32. <template #container>
  33. <div class="flex justify-between mt-10px mb-10px">
  34. <Button @click="reverseModalVisible = true">一键倒机</Button>
  35. <Button @click="switchModalVisible = true">一键启停</Button>
  36. </div>
  37. <List icon="pump" title="抽放泵" layout="double-columns" type="status-light" :label-width="80" v-bind="pumpStatusProp" />
  38. <List icon="water-pump" title="水泵" layout="double-columns" type="status-light" :label-width="80" v-bind="waterPumpStatusProp" />
  39. <List icon="gas-pump" title="高负压配气泵" layout="double-columns" type="status-light" :label-width="80" v-bind="HPumpStatusProp" />
  40. <List icon="gas-pump" title="低负压配气泵" layout="double-columns" type="status-light" :label-width="80" v-bind="LPumpStatusProp" />
  41. </template>
  42. </ventBox1>
  43. </div>
  44. </div>
  45. <ConfirmModal v-model:visible="reverseModalVisible">
  46. <SvgIcon class="icon" size="34" name="warning-icon-gas" />
  47. <span> 是否进行一键倒机 </span>
  48. </ConfirmModal>
  49. <ConfirmModal v-model:visible="switchModalVisible">
  50. <SvgIcon class="icon" size="34" name="warning-icon-gas" />
  51. <span> 是否进行一键启停 </span>
  52. </ConfirmModal>
  53. </div>
  54. </template>
  55. <script setup lang="ts" name="gas-pump-monitor">
  56. import _ from 'lodash-es';
  57. import { ref, defineProps, computed } from 'vue';
  58. import ventBox1 from '/@/components/vent/ventBox1.vue';
  59. import List from '@/views/vent/gas/components/list/index.vue';
  60. import BaseTab from '@/views/vent/gas/components/tab/baseTab.vue';
  61. import Button from '@/views/vent/gas/components/form/button.vue';
  62. import CategoryBoard from '@/views/vent/gas/components/board/categoryBoard.vue';
  63. import ConfirmModal from '@/views/vent/gas/components/modal/confirmModal.vue';
  64. import { SvgIcon } from '/@/components/Icon';
  65. import {
  66. pumpListConfig,
  67. pumpStationListConfig,
  68. pumpStatusConfig,
  69. waterPumpStatusConfig,
  70. HPumpStationListItems,
  71. LPumpStationListItems,
  72. statusConfig,
  73. HPumpCategoryConfig,
  74. LPumpCategoryConfig,
  75. } from '../gasPumpMonitor.data';
  76. const props = defineProps({
  77. device: {
  78. type: Object,
  79. default: () => {},
  80. require: true,
  81. },
  82. });
  83. // 抽放泵模块的Tab相关
  84. const pumpSelection = ref([
  85. { name: 't1', id: 1 },
  86. { name: 't2', id: 2 },
  87. { name: 't3', id: 3 },
  88. { name: 't4', id: 4 },
  89. ]);
  90. const activedPumpID = ref(1);
  91. // const pump = ref({});
  92. // 将列表配置项转换为列表可用的prop
  93. function transConfigToProp(config, source) {
  94. return config.map((c) => {
  95. return {
  96. ...c,
  97. value: _.get(c.prop, source),
  98. label: c.label,
  99. };
  100. });
  101. }
  102. // 各个模块的配置项
  103. const pumpListProp = computed(() => {
  104. return {
  105. items: transConfigToProp(pumpListConfig, props.device),
  106. };
  107. });
  108. const pumpStationListProp = computed(() => {
  109. return {
  110. items: transConfigToProp(pumpStationListConfig, props.device),
  111. };
  112. });
  113. const pumpStatusProp = computed(() => {
  114. return {
  115. status: statusConfig as any,
  116. items: transConfigToProp(pumpStatusConfig, props.device),
  117. };
  118. });
  119. const waterPumpStatusProp = computed(() => {
  120. return {
  121. status: statusConfig as any,
  122. items: transConfigToProp(waterPumpStatusConfig, props.device),
  123. };
  124. });
  125. const HPumpStatusProp = computed(() => {
  126. return {
  127. status: statusConfig as any,
  128. items: transConfigToProp(HPumpStationListItems, props.device),
  129. };
  130. });
  131. const LPumpStatusProp = computed(() => {
  132. return {
  133. status: statusConfig as any,
  134. items: transConfigToProp(LPumpStationListItems, props.device),
  135. };
  136. });
  137. // 告示板相关字段
  138. const pumpCategoryProp = computed(() => {
  139. return {
  140. categoryTop: transConfigToProp(HPumpCategoryConfig, props.device),
  141. categoryButtom: transConfigToProp(LPumpCategoryConfig, props.device),
  142. };
  143. });
  144. // 模态框相关
  145. const reverseModalVisible = ref(false);
  146. const switchModalVisible = ref(false);
  147. </script>
  148. <style lang="less" scoped>
  149. @import '@/views/vent/monitorManager/comment/less/workFace.less';
  150. @ventSpace: zxm;
  151. @tab-bg: #10427a;
  152. @tab-pane-bg: #166ab5;
  153. @tab-pane-border: #2cb6ff;
  154. .pump__tabs {
  155. font-weight: bold;
  156. background-color: @tab-bg;
  157. border-radius: 5px 5px 0 0;
  158. }
  159. .pump__tabs_pane_actived {
  160. background-color: @tab-pane-bg;
  161. border-radius: 5px 5px 0 0;
  162. border-bottom: 5px solid @tab-pane-border;
  163. }
  164. </style>