index.ts 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. import * as Study from "./study";
  2. import * as User from "./user";
  3. import * as News from "./news";
  4. import * as Transfer from "./transfer";
  5. import * as System from './system';
  6. import * as Major from "./major";
  7. import { VipCardInfo } from "./user";
  8. import { EnumExamMode, EnumExamType, EnumReviewMode } from "@/common/enum";
  9. /// 接口响应
  10. export interface ApiResponse<T> {
  11. code: number;
  12. msg: string;
  13. data: T;
  14. card?: VipCardInfo;
  15. // 以下是注册登录才有的
  16. token?: string;
  17. user?: User.UserInfo;
  18. isDefaultModifyPwd?: boolean;
  19. isPasswordExpired?: boolean;
  20. // 以下是机构信息
  21. org?: {
  22. contactPhone: string;
  23. logo: string;
  24. orgName: string;
  25. }
  26. }
  27. export interface ApiCaptchaResponse {
  28. code: number;
  29. msg: string;
  30. img: string;
  31. uuid: string;
  32. }
  33. export interface ApiResponseList<T> {
  34. code: number;
  35. msg: string;
  36. rows: T[];
  37. total: number;
  38. }
  39. export interface TreeData {
  40. name: string;
  41. value: number;
  42. children?: TreeData[];
  43. isExpanded?: boolean;
  44. isLeaf?: boolean;
  45. }
  46. export interface TableConfig {
  47. border?: boolean;
  48. stripe?: boolean;
  49. emptyText?: string;
  50. loading?: boolean;
  51. rowKey?: string;
  52. }
  53. export interface TableColumnConfig {
  54. prop: string;
  55. label: string;
  56. flex?: number;
  57. slot?: string;
  58. type?: string;
  59. headerAlign?: 'left' | 'center' | 'right';
  60. align?: 'left' | 'center' | 'right';
  61. }
  62. /**
  63. * 应用 store
  64. */
  65. export interface AppStoreState {
  66. isInitialized: boolean;
  67. activeTabbar: number;
  68. statusBarHeight: number;
  69. systemInfo: UniApp.GetSystemInfoResult | null;
  70. appConfig: ConfigItem[];
  71. platform: string;
  72. }
  73. export interface DictStoreState {
  74. dicts: Record<string, DictItem[]>;
  75. }
  76. export interface UserStoreState {
  77. accessToken: string | null;
  78. user: User.UserInfo | null;
  79. isDefaultModifyPwd?: boolean;
  80. isPasswordExpired?: boolean;
  81. card: VipCardInfo | null;
  82. isExamGuideShow: boolean;
  83. tempInfo?: {
  84. location: string;
  85. examType?: EnumExamType;
  86. };
  87. org: {
  88. contactPhone: string;
  89. logo: string;
  90. orgName: string;
  91. };
  92. rememberPwd: boolean;
  93. cardPassword: string;
  94. cardNo: string;
  95. directedSchoolList: Study.DirectedSchool[];
  96. practiceSettings: Study.PracticeSettings;
  97. }
  98. /**
  99. * 字典项
  100. */
  101. export interface DictItem {
  102. dictLabel: string;
  103. dictValue: string;
  104. }
  105. export interface PickerItem {
  106. label: string;
  107. value: string | number;
  108. }
  109. export interface ConfigItem {
  110. configKey: string;
  111. configValue: string;
  112. configType: string;
  113. configName: string;
  114. configId: number;
  115. }
  116. export interface SwiperTabItem {
  117. name: string;
  118. value?: string;
  119. slot?: string;
  120. params?: any;
  121. }
  122. export { Study, User, News, Transfer, System, Major };