fix: 修复插件设备映射后没有回显
This commit is contained in:
parent
84e4b790d1
commit
a2bebe1f36
|
@ -43,12 +43,14 @@ const route = useRoute()
|
|||
|
||||
const handleOk = async () => {
|
||||
if (checkKey.value) {
|
||||
loading.value = true
|
||||
const res = await savePluginData(
|
||||
'device',
|
||||
props.accessId!,
|
||||
route.params.id as string,
|
||||
checkKey.value
|
||||
).catch(() => ({ success: false }))
|
||||
loading.value = false
|
||||
if (res.success) {
|
||||
emit('submit', checkKey.value)
|
||||
}
|
||||
|
|
|
@ -145,7 +145,8 @@ const saveInkling = (id: string) => {
|
|||
instanceStore.refresh(instanceStore.current?.id);
|
||||
}
|
||||
channelId.value = id
|
||||
giveAnInkling()
|
||||
queryInkling()
|
||||
inkingVisible.value = false
|
||||
}
|
||||
|
||||
const giveAnInkling = () => {
|
||||
|
|
|
@ -758,7 +758,7 @@ const updateAccessData = async (id: string, values: any) => {
|
|||
submitLoading.value = false
|
||||
}
|
||||
|
||||
if (access.value?.provider === "plugin_gateway") {
|
||||
if (access.value?.provider === "plugin_gateway" && productData.id) {
|
||||
await savePluginData(
|
||||
'product',
|
||||
access.value?.id,
|
||||
|
|
|
@ -133,7 +133,7 @@ const updateAccessData = async (id: string, values: any, metadata: string) => {
|
|||
return
|
||||
}
|
||||
|
||||
if (props.access?.provider === 'plugin_gateway') {
|
||||
if (props.access?.provider === 'plugin_gateway' && props.data.productTypeId) {
|
||||
await savePluginData(
|
||||
'product',
|
||||
props.access.id,
|
||||
|
|
|
@ -101,11 +101,11 @@ const columns = [
|
|||
]
|
||||
|
||||
const selectedKeys = computed(() => {
|
||||
return dataSource.value.filter(item => !!item?.plugin).map(item => item.id)
|
||||
return dataSource.value?.filter(item => !!item?.plugin).map(item => item.id) || []
|
||||
})
|
||||
|
||||
const selectedPluginKeys = computed(() => {
|
||||
return dataSource.value.filter(item => !!item?.plugin).map(item => item.plugin)
|
||||
return dataSource.value?.filter(item => !!item?.plugin).map(item => item.plugin) || []
|
||||
})
|
||||
|
||||
const getMetadataMapData = () => {
|
||||
|
@ -151,7 +151,7 @@ const getDefaultMetadata = async () => {
|
|||
type: item.valueType?.type,
|
||||
plugin: _m?.pluginId, // 插件物模型id
|
||||
}
|
||||
})
|
||||
}) || []
|
||||
dataSourceCache.value = dataSource.value
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue