Browse Source

功能完善

wangqin
hui 12 months ago
parent
commit
f25e3c4bb4
  1. 8
      ruoyi-ui/src/utils/request.js
  2. 54
      ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardInfoEditor.vue
  3. 4
      ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardPreview.vue
  4. 2
      ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardTplPreview.vue
  5. 3
      ruoyi-ui/src/views/JiHeExpressway/mixins/InfoBoard.js
  6. 19
      ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue
  7. 4
      ruoyi-ui/vue.config.js

8
ruoyi-ui/src/utils/request.js

@ -141,6 +141,14 @@ service.interceptors.response.use(res => {
else if (message.includes("Request failed with status code")) { else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常"; message = "系统接口" + message.substr(message.length - 3) + "异常";
} }
else if (message.includes("client_offline"))
{
message = "设备离线"
}
else if (message.includes("time_out"))
{
message = "连接超时"
}
Message({ Message({
message: message, message: message,
type: 'error', type: 'error',

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

@ -101,6 +101,7 @@
:key="item.dictValue" :key="item.dictValue"
:label="item.dictLabel" :label="item.dictLabel"
:value="item.dictValue" :value="item.dictValue"
v-if="+(item.dictValue.replace('px',''))<=maxFontSize"
> >
</el-option> </el-option>
</el-select> </el-select>
@ -191,6 +192,7 @@ import { debounce } from "lodash";
export default { export default {
data() { data() {
return { return {
maxFontSize:100,
alignmentNum: 2, alignmentNum: 2,
content: "", content: "",
boardWidth: "", boardWidth: "",
@ -316,6 +318,17 @@ export default {
speechSpeed: "0", speechSpeed: "0",
font: "3", font: "3",
}, },
templateDefault: {
category: "",
formatStyle: "2",
content: "",
fontColor: "",
fontSize: "",
fontType: "",
stopTime: 50,
inScreenMode: "",
screenSize: "",
},
isLocked: false, isLocked: false,
}; };
}, },
@ -361,6 +374,26 @@ export default {
}, },
}, },
watch: { watch: {
screenSize(newV){
if(newV){
let boardH = newV.split("*")[1];
let fontSize = "20";
if (['64', '48'].includes(boardH)) {
this.maxFontSize = +boardH
fontSize = boardH + ""
} else if (['80'].includes(boardH)) {
this.maxFontSize = +boardH / 2
fontSize = +boardH / 2 + ""
} else if (['160'].includes(boardH)) {
this.maxFontSize = +boardH / 2
fontSize = +boardH / 4 + ""
}
this.deviceCttDefault.fontSize = fontSize
this.templateDefault.screenSize = newV;
this.templateDefault.fontSize = fontSize;
}
},
visible: { visible: {
handler(newV) { handler(newV) {
this.dialogVisible = newV; this.dialogVisible = newV;
@ -400,21 +433,30 @@ export default {
}, },
mounted() {}, mounted() {},
created() { created() {
this.templateDefault.fontType = this.fontTypeList[0].dictValue //
this.getDicts("iot_devices_font_color").then((res) => { this.getDicts("iot_devices_font_color").then((res) => {
this.colorList = res.data; this.colorList = res.data;
this.templateDefault.fontColor = this.colorList[0].dictValue
// console.log(this.colorList, ""); // console.log(this.colorList, "");
}); });
this.getDicts("iot_device_font_inScreen_mode").then((res) => { this.getDicts("iot_device_font_inScreen_mode").then((res) => {
this.inScreenModeList = res.data; this.inScreenModeList = res.data;
this.templateDefault.inScreenMode = this.inScreenModeList[0].dictValue
// console.log(this.inScreenModeList, ""); // console.log(this.inScreenModeList, "");
}); });
this.getDicts("iot_template_category").then((res) => { this.getDicts("iot_template_category").then((res) => {
this.templateCategoryList = res.data; this.templateCategoryList = res.data;
this.templateDefault.category = this.templateCategoryList[0].dictValue
}); });
this.getDicts("iot_device_font_size").then((res) => { this.getDicts("iot_device_font_size").then((res) => {
this.fontSizeList = res.data; this.fontSizeList = res.data;
// this.templateDefault.fontSize = this.fontSizeList[0].dictValue
// this.dataForm.FONT_SIZE = res.data[1].dictValue // this.dataForm.FONT_SIZE = res.data[1].dictValue
}); });
}, },
methods: { methods: {
initData() { initData() {
@ -433,17 +475,7 @@ export default {
if (this.mode == "add") { if (this.mode == "add") {
let tempTpl = null; let tempTpl = null;
if (this.type == "template") { if (this.type == "template") {
tempTpl = { tempTpl = _.merge({}, this.templateDefault, this.tpl);
category: this.templateCategoryList[0].dictValue,
formatStyle: 0,
content: "",
fontColor: this.colorList[0].dictValue,
fontSize: this.fontSizeList[0].dictValue,
fontType: this.fontTypeList[0].dictValue,
stopTime: 50,
inScreenMode: this.inScreenModeList[0].dictValue,
screenSize: this.screenSize,
};
} else { } else {
tempTpl = _.merge({}, this.deviceCttDefault, this.tpl.origin); // tempTpl = _.merge({}, this.deviceCttDefault, this.tpl.origin); //
} }

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

@ -40,7 +40,7 @@ export default {
}, },
tpl:{ tpl:{
handler(newV){ handler(newV){
this.contentArr = this.tpl.textContent.replaceAll(/\\\\n/g, '\n').replaceAll(/ /g, '&nbsp').split('\n'); this.contentArr = this.tpl.textContent.replaceAll(/\\\\n/g, '\n').replaceAll(/\\=/g, '=').replaceAll(/\\,/g, ',').replaceAll(/ /g, '&nbsp').split('\n');
this.setStyle(); this.setStyle();
}, },
deep:true, deep:true,
@ -113,6 +113,8 @@ export default {
color: #f00; color: #f00;
line-height: 1; line-height: 1;
margin-bottom: 0; margin-bottom: 0;
word-break: keep-all;
white-space: nowrap;
} }
} }
} }

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

@ -110,6 +110,8 @@ export default {
color: #f00; color: #f00;
line-height: 1; line-height: 1;
margin-bottom: 0; margin-bottom: 0;
word-break: keep-all;
white-space: nowrap;
} }
} }
} }

3
ruoyi-ui/src/views/JiHeExpressway/mixins/InfoBoard.js

@ -11,13 +11,14 @@ export default{
// 新增待下发 // 新增待下发
____onAddDeviceItem() { ____onAddDeviceItem() {
let arr = this.selectedSize.split("*"); let arr = this.selectedSize.split("*");
this.editDialog = { this.editDialog = {
visible: true, visible: true,
mode: "add", mode: "add",
type: "device", type: "device",
tpl: { tpl: {
"textContent": "", "textContent": "",
origin: { "origin": {
displayAreaWidth: +arr[0], displayAreaWidth: +arr[0],
displayAreaHeight: +arr[1] displayAreaHeight: +arr[1]
} }

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

@ -57,8 +57,8 @@
:key="index" :key="index"
> >
<div class="title">{{ itm.deviceName }}</div> <div class="title">{{ itm.deviceName }}</div>
<el-tooltip :content="(item.deviceState == 0 || item.deviceState == null) ? '离线' : '在线'" placement="top"> <el-tooltip :content="(itm.deviceState == 0 || itm.deviceState == null) ? '离线' : '在线'" placement="top">
<img src="@/assets/jihe/images/offline.svg" class="state" v-if="item.deviceState==0 || item.deviceState==null"> <img src="@/assets/jihe/images/offline.svg" class="state" v-if="itm.deviceState=='0' || itm.deviceState==null">
<img src="@/assets/jihe/images/online.svg" class="state" v-else> <img src="@/assets/jihe/images/online.svg" class="state" v-else>
</el-tooltip> </el-tooltip>
<el-tooltip content="回读" placement="top"> <el-tooltip content="回读" placement="top">
@ -455,7 +455,7 @@ export default {
res.data.forEach((item) => { res.data.forEach((item) => {
this.boardSizeDic[item.dictValue] = { this.boardSizeDic[item.dictValue] = {
label: item.dictLabel, label: item.dictLabel,
list: [], list: []
}; };
}); });
}); });
@ -533,6 +533,7 @@ export default {
if (_.isString(item.otherConfig)) { if (_.isString(item.otherConfig)) {
item.otherConfig = JSON.parse(item.otherConfig); item.otherConfig = JSON.parse(item.otherConfig);
} }
item.iotDeviceId = item.iotDeviceId || "null_" + item.id;
this.boardSizeDic[item.otherConfig.screenSize].list.push(item); this.boardSizeDic[item.otherConfig.screenSize].list.push(item);
if (!this.selectedSize) { if (!this.selectedSize) {
this.selectedSize = item.otherConfig.screenSize; this.selectedSize = item.otherConfig.screenSize;
@ -569,7 +570,7 @@ export default {
this.selectedBdMsg = []; this.selectedBdMsg = [];
this.selectedBdMsg = _.cloneDeep(testDeviceInfo.data["3A"].content); this.selectedBdMsg = _.cloneDeep(testDeviceInfo.data["3A"].content);
} else { } else {
if (!deviceFrom.iotDeviceId) { if (!deviceFrom.iotDeviceId || deviceFrom.iotDeviceId.includes("null_")) {
this.$message.warning("设备未接入!"); this.$message.warning("设备未接入!");
return; return;
} }
@ -586,12 +587,16 @@ export default {
} }
}, },
____onAddTemplate() { ____onAddTemplate() {
// if(selectedSize){
// fontSize = "64px"
// }
this.editDialog = { this.editDialog = {
visible: true, visible: true,
mode: "add", mode: "add",
type: "template", type: "template",
tpl: { tpl: {
content: "", content: ""
}, },
}; };
}, },
@ -783,8 +788,8 @@ export default {
return; return;
} }
this.checkedDeviceIds = [arr.pop()]; this.checkedDeviceIds = [arr.pop()];
if (!this.checkedDeviceIds[0]) { if (!this.checkedDeviceIds[0] || this.checkedDeviceIds[0].includes("null_")) {
this.$message.warning("该设备缺少iotDeviceId参数!"); this.$message.warning("设备未接入!");
} }
this.selectedDevice = _.find(this.boardSizeDic[this.selectedSize].list, { this.selectedDevice = _.find(this.boardSizeDic[this.selectedSize].list, {
iotDeviceId: this.checkedDeviceIds[0], iotDeviceId: this.checkedDeviceIds[0],

4
ruoyi-ui/vue.config.js

@ -51,8 +51,8 @@ module.exports = {
// target: `http://10.0.81.204:8087`, //现场后台 刘文阁 // target: `http://10.0.81.204:8087`, //现场后台 刘文阁
// target: `http://10.168.69.255:8087`, //正晨后台 连现场物联 刘文阁 // target: `http://10.168.69.255:8087`, //正晨后台 连现场物联 刘文阁
// target: `http://10.168.78.135:8087`, //王钦 // target: `http://10.168.78.135:8087`, //王钦
// target: `http://10.168.66.196:8087`, //正晨后台 连现场物联 刘文阁2 target: `http://10.168.66.196:8087`, //正晨后台 连现场物联 刘文阁2
target: `http://10.168.68.42:8087`, //王思祥 // target: `http://10.168.68.42:8087`, //王思祥
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "", ["^" + process.env.VUE_APP_BASE_API]: "",

Loading…
Cancel
Save