fix: bug#11174

This commit is contained in:
JiangQiming 2023-03-29 16:02:12 +08:00
parent d690240184
commit 4611f83841
3 changed files with 42 additions and 9 deletions

View File

@ -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),
);
}
}
};

View File

@ -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();
}
}
};

View File

@ -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>