|
|
@ -22,13 +22,13 @@ |
|
|
|
<div v-if="item.list.length > 0"> |
|
|
|
<!-- <el-checkbox style="width: 100%" :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选 |
|
|
|
</el-checkbox> --> |
|
|
|
<el-checkbox-group class="checkbox" v-model="checkedDevices" @change="____onSelctDevices"> |
|
|
|
<el-checkbox-group class="checkbox" v-model="checkedDeviceIds" :max="2" @change="____onSelectDevices"> |
|
|
|
<el-checkbox v-for="(itm, index) in item.list" :label="itm.iotDeviceId" :key="index"> |
|
|
|
<div>{{ itm.deviceName }}</div> |
|
|
|
<!-- <el-tooltip :content="itm.ip" placement="top"> |
|
|
|
</el-tooltip> --> |
|
|
|
<el-tooltip content="回读当前信息" placement="right"> |
|
|
|
<el-button class="el-icon-tickets huiduButton" @click.stop.prevent="____onCheckDeviceInfo(itm)" |
|
|
|
<el-button class="el-icon-tickets huiduButton" @click.stop.prevent="____forkDeviceInfo(itm)" |
|
|
|
:disabled="submitButton"></el-button> |
|
|
|
</el-tooltip> |
|
|
|
</el-checkbox> |
|
|
@ -230,7 +230,7 @@ export default { |
|
|
|
mechanismList: [], //管理机构下拉框 |
|
|
|
devicessizeList: [], //分辨率下拉框 |
|
|
|
deviceList: [], //分辨率 |
|
|
|
checkedDevices: [], //多选 选中项 |
|
|
|
checkedDeviceIds: [], //多选 选中项 |
|
|
|
templateAvailable: [], |
|
|
|
form: { |
|
|
|
selectedDirection: "", |
|
|
@ -388,12 +388,12 @@ export default { |
|
|
|
if (!this.selectedSize) { |
|
|
|
this.selectedSize = item.otherConfig.screenSize; |
|
|
|
} |
|
|
|
if (!this.selectedDevice.deviceName) { |
|
|
|
this.selectedDevice = item; |
|
|
|
} |
|
|
|
// if (!this.selectedDevice.deviceName) { |
|
|
|
// this.selectedDevice = item; |
|
|
|
// } |
|
|
|
}) |
|
|
|
this.____onChangeSize(); |
|
|
|
this.____getDeviceInfo(); |
|
|
|
// this.____getDeviceInfo(); |
|
|
|
|
|
|
|
}else{ |
|
|
|
getBoardList(param).then((res) => { |
|
|
@ -405,13 +405,11 @@ export default { |
|
|
|
if (!this.selectedSize) { |
|
|
|
this.selectedSize = item.otherConfig.screenSize; |
|
|
|
} |
|
|
|
if (!this.selectedDevice.deviceName) { |
|
|
|
this.selectedDevice = item; |
|
|
|
} |
|
|
|
// if (!this.selectedDevice.deviceName) { |
|
|
|
// this.selectedDevice = item; |
|
|
|
// } |
|
|
|
}) |
|
|
|
this.____onChangeSize(); |
|
|
|
this.____getDeviceInfo(); |
|
|
|
// this.$forceUpdate(); |
|
|
|
// this.____onChangeSize(this.boardSizeDic[0].selectedPixel); |
|
|
|
}); |
|
|
|
} |
|
|
@ -438,6 +436,27 @@ export default { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
____forkDeviceInfo(deviceFrom) { //从目标设备取得信息 |
|
|
|
|
|
|
|
if (IS_TESTING) { |
|
|
|
|
|
|
|
this.selectedBdMsg = _.cloneDeep(testDeviceInfo.data["3A"].content); |
|
|
|
|
|
|
|
} else{ |
|
|
|
|
|
|
|
if (!deviceFrom.iotDeviceId) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
getBoardDeviceInfo(deviceFrom.iotDeviceId).then(res => { |
|
|
|
this.selectedBdMsg = res.data["3A"].content; |
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
____onAddTemplate() { |
|
|
|
this.editDialog = { |
|
|
@ -468,12 +487,18 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
____onAddDeviceItem() { |
|
|
|
|
|
|
|
let arr = this.selectedSize.split("*"); |
|
|
|
this.editDialog = { |
|
|
|
visible: true, |
|
|
|
mode: "add", |
|
|
|
type: "device", |
|
|
|
tpl: { |
|
|
|
"textContent": "" |
|
|
|
"textContent": "", |
|
|
|
origin: { |
|
|
|
displayAreaWidth: +arr[0], |
|
|
|
displayAreaHeight: +arr[1] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -507,7 +532,7 @@ export default { |
|
|
|
// 新增待下发 |
|
|
|
____onAddToDevice(item) { |
|
|
|
|
|
|
|
// if(this.checkedDevices.length<=0){ |
|
|
|
// if(this.checkedDeviceIds.length<=0){ |
|
|
|
// this.$message.warning('未选择设备!'); |
|
|
|
// return; |
|
|
|
// } |
|
|
@ -634,12 +659,16 @@ export default { |
|
|
|
____onDeleteBoardItem(index) { |
|
|
|
if (index > -1) { |
|
|
|
this.selectedBdMsg.splice(index, 1) |
|
|
|
this.$message.success('删除成功,发布后才能生效。') |
|
|
|
this.$message.success('删除成功,发布后生效。') |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 发布信息 |
|
|
|
____publishInfo() { |
|
|
|
if(!this.selectedDevice.iotDeviceId){ |
|
|
|
this.$message.warning("请选择设备!"); |
|
|
|
return |
|
|
|
} |
|
|
|
this.$confirm('是否确定发布情报板?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
@ -656,7 +685,6 @@ export default { |
|
|
|
let content = []; |
|
|
|
|
|
|
|
this.selectedBdMsg.forEach(item=>{ |
|
|
|
console.log(item.font) |
|
|
|
|
|
|
|
content.push({ |
|
|
|
STAY :item.playbackDuration, |
|
|
@ -665,7 +693,7 @@ export default { |
|
|
|
COLOR :item.foregroundColor, |
|
|
|
FONT : item.font, |
|
|
|
FONT_SIZE : item.fontSize, |
|
|
|
CONTENT :item.textContent.replaceAll('\\', '').replaceAll(',', '\\,').replaceAll('=', '\\=').replaceAll('\n', '\\\\n'), |
|
|
|
CONTENT :item.textContent.replaceAll(',', '\\,').replaceAll('=', '\\=').replaceAll('\n', '\\\\n'), |
|
|
|
width : item.displayAreaWidth, |
|
|
|
height : item.displayAreaHeight, |
|
|
|
formatStyle : item.verticalAlignment |
|
|
@ -709,20 +737,29 @@ export default { |
|
|
|
|
|
|
|
// 全选 |
|
|
|
handleCheckAllChange(val) { |
|
|
|
this.checkedDevices = val ? this.deviceList : [] |
|
|
|
this.checkedDeviceIds = val ? this.deviceList : [] |
|
|
|
}, |
|
|
|
|
|
|
|
// 多选 |
|
|
|
____onSelctDevices(arr){ |
|
|
|
console.log(arr , "<<< 已选设备"); |
|
|
|
____onSelectDevices(arr){ |
|
|
|
if(arr.length == 0){ |
|
|
|
this.selectedDevice = {} |
|
|
|
return; |
|
|
|
} |
|
|
|
this.checkedDeviceIds = [arr.pop()]; |
|
|
|
if(!this.checkedDeviceIds[0]){ |
|
|
|
this.$message.warning('该设备缺少iotDeviceId参数!'); |
|
|
|
} |
|
|
|
this.selectedDevice = _.find(this.boardSizeDic[this.selectedSize].list , {iotDeviceId : this.checkedDeviceIds[0]}); |
|
|
|
this.____forkDeviceInfo(this.selectedDevice); |
|
|
|
}, |
|
|
|
____onCheckDeviceInfo(item) { |
|
|
|
// ____onCheckDeviceInfo(item) { |
|
|
|
// this.selectedDevice = _.find(this.boardSizeDic[this.selectedSize].list, { iotDeviceId: value[0] }); |
|
|
|
this.selectedDevice = item; |
|
|
|
// this.selectedDevice = item; |
|
|
|
// this.selectedDevice = this.deviceList |
|
|
|
this.____getDeviceInfo(); |
|
|
|
// this.____forkDeviceInfo(); |
|
|
|
|
|
|
|
// this.checkedDevices = value |
|
|
|
// this.checkedDeviceIds = value |
|
|
|
// let val = JSON.parse(JSON.stringify(value)) |
|
|
|
// for (let itm of this.deviceList) { |
|
|
|
// if (val.indexOf(itm) > -1) { |
|
|
@ -733,17 +770,17 @@ export default { |
|
|
|
// } |
|
|
|
// } |
|
|
|
// this.$forceUpdate() |
|
|
|
}, |
|
|
|
// }, |
|
|
|
// 情报板列表手风琴 |
|
|
|
____onChangeSize(val) { |
|
|
|
this.____setAvailableTemplate(); |
|
|
|
this.checkedDevices = []; |
|
|
|
this.selectedDevice = []; |
|
|
|
this.checkedDeviceIds = []; |
|
|
|
this.selectedDevice = {}; |
|
|
|
this.selectedBdMsg = []; |
|
|
|
// this.contentList = [] |
|
|
|
// this.deviceList = [] |
|
|
|
// this.disabledButton = true |
|
|
|
// this.checkedDevices = [] |
|
|
|
// this.checkedDeviceIds = [] |
|
|
|
// this.checkAll = false |
|
|
|
// this.allVmsTemplate() |
|
|
|
// for (let item of this.boardSizeDic) { |
|
|
@ -756,6 +793,10 @@ export default { |
|
|
|
// } |
|
|
|
}, |
|
|
|
____setAvailableTemplate() { |
|
|
|
if(!this.selectedSize){ |
|
|
|
this.templateAvailable = []; |
|
|
|
return; |
|
|
|
} |
|
|
|
this.templateAvailable = []; |
|
|
|
this.tplCategory.forEach((item, index) => { |
|
|
|
let arr = this.templateAll['' + index]; |
|
|
|