fix(工作台): 修复工作台接口跳转以及缺陷显示问题
--bug=1021848 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001021848 --bug=1021846 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001021846 --bug=1021844 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001021844
This commit is contained in:
parent
9f5f813533
commit
69582997b5
|
@ -1120,7 +1120,7 @@ export default {
|
|||
resource.protocol = 'DUBBO'
|
||||
}
|
||||
let definitionData = this.$router.resolve({
|
||||
path: '/api/definition/'+getUUID()+'/api/edit:'+resource.id+'/'+resource.projectId+'/'+resource.protocol+'/'+workspaceId,
|
||||
path: '/api/definition/default/' + getUUID() + '/api/edit:' + resource.id + '/' + resource.projectId + '/' + resource.protocol + '/' + workspaceId,
|
||||
});
|
||||
if (isTurnSpace) {
|
||||
window.open(definitionData.href, '_blank');
|
||||
|
|
|
@ -607,7 +607,7 @@ export default {
|
|||
edit(row) {
|
||||
let uuid = getUUID();
|
||||
let apiResolve = this.$router.resolve({
|
||||
path: '/api/automation/'+uuid+'/scenario/edit:'+row.id+'/'+row.projectId+'/'+getCurrentWorkspaceId(),
|
||||
path: '/api/automation/default/' + uuid + '/scenario/edit:' + row.id + '/' + row.projectId + '/' + getCurrentWorkspaceId(),
|
||||
});
|
||||
window.open(apiResolve.href, '_blank');
|
||||
},
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<template>
|
||||
<el-card class="table-card">
|
||||
<ms-table
|
||||
:table-is-loading="page.result.loading"
|
||||
v-loading="loading"
|
||||
row-key="id"
|
||||
:data="page.data"
|
||||
:enableSelection="false"
|
||||
:condition="page.condition"
|
||||
|
@ -10,13 +11,16 @@
|
|||
:show-select-all="false"
|
||||
:screen-height="screenHeight"
|
||||
:remember-order="true"
|
||||
@handlePageChange="getIssues"
|
||||
@handleRowClick="handleEdit"
|
||||
:fields.sync="fields"
|
||||
:field-key="tableHeaderKey"
|
||||
@refresh="getIssues"
|
||||
ref="table"
|
||||
>
|
||||
:custom-fields="issueTemplate.customFields"
|
||||
@headChange="handleHeadChange"
|
||||
@handleRowClick="handleEdit"
|
||||
@filter="search"
|
||||
@order="getIssues"
|
||||
@handlePageChange="getIssues"
|
||||
ref="table">
|
||||
|
||||
<ms-table-column
|
||||
v-for="(item) in fields" :key="item.key"
|
||||
:label="item.label"
|
||||
|
@ -88,6 +92,7 @@
|
|||
|
||||
</template>
|
||||
</ms-table-column>
|
||||
|
||||
</ms-table>
|
||||
|
||||
<ms-table-pagination :change="getIssues" :current-page.sync="page.currentPage" :page-size.sync="page.pageSize"
|
||||
|
@ -104,46 +109,94 @@ import MsTablePagination from "metersphere-frontend/src/components/pagination/Ta
|
|||
import {
|
||||
ISSUE_PLATFORM_OPTION,
|
||||
ISSUE_STATUS_MAP,
|
||||
SYSTEM_FIELD_NAME_MAP,
|
||||
TAPD_ISSUE_STATUS_MAP
|
||||
} from "metersphere-frontend/src/utils/table-constants";
|
||||
import MsTableHeader from "metersphere-frontend/src/components/MsTableHeader";
|
||||
import {getDashboardIssues, getIssuePartTemplateWithProject, getIssues, getPlatformOption} from "@/api/issue";
|
||||
|
||||
import {
|
||||
getDashboardIssues,
|
||||
getIssuePartTemplateWithProject,
|
||||
getIssues,
|
||||
getPlatformOption,
|
||||
} from "@/api/issue";
|
||||
import {
|
||||
getCustomFieldValue,
|
||||
getCustomTableWidth,
|
||||
getLastTableSortField,
|
||||
getPageDate,
|
||||
getPageInfo, parseCustomFilesForList
|
||||
getPageInfo, getTableHeaderWithCustomFields, getLastTableSortField, getCustomFieldFilter, parseCustomFilesForList
|
||||
} from "metersphere-frontend/src/utils/tableUtils";
|
||||
import MsContainer from "metersphere-frontend/src/components/MsContainer";
|
||||
import MsMainContainer from "metersphere-frontend/src/components/MsMainContainer";
|
||||
import {getCurrentProjectID, getCurrentWorkspaceId} from "metersphere-frontend/src/utils/token";
|
||||
import {getProjectMember} from "@/api/user";
|
||||
import {getTableHeaderWithCustomFieldsByXpack} from "@/business/component/js/table-head-util";
|
||||
import {getProjectMember, getProjectMemberUserFilter} from "@/api/user";
|
||||
import {LOCAL} from "metersphere-frontend/src/utils/constants";
|
||||
import {TEST_TRACK_ISSUE_LIST} from "metersphere-frontend/src/components/search/search-components";
|
||||
import {
|
||||
getAdvSearchCustomField
|
||||
} from "metersphere-frontend/src/components/search/custom-component";
|
||||
import MsMarkDownText from "metersphere-frontend/src/components/MsMarkDownText";
|
||||
import MsReviewTableItem from "@/business/component/MsReviewTableItem";
|
||||
import {getUUID} from "metersphere-frontend/src/utils";
|
||||
import IssueDescriptionTableItem from "@/business/component/IssueDescriptionTableItem";
|
||||
|
||||
export default {
|
||||
name: "IssueTableList",
|
||||
name: "IssueList",
|
||||
components: {
|
||||
MsMainContainer,
|
||||
MsReviewTableItem,
|
||||
MsMarkDownText,
|
||||
MsMainContainer,
|
||||
MsContainer,
|
||||
IssueDescriptionTableItem,
|
||||
MsTableHeader,
|
||||
MsTablePagination, MsTableButton, MsTableOperators, MsTableColumn, MsTable
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
page: getPageInfo(),
|
||||
page: getPageInfo({
|
||||
components: TEST_TRACK_ISSUE_LIST,
|
||||
custom: false,
|
||||
}),
|
||||
fields: [],
|
||||
customFields: [], // 通过表头过滤后的自定义字段列表
|
||||
tableHeaderKey: "ISSUE_LIST",
|
||||
fieldsWidth: getCustomTableWidth('ISSUE_LIST'),
|
||||
issueTemplate: {},
|
||||
members: [],
|
||||
userFilter: [],
|
||||
isThirdPart: false,
|
||||
creatorFilters: [],
|
||||
loading: false,
|
||||
dataSelectRange: "",
|
||||
platformOptions: [],
|
||||
platformStatus: [],
|
||||
platformStatusMap: new Map(),
|
||||
hasLicense: false,
|
||||
columns: {
|
||||
num: {
|
||||
sortable: true,
|
||||
minWidth: 100
|
||||
},
|
||||
title: {
|
||||
sortable: true,
|
||||
minWidth: 120,
|
||||
},
|
||||
platform: {
|
||||
minWidth: 80,
|
||||
filters: this.platformFilters
|
||||
},
|
||||
platformStatus: {
|
||||
minWidth: 110,
|
||||
},
|
||||
creatorName: {
|
||||
columnKey: 'creator',
|
||||
minWidth: 100,
|
||||
filters: this.creatorFilters
|
||||
},
|
||||
resourceName: {},
|
||||
createTime: {
|
||||
sortable: true,
|
||||
minWidth: 180
|
||||
},
|
||||
caseCount: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
activated() {
|
||||
|
@ -192,48 +245,87 @@ export default {
|
|||
tapdIssueStatusMap() {
|
||||
return TAPD_ISSUE_STATUS_MAP;
|
||||
},
|
||||
systemNameMap() {
|
||||
return SYSTEM_FIELD_NAME_MAP;
|
||||
},
|
||||
projectId() {
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
|
||||
workspaceId() {
|
||||
return getCurrentWorkspaceId();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getMaintainerOptions();
|
||||
this.page.result.loading = true;
|
||||
this.$nextTick(() => {
|
||||
getProjectMember((data) => {
|
||||
this.members = data;
|
||||
});
|
||||
getIssuePartTemplateWithProject((template) => {
|
||||
this.initFields(template);
|
||||
this.page.result.loading = false;
|
||||
});
|
||||
this.getIssues();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getCustomFieldValue(row, field) {
|
||||
getCustomFieldValue(row, field, defaultVal) {
|
||||
let value = getCustomFieldValue(row, field, this.members);
|
||||
if (!value) {
|
||||
if (field.name === '处理人') {
|
||||
return row.maintainerName;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
return value ? value : defaultVal;
|
||||
},
|
||||
getCustomFieldFilter(field) {
|
||||
return getCustomFieldFilter(field, this.userFilter);
|
||||
},
|
||||
initFields(template) {
|
||||
this.issueTemplate = template;
|
||||
if (this.issueTemplate.platform === LOCAL) {
|
||||
if (template.platform === LOCAL) {
|
||||
this.isThirdPart = false;
|
||||
} else {
|
||||
this.isThirdPart = true;
|
||||
}
|
||||
this.fields = getTableHeaderWithCustomFieldsByXpack('ISSUE_LIST_HEAD', this.issueTemplate.customFields);
|
||||
let fields = getTableHeaderWithCustomFields('ISSUE_LIST', template.customFields, this.members);
|
||||
if (!this.isThirdPart) {
|
||||
for (let i = 0; i < this.fields.length; i++) {
|
||||
if (this.fields[i].id === 'platformStatus') {
|
||||
this.fields.splice(i, 1);
|
||||
for (let i = 0; i < fields.length; i++) {
|
||||
if (fields[i].id === 'platformStatus') {
|
||||
fields.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 如果不是三方平台则移除备选字段中的平台状态
|
||||
let removeField = {id: 'platformStatus', name: 'platformStatus', remove: true};
|
||||
this.issueTemplate.customFields.push(removeField);
|
||||
template.customFields.push(removeField);
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.issueTemplate = template;
|
||||
fields.forEach(item => {
|
||||
if (this.columns[item.id]) {
|
||||
Object.assign(item, this.columns[item.id]);
|
||||
if (this.columns[item.id].filters) {
|
||||
item.filters = this.columns[item.id].filters;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.fields = fields;
|
||||
|
||||
// 过滤自定义字段
|
||||
this.page.condition.components = this.page.condition.components.filter(item => item.custom !== true);
|
||||
let comp = getAdvSearchCustomField(this.page.condition, template.customFields);
|
||||
this.page.condition.components.push(...comp);
|
||||
|
||||
this.initCustomFieldValue();
|
||||
|
||||
if (this.$refs.table) {
|
||||
this.$refs.table.reloadTable();
|
||||
}
|
||||
});
|
||||
},
|
||||
search() {
|
||||
// 添加搜索条件时,当前页设置成第一页
|
||||
this.page.currentPage = 1;
|
||||
this.getIssues();
|
||||
},
|
||||
handleHeadChange() {
|
||||
this.initFields(this.issueTemplate);
|
||||
},
|
||||
handleEdit(resource) {
|
||||
let issueData = this.$router.resolve({path: '/track/issue', query: {id: resource.id}});
|
||||
window.open(issueData.href, '_blank');
|
||||
},
|
||||
getIssues() {
|
||||
if (this.isSelectAll === false) {
|
||||
|
@ -313,24 +405,11 @@ export default {
|
|||
});
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
handleEdit(resource) {
|
||||
let issueData = this.$router.resolve({path: '/track/issue', query: {id: resource.id}});
|
||||
window.open(issueData.href, '_blank');
|
||||
getMaintainerOptions() {
|
||||
getProjectMemberUserFilter((data) => {
|
||||
this.creatorFilters = data;
|
||||
});
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.page.result.loading = true;
|
||||
this.$nextTick(() => {
|
||||
getProjectMember((data) => {
|
||||
this.members = data;
|
||||
});
|
||||
getIssuePartTemplateWithProject((template) => {
|
||||
this.initFields(template);
|
||||
this.page.result.loading = false;
|
||||
});
|
||||
this.getIssues();
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
width="80"
|
||||
show-overflow-tooltip>
|
||||
<template v-slot:default="scope">
|
||||
<span @click="link(scope.row)" style="cursor: pointer;">{{ scope.row.name }}</span>
|
||||
<span @click="link(scope.row)" style="cursor: pointer;">{{ scope.row.num }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
|
Loading…
Reference in New Issue