fix(任务中心): 修复跳转后,所属项目显示错误的缺陷

--bug=1042913 --user=王孝刚 【系统设置】系统/组织-任务中心-资源ID/名称跳转-非当前项目的资源也在当前项目下显示的
https://www.tapd.cn/55049933/s/1534413
This commit is contained in:
wxg0103 2024-06-24 10:39:05 +08:00 committed by 刘瑞斌
parent 7c7ce38072
commit 4cbd273f13
6 changed files with 37 additions and 20 deletions

View File

@ -24,6 +24,8 @@ public class TaskCenterDTO implements Serializable {
@Schema(description = "项目id") @Schema(description = "项目id")
private String projectId; private String projectId;
@Schema(description = "组织id")
private String organizationId;
@Schema(description = "报告id") @Schema(description = "报告id")
private String id; private String id;

View File

@ -25,6 +25,9 @@ public class TaskCenterScheduleDTO implements Serializable {
@Schema(description = "项目id") @Schema(description = "项目id")
private String projectId; private String projectId;
@Schema(description = "组织id")
private String organizationId;
@Schema(description = "任务id") @Schema(description = "任务id")
private String id; private String id;

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.system.mapper.ExtScheduleMapper"> <mapper namespace="io.metersphere.system.mapper.ExtScheduleMapper">
<select id="taskCenterSchedulelist" resultType="io.metersphere.system.dto.taskcenter.TaskCenterScheduleDTO"> <select id="taskCenterSchedulelist" resultType="io.metersphere.system.dto.taskcenter.TaskCenterScheduleDTO">
select task.*, QRTZ_TRIGGERS.NEXT_FIRE_TIME AS next_time from ( select task.*, QRTZ_TRIGGERS.NEXT_FIRE_TIME AS next_time, project.organization_id from (
<if test="request.scheduleTagType == 'API_IMPORT'"> <if test="request.scheduleTagType == 'API_IMPORT'">
SELECT SELECT
schedule.id, schedule.id,

View File

@ -28,7 +28,7 @@
type="text" type="text"
class="one-line-text w-full" class="one-line-text w-full"
:class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']" :class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']"
@click="showDetail(record.resourceId)" @click="showDetail(record)"
>{{ record.resourceNum }} >{{ record.resourceNum }}
</div> </div>
</template> </template>
@ -37,7 +37,7 @@
v-if="!record.integrated" v-if="!record.integrated"
class="one-line-text max-w-[300px]" class="one-line-text max-w-[300px]"
:class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']" :class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']"
@click="showDetail(record.resourceId)" @click="showDetail(record)"
>{{ record.resourceName }} >{{ record.resourceName }}
</div> </div>
</template> </template>
@ -539,18 +539,22 @@
/** /**
* 跳转接口用例详情 * 跳转接口用例详情
*/ */
function showDetail(id: string) { function showDetail(record: any) {
if (!hasJumpPermission.value) { if (!hasJumpPermission.value) {
return; return;
} }
if (props.moduleType === 'API_CASE') { if (props.moduleType === 'API_CASE') {
openNewPage(RouteEnum.API_TEST_MANAGEMENT, { openNewPage(RouteEnum.API_TEST_MANAGEMENT, {
cId: id, orgId: record.organizationId,
pId: record.projectId,
cId: record.resourceId,
}); });
} }
if (props.moduleType === 'API_SCENARIO') { if (props.moduleType === 'API_SCENARIO') {
openNewPage(RouteEnum.API_TEST_SCENARIO, { openNewPage(RouteEnum.API_TEST_SCENARIO, {
id, orgId: record.organizationId,
pId: record.projectId,
id: record.resourceId,
}); });
} }
} }

View File

@ -50,7 +50,7 @@
type="text" type="text"
class="one-line-text w-full" class="one-line-text w-full"
:class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']" :class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']"
@click="showDetail(record.resourceId)" @click="showDetail(record)"
>{{ record.resourceNum }} >{{ record.resourceNum }}
</div> </div>
</template> </template>
@ -62,7 +62,7 @@
" "
class="one-line-text max-w-[300px]" class="one-line-text max-w-[300px]"
:class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']" :class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']"
@click="showDetail(record.resourceId)" @click="showDetail(record)"
>{{ record.resourceName }} >{{ record.resourceName }}
</div> </div>
</template> </template>
@ -550,18 +550,22 @@
* 跳转接口用例详情 * 跳转接口用例详情
*/ */
function showDetail(id: string) { function showDetail(record: any) {
if (!hasJumpPermission.value) { if (!hasJumpPermission.value) {
return; return;
} }
if (props.moduleType === TaskCenterEnum.API_SCENARIO) { if (props.moduleType === TaskCenterEnum.API_SCENARIO) {
openNewPage(RouteEnum.API_TEST_SCENARIO, { openNewPage(RouteEnum.API_TEST_SCENARIO, {
id, orgId: record.organizationId,
pId: record.projectId,
id: record.resourceId,
}); });
} }
if (props.moduleType === TaskCenterEnum.TEST_PLAN) { if (props.moduleType === TaskCenterEnum.TEST_PLAN) {
openNewPage(RouteEnum.TEST_PLAN_INDEX_DETAIL, { openNewPage(RouteEnum.TEST_PLAN_INDEX_DETAIL, {
id, orgId: record.organizationId,
pId: record.projectId,
id: record.resourceId,
}); });
} }
} }

