From 9d7dd68bf21da1b03ccc166be51555448491bc2c Mon Sep 17 00:00:00 2001
From: qingzhengli <1204552371@qq.com>
Date: Wed, 17 Apr 2024 16:25:52 +0800
Subject: [PATCH] =?UTF-8?q?feat=20=E6=9B=B4=E6=96=B0=E6=89=B9=E9=87=8F?=
=?UTF-8?q?=E6=8E=A7=E5=88=B6=20=20=E8=AF=AD=E9=9F=B3=E5=B9=BF=E6=92=AD?=
=?UTF-8?q?=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/BroadcastParamMulti.vue | 182 ++++++++++++++++++
.../components/HomeFrameControl/index.vue | 29 +--
.../RoadAndEvents/utils/httpList.js | 8 +
.../views/JiHeExpressway/pages/Home/index.vue | 2 +-
4 files changed, 207 insertions(+), 14 deletions(-)
create mode 100644 ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Broadcast/components/BroadcastParamMulti.vue
diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Broadcast/components/BroadcastParamMulti.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Broadcast/components/BroadcastParamMulti.vue
new file mode 100644
index 00000000..0fabeb8f
--- /dev/null
+++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Broadcast/components/BroadcastParamMulti.vue
@@ -0,0 +1,182 @@
+
+
+
+
+
+
+
diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFrameControl/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFrameControl/index.vue
index 18227f6a..6fea9c31 100644
--- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFrameControl/index.vue
+++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFrameControl/index.vue
@@ -13,14 +13,14 @@
-
-
-
@@ -38,11 +38,9 @@ import { getDeviceList } from "@screen/pages/Home/components/RoadAndEvents/utils
import { delay } from "@screen/utils/common";
import { initSearch } from "@screen/utils/enum/common.js"
import DeviceParams from "@screen/pages/Home/components/Dialogs/SmartDevice/components/DeviceParams.vue";
-import BroadcastParam from "@screen/pages/Home/components/Dialogs/Broadcast/components/BroadcastParam.vue";
+import BroadcastParam from "@screen/pages/Home/components/Dialogs/Broadcast/components/BroadcastParamMulti.vue";
+import { DeviceForMap } from "@screen/pages/Home/components/RoadAndEvents/utils/buttonEvent";
-import Vue from "vue";
-
-import { DeviceForMap } from "@screen/pages/Home/components/RoadAndEvents/utils/buttonEvent"
const componentMap = { "语音广播": "BroadcastParam" } //DeviceTopics[deviceType]
//"情报板": undefined, "行车诱导": undefined, "疲劳唤醒": undefined, "合流区": undefined,"设备箱": "DeviceParams",
const controlMulti = Object.keys(componentMap);//6种批量控制
@@ -51,13 +49,14 @@ 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];
async function setDeviceOptions(config, filterData, formList) {
const data = await getDeviceList(config.deviceType, filterData).then(async (data) => {
await delay(600);
return data;
});
formList[4].options.options = data.map(item => {
- return { label: `${item.deviceName}`, value: JSON.stringify({ id: item.id, iotDeviceId: item.iotDeviceId }), disabled: item.deviceState != 1 }
+ return { label: `${item.deviceName}`, value: JSON.stringify({ id: item.id, iotDeviceId: item.iotDeviceId, deviceType: item.deviceType, otherConfig: item.otherConfig }), disabled: item.deviceState != 1 }
})
};
function changeHandle(data, formList) {
@@ -85,6 +84,7 @@ export default {
label: "设备类型:",
key: "deviceType",
type: "select",
+ default: deviceTypeDefault,
options: {
clearable: true,
options: Object.keys(DeviceTopics).map(key => { return { label: DeviceTopics[key], value: key } }),
@@ -92,7 +92,6 @@ export default {
ons: { //on监听 element事件
change(value, ...args) {
const { data, formList } = args.slice(-1)[0]; //data 为数据 formList为传入的配置项
- console.log(Vue, this)
if (data.deviceType) changeHandle(data, formList);
else data.childType = undefined;
}
@@ -274,14 +273,18 @@ export default {
// deep: true
// }
// },
+ mounted() {
+ changeHandle(this.data, this.formList);
+ },
methods: {
+ submitClick() {
+ this.$refs.ControlComponent.handleSubmit()
+ },
cancelClick() {
this.activeIcon = null;
},
handleClick(type) {
- console.log("type: ", type);
this.activeIcon = this.activeIcon === type ? null : type;
- console.log("this.activeIcon", this.activeIcon);
},
filterEnd(data) {
this.activeIcon = null;
diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js
index 8faea32f..82465cfc 100644
--- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js
+++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js
@@ -3,6 +3,14 @@ import { Message } from "element-ui";
import moment from "moment";
import request from "@/utils/request";
+export function batchFunctions(data) {
+ return request({
+ url: `/business/device/batchFunctions`,
+ method: "post",
+ data: data,
+ });
+}
+
/**
*
* @param {string} camId 相机 ID
diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue
index 98aa54f1..91b5bd4c 100644
--- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue
+++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue
@@ -22,7 +22,7 @@
-
+