Browse Source

完善情报板

wangqin
hui 10 months ago
parent
commit
9af2ff5536
  1. 1
      .gitignore
  2. 30
      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 node_modules
package-lock.json package-lock.json
dist.zip dist.zip
ruoyi-ui/dist.zip

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

@ -1,27 +1,25 @@
import Vue from "vue"; import Vue from "vue";
import { getDicts } from "@/api/system/dict/data"; import { getDicts } from "@/api/system/dict/data";
export default function(){ 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 = {}; let dic = {};
res.data.forEach(item => { res.data.forEach(item => {
dic[item.dictValue] = item.cssClass; dic[item.dictValue] = item.cssClass;
}); });
Vue.prototype.fontTypeDic = dic; Vue.prototype.fontTypeDic = dic;
Vue.prototype.fontTypeList = res.data; 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.socket = Socket
Vue.prototype.numberMul = numberMul Vue.prototype.numberMul = numberMul
import getBoardBaseData from '@/common/getBoardBaseData'
Vue.prototype.getBoardBaseData = getBoardBaseData;
// gis // gis
Vue.prototype.$GlobalConfig = config.GlobalConfig Vue.prototype.$GlobalConfig = config.GlobalConfig

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

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

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

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

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

@ -17,7 +17,7 @@ export default {
type:Array, type:Array,
default:()=>[] default:()=>[]
}, },
lineTotal:0, lineTotal:10,
} }
}, },
props:{ props:{
@ -26,24 +26,6 @@ export default {
default: "300*200" default: "300*200"
}, },
tpl: { 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, type: Object,
default: {} default: {}
}, },
@ -95,7 +77,7 @@ export default {
this.boardTxtStyle = { this.boardTxtStyle = {
"color": "#" + this.tpl.fontColor, "color": "#" + this.tpl.fontColor,
"font-size": `${fontSize*scale}px`, "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`, "min-height": `${fontSize * scale}px`,
} }
this.lineTotal = Math.floor(arr[1]/ fontSize); this.lineTotal = Math.floor(arr[1]/ fontSize);

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

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

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

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

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

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

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

@ -29,7 +29,6 @@ export default {
let data1 let data1
if(type=='template'){ if(type=='template'){
data1 = _.cloneDeep(data); data1 = _.cloneDeep(data);
data1.stopTime = data1.stopTime*0.1
if(mode=="toDevice"){ if(mode=="toDevice"){
// data.origin = tplDefault; // data.origin = tplDefault;
data.origin = _.merge(tplDefault, data.origin); data.origin = _.merge(tplDefault, data.origin);
@ -42,38 +41,34 @@ export default {
content: data.textContent.replaceAll('\\,', ',').replaceAll('\\=', '=').replaceAll('\\\\n', '\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), fontType: data.font,
fontFamily: data.font, stopTime: data.playbackDuration,
stopTime: data.residenceTime,
inScreenMode: data.screenEntryMethod, inScreenMode: data.screenEntryMethod,
origin: data origin: data
} }
} }
data1.stopTime = data1.stopTime * 0.1
return data1 return data1
}, },
dialogSaveFormat(data, type, mode) { dialogSaveFormat(data, type, mode) {
let data1; let data1;
if (type == 'template' && mode!=='toDevice') { if (type == 'template' && mode!=='toDevice') { //处理提交为模板的情况
data1 = _.cloneDeep(data); data1 = _.cloneDeep(data);
data1.stopTime = data1.stopTime * 10 + ""; data1.stopTime = data1.stopTime * 10 + "";
} else { } else { //处理提交到设备的情况
let temp = { let temp = {
// horizontalAlignment : data.formatStyle, // horizontalAlignment : data.formatStyle,
verticalAlignment : data.formatStyle, verticalAlignment : data.formatStyle,
textContent : data.content, textContent : data.content,
foregroundColor: data.fontColor.toLowerCase(), foregroundColor: data.fontColor.toLowerCase(),
fontSize: data.fontSize.replace("px", ""), fontSize: data.fontSize.replace("px", ""),
font: data.fontFamily, font: data.fontType,
residenceTime : data.stopTime, playbackDuration : data.stopTime * 10,
screenEntryMethod : data.inScreenMode screenEntryMethod : data.inScreenMode
} }
data1 = _.merge(data.origin, temp); data1 = _.merge(data.origin, temp);
} }
return data1; 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.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.168.65.156:8087`, // target: `http://10.168.65.156:8087`,
// target: `http://10.0.81.202:8087`, //现场后台 // target: `http://10.0.81.202:8087`, //现场后台
// target: `http://10.0.81.204:8087`, //现场后台 刘文阁 // target: `http://10.0.81.204:8087`, //现场后台 刘文阁
target: `http://10.168.69.255:8087`, //正晨后台 连现场物联 刘文阁
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "", ["^" + process.env.VUE_APP_BASE_API]: "",

Loading…
Cancel
Save