Browse Source

feat 批量控制 情报板完成

wangqin
qingzhengli 7 months ago
parent
commit
d69800720a
  1. 161
      ruoyi-ui/src/views/JiHeExpressway/mixins/InfoBoard.js
  2. 12
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFrameControl/index.vue
  3. 1019
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/InfoBoard/InfoBoard.vue
  4. 1038
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/InfoBoard/index.vue
  5. 24
      ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue

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

@ -1,11 +1,10 @@
import { publishToBoard, saveBoardReleaseLog } from '@/api/board/board'
import moment from 'moment/moment';
import store from '@/store'
import { publishToBoard, saveBoardReleaseLog } from "@/api/board/board";
import moment from "moment/moment";
import store from "@/store";
import { Message } from "element-ui";
export default {
data() {
return {
}
return {};
},
methods: {
// 新增待下发
@ -17,17 +16,16 @@ export default{
mode: "add",
type: "device",
tpl: {
"textContent": "",
"origin": {
textContent: "",
origin: {
displayAreaWidth: +arr[0],
displayAreaHeight: +arr[1]
}
}
}
displayAreaHeight: +arr[1],
},
},
};
},
// 从模板新增待下发
____onTplToDevice(item, showDialog) {
// if(this.checkedDeviceIds.length<=0){
// this.$message.warning('未选择设备!');
// return;
@ -36,40 +34,45 @@ export default{
let arr = this.selectedSize.split("*");
item.origin = {
displayAreaWidth: +arr[0],
displayAreaHeight: +arr[1]
}
displayAreaHeight: +arr[1],
};
this.editDialog = {
visible: showDialog == false ? false : true,
mode: "toDevice",
type: "template",
tpl: item
}
tpl: item,
};
},
// 发布信息
____publishInfo() {
let deviceList = [];
if (this.selectedDevice){
deviceList = [this.selectedDevice];
}else{
deviceList = this.selectedDevices;
if (this.isMultiControl && !this.selectItems.length) {
return Message.error("请至少选择一个设备!");
}
const selectItems = this.selectItems.map((item) => JSON.parse(item));
if (this.isMultiControl) deviceList = selectItems;
else {
if (this.selectedDevice) deviceList = [this.selectedDevice];
else deviceList = this.selectedDevices;
}
this.$confirm('是否确定发布情报板?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$confirm("是否确定发布情报板?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
text: "Loading",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
let content = [];
this.selectedBdMsg.forEach(item => {
this.selectedBdMsg.forEach((item) => {
content.push({
STAY: item.playbackDuration,
ACTION: item.screenEntryMethod,
@ -77,76 +80,78 @@ export default{
COLOR: item.foregroundColor,
FONT: item.font,
FONT_SIZE: item.fontSize,
CONTENT: item.textContent.replaceAll(',', '\\,').replaceAll('=', '\\=').replaceAll('\n', '\\\\n'),
CONTENT: item.textContent
.replaceAll(",", "\\,")
.replaceAll("=", "\\=")
.replaceAll("\n", "\\\\n"),
width: item.displayAreaWidth,
height: item.displayAreaHeight,
formatStyle: item.verticalAlignment
})
})
formatStyle: item.verticalAlignment,
});
});
let data = { content: content, deviceList }
let data = { content: content, deviceList };
if (IS_TESTING) {
// this.saveLog(content);
this.____getDeviceInfo();
loading.close()
loading.close();
} else {
publishToBoard(data).then(res => {
publishToBoard(data)
.then((res) => {
// this.saveLog(content);
this.$message({
type: "success",
message:"发布成功!"
message: "发布成功!",
});
this.____getDeviceInfo();
}).catch(err=>{
}).finally(()=>{
loading.close()
!isMultiControl && this.____getDeviceInfo();
})
.catch((err) => {})
.finally(() => {
loading.close();
});
}
}).catch(() => {
this.$message({
type: 'info',
message: '取消发布'
})
})
.catch(() => {
this.$message({
type: "info",
message: "取消发布",
});
});
},
//
saveLog(content) {
let time = moment().format("YYYY-MM-DD HH:mm:ss");
let device = this.selectedDevices;
let data = {
"createBy": store.getters.name,
"createTime": time,
"deviceId": device.id,
"deviceName": device.deviceName,
"direction": device.direction,
"params": {},
"platform": "",
"releaseContent": JSON.stringify(content),
"releaseDeptId": "",
"releaseDeptName": "",
"releaseIp": "",
"releaseStatus": "",
"releaseTime": time,
"releaseUserId": "",
"releaseUserName": "",
"remark": "",
"searchValue": "",
"stakeMark": device.stakeMark,
"updateBy": "",
"updateTime": time
}
saveBoardReleaseLog(data).then(res => {
createBy: store.getters.name,
createTime: time,
deviceId: device.id,
deviceName: device.deviceName,
direction: device.direction,
params: {},
platform: "",
releaseContent: JSON.stringify(content),
releaseDeptId: "",
releaseDeptName: "",
releaseIp: "",
releaseStatus: "",
releaseTime: time,
releaseUserId: "",
releaseUserName: "",
remark: "",
searchValue: "",
stakeMark: device.stakeMark,
updateBy: "",
updateTime: time,
};
saveBoardReleaseLog(data).then((res) => {
if (res.code == 200) {
console.log("情报板日志已保存:::", data);
} else {
console.log("情报板日志保存失败!");
}
})
}
}
}
});
},
},
};

