refactor(缺陷管理):缺陷列表平台状态列支持筛选和排序

--story=1011291 --user=王旭 缺陷列表平台状态列支持筛选和排序 https://www.tapd.cn/55049933/s/1360758
This commit is contained in:
WangXu10 2023-04-12 16:44:51 +08:00 committed by fit2-zhao
parent 47dcd0d8a3
commit 228d9ef8ba
5 changed files with 83 additions and 8 deletions

View File

@ -876,6 +876,20 @@ export const ID = {
}
}
// 平台状态
export const PLATFORM_STATUS = {
key: "platformStatus",
name: 'MsTableSearchSelect',
label: "平台状态",
operator: {
options: [OPERATORS.IN, OPERATORS.NOT_IN]
},
options: [],
props: {
multiple: true
}
}
function _getModuleTree(options) {
return {
key: "moduleIds",
@ -991,7 +1005,7 @@ export const TEST_CASE_RELEVANCE_LOAD_CASE = [NAME, STATUS, CREATE_TIME, UPDATE_
// 测试跟踪-缺陷管理-缺陷列表
export const TEST_TRACK_ISSUE_LIST = [NAME, PLATFORM, CREATE_TIME, UPDATE_TIME, CREATOR];
export const TEST_TRACK_ISSUE_LIST = [NAME, PLATFORM, CREATE_TIME, UPDATE_TIME, CREATOR,PLATFORM_STATUS];
// 测试跟踪-测试用例-关联缺陷
export const TEST_CASE_RELEVANCE_ISSUE_LIST = [NAME, PLATFORM, CREATE_TIME, CREATOR];

View File

@ -275,6 +275,12 @@
#{value}
</foreach>
</when>
<when test="key=='platform_status'">
and issues.platform_status in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</when>
<when test="key == 'platform'">
AND issues.platform IN
<foreach collection="values" item="value" separator="," open="(" close=")">

View File

@ -1510,8 +1510,7 @@ public class IssuesService {
platformStatusDTO.setLabel(item.getLabel());
platformStatusDTO.setValue(item.getValue());
return platformStatusDTO;
})
.collect(Collectors.toList());
}).collect(Collectors.collectingAndThen(Collectors.toCollection(()->new TreeSet<>(Comparator.comparing(PlatformStatusDTO::getValue))),ArrayList::new));
} else {
List<String> platforms = getPlatforms(project);
if (CollectionUtils.isEmpty(platforms)) {

View File

@ -25,12 +25,7 @@
</div>
</div>
<div slot="content">
<div v-if="page.data.length === 0" class="none-data-tip">
<img src="/assets/module/figma/icon_none.svg" style="height: 100px;width: 100px;margin-bottom: 8px"/>
<span class="none-data-content">{{$t('test_track.issue.list_none_tips')}}</span>
</div>
<ms-table
v-if="page.data.length > 0"
:screen-height="screenHeight"
v-loading="page.loading"
:data="page.data"
@ -75,6 +70,10 @@
:label="field.name"
:prop="field.name"
v-if="field.name === '状态'"
:sortable="true"
type="select"
:filters="item.filters"
:column-key="item.columnKey"
>
<template v-slot="scope">
<span>
@ -89,6 +88,9 @@
:label="$t('test_track.issue.platform_status')"
v-if="isThirdPart"
prop="platformStatus"
:sortable="true"
type="select"
:filters="getPlatformStatusFilte"
>
<template v-slot="scope">
<span v-if="scope.row.platform === 'Tapd'">
@ -209,6 +211,9 @@ export default {
projectId() {
return getCurrentProjectID();
},
getPlatformStatusFilte() {
return this.getPlatformStatusFiltes();
},
},
props: {
caseId: String,
@ -304,6 +309,23 @@ export default {
this.$success(this.$t('commons.relate_success'), false)
});
},
getPlatformStatusFiltes() {
let options = [];
getPlatformStatus({
projectId: getCurrentProjectID(),
workspaceId: getCurrentWorkspaceId()
}).then((r) => {
this.platformStatus = r.data;
if (this.platformStatus) {
this.platformStatus.forEach(item => {
options.push({"text":item.label,"value":item.value,"system": false});
});
return options;
}
return options;
});
return options;
},
},
};
</script>

View File

@ -263,6 +263,8 @@ export default {
platformStatus: {
sortable: true,
minWidth: 110,
type: 'select',
filters: this.getPlatformStatusFiltes(),
},
creatorName: {
columnKey: 'creator',
@ -328,6 +330,14 @@ export default {
this.platformStatus.forEach(item => {
this.platformStatusMap.set(item.value, item.label);
});
this.page.condition.components.forEach(item => {
if (item.key === 'platformStatus') {
item.options =[];
this.platformStatus.forEach(option => {
item.options.push({label: option.label, value: option.value});
});
}
});
}
});
},
@ -364,6 +374,23 @@ export default {
tableDoLayout() {
if (this.$refs.table) this.$refs.table.doLayout();
},
getPlatformStatusFiltes() {
let options = [];
getPlatformStatus({
projectId: getCurrentProjectID(),
workspaceId: getCurrentWorkspaceId()
}).then((r) => {
this.platformStatus = r.data;
if (this.platformStatus) {
this.platformStatus.forEach(item => {
options.push({"text":item.label,"value":item.value,"system": false});
});
return options;
}
return options;
});
return options;
},
getCustomFieldValue(row, field, defaultVal) {
let value = getCustomFieldValue(row, field, this.members);
return value ? value : defaultVal;
@ -388,6 +415,13 @@ export default {
//
let removeField = {id: 'platformStatus', name: 'platformStatus', remove: true};
template.customFields.push(removeField);
for (let i = 0; i < this.page.condition.components.length; i++) {
if (this.page.condition.components[i].key === 'platformStatus') {
this.page.condition.components.splice(i, 1);
break;
}
}
}
this.issueTemplate = template;
fields.forEach(item => {