docs: annotate remaining routes layouts and view boundaries

This commit is contained in:
cieanyau committed 2026-11-06 00:34:17 +08:00
1 parent 408f8e5c98
commit ab22d406c0
56 files changed
+403

No files matched your search

+14
View File
@@ -1,4 +1,7 @@
<script>
/**
* 订单列表:支持账单嵌入/路由模式、筛选、取消、导出与按需订单合并;选择集在筛选或账户变化时同步清空。
*/
import "~/assets/styles/orders.BflDlvVz.css";
import { toDisplayString } from "vue";
import { normalizeClass } from "vue";
@@ -51,9 +54,11 @@ var x = new Set([
`WaitReview`,
`ReviewFail`,
]);
// 状态筛选只接受已知枚举;all 显式转换为空筛选值。
function S(e, t = ``) {
return e === `all` ? `` : typeof e == `string` && x.has(e) ? e : t;
}
// 订单/账单地址只使用正的安全整数 ID,不把任意服务端字符串拼入路由。
function C(e, t = !1) {
if (typeof e != `string` && typeof e != `number`) return null;
let n = String(e);
@@ -208,6 +213,7 @@ var Se = {
t !== O.value && ((O.value = t), J());
},
);
// 根据当前账单模式生成详情链接,无效 ID 使用安全回落地址。
function Y(e) {
return C(e, w.value) || `/bills`;
}
@@ -258,12 +264,14 @@ var Se = {
flush: `sync`,
},
));
// 合并前冻结当前选中的按需订单 ID,等待确认时不再依赖可变选择数组。
function Re() {
Ie.value &&
((B.value = [...new Set(N.value.map((e) => Number(e.id)))]),
(z.value = ``),
(L.value = !0));
}
// 逐单核实仍是未付款按需订单,且账户未切换才合并;返回结果不完整时提示刷新核实,避免重复合并。
async function ze() {
if (R.value || !L.value || B.value.length < 2 || V) return;
let e = E.token,
@@ -304,9 +312,11 @@ var Se = {
R.value = !1;
}
}
// 判断普通未付款状态;具体批量取消集合还会排除按需订单。
function Be(e) {
return String(e.status) === `Unpaid`;
}
// 只允许对已选可取消订单打开确认,无法取消的选择项单独计数提示。
function Ve() {
if (((I.value = ``), !X.value.length)) {
I.value = Z.value
@@ -316,6 +326,7 @@ var Se = {
}
P.value = !0;
}
// 批量取消仅发送允许取消的 ID,成功后清空选择并刷新列表。
async function He() {
if (!F.value && X.value.length) {
((F.value = !0), (I.value = ``));
@@ -335,6 +346,7 @@ var Se = {
}
let Ue = ref(!1),
$ = ref(``);
// 按当前类型、状态和关键词导出服务端表格,下载超时与错误由公共 API 层处理。
async function We() {
((Ue.value = !0), ($.value = ``));
try {
@@ -353,6 +365,7 @@ var Se = {
Ue.value = !1;
}
}
// 恢复默认筛选、排序及 URL 状态值,同时清除选择后刷新。
function Ge() {
((D.value = ``),
(O.value = ``),
@@ -376,6 +389,7 @@ var Se = {
J());
}
let Ke = computed(() => !!D.value || !!O.value || !!A.value);
// 合并仅适用于已选未付按需订单,批量取消使用另一允许集合;导出参数与当前已应用筛选一致。
return (n, r) => {
let a = button,
c = ListSegments,