From 8da670830f786db7942867e6300ffd2edef1a867 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E9=92=A6?= <360013221@qq.com>
Date: Wed, 22 May 2024 15:33:41 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E6=A1=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Dialogs/RoadNetworkFacilities/index.vue | 107 +++++++++++-------
.../Cards/DeviceControl/index.vue | 70 ++++++++----
2 files changed, 114 insertions(+), 63 deletions(-)
diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/RoadNetworkFacilities/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/RoadNetworkFacilities/index.vue
index 6991dcd6..be806bc6 100644
--- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/RoadNetworkFacilities/index.vue
+++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/RoadNetworkFacilities/index.vue
@@ -3,26 +3,24 @@
@@ -67,61 +65,93 @@ export default {
deviceVendors: "XXX厂家",
},
formList: [],
- dateRange:[],
- daterangeChangeTime:[]
+ dateRange: [],
+ daterangeChangeTime: [],
+ upsList:[],
+ upsData:[],
+ // 收费站增加UPS
+ upsList:['SNMP']
};
},
watch: {
daterangeChangeTime: {
handler(val) {
- this.dateRange = [moment(val[0]).valueOf(),moment(val[1]).valueOf()];
+ this.dateRange = [moment(val[0]).valueOf(), moment(val[1]).valueOf()];
- this.bindListAsync();
+ this.bindListAsync();
},
},
+ activeName:{
+ handler(val){
+ if(val.indexOf('UPS_') !== -1){
+ this.bindUPS(val.substr(4))
+ }
+ }
+ }
},
async created() {
let dData = { ...this.dialogData };
this.formList = tabList[dData.facilityType]
-
+
if (dData.facilityType)
if (dData.otherConfig) {
let otherConfig = JSON.parse(dData.otherConfig);
dData.latitude = otherConfig.dimension
- if(dData.direction){
+ if (dData.direction) {
dData.direction = DirectionTypes[dData.direction]
}
let resPointList = await request({
- url: `sideSlope/GetMeasurePointList`,
- method: "get",
+ url: `sideSlope/GetMeasurePointList`,
+ method: "get",
});
if (resPointList.code != 200) return Message.error(resPointList?.msg);
let pointList = {};
- if(resPointList.data && resPointList.data.result && resPointList.data.result.length > 0){
- pointList = resPointList.data.result[0]
+ if (resPointList.data && resPointList.data.result && resPointList.data.result.length > 0) {
+ pointList = resPointList.data.result[0]
}
- dData = { ...dData, ...otherConfig,...pointList }
+ dData = { ...dData, ...otherConfig, ...pointList }
//获取历史数据echart
-
+
}
this.data = dData;
- this.daterangeChangeTime = [moment().startOf('months').format('YYYY-MM-DD'),moment().endOf('months').format('YYYY-MM-DD')]
-
+ this.daterangeChangeTime = [moment().startOf('months').format('YYYY-MM-DD'), moment().endOf('months').format('YYYY-MM-DD')]
+
console.log('this.data', this.data)
},
methods: {
- async bindListAsync(){
+ bindUPS(id){
+ request({
+ url: `business/device/properties/latest/${id}`,
+ method: "get"
+ }).then(res=>{
+ let _list = [];
+ let _data = {};
+
+ if (res.code != 200) return Message.error(res?.msg);
+ res.data.forEach(e => {
+ _list.push( {
+ label: e.propertyName,
+ key: e.propertyName,
+ gridColumn: "3",
+ })
+ _data[e.propertyName] = e.formatValue;
+ });
+ this.upsList = _list;
+ this.upsData = _data;
+ })
+ },
+ async bindListAsync() {
let res = await request({
- url: `sideSlope/GetPointDataListAsync`,
- method: "get",
- params:{
- projCode: this.data.pro_code,
- unitCode: this.data.unit_code,
- meaPointNum: this.data.meaPointNum,
- starttime: this.dateRange[0],
- endtime: this.dateRange[1],
- }
+ url: `sideSlope/GetPointDataListAsync`,
+ method: "get",
+ params: {
+ projCode: this.data.pro_code,
+ unitCode: this.data.unit_code,
+ meaPointNum: this.data.meaPointNum,
+ starttime: this.dateRange[0],
+ endtime: this.dateRange[1],
+ }
});
if (res.code != 200) return Message.error(res?.msg);
const cdata = [];
@@ -143,14 +173,12 @@ export default {