Browse Source

完善设备管控

wangqin
hui 7 months ago
parent
commit
93cc07cb20
  1. 7
      ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/AddNEditDialog.vue
  2. 31
      ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/TaskItem.vue
  3. 17
      ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/taskEditDialog.vue
  4. 10
      ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/timeEditDialog.vue
  5. 8
      ruoyi-ui/src/views/JiHeExpressway/pages/datav/gisAndBim/index.vue
  6. 11
      ruoyi-ui/src/views/JiHeExpressway/utils/api/batch.js

7
ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/AddNEditDialog.vue

@ -128,6 +128,7 @@ export default {
return this.visible; return this.visible;
}, },
set(val) { set(val) {
this.$emit("onSuccess");
this.$emit("update:value", val); this.$emit("update:value", val);
}, },
}, },
@ -143,6 +144,7 @@ export default {
// : { // : {
// ...this.propData, // ...this.propData,
// }; // };
this.taskGroupsEditing = [];
this.initEditingData(); this.initEditingData();
this.getTaskList(); this.getTaskList();
}, },
@ -163,6 +165,7 @@ export default {
methods: { methods: {
onSubmitTaskItem(){ onSubmitTaskItem(){
this.isEditing = false; this.isEditing = false;
this.selectedTaskGroup = {};
request({ request({
url: `/business/dcBatchFunctionsJobGroup/${this.propData.id}`, url: `/business/dcBatchFunctionsJobGroup/${this.propData.id}`,
method: "GET" method: "GET"
@ -207,9 +210,9 @@ export default {
}, },
onSubmitTime(time){ onSubmitTime(time){
this.isShowTimeEdit = false; this.isShowTimeEdit = false;
if (Object.keys(this.selectedTaskGroup).length>0){
if (this.selectedTaskGroup){
this.selectedTaskGroup.time = time; this.selectedTaskGroup.time = time;
this.selectedTaskGroup = {};
}else{ }else{
this.taskGroupsEditing.push({ time, tasks: [] }); this.taskGroupsEditing.push({ time, tasks: [] });
} }

31
ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/TaskItem.vue

@ -18,15 +18,18 @@
</BoardRecordPreview> </BoardRecordPreview>
</template> </template>
<template v-if="editData.deviceType == '5'"> <template v-if="editData.deviceType == '5'">
<p class="text">{{ editData.params.text }}</p> <p class="text">内容{{ editData.params.text }}</p>
</template> </template>
<template v-if="editData.deviceType == '2'"> <template v-if="editData.deviceType == '10'">
<div class="center">
<p>{{ gzmsDic[editData.params.SETMD] }}</p>
<p>时长{{ editData.params.SETTM }}</p>
</div>
</template> </template>
<template v-if="editData.deviceType == '2'"> <template v-if="editData.deviceType == '12'">
</template> </template>
<template v-if="editData.deviceType == '2'"> <template v-if="editData.deviceType == '13'">
</template> </template>
@ -45,7 +48,7 @@
<script> <script>
import request from "@/utils/request"; import request from "@/utils/request";
import { deviceTypeDic } from "@screen/utils/enum.js" import { deviceTypeDic, gzmsMap } from "@screen/utils/enum.js"
import { getDeviceList } from "@screen/utils/api/device.js" import { getDeviceList } from "@screen/utils/api/device.js"
import taskEditDialog from "./taskEditDialog.vue"; import taskEditDialog from "./taskEditDialog.vue";
import BoardRecordPreview from '@screen/components/infoBoard/BoardRecordPreview.vue' import BoardRecordPreview from '@screen/components/infoBoard/BoardRecordPreview.vue'
@ -66,6 +69,7 @@ export default {
isEditingTask: false, isEditingTask: false,
selectedType:"", selectedType:"",
deviceTypeDic:"", deviceTypeDic:"",
gzmsMap:"",
deviceDic:{}, deviceDic:{},
deviceList:[] deviceList:[]
}; };
@ -78,6 +82,7 @@ export default {
}, },
mounted() { mounted() {
this.deviceTypeDic = deviceTypeDic; this.deviceTypeDic = deviceTypeDic;
this.gzmsDic = gzmsMap;
this.isCompReady = true; this.isCompReady = true;
console.log(JSON.parse(this.propData.callParameter || '[{}]')[0], "++++=====######"); console.log(JSON.parse(this.propData.callParameter || '[{}]')[0], "++++=====######");
this.initBasicData().then(res=>{ this.initBasicData().then(res=>{
@ -86,16 +91,23 @@ export default {
//BoardRecordPreview //BoardRecordPreview
if(temp.functions){ if(temp.functions){
// temp.functions[1].params.CONTENT = temp.functions[1].params.CONTENT.replaceAll(/\\n/g, '\\\\n').replaceAll(/=/g, '\\=').replaceAll(/,/g, '\\,').replaceAll(/&nbsp/g, ' '); // temp.functions[1].params.CONTENT = temp.functions[1].params.CONTENT.replaceAll(/\\n/g, '\\\\n').replaceAll(/=/g, '\\=').replaceAll(/,/g, '\\,').replaceAll(/&nbsp/g, ' ');
let paramsIndex = 0; let params = {};
if (temp.deviceType == '2'){ if (temp.deviceType == '2'){
paramsIndex = 1; params = temp.functions[1].params
} else if (temp.deviceType == '5'){
params = temp.functions[0].params
} else if (temp.deviceType == '10') {
params = {
SETMD: temp.functions[0].params.SET,
SETTM: temp.functions[1].params.SET,
}
} }
this.editData = { this.editData = {
id: this.propData.jobId, id: this.propData.jobId,
direction: temp.direction, direction: temp.direction,
deviceType: temp.deviceType, deviceType: temp.deviceType,
devices: temp.devices, devices: temp.devices,
params: temp.functions[paramsIndex].params, params,
screenSize: temp.screenSize screenSize: temp.screenSize
}; };
}else{ }else{
@ -159,6 +171,7 @@ export default {
.content{ width: 300px; display: flex; align-items: stretch; .content{ width: 300px; display: flex; align-items: stretch;
.board{ flex: 1; } .board{ flex: 1; }
.text{ flex: 1; display: flex; align-items: center; justify-content: center; word-break: break-all;} .text{ flex: 1; display: flex; align-items: center; justify-content: center; word-break: break-all;}
.center{ flex: 1; text-align: center;}
} }
.button{ width:140px; margin-left: 10px} .button{ width:140px; margin-left: 10px}
} }

17
ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/taskEditDialog.vue

@ -69,13 +69,13 @@
<template v-else-if="searchData.deviceType == '10'"> <template v-else-if="searchData.deviceType == '10'">
<!-- 激光疲劳唤醒 --> <!-- 激光疲劳唤醒 -->
<el-form-item label="工作模式"> <el-form-item label="工作模式">
<el-select v-model="editData.type10.mode" placeholder="请选择"> <el-select v-model="editData.type10.SETMD" placeholder="请选择">
<el-option v-for="value,key in gzmsMap" :key="key" :label="value" :value="key" /> <el-option v-for="value,key in gzmsMap" :key="key" :label="value" :value="key" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="工作时长"> <el-form-item label="工作时长">
<el-col :span="8"> <el-col :span="8">
<el-input-number v-model="editData.type10.timeLength" :min="1" :max="600" label="描述文字" /> <el-input-number v-model="editData.type10.SETTM" :min="0" :max="100000" />
</el-col> </el-col>
<!-- <el-col :span="4" style="margin-left: 10px;">分钟</el-col> --> <!-- <el-col :span="4" style="margin-left: 10px;">分钟</el-col> -->
</el-form-item> </el-form-item>
@ -206,8 +206,8 @@ export default {
// { "STAY": 90, "ACTION": "1", "SPEED": "0", "COLOR": "ffff00", "FONT": "3", "FONT_SIZE": "24", "CONTENT": "\\\\n", "width": "160", "height": "80", "formatStyle": "2" } // { "STAY": 90, "ACTION": "1", "SPEED": "0", "COLOR": "ffff00", "FONT": "3", "FONT_SIZE": "24", "CONTENT": "\\\\n", "width": "160", "height": "80", "formatStyle": "2" }
if (this.propData.deviceType == "2"){ if (this.propData.deviceType == "2"){
this.editData.type2 = BoardUtils.contentToDeviceItem(this.propData.params); this.editData.type2 = BoardUtils.contentToDeviceItem(this.propData.params);
} else if (this.propData.deviceType == "5"){ } else if (this.propData.deviceType == "5" || this.propData.deviceType == "10"){
this.editData.type5 = { ...this.propData.params}; this.editData["type" + this.propData.deviceType] = { ...this.propData.params};
} }
}else{ }else{
this.searchData.deviceType = ""; this.searchData.deviceType = "";
@ -304,17 +304,16 @@ export default {
} }
} else if (this.searchData.deviceType == "10") { } else if (this.searchData.deviceType == "10") {
return { return {
mode: editData.type10.mode, SETMD: this.editData.type10.SETMD,
timeLength: editData.type10.timeLength SETTM: this.editData.type10.SETTM
} }
} else if (this.searchData.deviceType == "12") { } else if (this.searchData.deviceType == "12") {
return { return {
mode: editData.type12.mode,
timeLength: editData.type12.timeLength
} }
} else if (this.searchData.deviceType == "13") { } else if (this.searchData.deviceType == "13") {
return { return {
switch: editData.type13.switch
} }
} }
}, },

10
ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/timeEditDialog.vue

@ -1,11 +1,11 @@
<template> <template>
<Dialog v-model="modelVisible" title="修改" width="400px" label-width="120px"> <Dialog v-model="modelVisible" title="触发时间设置" width="400px" label-width="120px">
<el-form> <el-form>
<el-form-item label="时"> <el-form-item label="时(支持cron表达式)">
<el-input v-model="editData.hour"></el-input> <el-input v-model="editData.hour"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="分"> <el-form-item label="分(支持cron表达式)">
<el-input v-model="editData.minute"></el-input> <el-input v-model="editData.minute"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="mini" type="primary" @click="onSubmit">保存</el-button> <el-button size="mini" type="primary" @click="onSubmit">保存</el-button>

8
ruoyi-ui/src/views/JiHeExpressway/pages/datav/gisAndBim/index.vue

@ -37,10 +37,10 @@ export default {
} }
}, },
mounted() { mounted() {
this.alarmUrl = "http://10.0.86.37:81/?HoveringMouse=true&LightMode=false"; // this.alarmUrl = "http://10.0.86.37:81/?HoveringMouse=true&LightMode=false";
// getConfigKey("dc.alarmUrl").then((res) => { getConfigKey("dc.gisAndBim").then((res) => {
// this.alarmUrl = res.msg this.alarmUrl = res.msg
// }); });
} }
} }
</script> </script>

11
ruoyi-ui/src/views/JiHeExpressway/utils/api/batch.js

@ -46,6 +46,17 @@ export function submitTaskRequest(id, jobGroup, time, devices, params, others) {
} }
] ]
} else if (deviceType == '10') { //疲劳唤醒
functions = [
{
"functionId": "SETMD",
"params": { SET: params.SETMD }
},
{
"functionId": "SETTM",
"params": { SET: params.SETTM }
}
]
} }
let temp = [{ let temp = [{

Loading…
Cancel
Save