From a1982f1538cabc4c7f9cfeb4b16f65ee5047c271 Mon Sep 17 00:00:00 2001
From: xieyonghong <18010623010@163.com>
Date: Sun, 23 Apr 2023 10:31:17 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BA=A7=E5=93=81?=
=?UTF-8?q?=E7=89=A9=E6=A8=A1=E5=9E=8B=E6=98=A0=E5=B0=84=E6=90=9C=E7=B4=A2?=
=?UTF-8?q?=E5=92=8C=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Product/Detail/MetadataMap/index.vue | 22 +++++++++++++------
1 file changed, 15 insertions(+), 7 deletions(-)
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[]}> => {