common.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * @Author: ChenYaJin
  3. * @Date: 2023-07-03 10:55:53
  4. * @LastEditors: wjc
  5. * @LastEditTime: 2023-12-01 09:19:37
  6. * @Description: 通用模型
  7. */
  8. export type BasicResponse<T = any> = {
  9. code: number
  10. message: string
  11. data: T
  12. }
  13. /**
  14. * 接口返回数据模型
  15. */
  16. export type ApiResponse<T = unknown> = {
  17. data: BasicResponse<T>
  18. }
  19. /**
  20. * table
  21. */
  22. export type TableData<T = unknown> = {
  23. list: Array<T>
  24. pageSize?: number
  25. pageNum?: number
  26. pages?: number
  27. total?: number
  28. }
  29. export type Page = {
  30. pageSize?: number
  31. pageNum?: number
  32. isPage?: boolean
  33. }
  34. /**
  35. * dialog数据
  36. */
  37. export type ModalData<T = unknown> = {
  38. isShow?: boolean
  39. type?: string
  40. loading?: boolean
  41. row?: T
  42. title?: string
  43. }
  44. /**
  45. * 枚举
  46. */
  47. export interface IOption {
  48. id?: string
  49. code?: string
  50. value?: string
  51. name?: string
  52. label?: string
  53. type?: string
  54. leaf?: boolean
  55. children?: IOption[]
  56. }
  57. /**
  58. * 表单验证
  59. */
  60. export type IFormValidateCallback = {
  61. (message?: string | Error | undefined): Error | void
  62. }
  63. export type IFormValidator = (
  64. rule: {
  65. field: string
  66. },
  67. value: string,
  68. callback: IFormValidateCallback
  69. ) => void
  70. export type FormRuleItemParams = {
  71. required?: boolean
  72. message?: string
  73. validator?: IFormValidator
  74. trigger?: string
  75. }
  76. export interface AnyObject<T = unknown> {
  77. [key: string]: T
  78. }
  79. /**
  80. * 审核结果信息
  81. */
  82. export interface IAuditStatusInfo {
  83. content?: string
  84. reviewBy?: string
  85. auditStatus?: string
  86. reject?: string
  87. score?: number
  88. reviewAt?: string
  89. deadlineAt?: string
  90. }