fix(项目设置): 缺陷系统模板复制名称显示有误

--bug=1025812 --user=宋昌昌 【项目设置】模版管理-缺陷模版-复制模版到当前项目下-名称未增加copy-可复制成功 https://www.tapd.cn/55049933/s/1366700
This commit is contained in:
song-cc-rock 2023-04-25 19:48:59 +08:00 committed by fit2-zhao
parent fff1bae1e6
commit c65163ee09
2 changed files with 8 additions and 14 deletions

View File

@ -360,7 +360,8 @@ public class IssueTemplateService extends TemplateBaseService {
issueTemplateRecord.setUpdateTime(System.currentTimeMillis());
issueTemplateRecord.setCreateUser(SessionUtils.getUserId());
issueTemplateRecord.setProjectId(targetProjectId);
issueTemplateRecord.setGlobal(false);
issueTemplateRecord.setGlobal(Boolean.FALSE);
issueTemplateRecord.setSystem(Boolean.FALSE);
issueTemplateRecords.add(issueTemplateRecord);
// 根据复制模式设置自定义字段
sourceCustomFieldTemplates.forEach(sourceCustomFieldTemplate -> {

View File

@ -23,7 +23,7 @@
node-key="id">
<span slot-scope="{data}">
<span>{{ data.name }}</span>
<span v-if="data.id === copyData.projectId" style="font-size: 12px">{{$t("custom_field.current_project")}}</span>
<span v-if="data.id === getCurrentProjectID()" style="font-size: 12px">{{$t("custom_field.current_project")}}</span>
<span v-if="data.customPermissionFlag == null || !data.customPermissionFlag" style="font-size: 12px; color: red;">{{$t("custom_field.no_custom_fields_permission")}}</span>
</span>
</el-tree>
@ -38,17 +38,8 @@
<script>
import draggable from 'vuedraggable';
import TemplateComponentEditHeader from "@/business/menu/template/ext/TemplateComponentEditHeader";
import MsFormDivider from "metersphere-frontend/src/components/MsFormDivider";
import {ISSUE_PLATFORM_OPTION} from "metersphere-frontend/src/utils/table-constants";
import CustomFieldFormList from "@/business/menu/template/CustomFieldFormList";
import CustomFieldRelateList from "@/business/menu/template/CustomFieldRelateList";
import FieldTemplateEdit from "@/business/menu/template/FieldTemplateEdit";
import FormRIchTextItem from "metersphere-frontend/src/components/FormRichTextItem";
import {LOCAL} from "metersphere-frontend/src/utils/constants";
import {getUUID} from "metersphere-frontend/src/utils";
import {getCurrentUserId, getCurrentWorkspaceId} from "metersphere-frontend/src/utils/token"
import {getCurrentUserId, getCurrentWorkspaceId, getCurrentProjectID} from "metersphere-frontend/src/utils/token"
import {copyIssueTemplate, getIssueTemplateCopyProject} from "@/api/template";
export default {
@ -86,11 +77,10 @@ export default {
}
},
initCopyProjects() {
let issueTemplateId = this.copyData.id;
getIssueTemplateCopyProject(getCurrentUserId(), getCurrentWorkspaceId())
.then((response) => {
this.root = {id: getUUID(), name: response.data.workspaceName, customPermissionFlag: true, children: response.data.projectDTOS};
this.copyProjects.push(this.root)
this.copyProjects.push(this.root);
})
},
confirm() {
@ -108,6 +98,9 @@ export default {
message: this.$t('commons.copy_success'),
});
})
},
getCurrentProjectID() {
return getCurrentProjectID();
}
}
};