feat: minio功能开发

This commit is contained in:
louis 2024-03-08 16:24:42 +08:00
parent 4d281cd1cf
commit 3c3c21733c
5 changed files with 19 additions and 10 deletions

View File

@ -129,6 +129,7 @@ export const dynamicTableEmits = {
change: (...rest: OnChangeCallbackParams) => rest.length === 4, change: (...rest: OnChangeCallbackParams) => rest.length === 4,
'toggle-advanced': (isAdvanced: boolean) => isBoolean(isAdvanced), 'toggle-advanced': (isAdvanced: boolean) => isBoolean(isAdvanced),
'fetch-error': (error) => error, 'fetch-error': (error) => error,
'on-fetch': (loading: boolean) => isBoolean(loading),
'update:expandedRowKeys': (keys: Key[]) => keys, 'update:expandedRowKeys': (keys: Key[]) => keys,
'expanded-rows-change': (keyValues: string[]) => Array.isArray(keyValues), 'expanded-rows-change': (keyValues: string[]) => Array.isArray(keyValues),
}; };

View File

@ -62,10 +62,11 @@ export const useTableMethods = ({ state, props, emit }: UseTableMethodsContext)
*/ */
const fetchData = debounce(async (params = {}) => { const fetchData = debounce(async (params = {}) => {
const { dataRequest, dataSource, fetchConfig, searchParams } = props; const { dataRequest, dataSource, fetchConfig, searchParams } = props;
emit('on-fetch', true);
if (!dataRequest || !isFunction(dataRequest) || Array.isArray(dataSource)) { if (!dataRequest || !isFunction(dataRequest) || Array.isArray(dataSource)) {
return; return;
} }
try { try {
let pageParams: Recordable = {}; let pageParams: Recordable = {};
const pagination = unref(paginationRef)!; const pagination = unref(paginationRef)!;
@ -132,7 +133,8 @@ export const useTableMethods = ({ state, props, emit }: UseTableMethodsContext)
return tableData; return tableData;
} catch (error) { } catch (error) {
warn(`表格查询出错:${error}`); warn(`表格查询出错:${error}`);
emit('fetch-error', error);
emit('on-fetch', true);
tableData.value = []; tableData.value = [];
updatePagination({ total: 0 }); updatePagination({ total: 0 });
} finally { } finally {

View File

@ -203,6 +203,8 @@
emit('update:searchKey', ''); emit('update:searchKey', '');
return; return;
} }
message.info('全盘搜索功能暂未实现,敬请期待');
return;
await showModal({ await showModal({
modalProps: { modalProps: {
title: '全盘搜索', title: '全盘搜索',

View File

@ -26,7 +26,7 @@
</Descriptions.Item> </Descriptions.Item>
</template> </template>
<!-- mark --> <!-- mark -->
<Descriptions.Item label="文件备注" :label-style="{ whiteSpace: 'nowrap' }"> <!-- <Descriptions.Item label="文件备注" :label-style="{ whiteSpace: 'nowrap' }">
<Space direction="vertical" align="end"> <Space direction="vertical" align="end">
<Input.TextArea <Input.TextArea
v-model:value="mark" v-model:value="mark"
@ -45,7 +45,7 @@
>更新 >更新
</a-button> </a-button>
</Space> </Space>
</Descriptions.Item> </Descriptions.Item> -->
</Descriptions> </Descriptions>
</Space> </Space>
</Spin> </Spin>
@ -69,11 +69,11 @@
const detailInfoMap = new Map([ const detailInfoMap = new Map([
['name', '文件名'], ['name', '文件名'],
['mimeType', '文件类型'], ['mimeType', '文件类型'],
['hash', '文件Hash'], // ['hash', 'Hash'],
['md5', '文件MD5'], // ['md5', 'MD5'],
['fsize', '文件大小'], ['fsize', '文件大小'],
['putTime', '上传时间'], ['putTime', '上传时间'],
['uploader', '上传人员'], // ['uploader', ''],
] as const); ] as const);
const loading = ref(false); const loading = ref(false);

View File

@ -32,9 +32,10 @@
:auto-height="true" :auto-height="true"
:pagination="false" :pagination="false"
:search="false" :search="false"
:show-tool-bar="false" :show-tool-bar="true"
:loading="tableLoading" :loading="tableLoading"
:row-selection="rowSelection" :row-selection="rowSelection"
@onFetch="refresh"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'"> <template v-if="column.key === 'name'">
@ -50,6 +51,9 @@
</Typography.Link> </Typography.Link>
</template> </template>
</template> </template>
<!-- <template #toolbar>
<a-button type="primary" @click="dynamicTableInstance.reload()"> 刷新 </a-button>
</template> -->
</DynamicTable> </DynamicTable>
<FilePreviewDrawer ref="previewDrawerRef" /> <FilePreviewDrawer ref="previewDrawerRef" />
</Card> </Card>
@ -71,7 +75,7 @@
import { createContextMenu } from '@/components/basic/context-menu'; import { createContextMenu } from '@/components/basic/context-menu';
import { useTable } from '@/components/core/dynamic-table'; import { useTable } from '@/components/core/dynamic-table';
import { hasPermission } from '@/permission'; import { hasPermission } from '@/permission';
import { Button } from 'ant-design-vue';
defineOptions({ defineOptions({
name: 'NetDiskManage', name: 'NetDiskManage',
}); });