2022-07-18 19:06:37 +08:00
|
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
2022-11-22 16:41:43 +08:00
|
|
|
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
|
2022-07-18 19:06:37 +08:00
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
|
|
|
// CrudSchema
|
2022-11-22 16:41:43 +08:00
|
|
|
const crudSchemas = reactive<VxeCrudSchema>({
|
|
|
|
primaryKey: 'id',
|
|
|
|
primaryType: 'seq',
|
|
|
|
action: true,
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
title: '文件名',
|
2022-11-29 23:23:33 +08:00
|
|
|
field: 'name'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '文件路径',
|
2022-11-22 16:41:43 +08:00
|
|
|
field: 'path',
|
2022-11-29 23:23:33 +08:00
|
|
|
isSearch: true
|
2022-08-02 10:19:02 +08:00
|
|
|
},
|
2022-11-22 16:41:43 +08:00
|
|
|
{
|
|
|
|
title: 'URL',
|
|
|
|
field: 'url',
|
|
|
|
table: {
|
|
|
|
cellRender: {
|
2023-01-06 17:20:59 +08:00
|
|
|
name: 'XPreview'
|
2022-11-22 16:41:43 +08:00
|
|
|
}
|
2022-08-02 10:19:02 +08:00
|
|
|
}
|
2022-07-18 19:06:37 +08:00
|
|
|
},
|
2022-11-29 23:23:33 +08:00
|
|
|
{
|
|
|
|
title: '文件大小',
|
|
|
|
field: 'size',
|
|
|
|
formatter: 'formatSize'
|
|
|
|
},
|
2022-11-22 16:41:43 +08:00
|
|
|
{
|
|
|
|
title: '文件类型',
|
2022-11-29 23:23:33 +08:00
|
|
|
field: 'type',
|
|
|
|
isSearch: true
|
2022-11-22 16:41:43 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: t('common.createTime'),
|
|
|
|
field: 'createTime',
|
|
|
|
formatter: 'formatDate',
|
|
|
|
isForm: false,
|
|
|
|
search: {
|
|
|
|
show: true,
|
|
|
|
itemRender: {
|
|
|
|
name: 'XDataTimePicker'
|
|
|
|
}
|
|
|
|
}
|
2022-07-18 19:06:37 +08:00
|
|
|
}
|
2022-11-22 16:41:43 +08:00
|
|
|
]
|
|
|
|
})
|
|
|
|
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|