refactor: 用例状态过滤

This commit is contained in:
chenjianxing 2021-10-27 20:35:38 +08:00 committed by jianxing
parent 2c540535fa
commit 46b4e2fd5b
4 changed files with 16 additions and 11 deletions

View File

@ -167,6 +167,7 @@ public class TestCaseService {
request.setCustomNum(request.getNum().toString());
}
request.setReviewStatus(TestCaseReviewStatus.Prepare.name());
request.setStatus(TestCaseReviewStatus.Prepare.name());
request.setDemandId(request.getDemandId());
request.setDemandName(request.getDemandName());
request.setCreateUser(SessionUtils.getUserId());

View File

@ -456,3 +456,5 @@ ALTER TABLE `operating_log` ADD INDEX oper_module_index ( `oper_module` );
ALTER TABLE issues ADD platform_id varchar(50) NOT NULL;
UPDATE issues SET platform_id = id WHERE 1;
UPDATE test_case SET status = 'Prepare' WHERE status IS NULL;

View File

@ -146,17 +146,8 @@
</template>
</ms-table-column >
<!-- <ms-table-column-->
<!-- prop="status"-->
<!-- :filters="statusFilters"-->
<!-- :field="item"-->
<!-- :fields-width="fieldsWidth"-->
<!-- min-width="100px"-->
<!-- :label="$t('api_test.definition.api_case_status')">-->
<!-- </ms-table-column>-->
<ms-table-column v-for="field in testCaseTemplate.customFields" :key="field.id"
:filters="field.name === '用例等级' ? priorityFilters : null"
:filters="getCustomFieldFilter(field)"
:field="item"
:fields-width="fieldsWidth"
:label="field.system ? $t(systemFiledMap[field.name]) :field.name"
@ -166,6 +157,9 @@
<span v-if="field.name === '用例等级'">
<priority-table-item :value="getCustomFieldValue(scope.row, field) ? getCustomFieldValue(scope.row, field) : scope.row.priority"/>
</span>
<span v-else-if="field.name === '用例状态'">
{{getCustomFieldValue(scope.row, field) ? getCustomFieldValue(scope.row, field) : scope.row.status}}
</span>
<span v-else>
{{getCustomFieldValue(scope.row, field)}}
</span>
@ -522,6 +516,14 @@ export default {
}
return value;
},
getCustomFieldFilter(field) {
if (field.name === '用例等级') {
return this.priorityFilters;
} else if (field.name === '用例状态') {
return this.statusFilters;
}
return null;
},
checkRedirectEditPage(redirectParam) {
if (redirectParam != null) {
this.$get('test/case/get/' + redirectParam, response => {
@ -601,6 +603,7 @@ export default {
break;
}
this.condition.filters.priority = this.condition.filters['用例等级'];
this.condition.filters.status = this.condition.filters['用例状态'];
if (this.projectId) {
this.condition.projectId = this.projectId;
this.$emit('setCondition', this.condition);

View File

@ -186,7 +186,6 @@ export let CUSTOM_TABLE_HEADER = {
{id: 'createUser', key: '7', label: 'commons.create_user'},
{id: 'createTime', key: '8', label: 'commons.create_time'},
{id: 'desc', key: '9', label: 'test_track.case.case_desc'},
// {id: 'status', key: 'a', label: 'api_test.definition.api_case_status'},
{id: 'projectName', key: 'c', label: 'commons.project'},
{id: 'caseStatus', key: 'd', label: 'commons.status'},
],