feat(测试计划): 增加取消全部关联按钮
This commit is contained in:
parent
233e4e2ff8
commit
0b5b55e76c
|
@ -19,6 +19,8 @@
|
|||
:content="$t('test_track.plan_view.create_report')" @click="openTestReport"/>
|
||||
<ms-table-button :is-tester-permission="true" v-if="testPlan.reportId" icon="el-icon-document"
|
||||
:content="$t('test_track.plan_view.view_report')" @click="openReport"/>
|
||||
<ms-table-button :is-tester-permission="true" icon="el-icon-document-remove"
|
||||
:content="$t('test_track.plan_view.cancel_all_relevance')" @click="handleDeleteBatch"/>
|
||||
</template>
|
||||
</ms-table-header>
|
||||
</template>
|
||||
|
@ -413,26 +415,47 @@
|
|||
});
|
||||
},
|
||||
handleDeleteBatch() {
|
||||
if (this.tableData.length < 1) {
|
||||
this.$warning(this.$t('test_track.plan_view.no_case_relevance'));
|
||||
return;
|
||||
}
|
||||
this.$alert(this.$t('test_track.plan_view.confirm_cancel_relevance') + " ?", '', {
|
||||
confirmButtonText: this.$t('commons.confirm'),
|
||||
callback: (action) => {
|
||||
if (action === 'confirm') {
|
||||
let ids = Array.from(this.selectRows).map(row => row.id);
|
||||
this.$post('/test/plan/case/batch/delete', {ids: ids}, () => {
|
||||
// this.selectIds.clear();
|
||||
this.selectRows.clear();
|
||||
this.$emit("refresh");
|
||||
this.$success(this.$t('commons.delete_success'));
|
||||
});
|
||||
if (this.selectRows.size > 0) {
|
||||
let ids = Array.from(this.selectRows).map(row => row.id);
|
||||
this._handleBatchDelete(ids);
|
||||
} else {
|
||||
if (this.planId) {
|
||||
this.condition.planId = this.planId;
|
||||
}
|
||||
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
|
||||
this.condition.nodeIds = this.selectNodeIds;
|
||||
}
|
||||
// 根据条件查询计划下所有的关联用例
|
||||
this.$post('/test/plan/case/list/all', this.condition, res => {
|
||||
let data = res.data;
|
||||
let ids = data.map(d => d.id);
|
||||
this._handleBatchDelete(ids);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
_handleBatchDelete(ids) {
|
||||
this.result = this.$post('/test/plan/case/batch/delete', {ids:ids}, () => {
|
||||
this.selectRows.clear();
|
||||
this.$emit("refresh");
|
||||
this.$success(this.$t('test_track.cancel_relevance_success'));
|
||||
});
|
||||
},
|
||||
_handleDelete(testCase) {
|
||||
let testCaseId = testCase.id;
|
||||
this.$post('/test/plan/case/delete/' + testCaseId, {}, () => {
|
||||
this.result = this.$post('/test/plan/case/delete/' + testCaseId, {}, () => {
|
||||
this.$emit("refresh");
|
||||
this.$success(this.$t('commons.delete_success'));
|
||||
this.$success(this.$t('test_track.cancel_relevance_success'));
|
||||
});
|
||||
},
|
||||
handleSelectAll(selection) {
|
||||
|
|
|
@ -798,6 +798,7 @@ export default {
|
|||
plan_view: {
|
||||
plan: "Plan",
|
||||
relevance_test_case: "Relevance case",
|
||||
cancel_all_relevance: "Unlink all",
|
||||
executor: "Executor",
|
||||
execute_result: "Result",
|
||||
pass: "Pass",
|
||||
|
@ -842,7 +843,8 @@ export default {
|
|||
report_template: "Report template",
|
||||
test_detail: "Test detail",
|
||||
failure_case: "Failure case",
|
||||
export_report: "Export Report"
|
||||
export_report: "Export Report",
|
||||
no_case_relevance: "No related use cases",
|
||||
},
|
||||
issue: {
|
||||
issue: "Issue",
|
||||
|
|
|
@ -804,6 +804,7 @@ export default {
|
|||
plan_view: {
|
||||
plan: "计划",
|
||||
relevance_test_case: "关联测试用例",
|
||||
cancel_all_relevance: "取消全部关联",
|
||||
executor: "执行人",
|
||||
execute_result: "执行结果",
|
||||
pass: "通过",
|
||||
|
@ -848,7 +849,8 @@ export default {
|
|||
report_template: "测试报告模版",
|
||||
test_detail: "测试详情",
|
||||
failure_case: "失败用例",
|
||||
export_report: "导出报告"
|
||||
export_report: "导出报告",
|
||||
no_case_relevance: "没有关联用例",
|
||||
},
|
||||
issue: {
|
||||
issue: "缺陷",
|
||||
|
|
|
@ -800,6 +800,7 @@ export default {
|
|||
plan_view: {
|
||||
plan: "計劃",
|
||||
relevance_test_case: "關聯測試用例",
|
||||
cancel_all_relevance: "取消全部關聯",
|
||||
executor: "執行人",
|
||||
execute_result: "執行結果",
|
||||
pass: "通過",
|
||||
|
@ -844,7 +845,8 @@ export default {
|
|||
report_template: "測試報告模版",
|
||||
test_detail: "測試詳情",
|
||||
failure_case: "失敗用例",
|
||||
export_report: "導出報告"
|
||||
export_report: "導出報告",
|
||||
no_case_relevance: "沒有關聯用例",
|
||||
},
|
||||
issue: {
|
||||
issue: "缺陷",
|
||||
|
|
Loading…
Reference in New Issue