From f880978e9f3d70f51cbd78182581144d06d73e60 Mon Sep 17 00:00:00 2001 From: qianmoQ Date: Tue, 14 Nov 2023 11:02:35 +0800 Subject: [PATCH] [Core] [Metadata] Add filter component --- .../src/i18n/langs/en/source/manager.ts | 1 + .../src/i18n/langs/zhCn/source/manager.ts | 1 + .../src/views/admin/source/SourceManager.vue | 1 + .../source/components/TableColumnFilter.vue | 83 +++++++++++++++++++ .../admin/source/components/TableData.vue | 29 ++++++- 5 files changed, 111 insertions(+), 4 deletions(-) create mode 100644 core/datacap-web/src/views/admin/source/components/TableColumnFilter.vue diff --git a/core/datacap-web/src/i18n/langs/en/source/manager.ts b/core/datacap-web/src/i18n/langs/en/source/manager.ts index e3db7dba..f9f686bc 100644 --- a/core/datacap-web/src/i18n/langs/en/source/manager.ts +++ b/core/datacap-web/src/i18n/langs/en/source/manager.ts @@ -7,4 +7,5 @@ export default { visibleColumn: 'Visible Column', resetAutoIncrement: 'Reset AutoIncrement', resetTo: 'Reset To', + filter: 'Filter' } diff --git a/core/datacap-web/src/i18n/langs/zhCn/source/manager.ts b/core/datacap-web/src/i18n/langs/zhCn/source/manager.ts index 6ea13d83..921a3dd8 100644 --- a/core/datacap-web/src/i18n/langs/zhCn/source/manager.ts +++ b/core/datacap-web/src/i18n/langs/zhCn/source/manager.ts @@ -7,4 +7,5 @@ export default { visibleColumn: '可见列', resetAutoIncrement: '重置自增列', resetTo: '重置为', + filter: '筛选器' } diff --git a/core/datacap-web/src/views/admin/source/SourceManager.vue b/core/datacap-web/src/views/admin/source/SourceManager.vue index 58689f5a..f0032723 100644 --- a/core/datacap-web/src/views/admin/source/SourceManager.vue +++ b/core/datacap-web/src/views/admin/source/SourceManager.vue @@ -74,6 +74,7 @@ diff --git a/core/datacap-web/src/views/admin/source/components/TableColumnFilter.vue b/core/datacap-web/src/views/admin/source/components/TableColumnFilter.vue new file mode 100644 index 00000000..396c3828 --- /dev/null +++ b/core/datacap-web/src/views/admin/source/components/TableColumnFilter.vue @@ -0,0 +1,83 @@ + + diff --git a/core/datacap-web/src/views/admin/source/components/TableData.vue b/core/datacap-web/src/views/admin/source/components/TableData.vue index 777447cb..9699aadf 100644 --- a/core/datacap-web/src/views/admin/source/components/TableData.vue +++ b/core/datacap-web/src/views/admin/source/components/TableData.vue @@ -94,17 +94,26 @@ + + +
-
@@ -181,10 +194,11 @@ import TableCellEditPreview from "@/views/admin/source/components/TableCellEditP import TableRowDeletePreview from "@/views/admin/source/components/TableRowDeletePreview.vue"; import {cloneDeep} from "lodash"; import TableColumn from "@/views/admin/source/components/TableColumn.vue"; +import TableColumnFilter from "@/views/admin/source/components/TableColumnFilter.vue"; export default defineComponent({ name: "TableData", - components: {TableColumn, TableRowDeletePreview, TableCellEditPreview, MarkdownPreview, InputNumber, CircularLoading, AgGridVue}, + components: {TableColumnFilter, TableColumn, TableRowDeletePreview, TableCellEditPreview, MarkdownPreview, InputNumber, CircularLoading, AgGridVue}, props: { id: { type: Number, @@ -231,6 +245,9 @@ export default defineComponent({ visibleColumn: { show: false, columns: [] + }, + filterConfigure: { + show: false } } }, @@ -390,6 +407,10 @@ export default defineComponent({ this.handlerRefererData(configure) } }, + handlerFilterConfigure(show: boolean) + { + this.filterConfigure.show = show; + }, getSortConfigure(configure: TableFilter) { const columnState = this.gridColumnApi.getColumnState();