From e1023bb3313282b00d6dcdefd5d7e30d7aaa1bfc Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期四, 30 十一月 2023 11:13:29 +0800 Subject: [PATCH] update 优化 代码中存在的警告 --- src/types/global.d.ts | 27 +++++++++++++++++---------- 1 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/types/global.d.ts b/src/types/global.d.ts index 5a972a3..32081bf 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -1,18 +1,25 @@ -import { FormRules } from 'element-plus'; +import type { ComponentInternalInstance as ComponentInstance, PropType as VuePropType } from 'vue'; + declare global { + /** vue Instance */ + declare type ComponentInternalInstance = ComponentInstance; + /**vue */ + declare type PropType<T> = VuePropType<T>; + /** * 鐣岄潰瀛楁闅愯棌灞炴�� */ - interface FieldOption { + declare interface FieldOption { key: number; label: string; visible: boolean; + children?: Array<FieldOption>; } /** * 寮圭獥灞炴�� */ - interface DialogOption { + declare interface DialogOption { /** * 寮圭獥鏍囬 */ @@ -23,7 +30,7 @@ visible: boolean; } - interface UploadOption { + declare interface UploadOption { /** 璁剧疆涓婁紶鐨勮姹傚ご閮� */ headers: { [key: string]: any }; @@ -34,7 +41,7 @@ /** * 瀵煎叆灞炴�� */ - interface ImportOption extends UploadOption { + declare interface ImportOption extends UploadOption { /** 鏄惁鏄剧ず寮瑰嚭灞� */ open: boolean; /** 寮瑰嚭灞傛爣棰� */ @@ -48,14 +55,14 @@ /** * 瀛楀吀鏁版嵁 鏁版嵁閰嶇疆 */ - interface DictDataOption { + declare interface DictDataOption { label: string; value: string; elTagType?: ElTagType; elTagClass?: string; } - interface BaseEntity { + declare interface BaseEntity { createBy?: any; createDept?: any; createTime?: string; @@ -68,15 +75,15 @@ * T : 琛ㄥ崟鏁版嵁 * D : 鏌ヨ鍙傛暟 */ - interface PageData<T, D> { + declare interface PageData<T, D> { form: T; queryParams: D; - rules: FormRules; + rules: ElFormRules; } /** * 鍒嗛〉鏌ヨ鍙傛暟 */ - interface PageQuery { + declare interface PageQuery { pageNum: number; pageSize: number; } -- Gitblit v1.9.3