fileList.data.ts 1.1 KB

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