Browse Source

完善情报板

wangqin
hui 10 months ago
parent
commit
9af2ff5536
  1. 1
      .gitignore
  2. 32
      ruoyi-ui/src/common/getBoardBaseData.js
  3. 3
      ruoyi-ui/src/main.js
  4. 36
      ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardInfoEditor.vue
  5. 2
      ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardPreview.vue
  6. 22
      ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardTplPreview.vue
  7. 12
      ruoyi-ui/src/views/JiHeExpressway/index.vue
  8. 1
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/InfoBoard/index.vue
  9. 11
      ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue
  10. 21
      ruoyi-ui/src/views/JiHeExpressway/utils/infoBoard.js
  11. 3
      ruoyi-ui/vue.config.js

1
.gitignore

@ -49,3 +49,4 @@ nbdist/
node_modules
package-lock.json
dist.zip
ruoyi-ui/dist.zip

32
ruoyi-ui/src/common/getBoardBaseData.js

@ -1,27 +1,25 @@
import Vue from "vue";
import { getDicts } from "@/api/system/dict/data";
export default function(){
getDicts('iot_device_font_type').then(res => {
return Promise.all([
getDicts('iot_device_font_type'),
// getDicts('iot_devices_font_color'),
// getDicts('iot_device_font_inScreen_mode'),
// getDicts('iot_template_category'),
// getDicts('iot_device_font_size'),
]).then(resArr=>{
initFontType(resArr[0]);
function initFontType(res){
let dic = {};
res.data.forEach(item=>{
res.data.forEach(item => {
dic[item.dictValue] = item.cssClass;
});
Vue.prototype.fontTypeDic = dic;
Vue.prototype.fontTypeList = res.data;
// console.log(fontTypeList, "字体类型");
})
getDicts('iot_devices_font_color').then(res => {
})
getDicts('iot_device_font_inScreen_mode').then(res => {
})
getDicts('iot_template_category').then(res => {
})
getDicts('iot_device_font_size').then(res => {
})
}
});
}

3
ruoyi-ui/src/main.js

@ -94,9 +94,6 @@ Vue.prototype.handleTree = handleTree
Vue.prototype.socket = Socket
Vue.prototype.numberMul = numberMul
import getBoardBaseData from '@/common/getBoardBaseData'
Vue.prototype.getBoardBaseData = getBoardBaseData;
// gis
Vue.prototype.$GlobalConfig = config.GlobalConfig

36
ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardInfoEditor.vue

@ -1,5 +1,5 @@
<template>
<el-dialog :title="mode=='add'?'新增':'编辑'" :visible.sync="dialogVisible" width="800px" append-to-body :close-on-click-modal="false">
<el-dialog :title="calcTitle" :visible.sync="dialogVisible" width="800px" append-to-body :close-on-click-modal="false">
<!-- <div style="color:#fff">
<p>类型:{{type}} 增删改类型:{{mode}}</p>
<p>模板id:{{ tpl }}</p>
@ -57,7 +57,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="字体类型">
<el-select v-model="dataForm.fontFamily" placeholder="请选择">
<el-select v-model="dataForm.fontType" placeholder="请选择">
<el-option v-for="item in fontTypeList" :key="item.dictLabel" :label="item.dictLabel" :value="item.dictValue">
</el-option>
</el-select>
@ -90,7 +90,7 @@
</el-card>
<div slot="footer" class="dialog-footer">
<el-button @click="dataFormSubmitHandle" v-loading="loading" style="background-color: #10aac2;color:#fff;">确认</el-button>
<el-button @click="onSubmit" v-loading="loading" style="background-color: #10aac2;color:#fff;">确认</el-button>
<el-button style="background-color:#b5b5b6;color:#fff" @click="onClose">取消</el-button>
</div>
</el-dialog>
@ -144,7 +144,7 @@ export default {
content:"",
fontColor:"",
fontSize:"",
fontFamily:"",
fontType:"",
stopTime:"",
inScreenMode:"",
screenSize:""
@ -160,7 +160,6 @@ export default {
}
]
},
fontTypeList: [],
screenSizeOptions: [],
colorList: [],
isCurrencyOptions: [
@ -192,7 +191,7 @@ export default {
infoType: '',
devicePixelBoolean: false,
categoryRules: false,
tplDefault: {
deviceCttDefault: {
"residenceTime": "50",
"intonation": "0",
"fontSpacing": "1",
@ -252,11 +251,23 @@ export default {
BoardPreview, BoardTplPreview
},
computed: {
calcTitle(){
let str = '';
if(this.mode=="toDevice"){
str = `从模板添加设备信息`;
}else{
str = `${this.mode == 'add' ? '新增' : '编辑'}${this.type == 'template' ? '信息模板' : '设备信息'}`
}
return str;
}
},
watch: {
visible:{
handler(newV){
this.dialogVisible = newV;
if(this.$refs.dataForm){
this.$refs.dataForm.clearValidate();
}
},
immediate:true
},
@ -281,10 +292,6 @@ export default {
mounted() {
},
created() {
this.getDicts('iot_device_font_type').then(res => {
this.fontTypeList = res.data
// console.log(this.fontTypeList, "");
})
this.getDicts('iot_devices_font_color').then(res => {
this.colorList = res.data;
// console.log(this.colorList, "");
@ -315,25 +322,25 @@ export default {
content: "",
fontColor: this.colorList[0].dictValue,
fontSize: this.fontSizeList[0].dictValue,
fontFamily: this.fontTypeList[0].dictValue,
fontType: this.fontTypeList[0].dictValue,
stopTime: 5,
inScreenMode: this.inScreenModeList[0].dictValue,
screenSize: this.screenSize
}
}
else{
tempTpl = _.merge(this.tplDefault, this.tpl.origin); //
tempTpl = _.merge(this.deviceCttDefault, this.tpl.origin); //
}
this.dataForm = infoBoardUtils.dialogSourceFormat(tempTpl, this.type, this.mode);
}else{
this.dataForm = infoBoardUtils.dialogSourceFormat(this.tpl, this.type, this.mode, this.tplDefault);
this.dataForm = infoBoardUtils.dialogSourceFormat(this.tpl, this.type, this.mode, this.deviceCttDefault);
}
},
onClose(){
this.dialogVisible = false;
},
//
async dataFormSubmitHandle() {
async onSubmit() {
if (!this.dataForm.content.trim()) {
return this.$modal.msgError('当前输入内容为空')
}
@ -437,7 +444,6 @@ export default {
});
}else if (this.mode == "toDevice") {
this.loading = false
this.$emit("afterSubmit", { type: this.type, mode: this.mode, data: data });
} else {
addTemplate(data).then(res => {

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

@ -100,7 +100,7 @@ export default {
width: `${conW * scale}px`,
height: `${conH * scale}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.verticalAlignment]
}
let fontSize = 0;
if (_.isString(this.tpl.fontSize)) {

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

@ -17,7 +17,7 @@ export default {
type:Array,
default:()=>[]
},
lineTotal:0,
lineTotal:10,
}
},
props:{
@ -26,24 +26,6 @@ export default {
default: "300*200"
},
tpl: {
// {
// "id": 3,
// "category": "0",
// "content": "",
// "screenSize": "768*64",
// "fontColor": "FFFF00",
// "fontSize": "64",
// "fontType": "2",
// "fontSpacing": "0",
// "rollingSpeed": null,
// "stopTime": "50",
// "inScreenMode": "1",
// "formatStyle": "2",
// "remark": null,
// "createTime": "2024-01-06 10:40:19",
// "updateTime": "2024-01-06 11:04:53"
// }
type: Object,
default: {}
},
@ -95,7 +77,7 @@ export default {
this.boardTxtStyle = {
"color": "#" + this.tpl.fontColor,
"font-size": `${fontSize*scale}px`,
"font-family": this.fontTypeDic[this.tpl.fontType],
"font-family": this.fontTypeDic[this.tpl.fontType || '3'],
"min-height": `${fontSize * scale}px`,
}
this.lineTotal = Math.floor(arr[1]/ fontSize);

12
ruoyi-ui/src/views/JiHeExpressway/index.vue

@ -3,7 +3,7 @@
<HeaderMenu @onChange="handleChange" class="header" />
<div class="content">
<Transition name="fade">
<router-view />
<router-view v-if="isShowContent" />
</Transition>
</div>
</Adaptation>
@ -13,6 +13,8 @@
import HeaderMenu from "./components/HeaderMenu/index.vue";
import Adaptation from "./components/Adaptation.vue";
import getBoardBaseData from '@/common/getBoardBaseData'
export default {
name: "ji_ze_gao_su",
components: {
@ -22,10 +24,16 @@ export default {
},
data() {
return {
isShowContent:false
};
},
mounted(){
this.getBoardBaseData();
getBoardBaseData().then(res => {
this.isShowContent = true;
});
// Promise.all()getBoardBaseData().then(()=>{
// this.isShowContent = true ;
// });
},
methods: {
handleChange(activeMenu) {

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

@ -443,6 +443,7 @@ export default {
displayAreaWidth: +arr[0],
displayAreaHeight: +arr[1]
}
console.log(item);
this.editDialog = {
visible: true,
mode: "toDevice",

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

@ -423,7 +423,6 @@ export default {
if (IS_TESTING) {
this.selectedBdMsg = _.cloneDeep(testDeviceInfo.data["3A"].content);
console.log(this.selectedBdMsg, "gfdgfdd")
} else{
@ -478,6 +477,7 @@ export default {
}
}
},
//
____onEditSubmit(para) {
this.editDialog.tpl = {};
this.editDialog.visible = false;
@ -496,7 +496,9 @@ export default {
},
____refreshPageData(para) {
if (para.type == 'template') {
this.____getAllTemplate().then(this.____onChangeSize)
this.____getAllTemplate().then(res=>{
this.____setAvailableTemplate()
});
} else {
}
@ -654,6 +656,8 @@ export default {
let content = [];
this.selectedBdMsg.forEach(item=>{
console.log(item.font)
content.push({
STAY :item.playbackDuration,
ACTION :item.screenEntryMethod,
@ -668,7 +672,8 @@ export default {
})
})
let data = { content: content, deviceId: this.selectedDevice.iotDeviceId }
console.log(data , "发布内容");
console.log(data , "post参数+++++")
if (IS_TESTING) {

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

@ -29,7 +29,6 @@ export default {
let data1
if(type=='template'){
data1 = _.cloneDeep(data);
data1.stopTime = data1.stopTime*0.1
if(mode=="toDevice"){
// data.origin = tplDefault;
data.origin = _.merge(tplDefault, data.origin);
@ -42,38 +41,34 @@ export default {
content: data.textContent.replaceAll('\\,', ',').replaceAll('\\=', '=').replaceAll('\\\\n', '\n'),
fontColor: data.foregroundColor.toUpperCase(),
fontSize: data.fontSize.replace("px",""),
// fontFamily: this.deviceFontToEdit(data.font),
fontFamily: data.font,
stopTime: data.residenceTime,
fontType: data.font,
stopTime: data.playbackDuration,
inScreenMode: data.screenEntryMethod,
origin: data
}
}
data1.stopTime = data1.stopTime * 0.1
return data1
},
dialogSaveFormat(data, type, mode) {
let data1;
if (type == 'template' && mode!=='toDevice') {
if (type == 'template' && mode!=='toDevice') { //处理提交为模板的情况
data1 = _.cloneDeep(data);
data1.stopTime = data1.stopTime * 10 + "";
} else {
} else { //处理提交到设备的情况
let temp = {
// horizontalAlignment : data.formatStyle,
verticalAlignment : data.formatStyle,
textContent : data.content,
foregroundColor: data.fontColor.toLowerCase(),
fontSize: data.fontSize.replace("px", ""),
font: data.fontFamily,
residenceTime : data.stopTime,
font: data.fontType,
playbackDuration : data.stopTime * 10,
screenEntryMethod : data.inScreenMode
}
data1 = _.merge(data.origin, temp);
}
return data1;
},
templateToDevice(data) {
return {
}
}
}

3
ruoyi-ui/vue.config.js

@ -44,9 +44,10 @@ module.exports = {
// target: `http://10.168.77.209:8080`, // 刘朋
// target: `http://10.168.66.196:8080`, //刘文阁
// target: `http://10.168.56.206:8087`, //孟
target: `http://10.168.65.156: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.168.69.255:8087`, //正晨后台 连现场物联 刘文阁
changeOrigin: true,
pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "",

Loading…
Cancel
Save