|  | @ -7,7 +7,7 @@ | 
			
		
	
		
		
			
				
					|  |  |         <el-button v-hasPermi="['maintain:equipmentOnlineAnalysis:export']" size="mini" icon="el-icon-download" class="btnSearch" @click="SystemStatusExport('1')">导出丢包</el-button> |  |  |         <el-button v-hasPermi="['maintain:equipmentOnlineAnalysis:export']" size="mini" icon="el-icon-download" class="btnSearch" @click="SystemStatusExport('1')">导出丢包</el-button> | 
			
		
	
		
		
			
				
					|  |  |       </div> |  |  |       </div> | 
			
		
	
		
		
			
				
					|  |  |       <div class="right-div"> |  |  |       <div class="right-div"> | 
			
		
	
		
		
			
				
					
					|  |  |         <InputSearch  |  |  |         <InputSearch | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |         ref="searchComp" |  |  |         ref="searchComp" | 
			
		
	
		
		
			
				
					|  |  |         :formList="searchFormList" @handleSearch="handleSearch"  /> |  |  |         :formList="searchFormList" @handleSearch="handleSearch"  /> | 
			
		
	
		
		
			
				
					|  |  |       </div> |  |  |       </div> | 
			
		
	
	
		
		
			
				
					|  | @ -17,7 +17,7 @@ | 
			
		
	
		
		
			
				
					|  |  |         <el-checkbox-group class="device" v-model="devices" @change="onDeviceChange"> |  |  |         <el-checkbox-group class="device" v-model="devices" @change="onDeviceChange"> | 
			
		
	
		
		
			
				
					|  |  |           <el-checkbox v-for="(item,index) in deviceTypeList" :label="item.value" >{{ item.label }}</el-checkbox> |  |  |           <el-checkbox v-for="(item,index) in deviceTypeList" :label="item.value" >{{ item.label }}</el-checkbox> | 
			
		
	
		
		
			
				
					|  |  |         </el-checkbox-group> |  |  |         </el-checkbox-group> | 
			
		
	
		
		
			
				
					
					|  |  |       </div>         |  |  |       </div> | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |       <div class="cright"> |  |  |       <div class="cright"> | 
			
		
	
		
		
			
				
					|  |  |         <div class="queryChart"> |  |  |         <div class="queryChart"> | 
			
		
	
		
		
			
				
					|  |  |           <Empty |  |  |           <Empty | 
			
		
	
	
		
		
			
				
					|  | @ -58,10 +58,10 @@ | 
			
		
	
		
		
			
				
					|  |  |               </template> </ElTableColumn> |  |  |               </template> </ElTableColumn> | 
			
		
	
		
		
			
				
					|  |  |             <ElTableColumn prop="id" width="200"  label="日志"> |  |  |             <ElTableColumn prop="id" width="200"  label="日志"> | 
			
		
	
		
		
			
				
					|  |  |               <template slot="header" slot-scope="scope"> |  |  |               <template slot="header" slot-scope="scope"> | 
			
		
	
		
		
			
				
					
					|  |  |                |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 <InputSearch2  |  |  |                 <InputSearch2 | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |                   placeholder="搜索" |  |  |                   placeholder="搜索" | 
			
		
	
		
		
			
				
					
					|  |  |                   :formList="searchFormList2"  |  |  |                   :formList="searchFormList2" | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |                   @handleSearch="handleSearch2"  /> |  |  |                   @handleSearch="handleSearch2"  /> | 
			
		
	
		
		
			
				
					|  |  |               </template> |  |  |               </template> | 
			
		
	
		
		
			
				
					|  |  |                <template slot-scope="scope"> |  |  |                <template slot-scope="scope"> | 
			
		
	
	
		
		
			
				
					|  | @ -142,7 +142,7 @@ export default { | 
			
		
	
		
		
			
				
					|  |  |     }; |  |  |     }; | 
			
		
	
		
		
			
				
					|  |  |   }, |  |  |   }, | 
			
		
	
		
		
			
				
					|  |  |   destroyed() { |  |  |   destroyed() { | 
			
		
	
		
		
			
				
					
					|  |  |      |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |   }, |  |  |   }, | 
			
		
	
		
		
			
				
					|  |  |   methods: { |  |  |   methods: { | 
			
		
	
		
		
			
				
					|  |  |     showRecord(item){ |  |  |     showRecord(item){ | 
			
		
	
	
		
		
			
				
					|  | @ -206,42 +206,79 @@ export default { | 
			
		
	
		
		
			
				
					|  |  |         params.direction = this.direction |  |  |         params.direction = this.direction | 
			
		
	
		
		
			
				
					|  |  |       } |  |  |       } | 
			
		
	
		
		
			
				
					|  |  |       request({ |  |  |       request({ | 
			
		
	
		
		
			
				
					
					|  |  |         url: "/system/status/list", |  |  |         url: "/system/status/listHourSystem", | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |         method: "get", |  |  |         method: "get", | 
			
		
	
		
		
			
				
					|  |  |         params |  |  |         params | 
			
		
	
		
		
			
				
					
					|  |  |       }).then((res) => { |  |  |       }).then(res => { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |         if (res.code == 200) { |  |  |         if (res.code == 200) { | 
			
		
	
		
		
			
				
					
					|  |  |           const _chartsOption = _.cloneDeep(chartsOption) |  |  |           const _chartsOption = _.cloneDeep(chartsOption); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |           this.setStatus("01", "finish"); |  |  |           this.setStatus("01", "finish"); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |           let x = []; |  |  |           let x = []; | 
			
		
	
		
		
			
				
					|  |  |           let serie = []; |  |  |           let serie = []; | 
			
		
	
		
		
			
				
					
					|  |  |           for(let i in res.data){ |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |           // 遍历外层的分类 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           Object.keys(res.data).forEach(i => { | 
			
		
	
		
		
			
				
					|  |  |             const s = _.cloneDeep(chartsOption.series[0]); |  |  |             const s = _.cloneDeep(chartsOption.series[0]); | 
			
		
	
		
		
			
				
					
					|  |  |             if(x.length === 0){ |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |               for(let j in res.data[i]){ |  |  |             // 获取对应分类的设备信息 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 x.push(j) |  |  |             const _deviceType = _.find(deviceType, { value: i }); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |             s.name = _deviceType.label; | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             s.itemStyle.color = _deviceType.color; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             // 遍历该分类下的日期 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             Object.values(res.data[i]).forEach(dateData => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |               // 遍历每个日期下的时间点 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |               Object.keys(dateData).forEach(timeStr => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 // 如果X轴数据还未初始化,则添加时间点 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 if (!x.includes(timeStr)) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   x.push(timeStr); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 // 添加数据点到series | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 s.data.push(parseFloat(dateData[timeStr].replace(/%|W/, ''))); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |               }); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             }); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             serie.push(s); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           }); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           // 对X轴数据进行排序 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           x.sort((a, b) => moment(a).diff(moment(b))); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           // 更新图表选项 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           _chartsOption.xAxis = { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             data: x, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             axisLabel: { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |               formatter: function (value, index) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 const date = moment(value); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 const isSameDay = index > 0 && moment(x[index - 1]).isSame(date, 'day'); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 return  date.format('YYYY-MM-DD'); | 
			
		
	
		
		
			
				
					|  |  |               } |  |  |               } | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |             const _deviceType = _.find(deviceType,{value:i}) |  |  |           }; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             s.name = _deviceType.label |  |  |           // 更新 tooltip 选项,以显示完整的时间格式 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             s.itemStyle.color = _deviceType.color |  |  |           _chartsOption.tooltip = { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             s.data = []; |  |  |             trigger: 'axis', | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             for(let j in res.data[i]){ |  |  |             formatter: function (params) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |               const p = res.data[i][j]; |  |  |               let tooltip = ''; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |               s.data.push(parseFloat(p.substr(0,p.length-1))); |  |  |               params.forEach(param => { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |                 const date = moment(param.name); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 tooltip += `${date.format('YYYY-MM-DD HH:mm')}<br>${param.seriesName}: ${param.value}%<br>`; | 
			
		
	
		
		
			
				
					|  |  |  |  |  |               }); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |               return tooltip; | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |             serie.push(s); |  |  |           }; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |           } |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |           x.sort(function(a,b){return moment(a).diff(moment(b))}) |  |  |           _chartsOption.series = serie; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |           _chartsOption.xAxis.data = x; |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |           _chartsOption.series= serie; |  |  |           // 初始化并设置ECharts图表 | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |           this.queryChart = echarts.init(this.$refs["queryChart"]); |  |  |           this.queryChart = echarts.init(this.$refs["queryChart"]); | 
			
		
	
		
		
			
				
					|  |  |           this.queryChart.setOption(_chartsOption); |  |  |           this.queryChart.setOption(_chartsOption); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         } |  |  |         } | 
			
		
	
		
		
			
				
					|  |  |       }); |  |  |       }); | 
			
		
	
		
		
			
				
					|  |  |     }, |  |  |     }, | 
			
		
	
		
		
			
				
					
					|  |  |      |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |     //查询列表 |  |  |     //查询列表 | 
			
		
	
		
		
			
				
					|  |  |     initQueryTable() { |  |  |     initQueryTable() { | 
			
		
	
		
		
			
				
					|  |  |       this.loading = true; |  |  |       this.loading = true; | 
			
		
	
	
		
		
			
				
					|  | @ -259,7 +296,7 @@ export default { | 
			
		
	
		
		
			
				
					|  |  |       if(this.deviceName){ |  |  |       if(this.deviceName){ | 
			
		
	
		
		
			
				
					|  |  |         params.deviceName = this.deviceName |  |  |         params.deviceName = this.deviceName | 
			
		
	
		
		
			
				
					|  |  |       } |  |  |       } | 
			
		
	
		
		
			
				
					
					|  |  |       |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |       request({ |  |  |       request({ | 
			
		
	
		
		
			
				
					|  |  |         url: "/system/status/tablist", |  |  |         url: "/system/status/tablist", | 
			
		
	
		
		
			
				
					|  |  |         method: "get", |  |  |         method: "get", | 
			
		
	
	
		
		
			
				
					|  | @ -269,7 +306,7 @@ export default { | 
			
		
	
		
		
			
				
					|  |  |           this.loading = false; |  |  |           this.loading = false; | 
			
		
	
		
		
			
				
					|  |  |           this.total = res.total; |  |  |           this.total = res.total; | 
			
		
	
		
		
			
				
					|  |  |           this.tableData = res.rows |  |  |           this.tableData = res.rows | 
			
		
	
		
		
			
				
					
					|  |  |            |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |         } |  |  |         } | 
			
		
	
		
		
			
				
					|  |  |       }); |  |  |       }); | 
			
		
	
		
		
			
				
					|  |  |     }, |  |  |     }, | 
			
		
	
	
		
		
			
				
					|  | @ -288,7 +325,7 @@ export default { | 
			
		
	
		
		
			
				
					|  |  |     }, |  |  |     }, | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     onRefreshData() { |  |  |     onRefreshData() { | 
			
		
	
		
		
			
				
					
					|  |  |        |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |       this.$refs.searchComp.handleResetForm(); |  |  |       this.$refs.searchComp.handleResetForm(); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |       this.searchData.pageNum = 1; |  |  |       this.searchData.pageNum = 1; | 
			
		
	
	
		
		
			
				
					|  | @ -307,12 +344,12 @@ export default { | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |       this.deviceName = data.deviceName |  |  |       this.deviceName = data.deviceName | 
			
		
	
		
		
			
				
					|  |  |       this.direction = data.direction |  |  |       this.direction = data.direction | 
			
		
	
		
		
			
				
					
					|  |  |        |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |       this.initQueryChart(); |  |  |       this.initQueryChart(); | 
			
		
	
		
		
			
				
					
					|  |  |        |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |     }, |  |  |     }, | 
			
		
	
		
		
			
				
					|  |  |     handleSearch2(data){ |  |  |     handleSearch2(data){ | 
			
		
	
		
		
			
				
					
					|  |  |        |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |       this.searchData.pageNum = 1; |  |  |       this.searchData.pageNum = 1; | 
			
		
	
		
		
			
				
					|  |  |       this.tabelSearch = data; |  |  |       this.tabelSearch = data; | 
			
		
	
		
		
			
				
					|  |  |       this.initQueryTable(); |  |  |       this.initQueryTable(); | 
			
		
	
	
		
		
			
				
					|  | @ -342,7 +379,7 @@ export default { | 
			
		
	
		
		
			
				
					|  |  |       if(t === '1'){ |  |  |       if(t === '1'){ | 
			
		
	
		
		
			
				
					|  |  |         params.exportType='1' |  |  |         params.exportType='1' | 
			
		
	
		
		
			
				
					|  |  |         fileName = '设备丢包信息.xlsx' |  |  |         fileName = '设备丢包信息.xlsx' | 
			
		
	
		
		
			
				
					
					|  |  |       }         |  |  |       } | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |       getSystemStatusExport(params) |  |  |       getSystemStatusExport(params) | 
			
		
	
		
		
			
				
					|  |  |         .then((res) => { |  |  |         .then((res) => { | 
			
		
	
		
		
			
				
					|  |  |           const url = window.URL.createObjectURL(new Blob([res])); |  |  |           const url = window.URL.createObjectURL(new Blob([res])); | 
			
		
	
	
		
		
			
				
					|  | @ -377,7 +414,7 @@ export default { | 
			
		
	
		
		
			
				
					|  |  |         this.queryChart.resize(); |  |  |         this.queryChart.resize(); | 
			
		
	
		
		
			
				
					|  |  |       } |  |  |       } | 
			
		
	
		
		
			
				
					|  |  |     }); |  |  |     }); | 
			
		
	
		
		
			
				
					
					|  |  |      |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |   }, |  |  |   }, | 
			
		
	
		
		
			
				
					|  |  | }; |  |  | }; | 
			
		
	
		
		
			
				
					|  |  | </script> |  |  | </script> | 
			
		
	
	
		
		
			
				
					|  | 
 |