This commit is contained in:
扶桑花间 2025-08-27 20:37:31 +08:00
parent 3aff17bba9
commit 11032db958
3 changed files with 26 additions and 21 deletions

View File

@ -4,6 +4,7 @@ namespace app\model;
use app\BaseModel;
use think\db\Query;
use think\model\concern\SoftDelete;
use think\model\relation\HasOne;
/**
@ -11,6 +12,8 @@ use think\model\relation\HasOne;
*/
class SysFileRecord extends BaseModel
{
use SoftDelete;
protected $name = "sys_file_record";
protected $pk = "id";

View File

@ -24,6 +24,8 @@ export interface FileRecord {
thumbnail?: string;
/** 文件下载地址 */
downloadUrl?: string;
/** 文件预览地址 */
previewUrl?: string;
/** 上传人账号 */
createUsername?: string;
/** 上传人名称 */

View File

@ -10,8 +10,6 @@
:show-overflow-tooltip="true"
v-model:selections="selections"
:highlight-current-row="true"
:export-config="{ fileName: '文件数据', datasource: exportSource }"
:print-config="{ datasource: exportSource }"
cache-key="systemFileTable"
>
<template #toolbar>
@ -40,9 +38,10 @@
</el-button>
</template>
<template #path="{ row }">
<el-tag style="margin-right: 5px">{{ row.disk }}</el-tag>
<el-link
type="primary"
:href="row.url"
:href="row.previewUrl"
target="_blank"
underline="never"
>
@ -82,8 +81,7 @@
import {
pageFiles,
removeFiles,
uploadFile,
listFiles
uploadFile
} from '@/api/system/file';
import type { FileRecord, FileRecordParam } from '@/api/system/file/model';
@ -105,22 +103,29 @@
type: 'index',
columnKey: 'index',
width: 50,
align: 'center' /* ,
fixed: 'left' */
},
{
prop: 'name',
label: '文件名称',
sortable: 'custom',
minWidth: 140
align: 'center'
},
{
prop: 'path',
label: '文件路径',
sortable: 'custom',
minWidth: 140,
slot: 'path'
},
{
prop: 'name',
label: '文件名称',
minWidth: 140
},
{
prop: 'md5',
label: '文件md5',
width: 280
},
{
prop: 'contentType',
label: '文件Mime',
minWidth: 80
},
{
prop: 'length',
label: '文件大小',
@ -140,11 +145,10 @@
}
},
{
prop: 'createNickname',
prop: 'createUser.nickname',
label: '上传人',
width: 120,
align: 'center',
sortable: 'custom'
align: 'center'
},
{
prop: 'createTime',
@ -234,8 +238,4 @@
return false;
};
/** 导出和打印全部数据的数据源 */
const exportSource: DatasourceFunction = ({ where, orders }) => {
return listFiles({ ...where, ...orders });
};
</script>