feat(测试跟踪): 测试用例批量删除

This commit is contained in:
shiziyuan9527 2020-08-05 11:17:17 +08:00
parent fdc9b1c2fe
commit 9b5523d336
2 changed files with 31 additions and 13 deletions

View File

@ -20,10 +20,6 @@
<el-form-item label="更新后属性值为" prop="value">
<el-select v-model="form.value" style="width: 80%" :filterable="filterable">
<el-option v-for="(option, index) in options" :key="index" :value="option.id" :label="option.name">
<!-- <div v-if="option.email">-->
<!-- <span style="float: left">{{ option.name }}</span>-->
<!-- <span style="float: right;color: #8492a6;">{{ option.email }}</span>-->
<!-- </div>-->
</el-option>
</el-select>
</el-form-item>
@ -110,7 +106,6 @@
this.options = this.methods;
break;
case "maintainer":
this.options = this.maintainers;
break;
default:

View File

@ -196,7 +196,7 @@
}, {
name: '批量移动用例', stop: this.handleClickStop
}, {
name: '批量删除用例', stop: this.handleClickStop
name: '批量删除用例', stop: this.handleDeleteBatch
}
]
}
@ -394,16 +394,39 @@
}
},
batchEdit(form) {
let ids = Array.from(this.selectRows).map(row => row.id);
let sign = false;
let arr = Array.from(this.selectRows);
//
if (form.type === 'method' && form.value === 'auto') {
arr.forEach(row => {
if (row.type === 'functional') {
sign = true;
return;
}
});
}
if (form.type === 'type' && form.value === 'functional') {
arr.forEach(row => {
if (row.method === 'auto') {
sign = true;
return;
}
});
}
let ids = arr.map(row => row.id);
let param = {};
param[form.type] = form.value;
param.ids = ids;
// todo
//
this.$post('/test/case/batch/edit' , param, () => {
this.$success(this.$t('commons.save_success'));
this.refresh();
});
if (!sign) {
this.$post('/test/case/batch/edit' , param, () => {
this.$success(this.$t('commons.save_success'));
this.refresh();
});
} else {
this.$warning("功能测试的测试方式不能设置为自动!");
}
},
filter(filters) {
_filter(filters, this.condition);