From f536f1ff6e0b875da32007ae852c51419d66aebb Mon Sep 17 00:00:00 2001 From: teukkk Date: Tue, 3 Sep 2024 20:04:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=AB=98=E7=BA=A7=E6=90=9C=E7=B4=A2-?= =?UTF-8?q?=E8=A7=86=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/modules/user/index.ts | 23 +++ .../components/viewNameInput.vue | 66 +++++++ .../pure/ms-advance-filter/filterDrawer.vue | 181 +++++++++++++----- .../pure/ms-advance-filter/index.vue | 144 +++++++++++++- .../pure/ms-advance-filter/locale/en-US.ts | 52 +++-- .../pure/ms-advance-filter/locale/zh-CN.ts | 9 + .../components/pure/ms-advance-filter/type.ts | 34 ++++ frontend/src/enums/advancedFilterEnum.ts | 4 + .../components/caseTable.vue | 9 +- 9 files changed, 450 insertions(+), 72 deletions(-) create mode 100644 frontend/src/components/pure/ms-advance-filter/components/viewNameInput.vue diff --git a/frontend/src/api/modules/user/index.ts b/frontend/src/api/modules/user/index.ts index 759175c982..2a302db3e7 100644 --- a/frontend/src/api/modules/user/index.ts +++ b/frontend/src/api/modules/user/index.ts @@ -1,3 +1,5 @@ +import type { ViewDetail, ViewList, ViewParams } from '@/components/pure/ms-advance-filter/type'; + import MSR from '@/api/http/index'; import { AddAPIKEYUrl, @@ -240,3 +242,24 @@ export function getPlatformOrgOption() { export function getDefaultLocale() { return MSR.get({ url: GetDefaultLocaleUrl }); } + +// 视图列表 +export function getViewList(viewType: string, scopeId: string) { + return MSR.get({ url: `/user-view/${viewType}/grouped/list`, params: scopeId }); +} +// 视图详情 +export function getViewDetail(viewType: string, id: string) { + return MSR.get({ url: `/user-view/${viewType}/get/${id}` }); +} +// 编辑视图 +export function updateView(viewType: string, data: ViewParams) { + return MSR.post({ url: `/user-view/${viewType}/update`, data }); +} +// 新增视图 +export function addView(viewType: string, data: ViewParams) { + return MSR.post({ url: `/user-view/${viewType}/add`, data }); +} +// 删除视图 +export function deleteView(viewType: string, id: string) { + return MSR.post({ url: `/user-view/${viewType}/delete/${id}` }); +} diff --git a/frontend/src/components/pure/ms-advance-filter/components/viewNameInput.vue b/frontend/src/components/pure/ms-advance-filter/components/viewNameInput.vue new file mode 100644 index 0000000000..ebdf5179a0 --- /dev/null +++ b/frontend/src/components/pure/ms-advance-filter/components/viewNameInput.vue @@ -0,0 +1,66 @@ + + + diff --git a/frontend/src/components/pure/ms-advance-filter/filterDrawer.vue b/frontend/src/components/pure/ms-advance-filter/filterDrawer.vue index fe62036043..659697b63d 100644 --- a/frontend/src/components/pure/ms-advance-filter/filterDrawer.vue +++ b/frontend/src/components/pure/ms-advance-filter/filterDrawer.vue @@ -1,14 +1,12 @@ @@ -203,47 +210,74 @@ diff --git a/frontend/src/components/pure/ms-advance-filter/locale/en-US.ts b/frontend/src/components/pure/ms-advance-filter/locale/en-US.ts index 12b08f786b..13d41fd99a 100644 --- a/frontend/src/components/pure/ms-advance-filter/locale/en-US.ts +++ b/frontend/src/components/pure/ms-advance-filter/locale/en-US.ts @@ -1,33 +1,43 @@ export default { - 'advanceFilter.operator.gt': 'gt', - 'advanceFilter.operator.ge': 'ge', - 'advanceFilter.operator.lt': 'lt', - 'advanceFilter.operator.le': 'le', - 'advanceFilter.operator.equal': 'equal', - 'advanceFilter.operator.notEqual': 'not Equal', - 'advanceFilter.operator.no_check': 'uncheck', - 'advanceFilter.operator.contains': 'contain', - 'advanceFilter.operator.not_contains': 'exclude', - 'advanceFilter.operator.belongTo': 'belong to', - 'advanceFilter.operator.notBelongTo': 'not belong to', - 'advanceFilter.operator.start_with': 'with...start', - 'advanceFilter.operator.end_with': 'with...end', - 'advanceFilter.operator.empty': 'empty', - 'advanceFilter.operator.not_empty': 'not empty', - 'advanceFilter.operator.regexp': 'Regular', - 'advanceFilter.operator.between': 'between', + 'advanceFilter.operator.gt': 'Greater than', + 'advanceFilter.operator.ge': 'Greater than or equal to', + 'advanceFilter.operator.lt': 'Less than', + 'advanceFilter.operator.le': 'Less than or equal to', + 'advanceFilter.operator.equal': 'Equal to', + 'advanceFilter.operator.notEqual': 'Not equal to', + 'advanceFilter.operator.no_check': 'No check', + 'advanceFilter.operator.contains': 'Contain', + 'advanceFilter.operator.not_contains': 'Does not contain', + 'advanceFilter.operator.belongTo': 'Belong to', + 'advanceFilter.operator.notBelongTo': 'Not belong to', + 'advanceFilter.operator.start_with': 'Starts with', + 'advanceFilter.operator.end_with': 'Ends with', + 'advanceFilter.operator.empty': 'Is empty', + 'advanceFilter.operator.not_empty': 'Is not empty', + 'advanceFilter.operator.regexp': 'Regular expression match', + 'advanceFilter.operator.between': 'Between', 'advanceFilter.operator.length.equal': 'Length equal to', 'advanceFilter.operator.length.gt': 'Length greater than', 'advanceFilter.operator.length.ge': 'Length greater than or equal to', - 'advanceFilter.operator.length.lt': 'Less than', + 'advanceFilter.operator.length.lt': 'Length less than', 'advanceFilter.operator.length.le': 'Length less than or equal to', + + 'advanceFilter.view': 'View', + 'advanceFilter.systemView': 'System view', + 'advanceFilter.myView': 'My view', + 'advanceFilter.newView': 'New view', + 'advanceFilter.deleteView': 'Delete view', + 'advanceFilter.clearFilter': 'Clear filter', 'advanceFilter.saveAsView': 'Save as view', 'advanceFilter.viewNamePlaceholder': 'Please enter the view name', 'advanceFilter.meetTheFollowingConditions': 'Meet the following conditions', 'advanceFilter.and': 'And', 'advanceFilter.or': 'Or', 'advanceFilter.inputPlaceholder': 'Separate keywords with spaces', - 'advanceFilter.addCondition': 'Add conditions', - 'advanceFilter.conditionRequired': 'The query condition cannot be empty', - 'advanceFilter.filterContentRequired': 'The filtering content cannot be empty', + 'advanceFilter.addCondition': 'Add condition', + 'advanceFilter.viewNameRequired': 'View name cannot be empty', + 'advanceFilter.viewNameNotRepeat': 'View name cannot be repeated', + 'advanceFilter.conditionRequired': 'Query condition cannot be empty', + 'advanceFilter.filterContentRequired': 'Filter content cannot be empty', + 'advanceFilter.filterTip': 'Filter mode, module filtering can only be operated in the current filter', }; diff --git a/frontend/src/components/pure/ms-advance-filter/locale/zh-CN.ts b/frontend/src/components/pure/ms-advance-filter/locale/zh-CN.ts index f7e735b1ba..275bed78f4 100644 --- a/frontend/src/components/pure/ms-advance-filter/locale/zh-CN.ts +++ b/frontend/src/components/pure/ms-advance-filter/locale/zh-CN.ts @@ -22,6 +22,12 @@ export default { 'advanceFilter.operator.length.lt': '长度小于', 'advanceFilter.operator.length.le': '长度小于等于', + 'advanceFilter.view': '视图', + 'advanceFilter.systemView': '系统视图', + 'advanceFilter.myView': '我的视图', + 'advanceFilter.newView': '新建视图', + 'advanceFilter.deleteView': '删除视图', + 'advanceFilter.clearFilter': '清空筛选', 'advanceFilter.saveAsView': '另存为视图', 'advanceFilter.viewNamePlaceholder': '请输入视图名称', 'advanceFilter.meetTheFollowingConditions': '符合以下条件', @@ -29,6 +35,9 @@ export default { 'advanceFilter.or': '任一', 'advanceFilter.inputPlaceholder': '关键字之间以空格进行分隔', 'advanceFilter.addCondition': '添加条件', + 'advanceFilter.viewNameRequired': '视图名称不能为空', + 'advanceFilter.viewNameNotRepeat': '视图名称不能重复', 'advanceFilter.conditionRequired': '查询条件不能为空', 'advanceFilter.filterContentRequired': '筛选内容不能为空', + 'advanceFilter.filterTip': '筛选模式,模块过滤仅可在当前过滤器中操作', }; diff --git a/frontend/src/components/pure/ms-advance-filter/type.ts b/frontend/src/components/pure/ms-advance-filter/type.ts index 19749545db..86bf2d81b3 100644 --- a/frontend/src/components/pure/ms-advance-filter/type.ts +++ b/frontend/src/components/pure/ms-advance-filter/type.ts @@ -57,3 +57,37 @@ export interface FilterResult { conditions?: ConditionsItem[]; combine?: any; // TODO lmy 此为防报错占位 所有高级筛选都完成后 删除这一行 } + +export interface ViewItem { + id: string; + userId: string; + name: string; + viewType: string; // 视图类型,例如功能用例视图 + internal: boolean; // 是否为内置视图 + scopeId: string; // 视图的应用范围,一般为项目ID + searchMode: string; + pos?: number; // 自定义排序 + createTime?: number; + updateTime?: number; +} +export interface ViewList { + internalViews: ViewItem[]; + customViews: ViewItem[]; +} +export interface ViewParams extends FilterResult { + id?: string; + name: string; + scopeId?: string; +} +export interface ViewDetail extends ViewParams { + userId?: string; + viewType?: string; + internal?: boolean; // 是否为内置视图 + internalViewKey?: string; + createTime?: number; + updateTime?: number; +} + +export interface FilterForm extends ViewDetail { + list: FilterFormItem[]; +} diff --git a/frontend/src/enums/advancedFilterEnum.ts b/frontend/src/enums/advancedFilterEnum.ts index 8cd3e41ae4..f437b3ece9 100644 --- a/frontend/src/enums/advancedFilterEnum.ts +++ b/frontend/src/enums/advancedFilterEnum.ts @@ -27,3 +27,7 @@ export enum FilterType { CASCADER = 'Cascader', JIRAKEY = 'JIRAKEY', } + +export enum ViewTypeEnum { + FUNCTIONAL_CASE = 'functional-case', +} diff --git a/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue b/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue index 44bef0d1b9..48bd0e4da4 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue @@ -4,8 +4,9 @@