Browse Source

情报板发布多个

wangqin
hui 9 months ago
parent
commit
3fb99781d2
  1. 2
      ruoyi-ui/src/api/board/board.js
  2. 4
      ruoyi-ui/src/views/JiHeExpressway/mixins/InfoBoard.js
  3. 1
      ruoyi-ui/src/views/JiHeExpressway/pages/service/board/boardData.json
  4. 182
      ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue
  5. 4
      ruoyi-ui/vue.config.js

2
ruoyi-ui/src/api/board/board.js

@ -43,7 +43,7 @@ export function saveBoardReleaseLog(data) {
export function publishToBoard(data) {
return request({
url: '/business/board/publish',
url: '/business/board/batch/publish',
method: 'post',
data: data
})

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

@ -78,7 +78,7 @@ export default{
})
})
let data = { content: content, deviceId: this.selectedDevice.iotDeviceId }
let data = { content: content, deviceIdList: this.checkedDeviceIds }
if (IS_TESTING) {
// this.saveLog(content);
@ -107,7 +107,7 @@ export default{
//
saveLog(content){
let time = moment().format("YYYY-MM-DD HH:mm:ss");
let device = this.selectedDevice;
let device = this.selectedDevices;
let data = {
"createBy": store.getters.name,
"createTime": time,

1
ruoyi-ui/src/views/JiHeExpressway/pages/service/board/boardData.json

@ -1 +0,0 @@
"{\"support\":{\"PROTOCOL_TYPE\":\"GUANGDIAN_V33\",\"FONT_SIZE\":\"3232,2424,1616\",\"DEVICEID\":\"102111101\",\"COLOR\":\"红色,绿色,蓝色,黄色\",\"FONT\":\"宋体,黑体,楷体\"},\"content\":[{\"ITEM000\":[{\"SPEED\":\"1\",\"FONT_SIZE\":\"3232\",\"ACTION\":\"1\",\"COLOR\":\"黄色\",\"STATE\":true,\"CONTENT\":\"进入隧道 请开大灯1\",\"COORDINATE\":\"063004\",\"FONT\":\"黑体\",\"STAY\":\"500\"}]}]}"

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

@ -83,15 +83,21 @@
<el-checkbox-group
class="deviceList"
v-model="checkedDeviceIds"
:max="2"
@change="____onSelectDevices"
>
<el-checkbox
v-for="(itm, index) in item.list"
:label="itm.iotDeviceId"
:key="index"
:disabled="!itm.iotDeviceId || itm.iotDeviceId.includes('null') || itm.deviceState == 0 || itm.deviceState == null"
>
<div class="title">{{ itm.deviceName }}</div>
<el-tooltip content="设备未接入" placement="top" v-if="!itm.iotDeviceId || itm.iotDeviceId.includes('null_')">
<div class="title">{{ itm.deviceName }}</div>
</el-tooltip>
<el-tooltip content="设备离线" placement="top" v-else-if="itm.deviceState == 0 || itm.deviceState == null">
<div class="title">{{ itm.deviceName }}</div>
</el-tooltip>
<div v-else class="title">{{ itm.deviceName }}</div>
<el-tooltip :content="(itm.deviceState == 0 || itm.deviceState == null) ? '离线' : '在线'" placement="top">
<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>
@ -307,29 +313,12 @@
<script>
import Sortable from "sortablejs";
import editInfo from "./editInfo";
import boardData from "./boardData";
import { getUserDeptId } from "@/api/system/user";
import {
listTunnels,
devicessize,
information,
getBoardInfo,
getBoardEditInfo,
getboardSizeDic,
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 { getBoardList, getBoardDeviceInfo } from "@/api/board/board";
@ -341,8 +330,6 @@ import BoardInfoEditor from "@screen/components/infoBoard/BoardInfoEditor";
import vuescroll from "vuescroll";
import scrollOptions from "@/common/scrollbar.js";
import infoBoardUtils from "@screen/utils/infoBoard.js";
import testDeviceList from "@screen/testData/deviceList.js";
import testDeviceInfo from "@screen/testData/infoBoard.js";
@ -365,13 +352,14 @@ export default {
data() {
return {
multiPublish: true,
toggleIndex: 0,
toRightCategory: "", //
arrowRightVisible: false, //
loading: false,
submitButton: false, //
selectedSize: "", //
selectedDevice: {},
selectedDevices: [],
boardSizeDic: {}, //
boardDirectionList: [], //
userQueryParams: {
@ -574,12 +562,11 @@ export default {
if (!this.selectedSize) {
this.selectedSize = item.otherConfig.screenSize;
}
// if (!this.selectedDevice.deviceName) {
// this.selectedDevice = item;
// if (!this.selectedDevices.deviceName) {
// this.selectedDevices = item;
// }
});
this.____onChangeSize();
// this.____getDeviceInfo();
} else {
getBoardList(param).then((res) => {
res.data.forEach((item, index) => {
@ -596,8 +583,8 @@ export default {
if (!this.selectedSize) {
this.selectedSize = item.otherConfig.screenSize;
}
// if (!this.selectedDevice.deviceName) {
// this.selectedDevice = item;
// if (!this.selectedDevices.deviceName) {
// this.selectedDevices = item;
// }
});
this.____onChangeSize();
@ -605,22 +592,6 @@ export default {
});
}
},
____getDeviceInfo() {
if (IS_TESTING) {
this.selectedBdMsg = _.cloneDeep(testDeviceInfo.data["3A"].content);
} else {
if (!this.selectedDevice.iotDeviceId) {
return;
}
getBoardDeviceInfo(this.selectedDevice.iotDeviceId)
.then((res) => {
this.selectedBdMsg = res.data["3A"].content;
})
.catch((err) => {});
}
},
____forkDeviceInfo(deviceFrom) {
//
@ -819,7 +790,7 @@ export default {
//
____onPublish() {
if (!this.selectedDevice.iotDeviceId) {
if (!this.selectedDevices.length) {
this.$message.warning("请选择设备!");
return;
}
@ -827,57 +798,33 @@ export default {
},
// form
receiveForm(form) {
receiveForm(form) {
console.log(form, "接收子组件form表单 修改");
this.contentList.splice(this.index_, 1, form);
this.$forceUpdate();
this.allVmsTemplate("no");
},
//
handleCheckAllChange(val) {
this.checkedDeviceIds = val ? this.deviceList : [];
},
//
____onSelectDevices(arr) {
if (arr.length == 0) {
this.selectedDevice = {};
this.selectedDevices = [];
if (this.checkedDeviceIds.length == 0) {
return;
}
this.checkedDeviceIds = [arr.pop()];
if (!this.checkedDeviceIds[0] || this.checkedDeviceIds[0].includes("null_")) {
this.$message.warning("设备未接入!");
}
this.selectedDevice = _.find(this.boardSizeDic[this.selectedSize].list, {
iotDeviceId: this.checkedDeviceIds[0],
this.selectedDevices = _.filter(this.boardSizeDic[this.selectedSize].list, (item)=>{
return this.checkedDeviceIds.includes(item.iotDeviceId)
});
// this.____forkDeviceInfo(this.selectedDevice);
// this.____forkDeviceInfo(this.selectedDevices);
},
// ____onCheckDeviceInfo(item) {
// this.selectedDevice = _.find(this.boardSizeDic[this.selectedSize].list, { iotDeviceId: value[0] });
// this.selectedDevice = item;
// this.selectedDevice = this.deviceList
// this.____forkDeviceInfo();
// this.checkedDeviceIds = value
// let val = JSON.parse(JSON.stringify(value))
// for (let itm of this.deviceList) {
// if (val.indexOf(itm) > -1) {
// this.checkAll = true
// } else {
// this.checkAll = false
// return
// }
// }
// this.$forceUpdate()
// },
//
____onChangeSize(val) {
console.log("777777");
this.____setAvailableTemplate();
this.checkedDeviceIds = [];
this.selectedDevice = {};
this.selectedDevices = [];
this.selectedBdMsg = [];
// this.contentList = []
// this.deviceList = []
@ -1012,39 +959,6 @@ export default {
return value;
},
//
getColorStyle(font) {
if (font == "黄色" || font == "yellow" || font == "4") {
return "#FFFF00";
} else if (font == "红色" || font == "red" || font == "1") {
return "#FF0000";
} else if (
font == "绿色" ||
font == "GreenYellow" ||
font == "000255000000" ||
font == "2"
) {
return "#00FF00";
} else if (font == "蓝色" || font == "blue" || font == "3") {
return "#0000FF";
} else if (font == "7" || font == "white") {
return "#FFFFFF";
} else {
return "#" + font;
}
},
//
getTextAlign(font) {
if (font == "0") {
return "left";
} else if (font == "1") {
return "right";
} else {
return "center";
}
},
//
getCoordinate(coordinate, type, screenSize) {
let width = "";
@ -1082,50 +996,6 @@ export default {
}
}
},
getFontStyle(font) {
if (font == "宋体") {
return "Simsun";
} else if (font == "黑体") {
return "SimHei";
} else if (font == "楷体") {
return "KaiTi";
} else {
return font;
}
},
getFont(font) {
if (font == "KaiTi" || font == "k") {
return "楷体";
} else if (font == "SimSun" || font == "s") {
return "宋体";
} else if (font == "SimHei" || font == "h") {
return "黑体";
} else if (font == "FangSong" || font == "f") {
return "仿宋";
} else if (font == "LiSu" || font == "l") {
return "隶书";
} else {
return font;
}
},
// //
// moveTop(i, item) {
// if (item && i) {
// let obj = { ...this.contentList[i - 1] };
// this.contentList.splice(i - 1, 1, item);
// this.contentList.splice(i, 1, obj);
// this.$forceUpdate();
// }
// },
// //
// moveBottom(i, item) {
// if (item && typeof i === "number") {
// let obj = { ...this.contentList[i + 1] };
// this.contentList.splice(i + 1, 1, item);
// this.contentList.splice(i, 1, obj);
// this.$forceUpdate();
// }
// },
dialogClose() {
this.showEmit = false;
this.arrowRightVisible = false;

4
ruoyi-ui/vue.config.js

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

Loading…
Cancel
Save