account.data.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
  2. // 表单校验
  3. export const rules = reactive({
  4. mail: [required],
  5. username: [required],
  6. password: [required],
  7. host: [required],
  8. port: [required],
  9. sslEnable: [required]
  10. })
  11. // CrudSchema
  12. const crudSchemas = reactive<VxeCrudSchema>({
  13. primaryKey: 'id', // 默认的主键 ID
  14. primaryTitle: '编号',
  15. primaryType: 'id',
  16. action: true,
  17. actionWidth: '200', // 3 个按钮默认 200,如有删减对应增减即可
  18. columns: [
  19. {
  20. title: '邮箱',
  21. field: 'mail',
  22. isSearch: true
  23. },
  24. {
  25. title: '用户名',
  26. field: 'username',
  27. isSearch: true
  28. },
  29. {
  30. title: '密码',
  31. field: 'password',
  32. isTable: false
  33. },
  34. {
  35. title: 'SMTP 服务器域名',
  36. field: 'host'
  37. },
  38. {
  39. title: 'SMTP 服务器端口',
  40. field: 'port',
  41. form: {
  42. component: 'InputNumber',
  43. value: 465
  44. }
  45. },
  46. {
  47. title: '是否开启 SSL',
  48. field: 'sslEnable',
  49. dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
  50. dictClass: 'boolean'
  51. },
  52. {
  53. title: '创建时间',
  54. field: 'createTime',
  55. isForm: false,
  56. formatter: 'formatDate',
  57. table: {
  58. width: 180
  59. }
  60. }
  61. ]
  62. })
  63. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)