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 @@ - + diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/index.vue index 9bdd89a4..cbd6026f 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/index.vue @@ -5,13 +5,15 @@ }"> -
+
-