loginLog.data.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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: 'datetimerange',
  63. valueFormat: 'YYYY-MM-DD HH:mm:ss'
  64. }
  65. }
  66. },
  67. {
  68. label: t('table.action'),
  69. field: 'action',
  70. width: '120px',
  71. form: {
  72. show: false
  73. },
  74. detail: {
  75. show: false
  76. }
  77. }
  78. ])
  79. export const { allSchemas } = useCrudSchemas(crudSchemas)