fix: bug#11174
This commit is contained in:
parent
d690240184
commit
4611f83841
|
@ -159,6 +159,14 @@ const queryProviders = async () => {
|
|||
// dataSource.value = getTypeList(resp.result)[0].list.filter(
|
||||
// (item) => item.name !== '插件设备接入',
|
||||
// );
|
||||
if (route.query.save) {
|
||||
// 视频中心-设备快速添加产品, 添加接入网关
|
||||
goProviders(
|
||||
dataSource.value
|
||||
.find((f: any) => f.title === '视频类设备接入')
|
||||
?.list?.find((f: any) => f.id === route.query.type),
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -121,7 +121,14 @@ const onFinish = async (values: any) => {
|
|||
id === ':id' ? await save(params) : await update({ ...params, id });
|
||||
if (resp.status === 200) {
|
||||
onlyMessage('操作成功', 'success');
|
||||
history.back();
|
||||
|
||||
if (route.query.save) {
|
||||
// @ts-ignore
|
||||
window?.onSaveSuccess(resp.result);
|
||||
window.close();
|
||||
} else {
|
||||
history.back();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -68,12 +68,17 @@
|
|||
:rules="{ required: true, message: '请选择接入网关' }"
|
||||
>
|
||||
<div class="gateway-box">
|
||||
<div v-if="!gatewayList.length">
|
||||
暂无数据,请先
|
||||
<j-button type="link">
|
||||
添加{{ providerType[props.channel] }} 接入网关
|
||||
</j-button>
|
||||
</div>
|
||||
<j-empty
|
||||
v-if="!gatewayList.length"
|
||||
style="margin-top: 50px"
|
||||
>
|
||||
<template #description>
|
||||
暂无数据,请先
|
||||
<j-button type="link" @click="handleAdd">
|
||||
添加{{ providerType[props.channel] }} 接入网关
|
||||
</j-button>
|
||||
</template>
|
||||
</j-empty>
|
||||
<div
|
||||
class="gateway-item"
|
||||
v-for="(item, index) in gatewayList"
|
||||
|
@ -234,8 +239,8 @@ watch(
|
|||
if (val) {
|
||||
getGatewayList();
|
||||
} else {
|
||||
_selectedRowKeys.value = []
|
||||
extendFormItem.value = []
|
||||
_selectedRowKeys.value = [];
|
||||
extendFormItem.value = [];
|
||||
emit('close');
|
||||
}
|
||||
},
|
||||
|
@ -290,6 +295,19 @@ const handleCancel = () => {
|
|||
_vis.value = false;
|
||||
formRef.value.resetFields();
|
||||
};
|
||||
|
||||
/**
|
||||
* 添加接入网关
|
||||
*/
|
||||
const handleAdd = () => {
|
||||
const tab: any = window.open(
|
||||
`${origin}/#/iot/link/accessConfig/detail/:id?save=true&view=false&type=${props.channel}`,
|
||||
);
|
||||
tab.onSaveSuccess = async (value: string) => {
|
||||
await getGatewayList();
|
||||
handleClick(value);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
Loading…
Reference in New Issue