|
@@ -423,8 +423,17 @@ const handleOk = () => {
|
|
);
|
|
);
|
|
const dataList = [...monitorAssociationGatewayList.value, ...controlAssociationGatewayList.value];
|
|
const dataList = [...monitorAssociationGatewayList.value, ...controlAssociationGatewayList.value];
|
|
|
|
|
|
- groupingList.value = Array.from(new Set(dataList.map((item) => item.groupName))).map((groupName) => ({ groupName }));
|
|
|
|
-
|
|
|
|
|
|
+ groupingList.value = Array.from(new Set(dataList.map((item) => item.groupName))).map((groupName, index) => ({
|
|
|
|
+ groupName,
|
|
|
|
+ id: index,
|
|
|
|
+ }));
|
|
|
|
+ dataList.forEach((item) => {
|
|
|
|
+ groupingList.value.forEach((i) => {
|
|
|
|
+ if (item.groupName === i.groupName) {
|
|
|
|
+ item.groupId = i.id;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
open.value = false;
|
|
open.value = false;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -513,15 +522,18 @@ const addCustomizationData = () => {
|
|
|
|
|
|
const customizationChange = (value: SelectValue, option: DefaultOptionType, index: number) => {
|
|
const customizationChange = (value: SelectValue, option: DefaultOptionType, index: number) => {
|
|
customizationData.value[index].groupSerialNum = option.serialNum;
|
|
customizationData.value[index].groupSerialNum = option.serialNum;
|
|
|
|
+ customizationData.value[index].paramGroupName = option.groupName;
|
|
customizationData.value[index].paramGroupIdShow = false;
|
|
customizationData.value[index].paramGroupIdShow = false;
|
|
};
|
|
};
|
|
|
|
|
|
const selectGrouping = (value: SelectValue, option: DefaultOptionType, index: number) => {
|
|
const selectGrouping = (value: SelectValue, option: DefaultOptionType, index: number) => {
|
|
if (agreementListKey.value === 'monitoring') {
|
|
if (agreementListKey.value === 'monitoring') {
|
|
monitorAssociationGatewayList.value[index].groupSerialNum = option.serialNum;
|
|
monitorAssociationGatewayList.value[index].groupSerialNum = option.serialNum;
|
|
|
|
+ monitorAssociationGatewayList.value[index].groupName = option.groupName;
|
|
monitorAssociationGatewayList.value[index].groupIdShow = false;
|
|
monitorAssociationGatewayList.value[index].groupIdShow = false;
|
|
} else {
|
|
} else {
|
|
controlAssociationGatewayList.value[index].groupSerialNum = option.serialNum;
|
|
controlAssociationGatewayList.value[index].groupSerialNum = option.serialNum;
|
|
|
|
+ controlAssociationGatewayList.value[index].groupName = option.groupName;
|
|
controlAssociationGatewayList.value[index].groupIdShow = false;
|
|
controlAssociationGatewayList.value[index].groupIdShow = false;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -837,14 +849,14 @@ const groupSettings = () => {
|
|
const addGroupingList = () => {
|
|
const addGroupingList = () => {
|
|
groupingDisplayList.value.push({
|
|
groupingDisplayList.value.push({
|
|
groupName: '',
|
|
groupName: '',
|
|
- serialNum: undefined,
|
|
|
|
|
|
+ id: groupingDisplayList.value.length,
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
-const deleteGroupingList = (index: number, name: string) => {
|
|
|
|
|
|
+const deleteGroupingList = (index: number, id: number) => {
|
|
const dataList = [...monitorAssociationGatewayList.value, ...controlAssociationGatewayList.value];
|
|
const dataList = [...monitorAssociationGatewayList.value, ...controlAssociationGatewayList.value];
|
|
|
|
|
|
- if (dataList.some((item) => item.groupName == name)) {
|
|
|
|
|
|
+ if (dataList.some((item) => item.groupId == id)) {
|
|
return message.warning(t('createDevice.cannotBeDeletedGroupNumber'));
|
|
return message.warning(t('createDevice.cannotBeDeletedGroupNumber'));
|
|
}
|
|
}
|
|
groupingDisplayList.value.splice(index, 1);
|
|
groupingDisplayList.value.splice(index, 1);
|
|
@@ -858,6 +870,24 @@ const handleOk1 = () => {
|
|
return message.warning(t('createDevice.groupNameRepeat'));
|
|
return message.warning(t('createDevice.groupNameRepeat'));
|
|
}
|
|
}
|
|
groupingList.value = groupingDisplayList.value;
|
|
groupingList.value = groupingDisplayList.value;
|
|
|
|
+ const dataList = [...monitorAssociationGatewayList.value, ...controlAssociationGatewayList.value];
|
|
|
|
+
|
|
|
|
+ dataList.forEach((item) => {
|
|
|
|
+ groupingList.value.forEach((i) => {
|
|
|
|
+ if (item.groupId === i.id) {
|
|
|
|
+ item.groupName = i.groupName;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ customizationData.value.forEach((item) => {
|
|
|
|
+ groupingList.value.forEach((i) => {
|
|
|
|
+ if (item.paramGroupId === i.id) {
|
|
|
|
+ item.paramGroupName = i.groupName;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
open1.value = false;
|
|
open1.value = false;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -963,6 +993,13 @@ onMounted(() => {
|
|
handleRequest(async () => {
|
|
handleRequest(async () => {
|
|
serialNumberItem.value = await getAllGatewayList();
|
|
serialNumberItem.value = await getAllGatewayList();
|
|
const { gatewayInfoVos, protocolParamDeviceInfoVos, protocolParamCustomDevVos } = await equipmentDetails(deviceId);
|
|
const { gatewayInfoVos, protocolParamDeviceInfoVos, protocolParamCustomDevVos } = await equipmentDetails(deviceId);
|
|
|
|
+ const dataList = [...protocolParamDeviceInfoVos, ...protocolParamCustomDevVos];
|
|
|
|
+
|
|
|
|
+ groupingList.value = Array.from(new Set(dataList.map((item) => item.groupName))).map((groupName, index) => ({
|
|
|
|
+ groupName,
|
|
|
|
+ id: index,
|
|
|
|
+ }));
|
|
|
|
+
|
|
if (gatewayInfoVos.length) {
|
|
if (gatewayInfoVos.length) {
|
|
gatewayInfoVos.forEach((item) => {
|
|
gatewayInfoVos.forEach((item) => {
|
|
const { snCode, modelName, id, linkName, linkId, gatewayLinkProtocolId } = item;
|
|
const { snCode, modelName, id, linkName, linkId, gatewayLinkProtocolId } = item;
|
|
@@ -989,9 +1026,6 @@ onMounted(() => {
|
|
}
|
|
}
|
|
|
|
|
|
if (protocolParamDeviceInfoVos.length) {
|
|
if (protocolParamDeviceInfoVos.length) {
|
|
- groupingList.value = Array.from(new Set(protocolParamDeviceInfoVos.map((item) => item.groupName))).map(
|
|
|
|
- (groupName) => ({ groupName }),
|
|
|
|
- );
|
|
|
|
protocolParamDeviceInfoVos.forEach((item) => {
|
|
protocolParamDeviceInfoVos.forEach((item) => {
|
|
const {
|
|
const {
|
|
deviceParamCode,
|
|
deviceParamCode,
|
|
@@ -1045,6 +1079,16 @@ onMounted(() => {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ const dataList = [...monitorAssociationGatewayList.value, ...controlAssociationGatewayList.value];
|
|
|
|
+
|
|
|
|
+ dataList.forEach((item) => {
|
|
|
|
+ groupingList.value.forEach((i) => {
|
|
|
|
+ if (item.groupName === i.groupName) {
|
|
|
|
+ item.groupId = i.id;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
if (protocolParamCustomDevVos.length) {
|
|
if (protocolParamCustomDevVos.length) {
|
|
@@ -1070,6 +1114,14 @@ onMounted(() => {
|
|
paramGroupName: groupName,
|
|
paramGroupName: groupName,
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ customizationData.value.forEach((item) => {
|
|
|
|
+ groupingList.value.forEach((i) => {
|
|
|
|
+ if (item.paramGroupName === i.groupName) {
|
|
|
|
+ item.paramGroupId = i.id;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
@@ -1168,12 +1220,12 @@ onMounted(() => {
|
|
<template v-else-if="column.key === 'groupId'">
|
|
<template v-else-if="column.key === 'groupId'">
|
|
<ASelect
|
|
<ASelect
|
|
class="select-width"
|
|
class="select-width"
|
|
- v-model:value="record.groupName"
|
|
|
|
|
|
+ v-model:value="record.groupId"
|
|
@click="record.groupIdShow = true"
|
|
@click="record.groupIdShow = true"
|
|
@blur="record.groupIdShow = false"
|
|
@blur="record.groupIdShow = false"
|
|
:show-arrow="record.groupIdShow ? true : false"
|
|
:show-arrow="record.groupIdShow ? true : false"
|
|
:options="groupingList"
|
|
:options="groupingList"
|
|
- :field-names="{ label: 'groupName', value: 'groupName' }"
|
|
|
|
|
|
+ :field-names="{ label: 'groupName', value: 'id' }"
|
|
@change="(value, option) => selectGrouping(value, option, index)"
|
|
@change="(value, option) => selectGrouping(value, option, index)"
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
@@ -1219,12 +1271,12 @@ onMounted(() => {
|
|
<template v-else-if="column.key === 'groupId'">
|
|
<template v-else-if="column.key === 'groupId'">
|
|
<ASelect
|
|
<ASelect
|
|
class="select-width"
|
|
class="select-width"
|
|
- v-model:value="record.groupName"
|
|
|
|
|
|
+ v-model:value="record.groupId"
|
|
@click="record.groupIdShow = true"
|
|
@click="record.groupIdShow = true"
|
|
@blur="record.groupIdShow = false"
|
|
@blur="record.groupIdShow = false"
|
|
:show-arrow="record.groupIdShow ? true : false"
|
|
:show-arrow="record.groupIdShow ? true : false"
|
|
:options="groupingList"
|
|
:options="groupingList"
|
|
- :field-names="{ label: 'groupName', value: 'groupName' }"
|
|
|
|
|
|
+ :field-names="{ label: 'groupName', value: 'id' }"
|
|
@change="(value, option) => selectGrouping(value, option, index)"
|
|
@change="(value, option) => selectGrouping(value, option, index)"
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
@@ -1314,9 +1366,9 @@ onMounted(() => {
|
|
<template v-else-if="column.key === 'paramGroupId'">
|
|
<template v-else-if="column.key === 'paramGroupId'">
|
|
<ASelect
|
|
<ASelect
|
|
class="select-width"
|
|
class="select-width"
|
|
- v-model:value="record.paramGroupName"
|
|
|
|
|
|
+ v-model:value="record.paramGroupId"
|
|
:options="groupingList"
|
|
:options="groupingList"
|
|
- :field-names="{ label: 'groupName', value: 'groupName' }"
|
|
|
|
|
|
+ :field-names="{ label: 'groupName', value: 'id' }"
|
|
@click="record.paramGroupIdShow = true"
|
|
@click="record.paramGroupIdShow = true"
|
|
@blur="record.paramGroupIdShow = false"
|
|
@blur="record.paramGroupIdShow = false"
|
|
:show-arrow="record.paramGroupIdShow"
|
|
:show-arrow="record.paramGroupIdShow"
|
|
@@ -1529,7 +1581,7 @@ onMounted(() => {
|
|
<AInput v-model:value="record.groupName" />
|
|
<AInput v-model:value="record.groupName" />
|
|
</template>
|
|
</template>
|
|
<template v-else-if="column.key === 'action'">
|
|
<template v-else-if="column.key === 'action'">
|
|
- <SvgIcon @click="deleteGroupingList(index, record.groupName)" class="grouping-delete-svg" name="delete" />
|
|
|
|
|
|
+ <SvgIcon @click="deleteGroupingList(index, record.id)" class="grouping-delete-svg" name="delete" />
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</ATable>
|
|
</ATable>
|