fix(系统设置): 项目列表分页查询参数设置有误

--bug=1030237 --user=宋昌昌 【系统设置】github#26668,项目管理列表翻页后重置查询状态,列表记录加载不正确 https://www.tapd.cn/55049933/s/1414582
This commit is contained in:
song-cc-rock 2023-09-11 16:48:17 +08:00 committed by 刘瑞斌
parent a2e060bfcd
commit 0148a4a578
1 changed files with 28 additions and 8 deletions

View File

@ -179,7 +179,12 @@ import MsTablePagination from "metersphere-frontend/src/components/pagination/Ta
import MsTableHeader from "metersphere-frontend/src/components/MsTableHeader";
import MsTableOperator from "metersphere-frontend/src/components/MsTableOperator";
import MsDialogFooter from "metersphere-frontend/src/components/MsDialogFooter";
import {removeGoBackListener} from "metersphere-frontend/src/utils";
import {
fullScreenLoading,
operationConfirm,
removeGoBackListener,
stopFullScreenLoading
} from "metersphere-frontend/src/utils";
import {
getCurrentProjectID,
getCurrentUser,
@ -205,11 +210,9 @@ import {
} from "../../../api/user";
import {delProjectById, getProjectPages, modifyProjectMember} from "../../../api/project";
import {getProjectMemberGroup, getUserGroupList} from "../../../api/user-group";
import {operationConfirm} from "metersphere-frontend/src/utils";
import EditProject from "./EditProject";
import ApiEnvironmentConfig from "metersphere-frontend/src/components/environment/ApiEnvironmentConfig";
import {switchProject} from "metersphere-frontend/src/api/project";
import {fullScreenLoading, stopFullScreenLoading} from "metersphere-frontend/src/utils";
export default {
@ -381,6 +384,7 @@ export default {
removeGoBackListener(this.handleClose);
},
search() {
this.currentPage = 1;
this.list();
},
list() {
@ -420,24 +424,40 @@ export default {
// currentRow
this.currentWorkspaceRow = row;
this.currentProjectId = row.id;
this.memberVisible = true;
let param = {
name: '',
projectId: row.id
};
this.memberTableLoading = getProjectMemberPages(this.dialogCurrentPage, this.dialogPageSize, row.workspaceId, param).then(res => {
console.log(111)
let data = res.data;
let {listObject, itemCount} = data;
this.memberLineData = listObject;
this.dialogTotal = itemCount;
//
for (let i = 0; i < this.memberLineData.length; i++) {
getProjectMemberGroup(row.id, encodeURIComponent(this.memberLineData[i].id)).then(res => {
this.$set(this.memberLineData[i], "groups", res.data);
let memberArr = this.memberLineData.filter(item => item.id === getCurrentUserId());
if (memberArr.length === 0) {
isSuperUser(getCurrentUserId()).then(r => {
if (r && r.data) {
//
this.setMemberGroup(row);
this.memberVisible = true;
} else {
this.$warning(this.$t("commons.project_permission"));
}
});
} else {
this.setMemberGroup(row);
this.memberVisible = true;
}
});
},
setMemberGroup(row) {
for (let i = 0; i < this.memberLineData.length; i++) {
getProjectMemberGroup(row.id, encodeURIComponent(this.memberLineData[i].id)).then(res => {
this.$set(this.memberLineData[i], "groups", res.data);
});
}
},
dialogSearch() {
let row = this.currentWorkspaceRow;
this.dialogWsMemberVisible = true;