deviceFaultDetailModal.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template>
  2. <a-modal v-model:visible="visible" width="1200px" :title="title" centered destroyOnClose :footer="null" @cancel="handleCancel">
  3. <div class="basic-top">
  4. <div class="top-l">
  5. <faultEchartPie :normalNum="normalNum" :abnormalNum="abnormalNum" />
  6. </div>
  7. <div class="top-r">
  8. <div class="basic-title">异常测点信息</div>
  9. <div class="list-r">
  10. <div class="list-item" v-for="(item, index) in faultList" :key="index">
  11. <span style="margin-right: 5px; color: #f50707">{{ `${index + 1}.` }}</span>
  12. <span style="color: #f50707">{{ item.label }}</span>
  13. </div>
  14. </div>
  15. </div>
  16. </div>
  17. <div class="basic-bot">
  18. <div class="basic-content">
  19. <div class="basic-title">轴温监测曲线</div>
  20. <div class="echart-box">
  21. <faultEchartLine
  22. :selectData="selectData"
  23. :warningMonitorRowIndex="warningMonitorRowIndex"
  24. :deviceId="deviceID"
  25. :deviceType="deviceType"
  26. :Type="'tempZw'"
  27. :addData="tempzwValue"
  28. :legendName="'轴温'"
  29. :echartColor="'#ff0000'"
  30. />
  31. </div>
  32. </div>
  33. <div class="basic-content">
  34. <div class="basic-title">电机温度监测曲线</div>
  35. <div class="echart-box">
  36. <faultEchartLine
  37. :selectData="selectData"
  38. :warningMonitorRowIndex="warningMonitorRowIndex"
  39. :deviceId="deviceID"
  40. :deviceType="deviceType"
  41. :Type="'tempDj'"
  42. :addData="tempdjValue"
  43. :legendName="'电机温度'"
  44. :echartColor="'#2ec1dd'"
  45. />
  46. </div>
  47. </div>
  48. <div class="basic-content">
  49. <div class="basic-title">电流监测曲线</div>
  50. <div class="echart-box">
  51. <faultEchartLine
  52. :selectData="selectData"
  53. :warningMonitorRowIndex="warningMonitorRowIndex"
  54. :deviceId="deviceID"
  55. :deviceType="deviceType"
  56. :Type="'Dl'"
  57. :addData="dlValue"
  58. :legendName="'电流'"
  59. :echartColor="'#fbc21c'"
  60. />
  61. </div>
  62. </div>
  63. <div class="basic-content">
  64. <div class="basic-title">电压监测曲线</div>
  65. <div class="echart-box">
  66. <faultEchartLine
  67. :selectData="selectData"
  68. :warningMonitorRowIndex="warningMonitorRowIndex"
  69. :deviceId="deviceID"
  70. :deviceType="deviceType"
  71. :Type="'Dy'"
  72. :addData="dyValue"
  73. :legendName="'电压'"
  74. :echartColor="'#259745'"
  75. />
  76. </div>
  77. </div>
  78. <div class="basic-content">
  79. <div class="basic-title">径向振动监测曲线</div>
  80. <div class="echart-box">
  81. <faultEchartLine
  82. :selectData="selectData"
  83. :warningMonitorRowIndex="warningMonitorRowIndex"
  84. :deviceId="deviceID"
  85. :deviceType="deviceType"
  86. :Type="'jxzd'"
  87. :addData="jxzdValue"
  88. :legendName="'径向振动'"
  89. :echartColor="'#0fcb74'"
  90. />
  91. </div>
  92. </div>
  93. <div class="basic-content">
  94. <div class="basic-title">垂直振动监测曲线</div>
  95. <div class="echart-box">
  96. <faultEchartLine
  97. :selectData="selectData"
  98. :warningMonitorRowIndex="warningMonitorRowIndex"
  99. :deviceId="deviceID"
  100. :deviceType="deviceType"
  101. :Type="'czzd'"
  102. :addData="czzdValue"
  103. :legendName="'垂直振动'"
  104. :echartColor="'#00a9ff'"
  105. />
  106. </div>
  107. </div>
  108. </div>
  109. </a-modal>
  110. </template>
  111. <script setup lang="ts">
  112. import { computed, reactive, ref, watch } from 'vue';
  113. import faultEchartPie from './faultEchartPie.vue';
  114. import faultEchartLine from './faultEchartLine.vue';
  115. let props = defineProps({
  116. //是否显示弹窗
  117. isShowModal: {
  118. type: Boolean,
  119. },
  120. //当前激活风机索引
  121. warningMonitorRowIndex: {
  122. type: Number,
  123. },
  124. rightColumns: {
  125. type: Array as any,
  126. },
  127. selectData: {
  128. type: Object as any,
  129. },
  130. deviceID: {
  131. type: String,
  132. },
  133. deviceType: {
  134. type: String,
  135. },
  136. });
  137. let visible = ref(false);
  138. let title = ref('风机故障诊断分析');
  139. let faultList = ref<any[]>([]); //异常信息列表
  140. let normalNum = ref(0); //正常测点数量
  141. let abnormalNum = ref(0); //
  142. let tempzwValue = computed(() => {
  143. return {
  144. y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Tempzw'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Tempzw'] : '',
  145. x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' ')),
  146. };
  147. }); //实时轴温
  148. let tempdjValue = computed(() => {
  149. return {
  150. y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Tempdj'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Tempdj'] : '',
  151. x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' ')),
  152. };
  153. }); //实时电机温度
  154. let dlValue = computed(() => {
  155. return {
  156. y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Dl'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Dl'] : '',
  157. x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' ')),
  158. };
  159. }); //实时电流
  160. let dyValue = computed(() => {
  161. return {
  162. y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Dy'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Dy'] : '',
  163. x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' ')),
  164. };
  165. }); //实时电压
  166. let jxzdValue = computed(() => {
  167. return {
  168. y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Jxzd'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Jxzd'] : '',
  169. x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' ')),
  170. };
  171. }); //实时径向振动
  172. let czzdValue = computed(() => {
  173. return {
  174. y: props.warningMonitorRowIndex == 0 ? props.selectData['Fan1Czzd'] : props.warningMonitorRowIndex == 1 ? props.selectData['Fan2Czzd'] : '',
  175. x: props.selectData['tTime'].substring(props.selectData['tTime'].lastIndexOf(' ')),
  176. };
  177. }); //实时垂直振动
  178. let $emit = defineEmits(['handlerClose']);
  179. //弹窗关闭
  180. function handleCancel() {
  181. $emit('handlerClose', false);
  182. }
  183. watch(
  184. () => props.isShowModal,
  185. (newV, oldV) => {
  186. visible.value = newV;
  187. }
  188. );
  189. watch(
  190. () => props.warningMonitorRowIndex,
  191. (newV, oldV) => {
  192. // if (props.rightColumns.length) {
  193. // let dataList: any[] = []
  194. // props.rightColumns.forEach((el) => {
  195. // if (el.dataIndex.startsWith('Fan')) {
  196. // if (newV == 0 && props.selectData[el.dataIndex.replace('Fan', 'Fan1')] != undefined) {
  197. // dataList.push({ label: el.title })
  198. // } else if (newV == 1 && props.selectData[el.dataIndex.replace('Fan', 'Fan2')] != undefined && props.selectData[el.dataIndex.replace('Fan', 'Fan2')] != '0') {
  199. // dataList.push({ label: el.title })
  200. // } else if (newV == 2 && props.selectData[el.dataIndex.replace('Fan', 'Fan3')] != undefined && props.selectData[el.dataIndex.replace('Fan', 'Fan3')] != '0') {
  201. // dataList.push({ label: el.title })
  202. // }
  203. // } else {
  204. // if (props.selectData[el.dataIndex] != undefined && props.selectData[el.dataIndex] != '0') {
  205. // dataList.push({ label: el.title })
  206. // }
  207. // }
  208. // })
  209. // faultList.value = dataList
  210. // abnormalNum.value = dataList.length
  211. // normalNum.value = props.rightColumns.length - dataList.length
  212. // console.log(dataList, 'dataList===')
  213. // }
  214. if (newV == 0) {
  215. faultList.value = [
  216. { label: '2025年8月13日 14:25:37 供风不足,疑似矿井阻力异常' },
  217. { label: '2025年8月13日 15:05:30 径向振动幅度增大,疑似轴承故障' },
  218. ];
  219. } else if (newV == 1) {
  220. faultList.value = [
  221. { label: '2025年8月13日 14:25:37 供风不足,疑似矿井阻力异常' },
  222. { label: '2025年8月13日 15:05:30 径向振动幅度增大,疑似轴承故障' },
  223. ];
  224. } else {
  225. faultList.value = [
  226. { label: '2025年8月13日 14:25:37 供风不足,疑似矿井阻力异常' },
  227. { label: '2025年8月13日 15:05:30 径向振动幅度增大,疑似轴承故障' },
  228. ];
  229. }
  230. abnormalNum.value = faultList.value.length;
  231. normalNum.value = 45;
  232. },
  233. { immediate: true }
  234. );
  235. </script>
  236. <style lang="less" scoped>
  237. .basic-top {
  238. width: calc(100% - 30px);
  239. height: 200px;
  240. margin: 10px;
  241. display: flex;
  242. .top-l {
  243. width: 320px;
  244. margin-right: 10px;
  245. }
  246. .top-r {
  247. width: calc(100% - 330px);
  248. }
  249. .list-r {
  250. height: calc(100% - 25px);
  251. padding: 0px 10px;
  252. box-sizing: border-box;
  253. overflow-y: auto;
  254. border: 1px solid #3062a2;
  255. }
  256. .list-item {
  257. margin: 5px 0px;
  258. }
  259. }
  260. .basic-title {
  261. height: 20px;
  262. line-height: 20px;
  263. font-weight: bold;
  264. margin-bottom: 5px;
  265. }
  266. .basic-bot {
  267. width: calc(100% - 30px);
  268. height: 400px;
  269. margin: 10px;
  270. display: flex;
  271. justify-content: space-between;
  272. flex-wrap: wrap;
  273. overflow-y: auto;
  274. .basic-content {
  275. width: calc(50% - 5px);
  276. height: 240px;
  277. margin-bottom: 10px;
  278. padding: 5px 10px;
  279. box-sizing: border-box;
  280. border: 1px solid #3062a2;
  281. }
  282. .echart-box {
  283. height: calc(100% - 25px);
  284. }
  285. }
  286. </style>