loginLog.data.ts 1.1 KB

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