5
0

3 Коммиты e2f16a56ff ... 6b756844d5

Автор SHA1 Сообщение Дата
  cc 6b756844d5 1 2 недель назад
  cc 359c50e3f7 1 2 недель назад
  cc 343c4d6493 1 2 недель назад

+ 2 - 3
ai-electron/frontend/src/workbench/components/VisibleScopeField.vue

@@ -5,8 +5,9 @@
         {{ item.label }}
       </a-radio>
     </a-radio-group>
+    <!-- 部门树仅对「本部门」(scope=1)有意义,其余范围隐藏选择框 -->
     <a-tree-select
-      v-if="showDept"
+      v-if="scope === '1'"
       :value="ownerDeptId"
       :tree-data="deptOptions"
       :field-names="{ label: 'label', value: 'id', children: 'children' }"
@@ -30,12 +31,10 @@
       ownerDeptId?: string | number;
       deptOptions?: DeptOption[];
       options?: VisibleScopeOption[];
-      showDept?: boolean;
     }>(),
     {
       deptOptions: () => [],
       options: () => [],
-      showDept: true,
     },
   );
 

+ 9 - 46
ai-electron/frontend/src/workbench/views/agent/entry/index.vue

@@ -104,20 +104,6 @@
           </div>
         </section>
 
-        <section class="entry-section">
-          <h4 class="entry-section-title">可见范围</h4>
-          <div class="entry-grid">
-            <a-form-item label="可见范围" name="visibleScope" class="entry-span-all">
-              <VisibleScopeField
-                v-model:scope="form.visibleScope"
-                v-model:owner-dept-id="form.ownerDeptId"
-                :options="scopeOptions"
-                :dept-options="deptOptions"
-              />
-            </a-form-item>
-          </div>
-        </section>
-
         <section class="entry-section">
           <h4 class="entry-section-title">系统提示词</h4>
           <a-form-item name="sysPrompt" class="entry-no-label">
@@ -183,18 +169,10 @@
     message,
   } from 'ant-design-vue';
   import { Icon } from '@/core/components/Icon';
-  import VisibleScopeField from '@/workbench/components/VisibleScopeField.vue';
-  import {
-    AGENT_SCOPE_OPTIONS,
-    normalizeDeptTree,
-    scopeOptionsForUser,
-  } from '@/workbench/constants/visibleScope';
-  import { getAgentScopeOptions, getEntryAgent, updateEntryAgent } from '@/workbench/api/agent';
+  import { getEntryAgent, updateEntryAgent } from '@/workbench/api/agent';
   import { optionModelConfig } from '@/workbench/api/model';
 
   const modelOptions = ref<any[]>([]);
-  const deptOptions = ref<any[]>([]);
-  const canPublic = ref(false);
   const buttonLoading = ref(false);
   const loaded = ref(false);
   const loading = ref(true);
@@ -214,14 +192,9 @@
     maxIters: 10,
     status: '0',
     remark: undefined as string | undefined,
-    ownerDeptId: undefined as string | number | undefined,
-    visibleScope: undefined as string | undefined,
   };
 
   const form = ref<any>({ ...initFormData });
