Compare commits
2 Commits
0b9362bd41
...
a7e6a917b1
Author | SHA1 | Date |
---|---|---|
qingzhengli | a7e6a917b1 | 7 months ago |
qingzhengli | d69800720a | 7 months ago |
5 changed files with 1201 additions and 1189 deletions
@ -1,152 +1,157 @@ |
|||||
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: { |
||||
|
// 新增待下发
|
||||
|
____onAddDeviceItem() { |
||||
|
let arr = this.selectedSize.split("*"); |
||||
|
|
||||
} |
this.editDialog = { |
||||
}, |
visible: true, |
||||
methods:{ |
mode: "add", |
||||
// 新增待下发
|
type: "device", |
||||
____onAddDeviceItem() { |
tpl: { |
||||
let arr = this.selectedSize.split("*"); |
textContent: "", |
||||
|
origin: { |
||||
this.editDialog = { |
displayAreaWidth: +arr[0], |
||||
visible: true, |
displayAreaHeight: +arr[1], |
||||
mode: "add", |
}, |
||||
type: "device", |
|
||||
tpl: { |
|
||||
"textContent": "", |
|
||||
"origin": { |
|
||||
displayAreaWidth: +arr[0], |
|
||||
displayAreaHeight: +arr[1] |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
// 从模板新增待下发
|
|
||||
____onTplToDevice(item, showDialog) { |
|
||||
|
|
||||
// if(this.checkedDeviceIds.length<=0){
|
|
||||
// this.$message.warning('未选择设备!');
|
|
||||
// return;
|
|
||||
// }
|
|
||||
|
|
||||
let arr = this.selectedSize.split("*"); |
|
||||
item.origin = { |
|
||||
displayAreaWidth: +arr[0], |
|
||||
displayAreaHeight: +arr[1] |
|
||||
} |
|
||||
|
|
||||
this.editDialog = { |
|
||||
visible: showDialog == false ? false : true, |
|
||||
mode: "toDevice", |
|
||||
type: "template", |
|
||||
tpl: item |
|
||||
} |
|
||||
}, |
}, |
||||
// 发布信息
|
}; |
||||
____publishInfo() { |
}, |
||||
let deviceList = []; |
// 从模板新增待下发
|
||||
if (this.selectedDevice){ |
____onTplToDevice(item, showDialog) { |
||||
deviceList = [this.selectedDevice]; |
// if(this.checkedDeviceIds.length<=0){
|
||||
}else{ |
// this.$message.warning('未选择设备!');
|
||||
deviceList = this.selectedDevices; |
// return;
|
||||
} |
// }
|
||||
this.$confirm('是否确定发布情报板?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
|
|
||||
let loading = this.$loading({ |
|
||||
lock: true, |
|
||||
text: 'Loading', |
|
||||
spinner: 'el-icon-loading', |
|
||||
background: 'rgba(0, 0, 0, 0.7)' |
|
||||
}) |
|
||||
|
|
||||
let content = []; |
let arr = this.selectedSize.split("*"); |
||||
|
item.origin = { |
||||
|
displayAreaWidth: +arr[0], |
||||
|
displayAreaHeight: +arr[1], |
||||
|
}; |
||||
|
|
||||
this.selectedBdMsg.forEach(item => { |
this.editDialog = { |
||||
content.push({ |
visible: showDialog == false ? false : true, |
||||
STAY: item.playbackDuration, |
mode: "toDevice", |
||||
ACTION: item.screenEntryMethod, |
type: "template", |
||||
SPEED: item.fontSpacing || 0, |
tpl: item, |
||||
COLOR: item.foregroundColor, |
}; |
||||
FONT: item.font, |
}, |
||||
FONT_SIZE: item.fontSize, |
// 发布信息
|
||||
CONTENT: item.textContent.replaceAll(',', '\\,').replaceAll('=', '\\=').replaceAll('\n', '\\\\n'), |
____publishInfo() { |
||||
width: item.displayAreaWidth, |
let deviceList = []; |
||||
height: item.displayAreaHeight, |
if (this.isMultiControl && !this.selectItems.length) { |
||||
formatStyle: item.verticalAlignment |
return Message.error("请至少选择一个设备!"); |
||||
}) |
} |
||||
}) |
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; |
||||
|
} |
||||
|
|
||||
let data = { content: content, deviceList } |
this.$confirm("是否确定发布情报板?", "提示", { |
||||
|
confirmButtonText: "确定", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
let loading = this.$loading({ |
||||
|
lock: true, |
||||
|
text: "Loading", |
||||
|
spinner: "el-icon-loading", |
||||
|
background: "rgba(0, 0, 0, 0.7)", |
||||
|
}); |
||||
|
|
||||
if (IS_TESTING) { |
let content = []; |
||||
// this.saveLog(content);
|
|
||||
this.____getDeviceInfo(); |
|
||||
loading.close() |
|
||||
|
|
||||
} else { |
this.selectedBdMsg.forEach((item) => { |
||||
publishToBoard(data).then(res => { |
content.push({ |
||||
// this.saveLog(content);
|
STAY: item.playbackDuration, |
||||
this.$message({ |
ACTION: item.screenEntryMethod, |
||||
type:"success", |
SPEED: item.fontSpacing || 0, |
||||
message:"发布成功!" |
COLOR: item.foregroundColor, |
||||
}); |
FONT: item.font, |
||||
this.____getDeviceInfo(); |
FONT_SIZE: item.fontSize, |
||||
}).catch(err=>{ |
CONTENT: item.textContent |
||||
|
.replaceAll(",", "\\,") |
||||
|
.replaceAll("=", "\\=") |
||||
|
.replaceAll("\n", "\\\\n"), |
||||
|
width: item.displayAreaWidth, |
||||
|
height: item.displayAreaHeight, |
||||
|
formatStyle: item.verticalAlignment, |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
}).finally(()=>{ |
let data = { content: content, deviceList }; |
||||
loading.close() |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
}).catch(() => { |
if (IS_TESTING) { |
||||
|
// this.saveLog(content);
|
||||
|
this.____getDeviceInfo(); |
||||
|
loading.close(); |
||||
|
} else { |
||||
|
publishToBoard(data) |
||||
|
.then((res) => { |
||||
|
// this.saveLog(content);
|
||||
this.$message({ |
this.$message({ |
||||
type: 'info', |
type: "success", |
||||
message: '取消发布' |
message: "发布成功!", |
||||
}) |
}); |
||||
}) |
!isMultiControl && this.____getDeviceInfo(); |
||||
|
}) |
||||
}, |
.catch((err) => {}) |
||||
//
|
.finally(() => { |
||||
saveLog(content){ |
loading.close(); |
||||
let time = moment().format("YYYY-MM-DD HH:mm:ss"); |
}); |
||||
let device = this.selectedDevices; |
} |
||||
let data = { |
}) |
||||
"createBy": store.getters.name, |
.catch(() => { |
||||
"createTime": time, |
this.$message({ |
||||
"deviceId": device.id, |
type: "info", |
||||
"deviceName": device.deviceName, |
message: "取消发布", |
||||
"direction": device.direction, |
}); |
||||
"params": {}, |
}); |
||||
"platform": "", |
}, |
||||
"releaseContent": JSON.stringify(content), |
//
|
||||
"releaseDeptId": "", |
saveLog(content) { |
||||
"releaseDeptName": "", |
let time = moment().format("YYYY-MM-DD HH:mm:ss"); |
||||
"releaseIp": "", |
let device = this.selectedDevices; |
||||
"releaseStatus": "", |
let data = { |
||||
"releaseTime": time, |
createBy: store.getters.name, |
||||
"releaseUserId": "", |
createTime: time, |
||||
"releaseUserName": "", |
deviceId: device.id, |
||||
"remark": "", |
deviceName: device.deviceName, |
||||
"searchValue": "", |
direction: device.direction, |
||||
"stakeMark": device.stakeMark, |
params: {}, |
||||
"updateBy": "", |
platform: "", |
||||
"updateTime": time |
releaseContent: JSON.stringify(content), |
||||
} |
releaseDeptId: "", |
||||
saveBoardReleaseLog(data).then(res => { |
releaseDeptName: "", |
||||
if(res.code==200){ |
releaseIp: "", |
||||
console.log("情报板日志已保存:::" , data); |
releaseStatus: "", |
||||
}else{ |
releaseTime: time, |
||||
console.log("情报板日志保存失败!"); |
releaseUserId: "", |
||||
} |
releaseUserName: "", |
||||
}) |
remark: "", |
||||
|
searchValue: "", |
||||
|
stakeMark: device.stakeMark, |
||||
|
updateBy: "", |
||||
|
updateTime: time, |
||||
|
}; |
||||
|
saveBoardReleaseLog(data).then((res) => { |
||||
|
if (res.code == 200) { |
||||
|
console.log("情报板日志已保存:::", data); |
||||
|
} else { |
||||
|
console.log("情报板日志保存失败!"); |
||||
} |
} |
||||
} |
}); |
||||
} |
}, |
||||
|
}, |
||||
|
}; |
||||
|
File diff suppressed because it is too large
File diff suppressed because it is too large
Loading…
Reference in new issue