更改表单模型类型逻辑

This commit is contained in:
2026-05-12 15:03:47 +08:00
parent f2266317e2
commit 34bc30a2c5
3 changed files with 23 additions and 22 deletions

View File

@@ -342,22 +342,8 @@
<el-input v-model="userInput" placeholder="说点什么..." class="chat-input" @keydown.enter="sendMessage" />
<!-- 右侧发送/暂停按钮 -->
<el-button
v-if="!isCreating"
type="primary"
:icon="Promotion"
@click="sendMessage"
class="send-btn"
circle
/>
<el-button
v-else
type="danger"
:icon="VideoPause"
@click="stopExecution"
class="send-btn"
circle
/>
<el-button v-if="!isCreating" type="primary" :icon="Promotion" @click="sendMessage" class="send-btn" circle />
<el-button v-else type="danger" :icon="VideoPause" @click="stopExecution" class="send-btn" circle />
</div>
<!-- 已选技能标签 -->
@@ -513,7 +499,7 @@
<SkillSelector v-model="showCreationSkillSelector" :default-skill="selectedCreationSkill" @confirm="handleCreationSkillConfirm" />
<!-- 模型选择器 -->
<ModelSelector v-model="showModelSelector" :default-model="selectedModelData" @confirm="handleModelConfirm" />
<ModelSelector v-model="showModelSelector" :default-model="selectedModelData" :model-type="currentNodeModelType" @confirm="handleModelConfirm" />
<!-- 对话模型选择器 -->
<el-dialog v-model="showChatModelSelector" title="设置对话模型" width="900px" :close-on-click-modal="false">
@@ -758,6 +744,18 @@ const currentNodeSkillOption = computed(() => {
});
return skillOption;
});
// 获取当前节点的模型类型
const currentNodeModelType = computed(() => {
let modelType = 1; // 默认为推理模型
nodeLibraryGroups.value.forEach((group) => {
(group.items || []).forEach((item) => {
if (item.nodeCode === formState.nodeCode) {
modelType = item.modelType || 1;
}
});
});
return modelType;
});
// 获取当前选中模型的表单字段
const currentModelForm = computed<NodeLibraryFormItem[]>(() => {
// 不显示模型的表单字段,返回空数组
@@ -1314,9 +1312,9 @@ const stopExecution = async () => {
try {
// TODO: 调用终止执行的接口
// await stopExecutionApi({ sessionId: getSessionId() });
ElMessage.warning('终止执行功能开发中...');
// 暂时直接停止加载状态
isCreating.value = false;
} catch (error) {
@@ -1347,7 +1345,7 @@ const handleTreeNodeClick = async (data: TreeNode) => {
currentSessionId.value = data.sessionId || null;
// 标记为从工作空间进入
isFromWorkspace.value = true;
// 切换到创作模式
isCreationMode.value = true;
currentWorkflowForCreation.value = res.data;