Browse Source

设备在线分析

develop
王兴琳 4 weeks ago
parent
commit
3fbbee6d2b
  1. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/statisticalAnalysis/analysis/components/deviceSummary/index.vue
  2. 75
      ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/statisticalAnalysis/query/index.vue

4
ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/statisticalAnalysis/analysis/components/deviceSummary/index.vue

@ -124,12 +124,12 @@
{{ item.pctOffl }}
</div>
</div>
<div class="list-text">
<!-- <div class="list-text">
<span class="title">丢包</span>
<div class="value value3">
{{ item.pctLose }}
</div>
</div>
</div>-->
</div>
</div>
</div>

75
ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/statisticalAnalysis/query/index.vue

@ -206,38 +206,75 @@ export default {
params.direction = this.direction
}
request({
url: "/system/status/list",
url: "/system/status/listHourSystem",
method: "get",
params
}).then((res) => {
}).then(res => {
if (res.code == 200) {
const _chartsOption = _.cloneDeep(chartsOption)
const _chartsOption = _.cloneDeep(chartsOption);
this.setStatus("01", "finish");
let x = [];
let serie = [];
for(let i in res.data){
//
Object.keys(res.data).forEach(i => {
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
s.itemStyle.color = _deviceType.color
s.data = [];
for(let j in res.data[i]){
const p = res.data[i][j];
s.data.push(parseFloat(p.substr(0,p.length-1)));
}
serie.push(s);
};
// tooltip
_chartsOption.tooltip = {
trigger: 'axis',
formatter: function (params) {
let tooltip = '';
params.forEach(param => {
const date = moment(param.name);
tooltip += `${date.format('YYYY-MM-DD HH:mm')}<br>${param.seriesName}: ${param.value}%<br>`;
});
return tooltip;
}
x.sort(function(a,b){return moment(a).diff(moment(b))})
_chartsOption.xAxis.data = x;
_chartsOption.series= serie;
};
_chartsOption.series = serie;
// ECharts
this.queryChart = echarts.init(this.$refs["queryChart"]);
this.queryChart.setOption(_chartsOption);
}
});
},

Loading…
Cancel
Save