fix: 过滤项目待选列表
This commit is contained in:
parent
d52a95cae1
commit
9966905c84
|
@ -14,7 +14,7 @@ public interface ExtProjectMapper {
|
||||||
|
|
||||||
int removeIssuePlatform(@Param("platform") String platform, @Param("orgId") String orgId);
|
int removeIssuePlatform(@Param("platform") String platform, @Param("orgId") String orgId);
|
||||||
|
|
||||||
List<ProjectDTO> getSwitchProject(@Param("proRequest") ProjectRequest request);
|
List<ProjectDTO> getUserProject(@Param("proRequest") ProjectRequest request);
|
||||||
|
|
||||||
String getSystemIdByProjectId(String projectId);
|
String getSystemIdByProjectId(String projectId);
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@
|
||||||
from project
|
from project
|
||||||
where workspace_id = #{workspaceId}
|
where workspace_id = #{workspaceId}
|
||||||
</select>
|
</select>
|
||||||
<select id="getSwitchProject" resultType="io.metersphere.dto.ProjectDTO">
|
<select id="getUserProject" resultType="io.metersphere.dto.ProjectDTO">
|
||||||
select distinct p.* from `group` g join user_group ug on g.id = ug.group_id
|
select distinct p.* from `group` g join user_group ug on g.id = ug.group_id
|
||||||
join project p on p.id = ug.source_id
|
join project p on p.id = ug.source_id
|
||||||
<where>
|
<where>
|
||||||
|
|
|
@ -88,15 +88,14 @@ public class ProjectController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 切换项目
|
* 在工作空间下与用户有关的项目
|
||||||
*
|
* @param request userId
|
||||||
* @param request
|
* @return List<ProjectDTO>
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
@PostMapping("/list/related")
|
@PostMapping("/list/related")
|
||||||
public List<ProjectDTO> getSwitchProject(@RequestBody ProjectRequest request) {
|
public List<ProjectDTO> getUserProject(@RequestBody ProjectRequest request) {
|
||||||
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||||
return projectService.getSwitchProject(request);
|
return projectService.getUserProject(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -135,12 +135,12 @@ public class ProjectService {
|
||||||
return extProjectMapper.getProjectWithWorkspace(request);
|
return extProjectMapper.getProjectWithWorkspace(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ProjectDTO> getSwitchProject(ProjectRequest request) {
|
public List<ProjectDTO> getUserProject(ProjectRequest request) {
|
||||||
if (StringUtils.isNotBlank(request.getName())) {
|
if (StringUtils.isNotBlank(request.getName())) {
|
||||||
request.setName(StringUtils.wrapIfMissing(request.getName(), "%"));
|
request.setName(StringUtils.wrapIfMissing(request.getName(), "%"));
|
||||||
}
|
}
|
||||||
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
|
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
|
||||||
return extProjectMapper.getSwitchProject(request);
|
return extProjectMapper.getUserProject(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Project> getProjectByIds(List<String> ids) {
|
public List<Project> getProjectByIds(List<String> ids) {
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
import MsDialogFooter from '../../../../../common/components/MsDialogFooter'
|
import MsDialogFooter from '../../../../../common/components/MsDialogFooter'
|
||||||
import SelectMenu from "../../../../common/SelectMenu";
|
import SelectMenu from "../../../../common/SelectMenu";
|
||||||
import RelevanceDialog from "./RelevanceDialog";
|
import RelevanceDialog from "./RelevanceDialog";
|
||||||
import {getCurrentProjectID} from "@/common/js/utils";
|
import {getCurrentProjectID, getCurrentUserId} from "@/common/js/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestCaseRelevanceBase",
|
name: "TestCaseRelevanceBase",
|
||||||
|
@ -91,7 +91,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
getProject() {
|
getProject() {
|
||||||
this.result = this.$get("/project/listAll", res => {
|
this.result = this.$post("/project/list/related", {userId: getCurrentUserId()}, res => {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
const index = data.findIndex(d => d.id === getCurrentProjectID());
|
const index = data.findIndex(d => d.id === getCurrentProjectID());
|
||||||
|
|
|
@ -108,7 +108,7 @@ import ReviewStatus from "@/business/components/track/case/components/ReviewStat
|
||||||
import elTableInfiniteScroll from 'el-table-infinite-scroll';
|
import elTableInfiniteScroll from 'el-table-infinite-scroll';
|
||||||
import SelectMenu from "../../../common/SelectMenu";
|
import SelectMenu from "../../../common/SelectMenu";
|
||||||
import {_filter} from "@/common/js/tableUtils";
|
import {_filter} from "@/common/js/tableUtils";
|
||||||
import {getCurrentProjectID} from "@/common/js/utils";
|
import {getCurrentProjectID, getCurrentUserId} from "@/common/js/utils";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -313,7 +313,7 @@ export default {
|
||||||
},
|
},
|
||||||
getProject() {
|
getProject() {
|
||||||
if (this.reviewId) {
|
if (this.reviewId) {
|
||||||
this.$post("/test/case/review/projects", {reviewId: this.reviewId}, res => {
|
this.$post("/project/list/related", {userId: getCurrentUserId()}, res => {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
this.projects = data;
|
this.projects = data;
|
||||||
|
|
Loading…
Reference in New Issue