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