global.d.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. import type { ComponentInternalInstance as ComponentInstance, PropType as VuePropType } from 'vue';
  2. declare global {
  3. /** vue Instance */
  4. declare type ComponentInternalInstance = ComponentInstance;
  5. /**vue */
  6. declare type PropType<T> = VuePropType<T>;
  7. /**
  8. * 界面字段隐藏属性
  9. */
  10. declare interface FieldOption {
  11. key: number;
  12. label: string;
  13. visible: boolean;
  14. children?: Array<FieldOption>;
  15. }
  16. /**
  17. * 弹窗属性
  18. */
  19. declare interface DialogOption {
  20. /**
  21. * 弹窗标题
  22. */
  23. title?: string;
  24. /**
  25. * 是否显示
  26. */
  27. visible: boolean;
  28. }
  29. declare interface UploadOption {
  30. /** 设置上传的请求头部 */
  31. headers: { [key: string]: any };
  32. /** 上传的地址 */
  33. url: string;
  34. }
  35. /**
  36. * 导入属性
  37. */
  38. declare interface ImportOption extends UploadOption {
  39. /** 是否显示弹出层 */
  40. open: boolean;
  41. /** 弹出层标题 */
  42. title: string;
  43. /** 是否禁用上传 */
  44. isUploading: boolean;
  45. /** 其他参数 */
  46. [key: string]: any;
  47. }
  48. /**
  49. * 字典数据 数据配置
  50. */
  51. declare interface DictDataOption {
  52. label: string;
  53. value: string;
  54. elTagType?: ElTagType;
  55. elTagClass?: string;
  56. remark?: string;
  57. }
  58. declare interface BaseEntity {
  59. createBy?: any;
  60. createDept?: any;
  61. createTime?: string;
  62. updateBy?: any;
  63. updateTime?: any;
  64. }
  65. /**
  66. * 分页数据
  67. * T : 表单数据
  68. * D : 查询参数
  69. */
  70. declare interface PageData<T, D> {
  71. form: T;
  72. queryParams: D;
  73. rules: ElFormRules;
  74. }
  75. /**
  76. * 分页查询参数
  77. */
  78. declare interface PageQuery {
  79. pageNum: number;
  80. pageSize: number;
  81. }
  82. }
  83. import '@vue/runtime-core';
  84. declare module '@vue/runtime-core' {
  85. export interface ComponentCustomProperties {
  86. navigateBackOrHome: () => void;
  87. showToast: (title: string) => void;
  88. selectDictLabel: (datas: any, value: number | string) => string;
  89. selectDictLabels: (datas: any, value: any, separator?: any) => string;
  90. useDict: (...args: string[]) => { [key: string]: DictDataOption[] };
  91. $u: any;
  92. }
  93. }
  94. export {};