global.d.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. // 申明外部 npm 插件模块
  2. declare module 'vue-grid-layout';
  3. declare module 'qrcodejs2-fixes';
  4. declare module 'splitpanes';
  5. declare module 'js-cookie';
  6. declare module '@wangeditor/editor-for-vue';
  7. declare module 'js-table2excel';
  8. declare module 'qs';
  9. declare module 'sortablejs';
  10. declare module 'vue-plugin-hiprint';
  11. declare module 'vcrontab-3';
  12. // 声明一个模块,防止引入文件时报错
  13. declare module '*.json';
  14. declare module '*.png';
  15. declare module '*.jpg';
  16. declare module '*.scss';
  17. declare module '*.ts';
  18. declare module '*.js';
  19. // 声明文件,*.vue 后缀的文件交给 vue 模块来处理
  20. declare module '*.vue' {
  21. import type { DefineComponent } from 'vue';
  22. const component: DefineComponent<{}, {}, any>;
  23. export default component;
  24. }
  25. // 声明文件,定义全局变量
  26. /* eslint-disable */
  27. declare interface Window {
  28. nextLoading: boolean;
  29. BMAP_SATELLITE_MAP: any;
  30. BMap: any;
  31. __env__: any;
  32. }
  33. // 声明路由当前项类型
  34. declare type RouteItem<T = any> = {
  35. path: string;
  36. name?: string | symbol | undefined | null;
  37. redirect?: string;
  38. k?: T;
  39. meta?: {
  40. title?: string;
  41. isLink?: string;
  42. isHide?: boolean;
  43. isKeepAlive?: boolean;
  44. isAffix?: boolean;
  45. isIframe?: boolean;
  46. roles?: string[];
  47. icon?: string;
  48. isDynamic?: boolean;
  49. isDynamicPath?: string;
  50. isIframeOpen?: string;
  51. loading?: boolean;
  52. };
  53. children: T[];
  54. query?: { [key: string]: T };
  55. params?: { [key: string]: T };
  56. contextMenuClickId?: string | number;
  57. commonUrl?: string;
  58. isFnClick?: boolean;
  59. url?: string;
  60. transUrl?: string;
  61. title?: string;
  62. id?: string | number;
  63. };
  64. // 声明路由 to from
  65. declare interface RouteToFrom<T = any> extends RouteItem {
  66. path?: string;
  67. children?: T[];
  68. }
  69. // 声明路由当前项类型集合
  70. declare type RouteItems<T extends RouteItem = any> = T[];
  71. // 声明 ref
  72. declare type RefType<T = any> = T | null;
  73. // 声明 HTMLElement
  74. declare type HtmlType = HTMLElement | string | undefined | null;
  75. // 申明 children 可选
  76. declare type ChilType<T = any> = {
  77. children?: T[];
  78. };
  79. // 申明 数组
  80. declare type EmptyArrayType<T = any> = T[];
  81. // 申明 对象
  82. declare type EmptyObjectType<T = any> = {
  83. [key: string]: T;
  84. };
  85. // 申明 select option
  86. declare type SelectOptionType = {
  87. value: string | number;
  88. label: string | number;
  89. };
  90. // 鼠标滚轮滚动类型
  91. declare interface WheelEventType extends WheelEvent {
  92. wheelDelta: number;
  93. }
  94. // table 数据格式公共类型
  95. declare interface TableType<T = any> {
  96. total: number;
  97. loading: boolean;
  98. param: {
  99. pageNum: number;
  100. pageSize: number;
  101. [key: string]: T;
  102. };
  103. }
  104. // 字典数据结构
  105. export interface DictItem {
  106. typeCode: string;
  107. label: string;
  108. value: string;
  109. name: string;
  110. status: string;
  111. orderNo: number;
  112. remark?: string;
  113. tagType?: string;
  114. extData?: string;
  115. styleSetting?: string;
  116. classSetting?: string;
  117. [key: string]: any;
  118. }