fileList.data.ts 929 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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: 'path',
  14. search: {
  15. show: true
  16. }
  17. },
  18. {
  19. title: 'URL',
  20. field: 'url',
  21. table: {
  22. cellRender: {
  23. name: 'XImg'
  24. }
  25. }
  26. },
  27. {
  28. title: '文件类型',
  29. field: 'type'
  30. },
  31. {
  32. title: t('common.createTime'),
  33. field: 'createTime',
  34. formatter: 'formatDate',
  35. isForm: false,
  36. search: {
  37. show: true,
  38. itemRender: {
  39. name: 'XDataTimePicker'
  40. }
  41. }
  42. }
  43. ]
  44. })
  45. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)