; // 选中的节点 key
virtualListProps?: Record
; // 虚拟滚动列表的属性
+ titleTooltipPosition?:
+ | 'top'
+ | 'tl'
+ | 'tr'
+ | 'bottom'
+ | 'bl'
+ | 'br'
+ | 'left'
+ | 'lt'
+ | 'lb'
+ | 'right'
+ | 'rt'
+ | 'rb'; // 标题 tooltip 的位置
}>(),
{
searchDebounce: 300,
defaultExpandAll: false,
selectable: true,
+ draggable: false,
+ titleTooltipPosition: 'right',
fieldNames: () => ({
key: 'key',
title: 'title',
@@ -401,6 +422,9 @@
}
}
}
+ .arco-tree-node-title-block {
+ width: 80%;
+ }
.ms-tree-node-extra {
@apply relative hidden;
&:hover {
diff --git a/frontend/src/hooks/useTableStore.ts b/frontend/src/hooks/useTableStore.ts
index 4fdc98e30e..caa43b4acc 100644
--- a/frontend/src/hooks/useTableStore.ts
+++ b/frontend/src/hooks/useTableStore.ts
@@ -1,4 +1,5 @@
import { filter, orderBy, sortBy } from 'lodash-es';
+import localforage from 'localforage';
import { MsTableColumn, MsTableColumnData } from '@/components/pure/ms-table/type';
@@ -8,8 +9,6 @@ import { isArraysEqualWithOrder } from '@/utils/equal';
import { SpecialColumnEnum } from '@/enums/tableEnum';
-import localforage from 'localforage';
-
export default function useTableStore() {
const state = reactive({
baseSortIndex: 10,
diff --git a/frontend/src/models/projectManagement/file.ts b/frontend/src/models/projectManagement/file.ts
index d1aa0dcbd0..18e89bfb62 100644
--- a/frontend/src/models/projectManagement/file.ts
+++ b/frontend/src/models/projectManagement/file.ts
@@ -59,6 +59,7 @@ export interface BatchFileApiParams extends BatchApiParams {
projectId: string;
fileType: string;
moduleIds: string[];
+ moveModuleId?: string | number; // 移动的模块ID
}
// 更新模块参数
export interface UpdateModuleParams {
diff --git a/frontend/src/views/project-management/fileManagement/components/folderTree.vue b/frontend/src/views/project-management/fileManagement/components/folderTree.vue
index b1883886c3..66fae7b6ac 100644
--- a/frontend/src/views/project-management/fileManagement/components/folderTree.vue
+++ b/frontend/src/views/project-management/fileManagement/components/folderTree.vue
@@ -23,6 +23,7 @@
count: 'count',
}"
block-node
+ title-tooltip-position="left"
@select="folderNodeSelect"
@more-action-select="handleFolderMoreSelect"
@more-actions-close="moreActionsClose"
@@ -30,9 +31,7 @@
>
-
- {{ nodeData.name }}
-
+
{{ nodeData.name }}
({{ nodeData.count || 0 }})
@@ -162,7 +161,7 @@
folderTree.value = res.map((e) => ({
...e,
hideMoreAction: e.id === 'root',
- draggable: e.id !== 'root',
+ draggable: e.id !== 'root' && !props.isModal,
}));
if (isSetDefaultKey) {
selectedKeys.value = [folderTree.value[0].id];
diff --git a/frontend/src/views/project-management/fileManagement/components/rightBox.vue b/frontend/src/views/project-management/fileManagement/components/rightBox.vue
index 4b4510937d..351c3db473 100644
--- a/frontend/src/views/project-management/fileManagement/components/rightBox.vue
+++ b/frontend/src/views/project-management/fileManagement/components/rightBox.vue
@@ -234,7 +234,7 @@
:ok-text="t('project.fileManagement.batchMoveConfirm')"
:ok-button-props="{ disabled: selectedModuleKeys.length === 0 }"
:cancel-button-props="{ disabled: batchMoveFileLoading }"
- :on-before-ok="batchMoveFile"
+ :on-before-ok="handleFileMove"
@close="handleMoveFileModalCancel"
>
@@ -292,6 +292,7 @@
import {
batchDownloadFile,
+ batchMoveFile,
deleteFile,
downloadFile,
getFileList,
@@ -341,6 +342,9 @@
const tableFileTypeOptions = ref([]);
const fileTypeLoading = ref(false);
+ /**
+ * 初始化文件类型筛选选项
+ */
async function initFileTypes() {
try {
fileTypeLoading.value = true;
@@ -464,7 +468,6 @@
tableStore.initColumn(TableKeyEnum.FILE_MANAGEMENT_FILE, columns, 'drawer');
const { propsRes, propsEvent, loadList, setLoadListParams } = useTable(getFileList, {
tableKey: TableKeyEnum.FILE_MANAGEMENT_FILE,
- columns,
showSetting: true,
selectable: true,
showSelectAll: true,
@@ -500,6 +503,13 @@
],
};
const tableSelected = ref<(string | number)[]>([]);
+ const batchParams = ref({
+ selectedIds: [],
+ selectAll: false,
+ excludeIds: [],
+ currentSelectCount: 0,
+ });
+ const combine = ref>({});
/**
* 处理表格选中
@@ -510,16 +520,15 @@
/**
* 批量下载文件
- * @param params 批量操作参数
*/
- async function batchDownload(params: BatchActionQueryParams) {
+ async function batchDownload() {
try {
loading.value = true;
const res = await batchDownloadFile({
- selectIds: params?.selectedIds || [],
- selectAll: !!params?.selectAll,
- excludeIds: params?.excludeIds || [],
- condition: { keyword: keyword.value },
+ selectIds: batchParams.value?.selectedIds || [],
+ selectAll: !!batchParams.value?.selectAll,
+ excludeIds: batchParams.value?.excludeIds || [],
+ condition: { keyword: keyword.value, comebine: combine.value },
projectId: appStore.currentProjectId,
fileType: tableFileType.value,
moduleIds: [props.activeFolder],
@@ -555,14 +564,14 @@
/**
* 删除文件
*/
- function delFile(record: FileItem | null, isBatch: boolean, params?: BatchActionQueryParams) {
+ function delFile(record: FileItem | null, isBatch: boolean) {
let title = t('project.fileManagement.deleteFileTipTitle', { name: characterLimit(record?.name) });
let selectIds = [record?.id || ''];
if (isBatch) {
title = t('project.fileManagement.batchDeleteFileTipTitle', {
- count: params?.currentSelectCount || params?.selectedIds?.length,
+ count: batchParams.value?.currentSelectCount || batchParams.value?.selectedIds?.length,
});
- selectIds = params?.selectedIds || [];
+ selectIds = batchParams.value?.selectedIds || [];
}
openModal({
type: 'error',
@@ -578,9 +587,9 @@
try {
await deleteFile({
selectIds,
- selectAll: !!params?.selectAll,
- excludeIds: params?.excludeIds || [],
- condition: { keyword: keyword.value },
+ selectAll: !!batchParams.value?.selectAll,
+ excludeIds: batchParams.value?.excludeIds || [],
+ condition: { keyword: keyword.value, comebine: combine.value },
projectId: appStore.currentProjectId,
fileType: tableFileType.value,
moduleIds: [props.activeFolder],
@@ -619,16 +628,17 @@
*/
function handleTableBatch(event: BatchActionParams, params: BatchActionQueryParams) {
tableSelected.value = params?.selectedIds || [];
+ batchParams.value = params;
switch (event.eventTag) {
case 'download':
- batchDownload(params);
+ batchDownload();
break;
case 'move':
moveModalVisible.value = true;
isBatchMove.value = true;
break;
case 'delete':
- delFile(null, true, params);
+ delFile(null, true);
break;
default:
break;
@@ -639,11 +649,18 @@
/**
* 单个/批量移动文件
*/
- async function batchMoveFile() {
+ async function handleFileMove() {
try {
batchMoveFileLoading.value = true;
- await new Promise((resolve) => {
- setTimeout(() => resolve(true), 2000);
+ await batchMoveFile({
+ selectIds: batchParams.value?.selectedIds || [activeFile.value?.id || ''],
+ selectAll: !!batchParams.value?.selectAll,
+ excludeIds: batchParams.value?.excludeIds || [],
+ condition: { keyword: keyword.value, comebine: combine.value },
+ projectId: appStore.currentProjectId,
+ fileType: tableFileType.value,
+ moduleIds: [props.activeFolder],
+ moveModuleId: selectedModuleKeys.value[0],
});
Message.success(t('project.fileManagement.batchMoveSuccess'));
if (isBatchMove.value) {
@@ -672,19 +689,18 @@
}
function setTableParams() {
- const combine: Record = {};
if (props.activeFolder === 'my') {
- combine.createUser = userStore.id;
+ combine.value.createUser = userStore.id;
}
if (fileType.value === 'storage') {
- combine.storage = 'git';
+ combine.value.storage = 'git';
}
setLoadListParams({
keyword: keyword.value,
fileType: tableFileType.value,
moduleIds: ['all', 'my'].includes(props.activeFolder) ? [] : [props.activeFolder],
projectId: appStore.currentProjectId,
- comebine: combine,
+ comebine: combine.value,
});
}
@@ -885,6 +901,9 @@
isUploading.value = false;
}
+ /**
+ * 取消上传二次确认
+ */
function cancelUpload() {
if (asyncTaskStore.uploadFileTask.eachTaskQueue.length > 0 && asyncTaskStore.eachUploadTaskProgress !== 100) {
openModal({
diff --git a/frontend/src/views/project-management/fileManagement/locale/en-US.ts b/frontend/src/views/project-management/fileManagement/locale/en-US.ts
index 6aec81415f..378f7f2910 100644
--- a/frontend/src/views/project-management/fileManagement/locale/en-US.ts
+++ b/frontend/src/views/project-management/fileManagement/locale/en-US.ts
@@ -4,7 +4,7 @@ export default {
'project.fileManagement.defaultFile': 'Default files',
'project.fileManagement.expandAll': 'Expand all submodules',
'project.fileManagement.collapseAll': 'Collapse all submodules',
- 'project.fileManagement.addSubModule': 'Add module',
+ 'project.fileManagement.addSubModule': 'Add submodule',
'project.fileManagement.addStorage': 'Add repository',
'project.fileManagement.rename': 'Rename',
'project.fileManagement.nameNotNull': 'name cannot be empty',
diff --git a/frontend/src/views/project-management/fileManagement/locale/zh-CN.ts b/frontend/src/views/project-management/fileManagement/locale/zh-CN.ts
index 0b98319979..77003cf96f 100644
--- a/frontend/src/views/project-management/fileManagement/locale/zh-CN.ts
+++ b/frontend/src/views/project-management/fileManagement/locale/zh-CN.ts
@@ -4,7 +4,7 @@ export default {
'project.fileManagement.defaultFile': '默认文件',
'project.fileManagement.expandAll': '展开全部子模块',
'project.fileManagement.collapseAll': '收起全部子模块',
- 'project.fileManagement.addSubModule': '添加模块',
+ 'project.fileManagement.addSubModule': '添加子模块',
'project.fileManagement.addStorage': '添加存储库',
'project.fileManagement.rename': '重命名',
'project.fileManagement.nameNotNull': '名字不能为空',
diff --git a/frontend/src/views/setting/system/user/components/batchModal.vue b/frontend/src/views/setting/system/user/components/batchModal.vue
index 09ab4fddba..e6dc810efe 100644
--- a/frontend/src/views/setting/system/user/components/batchModal.vue
+++ b/frontend/src/views/setting/system/user/components/batchModal.vue
@@ -10,7 +10,7 @@
}}