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

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

@ -14,7 +14,7 @@
</span> </span>
<Form v-model="data" labelWidth="90px" column="2" class="form" ref="FormConfigRef" :formList="formList" /> <Form v-model="data" labelWidth="90px" column="2" class="form" ref="FormConfigRef" :formList="formList" />
<component ref="ControlComponent" :is="componentMap[DeviceTopics[data.deviceType]]" :isMultiControl="true" <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> @update:submitting="(val) => { submitting = val }"></component>
<div v-if="hiddenDevices.indexOf(componentMap[DeviceTopics[data.deviceType]]) == -1" class="footer"> <div v-if="hiddenDevices.indexOf(componentMap[DeviceTopics[data.deviceType]]) == -1" class="footer">
<Button @click.native="submitClick" :loading="submitting"> <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 BroadcastParam from "@screen/pages/Home/components/Dialogs/Broadcast/components/BroadcastParamMulti.vue";
import FatigueWakesUpParam from "@screen/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceParam.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 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"; import { DeviceForMap } from "@screen/pages/Home/components/RoadAndEvents/utils/buttonEvent";
const componentMap = { const componentMap = {
"设备箱": "SmartDeviceParams", "语音广播": "BroadcastParam", "疲劳唤醒": "FatigueWakesUpParam", "设备箱": "SmartDeviceParams", "语音广播": "BroadcastParam", "疲劳唤醒": "FatigueWakesUpParam",
"行车诱导": "DrivingGuidanceParam" "行车诱导": "DrivingGuidanceParam", "情报板": "InfoBoardParam",
} //DeviceTopics[deviceType] } //DeviceTopics[deviceType]
//"": undefined, , , "": undefined, // , , "": undefined,
const hiddenDevices = ["SmartDeviceParams"]; const hiddenDevices = ["SmartDeviceParams", "InfoBoardParam"];
const controlMulti = Object.keys(componentMap);//6 const controlMulti = Object.keys(componentMap);//6
const DeviceTopics = {};//6 {key:label} const DeviceTopics = {};//6 {key:label}
Object.keys(DeviceForMap).forEach(DeviceLabel => { Object.keys(DeviceForMap).forEach(DeviceLabel => {
controlMulti.indexOf(DeviceLabel) !== -1 && (DeviceTopics[DeviceForMap[DeviceLabel].deviceType] = 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) { async function setDeviceOptions(config, filterData, formList) {
const data = await getDeviceList(config.deviceType, filterData).then(async (data) => { const data = await getDeviceList(config.deviceType, filterData).then(async (data) => {
await delay(600); await delay(600);
@ -85,6 +86,7 @@ export default {
BroadcastParam, BroadcastParam,
FatigueWakesUpParam, FatigueWakesUpParam,
DrivingGuidanceParam, DrivingGuidanceParam,
InfoBoardParam
}, },
data() { data() {
return { 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"> <div class="partCon">
<vuescroll :ops="scrollOptions" class="templateBox" v-if="selectedBdMsg.length > 0" <vuescroll :ops="scrollOptions" class="templateBox" v-if="selectedBdMsg.length > 0"
:class="{ hide: isHideCtt }"> :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"> <div v-for="(itm, indx) in selectedBdMsg" :key="indx" class="tplItem">
<!-- 模板内容 --> <!-- 模板内容 -->
<BoardPreview class="boardPreview" :boardWH="selectedSize" :tpl="itm"></BoardPreview> <BoardPreview class="boardPreview" :boardWH="selectedSize" :tpl="itm"></BoardPreview>
@ -492,6 +493,7 @@ export default {
if (!this.selectedSize) { if (!this.selectedSize) {
this.selectedSize = item.otherConfig.screenSize; this.selectedSize = item.otherConfig.screenSize;
} }
console.log(item, item.otherConfig.screenSize)
// if (!this.selectedDevices.deviceName) { // if (!this.selectedDevices.deviceName) {
// this.selectedDevices = item; // this.selectedDevices = item;
// } // }
@ -1049,7 +1051,8 @@ export default {
padding-bottom: 10px; padding-bottom: 10px;
.boardPreview { .boardPreview {
border: 2px solid #004c64; background-color: #133242; border: 2px solid #004c64;
background-color: #133242;
// width: 560px; // width: 560px;
// height:80px; // height:80px;
flex: 1; flex: 1;
@ -1061,7 +1064,8 @@ export default {
display: flex; display: flex;
margin-left: 10px; margin-left: 10px;
/* // border: solid 1px #05afe3; */ /* // border: solid 1px #05afe3; */
border: 2px solid #004c64; background-color: #133242; border: 2px solid #004c64;
background-color: #133242;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
@ -1107,17 +1111,25 @@ export default {
} }
.tplItem.ghost_class { .tplItem.ghost_class {
.boardPreview, .infoBtnBox{
.boardPreview,
.infoBtnBox {
border-color: #F00; border-color: #F00;
} }
} }
.tplItem.chosen_class { .tplItem.chosen_class {
.boardPreview, .infoBtnBox{
.boardPreview,
.infoBtnBox {
border-color: #0A0; border-color: #0A0;
} }
} }
.tplItem.drag_class { .tplItem.drag_class {
.boardPreview, .infoBtnBox{
.boardPreview,
.infoBtnBox {
border-color: #FF0; border-color: #FF0;
} }
} }

Loading…
Cancel
Save