@agile-team/mach-report 2.21.0 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -2
- package/dist/{ExcelBindingWizard-B2xXBOJu.cjs → ExcelBindingWizard-CW79I6Gl.cjs} +1 -1
- package/dist/{ExcelBindingWizard-CixTPQAL.js → ExcelBindingWizard-CZyppD7I.js} +3 -3
- package/dist/{ParamEditor-DhHlNxai.cjs → ParamEditor-CiYCJI0b.cjs} +1 -1
- package/dist/{ParamEditor-gKhvEsnr.js → ParamEditor-DQit-Gdf.js} +2 -2
- package/dist/{ReportBatchPanel-D-lyWKyf.js → ReportBatchPanel-DKTpV7MU.js} +2 -2
- package/dist/{ReportBatchPanel-BUdUfTdm.cjs → ReportBatchPanel-Db6TAfG5.cjs} +1 -1
- package/dist/ReportLabelStudio-B0i9ohQj.cjs +1 -0
- package/dist/ReportLabelStudio-BYnRqmje.js +780 -0
- package/dist/{ReportParamPanel-peB-KEmm.js → ReportParamPanel-BHSKVL8k.js} +231 -224
- package/dist/ReportParamPanel-lngONOEz.cjs +1 -0
- package/dist/ReportPreview-BDgKssYR.js +5887 -0
- package/dist/ReportPreview-Dw-4icG6.cjs +6 -0
- package/dist/{ReportTemplateLibrary-WZl-AK-2.js → ReportTemplateLibrary-BZuKn0YK.js} +1 -1
- package/dist/{ReportTemplateLibrary-Cs9WKneQ.cjs → ReportTemplateLibrary-DEXH07ND.cjs} +1 -1
- package/dist/{RuleEditor-DGpmjCko.js → RuleEditor-CIQn547x.js} +3 -3
- package/dist/{RuleEditor-Dtcq-7LO.cjs → RuleEditor-zSUmPjKa.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-CkCh506f.cjs → TemplateOutlinePanel-B5SfGYVN.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-cxp95OT9.js → TemplateOutlinePanel-D0PgOSQE.js} +2 -2
- package/dist/{TemplateReusePanel-BZ8VTtrO.js → TemplateReusePanel-BKlAEF8-.js} +2 -2
- package/dist/{TemplateReusePanel-CwttuSta.cjs → TemplateReusePanel-DAy_Hwqz.cjs} +1 -1
- package/dist/TemplateReviewPanel-CowmHaQQ.cjs +1 -0
- package/dist/{TemplateReviewPanel-C9cTvsRs.js → TemplateReviewPanel-div-EH_m.js} +2 -2
- package/dist/artifact-integrity.json +76 -76
- package/dist/{auto-Tq7ReIC1.cjs → auto-DcUHlKob.cjs} +1 -1
- package/dist/{auto-BkdGiNtr.js → auto-moShblh1.js} +4 -4
- package/dist/{designer-CIDHt5xz.js → designer-B7jJeAeG.js} +1500 -1455
- package/dist/{designer-CDqok4S5.cjs → designer-BWQVpJeN.cjs} +2 -2
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +149 -2
- package/dist/designer.d.ts +149 -2
- package/dist/designer.js +13 -12
- package/dist/{encoding-BSeUwrN7.js → encoding-DbnhbwI8.js} +2 -2
- package/dist/{encoding-B79hW4zq.cjs → encoding-ncQAvyOv.cjs} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +38 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +299 -279
- package/dist/{json-snapshot-Kgn459Oj.js → json-snapshot-DvQbZlD7.js} +2 -2
- package/dist/{json-snapshot-I5VI84Vp.cjs → json-snapshot-nyV63AbB.cjs} +1 -1
- package/dist/{plugin-BaRUGORD.cjs → plugin-AcAQ2m9X.cjs} +1 -1
- package/dist/{plugin-D4kAxfLG.js → plugin-w5Nyt08U.js} +1 -1
- package/dist/{prefill-CJSazcVY.js → prefill-BXBxx5We.js} +1 -1
- package/dist/{prefill-Bpyn58AZ.cjs → prefill-DUvejVt1.cjs} +1 -1
- package/dist/prepared-YXy-fVLw.cjs +1 -0
- package/dist/{prepared-BwjwEzFz.js → prepared-rXCKqdHY.js} +35 -34
- package/dist/{protocol-C8VWF9An.cjs → protocol-C9ZaylID.cjs} +1 -1
- package/dist/{protocol-Bs9-ohHN.js → protocol-fjaeKkjf.js} +3 -3
- package/dist/{region-binding-workflow-JNowHd0A.cjs → region-binding-workflow-BiJQ7NU6.cjs} +1 -1
- package/dist/{region-binding-workflow-Cy4GIOUo.js → region-binding-workflow-aA8nxmkZ.js} +1 -1
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/{runtime-BDf5x1i1.js → runtime-BTtpjF3D.js} +4 -4
- package/dist/{runtime-DsJt1PIf.cjs → runtime-Dq0LUsyS.cjs} +1 -1
- package/dist/sbom.cdx.json +1 -1
- package/dist/server/node.d.cts +9 -0
- package/dist/server/node.d.ts +9 -0
- package/dist/server-node.cjs +5 -4
- package/dist/server-node.js +1838 -1760
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +81 -0
- package/dist/server.d.ts +81 -0
- package/dist/server.js +6 -6
- package/dist/style.css +1 -1
- package/dist/template-catalog-CLAM4w7H.cjs +1 -0
- package/dist/{template-catalog-DFwIS9aN.js → template-catalog-JSxSqk5y.js} +3 -3
- package/dist/template-fragments-Ca25Jt7e.cjs +1 -0
- package/dist/{template-fragments-Dng-AlHk.js → template-fragments-D2JFj7Du.js} +18 -18
- package/dist/{template-outline-DiADphlq.js → template-outline-CDWXptuj.js} +1 -1
- package/dist/template-outline-K4jGhATu.cjs +1 -0
- package/dist/template-registry-CWnuGqyP.cjs +1 -0
- package/dist/{template-registry-DhBqoD7W.js → template-registry-Do1Uav2Z.js} +333 -261
- package/dist/template-serialization-CU4n_Miu.js +307 -0
- package/dist/template-serialization-CgqBo6s-.cjs +1 -0
- package/dist/vue/async.d.cts +97 -2
- package/dist/vue/async.d.ts +97 -2
- package/dist/vue/index.d.cts +197 -4
- package/dist/vue/index.d.ts +197 -4
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +75 -70
- package/dist/{workbook-session-NYv01LHe.cjs → workbook-session-BvEBRRMz.cjs} +1 -1
- package/dist/{workbook-session-oinxX3qo.js → workbook-session-f0wVlzst.js} +1 -1
- package/dist/workbook-sheets-CaPAulQ6.cjs +2 -0
- package/dist/workbook-sheets-D4M7XXBh.js +44 -0
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +9 -0
- package/dist/worker.d.ts +9 -0
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.d.cts +39 -2
- package/dist/xlsx.d.ts +39 -2
- package/dist/xlsx.js +290 -270
- package/package.json +1 -1
- package/dist/ReportLabelStudio-BcjQt73a.cjs +0 -1
- package/dist/ReportLabelStudio-N2w6DdaZ.js +0 -764
- package/dist/ReportParamPanel-CVpK8mFc.cjs +0 -1
- package/dist/ReportPreview-BBJNlu2U.js +0 -5740
- package/dist/ReportPreview-nf4Dk1Jc.cjs +0 -6
- package/dist/TemplateReviewPanel-C2YjiaEC.cjs +0 -1
- package/dist/prepared-BiSz_9vN.cjs +0 -1
- package/dist/template-bindings-Cg5oBLFT.cjs +0 -1
- package/dist/template-bindings-TKnXM7ll.js +0 -62
- package/dist/template-catalog-D_2jdnkL.cjs +0 -1
- package/dist/template-fragments-DZVUBhuB.cjs +0 -1
- package/dist/template-outline-DWkzZXVC.cjs +0 -1
- package/dist/template-registry-DpLUSLwF.cjs +0 -1
- package/dist/template-serialization-Cc3h-miv.js +0 -247
- package/dist/template-serialization-D1R5oAqh.cjs +0 -1
|
@@ -3,7 +3,7 @@ import { a as Q } from "./injection-keys-e85udZCp.js";
|
|
|
3
3
|
import { ReportParamValidationError as we, ReportSourceError as Ee, validateReportParams as oe, parseReportCascaderPath as Se, formatReportCascaderPath as Pe, parseReportParamSelection as Ce, formatReportParamSelection as Oe } from "@agile-team/mach-report";
|
|
4
4
|
import { w as xe } from "./progress-Hc2vxoCs.js";
|
|
5
5
|
import { _ as ee, a as X } from "./_plugin-vue_export-helper-8SL1F89S.js";
|
|
6
|
-
const
|
|
6
|
+
const Re = {
|
|
7
7
|
printPrepareTimeout: "打印资源准备超时,请检查字体与图片后重试。",
|
|
8
8
|
printImageFailed: "第 {index} 张图片未能加载,已停止打印,避免输出缺失内容。",
|
|
9
9
|
printFontFailed: "打印字体 {family} 未能加载,请检查字体资源后重试。",
|
|
@@ -14,33 +14,33 @@ const Ae = {
|
|
|
14
14
|
printCalibrationTest: "打印校准页",
|
|
15
15
|
printCalibrationHint: "正值向右/向下移动,负值向左/向上。使用同规格纸张及 100% 比例,先试打一张。系统对话框关闭不代表设备已完成。"
|
|
16
16
|
};
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
if (![
|
|
20
|
-
return { x:
|
|
17
|
+
function Oa(e) {
|
|
18
|
+
const t = e?.calibration?.offsetXmm ?? 0, l = e?.calibration?.offsetYmm ?? 0;
|
|
19
|
+
if (![t, l].every((n) => Number.isFinite(n) && Math.abs(n) <= 20)) throw new RangeError("Print calibration must be within ±20 mm");
|
|
20
|
+
return { x: t, y: l };
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function xa(e = {}) {
|
|
23
23
|
if (e.fonts && (!Array.isArray(e.fonts) || e.fonts.length > 8)) throw new RangeError("At most eight print font faces are allowed");
|
|
24
|
-
return { ...e, ...e.fonts ? { fonts: e.fonts.map((
|
|
24
|
+
return { ...e, ...e.fonts ? { fonts: e.fonts.map((t) => ({ ...t })) } : {}, ...e.calibration ? { calibration: { ...e.calibration } } : {} };
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
const
|
|
26
|
+
function Ae(e = {}) {
|
|
27
|
+
const t = k(!1), l = k(null), n = k(null), i = k(null);
|
|
28
28
|
function c(d = !1) {
|
|
29
|
-
|
|
29
|
+
t.value = !1, d && V(() => n.value?.focus());
|
|
30
30
|
}
|
|
31
31
|
function g(d) {
|
|
32
|
-
d.target instanceof Node && !
|
|
32
|
+
d.target instanceof Node && !l.value?.contains(d.target) && c();
|
|
33
33
|
}
|
|
34
34
|
function s(d) {
|
|
35
|
-
d.key !== "Escape" || !
|
|
35
|
+
d.key !== "Escape" || !t.value || d.isComposing || (d.preventDefault(), d.stopPropagation(), c(!0));
|
|
36
36
|
}
|
|
37
|
-
return D(
|
|
37
|
+
return D(t, (d) => {
|
|
38
38
|
!d || e.focusOnOpen === !1 || V(() => (i.value?.querySelector("input") ?? i.value?.querySelector("button:not(:disabled)"))?.focus());
|
|
39
39
|
}), ge(() => {
|
|
40
40
|
document.addEventListener("pointerdown", g), document.addEventListener("focusin", g);
|
|
41
41
|
}), ie(() => {
|
|
42
42
|
document.removeEventListener("pointerdown", g), document.removeEventListener("focusin", g);
|
|
43
|
-
}), { opened:
|
|
43
|
+
}), { opened: t, root: l, trigger: n, panel: i, close: c, onKeydown: s };
|
|
44
44
|
}
|
|
45
45
|
const ae = {
|
|
46
46
|
paramOptionsLoading: "正在搜索选项…",
|
|
@@ -90,8 +90,8 @@ const ae = {
|
|
|
90
90
|
reviewNext: "下一页",
|
|
91
91
|
reviewPage: "差异分页"
|
|
92
92
|
};
|
|
93
|
-
function
|
|
94
|
-
return { ...de, ...Object.fromEntries(Object.entries(e).filter(([,
|
|
93
|
+
function Ra(e) {
|
|
94
|
+
return { ...de, ...Object.fromEntries(Object.entries(e).filter(([, t]) => t !== void 0)) };
|
|
95
95
|
}
|
|
96
96
|
const ue = {
|
|
97
97
|
calculationTitle: "选区计算",
|
|
@@ -131,14 +131,15 @@ const ue = {
|
|
|
131
131
|
calculationErrorPrecision: "数值超出安全精度,或展示小数位不是 0 至 12 的整数。"
|
|
132
132
|
};
|
|
133
133
|
function Aa(e) {
|
|
134
|
-
const
|
|
135
|
-
for (const
|
|
136
|
-
const
|
|
137
|
-
typeof
|
|
134
|
+
const t = { ...ue };
|
|
135
|
+
for (const l of Object.keys(t)) {
|
|
136
|
+
const n = e[l];
|
|
137
|
+
typeof n == "string" && (t[l] = n);
|
|
138
138
|
}
|
|
139
|
-
return
|
|
139
|
+
return t;
|
|
140
140
|
}
|
|
141
141
|
const ke = {
|
|
142
|
+
previousSnapshot: "当前保留上次成功结果,刷新成功后恢复编辑和输出。",
|
|
142
143
|
...ae,
|
|
143
144
|
...de,
|
|
144
145
|
reviewTools: "数据工具",
|
|
@@ -152,7 +153,7 @@ const ke = {
|
|
|
152
153
|
drillOpening: "正在打开…",
|
|
153
154
|
drillMissingValue: "当前单元格缺少关联参数",
|
|
154
155
|
drillFailed: "关联内容打开失败,请重试",
|
|
155
|
-
...
|
|
156
|
+
...Re,
|
|
156
157
|
...ue,
|
|
157
158
|
exportMenu: "导出",
|
|
158
159
|
exportMenuDescription: "选择文件格式",
|
|
@@ -325,10 +326,10 @@ const ke = {
|
|
|
325
326
|
function $e(e = {}) {
|
|
326
327
|
return { ...e, defaults: e.defaults ?? {}, presets: e.presets ?? {} };
|
|
327
328
|
}
|
|
328
|
-
function
|
|
329
|
+
function ka(e) {
|
|
329
330
|
return e;
|
|
330
331
|
}
|
|
331
|
-
const
|
|
332
|
+
const L = {
|
|
332
333
|
showExport: !0,
|
|
333
334
|
showPrint: !0,
|
|
334
335
|
showPdfWindow: !0,
|
|
@@ -337,201 +338,207 @@ const T = {
|
|
|
337
338
|
gapPx: 18,
|
|
338
339
|
pdfFontUrl: "/simhei.ttf",
|
|
339
340
|
logger: console
|
|
340
|
-
},
|
|
341
|
+
}, Ma = { warn: () => {
|
|
341
342
|
}, info: () => {
|
|
342
343
|
} };
|
|
343
|
-
function Fe(e,
|
|
344
|
-
if (!(!e && !
|
|
345
|
-
return { ...e, ...
|
|
344
|
+
function Fe(e, t) {
|
|
345
|
+
if (!(!e && !t))
|
|
346
|
+
return { ...e, ...t, calibration: { ...e?.calibration, ...t?.calibration } };
|
|
346
347
|
}
|
|
347
|
-
function
|
|
348
|
+
function Ie(e = {}, t = {}) {
|
|
349
|
+
const l = { ...e, ...t };
|
|
350
|
+
return (e.unavailableReasons || t.unavailableReasons) && (l.unavailableReasons = { ...e.unavailableReasons, ...t.unavailableReasons }), l;
|
|
351
|
+
}
|
|
352
|
+
function j(e, t) {
|
|
348
353
|
return {
|
|
349
354
|
...e,
|
|
350
|
-
...
|
|
351
|
-
theme: { ...e?.theme, ...
|
|
352
|
-
messages: { ...e?.messages, ...
|
|
353
|
-
preview: { ...e?.preview, ...
|
|
354
|
-
xlsx: { ...e?.xlsx, ...
|
|
355
|
-
toolbar:
|
|
356
|
-
interaction: { ...e?.interaction, ...
|
|
357
|
-
|
|
358
|
-
|
|
355
|
+
...t,
|
|
356
|
+
theme: { ...e?.theme, ...t?.theme },
|
|
357
|
+
messages: { ...e?.messages, ...t?.messages },
|
|
358
|
+
preview: { ...e?.preview, ...t?.preview },
|
|
359
|
+
xlsx: { ...e?.xlsx, ...t?.xlsx },
|
|
360
|
+
toolbar: Ie(e?.toolbar, t?.toolbar),
|
|
361
|
+
interaction: { ...e?.interaction, ...t?.interaction },
|
|
362
|
+
refresh: { ...e?.refresh, ...t?.refresh },
|
|
363
|
+
output: { ...e?.output, ...t?.output },
|
|
364
|
+
printOptions: Fe(e?.printOptions, t?.printOptions)
|
|
359
365
|
};
|
|
360
366
|
}
|
|
361
|
-
function
|
|
367
|
+
function De(e) {
|
|
362
368
|
return {
|
|
363
|
-
showExport: e.showExport ??
|
|
364
|
-
showPrint: e.showPrint ??
|
|
365
|
-
showPdfWindow: e.showPdfWindow ??
|
|
366
|
-
showSettings: e.showSettings ??
|
|
367
|
-
showParams: e.showParams ??
|
|
368
|
-
gapPx: e.gapPx ??
|
|
369
|
+
showExport: e.showExport ?? L.showExport,
|
|
370
|
+
showPrint: e.showPrint ?? L.showPrint,
|
|
371
|
+
showPdfWindow: e.showPdfWindow ?? L.showPdfWindow,
|
|
372
|
+
showSettings: e.showSettings ?? L.showSettings,
|
|
373
|
+
showParams: e.showParams ?? L.showParams,
|
|
374
|
+
gapPx: e.gapPx ?? L.gapPx
|
|
369
375
|
};
|
|
370
376
|
}
|
|
371
|
-
function
|
|
372
|
-
const
|
|
377
|
+
function $a(e, t) {
|
|
378
|
+
const l = t ? e?.presets?.[t] : e?.defaultPreset ? e?.presets?.[e.defaultPreset] : void 0, n = j(e?.defaults, l);
|
|
373
379
|
return {
|
|
374
|
-
drill:
|
|
375
|
-
prefill:
|
|
376
|
-
dataComparison:
|
|
377
|
-
exportExecution:
|
|
378
|
-
loadParamOptions:
|
|
379
|
-
...
|
|
380
|
-
pdfFontUrl:
|
|
381
|
-
theme: { ...Me, ...
|
|
382
|
-
messages: { ...ke, ...
|
|
383
|
-
logger:
|
|
380
|
+
drill: n.drill,
|
|
381
|
+
prefill: n.prefill,
|
|
382
|
+
dataComparison: n.dataComparison,
|
|
383
|
+
exportExecution: n.exportExecution,
|
|
384
|
+
loadParamOptions: n.loadParamOptions,
|
|
385
|
+
...De(n),
|
|
386
|
+
pdfFontUrl: n.pdfFontUrl ?? L.pdfFontUrl,
|
|
387
|
+
theme: { ...Me, ...n.theme },
|
|
388
|
+
messages: { ...ke, ...n.messages },
|
|
389
|
+
logger: n.logger ?? L.logger,
|
|
384
390
|
preview: {
|
|
385
|
-
overscanPages: re(
|
|
386
|
-
searchDebounceMs: re(
|
|
391
|
+
overscanPages: re(n.preview?.overscanPages, 1, 10, !0),
|
|
392
|
+
searchDebounceMs: re(n.preview?.searchDebounceMs, 200, 2e3)
|
|
387
393
|
},
|
|
388
|
-
xlsx: { ...
|
|
389
|
-
editable:
|
|
390
|
-
excelImport:
|
|
391
|
-
toolbar: { ...
|
|
392
|
-
interaction: { ...
|
|
393
|
-
preferences:
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
394
|
+
xlsx: { ...n.xlsx },
|
|
395
|
+
editable: n.editable ?? !1,
|
|
396
|
+
excelImport: n.excelImport ?? !1,
|
|
397
|
+
toolbar: { ...n.toolbar },
|
|
398
|
+
interaction: { ...n.interaction },
|
|
399
|
+
preferences: n.preferences,
|
|
400
|
+
refresh: n.refresh,
|
|
401
|
+
assets: n.assets,
|
|
402
|
+
guardChanges: n.guardChanges ?? !0,
|
|
403
|
+
beforeDiscard: n.beforeDiscard,
|
|
404
|
+
output: { ...n.output },
|
|
405
|
+
printOptions: n.printOptions
|
|
399
406
|
};
|
|
400
407
|
}
|
|
401
|
-
function re(e, l, n
|
|
402
|
-
if (e == null || !Number.isFinite(e)) return
|
|
403
|
-
const i = Math.max(0, Math.min(
|
|
404
|
-
return
|
|
405
|
-
}
|
|
406
|
-
function $a(e) {
|
|
407
|
-
const l = {};
|
|
408
|
-
return e.emptyAccent != null && (l["--mrp-empty-accent"] = e.emptyAccent), e.shellBg != null && (l["--mrp-shell-bg"] = e.shellBg), e.shellFg != null && (l["--mrp-shell-fg"] = e.shellFg), e.toolbarBg != null && (l["--mrp-toolbar-bg"] = e.toolbarBg), e.toolbarBorder != null && (l["--mrp-toolbar-border"] = e.toolbarBorder), e.toolbarFg != null && (l["--mrp-toolbar-fg"] = e.toolbarFg), e.btnFg != null && (l["--mrp-btn-fg"] = e.btnFg), e.btnBorder != null && (l["--mrp-btn-border"] = e.btnBorder), e.btnHoverBg != null && (l["--mrp-btn-hover-bg"] = e.btnHoverBg), e.btnHoverFg != null && (l["--mrp-btn-hover-fg"] = e.btnHoverFg), e.btnActiveBg != null && (l["--mrp-btn-active-bg"] = e.btnActiveBg), l;
|
|
408
|
+
function re(e, t, l, n = !1) {
|
|
409
|
+
if (e == null || !Number.isFinite(e)) return t;
|
|
410
|
+
const i = Math.max(0, Math.min(l, e));
|
|
411
|
+
return n ? Math.floor(i) : i;
|
|
409
412
|
}
|
|
410
413
|
function Fa(e) {
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
414
|
+
const t = {};
|
|
415
|
+
return e.emptyAccent != null && (t["--mrp-empty-accent"] = e.emptyAccent), e.shellBg != null && (t["--mrp-shell-bg"] = e.shellBg), e.shellFg != null && (t["--mrp-shell-fg"] = e.shellFg), e.toolbarBg != null && (t["--mrp-toolbar-bg"] = e.toolbarBg), e.toolbarBorder != null && (t["--mrp-toolbar-border"] = e.toolbarBorder), e.toolbarFg != null && (t["--mrp-toolbar-fg"] = e.toolbarFg), e.btnFg != null && (t["--mrp-btn-fg"] = e.btnFg), e.btnBorder != null && (t["--mrp-btn-border"] = e.btnBorder), e.btnHoverBg != null && (t["--mrp-btn-hover-bg"] = e.btnHoverBg), e.btnHoverFg != null && (t["--mrp-btn-hover-fg"] = e.btnHoverFg), e.btnActiveBg != null && (t["--mrp-btn-active-bg"] = e.btnActiveBg), t;
|
|
416
|
+
}
|
|
417
|
+
function Ia(e) {
|
|
418
|
+
const t = se(Q, null), l = E(() => {
|
|
419
|
+
const n = t?.value ?? null, i = "defaults" in e || "presets" in e || "defaultPreset" in e ? $e(e) : { defaults: e, presets: {} };
|
|
420
|
+
if (!n) return i;
|
|
421
|
+
const c = { ...n.presets, ...i.presets };
|
|
415
422
|
for (const g of Object.keys(c))
|
|
416
423
|
c[g] = j(
|
|
417
|
-
j(
|
|
424
|
+
j(n.presets[g], i.defaults),
|
|
418
425
|
i.presets[g]
|
|
419
426
|
);
|
|
420
427
|
return {
|
|
421
|
-
defaults: j(
|
|
428
|
+
defaults: j(n.defaults, i.defaults),
|
|
422
429
|
presets: c,
|
|
423
|
-
defaultPreset: i.defaultPreset ??
|
|
430
|
+
defaultPreset: i.defaultPreset ?? n.defaultPreset
|
|
424
431
|
};
|
|
425
432
|
});
|
|
426
|
-
be(Q,
|
|
433
|
+
be(Q, l);
|
|
427
434
|
}
|
|
428
|
-
function
|
|
435
|
+
function Da() {
|
|
429
436
|
return se(Q, E(() => null));
|
|
430
437
|
}
|
|
431
438
|
class B extends Error {
|
|
432
|
-
constructor(l, n
|
|
433
|
-
super(
|
|
439
|
+
constructor(t, l, n) {
|
|
440
|
+
super(l), this.name = "MachReportError", this.code = t, this.cause = n;
|
|
434
441
|
}
|
|
435
442
|
}
|
|
436
|
-
function
|
|
443
|
+
function qa(e) {
|
|
437
444
|
return e instanceof B ? { code: e.code, cause: e.cause } : { code: "render", cause: e };
|
|
438
445
|
}
|
|
439
|
-
function
|
|
446
|
+
function Ta(e) {
|
|
440
447
|
if (e instanceof B) return e;
|
|
441
448
|
if (e instanceof we) return new B("param", e.message, e);
|
|
442
449
|
if (e instanceof Ee) return new B(e.code, e.message, e.cause);
|
|
443
450
|
if (e instanceof Error) {
|
|
444
|
-
const
|
|
445
|
-
if (typeof
|
|
451
|
+
const t = { params: "param", config: "config", validate: "validate", fetch: "fetch" }, l = e.code;
|
|
452
|
+
if (typeof l == "string" && Object.prototype.hasOwnProperty.call(t, l)) return new B(t[l], e.message, e);
|
|
446
453
|
}
|
|
447
454
|
return new B("fetch", e instanceof Error ? e.message : "预览加载失败", e);
|
|
448
455
|
}
|
|
449
|
-
let
|
|
450
|
-
function
|
|
451
|
-
return `mrp-params-${++
|
|
456
|
+
let qe = 0;
|
|
457
|
+
function Te() {
|
|
458
|
+
return `mrp-params-${++qe}`;
|
|
452
459
|
}
|
|
453
|
-
function ce(e,
|
|
454
|
-
const
|
|
455
|
-
return e.code === "required" ?
|
|
460
|
+
function ce(e, t, l) {
|
|
461
|
+
const n = (Array.isArray(t) ? t.find((i) => i?.field === e.field)?.label : void 0) ?? e.field;
|
|
462
|
+
return e.code === "required" ? l.paramRequired.replace("{label}", n) : (l.paramInvalid ?? "{label}:{message}").replace("{label}", n).replace("{message}", e.message);
|
|
456
463
|
}
|
|
457
464
|
function La(e) {
|
|
458
|
-
const
|
|
459
|
-
function
|
|
465
|
+
const t = k({}), l = k(!1);
|
|
466
|
+
function n() {
|
|
460
467
|
const s = {};
|
|
461
468
|
for (const d of Array.isArray(e.defs.value) ? e.defs.value : [])
|
|
462
469
|
typeof d?.field == "string" && Object.defineProperty(s, d.field, { value: e.params()[d.field] ?? d.defaultValue ?? "", writable: !0, enumerable: !0, configurable: !0 });
|
|
463
|
-
|
|
470
|
+
t.value = s, l.value = !1;
|
|
464
471
|
}
|
|
465
|
-
|
|
466
|
-
const i = E(() => oe(e.defs.value, { ...e.params(), ...
|
|
472
|
+
n(), D(e.defs, n), D(e.reportIds, n), D(() => JSON.stringify(e.params()), n);
|
|
473
|
+
const i = E(() => oe(e.defs.value, { ...e.params(), ...t.value })), c = E(() => !l.value && i.value.issues.length > 0 && i.value.issues.every((s) => s.code === "required"));
|
|
467
474
|
function g() {
|
|
468
475
|
const s = i.value;
|
|
469
476
|
if (!s.ok) {
|
|
470
477
|
const y = s.issues[0];
|
|
471
478
|
return { quiet: c.value, error: new B(y.code === "definition" ? "config" : "param", ce(y, e.defs.value, e.messages()), { issues: s.issues }) };
|
|
472
479
|
}
|
|
473
|
-
const d = { ...s.values },
|
|
474
|
-
for (const [y, u] of Object.entries(d)) u === "" && !
|
|
480
|
+
const d = { ...s.values }, A = new Set(e.defs.value.filter((y) => y.defaultValue !== void 0).map((y) => y.field));
|
|
481
|
+
for (const [y, u] of Object.entries(d)) u === "" && !A.has(y) && delete d[y];
|
|
475
482
|
return { params: d, quiet: !1 };
|
|
476
483
|
}
|
|
477
|
-
return { values:
|
|
484
|
+
return { values: t, attempted: l, validation: i, pendingRequired: c, reset: n, query: g };
|
|
478
485
|
}
|
|
479
|
-
const Z = 100, Le = 32,
|
|
480
|
-
function
|
|
481
|
-
let
|
|
482
|
-
const
|
|
483
|
-
function
|
|
486
|
+
const Z = 100, Le = 32, Ne = 6e4, Be = 15e3;
|
|
487
|
+
function Ue(e) {
|
|
488
|
+
let t = 0;
|
|
489
|
+
const l = /* @__PURE__ */ new Set();
|
|
490
|
+
function n(i, c) {
|
|
484
491
|
if (!Array.isArray(i) || c > 16 || i.length > Z) throw new Error("Invalid option response");
|
|
485
492
|
const g = /* @__PURE__ */ new Set();
|
|
486
493
|
return Object.freeze(i.map((s) => {
|
|
487
|
-
if (++
|
|
488
|
-
return
|
|
494
|
+
if (++t > Z || !s || l.has(s) || typeof s.value != "string" || !s.value || s.value.length > 1024 || typeof s.label != "string" || s.label.length > 1024 || g.has(s.value)) throw new Error("Invalid option response");
|
|
495
|
+
return l.add(s), g.add(s.value), Object.freeze({ label: s.label, value: s.value, ...s.children === void 0 ? {} : { children: n(s.children, c + 1) } });
|
|
489
496
|
}));
|
|
490
497
|
}
|
|
491
|
-
return
|
|
498
|
+
return n(e, 1);
|
|
492
499
|
}
|
|
493
500
|
function fe(e) {
|
|
494
|
-
const
|
|
495
|
-
let
|
|
501
|
+
const t = k(""), l = ye([]), n = k(!1), i = k(!1), c = E(() => Object.fromEntries((Array.isArray(e.def().dependsOn) ? e.def().dependsOn : []).map((R) => [R, e.values()[R] ?? ""]))), g = E(() => Object.values(c.value).some((R) => !R.trim())), s = E(() => !e.loader()), d = /* @__PURE__ */ new Map();
|
|
502
|
+
let A, y, u = 0;
|
|
496
503
|
function h() {
|
|
497
|
-
u++,
|
|
504
|
+
u++, A?.abort(), A = void 0, clearTimeout(y), n.value = !1;
|
|
498
505
|
}
|
|
499
506
|
async function b() {
|
|
500
507
|
h(), i.value = !1;
|
|
501
|
-
const
|
|
502
|
-
if (!
|
|
503
|
-
const F = { source: M.optionsSource, field: M.field, query:
|
|
504
|
-
if (p && Date.now() - p.at <
|
|
505
|
-
d.delete(r), d.set(r, p),
|
|
508
|
+
const R = e.loader(), M = e.def();
|
|
509
|
+
if (!R || !M.optionsSource || g.value || e.disabled() || !e.opened()) return;
|
|
510
|
+
const F = { source: M.optionsSource, field: M.field, query: t.value.trim().slice(0, 256), params: Object.freeze({ ...c.value }), limit: Z }, r = JSON.stringify(F), p = d.get(r);
|
|
511
|
+
if (p && Date.now() - p.at < Ne) {
|
|
512
|
+
d.delete(r), d.set(r, p), l.value = p.options;
|
|
506
513
|
return;
|
|
507
514
|
}
|
|
508
515
|
const a = u, o = new AbortController();
|
|
509
|
-
|
|
510
|
-
const S = setTimeout(() => o.abort(),
|
|
516
|
+
A = o, n.value = !0;
|
|
517
|
+
const S = setTimeout(() => o.abort(), Be);
|
|
511
518
|
try {
|
|
512
|
-
const O =
|
|
519
|
+
const O = Ue(await xe(R(Object.freeze({ ...F, signal: o.signal })), o.signal));
|
|
513
520
|
if (a !== u) return;
|
|
514
|
-
for (
|
|
521
|
+
for (l.value = O, d.delete(r), d.set(r, { at: Date.now(), options: O }); d.size > Le; ) d.delete(d.keys().next().value);
|
|
515
522
|
} catch {
|
|
516
523
|
a === u && (i.value = !0);
|
|
517
524
|
} finally {
|
|
518
|
-
clearTimeout(S), a === u && (
|
|
525
|
+
clearTimeout(S), a === u && (n.value = !1, A = void 0);
|
|
519
526
|
}
|
|
520
527
|
}
|
|
521
528
|
function C() {
|
|
522
|
-
h(),
|
|
529
|
+
h(), l.value = [], i.value = !1, y = setTimeout(() => {
|
|
523
530
|
b();
|
|
524
531
|
}, 180);
|
|
525
532
|
}
|
|
526
|
-
return D(
|
|
527
|
-
d.clear(),
|
|
533
|
+
return D(t, C, { flush: "sync" }), D([() => e.def().field, () => e.def().type, () => e.def().optionsSource, () => JSON.stringify(c.value), e.loader], () => {
|
|
534
|
+
d.clear(), t.value = "", h(), l.value = [], i.value = !1, e.opened() && b();
|
|
528
535
|
}, { flush: "sync" }), D([e.opened, e.disabled], () => {
|
|
529
536
|
!e.opened() || e.disabled() ? h() : b();
|
|
530
537
|
}, { immediate: !0 }), ie(() => {
|
|
531
538
|
h(), d.clear();
|
|
532
|
-
}), { query:
|
|
539
|
+
}), { query: t, options: l, loading: n, failed: i, waiting: g, missingLoader: s, request: b, cancel: h };
|
|
533
540
|
}
|
|
534
|
-
const
|
|
541
|
+
const He = ["aria-labelledby"], Ve = ["value", "disabled", "aria-label", "aria-invalid", "aria-describedby", "aria-required", "onChange"], je = { value: "" }, Ge = ["value"], ze = ["id"], Je = /* @__PURE__ */ _({
|
|
535
542
|
__name: "ReportCascaderParam",
|
|
536
543
|
props: {
|
|
537
544
|
def: {},
|
|
@@ -544,29 +551,29 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
544
551
|
invalid: { type: Boolean }
|
|
545
552
|
},
|
|
546
553
|
emits: ["change"],
|
|
547
|
-
setup(e, { emit:
|
|
548
|
-
const
|
|
549
|
-
const y = Se(
|
|
554
|
+
setup(e, { emit: t }) {
|
|
555
|
+
const l = e, n = t, i = fe({ def: () => l.def, values: () => l.values, loader: () => l.loadOptions, opened: () => !0, disabled: () => l.disabled === !0 }), c = E(() => {
|
|
556
|
+
const y = Se(l.value);
|
|
550
557
|
if (y) return y;
|
|
551
558
|
try {
|
|
552
|
-
const u = JSON.parse(
|
|
559
|
+
const u = JSON.parse(l.value);
|
|
553
560
|
return Array.isArray(u) && u.length <= 16 && u[u.length - 1] === null && u.slice(0, -1).every((h) => typeof h == "string") ? u.slice(0, -1) : [];
|
|
554
561
|
} catch {
|
|
555
562
|
return [];
|
|
556
563
|
}
|
|
557
|
-
}), g = E(() => ({ ...ae, ...
|
|
564
|
+
}), g = E(() => ({ ...ae, ...l.messages })), s = E(() => {
|
|
558
565
|
const y = [];
|
|
559
|
-
let u =
|
|
566
|
+
let u = l.def.optionsSource ? i.options.value : l.def.options ?? [];
|
|
560
567
|
for (let h = 0; h < 16 && u.length; h++)
|
|
561
568
|
y.push(u), u = u.find((b) => b.value === c.value[h])?.children ?? [];
|
|
562
569
|
return y;
|
|
563
|
-
}), d = E(() =>
|
|
564
|
-
function
|
|
565
|
-
if (
|
|
570
|
+
}), d = E(() => l.def.optionsSource ? i.waiting.value ? g.value.paramOptionsDependencies : i.missingLoader.value ? g.value.paramOptionsMissingLoader : i.failed.value ? g.value.paramOptionsFailed : i.loading.value ? g.value.paramOptionsLoading : s.value.length ? "" : g.value.paramOptionsEmpty : "");
|
|
571
|
+
function A(y, u) {
|
|
572
|
+
if (l.disabled) return;
|
|
566
573
|
const h = c.value.slice(0, y);
|
|
567
574
|
u && h.push(u);
|
|
568
575
|
const b = u ? s.value[y]?.find((C) => C.value === u)?.children : s.value[y];
|
|
569
|
-
|
|
576
|
+
n("change", h.length ? b?.length ? JSON.stringify([...h, null]) : Pe(h) : "");
|
|
570
577
|
}
|
|
571
578
|
return (y, u) => (f(), m("div", {
|
|
572
579
|
class: "mrp-cascader",
|
|
@@ -582,14 +589,14 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
582
589
|
"aria-invalid": e.invalid || void 0,
|
|
583
590
|
"aria-describedby": e.invalid ? `${e.id}-error` : d.value ? `${e.id}-status` : void 0,
|
|
584
591
|
"aria-required": e.def.required || void 0,
|
|
585
|
-
onChange: (C) =>
|
|
592
|
+
onChange: (C) => A(b, C.target.value)
|
|
586
593
|
}, [
|
|
587
|
-
q("option",
|
|
594
|
+
q("option", je, x(e.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", e.def.label ?? e.def.field)), 1),
|
|
588
595
|
(f(!0), m(U, null, H(h, (C) => (f(), m("option", {
|
|
589
596
|
key: C.value,
|
|
590
597
|
value: C.value
|
|
591
|
-
}, x(C.label), 9,
|
|
592
|
-
], 40,
|
|
598
|
+
}, x(C.label), 9, Ge))), 128))
|
|
599
|
+
], 40, Ve))), 128)),
|
|
593
600
|
d.value ? (f(), m("small", {
|
|
594
601
|
key: 0,
|
|
595
602
|
id: `${e.id}-status`,
|
|
@@ -602,17 +609,17 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
602
609
|
onClick: u[0] || (u[0] = //@ts-ignore
|
|
603
610
|
(...h) => w(i).request && w(i).request(...h))
|
|
604
611
|
}, x(e.messages.retry), 1)) : I("", !0)
|
|
605
|
-
], 8,
|
|
606
|
-
], 8,
|
|
612
|
+
], 8, ze)) : I("", !0)
|
|
613
|
+
], 8, He));
|
|
607
614
|
}
|
|
608
|
-
}),
|
|
615
|
+
}), We = /* @__PURE__ */ ee(Je, [["__scopeId", "data-v-734dde49"]]), Ke = ["id", "value", "aria-labelledby", "aria-invalid", "aria-required", "aria-describedby", "aria-expanded", "aria-controls", "aria-activedescendant", "disabled", "placeholder"], Xe = ["aria-label", "disabled"], Ye = ["aria-label", "disabled"], Qe = ["id"], Ze = ["id", "aria-label", "aria-busy", "aria-multiselectable"], _e = ["id", "aria-selected", "disabled", "onPointermove", "onClick"], ea = {
|
|
609
616
|
key: 0,
|
|
610
617
|
"aria-hidden": "true",
|
|
611
618
|
class: "mrp-option-check"
|
|
612
|
-
},
|
|
619
|
+
}, aa = { key: 0 }, ta = {
|
|
613
620
|
key: 0,
|
|
614
621
|
role: "status"
|
|
615
|
-
},
|
|
622
|
+
}, la = /* @__PURE__ */ _({
|
|
616
623
|
__name: "ReportRemoteParamSelect",
|
|
617
624
|
props: {
|
|
618
625
|
def: {},
|
|
@@ -625,37 +632,37 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
625
632
|
invalid: { type: Boolean }
|
|
626
633
|
},
|
|
627
634
|
emits: ["change"],
|
|
628
|
-
setup(e, { emit:
|
|
629
|
-
const
|
|
630
|
-
D(() =>
|
|
635
|
+
setup(e, { emit: t }) {
|
|
636
|
+
const l = e, n = t, i = Ae({ focusOnOpen: !1 }), { root: c, panel: g, opened: s } = i, d = fe({ def: () => l.def, values: () => l.values, loader: () => l.loadOptions, opened: () => s.value, disabled: () => l.disabled === !0 }), { query: A, options: y, loading: u, failed: h, waiting: b, missingLoader: C } = d, R = E(() => ({ ...ae, ...l.messages })), M = E(() => l.def.type === "multiSelect"), F = E(() => M.value ? Ce(l.value) ?? [] : [l.value]), r = E(() => l.def.optionsSource ? y.value : (l.def.options ?? []).filter((v) => `${v.label} ${v.value}`.toLocaleLowerCase().includes(A.value.toLocaleLowerCase())).slice(0, 100)), p = /* @__PURE__ */ new Map(), a = E(() => M.value ? F.value.map((v) => p.get(v) ?? l.def.options?.find((P) => P.value === v)?.label ?? v).join("、") : S.value || l.value), o = k(0), S = k(""), O = k(), N = E(() => `${l.id}-options`), T = E(() => b.value ? R.value.paramOptionsDependencies : l.def.optionsSource && C.value ? R.value.paramOptionsMissingLoader : h.value ? R.value.paramOptionsFailed : u.value ? R.value.paramOptionsLoading : r.value.length ? "" : R.value.paramOptionsEmpty);
|
|
637
|
+
D(() => l.value, () => {
|
|
631
638
|
S.value = "";
|
|
632
639
|
}), D(r, () => {
|
|
633
640
|
o.value = 0;
|
|
634
|
-
}), D(() => [
|
|
641
|
+
}), D(() => [l.def.field, l.def.optionsSource, JSON.stringify(l.def.options)], () => {
|
|
635
642
|
p.clear(), S.value = "";
|
|
636
643
|
}), D(s, (v) => {
|
|
637
644
|
v && V(() => O.value?.focus());
|
|
638
645
|
});
|
|
639
646
|
function te(v) {
|
|
640
|
-
if (!(
|
|
647
|
+
if (!(l.disabled || b.value || u.value || h.value)) {
|
|
641
648
|
p.set(v.value, v.label);
|
|
642
649
|
for (const P of p.keys()) P !== v.value && !F.value.includes(P) && p.delete(P);
|
|
643
650
|
if (M.value) {
|
|
644
651
|
const P = F.value.includes(v.value) ? F.value.filter(($) => $ !== v.value) : [...F.value, v.value];
|
|
645
|
-
if (P.length > Math.min(
|
|
646
|
-
|
|
652
|
+
if (P.length > Math.min(l.def.maxItems ?? 100, 100)) return;
|
|
653
|
+
n("change", P.length ? Oe(P) : "");
|
|
647
654
|
} else
|
|
648
|
-
|
|
655
|
+
n("change", v.value), i.close();
|
|
649
656
|
V(() => {
|
|
650
657
|
S.value = v.label, O.value?.focus();
|
|
651
658
|
});
|
|
652
659
|
}
|
|
653
660
|
}
|
|
654
661
|
function le(v) {
|
|
655
|
-
v.isComposing || (s.value = !0,
|
|
662
|
+
v.isComposing || (s.value = !0, A.value = v.target.value);
|
|
656
663
|
}
|
|
657
664
|
function z() {
|
|
658
|
-
!
|
|
665
|
+
!l.disabled && !b.value && (!l.def.optionsSource || !C.value) && (A.value = "", s.value = !0);
|
|
659
666
|
}
|
|
660
667
|
function pe(v) {
|
|
661
668
|
if (!(v.isComposing || v.keyCode === 229)) {
|
|
@@ -678,7 +685,7 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
678
685
|
}
|
|
679
686
|
}
|
|
680
687
|
function ve() {
|
|
681
|
-
|
|
688
|
+
l.disabled || (n("change", ""), S.value = "", i.close());
|
|
682
689
|
}
|
|
683
690
|
return (v, P) => (f(), m("div", {
|
|
684
691
|
ref_key: "root",
|
|
@@ -699,7 +706,7 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
699
706
|
type: "text",
|
|
700
707
|
role: "combobox",
|
|
701
708
|
autocomplete: "off",
|
|
702
|
-
value: w(s) ? w(
|
|
709
|
+
value: w(s) ? w(A) : a.value,
|
|
703
710
|
maxlength: 256,
|
|
704
711
|
"aria-labelledby": `${e.id}-label`,
|
|
705
712
|
"aria-invalid": e.invalid || void 0,
|
|
@@ -715,11 +722,11 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
715
722
|
onInput: le,
|
|
716
723
|
onCompositionend: le,
|
|
717
724
|
onKeydown: pe
|
|
718
|
-
}, null, 40,
|
|
725
|
+
}, null, 40, Ke),
|
|
719
726
|
e.value ? (f(), m("button", {
|
|
720
727
|
key: 0,
|
|
721
728
|
type: "button",
|
|
722
|
-
"aria-label":
|
|
729
|
+
"aria-label": R.value.paramOptionsClear,
|
|
723
730
|
disabled: e.disabled,
|
|
724
731
|
onClick: ve
|
|
725
732
|
}, [
|
|
@@ -727,7 +734,7 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
727
734
|
name: "close",
|
|
728
735
|
size: 12
|
|
729
736
|
})
|
|
730
|
-
], 8,
|
|
737
|
+
], 8, Xe)) : (f(), m("button", {
|
|
731
738
|
key: 1,
|
|
732
739
|
type: "button",
|
|
733
740
|
"aria-label": e.def.label ?? e.def.field,
|
|
@@ -738,13 +745,13 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
738
745
|
name: "chevron-down",
|
|
739
746
|
size: 12
|
|
740
747
|
})
|
|
741
|
-
], 8,
|
|
748
|
+
], 8, Ye))
|
|
742
749
|
], 2),
|
|
743
750
|
w(b) || e.def.optionsSource && w(C) ? (f(), m("small", {
|
|
744
751
|
key: 0,
|
|
745
752
|
id: `${e.id}-remote-status`,
|
|
746
753
|
role: "status"
|
|
747
|
-
}, x(
|
|
754
|
+
}, x(T.value), 9, Qe)) : I("", !0),
|
|
748
755
|
w(s) ? (f(), m("div", {
|
|
749
756
|
key: 1,
|
|
750
757
|
ref_key: "panel",
|
|
@@ -773,14 +780,14 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
773
780
|
onClick: (me) => te($)
|
|
774
781
|
}, [
|
|
775
782
|
q("span", null, [
|
|
776
|
-
M.value ? (f(), m("span",
|
|
783
|
+
M.value ? (f(), m("span", ea, x(F.value.includes($.value) ? "✓" : ""), 1)) : I("", !0),
|
|
777
784
|
G(x($.label), 1)
|
|
778
785
|
]),
|
|
779
|
-
$.label !== $.value ? (f(), m("small",
|
|
780
|
-
], 42,
|
|
781
|
-
], 8,
|
|
782
|
-
|
|
783
|
-
G(x(
|
|
786
|
+
$.label !== $.value ? (f(), m("small", aa, x($.value), 1)) : I("", !0)
|
|
787
|
+
], 42, _e))), 128))
|
|
788
|
+
], 8, Ze),
|
|
789
|
+
T.value ? (f(), m("p", ta, [
|
|
790
|
+
G(x(T.value), 1),
|
|
784
791
|
w(h) ? (f(), m("button", {
|
|
785
792
|
key: 0,
|
|
786
793
|
type: "button",
|
|
@@ -791,17 +798,17 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
791
798
|
], 512)) : I("", !0)
|
|
792
799
|
], 512));
|
|
793
800
|
}
|
|
794
|
-
}),
|
|
801
|
+
}), na = /* @__PURE__ */ ee(la, [["__scopeId", "data-v-6ad41cf4"]]), ra = {
|
|
795
802
|
key: 0,
|
|
796
803
|
class: "mrp-params-title"
|
|
797
|
-
},
|
|
804
|
+
}, ia = { class: "mrp-params-grid" }, sa = ["id"], oa = {
|
|
798
805
|
key: 0,
|
|
799
806
|
class: "mrp-param-star",
|
|
800
807
|
"aria-hidden": "true"
|
|
801
|
-
},
|
|
808
|
+
}, da = ["value", "disabled", "aria-labelledby", "aria-invalid", "aria-describedby", "aria-required", "onChange"], ua = ["disabled", "hidden"], ca = ["value"], fa = ["aria-labelledby"], pa = ["type", "step", "value", "disabled", "min", "max", "aria-label", "aria-invalid", "aria-describedby", "aria-required", "onInput"], va = ["type", "inputmode", "maxlength", "placeholder", "value", "disabled", "min", "max", "step", "aria-labelledby", "aria-invalid", "aria-describedby", "aria-required", "onInput"], ma = ["id"], ga = {
|
|
802
809
|
key: 1,
|
|
803
810
|
class: "mrp-params-actions"
|
|
804
|
-
},
|
|
811
|
+
}, ba = ["disabled"], ya = ["disabled"], ha = /* @__PURE__ */ _({
|
|
805
812
|
__name: "ReportParamPanel",
|
|
806
813
|
props: {
|
|
807
814
|
defs: {},
|
|
@@ -815,32 +822,32 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
815
822
|
loadOptions: { type: Function, default: void 0 }
|
|
816
823
|
},
|
|
817
824
|
emits: ["update:modelValue", "query", "reset"],
|
|
818
|
-
setup(e, { expose:
|
|
819
|
-
const
|
|
825
|
+
setup(e, { expose: t, emit: l }) {
|
|
826
|
+
const n = e, i = l, c = k({ ...n.modelValue }), g = k(null), s = Te();
|
|
820
827
|
D(
|
|
821
|
-
() =>
|
|
828
|
+
() => n.modelValue,
|
|
822
829
|
(r) => {
|
|
823
830
|
c.value = { ...r };
|
|
824
831
|
}
|
|
825
832
|
);
|
|
826
|
-
const d = E(() =>
|
|
827
|
-
() => (Array.isArray(
|
|
833
|
+
const d = E(() => n.issues ?? oe(n.defs, c.value).issues), A = E(
|
|
834
|
+
() => (Array.isArray(n.defs) ? n.defs : []).filter((r) => r && typeof r.field == "string").map((r, p) => ({
|
|
828
835
|
def: r,
|
|
829
836
|
id: `${s}-${p}`,
|
|
830
837
|
label: r.label ?? r.field,
|
|
831
838
|
value: c.value[r.field] ?? "",
|
|
832
|
-
error:
|
|
839
|
+
error: n.attempted ? d.value.find((a) => a.field === r.field) : void 0
|
|
833
840
|
}))
|
|
834
841
|
), y = E(() => {
|
|
835
842
|
const r = /* @__PURE__ */ new Map();
|
|
836
|
-
for (const p of
|
|
843
|
+
for (const p of n.defs) for (const a of Array.isArray(p.dependsOn) ? p.dependsOn : []) {
|
|
837
844
|
const o = r.get(a) ?? [];
|
|
838
845
|
o.push(p.field), r.set(a, o);
|
|
839
846
|
}
|
|
840
847
|
return r;
|
|
841
848
|
});
|
|
842
849
|
function u(r, p) {
|
|
843
|
-
if (
|
|
850
|
+
if (n.disabled || c.value[r] === p) return;
|
|
844
851
|
c.value = { ...c.value, [r]: p };
|
|
845
852
|
const a = /* @__PURE__ */ new Set([r]), o = [r];
|
|
846
853
|
for (let S = 0; S < o.length; S++) for (const O of y.value.get(o[S]) ?? [])
|
|
@@ -862,11 +869,11 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
862
869
|
function C(r, p, a) {
|
|
863
870
|
return a ? !!b(r, 0) != !!b(r, 1) ? !b(r, p) || void 0 : !0 : void 0;
|
|
864
871
|
}
|
|
865
|
-
function
|
|
872
|
+
function R(r, p, a) {
|
|
866
873
|
const o = r.type === "numberRange", S = c.value[r.field] ?? "", O = [b(S, 0, o), b(S, 1, o)];
|
|
867
874
|
O[p] = a;
|
|
868
|
-
const N = o ? JSON.stringify(O.map((
|
|
869
|
-
u(r.field, O.every((
|
|
875
|
+
const N = o ? JSON.stringify(O.map((T) => T === "" ? null : Number(T))) : O.join("/");
|
|
876
|
+
u(r.field, O.every((T) => !T) ? "" : N);
|
|
870
877
|
}
|
|
871
878
|
function M(r) {
|
|
872
879
|
r.isComposing || i("query");
|
|
@@ -874,14 +881,14 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
874
881
|
function F() {
|
|
875
882
|
g.value?.querySelector('[aria-invalid="true"]')?.focus();
|
|
876
883
|
}
|
|
877
|
-
return
|
|
884
|
+
return t({ focusInvalid: F }), (r, p) => (f(), m("div", {
|
|
878
885
|
ref_key: "root",
|
|
879
886
|
ref: g,
|
|
880
887
|
class: "mrp-params"
|
|
881
888
|
}, [
|
|
882
|
-
e.showTitle !== !1 ? (f(), m("span",
|
|
883
|
-
q("div",
|
|
884
|
-
(f(!0), m(U, null, H(
|
|
889
|
+
e.showTitle !== !1 ? (f(), m("span", ra, x(e.messages.paramsTitle), 1)) : I("", !0),
|
|
890
|
+
q("div", ia, [
|
|
891
|
+
(f(!0), m(U, null, H(A.value, (a) => (f(), m("label", {
|
|
885
892
|
key: a.id,
|
|
886
893
|
class: Y(["mrp-param", { "mrp-param-missing": !!a.error }])
|
|
887
894
|
}, [
|
|
@@ -890,9 +897,9 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
890
897
|
class: "mrp-param-label"
|
|
891
898
|
}, [
|
|
892
899
|
G(x(a.label), 1),
|
|
893
|
-
a.def.required ? (f(), m("i",
|
|
894
|
-
], 8,
|
|
895
|
-
a.def.type === "cascader" ? (f(), ne(
|
|
900
|
+
a.def.required ? (f(), m("i", oa, "*")) : I("", !0)
|
|
901
|
+
], 8, sa),
|
|
902
|
+
a.def.type === "cascader" ? (f(), ne(We, {
|
|
896
903
|
key: 0,
|
|
897
904
|
id: a.id,
|
|
898
905
|
def: a.def,
|
|
@@ -903,7 +910,7 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
903
910
|
disabled: e.disabled,
|
|
904
911
|
invalid: !!a.error,
|
|
905
912
|
onChange: (o) => u(a.def.field, o)
|
|
906
|
-
}, null, 8, ["id", "def", "value", "values", "load-options", "messages", "disabled", "invalid", "onChange"])) : a.def.optionsSource || a.def.type === "multiSelect" ? (f(), ne(
|
|
913
|
+
}, null, 8, ["id", "def", "value", "values", "load-options", "messages", "disabled", "invalid", "onChange"])) : a.def.optionsSource || a.def.type === "multiSelect" ? (f(), ne(na, {
|
|
907
914
|
key: 1,
|
|
908
915
|
id: a.id,
|
|
909
916
|
def: a.def,
|
|
@@ -930,12 +937,12 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
930
937
|
value: "",
|
|
931
938
|
disabled: a.def.required,
|
|
932
939
|
hidden: a.def.required
|
|
933
|
-
}, x(a.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", a.label)), 9,
|
|
940
|
+
}, x(a.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", a.label)), 9, ua),
|
|
934
941
|
(f(!0), m(U, null, H(a.def.options ?? [], (o) => (f(), m("option", {
|
|
935
942
|
key: o.value,
|
|
936
943
|
value: o.value
|
|
937
|
-
}, x(o.label), 9,
|
|
938
|
-
], 40,
|
|
944
|
+
}, x(o.label), 9, ca))), 128))
|
|
945
|
+
], 40, da)) : a.def.type === "dateRange" || a.def.type === "numberRange" ? (f(), m("div", {
|
|
939
946
|
key: 3,
|
|
940
947
|
class: "mrp-param-range",
|
|
941
948
|
role: "group",
|
|
@@ -954,10 +961,10 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
954
961
|
"aria-invalid": a.def.type === "numberRange" ? !!a.error || void 0 : C(a.value, S, a.error),
|
|
955
962
|
"aria-describedby": a.error ? `${a.id}-error` : void 0,
|
|
956
963
|
"aria-required": a.def.required || void 0,
|
|
957
|
-
onInput: (O) =>
|
|
964
|
+
onInput: (O) => R(a.def, S, O.target.value),
|
|
958
965
|
onKeydown: K(M, ["enter"])
|
|
959
|
-
}, null, 40,
|
|
960
|
-
], 8,
|
|
966
|
+
}, null, 40, pa))), 128))
|
|
967
|
+
], 8, fa)) : (f(), m("input", {
|
|
961
968
|
key: 4,
|
|
962
969
|
class: "mrp-param-input",
|
|
963
970
|
type: h(a.def),
|
|
@@ -975,54 +982,54 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
975
982
|
"aria-required": a.def.required || void 0,
|
|
976
983
|
onInput: (o) => u(a.def.field, o.target.value),
|
|
977
984
|
onKeydown: K(M, ["enter"])
|
|
978
|
-
}, null, 40,
|
|
985
|
+
}, null, 40, va)),
|
|
979
986
|
a.error ? (f(), m("small", {
|
|
980
987
|
key: 5,
|
|
981
988
|
id: `${a.id}-error`,
|
|
982
989
|
class: "mrp-param-error",
|
|
983
990
|
role: "status"
|
|
984
|
-
}, x(w(ce)(a.error, e.defs, e.messages)), 9,
|
|
991
|
+
}, x(w(ce)(a.error, e.defs, e.messages)), 9, ma)) : I("", !0)
|
|
985
992
|
], 2))), 128))
|
|
986
993
|
]),
|
|
987
|
-
e.showActions !== !1 ? (f(), m("div",
|
|
994
|
+
e.showActions !== !1 ? (f(), m("div", ga, [
|
|
988
995
|
q("button", {
|
|
989
996
|
class: "mrp-nav mrp-param-query",
|
|
990
997
|
type: "button",
|
|
991
998
|
disabled: e.disabled,
|
|
992
999
|
onClick: p[0] || (p[0] = (a) => r.$emit("query"))
|
|
993
|
-
}, x(e.messages.query), 9,
|
|
1000
|
+
}, x(e.messages.query), 9, ba),
|
|
994
1001
|
q("button", {
|
|
995
1002
|
class: "mrp-nav",
|
|
996
1003
|
type: "button",
|
|
997
1004
|
disabled: e.disabled,
|
|
998
1005
|
onClick: p[1] || (p[1] = (a) => r.$emit("reset"))
|
|
999
|
-
}, x(e.messages.reset), 9,
|
|
1006
|
+
}, x(e.messages.reset), 9, ya)
|
|
1000
1007
|
])) : I("", !0)
|
|
1001
1008
|
], 512));
|
|
1002
1009
|
}
|
|
1003
|
-
}),
|
|
1010
|
+
}), Na = /* @__PURE__ */ ee(ha, [["__scopeId", "data-v-e74206d7"]]);
|
|
1004
1011
|
export {
|
|
1005
1012
|
ue as D,
|
|
1006
1013
|
B as M,
|
|
1007
1014
|
ae as P,
|
|
1008
|
-
|
|
1009
|
-
|
|
1015
|
+
Na as R,
|
|
1016
|
+
Ma as S,
|
|
1010
1017
|
de as a,
|
|
1011
1018
|
ke as b,
|
|
1012
|
-
|
|
1019
|
+
Re as c,
|
|
1013
1020
|
Me as d,
|
|
1014
1021
|
$e as e,
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1022
|
+
ka as f,
|
|
1023
|
+
Ia as g,
|
|
1024
|
+
$a as h,
|
|
1025
|
+
Ra as i,
|
|
1026
|
+
qa as j,
|
|
1027
|
+
Ae as k,
|
|
1021
1028
|
La as l,
|
|
1022
|
-
|
|
1023
|
-
|
|
1029
|
+
Ta as n,
|
|
1030
|
+
Oa as p,
|
|
1024
1031
|
Aa as r,
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1032
|
+
xa as s,
|
|
1033
|
+
Fa as t,
|
|
1034
|
+
Da as u
|
|
1028
1035
|
};
|