更新模型类型字段名称,统一为 modelType,以提高代码一致性和可读性。涉及多个组件和接口的相应调整,确保功能正常。
This commit is contained in:
@@ -4,7 +4,7 @@ export interface ModelModuleListParams {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
modelName?: string;
|
||||
modelsType?: number | string;
|
||||
modelType?: number | string;
|
||||
}
|
||||
|
||||
export interface ModelFormItem {
|
||||
@@ -23,7 +23,7 @@ export interface ModelFormEntry {
|
||||
export interface ModelTypeListItem {
|
||||
id?: number | string;
|
||||
typeId?: number | string;
|
||||
modelsType?: number | string;
|
||||
modelType?: number | string;
|
||||
name?: string;
|
||||
typeName?: string;
|
||||
label?: string;
|
||||
@@ -55,7 +55,7 @@ export function normalizeModelTypeOptions(res: { data?: unknown }): Array<{ id:
|
||||
const arr: ModelTypeListItem[] = Array.isArray(raw) ? raw : ((raw as { list?: ModelTypeListItem[] })?.list ?? []);
|
||||
return arr
|
||||
.map((item) => {
|
||||
const id = item.id ?? item.typeId ?? item.modelsType;
|
||||
const id = item.id ?? item.typeId ?? item.modelType;
|
||||
const label = item.name ?? item.typeName ?? item.label ?? (id != null && id !== '' ? String(id) : '');
|
||||
return { id: id as number | string, label: label || String(id) };
|
||||
})
|
||||
@@ -73,7 +73,7 @@ export interface ModelModuleItem {
|
||||
isDeleted?: boolean;
|
||||
modelName: string;
|
||||
/** 模型类型 ID,与 listType 返回项对应 */
|
||||
modelsType?: number | string;
|
||||
modelType?: number | string;
|
||||
baseUrl: string;
|
||||
route?: string;
|
||||
httpMethod: string;
|
||||
@@ -110,7 +110,7 @@ export interface ModelModuleListResponse {
|
||||
export interface CreateModelParams {
|
||||
modelName: string;
|
||||
/** 与 listType 返回的类型 id 一致,可能为数字或字符串 */
|
||||
modelsType: number | string;
|
||||
modelType: number | string;
|
||||
baseUrl: string;
|
||||
httpMethod?: string;
|
||||
headMsg?: string;
|
||||
|
||||
Reference in New Issue
Block a user