fix: 修改子设备绑定
This commit is contained in:
parent
be9cdd8bb4
commit
dabc73b589
|
@ -105,7 +105,7 @@ const handleSearch = async () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
if (_item) {
|
if (_item) {
|
||||||
info.value = _item?.providerName
|
info.value = _item?.providerName || _item?.provider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -194,13 +194,22 @@ const handleOk = () => {
|
||||||
if (instanceStore.current.accessProvider === 'official-edge-gateway') { // 网关设备
|
if (instanceStore.current.accessProvider === 'official-edge-gateway') { // 网关设备
|
||||||
queryDeviceMapping(instanceStore.current.id)
|
queryDeviceMapping(instanceStore.current.id)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const arr = bindDeviceRef.value?._dataSource.filter(item => {
|
const arr = bindDeviceRef.value?._dataSource.filter((item: any) => {
|
||||||
return !res.result?.[0]?.find(val => val.deviceId === item.id) && _selectedRowKeys.value.includes(item.id);
|
return _selectedRowKeys.value.includes(item.id);
|
||||||
}).map(item => {
|
}).map((item: any) => {
|
||||||
return {
|
const _item = res.result?.[0]?.find((val: any) => val.deviceId === item.id)
|
||||||
deviceId: item.id,
|
if(_item){
|
||||||
deviceName: item.name
|
return {
|
||||||
}
|
id: _item.id,
|
||||||
|
deviceId: _item.deviceId,
|
||||||
|
deviceName: _item.deviceName
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return {
|
||||||
|
deviceId: item.id,
|
||||||
|
deviceName: item.name
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
return saveDeviceMapping(instanceStore.current.id, {info: arr})
|
return saveDeviceMapping(instanceStore.current.id, {info: arr})
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|
|
@ -11,7 +11,27 @@
|
||||||
></j-input> </j-form-item
|
></j-input> </j-form-item
|
||||||
></j-col>
|
></j-col>
|
||||||
<j-col :span="12">
|
<j-col :span="12">
|
||||||
<j-form-item label="类型" name="targetType">
|
<j-form-item name="targetType">
|
||||||
|
<template #label>
|
||||||
|
<j-space>
|
||||||
|
类型
|
||||||
|
<j-tooltip>
|
||||||
|
<template #title>
|
||||||
|
<div>产品:以产品维度告警,某产品下的多个设备异常仅发送一条告警。</div>
|
||||||
|
<div>设备:以设备维度告警,任何设备异常即发送一条告警。</div>
|
||||||
|
<div>组织:以组织维度告警,某组织下的多个设备异常仅发送一条告警。</div>
|
||||||
|
<div>其他:以场景联动维度告警,某场景下的多个设备异常仅发送一条告警。</div>
|
||||||
|
</template>
|
||||||
|
<AIcon
|
||||||
|
type="QuestionCircleOutlined"
|
||||||
|
style="
|
||||||
|
color: rgb(136, 136, 136);
|
||||||
|
font-size: 12px;
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</j-tooltip>
|
||||||
|
</j-space>
|
||||||
|
</template>
|
||||||
<j-select
|
<j-select
|
||||||
:options="options"
|
:options="options"
|
||||||
v-model:value="form.targetType"
|
v-model:value="form.targetType"
|
||||||
|
@ -91,13 +111,13 @@ let selectDisable = ref(false);
|
||||||
const alarmConfigurationStore = useAlarmConfigurationStore();
|
const alarmConfigurationStore = useAlarmConfigurationStore();
|
||||||
let { configurationData } = storeToRefs(alarmConfigurationStore);
|
let { configurationData } = storeToRefs(alarmConfigurationStore);
|
||||||
|
|
||||||
const emit = defineEmits(['change'])
|
const emit = defineEmits(['change']);
|
||||||
|
|
||||||
const queryData = () => {
|
const queryData = () => {
|
||||||
if (route.query?.id) {
|
if (route.query?.id) {
|
||||||
detail(route.query?.id).then((res) => {
|
detail(route.query?.id).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
emit('change', res?.result?.targetType)
|
emit('change', res?.result?.targetType);
|
||||||
form.value = res?.result;
|
form.value = res?.result;
|
||||||
// form.level = res?.result?.level;
|
// form.level = res?.result?.level;
|
||||||
// form.name = res?.result?.name;
|
// form.name = res?.result?.name;
|
||||||
|
@ -209,7 +229,7 @@ const handleSave = async () => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
onlyMessage('操作成功,请配置关联的场景联动');
|
onlyMessage('操作成功,请配置关联的场景联动');
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
emit('change', form.value.targetType)
|
emit('change', form.value.targetType);
|
||||||
if (res.result?.id) {
|
if (res.result?.id) {
|
||||||
menuStory.jumpPage(
|
menuStory.jumpPage(
|
||||||
'rule-engine/Alarm/Configuration/Save',
|
'rule-engine/Alarm/Configuration/Save',
|
||||||
|
|
Loading…
Reference in New Issue