{"remainingRequest":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\cssc-fvue\\src\\views\\HolographicMonitor\\EquipmentMonitor.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\cssc-fvue\\src\\views\\HolographicMonitor\\EquipmentMonitor.vue","mtime":1681441192473},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nexport default {\r\n name: 'equipment-monitor',\r\n data() {\r\n return {\r\n collectTime: '',\r\n timer: null,\r\n bodyStyle: {\r\n padding: '10px 20px',\r\n },\r\n bodyStyle2: {\r\n padding: '10px',\r\n height: 'calc(100% - 20px)',\r\n },\r\n equipmentStates: [\r\n { key: 'normal', value: 0, text: '正常风机' },\r\n { key: 'warm', value: 0, text: '预警风机' },\r\n { key: 'alarm', value: 0, text: '报警风机' },\r\n // {key: 'abnormal', value: 0, text: '通讯异常风机'},\r\n ],\r\n ListData: [],\r\n crewCol: {\r\n col1: {\r\n crewList: [\r\n // {\r\n // name: '#00001',\r\n // isExpand: false,\r\n // activeNames: [],\r\n // innerActiveKeys: {},\r\n // partList: [\r\n // {\r\n // innerActiveNames: [],\r\n // key: 'col2-key1',\r\n // name: '传动链',\r\n // data: [\r\n // {\r\n // key: '主轴前轴承径向',\r\n // value: '正常',\r\n // },\r\n // {\r\n // key: '发动机驱动端径向',\r\n // value: '正常',\r\n // },\r\n // ],\r\n // },\r\n // ],\r\n // },\r\n ],\r\n },\r\n col2: {\r\n crewList: [],\r\n },\r\n col3: {\r\n crewList: [],\r\n },\r\n col4: {\r\n crewList: [],\r\n },\r\n },\r\n }\r\n },\r\n filters: {\r\n state: (value) => {\r\n if (value == 1) {\r\n return '正常'\r\n } else if (value == 2) {\r\n return '预警'\r\n } else if (value == 3) {\r\n return '报警'\r\n }\r\n },\r\n },\r\n mounted() {\r\n this.initData()\r\n this.circlrQuery()\r\n },\r\n beforeDestroy() {\r\n clearInterval(this.timer)\r\n },\r\n methods: {\r\n circlrQuery() {\r\n clearInterval(this.timer)\r\n this.timer = setInterval(() => {\r\n this.clearData()\r\n this.initData()\r\n this.circlrQuery()\r\n }, 1000 * 60 * 5)\r\n },\r\n clearData() {\r\n this.ListData = []\r\n this.crewCol = {\r\n col1: {\r\n crewList: [],\r\n },\r\n col2: {\r\n crewList: [],\r\n },\r\n col3: {\r\n crewList: [],\r\n },\r\n col4: {\r\n crewList: [],\r\n },\r\n }\r\n this.equipmentStates[0].value = 0\r\n this.equipmentStates[1].value = 0\r\n this.equipmentStates[2].value = 0\r\n },\r\n initData() {\r\n this.$http.post('${cssc}/biz/cms/cmsState/v1/queryNoPage').then((res) => {\r\n if (res.status == 200) {\r\n this.ListData = res.data\r\n console.log(this.ListData)\r\n this.collectTime = this.ListData[0].collTime\r\n this.ListData.forEach((item, index) => {\r\n if (item.fanState == 1) {\r\n this.equipmentStates[0].value++\r\n } else if (item.fanState == 2) {\r\n this.equipmentStates[1].value++\r\n } else if (item.fanState == 3) {\r\n this.equipmentStates[2].value++\r\n }\r\n\r\n item.isExpand = false\r\n item.activeNames = []\r\n item.innerActiveKeys = {}\r\n item.partList = []\r\n let item1 = {\r\n key: '',\r\n name: '传动链振动',\r\n data: JSON.parse(item.driveChain),\r\n innerActiveNames: [],\r\n }\r\n let item2 = {\r\n key: '',\r\n name: '倾角数据',\r\n data: JSON.parse(item.towerBaseObliquity),\r\n innerActiveNames: [],\r\n }\r\n // console.log(item)\r\n if (index % 4 == 0) {\r\n item1.key = 'col1-key1'\r\n item2.key = 'col1-key2'\r\n item.innerActiveKeys = {\r\n [item1.key]: false,\r\n [item2.key]: false,\r\n }\r\n item.partList.push(item1, item2)\r\n this.crewCol.col1.crewList.push(item)\r\n } else if (index % 4 == 1) {\r\n item1.key = 'col2-key1'\r\n item2.key = 'col2-key2'\r\n item.innerActiveKeys = {\r\n [item1.key]: false,\r\n [item2.key]: false,\r\n }\r\n item.partList.push(item1, item2)\r\n this.crewCol.col2.crewList.push(item)\r\n } else if (index % 4 == 2) {\r\n item1.key = 'col3-key1'\r\n item2.key = 'col3-key2'\r\n item.innerActiveKeys = {\r\n [item1.key]: false,\r\n [item2.key]: false,\r\n }\r\n item.partList.push(item1, item2)\r\n this.crewCol.col3.crewList.push(item)\r\n } else if (index % 4 == 3) {\r\n item1.key = 'col3-key1'\r\n item2.key = 'col3-key2'\r\n item.innerActiveKeys = {\r\n [item1.key]: false,\r\n [item2.key]: false,\r\n }\r\n item.partList.push(item1, item2)\r\n this.crewCol.col4.crewList.push(item)\r\n }\r\n })\r\n }\r\n })\r\n },\r\n toggleExpand(key, i) {\r\n if (this.crewCol[key].crewList[i].isExpand) {\r\n this.crewCol[key].crewList[i].activeNames = []\r\n Object.keys(\r\n this.crewCol[key].crewList[i].innerActiveKeys\r\n ).forEach((keyname) => {\r\n this.crewCol[key].crewList[i].innerActiveKeys[\r\n keyname\r\n ] = false\r\n })\r\n this.crewCol[key].crewList[i].partList.forEach(\r\n (part) => (part.innerActiveNames = [])\r\n )\r\n } else {\r\n this.crewCol[key].crewList[i].activeNames = [\r\n this.crewCol[key].crewList[i].fanCode,\r\n ]\r\n this.crewCol[key].crewList[i].partList.forEach((part) => {\r\n part.innerActiveNames = this.crewCol[key].crewList[\r\n i\r\n ].partList.map((item) => {\r\n return item.key\r\n })\r\n })\r\n Object.keys(\r\n this.crewCol[key].crewList[i].innerActiveKeys\r\n ).forEach((keyname) => {\r\n this.crewCol[key].crewList[i].innerActiveKeys[\r\n keyname\r\n ] = true\r\n })\r\n }\r\n this.crewCol[key].crewList[i].isExpand =\r\n !this.crewCol[key].crewList[i].isExpand\r\n console.log(key, i, this.crewCol[key].crewList[i])\r\n this.$forceUpdate()\r\n },\r\n handleChangeItem(val, key, i, currentKey) {\r\n if (val.length) {\r\n let keysObj = this.crewCol[key].crewList[i].innerActiveKeys\r\n keysObj[val[0]] = true\r\n let arr = []\r\n for (let keyName in keysObj) {\r\n if (!keysObj[keyName]) {\r\n this.crewCol[key].crewList[i].isExpand = false\r\n } else {\r\n arr.push(keyName)\r\n }\r\n }\r\n if (arr.length == Object.keys(keysObj).length) {\r\n this.crewCol[key].crewList[i].isExpand = true\r\n }\r\n } else {\r\n this.crewCol[key].crewList[i].innerActiveKeys[\r\n currentKey\r\n ] = false\r\n this.crewCol[key].crewList[i].isExpand = false\r\n }\r\n this.$forceUpdate()\r\n },\r\n },\r\n}\r\n",null]}