From 1a8b1cc1f5be766ba376de54823126d58404449b Mon Sep 17 00:00:00 2001 From: RubyLiu Date: Fri, 1 Dec 2023 16:38:01 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=BC=BA=E9=99=B7=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=AA=97=E5=8F=A3=E5=85=AC=E5=85=B1=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/modules/bug-management/index.ts | 4 + frontend/src/api/requrls/bug-management.ts | 1 + .../pure/ms-export-drawer/index.vue | 278 ++++++++++++++++++ .../pure/ms-export-drawer/locale/en-US.ts | 9 + .../pure/ms-export-drawer/locale/zh-CN.ts | 9 + .../components/pure/ms-export-drawer/types.ts | 13 + frontend/src/views/bug-management/index.vue | 18 +- 7 files changed, 331 insertions(+), 1 deletion(-) create mode 100644 frontend/src/components/pure/ms-export-drawer/index.vue create mode 100644 frontend/src/components/pure/ms-export-drawer/locale/en-US.ts create mode 100644 frontend/src/components/pure/ms-export-drawer/locale/zh-CN.ts create mode 100644 frontend/src/components/pure/ms-export-drawer/types.ts diff --git a/frontend/src/api/modules/bug-management/index.ts b/frontend/src/api/modules/bug-management/index.ts index 66b6699507..acb553528f 100644 --- a/frontend/src/api/modules/bug-management/index.ts +++ b/frontend/src/api/modules/bug-management/index.ts @@ -40,3 +40,7 @@ export function getTemplageOption(params: { projectId: string }) { export function getTemplateById(data: TableQueryParams) { return MSR.get({ url: bugURL.getTemplateUrl, data }); } +// 获取导出字段配置 +export function getExportConfig(projectId: string) { + return MSR.get({ url: `${bugURL.getExportConfigUrl}${projectId}` }); +} diff --git a/frontend/src/api/requrls/bug-management.ts b/frontend/src/api/requrls/bug-management.ts index 5d61bf5370..1e65e37623 100644 --- a/frontend/src/api/requrls/bug-management.ts +++ b/frontend/src/api/requrls/bug-management.ts @@ -6,3 +6,4 @@ export const getDeleteBugUrl = '/bug/delete/'; export const postBatchDeleteBugUrl = '/bug/batch-delete'; export const getTemplateUrl = '/bug/template'; export const getTemplageOption = '/bug/template/option'; +export const getExportConfigUrl = '/bug/export/columns/'; diff --git a/frontend/src/components/pure/ms-export-drawer/index.vue b/frontend/src/components/pure/ms-export-drawer/index.vue new file mode 100644 index 0000000000..08dfee8ade --- /dev/null +++ b/frontend/src/components/pure/ms-export-drawer/index.vue @@ -0,0 +1,278 @@ + + + + + diff --git a/frontend/src/components/pure/ms-export-drawer/locale/en-US.ts b/frontend/src/components/pure/ms-export-drawer/locale/en-US.ts new file mode 100644 index 0000000000..d9197402e3 --- /dev/null +++ b/frontend/src/components/pure/ms-export-drawer/locale/en-US.ts @@ -0,0 +1,9 @@ +export default { + 'ms-export-drawer.couldSelect': 'Could Select', + 'ms-export-drawer.selected': 'Selected', + 'ms-export-drawer.allSelected': 'All Selected', + 'ms-export-drawer.systemFiled': 'System Fields', + 'ms-export-drawer.customFiled': 'Custom Fields', + 'ms-export-drawer.otherFiled': 'Other Fields', + 'ms-export-drawer.otherTip': 'Other fields are system-generated fields and cannot be imported after export', +}; diff --git a/frontend/src/components/pure/ms-export-drawer/locale/zh-CN.ts b/frontend/src/components/pure/ms-export-drawer/locale/zh-CN.ts new file mode 100644 index 0000000000..3bb56d0664 --- /dev/null +++ b/frontend/src/components/pure/ms-export-drawer/locale/zh-CN.ts @@ -0,0 +1,9 @@ +export default { + 'ms-export-drawer.couldSelect': '可选字段', + 'ms-export-drawer.selected': '已选字段', + 'ms-export-drawer.allSelected': '全选', + 'ms-export-drawer.systemFiled': '系统字段', + 'ms-export-drawer.customFiled': '自定义字段', + 'ms-export-drawer.otherFiled': '其他字段', + 'ms-export-drawer.otherTip': '其他字段为系统生成字段, 导出后不支持导入', +}; diff --git a/frontend/src/components/pure/ms-export-drawer/types.ts b/frontend/src/components/pure/ms-export-drawer/types.ts new file mode 100644 index 0000000000..1110bf6c51 --- /dev/null +++ b/frontend/src/components/pure/ms-export-drawer/types.ts @@ -0,0 +1,13 @@ +export interface MsExportDrawerColumns { + [key: string]: string; +} +export interface MsExportDrawerMap { + systemColumns?: MsExportDrawerColumns; + customColumns?: MsExportDrawerColumns; + otherColumns?: MsExportDrawerColumns; +} +export interface MsExportDrawerOption { + text: string; + key: string; + columnType: string; +} diff --git a/frontend/src/views/bug-management/index.vue b/frontend/src/views/bug-management/index.vue index ef79b70c33..23fad6c360 100644 --- a/frontend/src/views/bug-management/index.vue +++ b/frontend/src/views/bug-management/index.vue @@ -5,6 +5,7 @@
{{ t('bugManagement.createBug') }} {{ t('bugManagement.syncBug') }} + {{ t('common.export') }}
@@ -65,6 +66,7 @@ +