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>
</div>
<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">
<!-- TODO 代码编辑器 -->
{{ value }}
</div>
</a-tab-pane>
</a-tabs>
@ -120,25 +121,29 @@ watch(
{ immediate: true }
)
watchEffect(() => {
if (props.visible) {
loading.value = true
const { id } = route.params
if (props.type === 'device') {
detail(id as string).then((resp) => {
loading.value = false
instanceStore.setCurrent(resp.result)
value.value = resp.result.metadata
});
} else {
productDetail(id as string).then((resp) => {
loading.value = false
// productStore.setCurrent(resp.result)
value.value = resp.result.metadata
});
watch(
[props.visible, props.type],
() => {
if (props.visible) {
loading.value = true
const { id } = route.params
if (props.type === 'device') {
detail(id as string).then((resp) => {
loading.value = false
instanceStore.setCurrent(resp.result)
value.value = resp.result.metadata
});
} else {
productDetail(id as string).then((resp) => {
loading.value = false
// productStore.setCurrent(resp.result)
value.value = resp.result.metadata
});
}
}
}
})
},
{ immediate: true }
)
</script>
<style scoped lang="less">
.cat-content {