fix: 修改物模型导入BUG
This commit is contained in:
parent
6485265e3d
commit
d8bc599164
|
@ -116,14 +116,14 @@ const pagination = {
|
|||
size: 'small',
|
||||
} as TablePaginationConfig
|
||||
const columns = computed(() => MetadataMapping.get(type)!.concat(actions))
|
||||
const items = computed(() => JSON.parse((target === 'product' ? productStore.current?.metadata : instanceStore.current.metadata) || '{}') as MetadataItem[])
|
||||
const items = computed(() => JSON.parse((target === 'product' ? productStore.current?.metadata : instanceStore.current.metadata) || '{}'))
|
||||
const searchValue = ref<string>()
|
||||
const handleSearch = (searchValue: string) => {
|
||||
if (searchValue) {
|
||||
const arr = items.value.filter(item => item.name!.indexOf(searchValue) > -1).sort((a, b) => b?.sortsIndex - a?.sortsIndex)
|
||||
const arr = items.value[type].filter((item: MetadataItem) => item.name!.indexOf(searchValue) > -1).sort((a: MetadataItem, b: MetadataItem) => b?.sortsIndex - a?.sortsIndex)
|
||||
data.value = arr
|
||||
} else {
|
||||
data.value = items.value
|
||||
data.value = items.value[type]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</template>
|
||||
</j-input>
|
||||
</j-form-item>
|
||||
<j-form-item v-bind="validateInfos.import" v-if="formModel.metadataType === 'script'">
|
||||
<j-form-item v-bind="validateInfos.import" v-if="(type === 'device' || formModel.type === 'import') && formModel.metadataType === 'script'">
|
||||
<template #label>
|
||||
<j-space>
|
||||
物模型
|
||||
|
|
Loading…
Reference in New Issue