lau572 11 months ago
parent
commit
0890ae31ed
  1. 7
      ruoyi-ui/src/views/information/board/editInfo.vue
  2. 137
      ruoyi-ui/src/views/information/board/index.vue

7
ruoyi-ui/src/views/information/board/editInfo.vue

@ -6,7 +6,7 @@
<div class="dialogLine"></div>
<div class="dialogCloseButton"></div>
</div>
<el-card class="box-card" >
<el-card class="box-card" style="display: flex;justify-content: center;">
<div class="blackBoard1" v-on:ondragenter="ondragenter" v-on:drop="faceDrop" v-on:dragover="allowDrop" :style="{
width: getDevicePixel(boardWidth, 0),
height: getDevicePixel(boardHeight, 1),
@ -374,7 +374,7 @@ export default {
message: '请输入详细内容',
trigger: 'blur'
},
{pattern: /^^((?!\\\\).)*/gi,message: "禁止输入特殊字符!",trigger: "blur"}
{ pattern: /^^((?!\\\\).)*/gi, message: '禁止输入特殊字符!', trigger: 'blur' }
],
fontColor: [
{
@ -484,6 +484,7 @@ export default {
this.dataForm = JSON.parse(JSON.stringify(this.boardEmitItem))
this.dataForm.COLOR = this.getColorValue(this.boardEmitItem.COLOR)
console.log(this.dataForm, 'this.dataForm')
// console.log('111111111', this.boardEmitItem)
// this.dataForm.FONT = this.getFont(this.boardEmitItem.FONT)
this.dataForm.CONTENT = JSON.parse(JSON.stringify(this.boardEmitItem.CONTENT.replace('<br>', '\n').replace(/ /g, ' ').replace('<r><n>', '\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

137
ruoyi-ui/src/views/information/board/index.vue

@ -25,7 +25,7 @@
<el-collapse v-model="iotBoardActive" accordion @change="handleChange">
<el-collapse-item v-for="(item, index) in iotBoardList" :key="index" :title="item.label" :name="item.devicePixel">
<div>
<!-- <el-checkbox style="width: 100%" :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选
<!-- <el-checkbox style="width: 100%" :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选
</el-checkbox>-->
<div style="margin: 5px 0"></div>
<el-checkbox-group class="checkbox" v-model="checkedCities" @change="handleCheckedCitiesChange" :max="1">
@ -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),
}">
<span :style="{
/*left: getCoordinate(
@ -155,8 +157,9 @@
<div :style="{
width: getScreenSize(itm.screenSize, 'width') + 'px',
height: getScreenSize(itm.screenSize, 'height') + 'px',
lineHeight:getScreenSize(itm.screenSize, 'height') + 'px',
textAlign: getTextAlign(itm.tcontents[0].formatStyle),
'display': 'flex',
'align-items': 'center',
'justify-content': getTextAlign(itm.tcontents[0].formatStyle),
position: 'relative',
}" style="background: black; position: relative;overflow: hidden;">
@ -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'

Loading…
Cancel
Save