loginLog.data.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import { reactive } from 'vue'
  2. import { DICT_TYPE } from '@/utils/dict'
  3. import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
  4. // CrudSchema
  5. const crudSchemas = reactive<VxeCrudSchema>({
  6. primaryKey: 'id',
  7. primaryType: 'seq',
  8. action: true,
  9. actionWidth: '80px',
  10. columns: [
  11. {
  12. title: '日志类型',
  13. field: 'logType',
  14. dictType: DICT_TYPE.SYSTEM_LOGIN_TYPE,
  15. dictData: '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. table: {
  31. width: 100
  32. }
  33. },
  34. {
  35. title: '登陆结果',
  36. field: 'result',
  37. dictType: DICT_TYPE.SYSTEM_LOGIN_RESULT,
  38. dictData: 'number'
  39. },
  40. {
  41. title: '登录日期',
  42. field: 'createTime',
  43. formatter: 'formatDate',
  44. table: {
  45. width: 100
  46. },
  47. search: {
  48. show: true,
  49. itemRender: {
  50. name: 'XDataTimePicker'
  51. }
  52. }
  53. }
  54. ]
  55. })
  56. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)