From 413dd322ea4c695a0aa23b9ea9af11b095233fe8 Mon Sep 17 00:00:00 2001 From: Arvin Huang <1095369685@qq.com> Date: Mon, 19 Feb 2024 18:27:44 +0800 Subject: [PATCH] update: 1. added search for table. 2.limiting scale range Signed-off-by: Arvin Huang <1095369685@qq.com> --- resources-front-end/package.json | 2 +- .../src/transform/metric/summary.ts | 5 +- .../src/views/history/table/Table.vue | 4 +- .../packages/fate-ui-component/html/Table.vue | 4 +- .../lib/components/Table/Table.scss | 12 + .../lib/components/Table/Table.vue | 49 +++- .../lib/components/Table/columns/index.vue | 213 +++++++++--------- .../Table/component/SearchInput.vue | 24 ++ .../lib/LineOrBar/options.ts | 2 + resources-front-end/webpack.config.js | 11 +- 10 files changed, 215 insertions(+), 111 deletions(-) create mode 100644 resources-front-end/packages/fate-ui-component/lib/components/Table/component/SearchInput.vue diff --git a/resources-front-end/package.json b/resources-front-end/package.json index 5ba2d8b6..9ac168de 100644 --- a/resources-front-end/package.json +++ b/resources-front-end/package.json @@ -53,7 +53,7 @@ "vue": "^3.3.4" }, "scripts": { - "dev": "lerna run dev --scope=fate-board", + "dev": "lerna run build && lerna run dev --scope=fate-board", "build": "lerna run build" } } diff --git a/resources-front-end/packages/fate-board/src/transform/metric/summary.ts b/resources-front-end/packages/fate-board/src/transform/metric/summary.ts index a1161c4c..ba77b5c8 100644 --- a/resources-front-end/packages/fate-board/src/transform/metric/summary.ts +++ b/resources-front-end/packages/fate-board/src/transform/metric/summary.ts @@ -143,7 +143,10 @@ export default function Summary( }, parameter: ['SummaryMetricSelection.modelValue'], } - : tableData + : tableData, + { + needSearch: true + } ) ); diff --git a/resources-front-end/packages/fate-board/src/views/history/table/Table.vue b/resources-front-end/packages/fate-board/src/views/history/table/Table.vue index 6fc48291..2cd8ec9a 100644 --- a/resources-front-end/packages/fate-board/src/views/history/table/Table.vue +++ b/resources-front-end/packages/fate-board/src/views/history/table/Table.vue @@ -32,7 +32,9 @@ const requesting = ref(true) // table header confgiuration const header = computed(() => { return cols( - (content: string, { $index }: any) => data[$index].notes = content, + (content: string, { $index }: any) => { + data[$index].notes = content + }, () => dataRequest(), () => dataRequest()) }); diff --git a/resources-front-end/packages/fate-ui-component/html/Table.vue b/resources-front-end/packages/fate-ui-component/html/Table.vue index af9528b4..a028bd0e 100644 --- a/resources-front-end/packages/fate-ui-component/html/Table.vue +++ b/resources-front-end/packages/fate-ui-component/html/Table.vue @@ -5,10 +5,12 @@ :data="dataForTable" :current="currentPage" :size="pageSize" + :total="dataForTable.length" :index="true" :row-class-name="rowClassName" :range="range" - :column="true" + :column="false" + :needSearch="true" position="right" @sizeChange="sizeChange" @currentChange="currentChange" diff --git a/resources-front-end/packages/fate-ui-component/lib/components/Table/Table.scss b/resources-front-end/packages/fate-ui-component/lib/components/Table/Table.scss index cc871636..241b2725 100644 --- a/resources-front-end/packages/fate-ui-component/lib/components/Table/Table.scss +++ b/resources-front-end/packages/fate-ui-component/lib/components/Table/Table.scss @@ -7,6 +7,18 @@ align-items: center; justify-content: flex-end; + .fb-table-searching { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 12px; + + .fb-table-pagination-search { + max-width: 240px; + } + } + .fb-table-columns { width: 100%; flex: 1 1 95%; diff --git a/resources-front-end/packages/fate-ui-component/lib/components/Table/Table.vue b/resources-front-end/packages/fate-ui-component/lib/components/Table/Table.vue index 23956247..8887310c 100644 --- a/resources-front-end/packages/fate-ui-component/lib/components/Table/Table.vue +++ b/resources-front-end/packages/fate-ui-component/lib/components/Table/Table.vue @@ -1,6 +1,15 @@