From b6eeedf18d4caae1c935654372fbd03f2a0f2b97 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Wed, 2 Nov 2022 17:41:26 +0800 Subject: [PATCH] feat(filter): added filters to list pages AB#13 --- package.json | 2 +- src/components/filter/FilterSelect.vue | 20 ++++ src/components/nav/NavActionGroup.vue | 21 ++-- src/components/nav/NavActionItem.vue | 3 +- src/components/nav/NavActions.vue | 13 +-- src/components/user/user.ts | 6 ++ src/i18n/lang/en/views/nodes.ts | 15 +++ src/i18n/lang/en/views/schedules.ts | 20 ++++ src/i18n/lang/en/views/spiders.ts | 2 +- src/i18n/lang/en/views/tasks.ts | 26 +++++ src/i18n/lang/en/views/users.ts | 14 +++ src/i18n/lang/zh/views/nodes.ts | 15 +++ src/i18n/lang/zh/views/schedules.ts | 20 ++++ src/i18n/lang/zh/views/spiders.ts | 2 +- src/i18n/lang/zh/views/tasks.ts | 26 +++++ src/i18n/lang/zh/views/users.ts | 14 +++ .../components/filter/FilterSelect.d.ts | 1 + src/interfaces/i18n/views/nodes.d.ts | 15 +++ src/interfaces/i18n/views/schedules.d.ts | 20 ++++ src/interfaces/i18n/views/tasks.d.ts | 26 +++++ src/interfaces/i18n/views/users.d.ts | 14 +++ src/layouts/content/list/ListLayout.vue | 1 - src/utils/list.ts | 2 +- src/utils/task.ts | 20 +++- src/views/node/list/nodeList.ts | 60 +++++++++++- src/views/project/list/projectList.ts | 26 ++++- src/views/schedule/list/scheduleList.ts | 72 +++++++++++++- src/views/task/list/taskList.ts | 98 ++++++++++++++++--- src/views/token/list/tokenList.ts | 24 ++++- src/views/user/list/userList.ts | 48 ++++++++- 30 files changed, 596 insertions(+), 50 deletions(-) diff --git a/package.json b/package.json index c55af0deb84e1..12c04f32d2ba5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crawlab-ui", - "version": "0.6.0-16", + "version": "0.6.0-17", "private": false, "author": { "name": "Marvin Zhang", diff --git a/src/components/filter/FilterSelect.vue b/src/components/filter/FilterSelect.vue index d0cfe4333be8b..261972cf182a5 100644 --- a/src/components/filter/FilterSelect.vue +++ b/src/components/filter/FilterSelect.vue @@ -4,8 +4,10 @@ {{ label }} , }, @@ -58,10 +64,12 @@ export default defineComponent({ }); const onChange = (value: any) => { + if (value === '') return; emit('change', value); }; const onClear = () => { + internalModelValue.value = undefined; emit('change', undefined); }; @@ -90,4 +98,16 @@ export default defineComponent({ diff --git a/src/components/nav/NavActionGroup.vue b/src/components/nav/NavActionGroup.vue index fc33dca6dc516..17525b7be08af 100644 --- a/src/components/nav/NavActionGroup.vue +++ b/src/components/nav/NavActionGroup.vue @@ -20,21 +20,26 @@ export default defineComponent({ @import "../../styles/variables.scss"; .nav-action-group { - height: auto; + height: fit-content; display: flex; - align-items: center; + align-items: start; box-sizing: border-box; + flex-wrap: wrap; + position: relative; & + .nav-action-group { //padding-left: 10px; margin-left: 10px; + } - .border { - margin-left: -10px; - margin-right: 10px; - border-left: 1px solid $navActionsGroupBorderColor; - height: calc(100% - 20px); - } + .border { + position: absolute; + left: 0; + top: 10px; + margin-left: -10px; + margin-right: 10px; + border-left: 1px solid $navActionsGroupBorderColor; + height: calc(100% - 20px); } } diff --git a/src/components/nav/NavActionItem.vue b/src/components/nav/NavActionItem.vue index a8f463c8266f3..edb89fad98a3a 100644 --- a/src/components/nav/NavActionItem.vue +++ b/src/components/nav/NavActionItem.vue @@ -32,8 +32,9 @@ export default defineComponent({ .nav-action-item { margin: 10px 0; - height: auto; + height: fit-content; display: flex; + flex: 0 0 auto; align-items: center; color: $navActionsItemColor; diff --git a/src/components/nav/NavActions.vue b/src/components/nav/NavActions.vue index 5ca90b6412bb6..e42fadc967371 100644 --- a/src/components/nav/NavActions.vue +++ b/src/components/nav/NavActions.vue @@ -1,9 +1,9 @@