cc 1 день назад
Родитель
Сommit
037d99faca

+ 2 - 59
ai-electron/frontend/src/ai/views/aiModel/index.vue

@@ -4,7 +4,6 @@
     <a-tabs v-model:active-key="activeTab" class="ai-model__tabs" size="small" destroy-inactive-tab-pane>
       <template #rightExtra>
         <div class="ai-topbar__actions">
-          <span class="ai-topbar__meta ai-model__summary">{{ summary }}</span>
           <a-button :loading="loading" @click="load">
             <template #icon><Icon icon="mdi:refresh" :size="14" /></template>
             刷新
@@ -22,8 +21,6 @@
           <span class="ai-model__tab-count">{{ listOf(tab.key).length }}</span>
         </template>
 
-        <div class="ai-model__hint">{{ tab.hint }}</div>
-
         <a-spin :spinning="loading">
           <div v-if="listOf(tab.key).length" class="ai-model__grid">
             <article v-for="record in listOf(tab.key)" :key="record.id" class="ai-model__card">
@@ -47,7 +44,6 @@
               </div>
 
               <div class="ai-model__card-meta">
-                <span class="ai-model__mono">{{ maskKey(record.apiKey) }}</span>
                 <span class="ai-model__mono ai-model__ellipsis" :title="record.baseUrl">
                   {{ record.baseUrl || '—' }}
                 </span>
@@ -118,20 +114,11 @@
   interface ModelTab {
     key: ModelTypeKey;
     label: string;
-    hint: string;
   }
 
   const TABS: ModelTab[] = [
-    {
-      key: 'llm',
-      label: '对话模型',
-      hint: '对话模型用于驱动 AI 对话与分析推理。默认对话模型会在新建会话时自动绑定,会话中也可随时切换。API Key 仅用于服务端调用模型,前端不会用于任何直连请求。',
-    },
-    {
-      key: 'embedding',
-      label: '向量模型',
-      hint: '向量模型用于把表结构转成向量以支持语义检索,不参与对话。默认向量模型在构建表结构索引时使用,切换默认后新构建的索引将使用新模型。',
-    },
+    { key: 'llm', label: '对话模型' },
+    { key: 'embedding', label: '向量模型' },
   ];
 
   const models = ref<AiModel[]>([]);
@@ -151,20 +138,6 @@
     return key === 'embedding' ? embeddingModels.value : llmModels.value;
   }
 
-  function defaultOf(key: ModelTypeKey) {
-    return listOf(key).find((m) => m.defaultModel);
-  }
-
-  const summary = computed(() => {
-    if (!models.value.length) return '尚未配置模型';
-    const parts = [`${models.value.length} 个模型`];
-    parts.push(`默认对话:${defaultOf('llm')?.name || defaultOf('llm')?.modelId || '未设置'}`);
-    if (embeddingModels.value.length) {
-      parts.push(`默认向量:${defaultOf('embedding')?.name || defaultOf('embedding')?.modelId || '未设置'}`);
-    }
-    return parts.join(' · ');
-  });
-
   /**
    * 状态展示:后端 StatusEnum 为 ACTIVE / SUSPENDED / ARCHIVED / DISABLED / DELETED
    * (DELETED 已被列表接口过滤,不会出现)
@@ -271,13 +244,6 @@
       },
     });
   }
-
-  /** API Key 脱敏展示 */
-  function maskKey(key?: string) {
-    if (!key) return '—';
-    if (key.length <= 8) return '••••••';
-    return `${key.slice(0, 4)}••••${key.slice(-4)}`;
-  }
 </script>
 
 <style lang="less" scoped>
@@ -320,14 +286,6 @@
       }
     }
 
-    /* 摘要与页签同在一行,过长时限宽省略,避免把页签挤进溢出下拉 */
-    &__summary {
-      max-width: 360px;
-      overflow: hidden;
-      white-space: nowrap;
-      text-overflow: ellipsis;
-    }
-
     &__tab-count {
       display: inline-block;
       min-width: 18px;
@@ -342,21 +300,6 @@
       border-radius: 999px;
     }
 
