fix(测试跟踪): 测试计划关联其他项目用例,编辑时自定义字段显示错误

--bug=1018296 --user=陈建星 【测试跟踪】测试计划-执行功能用例-用例字段显示的是其他项目的 https://www.tapd.cn/55049933/s/1274615
This commit is contained in:
chenjianxing 2022-10-24 16:56:42 +08:00 committed by jianxing
parent e01aebb620
commit 7f66632287
4 changed files with 11 additions and 13 deletions

View File

@ -5,7 +5,7 @@
</template>
<script>
import MsMarkDownText from "metersphere-frontend/src/components/MsMarkDownText";
import MsMarkDownText from "./MsMarkDownText";
export default {
name: "FormRichTextItem",
components: {MsMarkDownText},

View File

@ -1,10 +1,10 @@
import {post, get} from "metersphere-frontend/src/plugins/request";
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
export function getTemplate(baseUrl) {
export function getTemplate(baseUrl, projectId) {
return new Promise((resolve) => {
let template = {};
get(baseUrl + getCurrentProjectID())
get(baseUrl + (projectId ? projectId : getCurrentProjectID()))
.then(response => {
template = response.data;
if (template.customFields) {
@ -23,8 +23,8 @@ export function getIssueTemplate() {
return getTemplate('field/template/issue/get/relate/');
}
export function getTestTemplate() {
return getTemplate('field/template/case/get/relate/');
export function getTestTemplate(projectId) {
return getTemplate('field/template/case/get/relate/', projectId);
}
export function updateCustomFieldTemplate(request) {

View File

@ -145,7 +145,6 @@
<script>
import TestPlanTestCaseStatusButton from '../../../common/TestPlanTestCaseStatusButton';
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
import {getUUID, listenGoBack, removeGoBackListener} from "metersphere-frontend/src/utils"
import {hasPermission} from "metersphere-frontend/src/utils/permission";
import TestCaseAttachment from "@/business/case/components/TestCaseAttachment";
@ -231,9 +230,6 @@ export default {
prePageData: Object
},
computed: {
projectId() {
return getCurrentProjectID();
},
systemNameMap() {
return SYSTEM_FIELD_NAME_MAP;
},
@ -456,7 +452,7 @@ export default {
listenGoBack(this.handleClose);
let initFuc = this.getTestCase;
getTestTemplate()
getTestTemplate(testCase.projectId)
.then((template) => {
this.testCaseTemplate = template;
initFuc(testCase.id);

View File

@ -7,7 +7,7 @@
:modal-append-to-body="false"
size="100%"
ref="drawer"
v-loading="result.loading">
v-loading="loading">
<template>
<el-row :gutter="10">
@ -188,7 +188,7 @@ export default {
},
data() {
return {
result: {},
loading: false,
showDialog: false,
testCase: {},
index: 0,
@ -367,8 +367,10 @@ export default {
this.getTestCase(this.testCases[this.index].id);
},
getTestCase(id) {
this.loading = true;
getTestReviewTestCase(id)
.then((response) => {
this.loading = false;
let item = {};
let data = response.data;
Object.assign(item, data);
@ -423,7 +425,7 @@ export default {
}
}
getTestTemplate()
getTestTemplate(testCase.projectId)
.then((response) => {
this.testCaseTemplate = response;
initFuc(testCase.id);