测试调整

This commit is contained in:
joylink_zhaoerwei 2023-12-27 09:47:24 +08:00
parent e97a677c3b
commit a0b9e27e71

View File

@ -134,10 +134,8 @@ const setAlartTextData = ref<{
groupId?: string; groupId?: string;
status: string; status: string;
deviceInfos: { deviceInfos: {
groupId?: string;
deviceName: string; deviceName: string;
deviceType: string; deviceType: string;
status: string;
}[]; }[];
expanded: boolean; expanded: boolean;
}[]; }[];
@ -224,16 +222,11 @@ watch(
selectGraphic = Array.from(new Set(selectGraphic)); selectGraphic = Array.from(new Set(selectGraphic));
lineStore.getLineApp().updateSelected(...selectGraphic); lineStore.getLineApp().updateSelected(...selectGraphic);
setAlartTextData.value.groupList[clickIndex].deviceInfos = []; setAlartTextData.value.groupList[clickIndex].deviceInfos = [];
const status = setAlartTextData.value.groupList[clickIndex].status;
const groupId =
setAlartTextData.value.groupList[clickIndex].groupId || '';
selectGraphic.forEach((g) => { selectGraphic.forEach((g) => {
setAlartTextData.value.groupList[clickIndex as number].deviceInfos.push( setAlartTextData.value.groupList[clickIndex as number].deviceInfos.push(
{ {
deviceName: g.code, deviceName: g.code,
deviceType: (DeviceType as never)[g.type + ''], deviceType: (DeviceType as never)[g.type + ''],
status,
groupId,
} }
); );
}); });
@ -262,7 +255,19 @@ async function onSubmit() {
myForm.value?.validate().then(async (res) => { myForm.value?.validate().then(async (res) => {
if (res) { if (res) {
const deviceInfos = setAlartTextData.value.groupList const deviceInfos = setAlartTextData.value.groupList
.map((item) => item.deviceInfos) .map((group) => {
const deviceInfo = group.deviceInfos.map((deviceInfo) => {
const status = group.status;
const groupId = group.groupId || '';
return {
deviceName: deviceInfo.deviceName,
deviceType: deviceInfo.deviceType,
status,
groupId,
};
});
return deviceInfo;
})
.flat(); .flat();
try { try {
const params = { const params = {