fix: 修改物模型Cat组件

This commit is contained in:
wangshuaiswim 2023-01-31 11:36:21 +08:00
parent cc07ccb19d
commit 5d88cbc5c8
1 changed files with 24 additions and 19 deletions

View File

@ -16,9 +16,10 @@
</p> </p>
</div> </div>
<a-tabs @change="handleConvertMetadata"> <a-tabs @change="handleConvertMetadata">
<a-tab-pane v-for="item in codecs" :tab-key="item.id" :key="item.id"> <a-tab-pane v-for="item in codecs" :key="item.id" :tab="item.name">
<div class="cat-panel"> <div class="cat-panel">
<!-- TODO 代码编辑器 --> <!-- TODO 代码编辑器 -->
{{ value }}
</div> </div>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
@ -120,25 +121,29 @@ watch(
{ immediate: true } { immediate: true }
) )
watchEffect(() => { watch(
if (props.visible) { [props.visible, props.type],
loading.value = true () => {
const { id } = route.params if (props.visible) {
if (props.type === 'device') { loading.value = true
detail(id as string).then((resp) => { const { id } = route.params
loading.value = false if (props.type === 'device') {
instanceStore.setCurrent(resp.result) detail(id as string).then((resp) => {
value.value = resp.result.metadata loading.value = false
}); instanceStore.setCurrent(resp.result)
} else { value.value = resp.result.metadata
productDetail(id as string).then((resp) => { });
loading.value = false } else {
// productStore.setCurrent(resp.result) productDetail(id as string).then((resp) => {
value.value = resp.result.metadata loading.value = false
}); // productStore.setCurrent(resp.result)
value.value = resp.result.metadata
});
}
} }
} },
}) { immediate: true }
)
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.cat-content { .cat-content {