From edbbed011b7e24e183e0e40a4cf92a0fd5718f24 Mon Sep 17 00:00:00 2001 From: MeterSphere Bot <78466014+metersphere-bot@users.noreply.github.com> Date: Tue, 18 Oct 2022 15:00:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E7=BC=BA=E9=99=B7=E6=A8=A1=E6=9D=BF=E8=B7=A8=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1018327 --user=宋昌昌 【项目设置】模版管理-所有模版没有跨项目复制功能 https://www.tapd.cn/55049933/s/1265892 Co-authored-by: song-cc-rock --- .../frontend/src/api/template.js | 8 ++ .../frontend/src/business/menu/log/config.js | 1 + .../menu/template/IssueTemplateCopy.vue | 131 ++++++++++++++++++ .../menu/template/IssuesTemplateList.vue | 12 +- 4 files changed, 146 insertions(+), 6 deletions(-) create mode 100644 project-management/frontend/src/business/menu/template/IssueTemplateCopy.vue diff --git a/project-management/frontend/src/api/template.js b/project-management/frontend/src/api/template.js index 72e4def8cd..d41924ef15 100644 --- a/project-management/frontend/src/api/template.js +++ b/project-management/frontend/src/api/template.js @@ -55,3 +55,11 @@ export function deleteApiFieldTemplateById(id) { export function getFieldTemplateApiOption(projectId) { return get(`/field/template/api/option/${projectId}`); } + +export function getIssueTemplateCopyProject(userId, workspaceId) { + return get(`/field/template/issue/get/copy/project/` + userId + `/` + workspaceId); +} + +export function copyIssueTemplate(param) { + return post(`/field/template/issue/copy`, param); +} diff --git a/project-management/frontend/src/business/menu/log/config.js b/project-management/frontend/src/business/menu/log/config.js index 4cda802753..25af7757ba 100644 --- a/project-management/frontend/src/business/menu/log/config.js +++ b/project-management/frontend/src/business/menu/log/config.js @@ -85,6 +85,7 @@ export function LOG_MODULE_MAP(_this) { ['PROJECT_ENVIRONMENT_SETTING', _this.$t('operating_log.project_environment_setting')], ['PROJECT_PROJECT_MANAGER', _this.$t('operating_log.project_project_manager')], ['PROJECT_FILE_MANAGEMENT', _this.$t('operating_log.project_file_management')], + ['PROJECT_TEMPLATE_MANAGEMENT', _this.$t('operating_log.project_template_management')], ['PROJECT_PROJECT_MEMBER', _this.$t('operating_log.project_project_member')], ['PERSONAL_INFORMATION_PERSONAL_SETTINGS', _this.$t('operating_log.personal_information_personal_settings')], ['PERSONAL_INFORMATION_APIKEYS', _this.$t('operating_log.personal_information_apikeys')], diff --git a/project-management/frontend/src/business/menu/template/IssueTemplateCopy.vue b/project-management/frontend/src/business/menu/template/IssueTemplateCopy.vue new file mode 100644 index 0000000000..92ac0aa338 --- /dev/null +++ b/project-management/frontend/src/business/menu/template/IssueTemplateCopy.vue @@ -0,0 +1,131 @@ + + + + + diff --git a/project-management/frontend/src/business/menu/template/IssuesTemplateList.vue b/project-management/frontend/src/business/menu/template/IssuesTemplateList.vue index 7eadf963cd..a412422919 100644 --- a/project-management/frontend/src/business/menu/template/IssuesTemplateList.vue +++ b/project-management/frontend/src/business/menu/template/IssuesTemplateList.vue @@ -75,6 +75,7 @@ :page-size.sync="pageSize" :total="total"/> + @@ -93,11 +94,13 @@ import MsTable from "metersphere-frontend/src/components/table/MsTable"; import IssueTemplateEdit from "./IssueTemplateEdit"; import {deleteIssueFieldTemplateById, getIssueFieldTemplatePages} from "../../../api/template"; import MsDeleteConfirm from "metersphere-frontend/src/components/MsDeleteConfirm"; +import IssueTemplateCopy from "./IssueTemplateCopy"; export default { name: "IssuesTemplateList", components: { IssueTemplateEdit, + IssueTemplateCopy, MsTableHeader, MsTablePagination, MsTableButton, MsTableOperators, MsTableColumn, MsTable , MsDeleteConfirm }, @@ -123,12 +126,10 @@ export default { exec: this.handleEdit }, { tip: this.$t('commons.copy'), icon: "el-icon-copy-document", type: "success", - exec: this.handleCopy, - isDisable: this.systemDisable + exec: this.handleCopy }, { tip: this.$t('commons.delete'), icon: "el-icon-delete", type: "danger", - exec: this.handleDelete, - isDisable: this.systemDisable + exec: this.handleDelete } ], }; @@ -169,8 +170,7 @@ export default { handleCopy(data) { let copyData = {}; Object.assign(copyData, data); - copyData.name = data.name + '_copy'; - this.$refs.templateEdit.open(copyData, true); + this.$refs.templateCopy.open(copyData); }, handleDelete(data) { this.$refs.deleteConfirm.open(data);