Browse Source

修改预案

wangqin
王钦 6 months ago
parent
commit
8da670830f
  1. 77
      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

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

@ -3,26 +3,24 @@
<div class="RoadNetworkFacilities">
<div class="header">
<Video class="video-stream" :pileNum="dialogData.stakeMark" rangeIndex="upCamera" :showHeader="false" />
<!-- <Video class="video-stream" :pileNum="dialogData.stakeMark" /> -->
</div>
<div class="SolarEnergy">
<ElTabs v-model="activeName" class="tabs">
<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" />
</ElTabPane>
<ElTabPane label="测点历史数据">
<el-date-picker
v-model="daterangeChangeTime"
size="mini"
style="width: 320px;float:right;margin-bottom: 10px;"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
<ElTabPane label="测点历史数据" v-if="dialogData.facilityType === 9">
<el-date-picker v-model="daterangeChangeTime" size="mini"
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" />
</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>
</div>
@ -67,18 +65,29 @@ 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();
},
},
activeName:{
handler(val){
if(val.indexOf('UPS_') !== -1){
this.bindUPS(val.substr(4))
}
}
}
},
async created() {
let dData = { ...this.dialogData };
@ -88,7 +97,7 @@ export default {
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({
@ -97,25 +106,46 @@ export default {
});
if (resPointList.code != 200) return Message.error(resPointList?.msg);
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]
}
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:{
params: {
projCode: this.data.pro_code,
unitCode: this.data.unit_code,
meaPointNum: this.data.meaPointNum,
@ -143,14 +173,12 @@ export default {
</script>
<style lang="scss" scoped>
.LineChart {
width: 450px !important;
height: 160px;
overflow: hidden;
}
.RoadNetworkFacilities {
width: 452px;
color: #fff;
@ -183,6 +211,7 @@ export default {
display: flex;
flex-direction: column;
height: 260px;
::v-deep {
.el-tabs__content {
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)
},
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) {
let dcArr = [];
this.tableData.forEach((item) => {
@ -179,30 +222,9 @@ export default {
if (item.devList && item.devList.length > 0) {
dcData.deviceList = item.devList.join(",");
}
let zxData = {},
hfData = {};
if(item.executeConfig){
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);
dcData.executeConfig = JSON.stringify(item.executeConfig);
dcData.recoverConfig = JSON.stringify(item.recoverConfig);
dcArr.push(dcData);
});

Loading…
Cancel
Save