Skip to content

Commit 24895be

Browse files
committed
【代码重构】AI:“聊天模型”重构为“模型”,支持 type 模型类型
1 parent 2ef484e commit 24895be

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/views/ai/chat/index/components/conversation/ConversationUpdateForm.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
<el-form-item label="模型" prop="modelId">
1919
<el-select v-model="formData.modelId" placeholder="请选择模型">
2020
<el-option
21-
v-for="chatModel in chatModelList"
22-
:key="chatModel.id"
23-
:label="chatModel.name"
24-
:value="chatModel.id"
21+
v-for="model in models"
22+
:key="model.id"
23+
:label="model.name"
24+
:value="model.id"
2525
/>
2626
</el-select>
2727
</el-form-item>
@@ -85,7 +85,7 @@ const formRules = reactive({
8585
maxContexts: [{ required: true, message: '上下文数量不能为空', trigger: 'blur' }]
8686
})
8787
const formRef = ref() // 表单 Ref
88-
const chatModelList = ref([] as ModelVO[]) // 聊天模型列表
88+
const models = ref([] as ModelVO[]) // 聊天模型列表
8989
9090
/** 打开弹窗 */
9191
const open = async (id: number) => {
@@ -107,7 +107,7 @@ const open = async (id: number) => {
107107
}
108108
}
109109
// 获得下拉数据
110-
chatModelList.value = await ModelApi.getModelSimpleList(AiModelTypeEnum.CHAT)
110+
models.value = await ModelApi.getModelSimpleList(AiModelTypeEnum.CHAT)
111111
}
112112
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
113113

src/views/ai/model/chatRole/ChatRoleForm.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
<el-form-item label="绑定模型" prop="modelId" v-if="!isUser">
1717
<el-select v-model="formData.modelId" placeholder="请选择模型" clearable>
1818
<el-option
19-
v-for="chatModel in chatModelList"
20-
:key="chatModel.id"
21-
:label="chatModel.name"
22-
:value="chatModel.id"
19+
v-for="model in models"
20+
:key="model.id"
21+
:label="model.name"
22+
:value="model.id"
2323
/>
2424
</el-select>
2525
</el-form-item>
@@ -95,7 +95,7 @@ const formData = ref({
9595
status: CommonStatusEnum.ENABLE
9696
})
9797
const formRef = ref() // 表单 Ref
98-
const chatModelList = ref([] as ModelVO[]) // 聊天模型列表
98+
const models = ref([] as ModelVO[]) // 聊天模型列表
9999
100100
/** 是否【我】自己创建,私有角色 */
101101
const isUser = computed(() => {
@@ -129,7 +129,7 @@ const open = async (type: string, id?: number, title?: string) => {
129129
}
130130
}
131131
// 获得下拉数据
132-
chatModelList.value = await ModelApi.getModelSimpleList(AiModelTypeEnum.CHAT)
132+
models.value = await ModelApi.getModelSimpleList(AiModelTypeEnum.CHAT)
133133
}
134134
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
135135

0 commit comments

Comments
 (0)