修复表格刷新布局跳动并补齐多端回归验收
前端验证 / verify (push) Failing after 4m40s

This commit is contained in:
cieanyau committed 2026-11-07 07:08:48 +08:00
1 parent 1c0c0f16bc
commit 90989f8f8a
6 files changed
+480 -55

No files matched your search

+38 -31
View File
@@ -11,7 +11,6 @@ import "~/assets/styles/HostList.B3U15sJm.css";
import { nextTick } from "vue";
import { toDisplayString } from "vue";
import { renderList } from "vue";
import { onMounted } from "vue";
import { normalizeClass } from "vue";
import { onBeforeUnmount } from "vue";
import { renderSlot } from "vue";
@@ -667,7 +666,9 @@ var Ye = {
}),
});
((gn.value = T?.page ?? 1), (I.value = T?.limit ?? 20));
let L = computed(() => !hn.value && !F.value),
// 列定义与列表响应一起确认;缓存只有行数据,不能据此猜测本次动态列。
let schemaReady = computed(() => D.value !== null),
L = computed(() => (!hn.value || !schemaReady.value) && !F.value),
bn = computed(() =>
Array.from(
{
@@ -705,19 +706,18 @@ var Ye = {
(onBeforeUnmount(() => {
(O++, En(), (Tn = null));
}),
onMounted(async () => {
(await nextTick(),
requestAnimationFrame(() =>
requestAnimationFrame(() => {
(Tn !== null &&
window.scrollTo({
top: Tn,
behavior: `instant`,
}),
(Tn = null));
}),
));
}),
// 表格与列定义已真实渲染后恢复位置;短加载态不能提前消费长列表的滚动快照。
watch(
() => schemaReady.value && hn.value && !P.value,
async (ready) => {
if (!ready || Tn === null) return;
await nextTick();
if (Tn === null || !schemaReady.value || !hn.value) return;
window.scrollTo({ top: Tn, behavior: `instant` });
Tn = null;
},
{ flush: `post` },
),
watch(
() => w.token,
(e) => {
@@ -1574,37 +1574,43 @@ var Ye = {
`div`,
{
class: `list-table`,
"aria-busy": unref(P) || unref(L),
"aria-busy":
unref(P) || (!unref(schemaReady) && !unref(F)),
},
[
unref(L)
? (openBlock(),
createElementBlock(`span`, nt, `正在读取服务器列表`))
: createCommentVNode(``, !0),
unref(F) && !unref(hn) && !unref(P)
!unref(schemaReady) ||
(unref(F) && !unref(hn) && !unref(P))
? (openBlock(),
createBlock(
p,
{
key: 1,
icon: `pi pi-exclamation-circle`,
title: `服务器加载失败`,
description: unref(F),
icon: unref(F)
? `pi pi-exclamation-circle`
: `pi pi-spin pi-spinner`,
title: unref(F) ? `服务器加载失败` : `加载中…`,
description: unref(F) || `正在读取服务器列表`,
},
{
default: withCtx(() => [
createVNode(u, {
label: `重新加载`,
icon: `pi pi-refresh`,
severity: `secondary`,
size: `small`,
onClick: Dn,
}),
unref(F)
? createVNode(u, {
label: `重新加载`,
icon: `pi pi-refresh`,
severity: `secondary`,
size: `small`,
onClick: Dn,
})
: createCommentVNode(``, !0),
]),
_: 1,
},
8,
[`description`],
[`icon`, `title`, `description`],
))
: (openBlock(),
createBlock(
@@ -2800,7 +2806,7 @@ var Ye = {
8,
tt,
),
unref(xn).length
unref(schemaReady) && unref(xn).length
? (openBlock(),
createElementBlock(`p`, Nt, [
...(r[21] ||= [
@@ -2885,7 +2891,8 @@ var Ye = {
"host-list-foot-empty": !unref(L) && !unref(mn),
},
]),
inert: unref(L) || !unref(mn) || void 0,
inert:
!unref(schemaReady) || unref(L) || !unref(mn) || void 0,
},
[
createElementVNode(`div`, Ft, [
@@ -2952,7 +2959,7 @@ var Ye = {
10,
Pt,
),
unref(F) && unref(hn)
unref(F) && unref(hn) && unref(schemaReady)
? (openBlock(),
createBlock(
Pe,