loginLog.data.ts 1.2 KB

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