]> acesimba.cloud Git - StationBuilder-vue.git/commitdiff
内部工具配置页改造:仅保留模型类型/模型选择与保存按钮
authorroot <root@localhost.localdomain>
Tue, 29 Sep 2026 02:09:13 +0000 (10:09 +0800)
committerroot <root@localhost.localdomain>
Tue, 29 Sep 2026 02:09:13 +0000 (10:09 +0800)
- ToolSettings.vue 删除工具名称/内部 AI 服务/工具版本/配置说明
- 模型类型下拉:WISE-Agent / Workbuddy AI Plan / 自定义(默认 Workbuddy AI Plan)
- 模型选择联动:Workbuddy AI Plan 仅可选 Hy3·免费;WISE-Agent/自定义 仅占位项「...」且选择无效
- 保留保存配置按钮;沿用既有 Element Plus 组件与 var(--ant-*) 令牌样式
- 重新构建 dist-vue 并经 Playwright 端到端验证

src-vue/pages/ToolSettings.vue

index 4d0d4c0a284bca69121d34f1b7bad02b513448a9..6ab6011d0b744c057dcaf332dfad6e577a5eda3d 100644 (file)
@@ -1,6 +1,5 @@
 <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";
@@ -17,6 +16,9 @@ const props = defineProps({
   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,
@@ -24,24 +26,34 @@ watch(
 );
 
 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>