From 4e02eeaf9007f6d72ece56774856735c183fc3da Mon Sep 17 00:00:00 2001 From: IAMHERE <446961233@qq.com> Date: Fri, 29 Dec 2023 16:06:17 +0800 Subject: [PATCH] =?UTF-8?q?fix-=E6=9B=B4=E6=96=B0=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/information/board/editInfo.vue | 7 +- .../src/views/information/board/index.vue | 137 ++++++++++-------- 2 files changed, 77 insertions(+), 67 deletions(-) diff --git a/ruoyi-ui/src/views/information/board/editInfo.vue b/ruoyi-ui/src/views/information/board/editInfo.vue index ac17eff4..ca98c2a4 100644 --- a/ruoyi-ui/src/views/information/board/editInfo.vue +++ b/ruoyi-ui/src/views/information/board/editInfo.vue @@ -6,7 +6,7 @@
- +
', '\n').replace(/ /g, ' ').replace('', '\n'))) this.dataForm.STAY = JSON.parse(JSON.stringify(Number(this.boardEmitItem.STAY) / 10)) @@ -595,7 +596,7 @@ export default { return this.$modal.msgError('当前输入内容为空') } - if (this.dataForm.CONTENT.indexOf('\\')>0) { + if (this.dataForm.CONTENT.indexOf('\\') > 0) { return this.$modal.msgError("内容不能含有特殊字符'\\'") } this.loading = true diff --git a/ruoyi-ui/src/views/information/board/index.vue b/ruoyi-ui/src/views/information/board/index.vue index 1cc150c7..c902ad85 100644 --- a/ruoyi-ui/src/views/information/board/index.vue +++ b/ruoyi-ui/src/views/information/board/index.vue @@ -25,7 +25,7 @@
-
@@ -80,8 +80,10 @@ fontFamily: scope.row.FONT, width: getScreenSize(form.devicePixel, 'width') + 'px', height: getScreenSize(form.devicePixel, 'height') + 'px', - lineHeight:getScreenSize(form.devicePixel, 'height') + 'px', - textAlign: getTextAlign(scope.row.formatStyle), + 'lineHeight':'1', + 'display': 'flex', + 'align-items': 'center', + 'justify-content': getTextAlign(scope.row.formatStyle), }"> @@ -228,9 +231,9 @@ import addinfo from './addinfo' import editInfo from './editInfo' import boardData from './boardData' import { getUserDeptId } from '@/api/system/user' -import { listTunnels, devicessize, information, getBoardInfo, getBoardEditInfo, getIotBoardList, getBoardContentData,deviceControl } from '@/api/information/api.js' +import { listTunnels, devicessize, information, getBoardInfo, getBoardEditInfo, getIotBoardList, getBoardContentData, deviceControl } from '@/api/information/api.js' import { uploadBoardEditInfo, getAllVmsTemplate, addTemplate, addTemplateContent, getBoardContent, deleteTemplate, splicingBoard } from '@/api/board/template' -import {invokedFunction,getDeviceRealtimeProperty} from '@/api/device/device' +import { invokedFunction, getDeviceRealtimeProperty } from '@/api/device/device' // 对象深拷贝 export const deepClone = data => { @@ -383,7 +386,6 @@ export default { devicePixel: '768*64', label: '门架板768*64', list: [ - { searchValue: null, createBy: null, @@ -445,7 +447,8 @@ export default { lAlarmHandleStr: null, eqDirection: null, iotDeviceType: null - },{ + }, + { searchValue: null, createBy: null, createTime: null, @@ -506,7 +509,8 @@ export default { lAlarmHandleStr: null, eqDirection: null, iotDeviceType: null - },{ + }, + { searchValue: null, createBy: null, createTime: null, @@ -567,7 +571,8 @@ export default { lAlarmHandleStr: null, eqDirection: null, iotDeviceType: null - },{ + }, + { searchValue: null, createBy: null, createTime: null, @@ -628,7 +633,8 @@ export default { lAlarmHandleStr: null, eqDirection: null, iotDeviceType: null - },{ + }, + { searchValue: null, createBy: null, createTime: null, @@ -689,7 +695,7 @@ export default { lAlarmHandleStr: null, eqDirection: null, iotDeviceType: null - }, + } ] }, { @@ -974,7 +980,7 @@ export default { category: item.category, //所属类别 ID: this.contentList.length, format: item.tcontents[0].contentList, - formatStyle : item.tcontents[0].formatStyle, + formatStyle: item.tcontents[0].formatStyle } this.contentList.push(list) this.toggleIndex++ @@ -1064,7 +1070,7 @@ export default { category: item.category, id: item.id, tcontentsId: item.tcontents[0].id, - formatStyle : item.tcontents[0].formatStyle + formatStyle: item.tcontents[0].formatStyle } this.showEmit = true }, @@ -1130,7 +1136,8 @@ export default { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' - }).then(() => { + }) + .then(() => { let loading = this.$loading({ lock: true, text: 'Loading', @@ -1157,10 +1164,9 @@ export default { // 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 = item.CONTENT.replaceAll(',', '\\,') + obj.CONTENT = obj.CONTENT.replaceAll('=', '\\=') + obj.CONTENT = obj.CONTENT.replaceAll('\n', '\\\\n') // obj.CONTENT = obj.CONTENT.replaceAll('=','\=') obj.width = devicePixel[0] @@ -1174,41 +1180,46 @@ export default { } console.log(newArr, 'newArr') - - invokedFunction(objAll.deviceIds,11,{size : '65535',fileName:'play010.lst'}).then(res =>{ - debugger - console.log('发布消息,校验文件名-------------------------------------') - console.log(res) - if (res.data.result == '01'){ - invokedFunction(objAll.deviceIds,13,{parameters:newArr}).then(res =>{ + invokedFunction(objAll.deviceIds, 11, { size: '65535', fileName: 'play010.lst' }) + .then(res => { debugger - console.log('发布消息,发送文件内容-----------------------------') + console.log('发布消息,校验文件名-------------------------------------') console.log(res) - if (res.data.result == '01'){ - invokedFunction(objAll.deviceIds,'1B',{fileId:'10'}).then(res =>{ - debugger - console.log('发布消息,播放文件-----------------------------') - console.log(res) - }).catch(()=>{ - this.$modal.msgWarning("发布失败,请重试"); - }) - + if (res.data.result == '01') { + invokedFunction(objAll.deviceIds, 13, { parameters: newArr }) + .then(res => { + debugger + console.log('发布消息,发送文件内容-----------------------------') + console.log(res) + if (res.data.result == '01') { + invokedFunction(objAll.deviceIds, '1B', { fileId: '10' }) + .then(res => { + debugger + console.log('发布消息,播放文件-----------------------------') + console.log(res) + }) + .catch(() => { + this.$modal.msgWarning('发布失败,请重试') + }) + } + }) + .catch(() => { + this.$modal.msgWarning('发布失败,请重试') + }) } - }).catch(()=>{ - this.$modal.msgWarning("发布失败,请重试"); }) - } - }).catch(()=>{ - this.$modal.msgWarning("发布失败,请重试"); + .catch(() => { + this.$modal.msgWarning('发布失败,请重试') + }) + loading.close() }) - loading.close() - }).catch(() => { - this.$message({ - type: 'info', - message: '已取消发布情报板' + .catch(() => { + this.$message({ + type: 'info', + message: '已取消发布情报板' + }) + loading.close() }) - loading.close() - }) }, // 接收子组件新增待发模板 @@ -1312,7 +1323,7 @@ export default { const param = { deviceId: deviceId } - /* await getBoardContentData(param) + /* await getBoardContentData(param) .then(res => { console.log(res, 'onSubmit') var contents = res.data.parameters @@ -1334,9 +1345,9 @@ export default { this.loading = false this.submitButton = false })*/ - await getDeviceRealtimeProperty(deviceId,'3A',{ async: false}) + await getDeviceRealtimeProperty(deviceId, '3A', { async: false }) .then(res => { - if ("3A" in res.data){ + if ('3A' in res.data) { console.log('回读消息------------------------') console.log(res.data) debugger @@ -1348,12 +1359,12 @@ export default { item.ID = i item.FONT = item.font item.STAY = item.playbackDuration + item.ACTION = item.screenEntryMethod item.COORDINATE = this.covering(item.xCoordinate) + this.covering(item.yCoordinate) item.screenSize = item.displayAreaWidth + '*' + item.displayAreaHeight - item.CONTENT = item.textContent.replaceAll('\\,',',') - item.CONTENT = item.CONTENT.replaceAll('\\=','=') - item.CONTENT = item.CONTENT.replaceAll('\\\\n','\n') - + item.CONTENT = item.textContent.replaceAll('\\,', ',') + item.CONTENT = item.CONTENT.replaceAll('\\=', '=') + item.CONTENT = item.CONTENT.replaceAll('\\\\n', '\n') item.formatStyle = item.verticalAlignment this.contentList.push(item) @@ -1367,13 +1378,12 @@ export default { this.submitButton = false }) .catch(e => { - this.$modal.msgWarning("回读失败,请重试"); + this.$modal.msgWarning('回读失败,请重试') this.loading = false this.submitButton = false }) this.deviceId = deviceId - // 根据情报板id获取分辨率 /*getBoardInfo(deviceId).then(res => { console.log(res, 'getBoardInfo') @@ -1386,10 +1396,9 @@ export default { })*/ }, - covering(value){ - - if (value.length < 3){ - value = '0'+value + covering(value) { + if (value.length < 3) { + value = '0' + value return this.covering(value) } @@ -1427,9 +1436,9 @@ export default { // 居中 getTextAlign(font) { - if (font == '0'){ + if (font == '0') { return 'left' - } else if (font == '1'){ + } else if (font == '1') { return 'right' } else { return 'center'