Browse Source

修改预案

wangqin
王钦 6 months ago
parent
commit
8da670830f
  1. 101
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/RoadNetworkFacilities/index.vue
  2. 70
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/index.vue

101
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/RoadNetworkFacilities/index.vue

@ -3,26 +3,24 @@
<div class="RoadNetworkFacilities"> <div class="RoadNetworkFacilities">
<div class="header"> <div class="header">
<Video class="video-stream" :pileNum="dialogData.stakeMark" rangeIndex="upCamera" :showHeader="false" /> <Video class="video-stream" :pileNum="dialogData.stakeMark" rangeIndex="upCamera" :showHeader="false" />
<!-- <Video class="video-stream" :pileNum="dialogData.stakeMark" /> -->
</div> </div>
<div class="SolarEnergy"> <div class="SolarEnergy">
<ElTabs v-model="activeName" class="tabs"> <ElTabs v-model="activeName" class="tabs">
<ElTabPane v-for="item in formList" :key="item.key" :label="item.name" :name="item.key"> <ElTabPane v-for="item in formList" :key="item.key" :label="item.name" :name="item.key">
<Descriptions :labelWidth="item.labelWidth" :list="item.list" :data="data" style="gap: 12px" column="6" /> <Descriptions :labelWidth="item.labelWidth" :list="item.list" :data="data" style="gap: 12px" column="6" />
</ElTabPane> </ElTabPane>
<ElTabPane label="测点历史数据"> <ElTabPane label="测点历史数据" v-if="dialogData.facilityType === 9">
<el-date-picker <el-date-picker v-model="daterangeChangeTime" size="mini"
v-model="daterangeChangeTime" style="width: 320px;float:right;margin-bottom: 10px;" value-format="yyyy-MM-dd" type="daterange"
size="mini" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
style="width: 320px;float:right;margin-bottom: 10px;"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
<div class='chart LineChart' ref="chartRef" /> <div class='chart LineChart' ref="chartRef" />
</ElTabPane> </ElTabPane>
<ElTabPane :label="item" :key="'UPS_'+item" :name="'UPS_'+item" v-for="item in upsList" v-if="dialogData.facilityType === 1">
<Descriptions labelWidth="142px" :list="upsList" :data="upsData" style="gap: 12px" column="6" />
</ElTabPane>
</ElTabs> </ElTabs>
</div> </div>
@ -67,18 +65,29 @@ export default {
deviceVendors: "XXX厂家", deviceVendors: "XXX厂家",
}, },
formList: [], formList: [],
dateRange:[], dateRange: [],
daterangeChangeTime:[] daterangeChangeTime: [],
upsList:[],
upsData:[],
// UPS
upsList:['SNMP']
}; };
}, },
watch: { watch: {
daterangeChangeTime: { daterangeChangeTime: {
handler(val) { 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() { async created() {
let dData = { ...this.dialogData }; let dData = { ...this.dialogData };
@ -88,40 +97,61 @@ export default {
if (dData.otherConfig) { if (dData.otherConfig) {
let otherConfig = JSON.parse(dData.otherConfig); let otherConfig = JSON.parse(dData.otherConfig);
dData.latitude = otherConfig.dimension dData.latitude = otherConfig.dimension
if(dData.direction){ if (dData.direction) {
dData.direction = DirectionTypes[dData.direction] dData.direction = DirectionTypes[dData.direction]
} }
let resPointList = await request({ let resPointList = await request({
url: `sideSlope/GetMeasurePointList`, url: `sideSlope/GetMeasurePointList`,
method: "get", method: "get",
}); });
if (resPointList.code != 200) return Message.error(resPointList?.msg); if (resPointList.code != 200) return Message.error(resPointList?.msg);
let pointList = {}; let pointList = {};
if(resPointList.data && resPointList.data.result && resPointList.data.result.length > 0){ if (resPointList.data && resPointList.data.result && resPointList.data.result.length > 0) {
pointList = resPointList.data.result[0] pointList = resPointList.data.result[0]
} }
dData = { ...dData, ...otherConfig,...pointList } dData = { ...dData, ...otherConfig, ...pointList }
//echart //echart
} }
this.data = dData; 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) console.log('this.data', this.data)
}, },
methods: { 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({ let res = await request({
url: `sideSlope/GetPointDataListAsync`, url: `sideSlope/GetPointDataListAsync`,
method: "get", method: "get",
params:{ params: {
projCode: this.data.pro_code, projCode: this.data.pro_code,
unitCode: this.data.unit_code, unitCode: this.data.unit_code,
meaPointNum: this.data.meaPointNum, meaPointNum: this.data.meaPointNum,
starttime: this.dateRange[0], starttime: this.dateRange[0],
endtime: this.dateRange[1], endtime: this.dateRange[1],
} }
}); });
if (res.code != 200) return Message.error(res?.msg); if (res.code != 200) return Message.error(res?.msg);
const cdata = []; const cdata = [];
@ -143,14 +173,12 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.LineChart { .LineChart {
width: 450px !important; width: 450px !important;
height: 160px; height: 160px;
overflow: hidden; overflow: hidden;
} }
.RoadNetworkFacilities { .RoadNetworkFacilities {
width: 452px; width: 452px;
color: #fff; color: #fff;
@ -183,6 +211,7 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 260px; height: 260px;
::v-deep { ::v-deep {
.el-tabs__content { .el-tabs__content {
flex: 1; flex: 1;

70
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/index.vue

@ -168,6 +168,49 @@ export default {
} }
this.tableData = _.cloneDeep(this.tableData) this.tableData = _.cloneDeep(this.tableData)
}, },
formatData(it, value = 1) {
let data = { ...it, actionType: value, emergencyPlansId: id };
if (
it.deviceList &&
typeof it.deviceList !== "string" &&
it.deviceList.length > 0
) {
data.deviceList = it.deviceList.join(",");
} else {
data.deviceList = "";
}
if (it.content) {
data.otherConfig = JSON.stringify({ content: it.content });
}
if (it.controlModel) {
let other = {
controlModel: it.controlModel,
controlModelName: inducerModeDic[it.controlModel],
state: it.state,
name: inducerWorkTypeDic[it.state],
};
if (it.time && it?.time[0]) {
other = {
controlModel: it.controlModel,
controlModelName: inducerModeDic[it.controlModel],
state: it.state,
name: inducerWorkTypeDic[it.state],
startTime: it.time[0],
endTime: it.time[1],
};
}
data.otherConfig = JSON.stringify(other);
}
if (it.gzms) {
data.otherConfig = JSON.stringify({
state: it.gzms,
name: gzmsMap[it.gzms],
operationDuration: it.operationDuration,
});
}
return data;
},
handleSubmit(value = 1) { handleSubmit(value = 1) {
let dcArr = []; let dcArr = [];
this.tableData.forEach((item) => { this.tableData.forEach((item) => {
@ -179,30 +222,9 @@ export default {
if (item.devList && item.devList.length > 0) { if (item.devList && item.devList.length > 0) {
dcData.deviceList = item.devList.join(","); dcData.deviceList = item.devList.join(",");
} }
let zxData = {},
hfData = {}; dcData.executeConfig = JSON.stringify(item.executeConfig);
if(item.executeConfig){ dcData.recoverConfig = JSON.stringify(item.recoverConfig);
zxData['executeConfig'] = item.executeConfig
}
if(item.recoverConfig){
zxData['recoverConfig'] = item.recoverConfig
}
Object.keys(item).forEach((key) => {
if (/^zx_/.test(key)) {
let keyName = key.substring(3);
zxData[keyName] = item[key];
}
if (/^hf_/.test(key)) {
let keyName = key.substring(3);
hfData[keyName] = item[key];
}
});
if (item.deviceType == 12) {
zxData = this.formatData(zxData);
hfData = this.formatData(hfData);
}
dcData.executeConfig = JSON.stringify(zxData);
dcData.recoverConfig = JSON.stringify(hfData);
dcArr.push(dcData); dcArr.push(dcData);
}); });

Loading…
Cancel
Save