From b7f28a6db0e9efc44a9100551126b9be257c921b Mon Sep 17 00:00:00 2001 From: hui <770260999@qq.com> Date: Fri, 26 Apr 2024 17:48:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/infoBoard/BoardInfoEditor.vue | 6 +- .../views/JiHeExpressway/mixins/InfoBoard.js | 13 ++- .../strategy/components/AddNEditDialog.vue | 102 +++++++++++++----- .../device/strategy/components/TaskItem.vue | 63 ++++++----- .../strategy/components/taskEditDialog.vue | 31 ++++-- .../strategy/components/timeEditDialog.vue | 26 ++--- .../pages/control/device/strategy/index.vue | 22 ++-- .../pages/datav/gisAndBim/index.vue | 55 +++++++++- .../views/JiHeExpressway/utils/api/batch.js | 7 +- ruoyi-ui/vue.config.js | 4 +- 10 files changed, 224 insertions(+), 105 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardInfoEditor.vue b/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardInfoEditor.vue index 37ad3241..3be1387b 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardInfoEditor.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardInfoEditor.vue @@ -182,13 +182,10 @@ import { getFontSizeByDevicePixel, uploadBoardEditInfo, } from "@/api/board/template"; -import { devicessize } from "@/api/information/api.js"; -import { checkIotBoardContent } from "@/api/board/vocabulary"; import BoardPreview from "@screen/components/infoBoard/BoardPreview.vue"; import BoardTplPreview from "@screen/components/infoBoard/BoardTplPreview.vue"; import infoBoardUtils from "@screen/utils/infoBoard.js"; import { checkBoardContent } from "@/api/board/board"; -import { debounce } from "lodash"; export default { data() { return { @@ -303,8 +300,8 @@ export default { textContent: "", fontStyle: "0", displayAreaWidth: "768", - playbackDuration: "50", displayAreaHeight: "64", + playbackDuration: "50", volume: "0", xCoordinate: "0", screenEntrySpeed: "1", @@ -483,7 +480,6 @@ export default { this.mode ); } else { - console.log(this.tpl , "tttttttttppplllll") this.dataForm = infoBoardUtils.dialogSourceFormat( this.tpl, this.type, diff --git a/ruoyi-ui/src/views/JiHeExpressway/mixins/InfoBoard.js b/ruoyi-ui/src/views/JiHeExpressway/mixins/InfoBoard.js index 5009b82f..a750c92d 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/mixins/InfoBoard.js +++ b/ruoyi-ui/src/views/JiHeExpressway/mixins/InfoBoard.js @@ -45,13 +45,16 @@ export default { }; }, // 发布信息 - ____publishInfo() { + ____publishInfo() { let deviceList = []; - if (this.isMultiControl && !this.selectItems.length) { - return Message.error("请至少选择一个设备!"); + + if (this.isMultiControl){ + if (!this.selectItems.length) { + return Message.error("请至少选择一个设备!"); + } + const selectItems = this.selectItems.map((item) => JSON.parse(item)); + deviceList = selectItems; } - 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; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/AddNEditDialog.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/AddNEditDialog.vue index bb072cea..08288ac7 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/AddNEditDialog.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/AddNEditDialog.vue @@ -1,6 +1,5 @@ @@ -52,7 +56,7 @@ - + @@ -99,6 +103,7 @@ export default { // } }; return { + editingTime:"", editData:{}, mode:"", isEditing:false, @@ -156,18 +161,61 @@ export default { }, methods: { onSubmitTaskItem(){ - this.getTaskList(); //新增task后自动刷新任务列表 + this.isEditing = false; + request({ + url: `/business/dcBatchFunctionsJobGroup/${this.propData.id}`, + method: "GET" + }).then(res=>{ + this.editData = { + id: res.data.id, + groupName: res.data.groupName, + status: res.data.status, + remark: res.data.remark, + detailedConfiguration: res.data.detailedConfiguration + } + this.getTaskList(); //新增task后自动刷新任务列表 + }); }, onAddTaskGroup(){ this.isShowTimeEdit = true; }, + onModifyTime(taskG){ + this.editingTime = taskG.time; + this.selectedTaskGroup = taskG; + this.isShowTimeEdit = true; + }, + onDeleteTaskGroup(taskG){ + request({ + url: `/business/dcBatchFunctionsJob/time/${this.propData.id}/${taskG.time}`, + method: "DELETE" + }).then(res => { + request({ + url: `/business/dcBatchFunctionsJobGroup/${this.propData.id}`, + method: "GET" + }).then(res => { + this.editData = { + id: res.data.id, + groupName: res.data.groupName, + status: res.data.status, + remark: res.data.remark, + detailedConfiguration: res.data.detailedConfiguration + } + this.getTaskList(); //新增task后自动刷新任务列表 + }); + }); + }, onSubmitTime(time){ this.isShowTimeEdit = false; - this.taskGroupsEditing.push({ time, tasks: [] }); + + if (this.selectedTaskGroup){ + this.selectedTaskGroup.time = time; + }else{ + this.taskGroupsEditing.push({ time, tasks: [] }); + } let detailedConfiguration =[]; this.taskGroupsEditing.forEach(item=>{ - detailedConfiguration.push({time:item.time, tasks:_.map(item.tasksEdit, "id")}); + detailedConfiguration.push({time:item.time, tasks:_.map(item.tasksEdit, "jobId")}); }); request({ url: `/business/dcBatchFunctionsJobGroup`, @@ -179,6 +227,7 @@ export default { }) .then((result) => { if (result.code != 200) return; + Message.success(`提交成功!`); }) }, @@ -186,10 +235,6 @@ export default { this.selectedTaskGroup = taskG; this.isEditing = true; }, - onModifyItem(newV , oldV){ - console.log(newV, oldV , "修改条目》》》") - // oldV.devices - }, initEditingData(){ if(this.propData?.id){ this.mode = "edit" @@ -212,7 +257,7 @@ export default { }, getTaskList(){ - this.taskGroupsEditing = JSON.parse(this.propData.detailedConfiguration); + this.taskGroupsEditing = JSON.parse(this.editData.detailedConfiguration); // this.taskGroupsEditing = [{time:"08:00:00",tasks:[1],tasksEdit:[]}]; // 测试代码开始 @@ -312,9 +357,16 @@ export default { font-size: 12px; } } -.task{ +.all_groups{ + max-height:500px; + overflow-y: scroll; +} +.task_group{ border: 1px solid #FFF; .task_info{ + .time_show{ + color: #0AC; + } } .task_op{ } diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/TaskItem.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/TaskItem.vue index cb673be8..90d4876a 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/TaskItem.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/TaskItem.vue @@ -1,21 +1,21 @@