|
@ -1,13 +1,12 @@ |
|
|
import { publishToBoard, saveBoardReleaseLog } from '@/api/board/board' |
|
|
import { publishToBoard, saveBoardReleaseLog } from "@/api/board/board"; |
|
|
import moment from 'moment/moment'; |
|
|
import moment from "moment/moment"; |
|
|
import store from '@/store' |
|
|
import store from "@/store"; |
|
|
export default{ |
|
|
import { Message } from "element-ui"; |
|
|
data(){ |
|
|
export default { |
|
|
return { |
|
|
data() { |
|
|
|
|
|
return {}; |
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
methods:{ |
|
|
methods: { |
|
|
// 新增待下发
|
|
|
// 新增待下发
|
|
|
____onAddDeviceItem() { |
|
|
____onAddDeviceItem() { |
|
|
let arr = this.selectedSize.split("*"); |
|
|
let arr = this.selectedSize.split("*"); |
|
@ -17,17 +16,16 @@ export default{ |
|
|
mode: "add", |
|
|
mode: "add", |
|
|
type: "device", |
|
|
type: "device", |
|
|
tpl: { |
|
|
tpl: { |
|
|
"textContent": "", |
|
|
textContent: "", |
|
|
"origin": { |
|
|
origin: { |
|
|
displayAreaWidth: +arr[0], |
|
|
displayAreaWidth: +arr[0], |
|
|
displayAreaHeight: +arr[1] |
|
|
displayAreaHeight: +arr[1], |
|
|
} |
|
|
}, |
|
|
} |
|
|
}, |
|
|
} |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
// 从模板新增待下发
|
|
|
// 从模板新增待下发
|
|
|
____onTplToDevice(item, showDialog) { |
|
|
____onTplToDevice(item, showDialog) { |
|
|
|
|
|
|
|
|
// if(this.checkedDeviceIds.length<=0){
|
|
|
// if(this.checkedDeviceIds.length<=0){
|
|
|
// this.$message.warning('未选择设备!');
|
|
|
// this.$message.warning('未选择设备!');
|
|
|
// return;
|
|
|
// return;
|
|
@ -36,40 +34,45 @@ export default{ |
|
|
let arr = this.selectedSize.split("*"); |
|
|
let arr = this.selectedSize.split("*"); |
|
|
item.origin = { |
|
|
item.origin = { |
|
|
displayAreaWidth: +arr[0], |
|
|
displayAreaWidth: +arr[0], |
|
|
displayAreaHeight: +arr[1] |
|
|
displayAreaHeight: +arr[1], |
|
|
} |
|
|
}; |
|
|
|
|
|
|
|
|
this.editDialog = { |
|
|
this.editDialog = { |
|
|
visible: showDialog == false ? false : true, |
|
|
visible: showDialog == false ? false : true, |
|
|
mode: "toDevice", |
|
|
mode: "toDevice", |
|
|
type: "template", |
|
|
type: "template", |
|
|
tpl: item |
|
|
tpl: item, |
|
|
} |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
// 发布信息
|
|
|
// 发布信息
|
|
|
____publishInfo() { |
|
|
____publishInfo() { |
|
|
let deviceList = []; |
|
|
let deviceList = []; |
|
|
if (this.selectedDevice){ |
|
|
if (this.isMultiControl && !this.selectItems.length) { |
|
|
deviceList = [this.selectedDevice]; |
|
|
return Message.error("请至少选择一个设备!"); |
|
|
}else{ |
|
|
} |
|
|
deviceList = this.selectedDevices; |
|
|
const selectItems = this.selectItems.map((item) => JSON.parse(item)); |
|
|
|
|
|
if (this.isMultiControl) deviceList = selectItems; |
|
|
|
|
|
else { |
|
|
|
|
|
if (this.selectedDevice) deviceList = [this.selectedDevice]; |
|
|
|
|
|
else deviceList = this.selectedDevices; |
|
|
} |
|
|
} |
|
|
this.$confirm('是否确定发布情报板?', '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$confirm("是否确定发布情报板?", "提示", { |
|
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
|
type: "warning", |
|
|
|
|
|
}) |
|
|
|
|
|
.then(() => { |
|
|
let loading = this.$loading({ |
|
|
let loading = this.$loading({ |
|
|
lock: true, |
|
|
lock: true, |
|
|
text: 'Loading', |
|
|
text: "Loading", |
|
|
spinner: 'el-icon-loading', |
|
|
spinner: "el-icon-loading", |
|
|
background: 'rgba(0, 0, 0, 0.7)' |
|
|
background: "rgba(0, 0, 0, 0.7)", |
|
|
}) |
|
|
}); |
|
|
|
|
|
|
|
|
let content = []; |
|
|
let content = []; |
|
|
|
|
|
|
|
|
this.selectedBdMsg.forEach(item => { |
|
|
this.selectedBdMsg.forEach((item) => { |
|
|
content.push({ |
|
|
content.push({ |
|
|
STAY: item.playbackDuration, |
|
|
STAY: item.playbackDuration, |
|
|
ACTION: item.screenEntryMethod, |
|
|
ACTION: item.screenEntryMethod, |
|
@ -77,76 +80,78 @@ export default{ |
|
|
COLOR: item.foregroundColor, |
|
|
COLOR: item.foregroundColor, |
|
|
FONT: item.font, |
|
|
FONT: item.font, |
|
|
FONT_SIZE: item.fontSize, |
|
|
FONT_SIZE: item.fontSize, |
|
|
CONTENT: item.textContent.replaceAll(',', '\\,').replaceAll('=', '\\=').replaceAll('\n', '\\\\n'), |
|
|
CONTENT: item.textContent |
|
|
|
|
|
.replaceAll(",", "\\,") |
|
|
|
|
|
.replaceAll("=", "\\=") |
|
|
|
|
|
.replaceAll("\n", "\\\\n"), |
|
|
width: item.displayAreaWidth, |
|
|
width: item.displayAreaWidth, |
|
|
height: item.displayAreaHeight, |
|
|
height: item.displayAreaHeight, |
|
|
formatStyle: item.verticalAlignment |
|
|
formatStyle: item.verticalAlignment, |
|
|
}) |
|
|
}); |
|
|
}) |
|
|
}); |
|
|
|
|
|
|
|
|
let data = { content: content, deviceList } |
|
|
let data = { content: content, deviceList }; |
|
|
|
|
|
|
|
|
if (IS_TESTING) { |
|
|
if (IS_TESTING) { |
|
|
// this.saveLog(content);
|
|
|
// this.saveLog(content);
|
|
|
this.____getDeviceInfo(); |
|
|
this.____getDeviceInfo(); |
|
|
loading.close() |
|
|
loading.close(); |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
publishToBoard(data).then(res => { |
|
|
publishToBoard(data) |
|
|
|
|
|
.then((res) => { |
|
|
// this.saveLog(content);
|
|
|
// this.saveLog(content);
|
|
|
this.$message({ |
|
|
this.$message({ |
|
|
type:"success", |
|
|
type: "success", |
|
|
message:"发布成功!" |
|
|
message: "发布成功!", |
|
|
}); |
|
|
}); |
|
|
this.____getDeviceInfo(); |
|
|
!isMultiControl && this.____getDeviceInfo(); |
|
|
}).catch(err=>{ |
|
|
}) |
|
|
|
|
|
.catch((err) => {}) |
|
|
}).finally(()=>{ |
|
|
.finally(() => { |
|
|
loading.close() |
|
|
loading.close(); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
type: 'info', |
|
|
|
|
|
message: '取消发布' |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
.catch(() => { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
type: "info", |
|
|
|
|
|
message: "取消发布", |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
//
|
|
|
//
|
|
|
saveLog(content){ |
|
|
saveLog(content) { |
|
|
let time = moment().format("YYYY-MM-DD HH:mm:ss"); |
|
|
let time = moment().format("YYYY-MM-DD HH:mm:ss"); |
|
|
let device = this.selectedDevices; |
|
|
let device = this.selectedDevices; |
|
|
let data = { |
|
|
let data = { |
|
|
"createBy": store.getters.name, |
|
|
createBy: store.getters.name, |
|
|
"createTime": time, |
|
|
createTime: time, |
|
|
"deviceId": device.id, |
|
|
deviceId: device.id, |
|
|
"deviceName": device.deviceName, |
|
|
deviceName: device.deviceName, |
|
|
"direction": device.direction, |
|
|
direction: device.direction, |
|
|
"params": {}, |
|
|
params: {}, |
|
|
"platform": "", |
|
|
platform: "", |
|
|
"releaseContent": JSON.stringify(content), |
|
|
releaseContent: JSON.stringify(content), |
|
|
"releaseDeptId": "", |
|
|
releaseDeptId: "", |
|
|
"releaseDeptName": "", |
|
|
releaseDeptName: "", |
|
|
"releaseIp": "", |
|
|
releaseIp: "", |
|
|
"releaseStatus": "", |
|
|
releaseStatus: "", |
|
|
"releaseTime": time, |
|
|
releaseTime: time, |
|
|
"releaseUserId": "", |
|
|
releaseUserId: "", |
|
|
"releaseUserName": "", |
|
|
releaseUserName: "", |
|
|
"remark": "", |
|
|
remark: "", |
|
|
"searchValue": "", |
|
|
searchValue: "", |
|
|
"stakeMark": device.stakeMark, |
|
|
stakeMark: device.stakeMark, |
|
|
"updateBy": "", |
|
|
updateBy: "", |
|
|
"updateTime": time |
|
|
updateTime: time, |
|
|
} |
|
|
}; |
|
|
saveBoardReleaseLog(data).then(res => { |
|
|
saveBoardReleaseLog(data).then((res) => { |
|
|
if(res.code==200){ |
|
|
if (res.code == 200) { |
|
|
console.log("情报板日志已保存:::" , data); |
|
|
console.log("情报板日志已保存:::", data); |
|
|
}else{ |
|
|
} else { |
|
|
console.log("情报板日志保存失败!"); |
|
|
console.log("情报板日志保存失败!"); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}); |
|
|
} |
|
|
}, |
|
|
} |
|
|
}, |
|
|
} |
|
|
}; |
|
|