Browse Source

feat 批量控制 疲劳唤醒完成

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

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

@ -9,7 +9,7 @@
showWordLimit placeholder="请输入发布内容" /> showWordLimit placeholder="请输入发布内容" />
</div> </div>
<div class="footer"> <!-- <div class="footer">
<Button @click.native="handleSubmit" :loading="submitting"> <Button @click.native="handleSubmit" :loading="submitting">
确定 确定
</Button> </Button>
@ -17,7 +17,7 @@
<Button style="background-color: rgba(0, 179, 204, 0.3)" @click.native="cancelClick"> <Button style="background-color: rgba(0, 179, 204, 0.3)" @click.native="cancelClick">
取消 取消
</Button> </Button>
</div> </div> -->
</div> </div>
</div> </div>
</template> </template>
@ -86,7 +86,8 @@ export default {
methods: { methods: {
cancelClick() { cancelClick() {
this.$emit("update:activeIcon", null); this.$emit("update:activeIcon", null);
this.submitting = false; this.$emit("update:submitting", false);
// this.submitting = false;
}, },
handleSubmit() { handleSubmit() {
const selectItems = this.selectItems.map(item => JSON.parse(item)); const selectItems = this.selectItems.map(item => JSON.parse(item));
@ -96,7 +97,8 @@ export default {
if (!selectItems.length) if (!selectItems.length)
return Message.error("请至少选择一个广播设备!"); return Message.error("请至少选择一个广播设备!");
this.submitting = true; // this.submitting = true;
this.$emit("update:submitting", true);
batchFunctions( batchFunctions(
{ {
@ -121,7 +123,8 @@ export default {
multiResultShow(data.data, item => item.result.retCode == 0, "广播设置"); multiResultShow(data.data, item => item.result.retCode == 0, "广播设置");
}) })
.finally(() => { .finally(() => {
this.submitting = false; // this.submitting = false;
this.$emit("update:submitting", false);
}); });
}, },
}, },

361
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceControlDialog.vue

@ -1,86 +1,8 @@
<template> <template>
<Dialog v-model="modelVisible" title="设备操作" width="910px"> <Dialog v-model="modelVisible" title="设备操作" width="910px">
<div class="DeviceControlDialog"> <div class="DeviceControlDialog">
<ElTabs v-model="activeName" class="tabs" @tab-click="tabClick"> <DeviceParam v-model="modelVisible" ref="DeviceParam" :deviceId="this.deviceId" :productId="this.productId">
<ElTabPane label="一般模式" name="first"> </DeviceParam>
<Form v-model="formData" class="form" ref="FormConfigRef" :formList="formList1" column="1"
labelWidth="120px" />
</ElTabPane>
<ElTabPane label="自定义模式" name="second">
<!-- <div style="display: flex; margin: 20px 0">
<p style="width: 115px">工作时长():</p>
<el-input-number v-model="onWorkStatus2" :min="0" :max="999" label="工作时长(s分):"></el-input-number>
</div> -->
<Table :data="tableData">
<ElTableColumn prop="ds" label="段数"></ElTableColumn>
<ElTableColumn prop="time" width="120" label="时间(毫秒)">
<template slot-scope="scope">
<div style="display: flex">
<el-input-number style="width: 120px" v-model="scope.row.time" :min="0"></el-input-number>
</div>
</template>
</ElTableColumn>
<ElTableColumn prop="A" label="线路A">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.A" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="B" label="线路B">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.B" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="C" label="线路C">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.C" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="D" label="线路D">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.D" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="E" label="线路E">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.E" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="F" label="线路F">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.F" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="G" label="线路G">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.G" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="H" label="线路H">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.H" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
</Table>
</ElTabPane>
</ElTabs>
</div> </div>
<template #footer> <template #footer>
@ -100,7 +22,7 @@ import Button from "@screen/components/Buttons/Button.vue";
import Form from "@screen/components/FormConfig"; import Form from "@screen/components/FormConfig";
import request from "@/utils/request"; import request from "@/utils/request";
import { Message } from "element-ui"; import { Message } from "element-ui";
import DeviceParam from "./DeviceParam.vue";
export default { export default {
name: "DeviceControlDialog", name: "DeviceControlDialog",
components: { components: {
@ -108,6 +30,7 @@ export default {
Button, Button,
Form, Form,
Table, Table,
DeviceParam,
}, },
model: { model: {
prop: "visible", prop: "visible",
@ -121,153 +44,11 @@ export default {
data() { data() {
return { return {
submitting: false, submitting: false,
activeName: "first",
onWorkStatus2: 0,
formData: {},
duan: [
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
],
tableData: [
// {
// ds: 'A',
// time: 0,
// A: false,
// B: false,
// C: false,
// D: false,
// E: false,
// F: false,
// G: false,
// H: false,
// }
],
formList1: [
{
label: "工作模式:",
key: "controlType",
type: "select",
default: "1",
options: {
options: [
{
value: "0",
label: "激光关闭",
},
{
value: "1",
label: "常亮模式",
},
{
value: "2",
label: "间隔100ms闪烁模式",
},
{
value: "3",
label: "间隔200ms闪烁模式",
},
{
value: "4",
label: "间隔500ms闪烁模式",
},
{
value: "5",
label: "2次闪烁模式",
},
{
value: "6",
label: "SOS模式",
},
{
value: "7",
label: "自定义模式",
},
],
},
},
{
label: "工作时长(分):",
key: "onWorkStatus",
required: true,
default: 0,
type: "inputNumber",
options: {
min: 0,
max: 999,
},
},
],
formList2: [
{
label: "工作模式:",
key: "controlType",
type: "RadioGroup",
default: "00",
options: {
type: "circle",
options: [
{
key: "00",
label: "常量",
},
{
key: "01",
label: "闪烁",
},
],
},
},
{
label: "线路选择:",
key: "onWorkStatus2",
required: true,
type: "select",
options: {
placeholder: "请选择",
},
},
{
label: "工作时长:",
key: "onWorkStatus",
required: true,
type: "select",
options: {
placeholder: "请选择",
},
},
],
rules: {
onWorkStatus: [
{ required: true, message: "工作时长不能为空", trigger: "blur" },
],
},
}; };
}, },
computed: { computed: {
modelVisible: { modelVisible: {
get() { get() {
if (this.visible) {
// this.deviceId = 'K82+285';
this.initData();
}
return this.visible; return this.visible;
}, },
set(val) { set(val) {
@ -275,141 +56,9 @@ export default {
}, },
}, },
}, },
// watch: {
// modelVisible: {
// immediate: true,
// handler(bool) {
// if (!bool) return;
// // this.requestURL();
// }
// }
// },
methods: { methods: {
async initData() {
//
let result = await this.requestURL("ASKMD");
// if (result.data == 7) {
// this.activeName = "second";
// this.tabClick();
// } else {
this.formData.controlType = result.data + "" || "1";
//
let resultTime = await this.requestURL("ASKTM");
this.formData.onWorkStatus = resultTime.data || 0;
this.activeName = "first";
// }
},
async requestURL(functionId, options = {}) {
let result = await request({
url: `/business/device/functions/${this.deviceId}/${functionId}`,
method: "post",
data: options,
});
if (result.code != 200) return Message.error(result?.msg);
//SETMDASKMDSETTMASKTMSETDFASKDF
console.log("aaaa", result);
return result;
},
async tabClick() {
if (this.activeName == "second") {
//
let result = await request({
url: `/business/device/properties/latest/${this.deviceId}`,
method: "get",
});
if (result.code != 200) return Message.error(result?.msg);
this.tableData = [];
let tData = [];
result.data.forEach((item) => {
if (item.property == "TM") {
this.onWorkStatus2 = item.value;
} else if (item.property == "MD") {
} else {
let data = JSON.parse(item.formatValue || {});
tData.push({ ...data, ds: item.property });
}
});
tData.sort((a, b) => a.ds.toUpperCase().localeCompare(b.ds.toUpperCase()));
this.tableData = tData;
} else {
//
let resultTime = await this.requestURL("ASKTM");
this.formData.onWorkStatus = resultTime.data || 0;
this.activeName = "first";
}
},
async handleSubmit() { async handleSubmit() {
if (this.activeName == "first") { this.$refs.DeviceParam?.handleSubmit();
//
this.$refs.FormConfigRef.validate().then(async (formData) => {
console.log("formData", formData);
//
await this.requestURL("SETMD", { SET: formData.controlType });
//
let res = await this.requestURL("SETTM", {
SET: formData.onWorkStatus,
});
console.log("res", res);
if (res.code == 200) {
Message.success("设置成功!");
this.$emit("update:value", false);
}
});
} else if (this.activeName == "second") {
//
let rData = [];
this.tableData.forEach((it, index) => {
rData.push({
functionId: "SETDF",
params: {
order: 7,
time: it.time,
numberOfSegments: it.ds || this.duan[index],
A: Number(it.A),
B: Number(it.B),
C: Number(it.C),
D: Number(it.D),
E: Number(it.E),
F: Number(it.F),
G: Number(it.G),
H: Number(it.H),
}
});
});
//
let res = await request({
url: `/business/device/batchFunctions`,
method: "post",
// data: {
// deviceId: this.deviceId,
// functionId: "SETDF",
// params: rData,
// },
data: {
devices: [{
iotDeviceId: this.deviceId,
id: this.productId,
deviceType: 10
}],
functions: rData
}
});
if (res.code == 200) {
Message.success("设置成功!");
this.$emit("update:value", false);
}
//
// let res = await this.requestURL("SETTM", { SET: this.onWorkStatus2 });
// if (res.code == 200) {
// Message.success("");
// this.$emit("update:value", false);
// }
}
}, },
}, },
}; };

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

@ -0,0 +1,421 @@
<template>
<div :style="{
'max-height': isMultiControl ? '250px' : undefined, 'overflow-y': isMultiControl ? 'auto' : undefined,
'margin-left': isMultiControl ? '14px' : undefined
}">
<ElTabs v-model="activeName" class="tabs" @tab-click="tabClick">
<ElTabPane label="一般模式" name="first">
<Form v-model="formData" class="form" ref="FormConfigRef" :formList="formList1" column="1" labelWidth="120px" />
</ElTabPane>
<ElTabPane label="自定义模式" name="second">
<!-- <div style="display: flex; margin: 20px 0">
<p style="width: 115px">工作时长():</p>
<el-input-number v-model="onWorkStatus2" :min="0" :max="999" label="工作时长(s分):"></el-input-number>
</div> -->
<Table :data="tableData">
<ElTableColumn prop="ds" label="段数"></ElTableColumn>
<ElTableColumn prop="time" width="120" label="时间(毫秒)">
<template slot-scope="scope">
<div style="display: flex">
<el-input-number style="width: 120px" v-model="scope.row.time" :min="0"></el-input-number>
</div>
</template>
</ElTableColumn>
<ElTableColumn prop="A" label="线路A">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.A" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="B" label="线路B">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.B" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="C" label="线路C">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.C" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="D" label="线路D">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.D" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="E" label="线路E">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.E" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="F" label="线路F">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.F" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="G" label="线路G">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.G" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="H" label="线路H">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.H" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
</Table>
</ElTabPane>
</ElTabs>
</div>
</template>
<script>
import Table from "@screen/components/Table.vue";
import Dialog from "@screen/components/Dialog/index.vue";
import Button from "@screen/components/Buttons/Button.vue";
import Form from "@screen/components/FormConfig";
import request from "@/utils/request";
import { Message } from "element-ui";
import { batchFunctions } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js";
import { multiResultShow } from "@screen/utils/common";
export default {
name: "DeviceControlDialog",
components: {
Dialog,
Button,
Form,
Table,
},
model: {
prop: "visible",
event: "update:value",
},
props: {
visible: Boolean,
deviceId: String,
productId: String,
isMultiControl: Boolean,
selectItems: {
type: Array,
default: () => []
}
},
data() {
return {
submitting: false,
activeName: "first",
onWorkStatus2: 0,
formData: {},
duan: [
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
],
tableData: [
// {
// ds: 'A',
// time: 0,
// A: false,
// B: false,
// C: false,
// D: false,
// E: false,
// F: false,
// G: false,
// H: false,
// }
],
formList1: [
{
label: "工作模式:",
key: "controlType",
type: "select",
default: "1",
options: {
options: [
{
value: "0",
label: "激光关闭",
},
{
value: "1",
label: "常亮模式",
},
{
value: "2",
label: "间隔100ms闪烁模式",
},
{
value: "3",
label: "间隔200ms闪烁模式",
},
{
value: "4",
label: "间隔500ms闪烁模式",
},
{
value: "5",
label: "2次闪烁模式",
},
{
value: "6",
label: "SOS模式",
},
{
value: "7",
label: "自定义模式",
},
],
},
},
{
label: "工作时长(分):",
key: "onWorkStatus",
required: true,
default: 0,
type: "inputNumber",
options: {
min: 0,
max: 999,
},
},
],
formList2: [
{
label: "工作模式:",
key: "controlType",
type: "RadioGroup",
default: "00",
options: {
type: "circle",
options: [
{
key: "00",
label: "常量",
},
{
key: "01",
label: "闪烁",
},
],
},
},
{
label: "线路选择:",
key: "onWorkStatus2",
required: true,
type: "select",
options: {
placeholder: "请选择",
},
},
{
label: "工作时长:",
key: "onWorkStatus",
required: true,
type: "select",
options: {
placeholder: "请选择",
},
},
],
rules: {
onWorkStatus: [
{ required: true, message: "工作时长不能为空", trigger: "blur" },
],
},
};
},
mounted() {
if (!this.isMultiControl)
this.initData();
},
methods: {
async initData() {
//
let result = await this.requestURL("ASKMD");
// if (result.data == 7) {
// this.activeName = "second";
// this.tabClick();
// } else {
this.formData.controlType = result.data + "" || "1";
//
let resultTime = await this.requestURL("ASKTM");
this.formData.onWorkStatus = resultTime.data || 0;
this.activeName = "first";
// }
},
async requestURL(functionId, options = {}) {
let result = await request({
url: `/business/device/functions/${this.deviceId}/${functionId}`,
method: "post",
data: options,
});
if (result.code != 200) return Message.error(result?.msg);
//SETMDASKMDSETTMASKTMSETDFASKDF
return result;
},
async tabClick() {
if (this.activeName == "second") {
if (this.isMultiControl)
this.tableData = this.duan.map(item => {
return {
ds: item,
time: 0,
A: false,
B: false,
C: false,
D: false,
E: false,
F: false,
G: false,
H: false,
}
});
else {
//
let result = await request({
url: `/business/device/properties/latest/${this.deviceId}`,
method: "get",
});
if (result.code != 200) return Message.error(result?.msg);
this.tableData = [];
let tData = [];
result.data.forEach((item) => {
if (item.property == "TM") {
this.onWorkStatus2 = item.value;
} else if (item.property == "MD") {
} else {
let data = JSON.parse(item.formatValue || {});
tData.push({ ...data, ds: item.property });
}
});
tData.sort((a, b) => a.ds.toUpperCase().localeCompare(b.ds.toUpperCase()));
this.tableData = tData;
}
} else {
if (!this.isMultiControl) {
//
let resultTime = await this.requestURL("ASKTM");
this.formData.onWorkStatus = resultTime.data || 0;
this.activeName = "first";
}
}
},
async handleSubmit() {
if (this.isMultiControl && !this.selectItems.length) {
return Message.error("请至少选择一个疲劳唤醒设备!");
}
const selectItems = this.selectItems.map(item => JSON.parse(item));
let devices;
if (this.isMultiControl) devices = selectItems;
else devices = [{
iotDeviceId: this.deviceId,
id: this.productId,
deviceType: 10
}]
if (this.activeName == "first") {
//
this.$refs.FormConfigRef.validate().then(async (formData) => {
//
// await this.requestURL("SETMD", { SET: formData.controlType });
//
// let res = await this.requestURL("SETTM", {
// SET: formData.onWorkStatus,
// });
let res = await batchFunctions({
devices: devices,
functions: [
{ "functionId": "SETMD", "params": { SET: formData.controlType } },//
{
"functionId": "SETTM", "params": { //
SET: formData.onWorkStatus,
}
}
]
});
if (res.code == 200) {
Message.success("设置成功!");
this.$emit("update:value", false);
}
});
} else if (this.activeName == "second") {
//
let rData = [];
this.tableData.forEach((it, index) => {
rData.push({
functionId: "SETDF",
params: {
order: 7,
time: it.time,
numberOfSegments: it.ds || this.duan[index],
A: Number(it.A),
B: Number(it.B),
C: Number(it.C),
D: Number(it.D),
E: Number(it.E),
F: Number(it.F),
G: Number(it.G),
H: Number(it.H),
}
});
});
//
let res = await batchFunctions({
devices: devices,
functions: rData
});
if (res.code == 200) {
Message.success("设置成功!");
this.$emit("update:value", false);
}
//
// let res = await this.requestURL("SETTM", { SET: this.onWorkStatus2 });
// if (res.code == 200) {
// Message.success("");
// this.$emit("update:value", false);
// }
}
},
},
};
</script>
<style lang="scss" scoped></style>

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

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

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

@ -14,13 +14,14 @@
</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 }"></component> :selectItems="data.childType" @update:activeIcon="(val) => { this.activeIcon = val }"
<!-- <div class="footer"> @update:submitting="(val) => { submitting = val }"></component>
<Button @click.native="submitClick"> <div class="footer">
<Button @click.native="submitClick" :loading="submitting">
确认 确认
</Button> </Button>
<Button style="background-color: rgba(0, 179, 204, 0.3)" @click.native="cancelClick"> 取消 </Button> <Button style="background-color: rgba(0, 179, 204, 0.3)" @click.native="cancelClick"> 取消 </Button>
</div> --> </div>
</div> </div>
</ElPopover> </ElPopover>
@ -37,12 +38,14 @@ import { ChildTypes } from "@screen/utils/enum.js"
import { getDeviceList } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"; import { getDeviceList } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js";
import { delay } from "@screen/utils/common"; import { delay } from "@screen/utils/common";
import { initSearch } from "@screen/utils/enum/common.js" import { initSearch } from "@screen/utils/enum/common.js"
import DeviceParams from "@screen/pages/Home/components/Dialogs/SmartDevice/components/DeviceParamsMulti.vue"; import SmartDeviceParams from "@screen/pages/Home/components/Dialogs/SmartDevice/components/DeviceParamsMulti.vue";
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 { DeviceForMap } from "@screen/pages/Home/components/RoadAndEvents/utils/buttonEvent"; import { DeviceForMap } from "@screen/pages/Home/components/RoadAndEvents/utils/buttonEvent";
const componentMap = { "设备箱": "DeviceParams", "语音广播": "BroadcastParam" } //DeviceTopics[deviceType] const componentMap = { "设备箱": "SmartDeviceParams", "语音广播": "BroadcastParam", "疲劳唤醒": "FatigueWakesUpParam" } //DeviceTopics[deviceType]
//"": undefined, "": undefined, "": undefined, "": undefined, //"": undefined, "": undefined, , "": undefined,
const controlMulti = Object.keys(componentMap);//6 const controlMulti = Object.keys(componentMap);//6
const DeviceTopics = {};//6 {key:label} const DeviceTopics = {};//6 {key:label}
@ -72,13 +75,15 @@ export default {
components: { components: {
Button, Button,
Form, Form,
DeviceParams, SmartDeviceParams,
BroadcastParam BroadcastParam,
FatigueWakesUpParam,
}, },
data() { data() {
return { return {
activeIcon: null, activeIcon: null,
data: {}, data: {},
submitting: false,
formList: [ formList: [
{ {
label: "设备类型:", label: "设备类型:",
@ -278,7 +283,7 @@ export default {
}, },
methods: { methods: {
submitClick() { submitClick() {
this.$refs.ControlComponent.handleSubmit() this.$refs.ControlComponent?.handleSubmit();
}, },
cancelClick() { cancelClick() {
this.activeIcon = null; this.activeIcon = null;

Loading…
Cancel
Save