loginLog.data.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. actionWidth: '80px',
  12. columns: [
  13. {
  14. title: '日志类型',
  15. field: 'logType',
  16. dictType: DICT_TYPE.SYSTEM_LOGIN_TYPE
  17. },
  18. {
  19. title: '用户类型',
  20. field: 'userType'
  21. },
  22. {
  23. title: '用户名称',
  24. field: 'username',
  25. isSearch: true
  26. },
  27. {
  28. title: '登录地址',
  29. field: 'userIp',
  30. isSearch: true
  31. },
  32. {
  33. title: '浏览器',
  34. field: 'userAgent'
  35. },
  36. {
  37. title: '登陆结果',
  38. field: 'result',
  39. dictType: DICT_TYPE.SYSTEM_LOGIN_RESULT
  40. },
  41. {
  42. title: t('common.createTime'),
  43. field: 'createTime',
  44. formatter: 'formatDate',
  45. isForm: false,
  46. search: {
  47. itemRender: {
  48. name: 'XDataTimePicker'
  49. }
  50. }
  51. }
  52. ]
  53. })
  54. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)