fix(缺陷管理): 回收站排序问题&&批量编辑标签变更历史缺少&&用例数字无法点击跳转

--bug=1038760 --user=宋昌昌 【缺陷管理】缺陷批量编辑标签变更历史中没有记录 https://www.tapd.cn/55049933/s/1491888
--bug=1038804 --user=宋昌昌 【缺陷管理】回收站中用例排序为删除时间升序 https://www.tapd.cn/55049933/s/1491955
--bug=1038766 --user=宋昌昌 【缺陷管理】缺陷中用例数字段无法点击 https://www.tapd.cn/55049933/s/1491956
This commit is contained in:
song-cc-rock 2024-04-09 16:16:32 +08:00 committed by 刘瑞斌
parent f18e51a4e3
commit 9154d7cb7f
10 changed files with 40 additions and 16 deletions

View File

@ -132,7 +132,7 @@ public class ApiDefinitionController {
@CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project")
public Pager<List<ApiDefinitionDTO>> getPage(@Validated @RequestBody ApiDefinitionPageRequest request) { public Pager<List<ApiDefinitionDTO>> getPage(@Validated @RequestBody ApiDefinitionPageRequest request) {
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "pos desc"); StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : request.getDeleted() ? "delete_time desc" : "pos desc");
return PageUtils.setPageInfo(page, apiDefinitionService.getApiDefinitionPage(request, SessionUtils.getUserId())); return PageUtils.setPageInfo(page, apiDefinitionService.getApiDefinitionPage(request, SessionUtils.getUserId()));
} }

View File

@ -197,7 +197,7 @@ public class ApiTestCaseController {
@RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_CASE_READ) @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_CASE_READ)
public Pager<List<ApiTestCaseDTO>> pageTrash(@Validated @RequestBody ApiTestCasePageRequest request) { public Pager<List<ApiTestCaseDTO>> pageTrash(@Validated @RequestBody ApiTestCasePageRequest request) {
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "pos desc"); StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "delete_time desc");
return PageUtils.setPageInfo(page, apiTestCaseService.page(request, true)); return PageUtils.setPageInfo(page, apiTestCaseService.page(request, true));
} }

View File

@ -68,7 +68,7 @@ public class ApiScenarioController {
@CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project")
public Pager<List<ApiScenarioDTO>> getTrashPage(@Validated @RequestBody ApiScenarioPageRequest request) { public Pager<List<ApiScenarioDTO>> getTrashPage(@Validated @RequestBody ApiScenarioPageRequest request) {
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "pos desc"); StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "delete_time desc");
request.setDeleted(true); request.setDeleted(true);
return PageUtils.setPageInfo(page, apiScenarioService.getScenarioPage(request)); return PageUtils.setPageInfo(page, apiScenarioService.getScenarioPage(request));
} }

View File

