|
@@ -1554,7 +1554,7 @@
|
|
|
this.searchButtonConfigCheckId = String(management);
|
|
this.searchButtonConfigCheckId = String(management);
|
|
|
this.ssPaging.pageNo = 1;
|
|
this.ssPaging.pageNo = 1;
|
|
|
this.userInteracted = true;
|
|
this.userInteracted = true;
|
|
|
- this.loadPobjList();
|
|
|
|
|
|
|
+ this.loadPobjList({ source: "scope" });
|
|
|
},
|
|
},
|
|
|
// 提取当前表单参数(用于 ajax 调用 /service?ssServ=...)
|
|
// 提取当前表单参数(用于 ajax 调用 /service?ssServ=...)
|
|
|
getSearchFormParams() {
|
|
getSearchFormParams() {
|
|
@@ -1662,9 +1662,11 @@
|
|
|
const nextList = Array.isArray(ssData.objList) ? ssData.objList.map((r) => this.normalizeObjToCard(r)) : [];
|
|
const nextList = Array.isArray(ssData.objList) ? ssData.objList.map((r) => this.normalizeObjToCard(r)) : [];
|
|
|
if (this.listConfig) this.listConfig.list = nextList;
|
|
if (this.listConfig) this.listConfig.list = nextList;
|
|
|
this.cardGridKind = this.detectCardGridKind();
|
|
this.cardGridKind = this.detectCardGridKind();
|
|
|
- // 功能说明:列表渲染数据更新后,按当前容器尺寸更新 autoRowNumPer(不立即重拉;下次列表请求时生效) by xu 20260123
|
|
|
|
|
- if (this.$nextTick) this.$nextTick(() => this.scheduleAutoRowNumPer("list"));
|
|
|
|
|
- else this.scheduleAutoRowNumPer("list");
|
|
|
|
|
|
|
+ // 功能说明:列表接口返回后不再每次重算 autoRowNumPer,避免翻页过程中 rowNumPer 在 15/16 间抖动;仅在 autoRowNumPer 尚未得到时兜底计算一次 by xu 20260303
|
|
|
|
|
+ if (!Number(this.autoRowNumPer || 0)) {
|
|
|
|
|
+ if (this.$nextTick) this.$nextTick(() => this.scheduleAutoRowNumPer("list-init"));
|
|
|
|
|
+ else this.scheduleAutoRowNumPer("list-init");
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
// 功能说明:将 <对象名>_cxycl 返回的 bookList 写回右侧预订面板 by xu 20260114
|
|
// 功能说明:将 <对象名>_cxycl 返回的 bookList 写回右侧预订面板 by xu 20260114
|
|
|
applyPobjYclData(ssData) {
|
|
applyPobjYclData(ssData) {
|
|
@@ -1797,32 +1799,45 @@
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// 拉取列表数据(分页/搜索等)
|
|
// 拉取列表数据(分页/搜索等)
|
|
|
- loadPobjList() {
|
|
|
|
|
- const ssServ = this.ssSearchPobjListServName;
|
|
|
|
|
- if (!ssServ) return Promise.resolve(null);
|
|
|
|
|
- // 只有用户操作后才允许请求列表(避免初始化阶段出现第二个 loading)
|
|
|
|
|
- if (!this.userInteracted) return Promise.resolve(null);
|
|
|
|
|
- if (this.loadingList) return Promise.resolve(null);
|
|
|
|
|
- // 功能说明:rowNumPer 按 autoRowNumPer 生效(resize 只记录,不立即请求;下次接口请求时才更新) by xu 20260123
|
|
|
|
|
- try {
|
|
|
|
|
- const next = Number(this.autoRowNumPer || 0);
|
|
|
|
|
- const cur = Number(this.ssPaging?.rowNumPer || 0);
|
|
|
|
|
- if (next > 0 && next !== cur) {
|
|
|
|
|
- try { console.log("[objList][自适应分页] 列表请求前应用 rowNumPer", { cur, next, pageNo: this.ssPaging?.pageNo }); } catch (_) {}
|
|
|
|
|
- this.ssPaging.rowNumPer = next;
|
|
|
|
|
- // 功能说明:页大小变化时回到第一页,避免页码与数据范围不一致 by xu 20260123
|
|
|
|
|
- this.ssPaging.pageNo = 1;
|
|
|
|
|
- }
|
|
|
|
|
- } catch (_) {
|
|
|
|
|
- }
|
|
|
|
|
- const startedAt = Date.now();
|
|
|
|
|
- this.loadingList = true;
|
|
|
|
|
- // 点击后立即清空列表区域,避免用户误以为没点到
|
|
|
|
|
- if (this.listConfig) {
|
|
|
|
|
- this.listConfig.draftbox = [];
|
|
|
|
|
|
|
+ loadPobjList(options = {}) {
|
|
|
|
|
+ const ssServ = this.ssSearchPobjListServName;
|
|
|
|
|
+ if (!ssServ) return Promise.resolve(null);
|
|
|
|
|
+ // 只有用户操作后才允许请求列表(避免初始化阶段出现第二个 loading)
|
|
|
|
|
+ if (!this.userInteracted) return Promise.resolve(null);
|
|
|
|
|
+ if (this.loadingList) return Promise.resolve(null);
|
|
|
|
|
+
|
|
|
|
|
+ const opts = (options && typeof options === "object") ? options : {};
|
|
|
|
|
+ const source = String(opts.source || "general");
|
|
|
|
|
+ const lockRowNumPer = !!opts.lockRowNumPer;
|
|
|
|
|
+ this.__lastListLoadSource = source;
|
|
|
|
|
+
|
|
|
|
|
+ // 功能说明:rowNumPer 按 autoRowNumPer 生效(resize 只记录,不立即请求;下次接口请求时才更新) by xu 20260123
|
|
|
|
|
+ // 功能说明:翻页/刷新请求锁定当前 rowNumPer,避免在翻页链路中被 autoRowNumPer 覆盖导致 pageNo 重置 by xu 20260303
|
|
|
|
|
+ if (!lockRowNumPer) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const next = Number(this.autoRowNumPer || 0);
|
|
|
|
|
+ const cur = Number(this.ssPaging?.rowNumPer || 0);
|
|
|
|
|
+ if (next > 0 && next !== cur) {
|
|
|
|
|
+ try { console.log("[objList][自适应分页] 列表请求前应用 rowNumPer", { source, cur, next, pageNo: this.ssPaging?.pageNo }); } catch (_) {}
|
|
|
|
|
+ this.ssPaging.rowNumPer = next;
|
|
|
|
|
+ // 功能说明:仅在非翻页来源下,页大小变化时回到第一页;翻页来源必须保持当前页码 by xu 20260303
|
|
|
|
|
+ if (source !== "page") {
|
|
|
|
|
+ this.ssPaging.pageNo = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (_) {
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const startedAt = Date.now();
|
|
|
|
|
+ this.loadingList = true;
|
|
|
|
|
+ // 点击后立即清空列表区域,避免用户误以为没点到
|
|
|
|
|
+ if (this.listConfig) {
|
|
|
|
|
+ this.listConfig.draftbox = [];
|
|
|
this.listConfig.list = [];
|
|
this.listConfig.list = [];
|
|
|
}
|
|
}
|
|
|
const params = this.getPobjParams();
|
|
const params = this.getPobjParams();
|
|
|
|
|
+ try { console.log("[objList][分页请求]", { source, lockRowNumPer, pageNo: params?.pageNo, rowNumPer: params?.rowNumPer, rowNum: params?.rowNum }); } catch (_) {}
|
|
|
return this.callSsService(ssServ, params)
|
|
return this.callSsService(ssServ, params)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
const payload = res && typeof res === "object" ? (res.ssData || res) : null;
|
|
const payload = res && typeof res === "object" ? (res.ssData || res) : null;
|
|
@@ -2098,14 +2113,14 @@
|
|
|
this.ssPaging.rowNumPer = rowNumPer;
|
|
this.ssPaging.rowNumPer = rowNumPer;
|
|
|
this.ssPaging.rowNum = rowNum;
|
|
this.ssPaging.rowNum = rowNum;
|
|
|
this.userInteracted = true;
|
|
this.userInteracted = true;
|
|
|
- this.loadPobjList();
|
|
|
|
|
|
|
+ this.loadPobjList({ source: "page", lockRowNumPer: true });
|
|
|
},
|
|
},
|
|
|
search() {
|
|
search() {
|
|
|
// 搜索:回到第一页,调用列表接口刷新(不刷新右侧栏)
|
|
// 搜索:回到第一页,调用列表接口刷新(不刷新右侧栏)
|
|
|
if (this.loadingList) return;
|
|
if (this.loadingList) return;
|
|
|
this.ssPaging.pageNo = 1;
|
|
this.ssPaging.pageNo = 1;
|
|
|
this.userInteracted = true;
|
|
this.userInteracted = true;
|
|
|
- this.loadPobjList();
|
|
|
|
|
|
|
+ this.loadPobjList({ source: "search" });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
@@ -2119,7 +2134,7 @@
|
|
|
if (vm.loadingList) return;
|
|
if (vm.loadingList) return;
|
|
|
// 保持当前筛选/页码,仅刷新列表数据
|
|
// 保持当前筛选/页码,仅刷新列表数据
|
|
|
vm.userInteracted = true;
|
|
vm.userInteracted = true;
|
|
|
- vm.loadPobjList();
|
|
|
|
|
|
|
+ vm.loadPobjList({ source: "refresh", lockRowNumPer: true });
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
console.error("[objList] wdRefresh failed", e);
|
|
console.error("[objList] wdRefresh failed", e);
|
|
|
}
|
|
}
|