|
|
@ -3,16 +3,17 @@ |
|
|
|
<el-form> |
|
|
|
<div class="flex" style="justify-content: space-between;"> |
|
|
|
<div> |
|
|
|
设备类型:<span>{{ deviceTypeDic[editData.deviceType].label }}</span> |
|
|
|
设备类型: |
|
|
|
<span v-if="editData.deviceType">{{ deviceTypeDic[editData.deviceType].label }}</span> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
设备: |
|
|
|
<!-- {{ deviceDic }} --> |
|
|
|
<span v-for="item,index in editData.devices"> |
|
|
|
{{ deviceDic[item.id].deviceName }} |
|
|
|
</span>等{{ editData.devices.length }}个设备 |
|
|
|
<template v-if="editData.devices"> |
|
|
|
<span v-for="item,index in editData.devices"> |
|
|
|
{{ deviceDic[item.id].deviceName }} |
|
|
|
</span>等{{ editData.devices.length }}个 |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
<!-- <div>{{ editData.params }}</div> --> |
|
|
|
<template v-if="editData.deviceType=='2'"> |
|
|
|
<BoardRecordPreview :tpl="editData.params" style=" width:300px; height: 100%;"> |
|
|
|
</BoardRecordPreview> |
|
|
@ -81,18 +82,21 @@ export default { |
|
|
|
|
|
|
|
this.initBasicData().then(res=>{ |
|
|
|
|
|
|
|
let temp = JSON.parse(this.propData.callParameter)[0]; //callParameter是个字符串 |
|
|
|
let temp = JSON.parse(this.propData.callParameter || '[{}]')[0]; //callParameter是个字符串 |
|
|
|
//转成BoardRecordPreview组件需要的格式,用来预览 |
|
|
|
temp.functions[1].params.CONTENT = temp.functions[1].params.CONTENT.replaceAll(/\\n/g, '\\\\n').replaceAll(/=/g, '\\=').replaceAll(/,/g, '\\,').replaceAll(/ /g, ' '); |
|
|
|
this.editData = { |
|
|
|
id: this.propData.jobId, |
|
|
|
direction: temp.direction, |
|
|
|
deviceType: temp.deviceType, |
|
|
|
devices: temp.devices, |
|
|
|
params: temp.functions[1].params, |
|
|
|
screenSize: temp.screenSize |
|
|
|
}; |
|
|
|
console.log(this.editData , "+++======"); |
|
|
|
if(temp.functions){ |
|
|
|
temp.functions[1].params.CONTENT = temp.functions[1].params.CONTENT.replaceAll(/\\n/g, '\\\\n').replaceAll(/=/g, '\\=').replaceAll(/,/g, '\\,').replaceAll(/ /g, ' '); |
|
|
|
this.editData = { |
|
|
|
id: this.propData.jobId, |
|
|
|
direction: temp.direction, |
|
|
|
deviceType: temp.deviceType, |
|
|
|
devices: temp.devices, |
|
|
|
params: temp.functions[1].params, |
|
|
|
screenSize: temp.screenSize |
|
|
|
}; |
|
|
|
}else{ |
|
|
|
this.editData = {}; |
|
|
|
} |
|
|
|
this.isCompReady = true; |
|
|
|
}) |
|
|
|
}, |
|
|
@ -100,7 +104,8 @@ export default { |
|
|
|
onModify(){ |
|
|
|
this.isEditingTask = true; |
|
|
|
}, |
|
|
|
onSubmit(){ |
|
|
|
onSubmit(para){ |
|
|
|
this.emit("onSubmit"); |
|
|
|
this.isEditingTask = false; |
|
|
|
// let devices = _.filter(this.deviceOptions, item=>{ |
|
|
|
// this.editData.devices.includes(item.id); |
|
|
|