-    &__hint {
-      margin-bottom: var(--ai-sp-2);
-      padding: var(--ai-sp-3);
-      font-size: 12.5px;
-      line-height: 1.75;
-      color: var(--ai-text-2);
-      background: var(--ai-primary-softer);
-      border-left: 3px solid fade(@primary-color, 45%);
-      border-radius: 0 var(--ai-radius-sm) var(--ai-radius-sm) 0;
-
-      b {
-        color: var(--ai-text);
-      }
-    }
-
     /* 卡片网格:间距取分析页那一档(8px);圆角比页面外壳(12px)低一档,用 --ai-radius(8px) */
     &__grid {
       display: grid;

+ 5 - 5
ai-electron/frontend/src/ai/views/aiWorkbench/index.vue

@@ -327,26 +327,26 @@
   /*
    * 下载管理入口的图标按钮观感:传统壳那套 `.jeesite-layout-header-action > div`
    * 规则只存在于传统布局样式表(layouts/default/header/index.less),工作台路由下
-   * 不加载,这里自带一份(取值与 `jeesite-header-action-button` 一致),
+   * 不加载,这里自带一份(取值与 `jeesite-header-action-button` 一致:顶栏缩排后 30×28),
    * 只作用于本页,不影响传统壳原有外观。
    */
   .awb-page .jeesite-app-download-manager-trigger {
     display: inline-flex;
     align-items: center;
     justify-content: center;
-    width: 36px;
-    height: 38px;
+    width: 30px;
+    height: 28px;
     padding: 0 2px;
     color: inherit;
     background: transparent;
-    border-radius: 10px;
+    border-radius: 8px;
     cursor: pointer;
     transition: background-color 0.2s ease;
 
     .dl-trigger__icon {
       display: inline-flex;
       align-items: center;
-      font-size: 18px;
+      font-size: 14px;
       line-height: 1;
     }
 

+ 23 - 13
ai-electron/frontend/src/core/components/Application/src/AppTopBar.vue

@@ -123,7 +123,7 @@
   .app-topbar {
     display: flex;
     align-items: center;
-    gap: 12px;
+    gap: 9px;
     flex: 0 0 auto;
     height: @header-height;
     padding: 0 8px 0 0;
@@ -152,11 +152,11 @@
       display: flex;
       align-items: center;
       justify-content: center;
-      /* 用 100% 而非固定 48px:顶栏有 1px 下边框,固定值会溢出并被裁掉 */
+      /* 用 100% 而非固定高度:顶栏有 1px 下边框,固定值会溢出并被裁掉 */
       height: 100%;
-      min-width: 192px;
-      padding: 0 10px;
-      font-size: 14px;
+      min-width: 150px;
+      padding: 0 8px;
+      font-size: 12px;
       font-weight: bold;
 
       /* 图片尺寸必须在这里定死:布局壳的对应规则只在传统壳样式表里,工作台路由下不会加载 */
@@ -166,6 +166,16 @@
         margin-right: 2px;
         flex: 0 0 auto;
       }
+
+      /* 标题随顶栏缩排(AppLogo 全局 18px 是老值,顶栏这一行按 0.75 收敛) */
+      .jeesite-app-logo__title {
+        gap: 5px;
+        font-size: 13.5px;
+
+        .app-version {
+          font-size: 10px;
+        }
+      }
     }
 
     &__spacer {
@@ -177,14 +187,14 @@
     &__case {
       display: inline-flex;
       align-items: center;
-      gap: 6px;
+      gap: 5px;
       flex: 0 0 auto;
-      max-width: 320px;
-      padding: 3px 11px;
+      max-width: 300px;
+      padding: 2px 9px;
       overflow: hidden;
-      font-size: 12.5px;
-      /* 自带行高:布局壳给顶栏设过 48px 行高,继承下来会把胶囊撑出顶栏 */
-      line-height: 1.5;
+      font-size: 11px;
+      /* 自带行高:布局壳给顶栏设过大行高,继承下来会把胶囊撑出顶栏 */
+      line-height: 1.4;
       color: @text-color-secondary;
       white-space: nowrap;
       background: @component-background;
@@ -207,7 +217,7 @@
     &__case-exit {
       flex: 0 0 auto;
       padding: 0;
-      font-size: 11.5px;
+      font-size: 10.5px;
       color: @text-color-help-dark;
       background: transparent;
       border: none;
@@ -243,7 +253,7 @@
       display: block;
       flex: 0 0 auto;
       width: 1px;
-      height: 20px;
+      height: 15px;
       padding: 0;
       border: 0;
       background: @border-color-base;

+ 2 - 2
ai-electron/frontend/src/core/components/SimpleMenu/src/SimpleSubMenu.vue

@@ -8,7 +8,7 @@
     :title="getI18nName"
     :item="getMenuItem"
   >
-    <Icon v-if="getIcon" :icon="getIcon" :size="16" />
+    <Icon v-if="getIcon" :icon="getIcon" :size="15" />
     <div v-if="collapsedShowTitle && getIsCollapseParent" class="collapse-title mt-1">
       {{ getI18nName }}
     </div>
@@ -28,7 +28,7 @@
     :title="getI18nName"
   >
     <template #title>
-      <Icon v-if="getIcon" :icon="getIcon" :size="16" />
+      <Icon v-if="getIcon" :icon="getIcon" :size="15" />
 
       <div v-if="collapsedShowTitle && getIsCollapseParent" class="collapse-title mt-2">
         {{ getI18nName }}

+ 10 - 8
ai-electron/frontend/src/core/components/SimpleMenu/src/components/menu.less

@@ -38,8 +38,8 @@
     &-submenu-title {
       position: relative;
       z-index: 1;
-      // padding: 12px 20px; // 1
-      padding: 11px 20px; // 2
+      /* 顶栏缩排(36px)后菜单同步降密:项高 44 → 34(11+22 → 7+20),左右 20 → 16 */
+      padding: 7px 16px;
       color: @menu-dark-subsidiary-color;
       cursor: pointer;
       transition: all @transition-time @ease-in-out;
@@ -131,6 +131,7 @@
     }
 
     &-submenu-title {
+      font-size: 13px;
       font-weight: bold;
     }
 
@@ -138,6 +139,7 @@
       position: relative;
       z-index: 1;
       display: flex;
+      font-size: 13px;
       color: inherit;
       list-style: none;
       cursor: pointer;
@@ -168,8 +170,8 @@
     &-vertical &-submenu-title {
       position: relative;
       z-index: 1;
-      // padding: 12px 20px;  // 1
-      padding: 11px 20px; // 2
+      /* 与上面降密后的行高一致:34px 项(原 11px 20px → 44px) */
+      padding: 7px 16px;
       overflow: hidden;
       text-overflow: ellipsis;
       white-space: nowrap;
@@ -181,13 +183,11 @@
 
       .@{menu-prefix-cls}-tooltip {
         width: calc(100% - 0px);
-        // padding: 12px 0; // 1
-        padding: 11px 0; // 2
+        padding: 7px 0;
         text-align: center;
       }
       .@{menu-prefix-cls}-submenu-popup {
-        // padding: 11px 0; // 1
-        padding: 12px 0; // 2
+        padding: 8px 0;
       }
     }
 
@@ -342,3 +342,5 @@
     }
   }
 }
+
+/* 菜单密度:与 36px 顶栏配套的行高见上方 item/submenu-title padding(44 → 34) */

+ 4 - 4
ai-electron/frontend/src/core/design/var/index.less

@@ -2,11 +2,11 @@
 @import 'easing';
 @import 'breakpoint';
 
-// headers、HEADER_HEIGHT
-@header-height: 48px;
+// headers、HEADER_HEIGHT(顶栏全局统一:48 → 36,两个壳共用;传统壳写死 48 的地方见 MultipleHeader.vue)
+@header-height: 36px;
 
-// logo width
-@logo-width: 32px;
+// logo width(顶栏缩排同比:32 → 24,顶部 logo 行都按 @header-height 对齐,一起缩才不打架)
+@logo-width: 24px;
 
 @side-drag-z-index: 200;
 

+ 2 - 1
ai-electron/frontend/src/core/layouts/default/header/MultipleHeader.vue

@@ -20,7 +20,8 @@
   import { useLayoutHeight } from '../content/useContentViewHeight';
   import { useMultipleTabStore } from '@/core/store/modules/multipleTab';
 
-  const HEADER_HEIGHT = 48;
+  /** 顶栏高度:与共享变量 @header-height 保持一致(顶栏全局统一 36,fixed 全 header 时页签栏要接在它下面) */
+  const HEADER_HEIGHT = 36;
   const TABS_HEIGHT = 35;
   const TABS_HEIGHT_LARGE = 35;
 

+ 12 - 11
ai-electron/frontend/src/core/layouts/default/header/index.less

@@ -292,15 +292,15 @@
       align-items: center;
       justify-content: center;
       gap: 0;
-      width: 36px;
-      min-width: 36px;
-      height: 36px;
+      width: 30px;
+      min-width: 30px;
+      height: 28px;
       padding: 0;
-      border-radius: 10px;
-      font-size: 16px;
+      border-radius: 8px;
+      font-size: 13px;
 
       .anticon {
-        font-size: 18px;
+        font-size: 14px;
       }
     }
   }
@@ -329,17 +329,18 @@
     }
   }
 
+  /* 图标按钮:随顶栏缩排(36 → 30×28),与工作台下载入口同规格 */
   .jeesite-header-action-button,
   &-action-button.ant-btn {
     display: inline-flex;
     position: relative;
     align-items: center;
     justify-content: center;
-    width: 36px;
-    min-width: 36px;
-    height: 36px;
+    width: 30px;
+    min-width: 30px;
+    height: 28px;
     padding: 0;
-    border-radius: 10px;
+    border-radius: 8px;
     border-color: transparent;
     background: transparent;
     box-shadow: none;
@@ -395,7 +396,7 @@
     position: relative;
     align-items: center;
     width: 100%;
-    height: 30px;
+    height: 24px;
     padding: 0 10px;
     border: 1px solid transparent;
     border-radius: 4px;