DetailModal.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <BasicModal @register="register" title="预警详情" width="100%" v-bind="$attrs" @ok="onSubmit" @cancel="onSubmit" :defaultFullscreen="true">
  3. <MonitorTable
  4. ref="monitorTable"
  5. :columnsType="`${deviceType}_monitor`"
  6. :dataSource="dataSource"
  7. design-scope="device_monitor"
  8. :isShowPagination="false"
  9. :isShowActionColumn="true"
  10. title="设备监测"
  11. >
  12. <template #filterCell="{ column, record }">
  13. <template v-if="deviceType.startsWith('gate')">
  14. <template v-if="record.frontGateOpenCtrl">
  15. <a-tag v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0" color="red">正在打开</a-tag>
  16. <a-tag v-else-if="column.dataIndex === 'frontGateOpen'" color="processing">打开</a-tag>
  17. </template>
  18. <template v-else>
  19. <a-tag v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0" color="red">正在关闭</a-tag>
  20. <a-tag v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 1" color="default"
  21. >关闭</a-tag
  22. >
  23. <a-tag v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 1 && record.frontGateClose == 0" color="default"
  24. >打开</a-tag
  25. >
  26. </template>
  27. <template v-if="record.rearGateOpenCtrl">
  28. <a-tag v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0" color="red">正在打开</a-tag>
  29. <a-tag v-else-if="column.dataIndex === 'rearGateOpen'" color="processing">打开</a-tag>
  30. </template>
  31. <template v-else>
  32. <a-tag v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0" color="red">正在关闭</a-tag>
  33. <a-tag v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 1" color="default"
  34. >关闭</a-tag
  35. >
  36. <a-tag v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 1 && record.rearGateClose == 0" color="default"
  37. >打开</a-tag
  38. >
  39. </template>
  40. </template>
  41. <template v-if="deviceType.startsWith('windrect')">
  42. <a-tag v-if="column.dataIndex === 'sign'" :color="record.sign == 0 ? '#95CF65' : record.sign == 1 ? '#4590EA' : '#9876AA'">
  43. {{ record.sign == 0 ? '高位' : record.sign == 1 ? '中位' : '低位' }}</a-tag
  44. >
  45. <template v-if="record && column && column.dataIndex === 'isRun' && record.isRun">
  46. <a-tag v-if="record.isRun == -2 || record.isRun == -1" :color="record.isRun == -2 ? '#95CF65' : '#ED5700'">{{
  47. record.isRun == -2 ? '空闲' : '等待'
  48. }}</a-tag>
  49. <a-tag v-else-if="record.isRun == 100" color="#4693FF">完成</a-tag>
  50. <Progress v-else :percent="Number(record.isRun)" size="small" status="active" />
  51. </template>
  52. </template>
  53. <a-tag v-if="column.dataIndex === 'warnFlag'" :color="record.warnFlag == 0 ? 'green' : record.warnFlag == 1 ? '#FF5812' : 'gray'">
  54. {{ record.warnFlag == 0 ? '正常' : record.warnFlag == 1 ? '报警' : record.warnFlag == 2 ? '断开' : '未监测' }}</a-tag
  55. >
  56. <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == '0' ? '#f00' : 'green'">{{
  57. record.netStatus == '0' ? '断开' : '连接'
  58. }}</a-tag>
  59. </template>
  60. </MonitorTable>
  61. </BasicModal>
  62. </template>
  63. <script lang="ts" setup>
  64. import { onMounted, ref, defineEmits, onUnmounted, watch } from 'vue';
  65. import MonitorTable from '../comment/MonitorTable.vue';
  66. import { BasicModal, useModalInner } from '/@/components/Modal';
  67. const emit = defineEmits(['close', 'register']);
  68. const props = defineProps({
  69. deviceType: {
  70. type: String,
  71. default: '',
  72. },
  73. scroll: {
  74. type: Object,
  75. default: { y: 0 },
  76. },
  77. });
  78. const dataSource = ref([]);
  79. // 注册 modal
  80. const [register, { closeModal }] = useModalInner();
  81. async function onSubmit() {
  82. emit('close');
  83. closeModal();
  84. }
  85. onMounted(async () => {});
  86. onUnmounted(() => {});
  87. </script>
  88. <style scoped lang="less">
  89. @import '/@/design/vent/color.less';
  90. @import '/@/design/vent/modal.less';
  91. .padding-0 {
  92. padding: 10px 0 !important;
  93. }
  94. .alarm-modal {
  95. position: relative;
  96. padding: 10px;
  97. z-index: 999;
  98. max-height: calc(100vh - 150px);
  99. .title-text {
  100. position: absolute;
  101. top: -14px;
  102. left: 0;
  103. width: 100%;
  104. text-align: center;
  105. color: #fff;
  106. }
  107. .table-box {
  108. height: calc(60vh - 150px);
  109. padding: 20px 10px;
  110. overflow-y: auto;
  111. }
  112. .box-bg {
  113. border: 1px solid #4d7ad855;
  114. border-radius: 2px;
  115. // background-color: #001d3055;
  116. // -webkit-backdrop-filter: blur(8px);
  117. // backdrop-filter: blur(8px);
  118. box-shadow: 0 0 10px #5984e055 inset;
  119. // background-color: #00b3ff12;
  120. }
  121. .charts-box {
  122. height: calc(40vh - 80px);
  123. padding: 5px 10px;
  124. margin-top: 10px;
  125. }
  126. }
  127. .@{ventSpace}-picker,
  128. .@{ventSpace}-select-selector {
  129. width: 100% !important;
  130. background: #00000017 !important;
  131. border: 1px solid @vent-form-item-boder !important;
  132. input,
  133. .@{ventSpace}-select-selection-item,
  134. .@{ventSpace}-picker-suffix {
  135. color: #fff !important;
  136. }
  137. .@{ventSpace}-select-selection-placeholder {
  138. color: #b7b7b7 !important;
  139. }
  140. }
  141. .@{ventSpace}-pagination-next,
  142. .action,
  143. .@{ventSpace}-select-arrow,
  144. .@{ventSpace}-picker-separator {
  145. color: #fff !important;
  146. }
  147. .@{ventSpace}-table-cell-row-hover {
  148. background: #264d8833 !important;
  149. }
  150. .@{ventSpace}-table-row-selected {
  151. background: #00c0a311 !important;
  152. td {
  153. background-color: #00000000 !important;
  154. }
  155. }
  156. .@{ventSpace}-table-thead {
  157. // background: linear-gradient(#004a8655 0%, #004a86aa 10%) !important;
  158. background: #3d9dd45d !important;
  159. & > tr > th,
  160. .@{ventSpace}-table-column-title {
  161. // color: #70f9fc !important;
  162. border-color: #84f2ff !important;
  163. border-left: none !important;
  164. border-right: none !important;
  165. padding: 7px;
  166. }
  167. }
  168. .@{ventSpace}-table-tbody {
  169. tr > td {
  170. padding: 12px;
  171. }
  172. }
  173. .@{ventSpace}-table-tbody > tr:hover.@{ventSpace}-table-row > td {
  174. background-color: #26648855 !important;
  175. }
  176. .jeecg-basic-table-row__striped {
  177. // background: #97efff11 !important;
  178. td {
  179. background-color: #97efff11 !important;
  180. }
  181. }
  182. </style>