diff --git a/.DS_Store b/.DS_Store index 1cc8dd82..8bc7c4ea 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/BoardInfoEditor.vue b/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardInfoEditor.vue similarity index 91% rename from ruoyi-ui/src/views/JiHeExpressway/pages/service/board/BoardInfoEditor.vue rename to ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardInfoEditor.vue index b00b4288..7870aad5 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/BoardInfoEditor.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardInfoEditor.vue @@ -99,8 +99,8 @@ import { getTemplateList, addTemplate, addTemplateContent, editTemplateContent, editTemplate, deleteTemplate, getTemplateContent, getGalleryList, getFontSizeByDevicePixel, uploadBoardEditInfo } from '@/api/board/template' import { devicessize } from '@/api/information/api.js' import { checkIotBoardContent } from '@/api/board/vocabulary' -import BoardPreview from "./BoardPreview.vue" -import BoardTplPreview from "./BoardTplPreview.vue" +import BoardPreview from "@screen/components/infoBoard/BoardPreview.vue" +import BoardTplPreview from "@screen/components/infoBoard/BoardTplPreview.vue" import infoBoardUtils from "@screen/utils/infoBoard.js" export default { data() { @@ -191,7 +191,39 @@ export default { templateCategoryList: [], infoType: '', devicePixelBoolean: false, - categoryRules: false + categoryRules: false, + tplDefault: { + "residenceTime": "50", + "intonation": "0", + "fontSpacing": "1", + "screenEntryMethod": "1", + "screenOutputMethod": "1", + "lineSpacing": "0", + "yCoordinate": "0", + "whetherToSynchronizePlayback": "0", + "whetherToPlayText": "0", + "playbackCount": "1", + "flashingFrequency": "5", + "backgroundColor": "8", + "foregroundColor": "FFFF00", + "textContent": "", + "fontStyle": "0", + "displayAreaWidth": "768", + "playbackDuration": "50", + "displayAreaHeight": "64", + "volume": "0", + "xCoordinate": "0", + "screenEntrySpeed": "1", + "horizontalAlignment": "2", + "playSpecialEffects": "0", + "setUpTheSpeaker": "0", + "flickerSpeed": "0", + "specialEffectsSpeed": "1", + "fontSize": "64", + "verticalAlignment": "2", + "speechSpeed": "0", + "font": "3" + } } }, props:{ @@ -275,9 +307,9 @@ export default { // console.log(res.data , "++++++++==========="); // }) if(this.mode=="add"){ - let tplDefault= null; + let tempTpl= null; if(this.type=="template"){ - tplDefault = { + tempTpl = { category: this.templateCategoryList[0].dictValue, formatStyle: 0, content: "", @@ -290,42 +322,11 @@ export default { } } else{ - tplDefault = { - "residenceTime": "50", - "intonation": "0", - "fontSpacing": "1", - "screenEntryMethod": "1", - "screenOutputMethod": "1", - "lineSpacing": "0", - "yCoordinate": "0", - "whetherToSynchronizePlayback": "0", - "whetherToPlayText": "0", - "playbackCount": "1", - "flashingFrequency": "5", - "backgroundColor": "8", - "foregroundColor": "FFFF00", - "textContent": "", - "fontStyle": "0", - "displayAreaWidth": "768", - "playbackDuration": "50", - "displayAreaHeight": "64", - "volume": "0", - "xCoordinate": "0", - "screenEntrySpeed": "1", - "horizontalAlignment": "2", - "playSpecialEffects": "0", - "setUpTheSpeaker": "0", - "flickerSpeed": "0", - "specialEffectsSpeed": "1", - "fontSize": "64", - "verticalAlignment": "2", - "speechSpeed": "0", - "font": "3" - } + tempTpl = this.tplDefault; } this.dataForm = infoBoardUtils.dialogSourceFormat(tplDefault, this.type); }else{ - this.dataForm = infoBoardUtils.dialogSourceFormat(this.tpl, this.type); + this.dataForm = infoBoardUtils.dialogSourceFormat(this.tpl, this.type, this.mode, this.tplDefault); } }, onClose(){ @@ -424,7 +425,7 @@ export default { } })*/ - let data = infoBoardUtils.dialogSaveFormat(this.dataForm, this.type); + let data = infoBoardUtils.dialogSaveFormat(this.dataForm, this.type, this.mode); this.loading = true // let templateId = ""; @@ -434,11 +435,16 @@ export default { editTemplate(data).then(res=>{ afterSave("修改"); }); - }else{ + }else if (this.mode == "toDevice") { + this.loading = false + + this.$emit("afterSubmit", { type: this.type, mode: this.mode, data: data }); + } else { addTemplate(data).then(res => { afterSave("新增"); }); } + }else{ this.loading = false // this.dialogVisible = false diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/BoardPreview.vue b/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardPreview.vue similarity index 100% rename from ruoyi-ui/src/views/JiHeExpressway/pages/service/board/BoardPreview.vue rename to ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardPreview.vue diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/BoardTplPreview.vue b/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardTplPreview.vue similarity index 100% rename from ruoyi-ui/src/views/JiHeExpressway/pages/service/board/BoardTplPreview.vue rename to ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardTplPreview.vue 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 3371eec7..a1f9358a 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 @@ -9,23 +9,23 @@
-
-
-
-
-
-
-
-
-
-
+
+ +
+ + + +
+ +

+
+ +

+
+ +
暂无数据
@@ -64,28 +64,27 @@
- - -
-
-
-
-
-
+ +
+ +

{{ item.dictLabel }}

+
+ + + + +
+ +

+
- - +
@@ -140,6 +139,10 @@
+ + + @@ -151,6 +154,17 @@ import addBoard from './addinfo.vue' import editBoard from './editInfo.vue' import { listDevice, invokedFunction, getDeviceRealtimeProperty } from '@/api/device/device.js' import infoBoardTestData from "@/common/infoBoardTestData.js" +import { getBoardDeviceInfo } from '@/api/board/board' + +import BoardPreview from "@screen/components/infoBoard/BoardPreview.vue" +import BoardTplPreview from "@screen/components/infoBoard/BoardTplPreview.vue" +import BoardInfoEditor from '@screen/components/infoBoard/BoardInfoEditor' + +import vuescroll from 'vuescroll' +import scrollOptions from '@/common/scrollbar.js' + +import { getTemplateList } from '@/api/board/template' + export default { name: 'InfoBoard', data(){ @@ -246,17 +260,45 @@ export default { { id: 5001, txt: '变倍', numL: 11, numR: 12 }, { id: 5002, txt: '光圈', numL: 16, numR: 15 }, { id: 5003, txt: '聚焦', numL: 14, numR: 13 } - ] + ], + showEmit:false, + + selectedBdMsg:[], + selectedSize:"", + editDialog: { + mode: "", + type: "", + visible: false, + tpl: {} + }, + scrollOptions, + templateAvailable:null, + tplCategory: [], //模板 + templateAll:[] } }, props:{ visible:{ type:Boolean, default:false + }, + device: { + type:Object, + default:null } }, - components: { addBoard, editBoard }, + watch:{ + device: { + handler(newV) { + this.____getDeviceInfo(); + }, + immediate: false + } + }, + components: { addBoard, editBoard, BoardPreview, BoardTplPreview, BoardInfoEditor, vuescroll}, created() { + this.____getTemplateCategory(); + this.____getAllTemplate(); // this.getTemplateSeries(); }, computed:{ @@ -276,6 +318,108 @@ export default { ] }, methods: { + // 获取信息模板分类 + ____getTemplateCategory() { + return this.getDicts('iot_template_category').then(res => { + this.tplCategory = res.data; + }) + }, + + ____getAllTemplate() { + return getTemplateList().then((res) => { + this.templateAll = res.data; + }); + }, + + ____getDeviceInfo(){ + this.selectedSize = JSON.parse(this.device.otherConfig).screenSize; + this.____setAvailableTemplate(); + + getBoardDeviceInfo(this.device.iotDeviceId).then(res => { + this.selectedBdMsg = res.data["3A"].content; + }).catch(err => { + + }) + }, + + ____setAvailableTemplate() { + this.templateAvailable = []; + this.tplCategory.forEach((item, index) => { + let arr = this.templateAll['' + index]; + if (arr.length > 0) { + let temp = []; + arr.forEach(tpl => { + if (tpl.screenSize == this.selectedSize) { + temp.push(tpl); + } + }) + if (temp.length > 0) { + this.templateAvailable.push({ + ...item, + list: temp + }); + } + } + }) + }, + + ____onEditBoardItem(tpl, index) { + // type : board template + // mode : edit add toDevice toTemplate + this.boardItemEdtingIndex = index; + this.editDialog = { + visible: true, + mode: "edit", + type: "device", + tpl + } + }, + + ____onDeleteBoardItem(index) { + if (index > -1) { + this.selectedBdMsg.splice(index, 1) + this.$message.success('删除成功,发布后才能生效。') + } + }, + + ____onEditSubmit(para) { + this.editDialog.tpl = {}; + this.editDialog.visible = false; + + if (para.type == "device") { + if (para.mode == "edit") { + this.selectedBdMsg[this.boardItemEdtingIndex] = para.data; + } else { + this.selectedBdMsg.push(para.data); + } + } else if (para.mode == "toDevice") { + this.selectedBdMsg.push(para.data); + } else { + this.____refreshPageData(para); + } + }, + + ____refreshPageData(para){}, + + + // 新增待下发 + ____onAddToDevice(item) { + let arr = this.selectedSize.split("*"); + this.editDialog = { + visible: true, + mode: "toDevice", + type: "template", + tpl: item, + origin: { + displayAreaWidth: +arr[0], + displayAreaHeight: +arr[1] + } + } + }, + + + + boardBoxStyle(node) { let arr = node.screenSize.split("*"); let scale = this.getScrollSz(+arr[0]); @@ -728,6 +872,94 @@ export default {