-  const scopeOptions = computed(() =>
-    scopeOptionsForUser(AGENT_SCOPE_OPTIONS, canPublic.value, form.value.visibleScope),
-  );
 
   const rules: any = computed(() => ({
     agentName: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
@@ -230,21 +203,11 @@
   }));
 
   const loadOptions = async () => {
-    const [modelRes, scopeRes] = await Promise.allSettled([
-      optionModelConfig('chat'),
-      getAgentScopeOptions(),
-    ]);
-    if (modelRes.status === 'fulfilled') {
-      modelOptions.value = modelRes.value ?? [];
-    } else {
+    try {
+      modelOptions.value = (await optionModelConfig('chat')) ?? [];
+    } catch {
       message.warning('模型 选项加载失败,对应下拉暂不可用');
     }
-    if (scopeRes.status === 'fulfilled') {
-      deptOptions.value = normalizeDeptTree(scopeRes.value?.depts ?? []);
-      canPublic.value = !!scopeRes.value?.superAdmin;
-    } else {
-      message.warning('部门 选项加载失败,归属部门暂不可选');
-    }
   };
 
   const loadEntry = async () => {
@@ -258,8 +221,9 @@
       form.value = {
         ...initFormData,
         ...data,
-        visibleScope: data.visibleScope ?? (canPublic.value ? '0' : '2'),
-        ownerDeptId: data.ownerDeptId ?? undefined,
+        // 入口智能体固定全员可见,不提供可见范围配置;保存时随 payload 落库
+        visibleScope: '0',
+        ownerDeptId: null,
         dailyTokenQuota: data.dailyTokenQuota ?? 0,
         dailyRequestQuota: data.dailyRequestQuota ?? 0,
         monthlyTokenQuota: data.monthlyTokenQuota ?? 0,
@@ -288,9 +252,8 @@
     }
   };
 
-  onMounted(async () => {
-    // 先加载可见范围选项,确保 loadEntry 能按当前用户身份选择默认值
-    await loadOptions();
+  onMounted(() => {
+    loadOptions();
     loadEntry();
   });
 </script>

+ 11 - 6
ai-electron/frontend/src/workbench/views/agent/expert/index.vue

@@ -1023,7 +1023,7 @@
 
   .expert-grid {
     display: grid;
-    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
+    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
     gap: 12px;
   }
 
@@ -1031,7 +1031,7 @@
     display: flex;
     flex-direction: column;
     min-width: 0;
-    min-height: 214px;
+    min-height: 230px;
     padding: 14px;
     background: #fff;
     border: 1px solid #e7ebf3;
@@ -1131,9 +1131,9 @@
   }
 
   .expert-card__meta {
-    display: flex;
-    flex-direction: column;
-    gap: 8px;
+    display: grid;
+    grid-template-columns: repeat(2, minmax(0, 1fr));
+    gap: 8px 14px;
     margin-top: 12px;
     padding-top: 12px;
     border-top: 1px dashed #eff2f7;
@@ -1144,7 +1144,7 @@
     align-items: center;
     justify-content: space-between;
     min-width: 0;
-    gap: 12px;
+    gap: 8px;
   }
 
   .expert-card__meta-label {
@@ -1185,8 +1185,13 @@
   }
 
   .expert-card__created {
+    display: block;
+    min-width: 0;
+    overflow: hidden;
     color: #98a2b3;
     font-size: 11px;
+    line-height: 18px;
+    text-overflow: ellipsis;
     white-space: nowrap;
   }
 

+ 0 - 1
ai-electron/frontend/src/workbench/views/agent/pack/index.vue

@@ -275,7 +275,6 @@
             v-model:owner-dept-id="form.ownerDeptId"
             :options="scopeOptions"
             :dept-options="deptOptions"
-            :show-dept="form.visibleScope === '1'"
           />
         </a-form-item>
         <a-form-item name="remark">

+ 0 - 1
ai-electron/frontend/src/workbench/views/agent/skill/index.vue

@@ -183,7 +183,6 @@
             v-model:owner-dept-id="form.ownerDeptId"
             :options="scopeOptions"
             :dept-options="deptOptions"
-            :show-dept="form.visibleScope === '1'"
           />
         </a-form-item>
         <a-form-item label="备注">

+ 0 - 1
ai-electron/frontend/src/workbench/views/kb/base/index.vue

@@ -304,7 +304,6 @@
             v-model:owner-dept-id="form.ownerDeptId"
             :options="scopeOptions"
             :dept-options="deptOptions"
-            :show-dept="form.visibleScope === '1'"
           />
         </a-form-item>
         <a-form-item label="描述" name="description">