Browse Source

更新

wangqin
hui 10 months ago
parent
commit
6492144a55
  1. 9
      ruoyi-ui/src/api/board/board.js
  2. 12
      ruoyi-ui/src/common/infoBoardTestData.js
  3. 2
      ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardTplPreview.vue
  4. 74
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/InfoBoard/index.vue
  5. 135
      ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue
  6. 8
      ruoyi-ui/src/views/JiHeExpressway/utils/infoBoard.js
  7. 1
      ruoyi-ui/vue.config.js

9
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
})
}

12
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",

2
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, '&nbsp').split('&&&&&');
this.contentArr = this.tpl.content.replace(/\n/g, '&&&&&').replace(/ /g, '&nbsp').split('&&&&&');
this.setStyle();
},
deep:true,

74
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, '<r><n>')
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(() => {

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

@ -55,7 +55,7 @@
<div class="controlBox">
<el-button type="primary" @click.native="____onAddDeviceItem()">添加信息</el-button>
<el-button type="primary" @click="publishInfo" :disabled="contentList.length == 0">发布信息</el-button>
<el-button type="primary" @click="publishInfo" :disabled="selectedBdMsg.length == 0">发布信息</el-button>
</div>
</div>
<div class="partCon">
@ -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

8
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

1
ruoyi-ui/vue.config.js

@ -48,6 +48,7 @@ module.exports = {
// target: `http://10.168.66.196:8080`, //刘文阁
// 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]: "",

Loading…
Cancel
Save