|
@ -1,12 +1,13 @@ |
|
|
<template> |
|
|
<template> |
|
|
<Dialog v-model="modelVisible" title="修改" width="600px"> |
|
|
<Dialog v-model="modelVisible" title="修改" width="600px" label-width="120px"> |
|
|
|
|
|
<el-form> |
|
|
<el-form-item label="设备类型"> |
|
|
<el-form-item label="设备类型"> |
|
|
<!-- <el-radio-group v-model="searchData.deviceType" @input="onChange"> |
|
|
<!-- <el-radio-group v-model="searchData.deviceType" @input="onChange"> |
|
|
<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="onChange"> |
|
|
<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> |
|
|
</el-select> |
|
|
</el-select> |
|
@ -21,7 +22,7 @@ |
|
|
|
|
|
|
|
|
<el-form-item label="选择设备" v-if="searchData.deviceType != '2'"> |
|
|
<el-form-item label="选择设备" v-if="searchData.deviceType != '2'"> |
|
|
<el-select v-model="editData.devices" multiple placeholder="请选择设备" filterable> |
|
|
<el-select v-model="editData.devices" multiple placeholder="请选择设备" filterable> |
|
|
<el-option v-for="item in deviceOptions" :key="item.value" :label="item.label" :value="item.value"> |
|
|
<el-option v-for="item in deviceArr" :key="item.id" :label="item.deviceName" :value="item.id"> |
|
|
</el-option> |
|
|
</el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
@ -29,7 +30,7 @@ |
|
|
<template v-if="searchData.deviceType=='2'"> |
|
|
<template v-if="searchData.deviceType=='2'"> |
|
|
|
|
|
|
|
|
<el-form-item label="屏幕像素"> |
|
|
<el-form-item label="屏幕像素"> |
|
|
<el-select v-model="filterData.pixelSize" placeholder="请选择" clearable @change="resetEditData"> |
|
|
<el-select v-model="filterData.screenSize" placeholder="请选择" clearable @change="resetEditData"> |
|
|
<el-option v-for="item in boardPixelOptions" :key="item.value" :label="item.label" :value="item.value"> |
|
|
<el-option v-for="item in boardPixelOptions" :key="item.value" :label="item.label" :value="item.value"> |
|
|
</el-option> |
|
|
</el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
@ -37,16 +38,16 @@ |
|
|
|
|
|
|
|
|
<el-form-item label="选择设备"> |
|
|
<el-form-item label="选择设备"> |
|
|
<el-select v-model="editData.devices" multiple placeholder="请选择设备" filterable> |
|
|
<el-select v-model="editData.devices" multiple placeholder="请选择设备" filterable> |
|
|
<el-option v-for="item in deviceOptions" :key="item.value" :label="item.label" :value="item.value" |
|
|
<el-option v-for="item in deviceArr" :key="item.id" :label="item.deviceName" :value="item.id" |
|
|
v-if="item.pixelSize == filterData.pixelSize"> |
|
|
v-if="item.screenSize == filterData.screenSize"> |
|
|
</el-option> |
|
|
</el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item label="预览" v-if="filterData.pixelSize"> |
|
|
<el-form-item label="预览" v-if="filterData.screenSize"> |
|
|
<div class="tplItem"> |
|
|
<div class="tplItem"> |
|
|
<!-- 模板内容 --> |
|
|
<!-- 模板内容 --> |
|
|
<BoardPreview class="boardPreview" :boardWH="filterData.pixelSize" :tpl="editData.type2" /> |
|
|
<BoardPreview class="boardPreview" :boardWH="filterData.screenSize" :tpl="editData.type2" /> |
|
|
<!-- 操作按钮 --> |
|
|
<!-- 操作按钮 --> |
|
|
<div class="infoBtnBox"> |
|
|
<div class="infoBtnBox"> |
|
|
<el-tooltip content="编辑" placement="top"> |
|
|
<el-tooltip content="编辑" placement="top"> |
|
@ -55,6 +56,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<template v-else-if="searchData.deviceType == '5'"> |
|
|
<template v-else-if="searchData.deviceType == '5'"> |
|
@ -68,7 +70,7 @@ |
|
|
<!-- 激光疲劳唤醒 --> |
|
|
<!-- 激光疲劳唤醒 --> |
|
|
<el-form-item label="工作模式"> |
|
|
<el-form-item label="工作模式"> |
|
|
<el-select v-model="editData.type10.mode" placeholder="请选择"> |
|
|
<el-select v-model="editData.type10.mode" placeholder="请选择"> |
|
|
<el-option v-for="key,value 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="工作时长"> |
|
@ -83,7 +85,7 @@ |
|
|
<!-- 行车诱导 --> |
|
|
<!-- 行车诱导 --> |
|
|
<el-form-item label="工作状态"> |
|
|
<el-form-item label="工作状态"> |
|
|
<el-select v-model="editData.type12.mode" placeholder="请选择"> |
|
|
<el-select v-model="editData.type12.mode" placeholder="请选择"> |
|
|
<el-option v-for="key, value in gzztMap" :key="key" :label="value" :value="key" /> |
|
|
<el-option v-for="value, key in gzztMap" :key="key" :label="value" :value="key" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="工作时长"> |
|
|
<el-form-item label="工作时长"> |
|
@ -97,18 +99,18 @@ |
|
|
<template v-else-if="searchData.deviceType == '13'"> |
|
|
<template v-else-if="searchData.deviceType == '13'"> |
|
|
<!-- 智能设备箱 --> |
|
|
<!-- 智能设备箱 --> |
|
|
<el-form-item label="开启"> |
|
|
<el-form-item label="开启"> |
|
|
<el-switch v-model="editData.type13.open"> |
|
|
<el-switch v-model="editData.type13.switch"> |
|
|
<!-- active-color="#13ce66" inactive-color="#ff4949" --> |
|
|
<!-- active-color="#13ce66" inactive-color="#ff4949" --> |
|
|
</el-switch> |
|
|
</el-switch> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<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> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
<BoardInfoEditor @afterSubmit="____onEditSubmit" :mode="editDialog.mode" :type="editDialog.type" |
|
|
<BoardInfoEditor @afterSubmit="____onEditSubmit" :mode="editDialog.mode" :type="editDialog.type" |
|
|
:visible.sync="editDialog.visible" :screenSize="'768*60'" :tpl="editDialog.tpl"></BoardInfoEditor> |
|
|
:visible.sync="editDialog.visible" :screenSize="this.propData.screenSize" :tpl="editDialog.tpl"></BoardInfoEditor> |
|
|
</Dialog> |
|
|
</Dialog> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -118,6 +120,8 @@ import { deviceTypeOptions, directionOptions, gzmsMap, gzztMap } from "@screen/u |
|
|
import { getDeviceList } from "@screen/utils/api/device.js" |
|
|
import { getDeviceList } from "@screen/utils/api/device.js" |
|
|
import BoardPreview from "@screen/components/infoBoard/BoardPreview.vue"; |
|
|
import BoardPreview from "@screen/components/infoBoard/BoardPreview.vue"; |
|
|
import BoardInfoEditor from "@screen/components/infoBoard/BoardInfoEditor"; |
|
|
import BoardInfoEditor from "@screen/components/infoBoard/BoardInfoEditor"; |
|
|
|
|
|
import BoardUtils from "@screen/utils/infoBoard.js" |
|
|
|
|
|
import { addTaskRequest } from "@screen/utils/api/batch.js" |
|
|
export default { |
|
|
export default { |
|
|
name: "taskEditDialog", |
|
|
name: "taskEditDialog", |
|
|
components: { |
|
|
components: { |
|
@ -128,21 +132,27 @@ export default { |
|
|
event: "update:value", |
|
|
event: "update:value", |
|
|
}, |
|
|
}, |
|
|
props: { |
|
|
props: { |
|
|
|
|
|
deviceDic:Object, |
|
|
|
|
|
deviceList:Array, |
|
|
|
|
|
groupId: Number, |
|
|
|
|
|
time: String, |
|
|
visible: Boolean, |
|
|
visible: Boolean, |
|
|
data: Object |
|
|
propData: Object |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
|
|
|
mode:"add", |
|
|
deviceTypeOptions, |
|
|
deviceTypeOptions, |
|
|
directionOptions, |
|
|
directionOptions, |
|
|
gzmsMap, |
|
|
gzmsMap, |
|
|
deviceOptions:[], |
|
|
gzztMap, |
|
|
|
|
|
deviceArr:[], |
|
|
searchData: { |
|
|
searchData: { |
|
|
deviceType: "", |
|
|
deviceType: "", |
|
|
direction: "" |
|
|
direction: "" |
|
|
}, |
|
|
}, |
|
|
filterData:{ |
|
|
filterData:{ |
|
|
pixelSize:"" |
|
|
screenSize:"" |
|
|
}, |
|
|
}, |
|
|
editData:{ |
|
|
editData:{ |
|
|
devices:[], |
|
|
devices:[], |
|
@ -170,6 +180,9 @@ export default { |
|
|
immediate: true, |
|
|
immediate: true, |
|
|
handler(bool) { |
|
|
handler(bool) { |
|
|
if (!bool) return; |
|
|
if (!bool) return; |
|
|
|
|
|
this.propData?.id ? this.mode = 'edit' : this.mode = 'add'; |
|
|
|
|
|
this.transformData(); |
|
|
|
|
|
this.initBasicData(); |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
@ -178,43 +191,62 @@ export default { |
|
|
// this.directionOptions = directionOptions; |
|
|
// this.directionOptions = directionOptions; |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
initBasicData(){ |
|
|
|
|
|
if(this.mode=='edit'){ |
|
|
|
|
|
this.deviceArr = this.deviceList; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
transformData(){ |
|
|
|
|
|
//把props传来的数据转化一下,用来编辑 |
|
|
|
|
|
if (this.mode == 'edit'){ |
|
|
|
|
|
this.searchData.deviceType = this.propData.deviceType; |
|
|
|
|
|
this.searchData.direction = this.propData.direction; |
|
|
|
|
|
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" } |
|
|
|
|
|
this.editData.type2 = BoardUtils.contentToDeviceItem(this.propData.params); |
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
onEditBoard(){ |
|
|
onEditBoard(){ |
|
|
this.editDialog = { |
|
|
this.editDialog = { |
|
|
visible: true, |
|
|
visible: true, |
|
|
mode: "edit", |
|
|
mode: "edit", |
|
|
type: "device", |
|
|
type: "device", |
|
|
tpl: { |
|
|
tpl:this.editData.type2 |
|
|
"residenceTime": "90", |
|
|
// { |
|
|
"intonation": "0", |
|
|
// "residenceTime": "90", |
|
|
"fontSpacing": "0", |
|
|
// "intonation": "0", |
|
|
"screenEntryMethod": "1", |
|
|
// "fontSpacing": "0", |
|
|
"screenOutputMethod": "1", |
|
|
// "screenEntryMethod": "1", |
|
|
"lineSpacing": "0", |
|
|
// "screenOutputMethod": "1", |
|
|
"yCoordinate": "0", |
|
|
// "lineSpacing": "0", |
|
|
"whetherToSynchronizePlayback": "0", |
|
|
// "yCoordinate": "0", |
|
|
"whetherToPlayText": "0", |
|
|
// "whetherToSynchronizePlayback": "0", |
|
|
"playbackCount": "1", |
|
|
// "whetherToPlayText": "0", |
|
|
"flashingFrequency": "5", |
|
|
// "playbackCount": "1", |
|
|
"backgroundColor": "8", |
|
|
// "flashingFrequency": "5", |
|
|
"foregroundColor": "ffff00", |
|
|
// "backgroundColor": "8", |
|
|
"textContent": "长清收费站\\\\n出入口封闭", |
|
|
// "foregroundColor": "ffff00", |
|
|
"fontStyle": "0", |
|
|
// "textContent": "长清收费站\\\\n出入口封闭", |
|
|
"displayAreaWidth": "160", |
|
|
// "fontStyle": "0", |
|
|
"playbackDuration": "90", |
|
|
// "displayAreaWidth": "160", |
|
|
"displayAreaHeight": "80", |
|
|
// "playbackDuration": "90", |
|
|
"volume": "0", |
|
|
// "displayAreaHeight": "80", |
|
|
"xCoordinate": "0", |
|
|
// "volume": "0", |
|
|
"screenEntrySpeed": "1", |
|
|
// "xCoordinate": "0", |
|
|
"horizontalAlignment": "2", |
|
|
// "screenEntrySpeed": "1", |
|
|
"playSpecialEffects": "0", |
|
|
// "horizontalAlignment": "2", |
|
|
"setUpTheSpeaker": "0", |
|
|
// "playSpecialEffects": "0", |
|
|
"flickerSpeed": "0", |
|
|
// "setUpTheSpeaker": "0", |
|
|
"specialEffectsSpeed": "1", |
|
|
// "flickerSpeed": "0", |
|
|
"fontSize": "24", |
|
|
// "specialEffectsSpeed": "1", |
|
|
"verticalAlignment": "2", |
|
|
// "fontSize": "24", |
|
|
"speechSpeed": "0", |
|
|
// "verticalAlignment": "2", |
|
|
"font": "3" |
|
|
// "speechSpeed": "0", |
|
|
}, |
|
|
// "font": "3" |
|
|
|
|
|
// }, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
____onEditSubmit(data){ |
|
|
____onEditSubmit(data){ |
|
@ -224,21 +256,66 @@ export default { |
|
|
}, |
|
|
}, |
|
|
onSubmit(){ |
|
|
onSubmit(){ |
|
|
// this.boardDataTransform(); |
|
|
// this.boardDataTransform(); |
|
|
// let devices = |
|
|
let devices = []; |
|
|
// let data = {devices, functions } |
|
|
this.deviceArr.forEach((item,index)=>{ |
|
|
console.log(this.editData , "编辑出来的数据"); |
|
|
if (this.editData.devices.includes(item.id)){ |
|
|
|
|
|
let temp = { |
|
|
|
|
|
id: item.id, |
|
|
|
|
|
iotDeviceId: item.iotDeviceId, |
|
|
|
|
|
deviceType: item.deviceType, |
|
|
|
|
|
direction: item.direction |
|
|
|
|
|
} |
|
|
|
|
|
if(item.type == '2'){ |
|
|
|
|
|
temp.screenSize = item.screenSize; |
|
|
|
|
|
} |
|
|
|
|
|
devices.push(temp); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
let params = this.processParams(); |
|
|
|
|
|
|
|
|
|
|
|
if(this.mode == "add"){ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
addTaskRequest(devices, params, { jobGroup: this.groupId, time:this.time }).then(res=>{ |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
}); |
|
|
|
|
|
this.$emit("onSubmit") |
|
|
|
|
|
}, |
|
|
|
|
|
processParams(){ |
|
|
|
|
|
if(this.searchData.deviceType == "2"){ |
|
|
|
|
|
return BoardUtils.deviceItemToContent(this.editData.type2); |
|
|
|
|
|
}else if(this.searchData.deviceType == "5"){ |
|
|
|
|
|
return { |
|
|
|
|
|
content : editData.type5.content |
|
|
|
|
|
} |
|
|
|
|
|
} else if (this.searchData.deviceType == "10") { |
|
|
|
|
|
return { |
|
|
|
|
|
mode: editData.type10.mode, |
|
|
|
|
|
timeLength: editData.type10.timeLength |
|
|
|
|
|
} |
|
|
|
|
|
} else if (this.searchData.deviceType == "12") { |
|
|
|
|
|
return { |
|
|
|
|
|
mode: editData.type12.mode, |
|
|
|
|
|
timeLength: editData.type12.timeLength |
|
|
|
|
|
} |
|
|
|
|
|
} else if (this.searchData.deviceType == "13") { |
|
|
|
|
|
return { |
|
|
|
|
|
switch: editData.type13.switch |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
onChange() { |
|
|
onChange() { |
|
|
this.resetEditData(); |
|
|
this.resetEditData(); |
|
|
this.deviceOptions = []; |
|
|
this.deviceArr = []; |
|
|
getDeviceList(this.searchData).then(res => { |
|
|
getDeviceList(this.searchData).then(res => { |
|
|
|
|
|
if (this.searchData.deviceType == '2'){ |
|
|
res.data.forEach(item => { |
|
|
res.data.forEach(item => { |
|
|
this.deviceOptions.push({ |
|
|
item.screenSize = JSON.parse(item.otherConfig).screenSize; |
|
|
label: item.deviceName, |
|
|
// this.deviceArr.push(item); |
|
|
value: item.id, |
|
|
|
|
|
pixelSize: JSON.parse(item.otherConfig).screenSize |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
this.deviceArr = res.data; |
|
|
}).catch(err => { }) |
|
|
}).catch(err => { }) |
|
|
}, |
|
|
}, |
|
|
resetEditData(){ |
|
|
resetEditData(){ |
|
|