loginLog.data.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { DICT_TYPE } from '@/utils/dict'
  2. import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
  3. // CrudSchema
  4. const crudSchemas = reactive<VxeCrudSchema>({
  5. primaryKey: 'id',
  6. primaryType: 'seq',
  7. primaryTitle: '日志编号',
  8. action: true,
  9. actionWidth: '100px',
  10. columns: [
  11. {
  12. title: '日志类型',
  13. field: 'logType',
  14. dictType: DICT_TYPE.SYSTEM_LOGIN_TYPE,
  15. dictClass: 'number'
  16. },
  17. {
  18. title: '用户名称',
  19. field: 'username',
  20. isSearch: true
  21. },
  22. {
  23. title: '登录地址',
  24. field: 'userIp',
  25. isSearch: true
  26. },
  27. {
  28. title: '浏览器',
  29. field: 'userAgent'
  30. },
  31. {
  32. title: '登陆结果',
  33. field: 'result',
  34. dictType: DICT_TYPE.SYSTEM_LOGIN_RESULT,
  35. dictClass: 'number'
  36. },
  37. {
  38. title: '登录日期',
  39. field: 'createTime',
  40. formatter: 'formatDate',
  41. table: {
  42. width: 150
  43. },
  44. search: {
  45. show: true,
  46. itemRender: {
  47. name: 'XDataTimePicker'
  48. }
  49. }
  50. }
  51. ]
  52. })
  53. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)