Browse Source

更新

wangqin
hui 7 months ago
parent
commit
a0e2188b24
  1. 5
      ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/AddNEditDialog.vue
  2. 12
      ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/TaskItem.vue
  3. 24
      ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/taskEditDialog.vue
  4. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/timeEditDialog.vue
  5. 37
      ruoyi-ui/src/views/JiHeExpressway/utils/api/batch.js

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

@ -39,6 +39,7 @@
</div> </div>
</div> </div>
<div> <div>
<!-- <p v-for="item, index1 in taskGroup.tasksEdit">{{ item }}</p> -->
<TaskItem v-for="item, index1 in taskGroup.tasksEdit" :propData="item" :groupId="propData.id" <TaskItem v-for="item, index1 in taskGroup.tasksEdit" :propData="item" :groupId="propData.id"
:time="taskGroup.time" @onSubmit="onSubmitTaskItem"> :time="taskGroup.time" @onSubmit="onSubmitTaskItem">
</TaskItem> </TaskItem>
@ -358,13 +359,13 @@ export default {
} }
} }
.all_groups{ .all_groups{
border: 1px solid #09B;
max-height:500px; max-height:500px;
overflow-y: scroll; overflow-y: scroll;
} }
.task_group{ .task_group{
border: 1px solid #09B;
.task_info{ .task_info{
padding:10px 0; background: #005070; padding:10px 0; background: #004050;
.time_show{ .time_show{
color: #0AC; color: #0AC;
} }

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

@ -2,7 +2,6 @@
<div class="task_editor_box" v-if="isCompReady"> <div class="task_editor_box" v-if="isCompReady">
<div class="flex main_ctt"> <div class="flex main_ctt">
<div class="device_type"> <div class="device_type">
设备类型:
<span v-if="editData.deviceType">{{ deviceTypeDic[editData.deviceType].label }}</span> <span v-if="editData.deviceType">{{ deviceTypeDic[editData.deviceType].label }}</span>
</div> </div>
<div class="devices"> <div class="devices">
@ -19,7 +18,7 @@
</BoardRecordPreview> </BoardRecordPreview>
</template> </template>
<template v-if="editData.deviceType == '5'"> <template v-if="editData.deviceType == '5'">
<p class="text">{{ editData.params.text }}</p>
</template> </template>
<template v-if="editData.deviceType == '2'"> <template v-if="editData.deviceType == '2'">
@ -87,12 +86,16 @@ 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;
if (temp.deviceType == '2'){
paramsIndex = 1;
}
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[1].params, params: temp.functions[paramsIndex].params,
screenSize: temp.screenSize screenSize: temp.screenSize
}; };
}else{ }else{
@ -131,7 +134,7 @@ export default {
initBasicData(){ initBasicData(){
this.deviceDic = {}; this.deviceDic = {};
return getDeviceList({ deviceType: this.editData.deviceType }).then(res=>{ return getDeviceList({ deviceType: JSON.parse(this.propData.callParameter || '[{}]')[0].deviceType }).then(res=>{
this.deviceList = res.data; this.deviceList = res.data;
res.data.forEach(item=>{ res.data.forEach(item=>{
// this.deviceOptions.push({ // this.deviceOptions.push({
@ -155,6 +158,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;}
} }
.button{ width:140px; margin-left: 10px} .button{ width:140px; margin-left: 10px}
} }

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

@ -6,7 +6,7 @@
<el-radio-button v-for="item in deviceTypeOptions" :key="item.value" :label="item.label" :value="item.value" <el-radio-button v-for="item in deviceTypeOptions" :key="item.value" :label="item.label" :value="item.value"
v-if="item.timingControl"></el-radio-button> v-if="item.timingControl"></el-radio-button>
</el-radio-group> --> </el-radio-group> -->
<el-select v-model="searchData.deviceType" placeholder="请选择设备类型" @change="onChange"> <el-select v-model="searchData.deviceType" placeholder="请选择设备类型" @change="onSelectDeviceType">
<el-option v-for="item in deviceTypeOptions" :key="item.value" :label="item.label" :value="item.value+''" <el-option v-for="item in deviceTypeOptions" :key="item.value" :label="item.label" :value="item.value+''"
v-if="item.timingControl"> v-if="item.timingControl">
</el-option> </el-option>
@ -62,7 +62,7 @@
<template v-else-if="searchData.deviceType == '5'"> <template v-else-if="searchData.deviceType == '5'">
<!-- 语音广播 --> <!-- 语音广播 -->
<el-form-item label="广播内容"> <el-form-item label="广播内容">
<el-input type="textarea" v-model="editData.type5.content"></el-input> <el-input type="textarea" v-model="editData.type5.text"></el-input>
</el-form-item> </el-form-item>
</template> </template>
@ -204,13 +204,16 @@ export default {
this.filterData.screenSize = this.propData.screenSize; this.filterData.screenSize = this.propData.screenSize;
this.editData.devices = _.map(this.propData.devices, "id"); this.editData.devices = _.map(this.propData.devices, "id");
// { "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"){
this.editData.type2 = BoardUtils.contentToDeviceItem(this.propData.params); this.editData.type2 = BoardUtils.contentToDeviceItem(this.propData.params);
} else if (this.propData.deviceType == "5"){
this.editData.type5 = { ...this.propData.params};
}
}else{ }else{
this.searchData.deviceType = ""; this.searchData.deviceType = "";
this.searchData.direction = ""; this.searchData.direction = "";
this.filterData.screenSize = ""; this.filterData.screenSize = "";
this.editData.devices = []; this.editData.devices = [];
this.editData.type2 = {};
} }
}, },
onEditBoard(){ onEditBoard(){
@ -268,11 +271,13 @@ export default {
}, },
onSubmit(){ onSubmit(){
// this.boardDataTransform(); // this.boardDataTransform();
console.log(this.editData , "eeeeeeeeee");
let devices = []; let devices = [];
this.deviceArr.forEach((item,index)=>{ this.deviceArr.forEach((item,index)=>{
if (this.editData.devices.includes(item.id)){ if (this.editData.devices.includes(item.id)){
let temp = { let temp = {
id: item.id, id: item.id,
deviceName: item.deviceName,
iotDeviceId: item.iotDeviceId, iotDeviceId: item.iotDeviceId,
deviceType: item.deviceType, deviceType: item.deviceType,
direction: item.direction direction: item.direction
@ -286,10 +291,7 @@ export default {
let params = this.processParams(); let params = this.processParams();
if(this.mode == "add"){ submitTaskRequest(this.propData.id, this.groupId, this.time, devices, params, { direction: this.searchData.direction, deviceType: this.searchData.deviceType, screenSize: this.filterData.screenSize }).then(res=>{
}
submitTaskRequest(this.propData.id, this.groupId, this.time, devices, params, { deviceType: this.searchData.deviceType, screenSize: this.filterData.screenSize }).then(res=>{
this.$emit("onSubmit") this.$emit("onSubmit")
}); });
}, },
@ -298,7 +300,7 @@ export default {
return BoardUtils.deviceItemToContent(this.editData.type2); return BoardUtils.deviceItemToContent(this.editData.type2);
}else if(this.searchData.deviceType == "5"){ }else if(this.searchData.deviceType == "5"){
return { return {
content : editData.type5.content text : this.editData.type5.text
} }
} else if (this.searchData.deviceType == "10") { } else if (this.searchData.deviceType == "10") {
return { return {
@ -316,6 +318,12 @@ export default {
} }
} }
}, },
onSelectDeviceType(){
if (Object.keys(this.editData['type' + this.searchData.deviceType]).length<=0){
this.editData['type'+this.searchData.deviceType] = {};
}
this.onChange();
},
onChange() { onChange() {
this.resetEditData(); this.resetEditData();
this.deviceArr = []; this.deviceArr = [];

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

@ -4,7 +4,7 @@
<el-form-item label="时"> <el-form-item label="时">
<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="">
<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>

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

@ -2,10 +2,10 @@
import request from '@/utils/request' import request from '@/utils/request'
export function submitTaskRequest(id, jobGroup, time, devices, params, others) { export function submitTaskRequest(id, jobGroup, time, devices, params, others) {
let temp = [{ let functions;
...others, let deviceType = others.deviceType;
devices: devices, if (deviceType == '2'){ //情报板
"functions": [ functions = [
{ {
"functionId": "11", "functionId": "11",
"params": { "params": {
@ -25,6 +25,33 @@ export function submitTaskRequest(id, jobGroup, time, devices, params, others) {
} }
] ]
} else if (deviceType == '5'){ //语音广播
functions = [
{
"functionId": "",
"params": {
"name": "task-3",
"outVol": "6",
"priority": "1",
"text": params.text,
"repeatTimes": "3",
"termList": [
{
"zoneld": "6001",
"termDN": "601"
}
],
"functionType": "startPaTts"
}
}
]
}
let temp = [{
...others,
devices,
functions
}]; }];
let data = { let data = {
jobGroup, jobGroup,
@ -43,5 +70,3 @@ export function submitTaskRequest(id, jobGroup, time, devices, params, others) {
data data
}) })
} }

Loading…
Cancel
Save