feat(测试跟踪): 已归档的测试计划不可执行

--user=郭雨琦
--bug=1007448
https://www.tapd.cn/55049933/prong/stories/view/1155049933001007448?url_cache_key=from_url_story_list_2a3025da4c2d5d63c2ec0ca99fdfe730&action_entry_type=stories
This commit is contained in:
guoyuqi 2022-05-07 20:02:21 +08:00 committed by 刘瑞斌
parent fc0820fced
commit 3aa76c85fd
16 changed files with 125 additions and 69 deletions

View File

@ -1,5 +1,5 @@
package io.metersphere.commons.constants; package io.metersphere.commons.constants;
public enum TestPlanStatus { public enum TestPlanStatus {
Prepare, Underway, Completed, Finished Prepare, Underway, Completed, Finished,Archived
} }

View File

@ -470,6 +470,10 @@ public class TestPlanService {
statusList.addAll(testPlanScenarioCaseService.getExecResultByPlanId(testPlanId)); statusList.addAll(testPlanScenarioCaseService.getExecResultByPlanId(testPlanId));
statusList.addAll(testPlanLoadCaseService.getStatus(testPlanId)); statusList.addAll(testPlanLoadCaseService.getStatus(testPlanId));
TestPlanWithBLOBs testPlanWithBLOBs = testPlanMapper.selectByPrimaryKey(testPlanId); TestPlanWithBLOBs testPlanWithBLOBs = testPlanMapper.selectByPrimaryKey(testPlanId);
//如果测试计划是已归档状态不处理
if(testPlanWithBLOBs.getStatus().equals(TestPlanStatus.Archived.name())){
return;
}
testPlanWithBLOBs.setId(testPlanId); testPlanWithBLOBs.setId(testPlanId);
if (statusList.size() == 0) { // 原先status不是prepare, 但删除所有关联用例的情况 if (statusList.size() == 0) { // 原先status不是prepare, 但删除所有关联用例的情况
testPlanWithBLOBs.setStatus(TestPlanStatus.Prepare.name()); testPlanWithBLOBs.setStatus(TestPlanStatus.Prepare.name());

View File

@ -521,16 +521,6 @@ export default {
</script> </script>
<style scoped> <style scoped>
.el-table__header-wrapper,.el-table__body-wrapper,.el-table__footer-wrapper{overflow:visible;}
.el-table__body-wrapper{
overflow-x:visible !important;
}
/* 这个是为了解决前面样式覆盖之后伪类带出来的竖线 */
.el-table::after{
position: relative;
}
.batch-popper { .batch-popper {
top: 300px; top: 300px;
color: #1FDD02; color: #1FDD02;

View File

@ -265,9 +265,12 @@
</ms-table-column> </ms-table-column>
</span> </span>
<template v-slot:opt-before="scope"> <template v-slot:opt-before="scope">
<ms-table-operator-button :tip="$t('api_test.run')" icon="el-icon-video-play" class="run-button" <ms-table-operator-button :tip="$t('api_test.run')" icon="el-icon-video-play" :class="[scope.row.status==='Archived'?'disable-run':'run-button']" :disabled="scope.row.status === 'Archived'"
@exec="handleRun(scope.row)" v-permission="['PROJECT_TRACK_PLAN:READ+RUN']" @exec="handleRun(scope.row)" v-permission="['PROJECT_TRACK_PLAN:READ+RUN']"
style="margin-right: 10px;"/> />
<ms-table-operator-button :tip="$t('commons.edit')" icon="el-icon-edit"
@exec="handleEdit(scope.row)" v-permission="['PROJECT_TRACK_PLAN:READ+EDIT']" :disabled="scope.row.status === 'Archived'"
style="margin-right: 10px"/>
</template> </template>
<template v-slot:opt-behind="scope"> <template v-slot:opt-behind="scope">
<el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-if="!scope.row.showFollow"> <el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-if="!scope.row.showFollow">
@ -286,10 +289,10 @@
<el-icon class="el-icon-more"></el-icon> <el-icon class="el-icon-more"></el-icon>
</el-link> </el-link>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="delete" v-permission="['PROJECT_TRACK_PLAN:READ+DELETE']"> <el-dropdown-item command="delete" v-permission="['PROJECT_TRACK_PLAN:READ+DELETE']" :disabled="scope.row.status === 'Archived'" >
{{ $t('commons.delete') }} {{ $t('commons.delete') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item command="schedule_task" v-permission="['PROJECT_TRACK_PLAN:READ+SCHEDULE']"> <el-dropdown-item command="schedule_task" v-permission="['PROJECT_TRACK_PLAN:READ+SCHEDULE']" :disabled="scope.row.status === 'Archived'" >
{{ $t('commons.trigger_mode.schedule') }} {{ $t('commons.trigger_mode.schedule') }}
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
@ -442,12 +445,6 @@ export default {
} }
], ],
simpleOperators: [ simpleOperators: [
{
tip: this.$t('commons.edit'),
icon: "el-icon-edit",
exec: this.handleEdit,
permissions: ['PROJECT_TRACK_PLAN:READ+EDIT']
},
{ {
tip: this.$t('commons.copy'), tip: this.$t('commons.copy'),
icon: "el-icon-copy-document", icon: "el-icon-copy-document",

View File

@ -21,12 +21,12 @@
</ms-test-plan-header-bar> </ms-test-plan-header-bar>
<test-plan-functional v-if="activeIndex === 'functional'" :redirectCharType="redirectCharType" <test-plan-functional v-if="activeIndex === 'functional'" :redirectCharType="redirectCharType"
:clickType="clickType" :plan-id="planId" :version-enable="versionEnable" :clickType="clickType" :plan-id="planId" :version-enable="versionEnable" :plan-status="currentPlan.status"
ref="testPlanFunctional"/> ref="testPlanFunctional"/>
<test-plan-api v-if="activeIndex === 'api'" :redirectCharType="redirectCharType" :clickType="clickType" <test-plan-api v-if="activeIndex === 'api'" :redirectCharType="redirectCharType" :clickType="clickType"
:plan-id="planId" :version-enable="versionEnable"/> :plan-id="planId" :version-enable="versionEnable" :plan-status="currentPlan.status"/>
<test-plan-load v-if="activeIndex === 'load'" :redirectCharType="redirectCharType" :clickType="clickType" <test-plan-load v-if="activeIndex === 'load'" :redirectCharType="redirectCharType" :clickType="clickType"
:plan-id="planId" :version-enable="versionEnable"/> :plan-id="planId" :version-enable="versionEnable" :plan-status="currentPlan.status"/>
<test-plan-report-content class="plan-report" v-if="activeIndex === 'report'" :plan-id="planId" :version-enable="versionEnable"/> <test-plan-report-content class="plan-report" v-if="activeIndex === 'report'" :plan-id="planId" :version-enable="versionEnable"/>
<is-change-confirm <is-change-confirm

View File

@ -9,6 +9,7 @@
@refreshTable="refreshTable" @refreshTable="refreshTable"
@setModuleOptions="setModuleOptions" @setModuleOptions="setModuleOptions"
:plan-id="planId" :plan-id="planId"
:plan-status="planStatus"
:is-read-only="true" :is-read-only="true"
:redirectCharType="redirectCharType" :redirectCharType="redirectCharType"
ref="apiNodeTree"> ref="apiNodeTree">
@ -27,6 +28,7 @@
@setModuleOptions="setModuleOptions" @setModuleOptions="setModuleOptions"
:is-read-only="true" :is-read-only="true"
:plan-id="planId" :plan-id="planId"
:plan-status="planStatus"
ref="scenarioNodeTree"> ref="scenarioNodeTree">
<template v-slot:header> <template v-slot:header>
<div class="model-change-radio"> <div class="model-change-radio">
@ -50,6 +52,7 @@
:version-enable="versionEnable" :version-enable="versionEnable"
:model="'plan'" :model="'plan'"
:plan-id="planId" :plan-id="planId"
:plan-status="planStatus"
:clickType="clickType" :clickType="clickType"
@refresh="refreshTree" @refresh="refreshTree"
@relevanceCase="openTestCaseRelevanceDialog" @relevanceCase="openTestCaseRelevanceDialog"
@ -61,6 +64,7 @@
:trash-enable="trashEnable" :trash-enable="trashEnable"
:version-enable="versionEnable" :version-enable="versionEnable"
:plan-id="planId" :plan-id="planId"
:plan-status="planStatus"
:clickType="clickType" :clickType="clickType"
@refresh="refreshTree" @refresh="refreshTree"
@relevanceCase="openTestCaseRelevanceDialog" @relevanceCase="openTestCaseRelevanceDialog"
@ -128,6 +132,7 @@
'redirectCharType', 'redirectCharType',
'clickType', 'clickType',
'versionEnable', 'versionEnable',
'planStatus'
], ],
mounted() { mounted() {
this.checkRedirectCharType(); this.checkRedirectCharType();

View File

@ -6,6 +6,7 @@
:project-id="getProjectId()" :project-id="getProjectId()"
:condition="condition" :condition="condition"
:plan-id="planId" :plan-id="planId"
:plan-status="planStatus"
@refresh="initTable" @refresh="initTable"
@relevanceCase="$emit('relevanceCase')" @relevanceCase="$emit('relevanceCase')"
@setEnvironment="setEnvironment" @setEnvironment="setEnvironment"
@ -194,7 +195,7 @@ import TestPlanApiCaseResult from "./TestPlanApiCaseResult";
import {TEST_PLAN_API_CASE} from "@/common/js/constants"; import {TEST_PLAN_API_CASE} from "@/common/js/constants";
import { import {
buildBatchParam, buildBatchParam,
checkTableRowIsSelect, deepClone, getCustomTableHeader, getCustomTableWidth, deepClone, getCustomTableHeader, getCustomTableWidth,
} from "@/common/js/tableUtils"; } from "@/common/js/tableUtils";
import HeaderCustom from "@/business/components/common/head/HeaderCustom"; import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate"; import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
@ -250,20 +251,22 @@ export default {
{ {
tip: this.$t('api_test.run'), icon: "el-icon-video-play", tip: this.$t('api_test.run'), icon: "el-icon-video-play",
exec: this.singleRun, exec: this.singleRun,
class: 'run-button', class: this.planStatus==='Archived'?'disable-run':'run-button',
isDisable: this.planStatus==='Archived',
permissions: ['PROJECT_TRACK_PLAN:READ+RUN'] permissions: ['PROJECT_TRACK_PLAN:READ+RUN']
}, },
{ {
tip: this.$t('test_track.plan_view.cancel_relevance'), icon: "el-icon-unlock", tip: this.$t('test_track.plan_view.cancel_relevance'), icon: "el-icon-unlock",
exec: this.handleDelete, exec: this.handleDelete,
type: 'danger', type: 'danger',
isDisable: this.planStatus==='Archived',
permissions: ['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL'] permissions: ['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']
} }
], ],
buttons: [ buttons: [
{name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE']}, {name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch, isDisable: this.planStatus==='Archived', permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE']},
{name: this.$t('api_test.automation.batch_execute'), handleClick: this.handleBatchExecute, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN']}, {name: this.$t('api_test.automation.batch_execute'), handleClick: this.handleBatchExecute, isDisable: this.planStatus==='Archived', permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN']},
{name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT']} {name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit, isDisable: this.planStatus==='Archived', permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT']}
], ],
typeArr: [ typeArr: [
{id: 'projectEnv', name: this.$t('api_test.definition.request.run_env')}, {id: 'projectEnv', name: this.$t('api_test.definition.request.run_env')},
@ -325,6 +328,7 @@ export default {
} }
}, },
planId: String, planId: String,
planStatus: String,
reviewId: String, reviewId: String,
clickType: String, clickType: String,
versionEnable: Boolean, versionEnable: Boolean,

View File

@ -5,6 +5,7 @@
<test-plan-scenario-list-header <test-plan-scenario-list-header
:condition="condition" :condition="condition"
:projectId="projectId" :projectId="projectId"
:plan-status="planStatus"
@refresh="search" @refresh="search"
@relevanceCase="$emit('relevanceCase', 'scenario')"/> @relevanceCase="$emit('relevanceCase', 'scenario')"/>
</template> </template>
@ -251,6 +252,7 @@ export default {
selectNodeIds: Array, selectNodeIds: Array,
reviewId: String, reviewId: String,
planId: String, planId: String,
planStatus: String,
clickType: String, clickType: String,
versionEnable: Boolean, versionEnable: Boolean,
}, },
@ -282,25 +284,27 @@ export default {
{ {
tip: this.$t('api_test.run'), icon: "el-icon-video-play", tip: this.$t('api_test.run'), icon: "el-icon-video-play",
exec: this.execute, exec: this.execute,
class: 'run-button', class: this.planStatus==='Archived'?'disable-run':'run-button',
isDisable: this.planStatus==='Archived',
permissions: ['PROJECT_TRACK_PLAN:READ+RUN'] permissions: ['PROJECT_TRACK_PLAN:READ+RUN']
}, },
{ {
tip: this.$t('test_track.plan_view.cancel_relevance'), icon: "el-icon-unlock", tip: this.$t('test_track.plan_view.cancel_relevance'), icon: "el-icon-unlock",
exec: this.remove, exec: this.remove,
type: 'danger', type: 'danger',
isDisable: this.planStatus==='Archived',
permissions: ['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL'] permissions: ['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']
} }
], ],
buttons: [ buttons: [
{ {
name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE'] name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch, isDisable: this.planStatus==='Archived', permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE']
}, },
{ {
name: this.$t('api_test.automation.batch_execute'), handleClick: this.handleBatchExecute, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN'] name: this.$t('api_test.automation.batch_execute'), handleClick: this.handleBatchExecute, isDisable: this.planStatus==='Archived', permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN']
}, },
{ {
name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT'] name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit, isDisable: this.planStatus==='Archived', permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT']
} }
], ],
typeArr: [ typeArr: [

View File

@ -9,7 +9,7 @@
</template> </template>
<template v-slot:button> <template v-slot:button>
<ms-table-button v-permission="['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']" icon="el-icon-connection" <ms-table-button v-permission="['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']" icon="el-icon-connection"
:content="$t('test_track.plan_view.relevance_test_case')" :content="$t('test_track.plan_view.relevance_test_case')" :disabled="planStatus==='Archived'"
@click="$emit('relevanceCase')"/> @click="$emit('relevanceCase')"/>
</template> </template>
@ -23,7 +23,7 @@ import MsEnvironmentSelect from "../../../../../api/definition/components/case/M
export default { export default {
name: "TestPlanCaseListHeader", name: "TestPlanCaseListHeader",
components: {MsEnvironmentSelect, MsTableButton, MsTableHeader}, components: {MsEnvironmentSelect, MsTableButton, MsTableHeader},
props: ['condition', 'projectId', 'isReadOnly', 'planId'], props: ['condition', 'projectId', 'isReadOnly', 'planId', 'planStatus'],
methods: { methods: {
setEnvironment(data) { setEnvironment(data) {
if (this.planId) { if (this.planId) {

View File

@ -9,7 +9,7 @@
</template> </template>
<template v-slot:button> <template v-slot:button>
<ms-table-button v-permission="['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']" icon="el-icon-connection" <ms-table-button v-permission="['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']" icon="el-icon-connection"
:content="$t('test_track.plan_view.relevance_test_case')" :content="$t('test_track.plan_view.relevance_test_case')" :disabled="planStatus==='Archived'"
@click="$emit('relevanceCase')"/> @click="$emit('relevanceCase')"/>
</template> </template>
@ -26,7 +26,7 @@ export default {
components: { components: {
MsEnvironmentSelect, MsTableButton, MsTableHeader MsEnvironmentSelect, MsTableButton, MsTableHeader
}, },
props: ['condition', 'isReadOnly', 'projectId'], props: ['condition', 'isReadOnly', 'projectId', 'planStatus'],
methods: {} methods: {}
}; };
</script> </script>

View File

@ -13,7 +13,7 @@
:content="$t('test_track.plan_view.my_case')" @click="searchMyTestCase"/> :content="$t('test_track.plan_view.my_case')" @click="searchMyTestCase"/>
<ms-table-button v-permission="['PROJECT_TRACK_CASE:READ']" v-if="showMyTestCase" icon="el-icon-files" <ms-table-button v-permission="['PROJECT_TRACK_CASE:READ']" v-if="showMyTestCase" icon="el-icon-files"
:content="$t('test_track.plan_view.all_case')" @click="searchMyTestCase"/> :content="$t('test_track.plan_view.all_case')" @click="searchMyTestCase"/>
<ms-table-button v-permission="['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']" icon="el-icon-connection" <ms-table-button v-permission="['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']" icon="el-icon-connection" :disabled="planStatus==='Archived'"
:content="$t('test_track.plan_view.relevance_test_case')" :content="$t('test_track.plan_view.relevance_test_case')"
@click="$emit('openTestCaseRelevanceDialog')"/> @click="$emit('openTestCaseRelevanceDialog')"/>
</template> </template>
@ -25,8 +25,8 @@
:data="tableData" :data="tableData"
:condition="condition" :condition="condition"
:total="total" :total="total"
:page-size.sync="pageSize"
:operators="operators" :operators="operators"
:page-size.sync="pageSize"
:screen-height="screenHeight" :screen-height="screenHeight"
:batch-operators="buttons" :batch-operators="buttons"
:fields.sync="fields" :fields.sync="fields"
@ -359,28 +359,6 @@ export default {
executorFilters: [], executorFilters: [],
maintainerFilters: [], maintainerFilters: [],
showMore: false, showMore: false,
buttons: [
{
name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit,
permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT']
},
{
name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch,
permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE']
}
],
operators: [
{
tip: this.$t('commons.edit'), icon: "el-icon-edit",
exec: this.handleEdit,
permissions: ['PROJECT_TRACK_PLAN:READ+RUN']
},
{
tip: this.$t('test_track.plan_view.cancel_relevance'), icon: "el-icon-unlock", type: "danger",
exec: this.handleDelete,
permissions: ['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']
}
],
typeArr: [ typeArr: [
{id: 'status', name: this.$t('test_track.plan_view.execute_result')}, {id: 'status', name: this.$t('test_track.plan_view.execute_result')},
{id: 'executor', name: this.$t('test_track.plan_view.executor')}, {id: 'executor', name: this.$t('test_track.plan_view.executor')},
@ -411,6 +389,9 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
planStatus: {
type: String
},
}, },
computed: { computed: {
editTestPlanTestCaseOrder() { editTestPlanTestCaseOrder() {
@ -419,6 +400,65 @@ export default {
systemFiledMap() { systemFiledMap() {
return SYSTEM_FIELD_NAME_MAP; return SYSTEM_FIELD_NAME_MAP;
}, },
operators(){
if (this.planStatus==='Archived') {
return [
{
tip: this.$t('commons.edit'), icon: "el-icon-edit",
exec: this.handleEdit,
isDisable: true,
permissions: ['PROJECT_TRACK_PLAN:READ+RUN']
},
{
tip: this.$t('test_track.plan_view.cancel_relevance'), icon: "el-icon-unlock", type: "danger",
exec: this.handleDelete,
isDisable: true,
permissions: ['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']
}
]
} else {
return [
{
tip: this.$t('commons.edit'), icon: "el-icon-edit",
exec: this.handleEdit,
permissions: ['PROJECT_TRACK_PLAN:READ+RUN']
},
{
tip: this.$t('test_track.plan_view.cancel_relevance'), icon: "el-icon-unlock", type: "danger",
exec: this.handleDelete,
permissions: ['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']
}
]
}
},
buttons(){
if (this.planStatus==='Archived') {
return [
{
name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit,
isDisable: true,
permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT']
},
{
name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch,
isDisable: true,
permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE']
}
]
} else {
return [
{
name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit,
permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT']
},
{
name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch,
permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE']
}
]
}
} ,
}, },
watch: { watch: {
planId() { planId() {

View File

@ -25,6 +25,7 @@
@refresh="refresh" @refresh="refresh"
@setCondition="setCondition" @setCondition="setCondition"
:plan-id="planId" :plan-id="planId"
:plan-status="planStatus "
:clickType="clickType" :clickType="clickType"
:select-node-ids="selectNodeIds" :select-node-ids="selectNodeIds"
:version-enable="versionEnable" :version-enable="versionEnable"
@ -96,6 +97,7 @@ export default {
'redirectCharType', 'redirectCharType',
'clickType', 'clickType',
'versionEnable', 'versionEnable',
'planStatus'
], ],
mounted() { mounted() {
this.initData(); this.initData();

View File

@ -12,6 +12,7 @@
class="table-list" class="table-list"
@refresh="refresh" @refresh="refresh"
:plan-id="planId" :plan-id="planId"
:plan-status="planStatus"
:clickType="clickType" :clickType="clickType"
:select-project-id="selectProjectId" :select-project-id="selectProjectId"
:select-parent-nodes="selectParentNodes" :select-parent-nodes="selectParentNodes"
@ -58,6 +59,7 @@ export default {
'redirectCharType', 'redirectCharType',
'clickType', 'clickType',
'versionEnable', 'versionEnable',
'planStatus'
], ],
watch: { watch: {
planId() { planId() {

View File

@ -5,6 +5,7 @@
<test-plan-load-case-list-header <test-plan-load-case-list-header
:condition="condition" :condition="condition"
:plan-id="planId" :plan-id="planId"
:plan-status="planStatus"
:isShowVersion="false" :isShowVersion="false"
@refresh="initTable" @refresh="initTable"
@relevanceCase="$emit('relevanceCase')"/> @relevanceCase="$emit('relevanceCase')"/>
@ -187,8 +188,8 @@ export default {
{ {
tip: this.$t('api_test.run'), icon: "el-icon-video-play", tip: this.$t('api_test.run'), icon: "el-icon-video-play",
exec: this.run, exec: this.run,
class: 'run-button', class: (this.planStatus==='Archived' || this.isReadOnly )?'disable-run':'run-button',
isDisable: this.isReadOnly, isDisable: this.isReadOnly || this.planStatus==='Archived',
permissions: ['PROJECT_TRACK_PLAN:READ+RUN'] permissions: ['PROJECT_TRACK_PLAN:READ+RUN']
}, },
{ {
@ -196,22 +197,22 @@ export default {
icon: "el-icon-setting", icon: "el-icon-setting",
exec: this.changeLoadConfig, exec: this.changeLoadConfig,
type: 'success', type: 'success',
isDisable: this.isReadOnly, isDisable: this.isReadOnly || this.planStatus==='Archived',
}, },
{ {
tip: this.$t('test_track.plan_view.cancel_relevance'), icon: "el-icon-unlock", tip: this.$t('test_track.plan_view.cancel_relevance'), icon: "el-icon-unlock",
exec: this.handleDelete, exec: this.handleDelete,
type: 'danger', type: 'danger',
isDisable: this.isReadOnly, isDisable: this.isReadOnly || this.planStatus==='Archived',
permissions: ['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL'] permissions: ['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']
}, },
], ],
buttons: [ buttons: [
{ {
name: this.$t('test_track.plan.load_case.unlink_in_bulk'), handleClick: this.handleDeleteBatch, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE'] name: this.$t('test_track.plan.load_case.unlink_in_bulk'), handleClick: this.handleDeleteBatch, isDisable: this.planStatus==='Archived', permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE']
}, },
{ {
name: this.$t('test_track.plan.load_case.batch_exec_cases'), handleClick: this.handleRunBatch, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN'] name: this.$t('test_track.plan.load_case.batch_exec_cases'), handleClick: this.handleRunBatch, isDisable: this.planStatus==='Archived', permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN']
} }
], ],
statusFilters: [ statusFilters: [
@ -235,6 +236,7 @@ export default {
default: false default: false
}, },
planId: String, planId: String,
planStatus: String,
reviewId: String, reviewId: String,
clickType: String, clickType: String,
versionEnable: Boolean, versionEnable: Boolean,

View File

@ -11,7 +11,7 @@
</template> </template>
<template v-slot:button> <template v-slot:button>
<ms-table-button v-permission="['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']" icon="el-icon-connection" <ms-table-button v-permission="['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']" icon="el-icon-connection"
:content="$t('test_track.plan_view.relevance_test_case')" :content="$t('test_track.plan_view.relevance_test_case')" :disabled="planStatus==='Archived'"
@click="$emit('relevanceCase')"/> @click="$emit('relevanceCase')"/>
</template> </template>
@ -29,7 +29,7 @@ export default {
components: { components: {
MsTableButton, MsTableHeader, 'VersionSelect': VersionSelect.default, MsTableButton, MsTableHeader, 'VersionSelect': VersionSelect.default,
}, },
props: ['condition', 'isShowVersion'], props: ['condition', 'isShowVersion', 'planStatus'],
methods: { methods: {
changeVersion(currentVersion) { changeVersion(currentVersion) {
this.$emit("changeVersion", currentVersion) this.$emit("changeVersion", currentVersion)

View File

@ -297,6 +297,12 @@ textarea {
color: white; color: white;
} }
.disable-run .el-button {
background-color: #409eff91;
border-color: #409eff00;
color: white;
}
.ms-full-loading .el-loading-spinner { .ms-full-loading .el-loading-spinner {
font-size: 16px; font-size: 16px;
} }