Просмотр исходного кода

fix: 优化弹框尺寸与打开案件加载体验

- 消息/通知下移到顶栏拖拽区下方,避免选字时误拖动窗口
- 弹框高度监听异步内容变化,修复授权弹框首次打开尺寸错误
- 授权信息弹框宽度对齐关于产品、字体恢复原值并移除底部操作栏
- 关于产品弹框移除底部操作栏
- 打开案件增加按钮 loading,全局 loading 提升到弹框之上
cc 15 часов назад
Родитель
Сommit
a546956ce0

+ 4 - 1
ai-electron/frontend/src/core/components/Loading/src/Loading.vue

@@ -43,7 +43,10 @@
     position: fixed;
     top: 0;
     left: 0;
-    z-index: 200;
+
+    /* 高于 antd Modal(1000) / message(1010):全局 loading 要在弹框之上可见,
+       否则「打开案件」等长耗时操作期间会被密码弹框完全遮住 */
+    z-index: 3000;
     display: flex;
     width: 100%;
     height: 100%;

+ 13 - 1
ai-electron/frontend/src/core/components/Modal/src/components/ModalWrapper.vue

@@ -44,6 +44,12 @@
 
       useWindowSizeFn(setModalHeight.bind(null));
 
+      /*
+        只监听 attributes 时,异步内容替换(如骨架屏 → 接口数据)属于 childList 变化,
+        不会触发回调,弹框会停留在骨架屏高度(看起来「大小不对」),
+        直到某些 class/文本变化(比如切换状态)才被动重算。这里把 childList、
+        characterData 一并监听,内容增删改都会重新量高度。
+      */
       useMutationObserver(
         spinRef,
         () => {
@@ -51,6 +57,8 @@
         },
         {
           attributes: true,
+          childList: true,
+          characterData: true,
           subtree: true,
         },
       );
