diff --git a/src/views/device/Product/Detail/MetadataMap/index.vue b/src/views/device/Product/Detail/MetadataMap/index.vue
index d1a60f75..59ea1ff1 100644
--- a/src/views/device/Product/Detail/MetadataMap/index.vue
+++ b/src/views/device/Product/Detail/MetadataMap/index.vue
@@ -4,6 +4,7 @@
-
+
{{ text }} ({{ record.id }})
@@ -73,6 +74,7 @@ import { getMetadateMapById, metadateMapById } from '@/api/device/instance'
const productStore = useProductStore();
const { current: productDetail } = storeToRefs(productStore)
+const dataSourceCache = ref([])
const dataSource = ref([])
const pluginOptions = ref([])
@@ -94,11 +96,7 @@ const columns = [
{
title: '目标属性',
dataIndex: 'plugin',
- filters: [
- { text: '置顶已映射数据', value: 'already' },
- { text: '置顶未映射数据', value: 'not' },
- ],
- onFilter: tableFilter
+ sorter: tableFilter
}
]
@@ -125,6 +123,16 @@ const getMetadataMapData = () => {
})
}
+const search = (value: string) => {
+ console.log(value)
+ if (value) {
+ dataSource.value = dataSourceCache.value.filter((item: any) => {
+ return !!item.name?.includes(value)
+ })
+ } else {
+ dataSource.value = dataSourceCache.value
+ }
+}
const getDefaultMetadata = async () => {
const metadata = JSON.parse(productDetail.value?.metadata || '{}')
@@ -136,7 +144,6 @@ const getDefaultMetadata = async () => {
const concatProperties = [ ...pluginProperties.map(item => ({ id: item.id, pluginId: item.id})), ...metadataMap]
dataSource.value = properties?.map((item: any, index: number) => {
-
const _m = concatProperties.find(p => p.id === item.id)
return {
index: index + 1,
@@ -146,6 +153,7 @@ const getDefaultMetadata = async () => {
plugin: _m?.pluginId, // 插件物模型id
}
})
+ dataSourceCache.value = dataSource.value
}
const getPluginMetadata = (): Promise<{ properties: any[]}> => {