loginLog.data.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import { reactive } from 'vue'
  2. import { DICT_TYPE } from '@/utils/dict'
  3. import { useI18n } from '@/hooks/web/useI18n'
  4. import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
  5. const { t } = useI18n() // 国际化
  6. const crudSchemas = reactive<CrudSchema[]>([
  7. {
  8. label: t('common.index'),
  9. field: 'id',
  10. type: 'index',
  11. form: {
  12. show: false
  13. },
  14. detail: {
  15. show: false
  16. }
  17. },
  18. {
  19. label: '日志类型',
  20. field: 'logType',
  21. dictType: DICT_TYPE.SYSTEM_LOGIN_TYPE,
  22. search: {
  23. show: true
  24. }
  25. },
  26. {
  27. label: '用户名称',
  28. field: 'username',
  29. search: {
  30. show: true
  31. }
  32. },
  33. {
  34. label: '登录地址',
  35. field: 'userIp',
  36. search: {
  37. show: true
  38. }
  39. },
  40. {
  41. label: 'userAgent',
  42. field: 'userAgent'
  43. },
  44. {
  45. label: '登陆结果',
  46. field: 'result',
  47. dictType: DICT_TYPE.SYSTEM_LOGIN_RESULT,
  48. search: {
  49. show: true
  50. }
  51. },
  52. {
  53. label: t('common.createTime'),
  54. field: 'createTime',
  55. form: {
  56. show: false
  57. },
  58. search: {
  59. show: true,
  60. component: 'DatePicker',
  61. componentProps: {
  62. type: 'daterange',
  63. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  64. defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]
  65. }
  66. }
  67. },
  68. {
  69. label: t('table.action'),
  70. field: 'action',
  71. width: '120px',
  72. form: {
  73. show: false
  74. },
  75. detail: {
  76. show: false
  77. }
  78. }
  79. ])
  80. export const { allSchemas } = useCrudSchemas(crudSchemas)