fix: 修改物模型BUG
This commit is contained in:
parent
93f56a6441
commit
e278ae3ebc
|
@ -196,11 +196,12 @@ const resetMetadata = async () => {
|
|||
// }
|
||||
const { id } = route.params
|
||||
if (target === 'device') {
|
||||
instanceStore.refresh(id as string)
|
||||
await instanceStore.refresh(id as string)
|
||||
} else {
|
||||
productStore.refresh(id as string)
|
||||
await productStore.getDetail(id as string)
|
||||
}
|
||||
metadataStore.set('importMetadata', true)
|
||||
|
||||
};
|
||||
|
||||
const removeItem = async (record: MetadataItem) => {
|
||||
|
|
|
@ -61,12 +61,15 @@ const close = () => {
|
|||
|
||||
const instanceStore = useInstanceStore()
|
||||
const productStore = useProductStore()
|
||||
const metadata = computed(() => {
|
||||
const metadataMap = {
|
||||
product: productStore.current?.metadata as string,
|
||||
device: instanceStore.current?.metadata as string,
|
||||
};
|
||||
const metadata = metadataMap[props.type];
|
||||
const value = ref(metadata)
|
||||
return metadataMap[props.type];
|
||||
})
|
||||
// const metadata = metadataMap[props.type];
|
||||
const value = ref(metadata.value)
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
downloadObject(
|
||||
|
@ -86,14 +89,14 @@ const handleConvertMetadata = (key: Key) => {
|
|||
if (key === 'alink') {
|
||||
value.value = '';
|
||||
if (metadata) {
|
||||
convertMetadata('to', 'alink', JSON.parse(metadata)).then(res => {
|
||||
convertMetadata('to', 'alink', JSON.parse(metadata.value)).then(res => {
|
||||
if (res.status === 200) {
|
||||
value.value = JSON.stringify(res.result)
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
value.value = metadata;
|
||||
value.value = metadata.value;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue