From b63365c80186e7e1d9ced1275934ca7816b1dbbd Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 22 Feb 2023 20:26:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=B0=E7=94=A8=E4=BE=8B=E5=BA=93=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E6=98=AF=E5=90=A6=E5=BC=80=E5=90=AF=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1023684 --user=陈建星 【测试跟踪】项目未开启公共用例库开关-用例详情页-点击添加到公共用例库-也能添加成功 https://www.tapd.cn/55049933/s/1341404 --- .../business/case/components/TestCaseEdit.vue | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/test-track/frontend/src/business/case/components/TestCaseEdit.vue b/test-track/frontend/src/business/case/components/TestCaseEdit.vue index 08f01d3d89..0cdcda7b0f 100644 --- a/test-track/frontend/src/business/case/components/TestCaseEdit.vue +++ b/test-track/frontend/src/business/case/components/TestCaseEdit.vue @@ -346,7 +346,12 @@ import { hasTestCaseOtherInfo, testCaseEditFollows, testCaseGetByVersionId, - testCaseDeleteToGc, getTestCaseNodesByCaseFilter, getTestCaseByVersionId, getEditSimpleTestCase, getSimpleTestCase, + testCaseDeleteToGc, + getTestCaseNodesByCaseFilter, + getTestCaseByVersionId, + getEditSimpleTestCase, + getSimpleTestCase, + testCaseBatchEdit, } from "@/api/testCase"; import { @@ -889,12 +894,28 @@ export default { } }, addPublic() { - this.casePublic = true; - this.saveCase(true); + getProjectApplicationConfig('CASE_PUBLIC') + .then(res => { + let data = res.data; + if (data && data.typeValue === 'true') { + this.casePublic = true; + this.saveCase(true); + } else { + this.$warning(this.$t('test_track.case.public_warning'), false); + } + }); }, removePublic() { - this.casePublic = false; - this.saveCase(true); + getProjectApplicationConfig('CASE_PUBLIC') + .then(res => { + let data = res.data; + if (data && data.typeValue === 'true') { + this.casePublic = false; + this.saveCase(true); + } else { + this.$warning(this.$t('test_track.case.public_warning'), false); + } + }); }, handleCommand(e) { this.saveType = e;