View File

@ -28,7 +28,7 @@
type="text" type="text"
class="one-line-text w-full" class="one-line-text w-full"
:class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']" :class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']"
@click="showDetail(record.resourceId)" @click="showDetail(record)"
>{{ record.resourceNum }} >{{ record.resourceNum }}
</div> </div>
</template> </template>
@ -37,7 +37,7 @@
v-if="!record.integrated" v-if="!record.integrated"
class="one-line-text max-w-[300px]" class="one-line-text max-w-[300px]"
:class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']" :class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']"
@click="showDetail(record.resourceId)" @click="showDetail(record)"
>{{ record.resourceName }} >{{ record.resourceName }}
</div> </div>
</template> </template>
@ -75,7 +75,7 @@
<MsButton <MsButton
class="!mr-0" class="!mr-0"
:disabled="record.historyDeleted || !hasAnyPermission(permissionsMap[props.group].report)" :disabled="record.historyDeleted || !hasAnyPermission(permissionsMap[props.group].report)"
@click="viewReport(record.id, record.integrated)" @click="viewReport(record)"
>{{ t('project.taskCenter.viewReport') }} >{{ t('project.taskCenter.viewReport') }}
</MsButton> </MsButton>
</a-tooltip> </a-tooltip>
@ -84,7 +84,7 @@
<MsButton <MsButton
class="!mr-0" class="!mr-0"
:disabled="record.historyDeleted || !hasAnyPermission(permissionsMap[props.group].report)" :disabled="record.historyDeleted || !hasAnyPermission(permissionsMap[props.group].report)"
@click="viewReport(record.id, record.integrated)" @click="viewReport(record)"
>{{ t('project.taskCenter.viewReport') }} >{{ t('project.taskCenter.viewReport') }}
</MsButton> </MsButton>
</div> </div>
@ -420,19 +420,23 @@
} }
} }
function viewReport(id: string, type: boolean) { function viewReport(record: any) {
openNewPage(RouteEnum.TEST_PLAN_REPORT_DETAIL, { openNewPage(RouteEnum.TEST_PLAN_REPORT_DETAIL, {
id, orgId: record.organizationId,
type: type ? 'GROUP' : 'TEST_PLAN', pId: record.projectId,
id: record.id,
type: record.integrated ? 'GROUP' : 'TEST_PLAN',
}); });
} }
function showDetail(id: string) { function showDetail(record: any) {
if (!hasJumpPermission.value) { if (!hasJumpPermission.value) {
return; return;
} }
openNewPage(RouteEnum.TEST_PLAN_INDEX_DETAIL, { openNewPage(RouteEnum.TEST_PLAN_INDEX_DETAIL, {
id, orgId: record.organizationId,
pId: record.projectId,
id: record.resourceId,
}); });
} }