@ -150,7 +150,7 @@ public class BugController {
} }
@PostMapping("/sync/all") @PostMapping("/sync/all")
@Operation(summary = "缺陷管理-列表-同步缺陷(全量)") @Operation(summary = "缺陷管理-列表-同步缺陷(企业)")
@RequiresPermissions(PermissionConstants.PROJECT_BUG_UPDATE) @RequiresPermissions(PermissionConstants.PROJECT_BUG_UPDATE)
@CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project")
public void syncAll(@RequestBody BugSyncRequest request) { public void syncAll(@RequestBody BugSyncRequest request) {

View File

@ -37,7 +37,7 @@ public class BugTrashController {
@RequiresPermissions(PermissionConstants.PROJECT_BUG_READ) @RequiresPermissions(PermissionConstants.PROJECT_BUG_READ)
public Pager<List<BugDTO>> page(@Validated @RequestBody BugPageRequest request) { public Pager<List<BugDTO>> page(@Validated @RequestBody BugPageRequest request) {
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "create_time desc"); StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "delete_time desc");
request.setUseTrash(true); request.setUseTrash(true);
return PageUtils.setPageInfo(page, bugService.list(request)); return PageUtils.setPageInfo(page, bugService.list(request));
} }

View File

@ -1611,6 +1611,7 @@ public class BugService {
bugs.forEach(bug -> { bugs.forEach(bug -> {
LogDTO log = new LogDTO(bug.getProjectId(), project.getOrganizationId(), bug.getId(), currentUser, operationType, module, bug.getTitle()); LogDTO log = new LogDTO(bug.getProjectId(), project.getOrganizationId(), bug.getId(), currentUser, operationType, module, bug.getTitle());
log.setPath(path); log.setPath(path);
log.setHistory(true);
log.setMethod(HttpMethodConstants.POST.name()); log.setMethod(HttpMethodConstants.POST.name());
if (batchUpdate) { if (batchUpdate) {
// 批量更新只记录TAG的变更内容 // 批量更新只记录TAG的变更内容

View File

@ -42,7 +42,7 @@ public class FunctionalCaseTrashController {
@CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project")
public Pager<List<FunctionalCasePageDTO>> getFunctionalCasePage(@Validated @RequestBody FunctionalCasePageRequest request) { public Pager<List<FunctionalCasePageDTO>> getFunctionalCasePage(@Validated @RequestBody FunctionalCasePageRequest request) {
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "pos desc"); StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "delete_time desc");
return PageUtils.setPageInfo(page, functionalCaseService.getFunctionalCasePage(request, true)); return PageUtils.setPageInfo(page, functionalCaseService.getFunctionalCasePage(request, true));
} }

View File

@ -271,6 +271,7 @@
visible: boolean; visible: boolean;
detailId: string; // id detailId: string; // id
detailIndex: number; // detailIndex: number; //
detailDefaultTab: string; // tab
tableData: any[]; // tableData: any[]; //
pagination: MsPaginationI; // pagination: MsPaginationI; //
pageChange: (page: number) => Promise<void>; // pageChange: (page: number) => Promise<void>; //
@ -381,7 +382,7 @@
currentCustomFields.value = customFieldsRes.customFields || []; currentCustomFields.value = customFieldsRes.customFields || [];
if (detailInfo.value.customFields && Array.isArray(detailInfo.value.customFields)) { if (detailInfo.value.customFields && Array.isArray(detailInfo.value.customFields)) {
const MULTIPLE_TYPE = ['MULTIPLE_SELECT', 'MULTIPLE_INPUT', 'CHECKBOX', 'MULTIPLE_MEMBER']; const MULTIPLE_TYPE = ['MULTIPLE_SELECT', 'MULTIPLE_INPUT', 'CHECKBOX', 'MULTIPLE_MEMBER'];
const SINGRADIO_TYPE = ['RADIO', 'SELECT', 'MEMBER']; const SINGLE_TYPE = ['RADIO', 'SELECT', 'MEMBER'];
detail.customFields.forEach((item) => { detail.customFields.forEach((item) => {
if (MULTIPLE_TYPE.includes(item.type)) { if (MULTIPLE_TYPE.includes(item.type)) {
const multipleOptions = getOptionFromTemplate( const multipleOptions = getOptionFromTemplate(
@ -389,12 +390,14 @@
); );
// //
const optionsIds = (multipleOptions || []).map((e: any) => e.value); const optionsIds = (multipleOptions || []).map((e: any) => e.value);
if (item.value) {
if (item.type !== 'MULTIPLE_INPUT') { if (item.type !== 'MULTIPLE_INPUT') {
const currentDefaultValue = optionsIds.filter((e: any) => JSON.parse(item.value).includes(e)); const currentDefaultValue = optionsIds.filter((e: any) => JSON.parse(item.value).includes(e));
tmpObj[item.id] = currentDefaultValue; tmpObj[item.id] = currentDefaultValue;
} else { } else {
tmpObj[item.id] = JSON.parse(item.value); tmpObj[item.id] = JSON.parse(item.value);
} }
}
} else if (item.type === 'INT' || item.type === 'FLOAT') { } else if (item.type === 'INT' || item.type === 'FLOAT') {
tmpObj[item.id] = Number(item.value); tmpObj[item.id] = Number(item.value);
} else if (item.type === 'CASCADER') { } else if (item.type === 'CASCADER') {
@ -402,7 +405,7 @@
if (arr && arr instanceof Array && arr.length > 0) { if (arr && arr instanceof Array && arr.length > 0) {
tmpObj[item.id] = arr[arr.length - 1]; tmpObj[item.id] = arr[arr.length - 1];
} }
} else if (SINGRADIO_TYPE.includes(item.type)) { } else if (SINGLE_TYPE.includes(item.type)) {
const multipleOptions = getOptionFromTemplate( const multipleOptions = getOptionFromTemplate(
currentCustomFields.value.find((filed: any) => item.id === filed.fieldId) currentCustomFields.value.find((filed: any) => item.id === filed.fieldId)
); );
@ -630,7 +633,11 @@
() => showDrawerVisible.value, () => showDrawerVisible.value,
(val) => { (val) => {
if (val) { if (val) {
if (props.detailDefaultTab) {
activeTab.value = props.detailDefaultTab;
} else {
activeTab.value = 'detail'; activeTab.value = 'detail';
}
} else { } else {
const query = { ...route.query }; const query = { ...route.query };
delete query.id; delete query.id;

View File

@ -301,13 +301,13 @@
} }
onMounted(async () => { onMounted(async () => {
getEnabledModules();
getFetch(); getFetch();
}); });
watch( watch(
() => props.bugId, () => props.bugId,
() => { () => {
getEnabledModules();
getFetch(); getFetch();
} }
); );

View File

@ -55,6 +55,12 @@
</div> </div>
</template> </template>
<template #relationCaseCount="{ record, rowIndex }">
<a-button type="text" class="px-0" @click="showRelateCaseCount(record.id, rowIndex)">{{
record.relationCaseCount
}}</a-button>
</template>
<template #createUserFilter="{ columnConfig }"> <template #createUserFilter="{ columnConfig }">
<TableFilter <TableFilter
v-model:visible="createUserFilterVisible" v-model:visible="createUserFilterVisible"
@ -185,6 +191,7 @@
v-model:visible="detailVisible" v-model:visible="detailVisible"
:detail-id="activeDetailId" :detail-id="activeDetailId"
:detail-index="activeCaseIndex" :detail-index="activeCaseIndex"
:detail-default-tab="activeDetailTab"
:current-platform="currentPlatform" :current-platform="currentPlatform"
:table-data="propsRes.data" :table-data="propsRes.data"
:page-change="propsEvent.pageChange" :page-change="propsEvent.pageChange"
@ -273,6 +280,7 @@
const detailVisible = ref(false); const detailVisible = ref(false);
const activeDetailId = ref<string>(''); const activeDetailId = ref<string>('');
const activeCaseIndex = ref<number>(0); const activeCaseIndex = ref<number>(0);
const activeDetailTab = ref<string>('');
const currentDeleteObj = reactive<{ id: string; title: string }>({ id: '', title: '' }); const currentDeleteObj = reactive<{ id: string; title: string }>({ id: '', title: '' });
const deleteVisible = ref(false); const deleteVisible = ref(false);
const batchEditVisible = ref(false); const batchEditVisible = ref(false);
@ -407,7 +415,7 @@
{ {
title: 'bugManagement.numberOfCase', title: 'bugManagement.numberOfCase',
dataIndex: 'relationCaseCount', dataIndex: 'relationCaseCount',
slotName: 'numberOfCase', slotName: 'relationCaseCount',
width: 80, width: 80,
showDrag: true, showDrag: true,
showInTable: true, showInTable: true,
@ -677,9 +685,17 @@
detailVisible.value = true; detailVisible.value = true;
activeDetailId.value = id; activeDetailId.value = id;
activeCaseIndex.value = rowIndex - 1; activeCaseIndex.value = rowIndex - 1;
activeDetailTab.value = 'detail';
} }
}; };
const showRelateCaseCount = async (id: string, rowIndex: number) => {
detailVisible.value = true;
activeDetailId.value = id;
activeCaseIndex.value = rowIndex - 1;
activeDetailTab.value = 'case';
};
const handleCopy = (record: BugListItem) => { const handleCopy = (record: BugListItem) => {
router.push({ router.push({
name: RouteEnum.BUG_MANAGEMENT_DETAIL, name: RouteEnum.BUG_MANAGEMENT_DETAIL,