feat: 部分返回值增加明确类型定义

master
LiuJiaNan 2026-04-21 15:59:53 +08:00
parent e0ec572567
commit 981a4cda5c
16 changed files with 187 additions and 21 deletions

View File

@ -10,7 +10,8 @@
"Bash(git check-ignore:*)", "Bash(git check-ignore:*)",
"Bash(git checkout:*)", "Bash(git checkout:*)",
"Bash(find:*)", "Bash(find:*)",
"Bash(mkdir:*)" "Bash(mkdir:*)",
"mcp__ide__getDiagnostics"
], ],
"deny": [], "deny": [],
"ask": [] "ask": []

View File

@ -1,11 +1,20 @@
import type { FC } from "react"; import type { FC } from "react";
import type { BasicCascaderProps } from "../Basic"; import type { BasicCascaderProps } from "../Basic";
interface Data {
value: string;
label: string;
children: Data[];
}
/** /**
* *
*/ */
export interface AreaCascaderProps extends Omit<BasicCascaderProps, "options" | "placeholder" | "nameKey" | "idKey" | "childrenKey"> { export interface AreaCascaderProps extends Omit<BasicCascaderProps, "options" | "placeholder" | "nameKey" | "idKey" | "childrenKey" | "onGetNodePaths" | "onGetData"> {
/** 获取父级节点 */
onGetNodePaths?: (nodes: Data[]) => void;
/** 获取数据 */
onGetData?: (data: Data[], processedData: Data[]) => void;
} }
/** /**

View File

@ -1,10 +1,17 @@
import type { FC } from "react"; import type { FC } from "react";
import type { BasicCascaderProps } from "../Basic"; import type { BasicCascaderProps } from "../Basic";
interface Data {
dictValue: string;
dictLabel: string;
children: Data[];
[key: string]: any;
}
/** /**
* *
*/ */
export interface DictionaryCascaderProps extends Omit<BasicCascaderProps, "options" | "nameKey" | "idKey" | "childrenKey"> { export interface DictionaryCascaderProps extends Omit<BasicCascaderProps, "options" | "nameKey" | "idKey" | "childrenKey" | "onGetNodePaths" | "onGetData"> {
/** appKey默认 DICTIONARY_APP_KEY_ENUM.DEFAULT0bb989ecada5470c87635018ece9f327 */ /** appKey默认 DICTIONARY_APP_KEY_ENUM.DEFAULT0bb989ecada5470c87635018ece9f327 */
appKey?: string; appKey?: string;
/** 要获取的字典 */ /** 要获取的字典 */
@ -13,6 +20,10 @@ export interface DictionaryCascaderProps extends Omit<BasicCascaderProps, "optio
nameKey?: string; nameKey?: string;
/** 树形数据 value 字段,默认 dictValue */ /** 树形数据 value 字段,默认 dictValue */
idKey?: string; idKey?: string;
/** 获取父级节点 */
onGetNodePaths?: (nodes: Data[]) => void;
/** 获取数据 */
onGetData?: (data: Data[], processedData: Data[]) => void;
} }
/** /**

View File

@ -1,11 +1,20 @@
import type { FC } from "react"; import type { FC } from "react";
import type { BasicCascaderProps } from "../Basic"; import type { BasicCascaderProps } from "../Basic";
interface Data {
dict_value: string;
dict_label: string;
childrenList: Data[];
}
/** /**
* *
*/ */
export interface IndustryCascaderProps extends Omit<BasicCascaderProps, "options" | "placeholder" | "nameKey" | "idKey" | "childrenKey"> { export interface IndustryCascaderProps extends Omit<BasicCascaderProps, "options" | "placeholder" | "nameKey" | "idKey" | "childrenKey" | "onGetNodePaths" | "onGetData"> {
/** 获取父级节点 */
onGetNodePaths?: (nodes: Data[]) => void;
/** 获取数据 */
onGetData?: (data: Data[], processedData: Data[]) => void;
} }
/** /**

View File

@ -1,11 +1,21 @@
import type { FC } from "react"; import type { FC } from "react";
import type { BasicLeftTreeProps } from "../Basic"; import type { BasicLeftTreeProps } from "../Basic";
interface Data {
value: string;
label: string;
children: Data[];
[key: string]: any;
}
/** /**
* *
*/ */
export interface AreaLeftTreeProps extends Omit<BasicLeftTreeProps, "treeData" | "nameKey" | "idKey" | "childrenKey"> { export interface AreaLeftTreeProps extends Omit<BasicLeftTreeProps, "treeData" | "nameKey" | "idKey" | "childrenKey" | "onGetNodePaths" | "onGetData"> {
/** 获取父级节点 */
onGetNodePaths?: (nodes: Data[]) => void;
/** 获取数据 */
onGetData?: (data: Data[], processedData: Data[]) => void;
} }
/** /**

View File

@ -2,14 +2,25 @@ import type { FC } from "react";
import type { DepartmentSelectTreeProps } from "../../../SelectTree/Department/Gwj"; import type { DepartmentSelectTreeProps } from "../../../SelectTree/Department/Gwj";
import type { BasicLeftTreeProps } from "../../Basic"; import type { BasicLeftTreeProps } from "../../Basic";
interface Data {
id: string;
name: string;
childrenList: Data[];
[key: string]: any;
}
/** /**
* *
*/ */
export interface DepartmentLeftTreeProps extends Omit<BasicLeftTreeProps, "treeData" | "nameKey" | "idKey" | "childrenKey"> { export interface DepartmentLeftTreeProps extends Omit<BasicLeftTreeProps, "treeData" | "nameKey" | "idKey" | "childrenKey" | "onGetNodePaths" | "onGetData"> {
/** 请求参数 */ /** 请求参数 */
params?: DepartmentSelectTreeProps["params"]; params?: DepartmentSelectTreeProps["params"];
/** 查询的企业类型 */ /** 查询的企业类型 */
searchType?: DepartmentSelectTreeProps["searchType"]; searchType?: DepartmentSelectTreeProps["searchType"];
/** 获取父级节点 */
onGetNodePaths?: (nodes: Data[]) => void;
/** 获取数据 */
onGetData?: (data: Data[], processedData: Data[]) => void;
} }
/** /**

View File

@ -1,10 +1,17 @@
import type { FC } from "react"; import type { FC } from "react";
import type { BasicLeftTreeProps } from "../Basic"; import type { BasicLeftTreeProps } from "../Basic";
interface Data {
dictValue: string;
dictLabel: string;
children: Data[];
[key: string]: any;
}
/** /**
* *
*/ */
export interface DictionaryLeftTreeProps extends Omit<BasicLeftTreeProps, "treeData" | "nameKey" | "idKey" | "childrenKey"> { export interface DictionaryLeftTreeProps extends Omit<BasicLeftTreeProps, "treeData" | "nameKey" | "idKey" | "childrenKey" | "onGetNodePaths" | "onGetData"> {
/** appKey默认 DICTIONARY_APP_KEY_ENUM.DEFAULT0bb989ecada5470c87635018ece9f327 */ /** appKey默认 DICTIONARY_APP_KEY_ENUM.DEFAULT0bb989ecada5470c87635018ece9f327 */
appKey?: string; appKey?: string;
/** 要获取的字典 */ /** 要获取的字典 */
@ -13,6 +20,10 @@ export interface DictionaryLeftTreeProps extends Omit<BasicLeftTreeProps, "treeD
nameKey?: string; nameKey?: string;
/** 树形数据 value 字段,默认 dictValue */ /** 树形数据 value 字段,默认 dictValue */
idKey?: string; idKey?: string;
/** 获取父级节点 */
onGetNodePaths?: (nodes: Data[]) => void;
/** 获取数据 */
onGetData?: (data: Data[], processedData: Data[]) => void;
} }
/** /**

View File

@ -1,10 +1,16 @@
import type { FC } from "react"; import type { FC } from "react";
import type { BasicSelectProps } from "../Basic"; import type { BasicSelectProps } from "../Basic";
interface Data {
dictValue: string;
dictLabel: string;
[key: string]: any;
}
/** /**
* *
*/ */
export interface DictionarySelectProps extends Omit<BasicSelectProps, "data" | "nameKey" | "idKey"> { export interface DictionarySelectProps extends Omit<BasicSelectProps, "data" | "nameKey" | "idKey" | "onGetOption" | "onGetData"> {
/** appKey默认 DICTIONARY_APP_KEY_ENUM.DEFAULT0bb989ecada5470c87635018ece9f327 */ /** appKey默认 DICTIONARY_APP_KEY_ENUM.DEFAULT0bb989ecada5470c87635018ece9f327 */
appKey?: string; appKey?: string;
/** 要获取的字典 */ /** 要获取的字典 */
@ -13,6 +19,10 @@ export interface DictionarySelectProps extends Omit<BasicSelectProps, "data" | "
nameKey?: string; nameKey?: string;
/** 树形数据 value 字段,默认 dictValue */ /** 树形数据 value 字段,默认 dictValue */
idKey?: string; idKey?: string;
/** 获取选中的项 */
onGetOption?: (option: Data | Data[]) => void;
/** 获取数据 */
onGetData?: (data: Data[]) => void;
} }
/** /**

View File

@ -1,6 +1,20 @@
import type { FC } from "react"; import type { FC } from "react";
import type { BasicSelectProps } from "../../Basic"; import type { BasicSelectProps } from "../../Basic";
interface Data {
id: string;
name: string;
corpinfoId: string;
corpinfoName: string;
departmentId: string;
departmentName: string;
postId: string;
postName: string;
userId: string;
username: string;
[key: string]: any;
}
/** /**
* *
*/ */
@ -31,7 +45,7 @@ export interface ExtraParams {
/** /**
* *
*/ */
export interface PersonnelSelectProps extends Omit<BasicSelectProps, "data" | "placeholder" | "nameKey" | "idKey"> { export interface PersonnelSelectProps extends Omit<BasicSelectProps, "data" | "placeholder" | "nameKey" | "idKey" | "onGetOption" | "onGetData"> {
/** 请求参数 */ /** 请求参数 */
params?: Params; params?: Params;
/** 占位符,默认"人员" */ /** 占位符,默认"人员" */
@ -44,6 +58,10 @@ export interface PersonnelSelectProps extends Omit<BasicSelectProps, "data" | "p
isNeedDepartmentId?: boolean; isNeedDepartmentId?: boolean;
/** 额外请求参数 */ /** 额外请求参数 */
extraParams?: ExtraParams; extraParams?: ExtraParams;
/** 获取选中的项 */
onGetOption?: (option: Data | Data[]) => void;
/** 获取数据 */
onGetData?: (data: Data[]) => void;
} }
/** /**

View File

@ -1,11 +1,20 @@
import type { FC } from "react"; import type { FC } from "react";
import type { BasicSelectTreeProps } from "../Basic"; import type { BasicSelectTreeProps } from "../Basic";
interface Data {
value: string;
label: string;
children: Data[];
}
/** /**
* *
*/ */
export interface AreaSelectTreeProps extends Omit<BasicSelectTreeProps, "treeData" | "placeholder" | "nameKey" | "idKey" | "childrenKey"> { export interface AreaSelectTreeProps extends Omit<BasicSelectTreeProps, "treeData" | "placeholder" | "nameKey" | "idKey" | "childrenKey" | "onGetNodePaths" | "onGetData"> {
/** 获取父级节点 */
onGetNodePaths?: (nodes: Data[]) => void;
/** 获取数据 */
onGetData?: (data: Data[], processedData: Data[]) => void;
} }
/** /**

View File

@ -1,6 +1,13 @@
import type { FC } from "react"; import type { FC } from "react";
import type { BasicSelectTreeProps } from "../../Basic"; import type { BasicSelectTreeProps } from "../../Basic";
interface Data {
id: string;
name: string;
childrenList: Data[];
[key: string]: any;
}
/** /**
* inType * inType
*/ */
@ -28,7 +35,7 @@ export interface Params {
/** /**
* *
*/ */
export interface DepartmentSelectTreeProps extends Omit<BasicSelectTreeProps, "treeData" | "placeholder" | "nameKey" | "idKey" | "childrenKey"> { export interface DepartmentSelectTreeProps extends Omit<BasicSelectTreeProps, "treeData" | "placeholder" | "nameKey" | "idKey" | "childrenKey" | "onGetNodePaths" | "onGetData"> {
/** 请求参数 */ /** 请求参数 */
params?: Params; params?: Params;
/** 占位符,默认"部门" */ /** 占位符,默认"部门" */
@ -39,6 +46,10 @@ export interface DepartmentSelectTreeProps extends Omit<BasicSelectTreeProps, "t
isNeedParentId?: boolean; isNeedParentId?: boolean;
/** 查询的企业类型默认currentcurrent 接收 eqCorpinfoId 或者 eqParentIdall 不接受任何参数inType 接收 inType 或者 enterpriseType */ /** 查询的企业类型默认currentcurrent 接收 eqCorpinfoId 或者 eqParentIdall 不接受任何参数inType 接收 inType 或者 enterpriseType */
searchType?: "current" | "all" | "inType"; searchType?: "current" | "all" | "inType";
/** 获取父级节点 */
onGetNodePaths?: (nodes: Data[]) => void;
/** 获取数据 */
onGetData?: (data: Data[], processedData: Data[]) => void;
} }
/** /**

View File

@ -1,10 +1,17 @@
import type { FC } from "react"; import type { FC } from "react";
import type { BasicSelectTreeProps } from "../Basic"; import type { BasicSelectTreeProps } from "../Basic";
interface Data {
dictValue: string;
dictLabel: string;
children: Data[];
[key: string]: any;
}
/** /**
* *
*/ */
export interface DictionarySelectTreeProps extends Omit<BasicSelectTreeProps, "treeData" | "nameKey" | "idKey" | "childrenKey"> { export interface DictionarySelectTreeProps extends Omit<BasicSelectTreeProps, "treeData" | "nameKey" | "idKey" | "childrenKey" | "onGetNodePaths" | "onGetData"> {
/** appKey默认 DICTIONARY_APP_KEY_ENUM.DEFAULT0bb989ecada5470c87635018ece9f327 */ /** appKey默认 DICTIONARY_APP_KEY_ENUM.DEFAULT0bb989ecada5470c87635018ece9f327 */
appKey?: string; appKey?: string;
/** 要获取的字典 */ /** 要获取的字典 */
@ -13,6 +20,10 @@ export interface DictionarySelectTreeProps extends Omit<BasicSelectTreeProps, "t
nameKey?: string; nameKey?: string;
/** 树形数据 value 字段,默认 dictValue */ /** 树形数据 value 字段,默认 dictValue */
idKey?: string; idKey?: string;
/** 获取父级节点 */
onGetNodePaths?: (nodes: Data[]) => void;
/** 获取数据 */
onGetData?: (data: Data[], processedData: Data[]) => void;
} }
/** /**

View File

@ -1,16 +1,27 @@
import type { FC } from "react"; import type { FC } from "react";
import type { BasicSelectTreeProps } from "../../Basic"; import type { BasicSelectTreeProps } from "../../Basic";
interface Data {
dictValue: string;
dictLabel: string;
children: Data[];
[key: string]: any;
}
/** /**
* *
*/ */
export interface HiddenLevelSelectTreeProps extends Omit<BasicSelectTreeProps, "treeData" | "nameKey" | "idKey" | "childrenKey" | "level"> { export interface HiddenLevelSelectTreeProps extends Omit<BasicSelectTreeProps, "treeData" | "nameKey" | "idKey" | "childrenKey" | "level" | "onGetNodePaths" | "onGetData"> {
/** 是否显示忽略隐患,默认 true */ /** 是否显示忽略隐患,默认 true */
isShowNeglect?: boolean; isShowNeglect?: boolean;
/** 是否显示较大隐患,默认 true */ /** 是否显示较大隐患,默认 true */
isShowLarger?: boolean; isShowLarger?: boolean;
/** 是否显示重大隐患,默认 true */ /** 是否显示重大隐患,默认 true */
isShowMajor?: boolean; isShowMajor?: boolean;
/** 获取父级节点 */
onGetNodePaths?: (nodes: Data[]) => void;
/** 获取数据 */
onGetData?: (data: Data[], processedData: Data[]) => void;
} }
/** /**

View File

@ -1,6 +1,13 @@
import type { FC } from "react"; import type { FC } from "react";
import type { BasicSelectTreeProps } from "../../Basic"; import type { BasicSelectTreeProps } from "../../Basic";
interface Data {
hiddenregionId: string;
hiddenregion: string;
children: Data[];
[key: string]: any;
}
/** /**
* *
*/ */
@ -12,11 +19,15 @@ export interface Params {
/** /**
* *
*/ */
export interface HiddenPartSelectTreeProps extends Omit<BasicSelectTreeProps, "treeData" | "nameKey" | "idKey" | "childrenKey"> { export interface HiddenPartSelectTreeProps extends Omit<BasicSelectTreeProps, "treeData" | "nameKey" | "idKey" | "childrenKey" | "onGetNodePaths" | "onGetData"> {
/** 请求参数 */ /** 请求参数 */
params?: Params; params?: Params;
/** 是否需要企业id默认 false */ /** 是否需要企业id默认 false */
isNeedCorpInfoId?: boolean; isNeedCorpInfoId?: boolean;
/** 获取父级节点 */
onGetNodePaths?: (nodes: Data[]) => void;
/** 获取数据 */
onGetData?: (data: Data[], processedData: Data[]) => void;
} }
/** /**

View File

@ -1,11 +1,20 @@
import type { FC } from "react"; import type { FC } from "react";
import type { BasicSelectTreeProps } from "../Basic"; import type { BasicSelectTreeProps } from "../Basic";
interface Data {
dict_value: string;
dict_label: string;
childrenList: Data[];
}
/** /**
* *
*/ */
export interface IndustrySelectTreeProps extends Omit<BasicSelectTreeProps, "treeData" | "placeholder" | "nameKey" | "idKey" | "childrenKey"> { export interface IndustrySelectTreeProps extends Omit<BasicSelectTreeProps, "treeData" | "placeholder" | "nameKey" | "idKey" | "childrenKey" | "onGetNodePaths" | "onGetData"> {
/** 获取父级节点 */
onGetNodePaths?: (nodes: Data[]) => void;
/** 获取数据 */
onGetData?: (data: Data[], processedData: Data[]) => void;
} }
/** /**

View File

@ -1,4 +1,18 @@
export type getUserInfoFunction = () => Promise<Record<string, any>>; interface Data {
corpinfoId: string;
corpinfoName: string;
departmentId: string;
departmentName: string;
id: string;
name: string;
postId: string;
postName: string;
userId: string;
username: string;
[key: string]: any;
}
export type getUserInfoFunction = () => Promise<Data>;
/** /**
* *