@@ -67,7 +75,11 @@
       });
 
       watchEffect(() => {
-        props.useWrapper && setModalHeight();
+        // 打开时 ModalWrapper 才挂载,模板 ref 在 setup 阶段还没赋值,
+        // 直接调用会因取不到 DOM 而跳过,导致首次打开高度停留在初始值。
+        // 放到下一 tick,等 ref 就绪后再量一次。
+        if (!props.useWrapper || !props.open) return;
+        nextTick(() => setModalHeight());
       });
 
       watch(

+ 12 - 0
ai-electron/frontend/src/core/hooks/web/useMessage.tsx

@@ -263,9 +263,21 @@ function showMessage(content: JointContent, type?: string, duration?: number, on
   return messageRemove;
 }
 
+/**
+ * 消息 / 通知统一下移到顶栏下方。
+ *
+ * <p>顶栏(AppTopBar / AppHeader,@header-height = 40px)整条是窗口拖拽区,
+ * 而 antd 默认把消息固定在距窗口顶部 8px、通知 24px,提示条会压在拖拽带上:
+ * 在提示里按下鼠标会被 Chromium 当成拖动窗口,文字既选不中、也复制不了。
+ * 从 48px 起显示后,浮层与拖拽区不再有几何重叠,窗口拖拽和复制互不干扰。
+ */
+Message.config({
+  top: '48px',
+});
 notification.config({
   placement: 'topRight',
   duration: 3,
+  top: '48px',
 });
 
 /**

+ 74 - 45
ai-electron/frontend/src/core/layouts/default/setting/components/AuthorizationInfoModal.vue

@@ -1,11 +1,12 @@
 <template>
   <BasicModal
     v-bind="$attrs"
-    :width="980"
+    :width="860"
     :centered="true"
     :showCancelBtn="false"
+    :showOkBtn="false"
+    wrapClassName="authorization-info-modal-wrap"
     @register="registerModal"
-    @ok="closeModal"
   >
     <template #title>
       <div class="authorization-info__title">
@@ -344,7 +345,7 @@
     return String(value ?? '').trim();
   });
 
-  const [registerModal, { closeModal, setModalProps, getOpen }] = useModalInner();
+  const [registerModal, { setModalProps, getOpen }] = useModalInner();
 
   function setMockStatus(status: MockStatus) {
     mockStatus.value = status;
@@ -416,46 +417,74 @@
 <style lang="less">
   @prefix-cls: ~'jeesite-authorization-info-modal';
 
+  /*
+    内部容器尺寸按原设计的 2/3 收敛,字号保持原值;
+    弹框宽度与「关于产品」弹框一致(860)。
+    字号、间距、图标、圆角等直接使用收敛后的 px 值,
+    不使用 zoom/transform,避免影响弹框高度测量和内部滚动。
+  */
+
+  /* 弹框框架(标题栏 / 关闭按钮)同步缩小 */
+  .ant-modal-wrap.authorization-info-modal-wrap {
+    .ant-modal-content {
+      border-radius: 5px;
+    }
+
+    .ant-modal-header {
+      padding: 8px 11px;
+      border-radius: 5px 5px 0 0;
+    }
+
+    .jeesite-basic-modal-close {
+      margin-right: 7px;
+
+      .jeesite-icon {
+        padding: 11px 6px;
+        font-size: 18px;
+      }
+    }
+  }
+
   .@{prefix-cls} {
     display: flex;
     flex-direction: column;
-    gap: 16px;
-    padding-right: 4px;
+    gap: 11px;
+    padding-right: 3px;
 
     .authorization-info__title {
       display: inline-flex;
       align-items: center;
-      gap: 10px;
+      gap: 7px;
       color: #111827;
       font-size: 16px;
       font-weight: 600;
     }
 
     .authorization-info__mock-chip {
-      padding: 0 8px;
+      padding: 0 5px;
       color: #b45309;
       font-size: 11px;
       font-weight: 500;
       line-height: 20px;
       background: #fff7ed;
       border: 1px solid #fed7aa;
-      border-radius: 10px;
+      border-radius: 7px;
       cursor: default;
     }
 
     .authorization-info__loading {
-      padding: 8px 4px;
+      padding: 5px 3px;
     }
 
     .authorization-info__hero {
       display: flex;
       align-items: center;
       justify-content: space-between;
-      gap: 24px;
-      padding: 20px 22px;
+      gap: 16px;
+      padding: 13px 15px;
       background: #f4f8ff;
       border: 1px solid #dbe7ff;
-      border-radius: 16px;
+      border-radius: 11px;
 
       &.is-trial {
         background: #fff8ef;
@@ -512,7 +541,7 @@
     .authorization-info__hero-main {
       display: flex;
       align-items: center;
-      gap: 16px;
+      gap: 11px;
       min-width: 0;
     }
 
@@ -521,13 +550,13 @@
       flex: 0 0 auto;
       align-items: center;
       justify-content: center;
-      width: 52px;
-      height: 52px;
+      width: 35px;
+      height: 35px;
       color: #2a50ec;
       font-size: 26px;
       background: #fff;
-      border-radius: 14px;
-      box-shadow: 0 4px 12px rgb(15 23 42 / 6%);
+      border-radius: 9px;
+      box-shadow: 0 3px 8px rgb(15 23 42 / 6%);
     }
 
     .authorization-info__hero-content {
@@ -538,7 +567,7 @@
       display: flex;
       align-items: center;
       flex-wrap: wrap;
-      gap: 10px;
+      gap: 7px;
     }
 
     .authorization-info__status {
@@ -553,7 +582,7 @@
     }
 
     .authorization-info__hero-subject {
-      margin-top: 4px;
+      margin-top: 3px;
       overflow: hidden;
       color: #111827;
       font-size: 20px;
@@ -566,8 +595,8 @@
     .authorization-info__hero-meta {
       display: flex;
       align-items: center;
-      gap: 6px;
-      margin-top: 6px;
+      gap: 4px;
+      margin-top: 4px;
       color: #6b7280;
       font-size: 12px;
 
@@ -581,7 +610,7 @@
       flex: 0 0 auto;
       flex-direction: column;
       align-items: flex-end;
-      gap: 2px;
+      gap: 1px;
     }
 
     .authorization-info__hero-stat-value {
@@ -605,13 +634,13 @@
       display: flex;
       align-items: center;
       flex-wrap: wrap;
-      gap: 8px;
-      padding: 8px 12px;
+      gap: 5px;
+      padding: 5px 8px;
       color: #92400e;
       font-size: 12px;
       background: #fffbeb;
       border: 1px solid #fde68a;
-      border-radius: 10px;
+      border-radius: 7px;
     }
 
     .authorization-info__mock-switch-label {
@@ -619,7 +648,7 @@
     }
 
     .authorization-info__mock-switch-item {
-      padding: 2px 10px;
+      padding: 1px 7px;
       color: #92400e;
       font-size: 12px;
       line-height: 20px;
@@ -638,21 +667,21 @@
     .authorization-info__columns {
       display: grid;
       grid-template-columns: repeat(2, minmax(0, 1fr));
-      gap: 16px;
+      gap: 11px;
     }
 
     .authorization-info__section {
-      padding: 16px;
+      padding: 11px;
       background: #fff;
       border: 1px solid #e7edf6;
-      border-radius: 14px;
+      border-radius: 9px;
     }
 
     .authorization-info__section-head {
       display: flex;
       align-items: center;
-      gap: 8px;
-      margin-bottom: 10px;
+      gap: 5px;
+      margin-bottom: 7px;
       color: #111827;
       font-size: 14px;
       font-weight: 600;
@@ -665,8 +694,8 @@
 
     .authorization-info__field {
       display: flex;
-      gap: 12px;
-      padding: 10px 0;
+      gap: 8px;
+      padding: 7px 0;
       border-bottom: 1px dashed #edf1f7;
 
       &:last-child {
@@ -693,7 +722,7 @@
     .authorization-info__machine {
       display: flex;
       align-items: flex-end;
-      gap: 16px;
+      gap: 11px;
     }
 
     .authorization-info__machine-main {
@@ -703,12 +732,12 @@
 
     .authorization-info__machine .authorization-info__field-label {
       display: block;
-      margin-bottom: 6px;
+      margin-bottom: 4px;
     }
 
     .authorization-info__machine-code {
       display: block;
-      padding: 8px 10px;
+      padding: 5px 7px;
       color: #334155;
       font-family: Consolas, Monaco, 'Courier New', monospace;
       font-size: 12px;
@@ -716,29 +745,29 @@
       word-break: break-all;
       background: #f8fafc;
       border: 1px solid #e5e7eb;
-      border-radius: 8px;
+      border-radius: 5px;
     }
 
     .authorization-info__copy-btn {
       flex: 0 0 auto;
-      margin-bottom: 2px;
+      margin-bottom: 1px;
     }
 
     .authorization-info__note {
       display: flex;
       align-items: flex-start;
-      gap: 8px;
-      padding: 12px 14px;
+      gap: 5px;
+      padding: 8px 9px;
       color: #475569;
       font-size: 12.5px;
       line-height: 1.7;
       background: #f8fbff;
       border: 1px solid #dbe7ff;
-      border-radius: 12px;
+      border-radius: 8px;
     }
 
     .authorization-info__note-icon {
-      margin-top: 3px;
+      margin-top: 2px;
       color: #2a50ec;
     }
 
@@ -747,12 +776,12 @@
       flex-direction: column;
       align-items: center;
       justify-content: center;
-      min-height: 320px;
+      min-height: 213px;
       text-align: center;
     }
 
     .authorization-info__empty-icon {
-      margin-bottom: 14px;
+      margin-bottom: 9px;
       color: #cbd5e1;
       font-size: 42px;
     }
@@ -764,7 +793,7 @@
     }
 
     .authorization-info__empty-desc {
-      margin-top: 6px;
+      margin-top: 4px;
       color: #9ca3af;
       font-size: 12px;
     }

+ 2 - 2
ai-electron/frontend/src/core/layouts/default/setting/components/ProductInfoModal.vue

@@ -5,8 +5,8 @@
     :width="860"
     :centered="true"
     :showCancelBtn="false"
+    :showOkBtn="false"
     @register="registerModal"
-    @ok="closeModal"
   >
     <div :class="prefixCls">
       <section class="product-info__hero">
@@ -82,7 +82,7 @@
   const { title } = useGlobSetting();
   const { pkg } = __APP_INFO__;
 
-  const [registerModal, { closeModal }] = useModalInner();
+  const [registerModal] = useModalInner();
 
   const FEATURES = [
     {

+ 7 - 0
ai-electron/frontend/src/plat/views/case/case.vue

@@ -181,6 +181,10 @@
       v-model:open="openModalVisible"
       title="打开案件"
       okText="打开"
+      :confirmLoading="openingCaseId !== null"
+      :closable="openingCaseId === null"
+      :keyboard="openingCaseId === null"
+      :cancelButtonProps="{ disabled: openingCaseId !== null }"
       @ok="confirmOpen"
       @cancel="cancelOpen"
     >
@@ -348,6 +352,7 @@
 
   /** 打开案件:先收案件密码,校验通过才进入案件 */
   async function handleOpen(id: string) {
+    if (openingCaseId.value !== null) return;
     currentOpenId.value = id;
     openPwd.value = '';
     openModalVisible.value = true;
@@ -363,6 +368,8 @@
   }
 
   function cancelOpen() {
+    // 打开过程中已进入初始化/路由重建,允许取消会与后续跳转冲突
+    if (openingCaseId.value !== null) return;
     openModalVisible.value = false;
     currentOpenId.value = '';
     openPwd.value = '';