app.data.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
  2. const { t } = useI18n() // 国际化
  3. // 表单校验
  4. export const rules = reactive({
  5. name: [required],
  6. status: [required],
  7. payNotifyUrl: [required],
  8. refundNotifyUrl: [required],
  9. merchantId: [required]
  10. })
  11. // CrudSchema
  12. const crudSchemas = reactive<VxeCrudSchema>({
  13. primaryKey: 'id',
  14. primaryType: 'seq',
  15. primaryTitle: '编号',
  16. action: true,
  17. columns: [
  18. {
  19. title: '应用名',
  20. field: 'name',
  21. isSearch: true
  22. },
  23. {
  24. title: '商户名称',
  25. field: 'payMerchant',
  26. isSearch: true
  27. },
  28. {
  29. title: t('common.status'),
  30. field: 'status',
  31. dictType: DICT_TYPE.COMMON_STATUS,
  32. dictClass: 'number',
  33. isSearch: true
  34. },
  35. {
  36. title: '支付结果的回调地址',
  37. field: 'payNotifyUrl',
  38. isSearch: true
  39. },
  40. {
  41. title: '退款结果的回调地址',
  42. field: 'refundNotifyUrl',
  43. isSearch: true
  44. },
  45. {
  46. title: '商户名称',
  47. field: 'merchantName',
  48. isSearch: true
  49. },
  50. {
  51. title: '备注',
  52. field: 'remark',
  53. isTable: false,
  54. isSearch: true
  55. },
  56. {
  57. title: t('common.createTime'),
  58. field: 'createTime',
  59. isForm: false,
  60. search: {
  61. show: true,
  62. itemRender: {
  63. name: 'XDataTimePicker'
  64. }
  65. }
  66. }
  67. ]
  68. })
  69. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)