diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js index e7b808be..fe5e221b 100644 --- a/ruoyi-ui/src/main.js +++ b/ruoyi-ui/src/main.js @@ -78,7 +78,7 @@ Vue.filter('dateformat', function (dataStr, pattern = 'YYY-MM-DD HH:mm:ss') { window.IS_TESTING = false; if (process.env.NODE_ENV == 'development'){ - window.IS_TESTING = true; + window.IS_TESTING = false; } // 全局方法挂载 diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardInfoEditor.vue b/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardInfoEditor.vue index baddeea8..a5bb6b4b 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardInfoEditor.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardInfoEditor.vue @@ -323,7 +323,7 @@ export default { fontColor: this.colorList[0].dictValue, fontSize: this.fontSizeList[0].dictValue, fontType: this.fontTypeList[0].dictValue, - stopTime: 5, + stopTime: 50, inScreenMode: this.inScreenModeList[0].dictValue, screenSize: this.screenSize } diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardPreview.vue b/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardPreview.vue index 678264f0..cf499d0e 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardPreview.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardPreview.vue @@ -26,39 +26,6 @@ export default { default: "300*200" }, tpl: { - // { - // "backgroundColor": "00000000", - // "displayAreaHeight": "120", - // "displayAreaWidth": "768", - // "flashingFrequency": "5", //闪烁次数 - // "flickerSpeed": "0", //闪烁速度 - // "font": "微软雅黑", - // "fontSize": "14", - // "fontSpacing": "4", - // "fontStyle": "0", - // "foregroundColor": "ffff00", - // "horizontalAlignment": "2", - // "intonation": "0", - // "lineSpacing": "0", - // "playSpecialEffects": "0", - // "playbackCount": "1", - // "playbackDuration": "50", - // "residenceTime": "18", //停留时间 - // "screenEntryMethod": "1", //入屏方式 - // "screenEntrySpeed": "1", //入屏速度 - // "screenOutputMethod": "1", //出屏方式 - // "setUpTheSpeaker": "0", - // "specialEffectsSpeed": "1", - // "speechSpeed": "0", - // "textContent": "因改扩建施工最高限速100km/h", - // "verticalAlignment": "2", - // "volume": "0", - // "whetherToPlayText": "0", - // "whetherToSynchronizePlayback": "0", - // "xCoordinate": "0", - // "yCoordinate": "0" - // } - type: Object, default: {} }, @@ -108,7 +75,6 @@ export default { } else { fontSize = this.tpl.fontSize; } - fontSize = fontSize * scale; this.boardTxtStyle = { "color": "#" + this.tpl.foregroundColor, "font-size": `${fontSize*scale}px`, diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/InfoBoard/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/InfoBoard/index.vue index c7f996f7..2f3deacb 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/InfoBoard/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/InfoBoard/index.vue @@ -412,7 +412,7 @@ export default { ____onDeleteBoardItem(index) { if (index > -1) { this.selectedBdMsg.splice(index, 1) - this.$message.success('删除成功,发布后才能生效。') + this.$message.success('删除成功,发布后才效。') } }, @@ -619,7 +619,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 diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue index 7e92ca64..20a60477 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue @@ -22,13 +22,13 @@
- +
{{ itm.deviceName }}
-
@@ -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];