Browse Source

feat 优化 批量控制

wangqin
qingzhengli 7 months ago
parent
commit
c9b81a40d0
  1. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Broadcast/components/BroadcastParamMulti.vue
  2. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceParam.vue
  3. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SmartDevice/components/DeviceParamsMulti.vue
  4. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFrameControl/index.vue

2
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Broadcast/components/BroadcastParamMulti.vue

@ -95,7 +95,7 @@ export default {
if (!this.releaseMessage?.trim()) if (!this.releaseMessage?.trim())
return Message.error("发布内容不能为空!"); return Message.error("发布内容不能为空!");
if (!selectItems.length) if (!selectItems.length)
return Message.error("请至少选择一个广播设备!"); return Message.error("请至少选择一个设备!");
// this.submitting = true; // this.submitting = true;
this.$emit("update:submitting", true); this.$emit("update:submitting", true);

2
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceParam.vue

@ -339,7 +339,7 @@ export default {
}, },
async handleSubmit() { async handleSubmit() {
if (this.isMultiControl && !this.selectItems.length) { if (this.isMultiControl && !this.selectItems.length) {
return Message.error("请至少选择一个疲劳唤醒设备!"); return Message.error("请至少选择一个设备!");
} }
const selectItems = this.selectItems.map(item => JSON.parse(item)); const selectItems = this.selectItems.map(item => JSON.parse(item));
let devices; let devices;

2
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SmartDevice/components/DeviceParamsMulti.vue

@ -116,7 +116,7 @@ export default {
if (!this.selectItems.length) { if (!this.selectItems.length) {
setTimeout(() => { data.state = !value; }, 10); setTimeout(() => { data.state = !value; }, 10);
return Message.error("请至少选择一个广播设备!"); return Message.error("请至少选择一个设备!");
} }
const selectItems = this.selectItems.map(item => JSON.parse(item)); const selectItems = this.selectItems.map(item => JSON.parse(item));

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

@ -16,7 +16,7 @@
<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 }" :selectItems="data.childType" @update:activeIcon="(val) => { this.activeIcon = val }"
@update:submitting="(val) => { submitting = val }"></component> @update:submitting="(val) => { submitting = val }"></component>
<div 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">
确认 确认
</Button> </Button>
@ -46,6 +46,7 @@ import { DeviceForMap } from "@screen/pages/Home/components/RoadAndEvents/utils/
const componentMap = { "设备箱": "SmartDeviceParams", "语音广播": "BroadcastParam", "疲劳唤醒": "FatigueWakesUpParam" } //DeviceTopics[deviceType] const componentMap = { "设备箱": "SmartDeviceParams", "语音广播": "BroadcastParam", "疲劳唤醒": "FatigueWakesUpParam" } //DeviceTopics[deviceType]
//"": undefined, "": undefined, , "": undefined, //"": undefined, "": undefined, , "": undefined,
const hiddenDevices = ["SmartDeviceParams"];
const controlMulti = Object.keys(componentMap);//6 const controlMulti = Object.keys(componentMap);//6
const DeviceTopics = {};//6 {key:label} const DeviceTopics = {};//6 {key:label}
@ -83,6 +84,7 @@ export default {
return { return {
activeIcon: null, activeIcon: null,
data: {}, data: {},
hiddenDevices,
submitting: false, submitting: false,
formList: [ formList: [
{ {

Loading…
Cancel
Save