Pārlūkot izejas kodu

fix:修复一级对象、二级对象 弹窗保存之后白屏

apple 22 stundas atpakaļ
vecāks
revīzija
17fc2b40bd
3 mainītis faili ar 57 papildinājumiem un 10 dzēšanām
  1. 16 0
      page/env/cobjList.jsp
  2. 22 8
      page/env/objList.jsp
  3. 19 2
      ss/env/env_search.js

+ 16 - 0
page/env/cobjList.jsp

@@ -1559,6 +1559,22 @@
                         }
                     } catch (e) {
                     }
+                    // 功能说明:暴露 vm + 提供 wdRefresh,弹窗保存后只刷新二级对象列表数据(走 Ajax),避免 form.submit 导致白屏 by xu 20260202
+                    try {
+                        window.__cobjListVm = this;
+                    } catch (e) {
+                    }
+                    try {
+                        const vm = this;
+                        window.wdRefresh = function () {
+                            try {
+                                vm.loadCobjInit();
+                            } catch (e) {
+                                console.error("[cobjList] wdRefresh failed", e);
+                            }
+                        };
+                    } catch (e) {
+                    }
                     // 功能说明:mounted 时先调二级对象接口打印返回,便于对齐字段 by xu 20260115
                     this.loadCobjInit();
                     // 在这里可以使用 Vue 实例

+ 22 - 8
page/env/objList.jsp

@@ -2108,14 +2108,28 @@
                     this.loadPobjList();
                 }
             },
-	                mounted() {
-	                    // 功能说明:临时将 vm 暴露到 window,供 searchButtonConfig.opt.callback 调用(后续再改为事件回传方式) by xu 20260123
-	                    try { window.__objListVm = this; } catch (_) {}
-	                    // 初始化:把 URL/form 上已有的参数合并到 form/ssPaging(支持回显 + ajax)
-	                    const curParams = this.getSearchFormParams();
-	                    this.form = {...this.form, ...curParams};
-		                    // 功能说明:分页参数不再从表单读取/初始化(完全由 ssPaging 驱动,且页面不再输出分页隐藏域) by xu 20260123
-		                    this.searchButtonConfigCheckId = String(this.form?.management || "99");
+		                mounted() {
+		                    // 功能说明:临时将 vm 暴露到 window,供 searchButtonConfig.opt.callback 调用(后续再改为事件回传方式) by xu 20260123
+		                    try { window.__objListVm = this; } catch (_) {}
+		                    // 功能说明:弹窗保存后只刷新列表数据(走 Ajax),禁止走 form.submit/reload 以免跳到 /service 返回内容导致白屏 by xu 20260202
+		                    try {
+		                        const vm = this;
+		                        window.wdRefresh = function () {
+		                            try {
+		                                if (vm.loadingList) return;
+		                                // 保持当前筛选/页码,仅刷新列表数据
+		                                vm.userInteracted = true;
+		                                vm.loadPobjList();
+		                            } catch (e) {
+		                                console.error("[objList] wdRefresh failed", e);
+		                            }
+		                        };
+		                    } catch (_) {}
+		                    // 初始化:把 URL/form 上已有的参数合并到 form/ssPaging(支持回显 + ajax)
+		                    const curParams = this.getSearchFormParams();
+		                    this.form = {...this.form, ...curParams};
+			                    // 功能说明:分页参数不再从表单读取/初始化(完全由 ssPaging 驱动,且页面不再输出分页隐藏域) by xu 20260123
+			                    this.searchButtonConfigCheckId = String(this.form?.management || "99");
 			                    // 功能说明:首屏在列表数据未到达前,按 thnType 预设 cardGridKind(决定 --ss-card-min),避免 detectCardGridKind 在空列表时把缩略图场景误判为 none by xu 20260123
 			                    try {
 			                        const t = Number(this.thnType || 0);

+ 19 - 2
ss/env/env_search.js

@@ -719,10 +719,27 @@ window.onresize = function() {
   });
 }
 function wdRefresh() {
+  // 功能说明:列表页已改为 Ajax 拉取 /service?ssServ=...,弹窗保存后刷新不应再走 form.submit(会导致页面导航到 /service 返回内容而白屏) by xu 20260202
+  try {
+    if (window.__objListVm && typeof window.__objListVm.loadPobjList === "function") {
+      try {
+        window.__objListVm.userInteracted = true;
+      } catch (e) {}
+      window.__objListVm.loadPobjList();
+      return;
+    }
+  } catch (e) {}
+  try {
+    if (window.__cobjListVm && typeof window.__cobjListVm.loadCobjInit === "function") {
+      window.__cobjListVm.loadCobjInit();
+      return;
+    }
+  } catch (e) {}
+
   if (initGraph()) {
-  } else {
-    $("form").submit();
+    return;
   }
+  $("form").submit();
 }
 
 //折叠