From 77aaeebf1d1962cf94f305074b26453dd950cf41 Mon Sep 17 00:00:00 2001 From: 2910410219 <2910410219@qq.com> Date: Tue, 12 May 2026 16:43:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A8=A1=E5=9E=8B=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AD=97=E6=AE=B5=E5=90=8D=E7=A7=B0=EF=BC=8C=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E4=B8=BA=20`modelType`=EF=BC=8C=E4=BB=A5=E6=8F=90?= =?UTF-8?q?=E9=AB=98=E4=BB=A3=E7=A0=81=E4=B8=80=E8=87=B4=E6=80=A7=E5=92=8C?= =?UTF-8?q?=E5=8F=AF=E8=AF=BB=E6=80=A7=E3=80=82=E6=B6=89=E5=8F=8A=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E7=BB=84=E4=BB=B6=E5=92=8C=E6=8E=A5=E5=8F=A3=E7=9A=84?= =?UTF-8?q?=E7=9B=B8=E5=BA=94=E8=B0=83=E6=95=B4=EF=BC=8C=E7=A1=AE=E4=BF=9D?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=AD=A3=E5=B8=B8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modelConfig/modelModule/index.ts | 10 ++++---- src/components/model/ModelSelector.vue | 6 ++--- src/views/digitalHuman/creation/index.vue | 20 +++++++++++----- .../modelModule/component/editModule.vue | 14 +++++------ .../modelConfig/modelModule/index.vue | 24 +++++++++---------- 5 files changed, 41 insertions(+), 33 deletions(-) diff --git a/src/api/digitalHuman/modelConfig/modelModule/index.ts b/src/api/digitalHuman/modelConfig/modelModule/index.ts index dd5df37..556df16 100644 --- a/src/api/digitalHuman/modelConfig/modelModule/index.ts +++ b/src/api/digitalHuman/modelConfig/modelModule/index.ts @@ -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; diff --git a/src/components/model/ModelSelector.vue b/src/components/model/ModelSelector.vue index 178d2cc..0a0d718 100644 --- a/src/components/model/ModelSelector.vue +++ b/src/components/model/ModelSelector.vue @@ -23,7 +23,7 @@ @click="handleSelectModel(model)" >
-
{{ getModelTypeName(model.modelsType) }}
+
{{ getModelTypeName(model.modelType) }}
内置模型 @@ -101,7 +101,7 @@ interface ModelItem { id: string; tenantId?: number; modelName: string; - modelsType: number; + modelType: number; baseUrl: string; route: string; httpMethod: string; @@ -264,7 +264,7 @@ const handleCreatePrivateModel = async () => { const systemModel = systemModelToClone.value; const createParams = { modelName: apiKeyForm.modelName, - modelsType: systemModel.modelsType, + modelType: systemModel.modelType, baseUrl: systemModel.baseUrl, httpMethod: systemModel.httpMethod || 'POST', headMsg: systemModel.headMsg || '', diff --git a/src/views/digitalHuman/creation/index.vue b/src/views/digitalHuman/creation/index.vue index 05eb64e..9ce0bab 100644 --- a/src/views/digitalHuman/creation/index.vue +++ b/src/views/digitalHuman/creation/index.vue @@ -445,7 +445,12 @@
-
+
{{ workflow.flowName || workflow.flowTemplateName }}
{{ workflow.description || '暂无描述' }}
@@ -520,12 +525,14 @@ v-for="model in filteredChatModels" :key="model.id" class="chat-model-card" - :class="{ selected: selectedChatModel?.id === model.id }" + :class="{ selected: selectedChatModel?.id === model.id, 'is-chat-model': model.isChatModel === 1 }" @click="selectedChatModel = model" >
{{ model.modelName }}
{{ model.baseUrl }}
- +
@@ -1010,7 +1017,7 @@ const fetchChatModelList = async () => { const res: any = await getModelModuleList({ pageNum: chatModelPagination.pageNum, pageSize: chatModelPagination.pageSize, - modelsType: 1, // 传递 modelsType=1 给后端,获取推理模型 + modelType: 1, // 传递 modelType=1 给后端,获取推理模型 modelName: chatModelSearchKeyword.value || undefined, }); chatModelList.value = res.data?.list || []; @@ -2385,7 +2392,7 @@ onMounted(async () => { initLogicFlow(); await getNodeLibrary(); await fetchWorkflowList(); - + // 获取当前用户角色 try { const res: any = await checkIsSuperAdmin(); @@ -3562,7 +3569,8 @@ onBeforeUnmount(() => { box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2); transform: translateY(-2px); } -.chat-model-card.selected { +.chat-model-card.selected, +.chat-model-card.is-chat-model { border-color: #67c23a; background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); box-shadow: 0 4px 12px rgba(103, 194, 58, 0.2); diff --git a/src/views/digitalHuman/modelConfig/modelModule/component/editModule.vue b/src/views/digitalHuman/modelConfig/modelModule/component/editModule.vue index bad431e..894f895 100644 --- a/src/views/digitalHuman/modelConfig/modelModule/component/editModule.vue +++ b/src/views/digitalHuman/modelConfig/modelModule/component/editModule.vue @@ -17,8 +17,8 @@ - - + + @@ -279,7 +279,7 @@ const state = reactive({ ruleForm: { id: '', modelName: '', - modelsType: null as number | string | null, + modelType: null as number | string | null, baseUrl: '', httpMethod: 'POST', headMsg: '', @@ -299,7 +299,7 @@ const state = reactive({ }, rules: { modelName: [{ required: true, message: '请输入模型名称', trigger: 'blur' }], - modelsType: [ + modelType: [ { validator: (_rule: unknown, value: unknown, callback: (e?: Error) => void) => { if (value === null || value === undefined || value === '') { @@ -528,7 +528,7 @@ const fillFormFromDetailRow = (row: Record) => { state.ruleForm = { id: row.id as string, modelName: String(row.modelName ?? ''), - modelsType: row.modelsType !== undefined && row.modelsType !== null ? typeOptionValue(row.modelsType as number | string) : null, + modelType: row.modelType !== undefined && row.modelType !== null ? typeOptionValue(row.modelType as number | string) : null, baseUrl: String(row.baseUrl ?? ''), httpMethod: String(row.httpMethod || 'POST'), headMsg: String(row.headMsg || ''), @@ -605,7 +605,7 @@ const openDialog = async (type: string, row?: Record) => { state.ruleForm = { id: '', modelName: '', - modelsType: null, + modelType: null, baseUrl: '', httpMethod: 'POST', headMsg: '', @@ -659,7 +659,7 @@ const onSubmit = () => { const responseBody = responseBodyField ? { [responseBodyField.key.trim()]: responseBodyField.value } : {}; const submitData = { modelName: state.ruleForm.modelName, - modelsType: state.ruleForm.modelsType as number | string, + modelType: state.ruleForm.modelType as number | string, baseUrl: state.ruleForm.baseUrl, httpMethod: state.ruleForm.httpMethod || 'POST', headMsg: state.ruleForm.headMsg, diff --git a/src/views/digitalHuman/modelConfig/modelModule/index.vue b/src/views/digitalHuman/modelConfig/modelModule/index.vue index ba4cd0f..1e7aa29 100644 --- a/src/views/digitalHuman/modelConfig/modelModule/index.vue +++ b/src/views/digitalHuman/modelConfig/modelModule/index.vue @@ -32,7 +32,7 @@ @@ -59,7 +59,7 @@