12
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFrameControl/index.vue

@ -14,7 +14,7 @@
</span>
<Form v-model="data" labelWidth="90px" column="2" class="form" ref="FormConfigRef" :formList="formList" />
<component ref="ControlComponent" :is="componentMap[DeviceTopics[data.deviceType]]" :isMultiControl="true"
:selectItems="data.childType" @update:activeIcon="(val) => { this.activeIcon = val }"
:visible="true" :selectItems="data.childType" @update:activeIcon="(val) => { this.activeIcon = val }"
@update:submitting="(val) => { submitting = val }"></component>
<div v-if="hiddenDevices.indexOf(componentMap[DeviceTopics[data.deviceType]]) == -1" class="footer">
<Button @click.native="submitClick" :loading="submitting">
@ -42,23 +42,24 @@ import SmartDeviceParams from "@screen/pages/Home/components/Dialogs/SmartDevice
import BroadcastParam from "@screen/pages/Home/components/Dialogs/Broadcast/components/BroadcastParamMulti.vue";
import FatigueWakesUpParam from "@screen/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceParam.vue";
import DrivingGuidanceParam from "@screen/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceParam.vue";
import InfoBoardParam from "@screen/pages/Home/components/InfoBoard/InfoBoard.vue";
import { DeviceForMap } from "@screen/pages/Home/components/RoadAndEvents/utils/buttonEvent";
const componentMap = {
"设备箱": "SmartDeviceParams", "语音广播": "BroadcastParam", "疲劳唤醒": "FatigueWakesUpParam",
"行车诱导": "DrivingGuidanceParam"
"行车诱导": "DrivingGuidanceParam", "情报板": "InfoBoardParam",
} //DeviceTopics[deviceType]
//"": undefined, , , "": undefined,
const hiddenDevices = ["SmartDeviceParams"];
// , , "": undefined,
const hiddenDevices = ["SmartDeviceParams", "InfoBoardParam"];
const controlMulti = Object.keys(componentMap);//6
const DeviceTopics = {};//6 {key:label}
Object.keys(DeviceForMap).forEach(DeviceLabel => {
controlMulti.indexOf(DeviceLabel) !== -1 && (DeviceTopics[DeviceForMap[DeviceLabel].deviceType] = DeviceLabel);
});
const deviceTypeDefault = Object.keys(DeviceTopics)[0];
const deviceTypeDefault = Object.keys(DeviceTopics)[1];
async function setDeviceOptions(config, filterData, formList) {
const data = await getDeviceList(config.deviceType, filterData).then(async (data) => {
await delay(600);
@ -85,6 +86,7 @@ export default {
BroadcastParam,
FatigueWakesUpParam,
DrivingGuidanceParam,
InfoBoardParam
},
data() {
return {

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

File diff suppressed because it is too large

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

File diff suppressed because it is too large

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

@ -125,7 +125,8 @@
<div class="partCon">
<vuescroll :ops="scrollOptions" class="templateBox" v-if="selectedBdMsg.length > 0"
:class="{ hide: isHideCtt }">
<draggable tag="div" :list="selectedBdMsg" @end="____onDragend" ghostClass="ghost_class" dragClass="drag_class" chosenClass="chosen_class">
<draggable tag="div" :list="selectedBdMsg" @end="____onDragend" ghostClass="ghost_class"
dragClass="drag_class" chosenClass="chosen_class">
<div v-for="(itm, indx) in selectedBdMsg" :key="indx" class="tplItem">
<!-- 模板内容 -->
<BoardPreview class="boardPreview" :boardWH="selectedSize" :tpl="itm"></BoardPreview>
@ -492,6 +493,7 @@ export default {
if (!this.selectedSize) {
this.selectedSize = item.otherConfig.screenSize;
}
console.log(item, item.otherConfig.screenSize)
// if (!this.selectedDevices.deviceName) {
// this.selectedDevices = item;
// }
@ -1049,7 +1051,8 @@ export default {
padding-bottom: 10px;
.boardPreview {
border: 2px solid #004c64; background-color: #133242;
border: 2px solid #004c64;
background-color: #133242;
// width: 560px;
// height:80px;
flex: 1;
@ -1061,7 +1064,8 @@ export default {
display: flex;
margin-left: 10px;
/* // border: solid 1px #05afe3; */
border: 2px solid #004c64; background-color: #133242;
border: 2px solid #004c64;
background-color: #133242;
display: flex;
justify-content: space-around;
align-items: center;
@ -1107,17 +1111,25 @@ export default {
}
.tplItem.ghost_class {
.boardPreview, .infoBtnBox{
.boardPreview,
.infoBtnBox {
border-color: #F00;
}
}
.tplItem.chosen_class {
.boardPreview, .infoBtnBox{
.boardPreview,
.infoBtnBox {
border-color: #0A0;
}
}
.tplItem.drag_class {
.boardPreview, .infoBtnBox{
.boardPreview,
.infoBtnBox {
border-color: #FF0;
}
}

Loading…
Cancel
Save