Browse Source

Merge branch 'develop' of http://39.106.31.193:9211/mengff/jihe-hs into develop

wangqin
王钦 7 months ago
parent
commit
29a5993777
  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>
<!-- <p v-for="item, index1 in taskGroup.tasksEdit">{{ item }}</p> -->
<TaskItem v-for="item, index1 in taskGroup.tasksEdit" :propData="item" :groupId="propData.id"
:time="taskGroup.time" @onSubmit="onSubmitTaskItem">
</TaskItem>
@ -358,13 +359,13 @@ export default {
}
}
.all_groups{
border: 1px solid #09B;
max-height:500px;
overflow-y: scroll;
}
.task_group{
border: 1px solid #09B;
.task_info{
padding:10px 0; background: #005070;
padding:10px 0; background: #004050;
.time_show{
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="flex main_ctt">
<div class="device_type">
设备类型:
<span v-if="editData.deviceType">{{ deviceTypeDic[editData.deviceType].label }}</span>
</div>
<div class="devices">
@ -19,7 +18,7 @@
</BoardRecordPreview>
</template>
<template v-if="editData.deviceType == '5'">
<p class="text">{{ editData.params.text }}</p>
</template>
<template v-if="editData.deviceType == '2'">
@ -87,12 +86,16 @@ export default {
//BoardRecordPreview
if(temp.functions){
// 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 = {
id: this.propData.jobId,
direction: temp.direction,
deviceType: temp.deviceType,
devices: temp.devices,
params: temp.functions[1].params,
params: temp.functions[paramsIndex].params,
screenSize: temp.screenSize
};
}else{
@ -131,7 +134,7 @@ export default {
initBasicData(){
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;
res.data.forEach(item=>{
// this.deviceOptions.push({
@ -155,6 +158,7 @@ export default {
}
.content{ width: 300px; display: flex; align-items: stretch;
.board{ flex: 1; }
.text{ flex: 1; display: flex; align-items: center; justify-content: center; word-break: break-all;}
}
.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"
v-if="item.timingControl"></el-radio-button>
</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+''"
v-if="item.timingControl">
</el-option>
@ -62,7 +62,7 @@
<template v-else-if="searchData.deviceType == '5'">
<!-- 语音广播 -->
<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>
</template>
@ -204,13 +204,16 @@ export default {
this.filterData.screenSize = this.propData.screenSize;
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" }
if (this.propData.deviceType == "2"){
this.editData.type2 = BoardUtils.contentToDeviceItem(this.propData.params);
} else if (this.propData.deviceType == "5"){
this.editData.type5 = { ...this.propData.params};
}
}else{
this.searchData.deviceType = "";
this.searchData.direction = "";
this.filterData.screenSize = "";
this.editData.devices = [];
this.editData.type2 = {};
}
},
onEditBoard(){
@ -268,11 +271,13 @@ export default {
},
onSubmit(){
// this.boardDataTransform();
console.log(this.editData , "eeeeeeeeee");
let devices = [];
this.deviceArr.forEach((item,index)=>{
if (this.editData.devices.includes(item.id)){
let temp = {
id: item.id,
deviceName: item.deviceName,
iotDeviceId: item.iotDeviceId,
deviceType: item.deviceType,
direction: item.direction
@ -286,10 +291,7 @@ export default {
let params = this.processParams();
if(this.mode == "add"){
}
submitTaskRequest(this.propData.id, this.groupId, this.time, devices, params, { deviceType: this.searchData.deviceType, screenSize: this.filterData.screenSize }).then(res=>{
submitTaskRequest(this.propData.id, this.groupId, this.time, devices, params, { direction: this.searchData.direction, deviceType: this.searchData.deviceType, screenSize: this.filterData.screenSize }).then(res=>{
this.$emit("onSubmit")
});
},
@ -298,7 +300,7 @@ export default {
return BoardUtils.deviceItemToContent(this.editData.type2);
}else if(this.searchData.deviceType == "5"){
return {
content : editData.type5.content
text : this.editData.type5.text
}
} else if (this.searchData.deviceType == "10") {
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() {
this.resetEditData();
this.deviceArr = [];

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

@ -4,7 +4,7 @@
<el-form-item label="时">
<el-input v-model="editData.hour"></el-input>
</el-form-item>
<el-form-item label="">
<el-form-item label="">
<el-input v-model="editData.minute"></el-input>
</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'
export function submitTaskRequest(id, jobGroup, time, devices, params, others) {
let temp = [{
...others,
devices: devices,
"functions": [
let functions;
let deviceType = others.deviceType;
if (deviceType == '2'){ //情报板
functions = [
{
"functionId": "11",
"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 = {
jobGroup,
@ -43,5 +70,3 @@ export function submitTaskRequest(id, jobGroup, time, devices, params, others) {
data
})
}

Loading…
Cancel
Save