修复模型管理v2对话模型回显与异步弹窗崩溃问题
- 修复 chatModel 开关回显:字段大小写与后端对齐(chatModel) - 修复异步模型 asyncTaskMapping 内字段为 null 时编辑弹窗崩溃 - lastFrame 提交仅限视频模型,避免占位符误提交 - 切换返回类型时清空 responseBodyMapping 残留 - 列表页访问类型列改为供应商列(后端不再返回 PrivateModel) - ModelManageItem 类型与后端返回字段对齐(modelSupplier/chatModel/minDuration 等)
This commit is contained in:
@@ -43,9 +43,9 @@
|
||||
<el-tag :type="scope.row.systemModel ? 'warning' : 'success'">{{ scope.row.systemModel ? '系统' : '用户' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="访问类型">
|
||||
<el-table-column label="供应商" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.PrivateModel ? 'info' : 'primary'">{{ scope.row.PrivateModel ? '服务商模型' : '本地模型' }}</el-tag>
|
||||
{{ resolveSupplierLabel(scope.row.modelSupplier) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态">
|
||||
@@ -85,7 +85,7 @@ import { ref, reactive, onMounted } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { Search, Plus } from '@element-plus/icons-vue';
|
||||
import EditModule from './component/editModule.vue';
|
||||
import { listModelManage, getModelManageTypes, deleteModelManage, type ModelManageItem, type ModelTypeTreeNode } from '/@/api/settings/modelConfigV2';
|
||||
import { listModelManage, getModelManageTypes, deleteModelManage, getModelSupplierList, type ModelManageItem, type ModelTypeTreeNode, type ModelSupplierItem } from '/@/api/settings/modelConfigV2';
|
||||
|
||||
const searchParams = reactive({
|
||||
modelName: '',
|
||||
@@ -101,6 +101,7 @@ const pagination = reactive({
|
||||
const modelList = ref<ModelManageItem[]>([]);
|
||||
const loading = ref(false);
|
||||
const modelTypes = ref<ModelTypeTreeNode[]>([]);
|
||||
const supplierList = ref<ModelSupplierItem[]>([]);
|
||||
const editModuleRef = ref();
|
||||
|
||||
/** 级联选择器的选中路径(例:[200, 201]) */
|
||||
@@ -139,6 +140,22 @@ const loadModelTypes = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
/** 加载模型供应商列表 */
|
||||
const loadSupplierList = async () => {
|
||||
try {
|
||||
const res = await getModelSupplierList();
|
||||
supplierList.value = res.data?.list || [];
|
||||
} catch {
|
||||
supplierList.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
/** 根据供应商值显示名称 */
|
||||
const resolveSupplierLabel = (supplier: number | undefined | null): string => {
|
||||
if (supplier === undefined || supplier === null) return '—';
|
||||
return supplierList.value.find((s) => s.value === supplier)?.label ?? String(supplier);
|
||||
};
|
||||
|
||||
/** 获取模型列表 */
|
||||
const fetchModelList = async () => {
|
||||
loading.value = true;
|
||||
@@ -204,6 +221,7 @@ const handleDelete = (row: ModelManageItem) => {
|
||||
|
||||
onMounted(async () => {
|
||||
await loadModelTypes();
|
||||
loadSupplierList();
|
||||
fetchModelList();
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user