fix(用例管理): 修复用例管理关联文件时的一揽子缺陷:切换存储模式时数据加载问题、各种统计问题、表格字段没有支持排序的问题

This commit is contained in:
song-tianyang 2024-02-27 17:21:00 +08:00 committed by 刘瑞斌
parent a74f9cc9e6
commit 867886860f
6 changed files with 51 additions and 35 deletions

View File

@ -23,5 +23,7 @@ public class ModuleConstants {
/* 模块数量统计相关key */
public static final String MODULE_COUNT_ALL = "all";
public static final String MODULE_COUNT_MY = "my";
public static final String MODULE_COUNT_GIT = "git";
public static final String MODULE_COUNT_MINIO = "minio";
/* 模块数量统计相关key end*/
}

View File

@ -40,10 +40,10 @@ public class FileInformationResponse {
@Schema(description = "模块ID")
private String moduleId;
@Schema(description = "更新")
@Schema(description = "创建")
private String createUser;
@Schema(description = "更新时间")
@Schema(description = "创建时间")
private long createTime;
@Schema(description = "更新人")

View File

@ -30,7 +30,7 @@
SELECT
f.id,
updateUser.name as update_user,
createUser.name AS create_uUser,
createUser.name AS create_user,
f.module_id,
f.name,
f.type,

View File

@ -459,10 +459,16 @@ public class FileMetadataService {
myFileCountDTO.setStorage(null);
myFileCountDTO.setHiddenIds(pageDTO.getHiddenIds());
long allCount = extFileMetadataMapper.fileCount(myFileCountDTO);
//查找git文件数量
myFileCountDTO.setStorage(StorageType.GIT.name());
long gitAllCount = extFileMetadataMapper.fileCount(myFileCountDTO);
myFileCountDTO.setStorage(null);
myFileCountDTO.setOperator(operator);
long myFileCount = extFileMetadataMapper.fileCount(myFileCountDTO);
moduleCountMap.put(ModuleConstants.MODULE_COUNT_MY, myFileCount);
moduleCountMap.put(ModuleConstants.MODULE_COUNT_ALL, allCount);
moduleCountMap.put(ModuleConstants.MODULE_COUNT_GIT, gitAllCount);
moduleCountMap.put(ModuleConstants.MODULE_COUNT_MINIO, allCount - gitAllCount);
return moduleCountMap;
}

View File

@ -72,6 +72,7 @@
:get-list-request="props.getListRequest"
:get-list-fun-params="props.getListFunParams"
:selector-type="props.selectorType"
:file-all-count-by-storage="fileAllCountByStorage"
@init="handleModuleTableInit"
/>
</template>
@ -80,22 +81,22 @@
</template>
<script setup lang="ts">
import { ref } from 'vue';
import {ref} from 'vue';
import MsButton from '@/components/pure/ms-button/index.vue';
import MsDrawer from '@/components/pure/ms-drawer/index.vue';
import MsSplitBox from '@/components/pure/ms-split-box/index.vue';
import FileTree from './fileTree.vue';
import LinkFileTable from './linkFileTable.vue';
import StorageList from './storageList.vue';
import MsButton from '@/components/pure/ms-button/index.vue';
import MsDrawer from '@/components/pure/ms-drawer/index.vue';
import MsSplitBox from '@/components/pure/ms-split-box/index.vue';
import FileTree from './fileTree.vue';
import LinkFileTable from './linkFileTable.vue';
import StorageList from './storageList.vue';
import { useI18n } from '@/hooks/useI18n';
import {useI18n} from '@/hooks/useI18n';
import type { AssociatedList } from '@/models/caseManagement/featureCase';
import type { CommonList, ModuleTreeNode, TableQueryParams } from '@/models/common';
import { FileListQueryParams, Repository } from '@/models/projectManagement/file';
import type {AssociatedList} from '@/models/caseManagement/featureCase';
import type {CommonList, ModuleTreeNode, TableQueryParams} from '@/models/common';
import {FileListQueryParams, Repository} from '@/models/projectManagement/file';
const { t } = useI18n();
const { t } = useI18n();
const props = defineProps<{
visible: boolean;
@ -136,6 +137,7 @@
const modulesCount = ref<Record<string, number>>({});
const myFileCount = ref(0);
const allFileCount = ref(0);
const fileAllCountByStorage = ref<number>(0);
const isExpandAll = ref(false);
@ -175,10 +177,11 @@
try {
modulesCount.value = await props.getCountRequest(params);
myFileCount.value = modulesCount.value.my || 0;
if (showType.value === 'Storage') {
allFileCount.value = storageCount.value;
} else {
allFileCount.value = modulesCount.value.all || 0;
allFileCount.value = modulesCount.value.all;
if(showType.value === 'Storage'){
fileAllCountByStorage.value = modulesCount.value.git;
}else {
fileAllCountByStorage.value = modulesCount.value.minio;
}
} catch (error) {
// eslint-disable-next-line no-console
@ -195,18 +198,6 @@
function changeShowType(val: string | number | boolean) {
showType.value = val as FileShowType;
activeFolder.value = 'all';
if (val === 'Storage') {
initModulesCount({
...tableFilterParams.value,
combine: {
...tableFilterParams.value.combine,
// ...props.getListFunParams.combine,
storage: 'git',
},
});
} else {
initModulesCount(tableFilterParams.value);
}
}
/**

View File

@ -84,6 +84,7 @@ const { t } = useI18n();
storageList: Repository[]; //
getListFunParams: TableQueryParams; //
selectorType?: 'none' | 'checkbox' | 'radio';
fileAllCountByStorage: number;
}>();
const emit = defineEmits<{
(e: 'init', params: FileListQueryParams): void;
@ -105,6 +106,10 @@ const { t } = useI18n();
title: 'project.fileManagement.name',
slotName: 'name',
dataIndex: 'name',
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
},
width: 270,
},
{
@ -119,20 +124,32 @@ const { t } = useI18n();
},
{
title: 'project.fileManagement.creator',
dataIndex: 'creator',
dataIndex: 'createUser',
showTooltip: true,
width: 120,
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
},
},
{
title: 'project.fileManagement.updater',
dataIndex: 'updateUser',
showTooltip: true,
width: 120,
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
},
},
{
title: 'project.fileManagement.updateTime',
dataIndex: 'updateTime',
width: 180,
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
},
},
];
@ -174,7 +191,7 @@ const { t } = useI18n();
} else {
combine.value.createUser = '';
}
if (fileType.value === 'storage') {
if (props.showType === 'Storage') {
combine.value.storage = 'git';
} else {
combine.value.storage = 'minio';
@ -258,7 +275,7 @@ const { t } = useI18n();
if (props.activeFolder === 'all') {
return {
name: t('ms.file.allFileModule'),
count: props.modulesCount[props.activeFolder],
count: props.fileAllCountByStorage,
};
}
return {
@ -271,7 +288,7 @@ const { t } = useI18n();
if (props.activeFolder === 'all') {
return {
name: t('ms.file.allRepositoryFileModule'),
count: storageItemCount.value,
count: props.fileAllCountByStorage,
};
}
return {