fileList.data.ts 997 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
  2. const { t } = useI18n() // 国际化
  3. // CrudSchema
  4. const crudSchemas = reactive<VxeCrudSchema>({
  5. primaryKey: 'id',
  6. primaryType: 'seq',
  7. action: true,
  8. columns: [
  9. {
  10. title: '文件名',
  11. field: 'name'
  12. },
  13. {
  14. title: '文件路径',
  15. field: 'path',
  16. isSearch: true
  17. },
  18. {
  19. title: 'URL',
  20. field: 'url',
  21. table: {
  22. cellRender: {
  23. name: 'XPreview'
  24. }
  25. }
  26. },
  27. {
  28. title: '文件大小',
  29. field: 'size',
  30. formatter: 'formatSize'
  31. },
  32. {
  33. title: '文件类型',
  34. field: 'type',
  35. isSearch: true
  36. },
  37. {
  38. title: t('common.createTime'),
  39. field: 'createTime',
  40. formatter: 'formatDate',
  41. isForm: false,
  42. search: {
  43. show: true,
  44. itemRender: {
  45. name: 'XDataTimePicker'
  46. }
  47. }
  48. }
  49. ]
  50. })
  51. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)