diff --git a/ruoyi-ui/src/api/board/board.js b/ruoyi-ui/src/api/board/board.js index 910a4f2b..b68f011f 100644 --- a/ruoyi-ui/src/api/board/board.js +++ b/ruoyi-ui/src/api/board/board.js @@ -18,4 +18,13 @@ export function getBoardDeviceInfo(deviceId) { url: `/business/board/realtimeProperty/${deviceId}`, method: 'get' }) +} + +// +export function publishToBoard(data) { + return request({ + url: '/dev-api/business/board/publish', + method: 'post', + data: data + }) } \ No newline at end of file diff --git a/ruoyi-ui/src/common/infoBoardTestData.js b/ruoyi-ui/src/common/infoBoardTestData.js index 1450b03c..9bd79762 100644 --- a/ruoyi-ui/src/common/infoBoardTestData.js +++ b/ruoyi-ui/src/common/infoBoardTestData.js @@ -34,8 +34,8 @@ export default [ "backgroundColor": "00000000", "displayAreaHeight": "120", "displayAreaWidth": "768", - "flashingFrequency": "5", //闪烁次数 - "flickerSpeed": "0", //闪烁速度 + "flashingFrequency": "5", + "flickerSpeed": "0", "font": "微软雅黑", "fontSize": "40", "fontSpacing": "4", @@ -47,10 +47,10 @@ export default [ "playSpecialEffects": "0", "playbackCount": "1", "playbackDuration": "50", - "residenceTime": "18", //停留时间 - "screenEntryMethod": "1", //入屏方式 - "screenEntrySpeed": "1", //入屏速度 - "screenOutputMethod": "1", //出屏方式 + "residenceTime": "18", + "screenEntryMethod": "1", + "screenEntrySpeed": "1", + "screenOutputMethod": "1", "setUpTheSpeaker": "0", "specialEffectsSpeed": "1", "speechSpeed": "0", diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardTplPreview.vue b/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardTplPreview.vue index 7d937b98..5d7d45ab 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardTplPreview.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardTplPreview.vue @@ -56,7 +56,7 @@ export default { }, tpl:{ handler(newV){ - this.contentArr = this.tpl.content.replace(/\\+n|\\+r\n/g, '&&&&&').replace(/ /g, ' ').split('&&&&&'); + this.contentArr = this.tpl.content.replace(/\n/g, '&&&&&').replace(/ /g, ' ').split('&&&&&'); this.setStyle(); }, deep:true, 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 e9ddc5d8..177920d0 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 @@ -178,6 +178,7 @@ import vuescroll from 'vuescroll' import scrollOptions from '@/common/scrollbar.js' import Teleport from '@screen/components/Teleport.vue' +import { publishToBoard } from '@/api/board/board' import { getTemplateList } from '@/api/board/template' export default { @@ -586,77 +587,22 @@ export default { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' - }) - .then(() => { - return; + }).then(() => { + let loading = this.$loading({ lock: true, text: 'Loading', spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' }) - const objAll = {} - // objAll.deviceIds = this.checkedCities.toString() - objAll.deviceIds = this.mapIds - let that = this - - // let devicePixel = this.form.devicePixel.split('*') - console.log('接口参数', this.dialogInfoList) - let newArr = this.dialogInfoList.map(item => { - let obj = {} - - obj.STAY = item.STAY - obj.ACTION = item.inScreenMode - obj.SPEED = item.tcontents[0].fontSpacing - obj.COORDINATE = item.screenSize.replace('*', '') - obj.COLOR = item.tcontents[0].fontColor - obj.FONT = this.getFontValue(item.tcontents[0].fontType) - obj.FONT_SIZE = item.tcontents[0].fontSize - - obj.CONTENT = item.tcontents[0].content.replaceAll(',', '\\,') - obj.CONTENT = item.tcontents[0].content.replaceAll('=', '\\=') - obj.CONTENT = item.tcontents[0].content.replace(/\n/g, '\\\\n') - - // obj.CONTENT = item.tcontents[0].content.replace(/\n|\r\n/g, '') - obj.width = this.processString(item.screenSize, 'w') - obj.height = this.processString(item.screenSize, 'h') - obj.formatStyle = item.tcontents[0].formatStyle - return obj - }) - objAll.parameters = newArr - const param = { - objectData: JSON.stringify(objAll) - } - - invokedFunction(595, 11, { size: '65535', fileName: 'play099.lst' }) - .then(res => { - debugger - // console.log('发布消息,校验文件名-------------') - if (res.data.result == '01') { - invokedFunction(595, 13, { parameters: newArr }) - .then(res => { - debugger - // console.log('发布消息,发送文件内容-----') - if (res.data.result == '01') { - invokedFunction(595, '1B', { fileId: '99' }) - .then(res => { - debugger - // console.log('发布消息,播放文件-----') - }) - .catch(() => { - this.$modal.msgError('发布失败,请重试') - }) - } - }) - .catch(() => { - this.$modal.msgError('发布失败,请重试') - }) - } - }) - .catch(() => { - this.$modal.msgError('发布失败,请重试') - }) + console.log(this.device , "devicedevicedevice") + console.log(this.device.iotDeviceId , "iotDeviceIdiotDeviceIdiotDeviceId") + console.log(this.selectedBdMsg , "selectedBdMsgselectedBdMsgselectedBdMsg") + // let content = this.content; + // let deviceId = this.device; + // publishToBoard({content, deviceId}); + loading.close() }) .catch(() => { 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 81df402d..d10b7253 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue @@ -55,7 +55,7 @@
添加信息 - 发布信息 + 发布信息
@@ -477,10 +477,18 @@ export default { // 新增待下发 ____onAddToDevice(item) { + if(this.checkedDevices.length<=0){ this.$message.warning('未选择设备!'); return; } + + let arr = this.selectedSize.split("*"); + item.origin = { + displayAreaWidth: +arr[0], + displayAreaHeight: +arr[1] + } + this.editDialog = { visible: true, mode: "toDevice", @@ -607,80 +615,57 @@ export default { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' - }) - .then(() => { - let loading = this.$loading({ - lock: true, - text: 'Loading', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }) - const objAll = {} - objAll.deviceIds = this.checkedDevices.toString() - let that = this - - let selectedPixel = this.form.selectedPixel.split('*') - let newArr = this.contentList.map(function (item) { - let obj = {} - - obj.STAY = item.STAY - obj.ACTION = item.ACTION - obj.SPEED = item.SPEED - obj.COORDINATE = item.COORDINATE.replace('-', '0') - obj.COLOR = item.COLOR - obj.FONT = that.getFontValue(item.FONT) - obj.FONT_SIZE = item.FONT_SIZE.substring(0, 2) - // obj.CONTENT = item.CONTENT.replace(/\\/g, '\\\\') - // - - // obj.CONTENT = item.CONTENT.replace(/\,/g , "other string or space") - // obj.CONTENT = item.CONTENT - obj.CONTENT = item.CONTENT.replaceAll(',', '\\,') - obj.CONTENT = obj.CONTENT.replaceAll('=', '\\=') - obj.CONTENT = obj.CONTENT.replaceAll('\n', '\\\\n') - - // obj.CONTENT = obj.CONTENT.replaceAll('=','\=') - obj.width = selectedPixel[0] - obj.height = selectedPixel[1] - obj.formatStyle = item.formatStyle - return obj - }) - objAll.parameters = newArr - const param = { - objectData: JSON.stringify(objAll) - } - console.log(newArr, 'newArr') - - invokedFunction(objAll.deviceIds, 11, { size: '65535', fileName: 'play010.lst' }) - .then(res => { - console.log('发布消息,校验文件名-------------------------------------') - console.log(res) - if (res.data.result == '01') { - invokedFunction(objAll.deviceIds, 13, { parameters: newArr }) - .then(res => { - console.log('发布消息,发送文件内容-----------------------------') - console.log(res) - if (res.data.result == '01') { - invokedFunction(objAll.deviceIds, '1B', { fileId: '10' }) - .then(res => { - console.log('发布消息,播放文件-----------------------------') - console.log(res) - }) - .catch(() => { - this.$modal.msgWarning('发布失败,请重试') - }) - } - }) - .catch(() => { - this.$modal.msgWarning('发布失败,请重试') - }) - } - }) - .catch(() => { - this.$modal.msgWarning('发布失败,请重试') - }) - loading.close() + }).then(() => { + + let loading = this.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' }) + + + let content = []; + let deviceId = this.device; + this.selectedBdMsg.forEach(item=>{ + console.log(item.textContent , "item.textContentitem.textContentitem.textContent"); + content.push({ + STAY :item.playbackDuration, + ACTION :item.screenEntryMethod, + SPEED :item.fontSpacing, + COLOR :item.foregroundColor, + FONT : item.font, + FONT_SIZE : item.fontSize, + CONTENT :item.textContent.replaceAll('\\', '').replaceAll(',', '\\,').replaceAll('=', '\\=').replaceAll('\n', '\\\\n'), + width : item.displayAreaWidth, + height : item.displayAreaHeight, + formatstyle : item.verticalAlignment, + + // backgroundColor : item.backgroundColor, + // flashingFrequency : item.flashingFrequency, + // flickerSpeed : item.flickerSpeed, + // fontStyle : item.fontStyle, + // horizontalAlignment : item.horizontalAlignment, + // intonation : item.intonation, + // lineSpacing : item.lineSpacing, + // playSpecialEffects : item.playSpecialEffects, + // playbackCount : item.playbackCount, + // residenceTime : item.residenceTime, + // screenEntrySpeed : item.screenEntrySpeed, + // screenOutputMethod : item.screenOutputMethod, + // setUpTheSpeaker : item.setUpTheSpeaker, + // specialEffectsSpeed : item.specialEffectsSpeed, + // speechSpeed : item.speechSpeed, + // volume : item.volume, + // whetherToPlayText : item.whetherToPlayText, + // whetherToSynchronizePlayback : item.whetherToSynchronizePlayback, + }) + }) + console.log(content, "发布内容"); + // publishToBoard({content, deviceId}); + + loading.close() + }) .catch(() => { this.$message({ type: 'info', @@ -688,6 +673,8 @@ export default { }) loading.close() }) + this.updateList() + }, // 接收子组件form表单 修改 diff --git a/ruoyi-ui/src/views/JiHeExpressway/utils/infoBoard.js b/ruoyi-ui/src/views/JiHeExpressway/utils/infoBoard.js index 11e19eab..aad78e3f 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/utils/infoBoard.js +++ b/ruoyi-ui/src/views/JiHeExpressway/utils/infoBoard.js @@ -38,7 +38,8 @@ export default { else{ console.log(data.origin , "fdsgfhgjdfss") data1 = { - formatStyle: data.horizontalAlignment, + // formatStyle: data.horizontalAlignment, + formatStyle: data.verticalAlignment, content: data.textContent, fontColor: data.foregroundColor.toUpperCase(), fontSize: data.fontSize.replace("px",""), @@ -58,10 +59,11 @@ export default { data1.stopTime = data1.stopTime * 10 + ""; } else { let temp = { - horizontalAlignment : data.formatStyle, + // horizontalAlignment : data.formatStyle, + verticalAlignment : data.formatStyle, textContent : data.content, foregroundColor: data.fontColor.toLowerCase(), - fontSize: data.fontSize, + fontSize: data.fontSize.replace("px", ""), font: data.fontFamily, residenceTime : data.stopTime, screenEntryMethod : data.inScreenMode diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index 7a16ca3c..4d947841 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -43,8 +43,9 @@ module.exports = { // target: `http://10.168.73.36:8080`, // 周乐 // target: `http://10.168.77.209:8080`, // 刘朋 // target: `http://10.168.66.196:8080`, //刘文阁 - target: `http://10.168.65.156:8087`,//孟 - // target: `http://10.0.81.202:8087`, //现场后台 + // target: `http://10.168.56.206:8087`, //孟 + target: `http://10.0.81.202:8087`, //现场后台 + // target: `http://10.0.81.204:8087`, //现场后台 刘文阁 changeOrigin: true, pathRewrite: { ["^" + process.env.VUE_APP_BASE_API]: "",