Browse Source

情报板完善

wangqin
hui 10 months ago
parent
commit
3a70a79f52
  1. 1
      .gitignore
  2. 2
      ruoyi-ui/src/api/board/board.js
  3. 105
      ruoyi-ui/src/common/infoBoardTestData.js
  4. 3
      ruoyi-ui/src/main.js
  5. 23
      ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardPreview.vue
  6. 22
      ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardTplPreview.vue
  7. 94
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/InfoBoard/index.vue
  8. 26
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue
  9. 105
      ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue
  10. 119
      ruoyi-ui/src/views/JiHeExpressway/testData/deviceList.js
  11. 75
      ruoyi-ui/src/views/JiHeExpressway/testData/infoBoard.js
  12. 3
      ruoyi-ui/src/views/JiHeExpressway/utils/infoBoard.js
  13. 3
      ruoyi-ui/vue.config.js

1
.gitignore

@ -48,3 +48,4 @@ nbdist/
/data /data
node_modules node_modules
package-lock.json package-lock.json
dist.zip

2
ruoyi-ui/src/api/board/board.js

@ -23,7 +23,7 @@ export function getBoardDeviceInfo(deviceId) {
// //
export function publishToBoard(data) { export function publishToBoard(data) {
return request({ return request({
url: '/dev-api/business/board/publish', url: '/business/board/publish',
method: 'post', method: 'post',
data: data data: data
}) })

105
ruoyi-ui/src/common/infoBoardTestData.js

@ -29,69 +29,78 @@
// volume 音量 // volume 音量
// speechSpeed 语速 // speechSpeed 语速
// intonation 语调 // intonation 语调
export default [ export default {
"msg": "操作成功",
"code": 200,
"data": {
"3A": {
"programId": 59,
"content": [
{ {
"backgroundColor": "00000000", "residenceTime": "100",
"displayAreaHeight": "120",
"displayAreaWidth": "768",
"flashingFrequency": "5",
"flickerSpeed": "0",
"font": "微软雅黑",
"fontSize": "40",
"fontSpacing": "4",
"fontStyle": "0",
"foregroundColor": "ffff00",
"horizontalAlignment": "2",
"intonation": "0", "intonation": "0",
"fontSpacing": "1",
"screenEntryMethod": "1",
"screenOutputMethod": "1",
"lineSpacing": "0", "lineSpacing": "0",
"playSpecialEffects": "0", "yCoordinate": "0",
"whetherToSynchronizePlayback": "0",
"whetherToPlayText": "0",
"playbackCount": "1", "playbackCount": "1",
"playbackDuration": "50", "flashingFrequency": "5",
"residenceTime": "18", "backgroundColor": "8",
"screenEntryMethod": "1", "foregroundColor": "FFFF00",
"textContent": "济南方向\\\\n禁止通行",
"fontStyle": "0",
"displayAreaWidth": "160",
"playbackDuration": "100",
"displayAreaHeight": "80",
"volume": "0",
"xCoordinate": "0",
"screenEntrySpeed": "1", "screenEntrySpeed": "1",
"screenOutputMethod": "1", "horizontalAlignment": "2",
"playSpecialEffects": "0",
"setUpTheSpeaker": "0", "setUpTheSpeaker": "0",
"flickerSpeed": "0",
"specialEffectsSpeed": "1", "specialEffectsSpeed": "1",
"speechSpeed": "0", "fontSize": "32",
"textContent": "因改扩建施工最高限速100km/h",
"verticalAlignment": "2", "verticalAlignment": "2",
"volume": "0", "speechSpeed": "0",
"whetherToPlayText": "0", "font": "3"
"whetherToSynchronizePlayback": "0",
"xCoordinate": "0",
"yCoordinate": "0"
}, },
{ {
"backgroundColor": "00000000", "residenceTime": "100",
"displayAreaHeight": "120",
"displayAreaWidth": "768",
"flashingFrequency": "5",
"flickerSpeed": "0",
"font": "微软雅黑",
"fontSize": "30",
"fontSpacing": "20",
"fontStyle": "0",
"foregroundColor": "ff0000",
"horizontalAlignment": "1",
"intonation": "0", "intonation": "0",
"lineSpacing": "10", "fontSpacing": "1",
"playSpecialEffects": "0",
"playbackCount": "1",
"playbackDuration": "50",
"residenceTime": "50",
"screenEntryMethod": "1", "screenEntryMethod": "1",
"screenEntrySpeed": "1",
"screenOutputMethod": "1", "screenOutputMethod": "1",
"lineSpacing": "0",
"yCoordinate": "0",
"whetherToSynchronizePlayback": "0",
"whetherToPlayText": "0",
"playbackCount": "1",
"flashingFrequency": "5",
"backgroundColor": "8",
"foregroundColor": "FF0000",
"textContent": "菏泽方向\\\\n可以通行",
"fontStyle": "0",
"displayAreaWidth": "160",
"playbackDuration": "100",
"displayAreaHeight": "80",
"volume": "0",
"xCoordinate": "0",
"screenEntrySpeed": "1",
"horizontalAlignment": "2",
"playSpecialEffects": "0",
"setUpTheSpeaker": "0", "setUpTheSpeaker": "0",
"flickerSpeed": "0",
"specialEffectsSpeed": "1", "specialEffectsSpeed": "1",
"speechSpeed": "0", "fontSize": "32",
"textContent": "因改扩建施工最高限速100km/h",
"verticalAlignment": "2", "verticalAlignment": "2",
"volume": "0", "speechSpeed": "0",
"whetherToPlayText": "0", "font": "3"
"whetherToSynchronizePlayback": "0",
"xCoordinate": "0",
"yCoordinate": "0"
} }
] ]
}
}
}

3
ruoyi-ui/src/main.js

@ -76,6 +76,9 @@ Vue.filter('dateformat', function (dataStr, pattern = 'YYY-MM-DD HH:mm:ss') {
//(函数里面的参数 第一个是传递的数据,第二个是需要转换的时间格式) //(函数里面的参数 第一个是传递的数据,第二个是需要转换的时间格式)
}) })
if (process.env.NODE_ENV == 'development'){
window.IS_TESTING = true;
}
// 全局方法挂载 // 全局方法挂载
Vue.prototype.dayjs = dayjs; Vue.prototype.dayjs = dayjs;

23
ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardPreview.vue

@ -1,7 +1,7 @@
<template> <template>
<div class="boardPreview" ref="compBox"> <div class="boardPreview" ref="compBox">
<div class="boardBox" :style="boardStyle"> <div class="boardBox" :style="boardStyle">
<p class="boardTxt" v-for="item,index in contentArr" :key="index" :style="boardTxtStyle" v-html="item"> <p class="boardTxt" v-for="item,index in contentArr" :key="index" :style="boardTxtStyle" v-html="item" v-if="(index + 1) <= lineTotal">
</p> </p>
</div> </div>
</div> </div>
@ -16,7 +16,8 @@ export default {
contentArr:{ contentArr:{
type:Array, type:Array,
default:()=>[] default:()=>[]
} },
lineTotal: 0
} }
}, },
props:{ props:{
@ -71,7 +72,7 @@ export default {
}, },
tpl:{ tpl:{
handler(newV){ handler(newV){
this.contentArr = this.tpl.textContent.replace(/\\+n|\\+r\n/g, '&&&&&').replace(/ /g, '&nbsp').split('&&&&&'); this.contentArr = this.tpl.textContent.replaceAll(/\\\\n/g, '\n').replaceAll(/ /g, '&nbsp').split('\n');
this.setStyle(); this.setStyle();
}, },
deep:true, deep:true,
@ -85,8 +86,8 @@ export default {
methods:{ methods:{
setStyle() { setStyle() {
this.$nextTick(() => { this.$nextTick(() => {
let boxW = this.$refs["compBox"].offsetWidth; let boxW = this.$refs["compBox"].clientWidth;
let boxH = this.$refs["compBox"].offsetHeight; let boxH = this.$refs["compBox"].clientHeight;
let conW = this.tpl.displayAreaWidth; let conW = this.tpl.displayAreaWidth;
let conH = this.tpl.displayAreaHeight; let conH = this.tpl.displayAreaHeight;
let scale = 1; let scale = 1;
@ -101,14 +102,20 @@ export default {
"background-color":`${this.tpl.backgroundColor}px`, "background-color":`${this.tpl.backgroundColor}px`,
"align-items" : ['flex-start', 'flex-end', 'center'][this.tpl.horizontalAlignment] "align-items" : ['flex-start', 'flex-end', 'center'][this.tpl.horizontalAlignment]
} }
let fontSize = +this.tpl.fontSize.replace("px", ""); let fontSize = 0;
if (_.isString(this.tpl.fontSize)) {
fontSize = this.tpl.fontSize.replace('px', '') * 1;
} else {
fontSize = this.tpl.fontSize;
}
fontSize = fontSize * scale; fontSize = fontSize * scale;
this.boardTxtStyle = { this.boardTxtStyle = {
"color": "#" + this.tpl.foregroundColor, "color": "#" + this.tpl.foregroundColor,
"font-size": `${fontSize}px`, "font-size": `${fontSize*scale}px`,
"font-family": this.tpl.font, "font-family": this.tpl.font,
"min-height": `${this.tpl.fontSize.replace('px', '') * scale}px` "min-height": `${fontSize * scale}px`
} }
this.lineTotal = Math.floor(conH / fontSize);
}) })
} }
} }

22
ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardTplPreview.vue

@ -1,7 +1,7 @@
<template> <template>
<div class="boardPreview" ref="compBox"> <div class="boardPreview" ref="compBox">
<div class="boardBox" :style="boardStyle"> <div class="boardBox" :style="boardStyle">
<p class="boardTxt" v-for="item,index in contentArr" :key="index" :style="boardTxtStyle" v-html="item"> <p class="boardTxt" v-for="item,index in contentArr" :key="index" :style="boardTxtStyle" v-html="item" v-if="(index+1)<=lineTotal">
</p> </p>
</div> </div>
</div> </div>
@ -16,7 +16,8 @@ export default {
contentArr:{ contentArr:{
type:Array, type:Array,
default:()=>[] default:()=>[]
} },
lineTotal:0,
} }
}, },
props:{ props:{
@ -70,27 +71,34 @@ export default {
methods:{ methods:{
setStyle() { setStyle() {
this.$nextTick(() => { this.$nextTick(() => {
let boxW = this.$refs["compBox"].offsetWidth; let boxW = this.$refs["compBox"].clientWidth;
let boxH = this.$refs["compBox"].offsetHeight; let boxH = this.$refs["compBox"].clientHeight;
let arr = this.boardWH.split("*"); let arr = this.boardWH.split("*");
let scale = 1; let scale = 1;
console.log(boxW,boxH,arr[0],arr[1]);
if (arr[0] / arr[1] > boxW / boxH) { if (arr[0] / arr[1] > boxW / boxH) {
scale = boxW / arr[0]; scale = boxW / arr[0];
} else { } else {
scale = boxH / arr[1]; scale = boxH / arr[1];
} }
this.boardStyle = { this.boardStyle = {
width: `${arr[0] * scale}px`, width: `${arr[0] * scale}px`,
height: `${arr[1] * scale}px`, height: `${arr[1] * scale}px`,
"align-items" : ['flex-start', 'flex-end', 'center'][this.tpl.formatStyle] "align-items" : ['flex-start', 'flex-end', 'center'][this.tpl.formatStyle]
} }
let fontSize = 0;
if(_.isString(this.tpl.fontSize)){
fontSize = this.tpl.fontSize.replace('px', '')*1;
}else{
fontSize = this.tpl.fontSize;
}
this.boardTxtStyle = { this.boardTxtStyle = {
"color": "#" + this.tpl.fontColor, "color": "#" + this.tpl.fontColor,
"font-size": `${this.tpl.fontSize.replace('px','')*scale}px`, "font-size": `${fontSize*scale}px`,
"font-family": this.fontTypeDic[this.tpl.fontType], "font-family": this.fontTypeDic[this.tpl.fontType],
"min-height": `${this.tpl.fontSize.replace('px', '') * scale}px` "min-height": `${fontSize * scale}px`,
} }
this.lineTotal = Math.floor(arr[1]/ fontSize);
}) })
} }
} }

94
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/InfoBoard/index.vue

@ -58,7 +58,7 @@
</div> </div>
<div class="dialogContent_bottom_btn"> <div class="dialogContent_bottom_btn">
<div class="show_bottom_btn_add" @click="____onAddDeviceItem">添加信息</div> <div class="show_bottom_btn_add" @click="____onAddDeviceItem">添加信息</div>
<div class="show_bottom_btn_del" @click="InformationReleaseFn">信息发布</div> <div class="show_bottom_btn_del" @click="____publishInfo">信息发布</div>
</div> </div>
<div class="sideSwitch" @click="showSidePanel"> <div class="sideSwitch" @click="showSidePanel">
<img class="img" src="@/assets/screen/xtb/leftd.png" alt="" <img class="img" src="@/assets/screen/xtb/leftd.png" alt=""
@ -167,7 +167,7 @@
import addBoard from './addinfo.vue' import addBoard from './addinfo.vue'
import editBoard from './editInfo.vue' import editBoard from './editInfo.vue'
import { listDevice, invokedFunction, getDeviceRealtimeProperty } from '@/api/device/device.js' import { listDevice, invokedFunction, getDeviceRealtimeProperty } from '@/api/device/device.js'
import infoBoardTestData from "@/common/infoBoardTestData.js" // import infoBoardTestData from "@/common/infoBoardTestData.js"
import { getBoardDeviceInfo } from '@/api/board/board' import { getBoardDeviceInfo } from '@/api/board/board'
import BoardPreview from "@screen/components/infoBoard/BoardPreview.vue" import BoardPreview from "@screen/components/infoBoard/BoardPreview.vue"
@ -181,6 +181,8 @@ import Teleport from '@screen/components/Teleport.vue'
import { publishToBoard } from '@/api/board/board' import { publishToBoard } from '@/api/board/board'
import { getTemplateList } from '@/api/board/template' import { getTemplateList } from '@/api/board/template'
import testDeviceInfo from "@screen/testData/infoBoard.js"
export default { export default {
name: 'InfoBoard', name: 'InfoBoard',
data() { data() {
@ -306,7 +308,7 @@ export default {
watch: { watch: {
device: { device: {
handler(newV) { handler(newV) {
this.____getDeviceInfo(); this.____initData();
}, },
immediate: true immediate: true
} }
@ -321,7 +323,7 @@ export default {
}, },
mounted() { mounted() {
// //
this.dialogInfoList = this.boardDataConvert(infoBoardTestData); // this.dialogInfoList = this.boardDataConvert(infoBoardTestData);
this.templateList = this.moBanDataList; this.templateList = this.moBanDataList;
let deviceState = "online"; let deviceState = "online";
this.tabDataInfoList = [ this.tabDataInfoList = [
@ -347,7 +349,7 @@ export default {
}); });
}, },
____getDeviceInfo() { ____initData() {
this.selectedSize = JSON.parse(this.device.otherConfig).screenSize; this.selectedSize = JSON.parse(this.device.otherConfig).screenSize;
if(this.tplCategory.length && this.templateAll.length){ if(this.tplCategory.length && this.templateAll.length){
this.____setAvailableTemplate(); this.____setAvailableTemplate();
@ -357,11 +359,21 @@ export default {
}) })
} }
this.____getDeviceInfo();
},
____getDeviceInfo(){
if (IS_TESTING) {
this.selectedBdMsg = _.cloneDeep(testDeviceInfo.data["3A"].content);
}else{
getBoardDeviceInfo(this.device.iotDeviceId).then(res => { getBoardDeviceInfo(this.device.iotDeviceId).then(res => {
this.selectedBdMsg = res.data["3A"].content; this.selectedBdMsg = res.data["3A"].content;
}).catch(err => { }).catch(err => {
}) })
}
}, },
____setAvailableTemplate() { ____setAvailableTemplate() {
@ -581,8 +593,8 @@ export default {
} }
}) })
}, },
// //
InformationReleaseFn() { ____publishInfo() {
this.$confirm('是否确定发布情报板?', '提示', { this.$confirm('是否确定发布情报板?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -596,50 +608,46 @@ export default {
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}) })
console.log(this.device , "devicedevicedevice") let content = [];
console.log(this.device.iotDeviceId , "iotDeviceIdiotDeviceIdiotDeviceId")
console.log(this.selectedBdMsg , "selectedBdMsgselectedBdMsgselectedBdMsg")
// let content = this.content;
// let deviceId = this.device;
// publishToBoard({content, deviceId});
loading.close() this.selectedBdMsg.forEach(item => {
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
}) })
.catch(() => {
this.$message({
type: 'info',
message: '已取消发布情报板'
}) })
let data = { content: content, deviceId: this.device.iotDeviceId }
console.log(data, "发布内容");
if (IS_TESTING) {
console.log("测试模式")
this.____getDeviceInfo();
loading.close() loading.close()
})
this.updateList()
},
//
updateList(deviceId) {
getDeviceRealtimeProperty(deviceId, '3A', { async: false })
.then(res => {
var contentsA = res.data['3A'].content
console.log('回读消息--1111111111---', contentsA)
this.dialogInfoList = this.boardDataConvert(contentsA); }else{
publishToBoard(data).then(res=>{
loading.close()
this.____getDeviceInfo();
});
}
console.log('hui1111111111111', this.dialogInfoList) }).catch(() => {
this.$message({
type: 'info',
message: '取消发布'
}) })
.catch(e => {
// this.$modal.msgError(',')
}) })
// this.deviceId = deviceId
// id
/*getBoardInfo(deviceId).then(res => {
console.log(res, 'getBoardInfo')
this.form.devicePixel = res.data.pixel
if (res.data.deviceId) {
this.disabledButton = false
} else {
this.disabledButton = true
}
})*/
}, },
// //
getTemplateSeries() { getTemplateSeries() {

26
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue

@ -30,6 +30,9 @@
<!-- <Camera :data="dialogConfig.data" :visible="dialogConfig.visibleType === 1" /> --> <!-- <Camera :data="dialogConfig.data" :visible="dialogConfig.visibleType === 1" /> -->
<component :dialogData="dialogConfig.data" visible :device="dialogConfig.data" :is="dialogConfig.component" <component :dialogData="dialogConfig.data" visible :device="dialogConfig.data" :is="dialogConfig.component"
@change="handleCameraChange" @update:visible="handleCameraChange" /> @change="handleCameraChange" @update:visible="handleCameraChange" />
<!-- <InfoBoard :device="testData.device" :visible.sync="testData.visible"></InfoBoard> -->
</Bg1> </Bg1>
</template> </template>
@ -55,6 +58,28 @@ export default {
}, },
data() { data() {
return { return {
testData:{
visible:true,
device: {
"id": 904,
"iotDeviceId": "81221-65535",
"groupId": null,
"productId": 0,
"stakeMarkId": "k59+289",
"direction": "1",
"deviceName": "大学城入口站前板",
"deviceType": 2,
"installationDate": null,
"productionDate": null,
"durableYears": null,
"installationSite": null,
"useState": null,
"otherConfig": "{\"screenSize\":\"160*80\"}",
"remark": null,
"createTime": "2024-01-10T15:48:59.000+08:00",
"updateTime": null
}
},
layerData: [], layerData: [],
active: "事件专题", active: "事件专题",
tabContentData: [], tabContentData: [],
@ -64,7 +89,6 @@ export default {
// 0 ControlCamera | 1 Camera // 0 ControlCamera | 1 Camera
component: void 0, component: void 0,
data: void 0, data: void 0,
// component: ControlCamera,
// data: { // data: {
// camId: "57937", // camId: "57937",
// } // }

105
ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue

@ -55,7 +55,7 @@
<div class="controlBox"> <div class="controlBox">
<el-button type="primary" @click.native="____onAddDeviceItem()">添加信息</el-button> <el-button type="primary" @click.native="____onAddDeviceItem()">添加信息</el-button>
<el-button type="primary" @click="publishInfo" :disabled="selectedBdMsg.length == 0">发布信息</el-button> <el-button type="primary" @click="____publishInfo" :disabled="selectedBdMsg.length == 0">发布信息</el-button>
</div> </div>
</div> </div>
<div class="partCon"> <div class="partCon">
@ -153,7 +153,7 @@ import { getUserDeptId } from '@/api/system/user'
import { listTunnels, devicessize, information, getBoardInfo, getBoardEditInfo, getboardSizeDic, getBoardContentData, deviceControl } from '@/api/information/api.js' import { listTunnels, devicessize, information, getBoardInfo, getBoardEditInfo, getboardSizeDic, getBoardContentData, deviceControl } from '@/api/information/api.js'
import { uploadBoardEditInfo, getAllVmsTemplate, addTemplate, addTemplateContent, getBoardContent, deleteTemplate, splicingBoard } from '@/api/board/template' 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'
import { getBoardList, getBoardDeviceInfo } from '@/api/board/board' import { getBoardList, getBoardDeviceInfo, publishToBoard } from '@/api/board/board'
import { getTemplateList } from '@/api/board/template' import { getTemplateList } from '@/api/board/template'
import BoardPreview from "@screen/components/infoBoard/BoardPreview.vue" import BoardPreview from "@screen/components/infoBoard/BoardPreview.vue"
import BoardTplPreview from "@screen/components/infoBoard/BoardTplPreview.vue" import BoardTplPreview from "@screen/components/infoBoard/BoardTplPreview.vue"
@ -164,6 +164,9 @@ import scrollOptions from '@/common/scrollbar.js'
import infoBoardUtils from "@screen/utils/infoBoard.js" import infoBoardUtils from "@screen/utils/infoBoard.js"
import testDeviceList from "@screen/testData/deviceList.js"
import testDeviceInfo from "@screen/testData/infoBoard.js"
// //
export const deepClone = data => { export const deepClone = data => {
// //
@ -375,6 +378,24 @@ export default {
let param = { let param = {
direction: this.form.selectedDirection, direction: this.form.selectedDirection,
}; };
if(IS_TESTING){
let res = testDeviceList;
res.data.forEach(item => {
if (_.isString(item.otherConfig)) {
item.otherConfig = JSON.parse(item.otherConfig);
}
this.boardSizeDic[item.otherConfig.screenSize].list.push(item);
if (!this.selectedSize) {
this.selectedSize = item.otherConfig.screenSize;
}
if (!this.selectedDevice.deviceName) {
this.selectedDevice = item;
}
})
this.____onChangeSize();
this.____getDeviceInfo();
}else{
getBoardList(param).then((res) => { getBoardList(param).then((res) => {
res.data.forEach(item => { res.data.forEach(item => {
if (_.isString(item.otherConfig)) { if (_.isString(item.otherConfig)) {
@ -389,28 +410,34 @@ export default {
} }
}) })
this.____onChangeSize(); this.____onChangeSize();
this.____getBoardMessage(); this.____getDeviceInfo();
// this.$forceUpdate(); // this.$forceUpdate();
// this.____onChangeSize(this.boardSizeDic[0].selectedPixel); // this.____onChangeSize(this.boardSizeDic[0].selectedPixel);
}); });
}
}, },
____getBoardMessage() { ____getDeviceInfo() {
if (process.env.NODE_ENV == 'development') {
if (IS_TESTING) {
this.selectedBdMsg = _.cloneDeep(testDeviceInfo.data["3A"].content);
console.log(this.selectedBdMsg, "gfdgfdd")
} else{
// import("@/common/infoBoardTestData.js").then(res=>{
// this.selectedBdMsg = res.default.data["3A"].content;
// })
}
if (!this.selectedDevice.iotDeviceId) { if (!this.selectedDevice.iotDeviceId) {
return; return;
} }
getBoardDeviceInfo(this.selectedDevice.iotDeviceId).then(res => { getBoardDeviceInfo(this.selectedDevice.iotDeviceId).then(res => {
this.selectedBdMsg = res.data["3A"].content; this.selectedBdMsg = res.data["3A"].content;
}).catch(err => { }).catch(err => {
}) })
//
}
}, },
____onAddTemplate() { ____onAddTemplate() {
@ -478,10 +505,10 @@ export default {
// //
____onAddToDevice(item) { ____onAddToDevice(item) {
if(this.checkedDevices.length<=0){ // if(this.checkedDevices.length<=0){
this.$message.warning('未选择设备!'); // this.$message.warning('!');
return; // return;
} // }
let arr = this.selectedSize.split("*"); let arr = this.selectedSize.split("*");
item.origin = { item.origin = {
@ -610,7 +637,7 @@ export default {
}, },
// //
publishInfo() { ____publishInfo() {
this.$confirm('是否确定发布情报板?', '提示', { this.$confirm('是否确定发布情报板?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -624,11 +651,9 @@ export default {
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}) })
let content = []; let content = [];
let deviceId = this.device;
this.selectedBdMsg.forEach(item=>{ this.selectedBdMsg.forEach(item=>{
console.log(item.textContent , "item.textContentitem.textContentitem.textContent");
content.push({ content.push({
STAY :item.playbackDuration, STAY :item.playbackDuration,
ACTION :item.screenEntryMethod, ACTION :item.screenEntryMethod,
@ -639,41 +664,33 @@ export default {
CONTENT :item.textContent.replaceAll('\\', '').replaceAll(',', '\\,').replaceAll('=', '\\=').replaceAll('\n', '\\\\n'), CONTENT :item.textContent.replaceAll('\\', '').replaceAll(',', '\\,').replaceAll('=', '\\=').replaceAll('\n', '\\\\n'),
width : item.displayAreaWidth, width : item.displayAreaWidth,
height : item.displayAreaHeight, height : item.displayAreaHeight,
formatstyle : item.verticalAlignment, 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, "发布内容"); let data = { content: content, deviceId: this.selectedDevice.iotDeviceId }
// publishToBoard({content, deviceId}); console.log(data , "发布内容");
if (IS_TESTING) {
console.log("测试模式")
this.____getDeviceInfo();
loading.close()
} else {
publishToBoard(data).then(res => {
loading.close() loading.close()
this.____getDeviceInfo();
});
}
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消发布情报板' message: '取消发布'
}) })
loading.close()
}) })
this.updateList()
}, },
@ -698,7 +715,7 @@ export default {
// this.selectedDevice = _.find(this.boardSizeDic[this.selectedSize].list, { iotDeviceId: value[0] }); // this.selectedDevice = _.find(this.boardSizeDic[this.selectedSize].list, { iotDeviceId: value[0] });
this.selectedDevice = item; this.selectedDevice = item;
// this.selectedDevice = this.deviceList // this.selectedDevice = this.deviceList
this.____getBoardMessage(); this.____getDeviceInfo();
// this.checkedDevices = value // this.checkedDevices = value
// let val = JSON.parse(JSON.stringify(value)) // let val = JSON.parse(JSON.stringify(value))

119
ruoyi-ui/src/views/JiHeExpressway/testData/deviceList.js

@ -0,0 +1,119 @@
export default
{
data:[
{
"id": 894,
"iotDeviceId": "8162-65535",
"groupId": null,
"productId": 0,
"stakeMarkId": "k57+595",
"direction": "1",
"deviceName": "门架式可变信息标志k57+595",
"deviceType": 2,
"installationDate": null,
"productionDate": null,
"durableYears": null,
"installationSite": null,
"useState": null,
"otherConfig": "{\"screenSize\":\"768*64\"}",
"remark": null,
"createTime": "2024-01-10T15:27:34.000+08:00",
"updateTime": null
},
{
"id": 895,
"iotDeviceId": "8166-65535",
"groupId": null,
"productId": 0,
"stakeMarkId": "k71+600",
"direction": "1",
"deviceName": "门架式可变信息标志k71+600",
"deviceType": 2,
"installationDate": null,
"productionDate": null,
"durableYears": null,
"installationSite": null,
"useState": null,
"otherConfig": "{\"screenSize\":\"768*64\"}",
"remark": null,
"createTime": "2024-01-10T15:27:34.000+08:00",
"updateTime": null
},
{
"id": 896,
"iotDeviceId": "2161-65535",
"groupId": null,
"productId": 0,
"stakeMarkId": "k82+285",
"direction": "1",
"deviceName": "门架式可变信息标志k82+285",
"deviceType": 2,
"installationDate": null,
"productionDate": null,
"durableYears": null,
"installationSite": null,
"useState": null,
"otherConfig": "{\"screenSize\":\"768*64\"}",
"remark": null,
"createTime": "2024-01-10T15:27:34.000+08:00",
"updateTime": null
},
{
"id": 902,
"iotDeviceId": "31115-65535",
"groupId": null,
"productId": 0,
"stakeMarkId": "k98+208",
"direction": "1",
"deviceName": "门架式可变信息标志k98+208",
"deviceType": 2,
"installationDate": null,
"productionDate": null,
"durableYears": null,
"installationSite": null,
"useState": null,
"otherConfig": "{\"screenSize\":\"768*64\"}",
"remark": null,
"createTime": "2024-01-10T15:48:59.000+08:00",
"updateTime": null
},
{
"id": 903,
"iotDeviceId": "31111-65535",
"groupId": null,
"productId": 0,
"stakeMarkId": "k103+900",
"direction": "1",
"deviceName": "门架式可变信息标志k103+900",
"deviceType": 2,
"installationDate": null,
"productionDate": null,
"durableYears": null,
"installationSite": null,
"useState": null,
"otherConfig": "{\"screenSize\":\"768*64\"}",
"remark": null,
"createTime": "2024-01-10T15:48:59.000+08:00",
"updateTime": null
},
{
"id": 904,
"iotDeviceId": "81221-65535",
"groupId": null,
"productId": 0,
"stakeMarkId": "k59+289",
"direction": "1",
"deviceName": "大学城入口站前板",
"deviceType": 2,
"installationDate": null,
"productionDate": null,
"durableYears": null,
"installationSite": null,
"useState": null,
"otherConfig": "{\"screenSize\":\"160*80\"}",
"remark": null,
"createTime": "2024-01-10T15:48:59.000+08:00",
"updateTime": null
}
]
}

75
ruoyi-ui/src/views/JiHeExpressway/testData/infoBoard.js

@ -0,0 +1,75 @@
export default{
"msg": "操作成功",
"code": 200,
"data": {
"3A": {
"programId": 59,
"content": [
{
"residenceTime": "100",
"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": "济南方向\\\\n禁止通行",
"fontStyle": "0",
"displayAreaWidth": "160",
"playbackDuration": "100",
"displayAreaHeight": "80",
"volume": "0",
"xCoordinate": "0",
"screenEntrySpeed": "1",
"horizontalAlignment": "2",
"playSpecialEffects": "0",
"setUpTheSpeaker": "0",
"flickerSpeed": "0",
"specialEffectsSpeed": "1",
"fontSize": "32",
"verticalAlignment": "2",
"speechSpeed": "0",
"font": "3"
},
{
"residenceTime": "100",
"intonation": "0",
"fontSpacing": "1",
"screenEntryMethod": "1",
"screenOutputMethod": "1",
"lineSpacing": "0",
"yCoordinate": "0",
"whetherToSynchronizePlayback": "0",
"whetherToPlayText": "0",
"playbackCount": "1",
"flashingFrequency": "5",
"backgroundColor": "8",
"foregroundColor": "FF0000",
"textContent": "菏泽方向\\\\n可以通行",
"fontStyle": "0",
"displayAreaWidth": "160",
"playbackDuration": "100",
"displayAreaHeight": "80",
"volume": "0",
"xCoordinate": "0",
"screenEntrySpeed": "1",
"horizontalAlignment": "2",
"playSpecialEffects": "0",
"setUpTheSpeaker": "0",
"flickerSpeed": "0",
"specialEffectsSpeed": "1",
"fontSize": "32",
"verticalAlignment": "2",
"speechSpeed": "0",
"font": "3"
}
]
}
}
}

3
ruoyi-ui/src/views/JiHeExpressway/utils/infoBoard.js

@ -36,11 +36,10 @@ export default {
} }
} }
else{ else{
console.log(data.origin , "fdsgfhgjdfss")
data1 = { data1 = {
// formatStyle: data.horizontalAlignment, // formatStyle: data.horizontalAlignment,
formatStyle: data.verticalAlignment, formatStyle: data.verticalAlignment,
content: data.textContent.replaceAll(/\\\\n/g , "\n"), content: data.textContent.replaceAll('\\,', ',').replaceAll('\\=', '=').replaceAll('\\\\n', '\n'),
fontColor: data.foregroundColor.toUpperCase(), fontColor: data.foregroundColor.toUpperCase(),
fontSize: data.fontSize.replace("px",""), fontSize: data.fontSize.replace("px",""),
// fontFamily: this.deviceFontToEdit(data.font), // fontFamily: this.deviceFontToEdit(data.font),

3
ruoyi-ui/vue.config.js

@ -44,7 +44,8 @@ module.exports = {
// target: `http://10.168.77.209:8080`, // 刘朋 // target: `http://10.168.77.209:8080`, // 刘朋
// target: `http://10.168.66.196:8080`, //刘文阁 // target: `http://10.168.66.196:8080`, //刘文阁
// target: `http://10.168.56.206:8087`, //孟 // target: `http://10.168.56.206:8087`, //孟
target: `http://10.0.81.202:8087`, //现场后台 target: `http://10.168.65.156:8087`,
// target: `http://10.0.81.202:8087`, //现场后台
// target: `http://10.0.81.204:8087`, //现场后台 刘文阁 // target: `http://10.0.81.204:8087`, //现场后台 刘文阁
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {

Loading…
Cancel
Save