<script setup>
import { ref, watch } from "vue";
-import UiInput from "../ui/UiInput.vue";
import UiSelect from "../ui/UiSelect.vue";
import UiActions from "../ui/UiActions.vue";
import Panel from "../components/Panel.vue";
notify: { type: Function, default: () => {} },
});
+const MODEL_TYPES = ["WISE-Agent", "Workbuddy AI Plan", "自定义"];
+// 现版本行为(选择免费模型)对应 Workbuddy AI Plan,故默认该项
+const modelType = ref("Workbuddy AI Plan");
const draftModel = ref(props.model);
watch(
() => props.model,
);
const freeModels = MODELS.filter((item) => item.rate === "0.00x");
+
+// 模型类型为 WISE-Agent / 自定义 时,模型选择仅剩占位项「...」,选择后无效
+function onModelSelect(e) {
+ if (modelType.value !== "Workbuddy AI Plan") return;
+ draftModel.value = e.target.value;
+}
</script>
<template>
<div class="system-settings-page">
<Panel title="内部工具配置">
<div class="settings-form">
- <Field label="工具名称"><UiInput value="StationBuilder" :readonly="true" /></Field>
- <Field label="内部 AI 服务"><UiInput value="Wordbuddy AI" :readonly="true" /></Field>
- <Field label="默认模型" hint="当前仅开放免费模型">
- <UiSelect :value="draftModel" @change="(e) => (draftModel = e.target.value)">
- <option v-for="item in freeModels" :key="item.name" :value="item.name">{{ item.name }} · {{ item.tag || "免费" }}</option>
+ <Field label="模型类型">
+ <UiSelect :value="modelType" @change="(e) => (modelType = e.target.value)">
+ <option v-for="t in MODEL_TYPES" :key="t" :value="t">{{ t }}</option>
+ </UiSelect>
+ </Field>
+ <Field label="模型选择" :hint="modelType === 'Workbuddy AI Plan' ? '当前仅开放免费模型' : ''">
+ <UiSelect
+ :value="modelType === 'Workbuddy AI Plan' ? draftModel : '...'"
+ @change="onModelSelect"
+ >
+ <template v-if="modelType === 'Workbuddy AI Plan'">
+ <option v-for="item in freeModels" :key="item.name" :value="item.name">{{ item.name }} · {{ item.tag || "免费" }}</option>
+ </template>
+ <option v-else value="...">...</option>
</UiSelect>
</Field>
- <Field label="工具版本"><UiInput value="v0.4" :readonly="true" /></Field>
- <div class="settings-note">
- <strong>配置说明</strong>
- <span>此处集中维护原侧栏底部的内部工具配置。保存后,新建的 AI 会话将使用所选默认模型。</span>
- </div>
<UiActions className="settings-actions">
<ElButton @click="() => { onModelChange(draftModel); notify('内部工具配置已保存'); }">保存配置</ElButton>
</UiActions>