From 3fbbee6d2b4800dbc50bbabb01830ec983a1bc25 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com>
Date: Wed, 30 Oct 2024 15:25:26 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=9C=A8=E7=BA=BF=E5=88=86?=
=?UTF-8?q?=E6=9E=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DisposalProcess/DialogProcess/index.vue | 12 +-
.../components/deviceSummary/index.vue | 4 +-
.../smart/statisticalAnalysis/query/index.vue | 107 ++++++++++++------
3 files changed, 80 insertions(+), 43 deletions(-)
diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DisposalProcess/DialogProcess/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DisposalProcess/DialogProcess/index.vue
index ff991c74..e216c49f 100644
--- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DisposalProcess/DialogProcess/index.vue
+++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DisposalProcess/DialogProcess/index.vue
@@ -290,7 +290,7 @@
">
{{ formFileData.content }}
-
+
{
+ addEventImportantFile(data).then((res) => {
if (res.code != 200) return Message.error(res?.msg);
this.$message.success('报送成功')
this.submitting = false;
@@ -720,7 +720,7 @@ export default {
this.reload();
});
}
-
+
this.getImportantFileStatus();
if (this.activeName == "second") {
this.getEventImportantFileList(1);
diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/statisticalAnalysis/analysis/components/deviceSummary/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/statisticalAnalysis/analysis/components/deviceSummary/index.vue
index 883ae52f..d12129c1 100644
--- a/ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/statisticalAnalysis/analysis/components/deviceSummary/index.vue
+++ b/ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/statisticalAnalysis/analysis/components/deviceSummary/index.vue
@@ -124,12 +124,12 @@
{{ item.pctOffl }}
-
-
-
@@ -142,7 +142,7 @@ export default {
};
},
destroyed() {
-
+
},
methods: {
showRecord(item){
@@ -206,42 +206,79 @@ 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)));
+ };
+ // 更新 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')}
${param.seriesName}: ${param.value}%
`;
+ });
+ return tooltip;
}
- serie.push(s);
- }
- 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);
-
}
});
},
-
+
//查询列表
initQueryTable() {
this.loading = true;
@@ -259,7 +296,7 @@ export default {
if(this.deviceName){
params.deviceName = this.deviceName
}
-
+
request({
url: "/system/status/tablist",
method: "get",
@@ -269,7 +306,7 @@ export default {
this.loading = false;
this.total = res.total;
this.tableData = res.rows
-
+
}
});
},
@@ -288,7 +325,7 @@ export default {
},
onRefreshData() {
-
+
this.$refs.searchComp.handleResetForm();
this.searchData.pageNum = 1;
@@ -307,12 +344,12 @@ export default {
this.deviceName = data.deviceName
this.direction = data.direction
-
+
this.initQueryChart();
-
+
},
handleSearch2(data){
-
+
this.searchData.pageNum = 1;
this.tabelSearch = data;
this.initQueryTable();
@@ -342,7 +379,7 @@ export default {
if(t === '1'){
params.exportType='1'
fileName = '设备丢包信息.xlsx'
- }
+ }
getSystemStatusExport(params)
.then((res) => {
const url = window.URL.createObjectURL(new Blob([res]));
@@ -377,7 +414,7 @@ export default {
this.queryChart.resize();
}
});
-
+
},
};