@agile-team/mach-report 2.21.1 → 2.23.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 +20 -5
- package/dist/{ExcelBindingWizard-mnAO2qOX.js → ExcelBindingWizard-D4FLind-.js} +3 -3
- package/dist/{ExcelBindingWizard-Bu0LUlzl.cjs → ExcelBindingWizard-D4RS5Bpg.cjs} +1 -1
- package/dist/{ParamEditor-38ZfNrPU.cjs → ParamEditor-C-6C9rd2.cjs} +1 -1
- package/dist/{ParamEditor-C8l0EC8m.js → ParamEditor-CASZt-Ma.js} +2 -2
- package/dist/{ReportBatchPanel-CfUVhvkO.js → ReportBatchPanel-Bq7t8a5r.js} +2 -2
- package/dist/{ReportBatchPanel-nCC06Nfp.cjs → ReportBatchPanel-YVj5IO5y.cjs} +1 -1
- package/dist/ReportLabelStudio-Cqhita1b.cjs +1 -0
- package/dist/ReportLabelStudio-Dj7GXhuv.js +783 -0
- package/dist/ReportParamPanel-DZbFVmDL.cjs +1 -0
- package/dist/{ReportParamPanel-peB-KEmm.js → ReportParamPanel-Dgmqro1Y.js} +265 -244
- package/dist/ReportPreview-DeWzG8jQ.js +6257 -0
- package/dist/ReportPreview-FFIryrIr.cjs +6 -0
- package/dist/{ReportTemplateLibrary-DVlsf72p.cjs → ReportTemplateLibrary-BaWodmpm.cjs} +1 -1
- package/dist/{ReportTemplateLibrary-B5t_EcIs.js → ReportTemplateLibrary-DdAAAD2I.js} +1 -1
- package/dist/{RuleEditor-kT1JsZ9f.js → RuleEditor-D2UwQGF6.js} +59 -59
- package/dist/{RuleEditor-xFkCVlii.cjs → RuleEditor-DcT9xI1v.cjs} +1 -1
- package/dist/TemplateOutlinePanel-CUHFFiNM.cjs +1 -0
- package/dist/{TemplateOutlinePanel-BesgGR1P.js → TemplateOutlinePanel-DrT7XN0m.js} +2 -2
- package/dist/{TemplateReusePanel-BNFU6V-W.js → TemplateReusePanel-4eejkNqi.js} +2 -2
- package/dist/{TemplateReusePanel-BG9Or5-P.cjs → TemplateReusePanel-DZMyiX5I.cjs} +1 -1
- package/dist/{TemplateReviewPanel-CwvwyCSs.js → TemplateReviewPanel-BIhNLeNw.js} +2 -2
- package/dist/TemplateReviewPanel-DnYImiXu.cjs +1 -0
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.js +26 -26
- package/dist/artifact-integrity.json +108 -106
- package/dist/assets-D2gHc4Mz.cjs +1 -0
- package/dist/assets-T_gDeFaz.js +132 -0
- package/dist/auto-4pK9HePf.cjs +1 -0
- package/dist/auto-CTIJ6PnR.js +257 -0
- package/dist/capabilities-DiBj4Qgl.cjs +1 -0
- package/dist/capabilities-pg7j7VLT.js +106 -0
- package/dist/charts-Cjw5AYkg.cjs +1 -0
- package/dist/{charts-Dlv8j2AG.js → charts-CxJZ0XaY.js} +1 -1
- package/dist/computed-DK6BruFz.cjs +1 -0
- package/dist/{computed-C8NRZQss.js → computed-f3pOqWLX.js} +381 -301
- package/dist/data-bar-CeZuFmYl.cjs +1 -0
- package/dist/{data-bar-8baGYEZ9.js → data-bar-IkI6VvMQ.js} +1 -1
- package/dist/designer-DhrE7jzw.js +7169 -0
- package/dist/designer-IAZu6kBX.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +246 -46
- package/dist/designer.d.ts +246 -46
- package/dist/designer.js +15 -14
- package/dist/dom-ChE5D-L-.cjs +1 -0
- package/dist/dom-JWrchIre.js +452 -0
- package/dist/dom-cell-address-DLD1mkTB.cjs +1 -0
- package/dist/dom-cell-address-Fn-8nk7D.js +11 -0
- package/dist/{encoding-B79hW4zq.cjs → encoding-BefcaHdp.cjs} +1 -1
- package/dist/{encoding-BSeUwrN7.js → encoding-CL6rXEkR.js} +2 -2
- package/dist/{font-loader-Di0lQKFf.js → font-loader-BT5baV-o.js} +1 -1
- package/dist/{font-loader-BB372_XN.cjs → font-loader-Ga51c2VC.cjs} +1 -1
- package/dist/grid-strokes-Be24LGuV.cjs +1 -0
- package/dist/grid-strokes-EoY66L2f.js +53 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +44 -1
- package/dist/index.d.ts +44 -1
- package/dist/index.js +961 -1256
- package/dist/json-snapshot-1tvQNzQE.cjs +2 -0
- package/dist/{json-snapshot-Kgn459Oj.js → json-snapshot-OqkPyUk5.js} +763 -776
- package/dist/matrix-B8QWbsGM.cjs +1 -0
- package/dist/matrix-C6e_r_vp.js +302 -0
- package/dist/{pdf-CARdBcuw.cjs → pdf-HiEeXe9H.cjs} +42 -42
- package/dist/{pdf-DmlnL5eB.js → pdf-aobetCsy.js} +20 -20
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.js +2 -2
- package/dist/{plugin-BaRUGORD.cjs → plugin-BFANt-i8.cjs} +1 -1
- package/dist/{plugin-D4kAxfLG.js → plugin-DeYYAL6F.js} +1 -1
- package/dist/{prefill-CJSazcVY.js → prefill-Dk4C6S5R.js} +21 -21
- package/dist/prefill-DsUD5OoK.cjs +1 -0
- package/dist/prepared-DCIxhKFo.js +94 -0
- package/dist/prepared-Dv-XM3i1.cjs +1 -0
- package/dist/progress-ByiOxUD3.js +250 -0
- package/dist/progress-WomPRP3B.cjs +1 -0
- package/dist/{protocol-C8VWF9An.cjs → protocol-B9YgfQ_d.cjs} +1 -1
- package/dist/{protocol-Bs9-ohHN.js → protocol-DxeUKGYG.js} +3 -3
- package/dist/record-bindings-DatJZv_e.js +200 -0
- package/dist/record-bindings-MBxbeBsi.cjs +1 -0
- package/dist/{region-binding-workflow-Cy4GIOUo.js → region-binding-workflow-DjrXuR1q.js} +2 -2
- package/dist/{region-binding-workflow-JNowHd0A.cjs → region-binding-workflow-l7NGfagJ.cjs} +2 -2
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/rich-text-layout-Ciwa6D2o.js +52 -0
- package/dist/rich-text-layout-DK7A_a5r.cjs +3 -0
- package/dist/{runtime-BDf5x1i1.js → runtime-75Y5Oq5B.js} +52 -51
- package/dist/runtime-DKlGd_D4.cjs +1 -0
- 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 +2178 -2044
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +81 -0
- package/dist/server.d.ts +81 -0
- package/dist/server.js +24 -24
- package/dist/style.css +1 -1
- package/dist/{template-catalog-DFwIS9aN.js → template-catalog--cjxzgH7.js} +17 -17
- package/dist/template-catalog-CoT7jm_6.cjs +1 -0
- package/dist/{template-fragments-Dng-AlHk.js → template-fragments-CPpGpQoz.js} +24 -24
- package/dist/{template-fragments-DZVUBhuB.cjs → template-fragments-GVjpew_q.cjs} +1 -1
- package/dist/template-registry-DI59PXVK.cjs +1 -0
- package/dist/{template-registry-DhBqoD7W.js → template-registry-O0hNIOfB.js} +333 -261
- package/dist/template-serialization-CWmHq7lX.js +307 -0
- package/dist/template-serialization-CqQY4zDg.cjs +1 -0
- package/dist/{textwrap-CkGjRFT3.js → textwrap-BIjtEWmq.js} +1 -1
- package/dist/textwrap-Cy7o1hIR.cjs +4 -0
- package/dist/vue/async.d.cts +121 -2
- package/dist/vue/async.d.ts +121 -2
- package/dist/vue/index.d.cts +222 -5
- package/dist/vue/index.d.ts +222 -5
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +101 -91
- package/dist/{workbook-session-NYv01LHe.cjs → workbook-session-C6-SrnCT.cjs} +4 -4
- package/dist/{workbook-session-oinxX3qo.js → workbook-session-C9ZmCBwY.js} +15 -16
- 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 +300 -275
- package/package.json +1 -1
- package/dist/ReportLabelStudio-CaEvYuSK.cjs +0 -1
- package/dist/ReportLabelStudio-DQPBmh4v.js +0 -765
- package/dist/ReportParamPanel-CVpK8mFc.cjs +0 -1
- package/dist/ReportPreview-BBJNlu2U.js +0 -5740
- package/dist/ReportPreview-nf4Dk1Jc.cjs +0 -6
- package/dist/TemplateOutlinePanel-CDI6mfWx.cjs +0 -1
- package/dist/TemplateReviewPanel-BmBrjt6P.cjs +0 -1
- package/dist/assets-CxHunY_9.js +0 -232
- package/dist/assets-vbjAGgk8.cjs +0 -1
- package/dist/auto-BkdGiNtr.js +0 -240
- package/dist/auto-Tq7ReIC1.cjs +0 -1
- package/dist/charts-aCtoswXq.cjs +0 -1
- package/dist/component-tree-1_QCiQJX.js +0 -67
- package/dist/component-tree-BjZIp6w9.cjs +0 -1
- package/dist/computed-4TnxzgIh.cjs +0 -1
- package/dist/data-bar-YltqGTaC.cjs +0 -1
- package/dist/designer-DU3yDWgs.cjs +0 -2
- package/dist/designer-HQi-03R6.js +0 -6869
- package/dist/grid-geometry-D3SJgWFv.js +0 -136
- package/dist/grid-geometry-D8ReblRV.cjs +0 -1
- package/dist/json-snapshot-I5VI84Vp.cjs +0 -2
- package/dist/matrix-0hywp0-F.cjs +0 -1
- package/dist/matrix-Dy-tyY7E.js +0 -381
- package/dist/prefill-Bpyn58AZ.cjs +0 -1
- package/dist/prepared-BiSz_9vN.cjs +0 -1
- package/dist/prepared-BwjwEzFz.js +0 -87
- package/dist/progress-B0ctFpKf.cjs +0 -1
- package/dist/progress-Hc2vxoCs.js +0 -52
- package/dist/record-bindings-Ct1HkPrc.cjs +0 -1
- package/dist/record-bindings-VZGS-Qd8.js +0 -155
- package/dist/rich-text-layout-K48VHUoW.cjs +0 -3
- package/dist/rich-text-layout-wxBhnAS7.js +0 -102
- package/dist/runtime-DsJt1PIf.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-outline-DWkzZXVC.cjs +0 -1
- package/dist/template-outline-DiADphlq.js +0 -88
- 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
- package/dist/textwrap-OTOUMr4f.cjs +0 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ref as k, watch as
|
|
1
|
+
import { ref as k, watch as I, nextTick as V, onMounted as ge, onBeforeUnmount as ie, inject as se, computed as E, provide as be, shallowRef as ye, defineComponent as _, openBlock as f, createElementBlock as m, Fragment as U, renderList as H, unref as w, createElementVNode as q, toDisplayString as x, createTextVNode as G, createCommentVNode as D, normalizeClass as Y, createVNode as W, withModifiers as he, createBlock as ne, withKeys as K } from "vue";
|
|
2
2
|
import { a as Q } from "./injection-keys-e85udZCp.js";
|
|
3
|
-
import { ReportParamValidationError as we, ReportSourceError as Ee, validateReportParams as oe, parseReportCascaderPath as Se, formatReportCascaderPath as
|
|
4
|
-
import { w as xe } from "./progress-
|
|
3
|
+
import { ReportParamValidationError as we, ReportSourceError as Ee, validateReportParams as oe, parseReportCascaderPath as Se, formatReportCascaderPath as Ce, parseReportParamSelection as Pe, formatReportParamSelection as Oe } from "@agile-team/mach-report";
|
|
4
|
+
import { w as xe } from "./progress-ByiOxUD3.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
|
|
37
|
+
return I(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: "选择文件格式",
|
|
@@ -224,6 +225,20 @@ const ke = {
|
|
|
224
225
|
importing: "正在导入 Excel…",
|
|
225
226
|
editCell: "编辑单元格",
|
|
226
227
|
editingHint: "双击单元格编辑 · Enter 确认 · Esc 取消",
|
|
228
|
+
editCellEditable: "可编辑",
|
|
229
|
+
editCellReadOnly: "只读",
|
|
230
|
+
editCellFormula: "公式结果由计算生成,不能直接修改。",
|
|
231
|
+
editCellProtected: "此单元格已受保护。",
|
|
232
|
+
editCellComplex: "此单元格包含复合内容,请在模板设计中调整。",
|
|
233
|
+
editCellStructure: "表头与结构单元格由模板控制。",
|
|
234
|
+
editCellDerived: "汇总或派生值随来源数据计算。",
|
|
235
|
+
editCellPermission: "当前业务权限不允许修改此单元格。",
|
|
236
|
+
editCellBusy: "报表处理中,当前单元格暂时只读。",
|
|
237
|
+
editHistoryLimited: "较早的撤销记录已释放,当前修改与来源差异仍完整保留。",
|
|
238
|
+
changesSearch: "搜索字段、行键或数据集",
|
|
239
|
+
changesAllDatasets: "全部数据集",
|
|
240
|
+
changesNoMatches: "没有匹配的修改",
|
|
241
|
+
changesRange: "{start}–{end} / {total}",
|
|
227
242
|
saving: "正在保存修改…",
|
|
228
243
|
editInvalidNumber: "请输入有效数字;清空表示无值",
|
|
229
244
|
editInvalidBoolean: "请输入 true / false、是 / 否或 1 / 0",
|
|
@@ -325,7 +340,7 @@ const ke = {
|
|
|
325
340
|
function $e(e = {}) {
|
|
326
341
|
return { ...e, defaults: e.defaults ?? {}, presets: e.presets ?? {} };
|
|
327
342
|
}
|
|
328
|
-
function
|
|
343
|
+
function ka(e) {
|
|
329
344
|
return e;
|
|
330
345
|
}
|
|
331
346
|
const T = {
|
|
@@ -337,25 +352,30 @@ const T = {
|
|
|
337
352
|
gapPx: 18,
|
|
338
353
|
pdfFontUrl: "/simhei.ttf",
|
|
339
354
|
logger: console
|
|
340
|
-
},
|
|
355
|
+
}, Ma = { warn: () => {
|
|
341
356
|
}, info: () => {
|
|
342
357
|
} };
|
|
343
|
-
function Fe(e,
|
|
344
|
-
if (!(!e && !
|
|
345
|
-
return { ...e, ...
|
|
358
|
+
function Fe(e, t) {
|
|
359
|
+
if (!(!e && !t))
|
|
360
|
+
return { ...e, ...t, calibration: { ...e?.calibration, ...t?.calibration } };
|
|
361
|
+
}
|
|
362
|
+
function De(e = {}, t = {}) {
|
|
363
|
+
const l = { ...e, ...t };
|
|
364
|
+
return (e.unavailableReasons || t.unavailableReasons) && (l.unavailableReasons = { ...e.unavailableReasons, ...t.unavailableReasons }), l;
|
|
346
365
|
}
|
|
347
|
-
function j(e,
|
|
366
|
+
function j(e, t) {
|
|
348
367
|
return {
|
|
349
368
|
...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
|
-
|
|
369
|
+
...t,
|
|
370
|
+
theme: { ...e?.theme, ...t?.theme },
|
|
371
|
+
messages: { ...e?.messages, ...t?.messages },
|
|
372
|
+
preview: { ...e?.preview, ...t?.preview },
|
|
373
|
+
xlsx: { ...e?.xlsx, ...t?.xlsx },
|
|
374
|
+
toolbar: De(e?.toolbar, t?.toolbar),
|
|
375
|
+
interaction: { ...e?.interaction, ...t?.interaction },
|
|
376
|
+
refresh: { ...e?.refresh, ...t?.refresh },
|
|
377
|
+
output: { ...e?.output, ...t?.output },
|
|
378
|
+
printOptions: Fe(e?.printOptions, t?.printOptions)
|
|
359
379
|
};
|
|
360
380
|
}
|
|
361
381
|
function Ie(e) {
|
|
@@ -368,170 +388,171 @@ function Ie(e) {
|
|
|
368
388
|
gapPx: e.gapPx ?? T.gapPx
|
|
369
389
|
};
|
|
370
390
|
}
|
|
371
|
-
function
|
|
372
|
-
const
|
|
391
|
+
function $a(e, t) {
|
|
392
|
+
const l = t ? e?.presets?.[t] : e?.defaultPreset ? e?.presets?.[e.defaultPreset] : void 0, n = j(e?.defaults, l);
|
|
373
393
|
return {
|
|
374
|
-
drill:
|
|
375
|
-
prefill:
|
|
376
|
-
dataComparison:
|
|
377
|
-
exportExecution:
|
|
378
|
-
loadParamOptions:
|
|
379
|
-
...Ie(
|
|
380
|
-
pdfFontUrl:
|
|
381
|
-
theme: { ...Me, ...
|
|
382
|
-
messages: { ...ke, ...
|
|
383
|
-
logger:
|
|
394
|
+
drill: n.drill,
|
|
395
|
+
prefill: n.prefill,
|
|
396
|
+
dataComparison: n.dataComparison,
|
|
397
|
+
exportExecution: n.exportExecution,
|
|
398
|
+
loadParamOptions: n.loadParamOptions,
|
|
399
|
+
...Ie(n),
|
|
400
|
+
pdfFontUrl: n.pdfFontUrl ?? T.pdfFontUrl,
|
|
401
|
+
theme: { ...Me, ...n.theme },
|
|
402
|
+
messages: { ...ke, ...n.messages },
|
|
403
|
+
logger: n.logger ?? T.logger,
|
|
384
404
|
preview: {
|
|
385
|
-
overscanPages: re(
|
|
386
|
-
searchDebounceMs: re(
|
|
405
|
+
overscanPages: re(n.preview?.overscanPages, 1, 10, !0),
|
|
406
|
+
searchDebounceMs: re(n.preview?.searchDebounceMs, 200, 2e3)
|
|
387
407
|
},
|
|
388
|
-
xlsx: { ...
|
|
389
|
-
editable:
|
|
390
|
-
excelImport:
|
|
391
|
-
toolbar: { ...
|
|
392
|
-
interaction: { ...
|
|
393
|
-
preferences:
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
408
|
+
xlsx: { ...n.xlsx },
|
|
409
|
+
editable: n.editable ?? !1,
|
|
410
|
+
excelImport: n.excelImport ?? !1,
|
|
411
|
+
toolbar: { ...n.toolbar },
|
|
412
|
+
interaction: { ...n.interaction },
|
|
413
|
+
preferences: n.preferences,
|
|
414
|
+
refresh: n.refresh,
|
|
415
|
+
assets: n.assets,
|
|
416
|
+
guardChanges: n.guardChanges ?? !0,
|
|
417
|
+
beforeDiscard: n.beforeDiscard,
|
|
418
|
+
output: { ...n.output },
|
|
419
|
+
printOptions: n.printOptions
|
|
399
420
|
};
|
|
400
421
|
}
|
|
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;
|
|
422
|
+
function re(e, t, l, n = !1) {
|
|
423
|
+
if (e == null || !Number.isFinite(e)) return t;
|
|
424
|
+
const i = Math.max(0, Math.min(l, e));
|
|
425
|
+
return n ? Math.floor(i) : i;
|
|
409
426
|
}
|
|
410
427
|
function Fa(e) {
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
428
|
+
const t = {};
|
|
429
|
+
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;
|
|
430
|
+
}
|
|
431
|
+
function Da(e) {
|
|
432
|
+
const t = se(Q, null), l = E(() => {
|
|
433
|
+
const n = t?.value ?? null, i = "defaults" in e || "presets" in e || "defaultPreset" in e ? $e(e) : { defaults: e, presets: {} };
|
|
434
|
+
if (!n) return i;
|
|
435
|
+
const c = { ...n.presets, ...i.presets };
|
|
415
436
|
for (const g of Object.keys(c))
|
|
416
437
|
c[g] = j(
|
|
417
|
-
j(
|
|
438
|
+
j(n.presets[g], i.defaults),
|
|
418
439
|
i.presets[g]
|
|
419
440
|
);
|
|
420
441
|
return {
|
|
421
|
-
defaults: j(
|
|
442
|
+
defaults: j(n.defaults, i.defaults),
|
|
422
443
|
presets: c,
|
|
423
|
-
defaultPreset: i.defaultPreset ??
|
|
444
|
+
defaultPreset: i.defaultPreset ?? n.defaultPreset
|
|
424
445
|
};
|
|
425
446
|
});
|
|
426
|
-
be(Q,
|
|
447
|
+
be(Q, l);
|
|
427
448
|
}
|
|
428
449
|
function Ia() {
|
|
429
450
|
return se(Q, E(() => null));
|
|
430
451
|
}
|
|
431
452
|
class B extends Error {
|
|
432
|
-
constructor(l, n
|
|
433
|
-
super(
|
|
453
|
+
constructor(t, l, n) {
|
|
454
|
+
super(l), this.name = "MachReportError", this.code = t, this.cause = n;
|
|
434
455
|
}
|
|
435
456
|
}
|
|
436
|
-
function
|
|
457
|
+
function qa(e) {
|
|
437
458
|
return e instanceof B ? { code: e.code, cause: e.cause } : { code: "render", cause: e };
|
|
438
459
|
}
|
|
439
|
-
function
|
|
460
|
+
function La(e) {
|
|
440
461
|
if (e instanceof B) return e;
|
|
441
462
|
if (e instanceof we) return new B("param", e.message, e);
|
|
442
463
|
if (e instanceof Ee) return new B(e.code, e.message, e.cause);
|
|
443
464
|
if (e instanceof Error) {
|
|
444
|
-
const
|
|
445
|
-
if (typeof
|
|
465
|
+
const t = { params: "param", config: "config", validate: "validate", fetch: "fetch" }, l = e.code;
|
|
466
|
+
if (typeof l == "string" && Object.prototype.hasOwnProperty.call(t, l)) return new B(t[l], e.message, e);
|
|
446
467
|
}
|
|
447
468
|
return new B("fetch", e instanceof Error ? e.message : "预览加载失败", e);
|
|
448
469
|
}
|
|
449
|
-
let
|
|
450
|
-
function
|
|
451
|
-
return `mrp-params-${++
|
|
470
|
+
let qe = 0;
|
|
471
|
+
function Le() {
|
|
472
|
+
return `mrp-params-${++qe}`;
|
|
452
473
|
}
|
|
453
|
-
function ce(e,
|
|
454
|
-
const
|
|
455
|
-
return e.code === "required" ?
|
|
474
|
+
function ce(e, t, l) {
|
|
475
|
+
const n = (Array.isArray(t) ? t.find((i) => i?.field === e.field)?.label : void 0) ?? e.field;
|
|
476
|
+
return e.code === "required" ? l.paramRequired.replace("{label}", n) : (l.paramInvalid ?? "{label}:{message}").replace("{label}", n).replace("{message}", e.message);
|
|
456
477
|
}
|
|
457
|
-
function
|
|
458
|
-
const
|
|
459
|
-
function
|
|
478
|
+
function Ta(e) {
|
|
479
|
+
const t = k({}), l = k(!1);
|
|
480
|
+
function n() {
|
|
460
481
|
const s = {};
|
|
461
482
|
for (const d of Array.isArray(e.defs.value) ? e.defs.value : [])
|
|
462
483
|
typeof d?.field == "string" && Object.defineProperty(s, d.field, { value: e.params()[d.field] ?? d.defaultValue ?? "", writable: !0, enumerable: !0, configurable: !0 });
|
|
463
|
-
|
|
484
|
+
t.value = s, l.value = !1;
|
|
464
485
|
}
|
|
465
|
-
|
|
466
|
-
const i = E(() => oe(e.defs.value, { ...e.params(), ...
|
|
486
|
+
n(), I(e.defs, n), I(e.reportIds, n), I(() => JSON.stringify(e.params()), n);
|
|
487
|
+
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
488
|
function g() {
|
|
468
489
|
const s = i.value;
|
|
469
490
|
if (!s.ok) {
|
|
470
491
|
const y = s.issues[0];
|
|
471
492
|
return { quiet: c.value, error: new B(y.code === "definition" ? "config" : "param", ce(y, e.defs.value, e.messages()), { issues: s.issues }) };
|
|
472
493
|
}
|
|
473
|
-
const d = { ...s.values },
|
|
474
|
-
for (const [y, u] of Object.entries(d)) u === "" && !
|
|
494
|
+
const d = { ...s.values }, A = new Set(e.defs.value.filter((y) => y.defaultValue !== void 0).map((y) => y.field));
|
|
495
|
+
for (const [y, u] of Object.entries(d)) u === "" && !A.has(y) && delete d[y];
|
|
475
496
|
return { params: d, quiet: !1 };
|
|
476
497
|
}
|
|
477
|
-
return { values:
|
|
498
|
+
return { values: t, attempted: l, validation: i, pendingRequired: c, reset: n, query: g };
|
|
478
499
|
}
|
|
479
|
-
const Z = 100,
|
|
480
|
-
function
|
|
481
|
-
let
|
|
482
|
-
const
|
|
483
|
-
function
|
|
500
|
+
const Z = 100, Te = 32, Ne = 6e4, Be = 15e3;
|
|
501
|
+
function Ue(e) {
|
|
502
|
+
let t = 0;
|
|
503
|
+
const l = /* @__PURE__ */ new Set();
|
|
504
|
+
function n(i, c) {
|
|
484
505
|
if (!Array.isArray(i) || c > 16 || i.length > Z) throw new Error("Invalid option response");
|
|
485
506
|
const g = /* @__PURE__ */ new Set();
|
|
486
507
|
return Object.freeze(i.map((s) => {
|
|
487
|
-
if (++
|
|
488
|
-
return
|
|
508
|
+
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");
|
|
509
|
+
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
510
|
}));
|
|
490
511
|
}
|
|
491
|
-
return
|
|
512
|
+
return n(e, 1);
|
|
492
513
|
}
|
|
493
514
|
function fe(e) {
|
|
494
|
-
const
|
|
495
|
-
let
|
|
515
|
+
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();
|
|
516
|
+
let A, y, u = 0;
|
|
496
517
|
function h() {
|
|
497
|
-
u++,
|
|
518
|
+
u++, A?.abort(), A = void 0, clearTimeout(y), n.value = !1;
|
|
498
519
|
}
|
|
499
520
|
async function b() {
|
|
500
521
|
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),
|
|
522
|
+
const R = e.loader(), M = e.def();
|
|
523
|
+
if (!R || !M.optionsSource || g.value || e.disabled() || !e.opened()) return;
|
|
524
|
+
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);
|
|
525
|
+
if (p && Date.now() - p.at < Ne) {
|
|
526
|
+
d.delete(r), d.set(r, p), l.value = p.options;
|
|
506
527
|
return;
|
|
507
528
|
}
|
|
508
529
|
const a = u, o = new AbortController();
|
|
509
|
-
|
|
510
|
-
const S = setTimeout(() => o.abort(),
|
|
530
|
+
A = o, n.value = !0;
|
|
531
|
+
const S = setTimeout(() => o.abort(), Be);
|
|
511
532
|
try {
|
|
512
|
-
const O =
|
|
533
|
+
const O = Ue(await xe(R(Object.freeze({ ...F, signal: o.signal })), o.signal));
|
|
513
534
|
if (a !== u) return;
|
|
514
|
-
for (
|
|
535
|
+
for (l.value = O, d.delete(r), d.set(r, { at: Date.now(), options: O }); d.size > Te; ) d.delete(d.keys().next().value);
|
|
515
536
|
} catch {
|
|
516
537
|
a === u && (i.value = !0);
|
|
517
538
|
} finally {
|
|
518
|
-
clearTimeout(S), a === u && (
|
|
539
|
+
clearTimeout(S), a === u && (n.value = !1, A = void 0);
|
|
519
540
|
}
|
|
520
541
|
}
|
|
521
|
-
function
|
|
522
|
-
h(),
|
|
542
|
+
function P() {
|
|
543
|
+
h(), l.value = [], i.value = !1, y = setTimeout(() => {
|
|
523
544
|
b();
|
|
524
545
|
}, 180);
|
|
525
546
|
}
|
|
526
|
-
return
|
|
527
|
-
d.clear(),
|
|
528
|
-
}, { flush: "sync" }),
|
|
547
|
+
return I(t, P, { flush: "sync" }), I([() => e.def().field, () => e.def().type, () => e.def().optionsSource, () => JSON.stringify(c.value), e.loader], () => {
|
|
548
|
+
d.clear(), t.value = "", h(), l.value = [], i.value = !1, e.opened() && b();
|
|
549
|
+
}, { flush: "sync" }), I([e.opened, e.disabled], () => {
|
|
529
550
|
!e.opened() || e.disabled() ? h() : b();
|
|
530
551
|
}, { immediate: !0 }), ie(() => {
|
|
531
552
|
h(), d.clear();
|
|
532
|
-
}), { query:
|
|
553
|
+
}), { query: t, options: l, loading: n, failed: i, waiting: g, missingLoader: s, request: b, cancel: h };
|
|
533
554
|
}
|
|
534
|
-
const
|
|
555
|
+
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
556
|
__name: "ReportCascaderParam",
|
|
536
557
|
props: {
|
|
537
558
|
def: {},
|
|
@@ -544,29 +565,29 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
544
565
|
invalid: { type: Boolean }
|
|
545
566
|
},
|
|
546
567
|
emits: ["change"],
|
|
547
|
-
setup(e, { emit:
|
|
548
|
-
const
|
|
549
|
-
const y = Se(
|
|
568
|
+
setup(e, { emit: t }) {
|
|
569
|
+
const l = e, n = t, i = fe({ def: () => l.def, values: () => l.values, loader: () => l.loadOptions, opened: () => !0, disabled: () => l.disabled === !0 }), c = E(() => {
|
|
570
|
+
const y = Se(l.value);
|
|
550
571
|
if (y) return y;
|
|
551
572
|
try {
|
|
552
|
-
const u = JSON.parse(
|
|
573
|
+
const u = JSON.parse(l.value);
|
|
553
574
|
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
575
|
} catch {
|
|
555
576
|
return [];
|
|
556
577
|
}
|
|
557
|
-
}), g = E(() => ({ ...ae, ...
|
|
578
|
+
}), g = E(() => ({ ...ae, ...l.messages })), s = E(() => {
|
|
558
579
|
const y = [];
|
|
559
|
-
let u =
|
|
580
|
+
let u = l.def.optionsSource ? i.options.value : l.def.options ?? [];
|
|
560
581
|
for (let h = 0; h < 16 && u.length; h++)
|
|
561
582
|
y.push(u), u = u.find((b) => b.value === c.value[h])?.children ?? [];
|
|
562
583
|
return y;
|
|
563
|
-
}), d = E(() =>
|
|
564
|
-
function
|
|
565
|
-
if (
|
|
584
|
+
}), 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 : "");
|
|
585
|
+
function A(y, u) {
|
|
586
|
+
if (l.disabled) return;
|
|
566
587
|
const h = c.value.slice(0, y);
|
|
567
588
|
u && h.push(u);
|
|
568
|
-
const b = u ? s.value[y]?.find((
|
|
569
|
-
|
|
589
|
+
const b = u ? s.value[y]?.find((P) => P.value === u)?.children : s.value[y];
|
|
590
|
+
n("change", h.length ? b?.length ? JSON.stringify([...h, null]) : Ce(h) : "");
|
|
570
591
|
}
|
|
571
592
|
return (y, u) => (f(), m("div", {
|
|
572
593
|
class: "mrp-cascader",
|
|
@@ -582,14 +603,14 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
582
603
|
"aria-invalid": e.invalid || void 0,
|
|
583
604
|
"aria-describedby": e.invalid ? `${e.id}-error` : d.value ? `${e.id}-status` : void 0,
|
|
584
605
|
"aria-required": e.def.required || void 0,
|
|
585
|
-
onChange: (
|
|
606
|
+
onChange: (P) => A(b, P.target.value)
|
|
586
607
|
}, [
|
|
587
|
-
q("option",
|
|
588
|
-
(f(!0), m(U, null, H(h, (
|
|
589
|
-
key:
|
|
590
|
-
value:
|
|
591
|
-
}, x(
|
|
592
|
-
], 40,
|
|
608
|
+
q("option", je, x(e.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", e.def.label ?? e.def.field)), 1),
|
|
609
|
+
(f(!0), m(U, null, H(h, (P) => (f(), m("option", {
|
|
610
|
+
key: P.value,
|
|
611
|
+
value: P.value
|
|
612
|
+
}, x(P.label), 9, Ge))), 128))
|
|
613
|
+
], 40, Ve))), 128)),
|
|
593
614
|
d.value ? (f(), m("small", {
|
|
594
615
|
key: 0,
|
|
595
616
|
id: `${e.id}-status`,
|
|
@@ -601,18 +622,18 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
601
622
|
type: "button",
|
|
602
623
|
onClick: u[0] || (u[0] = //@ts-ignore
|
|
603
624
|
(...h) => w(i).request && w(i).request(...h))
|
|
604
|
-
}, x(e.messages.retry), 1)) :
|
|
605
|
-
], 8,
|
|
606
|
-
], 8,
|
|
625
|
+
}, x(e.messages.retry), 1)) : D("", !0)
|
|
626
|
+
], 8, ze)) : D("", !0)
|
|
627
|
+
], 8, He));
|
|
607
628
|
}
|
|
608
|
-
}),
|
|
629
|
+
}), 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
630
|
key: 0,
|
|
610
631
|
"aria-hidden": "true",
|
|
611
632
|
class: "mrp-option-check"
|
|
612
|
-
},
|
|
633
|
+
}, aa = { key: 0 }, ta = {
|
|
613
634
|
key: 0,
|
|
614
635
|
role: "status"
|
|
615
|
-
},
|
|
636
|
+
}, la = /* @__PURE__ */ _({
|
|
616
637
|
__name: "ReportRemoteParamSelect",
|
|
617
638
|
props: {
|
|
618
639
|
def: {},
|
|
@@ -625,37 +646,37 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
625
646
|
invalid: { type: Boolean }
|
|
626
647
|
},
|
|
627
648
|
emits: ["change"],
|
|
628
|
-
setup(e, { emit:
|
|
629
|
-
const
|
|
630
|
-
|
|
649
|
+
setup(e, { emit: t }) {
|
|
650
|
+
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: P } = d, R = E(() => ({ ...ae, ...l.messages })), M = E(() => l.def.type === "multiSelect"), F = E(() => M.value ? Pe(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((C) => C.value === v)?.label ?? v).join("、") : S.value || l.value), o = k(0), S = k(""), O = k(), N = E(() => `${l.id}-options`), L = E(() => b.value ? R.value.paramOptionsDependencies : l.def.optionsSource && P.value ? R.value.paramOptionsMissingLoader : h.value ? R.value.paramOptionsFailed : u.value ? R.value.paramOptionsLoading : r.value.length ? "" : R.value.paramOptionsEmpty);
|
|
651
|
+
I(() => l.value, () => {
|
|
631
652
|
S.value = "";
|
|
632
|
-
}),
|
|
653
|
+
}), I(r, () => {
|
|
633
654
|
o.value = 0;
|
|
634
|
-
}),
|
|
655
|
+
}), I(() => [l.def.field, l.def.optionsSource, JSON.stringify(l.def.options)], () => {
|
|
635
656
|
p.clear(), S.value = "";
|
|
636
|
-
}),
|
|
657
|
+
}), I(s, (v) => {
|
|
637
658
|
v && V(() => O.value?.focus());
|
|
638
659
|
});
|
|
639
660
|
function te(v) {
|
|
640
|
-
if (!(
|
|
661
|
+
if (!(l.disabled || b.value || u.value || h.value)) {
|
|
641
662
|
p.set(v.value, v.label);
|
|
642
|
-
for (const
|
|
663
|
+
for (const C of p.keys()) C !== v.value && !F.value.includes(C) && p.delete(C);
|
|
643
664
|
if (M.value) {
|
|
644
|
-
const
|
|
645
|
-
if (
|
|
646
|
-
|
|
665
|
+
const C = F.value.includes(v.value) ? F.value.filter(($) => $ !== v.value) : [...F.value, v.value];
|
|
666
|
+
if (C.length > Math.min(l.def.maxItems ?? 100, 100)) return;
|
|
667
|
+
n("change", C.length ? Oe(C) : "");
|
|
647
668
|
} else
|
|
648
|
-
|
|
669
|
+
n("change", v.value), i.close();
|
|
649
670
|
V(() => {
|
|
650
671
|
S.value = v.label, O.value?.focus();
|
|
651
672
|
});
|
|
652
673
|
}
|
|
653
674
|
}
|
|
654
675
|
function le(v) {
|
|
655
|
-
v.isComposing || (s.value = !0,
|
|
676
|
+
v.isComposing || (s.value = !0, A.value = v.target.value);
|
|
656
677
|
}
|
|
657
678
|
function z() {
|
|
658
|
-
!
|
|
679
|
+
!l.disabled && !b.value && (!l.def.optionsSource || !P.value) && (A.value = "", s.value = !0);
|
|
659
680
|
}
|
|
660
681
|
function pe(v) {
|
|
661
682
|
if (!(v.isComposing || v.keyCode === 229)) {
|
|
@@ -669,8 +690,8 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
669
690
|
return;
|
|
670
691
|
}
|
|
671
692
|
if (v.key === "Enter") {
|
|
672
|
-
const
|
|
673
|
-
|
|
693
|
+
const C = r.value[o.value];
|
|
694
|
+
C && te(C);
|
|
674
695
|
return;
|
|
675
696
|
}
|
|
676
697
|
r.value.length && (o.value = (o.value + (v.key === "ArrowDown" ? 1 : -1) + r.value.length) % r.value.length, V(() => g.value?.querySelector(`[id="${N.value}-${o.value}"]`)?.scrollIntoView?.({ block: "nearest" })));
|
|
@@ -678,9 +699,9 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
678
699
|
}
|
|
679
700
|
}
|
|
680
701
|
function ve() {
|
|
681
|
-
|
|
702
|
+
l.disabled || (n("change", ""), S.value = "", i.close());
|
|
682
703
|
}
|
|
683
|
-
return (v,
|
|
704
|
+
return (v, C) => (f(), m("div", {
|
|
684
705
|
ref_key: "root",
|
|
685
706
|
ref: c,
|
|
686
707
|
class: "mrp-remote-param"
|
|
@@ -699,27 +720,27 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
699
720
|
type: "text",
|
|
700
721
|
role: "combobox",
|
|
701
722
|
autocomplete: "off",
|
|
702
|
-
value: w(s) ? w(
|
|
723
|
+
value: w(s) ? w(A) : a.value,
|
|
703
724
|
maxlength: 256,
|
|
704
725
|
"aria-labelledby": `${e.id}-label`,
|
|
705
726
|
"aria-invalid": e.invalid || void 0,
|
|
706
727
|
"aria-required": e.def.required || void 0,
|
|
707
|
-
"aria-describedby": e.invalid ? `${e.id}-error` : w(b) || e.def.optionsSource && w(
|
|
728
|
+
"aria-describedby": e.invalid ? `${e.id}-error` : w(b) || e.def.optionsSource && w(P) ? `${e.id}-remote-status` : void 0,
|
|
708
729
|
"aria-autocomplete": "list",
|
|
709
730
|
"aria-expanded": w(s),
|
|
710
731
|
"aria-controls": w(s) ? N.value : void 0,
|
|
711
732
|
"aria-activedescendant": w(s) && r.value.length ? `${N.value}-${o.value}` : void 0,
|
|
712
|
-
disabled: e.disabled || w(b) || !!e.def.optionsSource && w(
|
|
733
|
+
disabled: e.disabled || w(b) || !!e.def.optionsSource && w(P),
|
|
713
734
|
placeholder: e.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", e.def.label ?? e.def.field),
|
|
714
735
|
onClick: z,
|
|
715
736
|
onInput: le,
|
|
716
737
|
onCompositionend: le,
|
|
717
738
|
onKeydown: pe
|
|
718
|
-
}, null, 40,
|
|
739
|
+
}, null, 40, Ke),
|
|
719
740
|
e.value ? (f(), m("button", {
|
|
720
741
|
key: 0,
|
|
721
742
|
type: "button",
|
|
722
|
-
"aria-label":
|
|
743
|
+
"aria-label": R.value.paramOptionsClear,
|
|
723
744
|
disabled: e.disabled,
|
|
724
745
|
onClick: ve
|
|
725
746
|
}, [
|
|
@@ -727,24 +748,24 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
727
748
|
name: "close",
|
|
728
749
|
size: 12
|
|
729
750
|
})
|
|
730
|
-
], 8,
|
|
751
|
+
], 8, Xe)) : (f(), m("button", {
|
|
731
752
|
key: 1,
|
|
732
753
|
type: "button",
|
|
733
754
|
"aria-label": e.def.label ?? e.def.field,
|
|
734
|
-
disabled: e.disabled || w(b) || !!e.def.optionsSource && w(
|
|
735
|
-
onClick:
|
|
755
|
+
disabled: e.disabled || w(b) || !!e.def.optionsSource && w(P),
|
|
756
|
+
onClick: C[0] || (C[0] = ($) => w(s) ? w(i).close() : z())
|
|
736
757
|
}, [
|
|
737
758
|
W(X, {
|
|
738
759
|
name: "chevron-down",
|
|
739
760
|
size: 12
|
|
740
761
|
})
|
|
741
|
-
], 8,
|
|
762
|
+
], 8, Ye))
|
|
742
763
|
], 2),
|
|
743
|
-
w(b) || e.def.optionsSource && w(
|
|
764
|
+
w(b) || e.def.optionsSource && w(P) ? (f(), m("small", {
|
|
744
765
|
key: 0,
|
|
745
766
|
id: `${e.id}-remote-status`,
|
|
746
767
|
role: "status"
|
|
747
|
-
}, x(L.value), 9,
|
|
768
|
+
}, x(L.value), 9, Qe)) : D("", !0),
|
|
748
769
|
w(s) ? (f(), m("div", {
|
|
749
770
|
key: 1,
|
|
750
771
|
ref_key: "panel",
|
|
@@ -768,40 +789,40 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
768
789
|
class: Y({ active: J === o.value }),
|
|
769
790
|
disabled: w(u),
|
|
770
791
|
onPointermove: (me) => o.value = J,
|
|
771
|
-
onMousedown:
|
|
792
|
+
onMousedown: C[1] || (C[1] = he(() => {
|
|
772
793
|
}, ["prevent"])),
|
|
773
794
|
onClick: (me) => te($)
|
|
774
795
|
}, [
|
|
775
796
|
q("span", null, [
|
|
776
|
-
M.value ? (f(), m("span",
|
|
797
|
+
M.value ? (f(), m("span", ea, x(F.value.includes($.value) ? "✓" : ""), 1)) : D("", !0),
|
|
777
798
|
G(x($.label), 1)
|
|
778
799
|
]),
|
|
779
|
-
$.label !== $.value ? (f(), m("small",
|
|
780
|
-
], 42,
|
|
781
|
-
], 8,
|
|
782
|
-
L.value ? (f(), m("p",
|
|
800
|
+
$.label !== $.value ? (f(), m("small", aa, x($.value), 1)) : D("", !0)
|
|
801
|
+
], 42, _e))), 128))
|
|
802
|
+
], 8, Ze),
|
|
803
|
+
L.value ? (f(), m("p", ta, [
|
|
783
804
|
G(x(L.value), 1),
|
|
784
805
|
w(h) ? (f(), m("button", {
|
|
785
806
|
key: 0,
|
|
786
807
|
type: "button",
|
|
787
|
-
onClick:
|
|
808
|
+
onClick: C[2] || (C[2] = //@ts-ignore
|
|
788
809
|
(...$) => w(d).request && w(d).request(...$))
|
|
789
|
-
}, x(e.messages.retry), 1)) :
|
|
790
|
-
])) :
|
|
791
|
-
], 512)) :
|
|
810
|
+
}, x(e.messages.retry), 1)) : D("", !0)
|
|
811
|
+
])) : D("", !0)
|
|
812
|
+
], 512)) : D("", !0)
|
|
792
813
|
], 512));
|
|
793
814
|
}
|
|
794
|
-
}),
|
|
815
|
+
}), na = /* @__PURE__ */ ee(la, [["__scopeId", "data-v-6ad41cf4"]]), ra = {
|
|
795
816
|
key: 0,
|
|
796
817
|
class: "mrp-params-title"
|
|
797
|
-
},
|
|
818
|
+
}, ia = { class: "mrp-params-grid" }, sa = ["id"], oa = {
|
|
798
819
|
key: 0,
|
|
799
820
|
class: "mrp-param-star",
|
|
800
821
|
"aria-hidden": "true"
|
|
801
|
-
},
|
|
822
|
+
}, 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
823
|
key: 1,
|
|
803
824
|
class: "mrp-params-actions"
|
|
804
|
-
},
|
|
825
|
+
}, ba = ["disabled"], ya = ["disabled"], ha = /* @__PURE__ */ _({
|
|
805
826
|
__name: "ReportParamPanel",
|
|
806
827
|
props: {
|
|
807
828
|
defs: {},
|
|
@@ -815,32 +836,32 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
815
836
|
loadOptions: { type: Function, default: void 0 }
|
|
816
837
|
},
|
|
817
838
|
emits: ["update:modelValue", "query", "reset"],
|
|
818
|
-
setup(e, { expose:
|
|
819
|
-
const
|
|
820
|
-
|
|
821
|
-
() =>
|
|
839
|
+
setup(e, { expose: t, emit: l }) {
|
|
840
|
+
const n = e, i = l, c = k({ ...n.modelValue }), g = k(null), s = Le();
|
|
841
|
+
I(
|
|
842
|
+
() => n.modelValue,
|
|
822
843
|
(r) => {
|
|
823
844
|
c.value = { ...r };
|
|
824
845
|
}
|
|
825
846
|
);
|
|
826
|
-
const d = E(() =>
|
|
827
|
-
() => (Array.isArray(
|
|
847
|
+
const d = E(() => n.issues ?? oe(n.defs, c.value).issues), A = E(
|
|
848
|
+
() => (Array.isArray(n.defs) ? n.defs : []).filter((r) => r && typeof r.field == "string").map((r, p) => ({
|
|
828
849
|
def: r,
|
|
829
850
|
id: `${s}-${p}`,
|
|
830
851
|
label: r.label ?? r.field,
|
|
831
852
|
value: c.value[r.field] ?? "",
|
|
832
|
-
error:
|
|
853
|
+
error: n.attempted ? d.value.find((a) => a.field === r.field) : void 0
|
|
833
854
|
}))
|
|
834
855
|
), y = E(() => {
|
|
835
856
|
const r = /* @__PURE__ */ new Map();
|
|
836
|
-
for (const p of
|
|
857
|
+
for (const p of n.defs) for (const a of Array.isArray(p.dependsOn) ? p.dependsOn : []) {
|
|
837
858
|
const o = r.get(a) ?? [];
|
|
838
859
|
o.push(p.field), r.set(a, o);
|
|
839
860
|
}
|
|
840
861
|
return r;
|
|
841
862
|
});
|
|
842
863
|
function u(r, p) {
|
|
843
|
-
if (
|
|
864
|
+
if (n.disabled || c.value[r] === p) return;
|
|
844
865
|
c.value = { ...c.value, [r]: p };
|
|
845
866
|
const a = /* @__PURE__ */ new Set([r]), o = [r];
|
|
846
867
|
for (let S = 0; S < o.length; S++) for (const O of y.value.get(o[S]) ?? [])
|
|
@@ -859,10 +880,10 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
859
880
|
return "";
|
|
860
881
|
}
|
|
861
882
|
}
|
|
862
|
-
function
|
|
883
|
+
function P(r, p, a) {
|
|
863
884
|
return a ? !!b(r, 0) != !!b(r, 1) ? !b(r, p) || void 0 : !0 : void 0;
|
|
864
885
|
}
|
|
865
|
-
function
|
|
886
|
+
function R(r, p, a) {
|
|
866
887
|
const o = r.type === "numberRange", S = c.value[r.field] ?? "", O = [b(S, 0, o), b(S, 1, o)];
|
|
867
888
|
O[p] = a;
|
|
868
889
|
const N = o ? JSON.stringify(O.map((L) => L === "" ? null : Number(L))) : O.join("/");
|
|
@@ -874,14 +895,14 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
874
895
|
function F() {
|
|
875
896
|
g.value?.querySelector('[aria-invalid="true"]')?.focus();
|
|
876
897
|
}
|
|
877
|
-
return
|
|
898
|
+
return t({ focusInvalid: F }), (r, p) => (f(), m("div", {
|
|
878
899
|
ref_key: "root",
|
|
879
900
|
ref: g,
|
|
880
901
|
class: "mrp-params"
|
|
881
902
|
}, [
|
|
882
|
-
e.showTitle !== !1 ? (f(), m("span",
|
|
883
|
-
q("div",
|
|
884
|
-
(f(!0), m(U, null, H(
|
|
903
|
+
e.showTitle !== !1 ? (f(), m("span", ra, x(e.messages.paramsTitle), 1)) : D("", !0),
|
|
904
|
+
q("div", ia, [
|
|
905
|
+
(f(!0), m(U, null, H(A.value, (a) => (f(), m("label", {
|
|
885
906
|
key: a.id,
|
|
886
907
|
class: Y(["mrp-param", { "mrp-param-missing": !!a.error }])
|
|
887
908
|
}, [
|
|
@@ -890,9 +911,9 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
890
911
|
class: "mrp-param-label"
|
|
891
912
|
}, [
|
|
892
913
|
G(x(a.label), 1),
|
|
893
|
-
a.def.required ? (f(), m("i",
|
|
894
|
-
], 8,
|
|
895
|
-
a.def.type === "cascader" ? (f(), ne(
|
|
914
|
+
a.def.required ? (f(), m("i", oa, "*")) : D("", !0)
|
|
915
|
+
], 8, sa),
|
|
916
|
+
a.def.type === "cascader" ? (f(), ne(We, {
|
|
896
917
|
key: 0,
|
|
897
918
|
id: a.id,
|
|
898
919
|
def: a.def,
|
|
@@ -903,7 +924,7 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
903
924
|
disabled: e.disabled,
|
|
904
925
|
invalid: !!a.error,
|
|
905
926
|
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(
|
|
927
|
+
}, null, 8, ["id", "def", "value", "values", "load-options", "messages", "disabled", "invalid", "onChange"])) : a.def.optionsSource || a.def.type === "multiSelect" ? (f(), ne(na, {
|
|
907
928
|
key: 1,
|
|
908
929
|
id: a.id,
|
|
909
930
|
def: a.def,
|
|
@@ -930,12 +951,12 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
930
951
|
value: "",
|
|
931
952
|
disabled: a.def.required,
|
|
932
953
|
hidden: a.def.required
|
|
933
|
-
}, x(a.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", a.label)), 9,
|
|
954
|
+
}, x(a.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", a.label)), 9, ua),
|
|
934
955
|
(f(!0), m(U, null, H(a.def.options ?? [], (o) => (f(), m("option", {
|
|
935
956
|
key: o.value,
|
|
936
957
|
value: o.value
|
|
937
|
-
}, x(o.label), 9,
|
|
938
|
-
], 40,
|
|
958
|
+
}, x(o.label), 9, ca))), 128))
|
|
959
|
+
], 40, da)) : a.def.type === "dateRange" || a.def.type === "numberRange" ? (f(), m("div", {
|
|
939
960
|
key: 3,
|
|
940
961
|
class: "mrp-param-range",
|
|
941
962
|
role: "group",
|
|
@@ -951,13 +972,13 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
951
972
|
min: a.def.min,
|
|
952
973
|
max: a.def.max,
|
|
953
974
|
"aria-label": `${a.label} · ${o}`,
|
|
954
|
-
"aria-invalid": a.def.type === "numberRange" ? !!a.error || void 0 :
|
|
975
|
+
"aria-invalid": a.def.type === "numberRange" ? !!a.error || void 0 : P(a.value, S, a.error),
|
|
955
976
|
"aria-describedby": a.error ? `${a.id}-error` : void 0,
|
|
956
977
|
"aria-required": a.def.required || void 0,
|
|
957
|
-
onInput: (O) =>
|
|
978
|
+
onInput: (O) => R(a.def, S, O.target.value),
|
|
958
979
|
onKeydown: K(M, ["enter"])
|
|
959
|
-
}, null, 40,
|
|
960
|
-
], 8,
|
|
980
|
+
}, null, 40, pa))), 128))
|
|
981
|
+
], 8, fa)) : (f(), m("input", {
|
|
961
982
|
key: 4,
|
|
962
983
|
class: "mrp-param-input",
|
|
963
984
|
type: h(a.def),
|
|
@@ -975,54 +996,54 @@ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-i
|
|
|
975
996
|
"aria-required": a.def.required || void 0,
|
|
976
997
|
onInput: (o) => u(a.def.field, o.target.value),
|
|
977
998
|
onKeydown: K(M, ["enter"])
|
|
978
|
-
}, null, 40,
|
|
999
|
+
}, null, 40, va)),
|
|
979
1000
|
a.error ? (f(), m("small", {
|
|
980
1001
|
key: 5,
|
|
981
1002
|
id: `${a.id}-error`,
|
|
982
1003
|
class: "mrp-param-error",
|
|
983
1004
|
role: "status"
|
|
984
|
-
}, x(w(ce)(a.error, e.defs, e.messages)), 9,
|
|
1005
|
+
}, x(w(ce)(a.error, e.defs, e.messages)), 9, ma)) : D("", !0)
|
|
985
1006
|
], 2))), 128))
|
|
986
1007
|
]),
|
|
987
|
-
e.showActions !== !1 ? (f(), m("div",
|
|
1008
|
+
e.showActions !== !1 ? (f(), m("div", ga, [
|
|
988
1009
|
q("button", {
|
|
989
1010
|
class: "mrp-nav mrp-param-query",
|
|
990
1011
|
type: "button",
|
|
991
1012
|
disabled: e.disabled,
|
|
992
1013
|
onClick: p[0] || (p[0] = (a) => r.$emit("query"))
|
|
993
|
-
}, x(e.messages.query), 9,
|
|
1014
|
+
}, x(e.messages.query), 9, ba),
|
|
994
1015
|
q("button", {
|
|
995
1016
|
class: "mrp-nav",
|
|
996
1017
|
type: "button",
|
|
997
1018
|
disabled: e.disabled,
|
|
998
1019
|
onClick: p[1] || (p[1] = (a) => r.$emit("reset"))
|
|
999
|
-
}, x(e.messages.reset), 9,
|
|
1000
|
-
])) :
|
|
1020
|
+
}, x(e.messages.reset), 9, ya)
|
|
1021
|
+
])) : D("", !0)
|
|
1001
1022
|
], 512));
|
|
1002
1023
|
}
|
|
1003
|
-
}),
|
|
1024
|
+
}), Na = /* @__PURE__ */ ee(ha, [["__scopeId", "data-v-e74206d7"]]);
|
|
1004
1025
|
export {
|
|
1005
1026
|
ue as D,
|
|
1006
1027
|
B as M,
|
|
1007
1028
|
ae as P,
|
|
1008
|
-
|
|
1009
|
-
|
|
1029
|
+
Na as R,
|
|
1030
|
+
Ma as S,
|
|
1010
1031
|
de as a,
|
|
1011
1032
|
ke as b,
|
|
1012
|
-
|
|
1033
|
+
Re as c,
|
|
1013
1034
|
Me as d,
|
|
1014
1035
|
$e as e,
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1036
|
+
ka as f,
|
|
1037
|
+
Da as g,
|
|
1038
|
+
$a as h,
|
|
1039
|
+
Ra as i,
|
|
1040
|
+
qa as j,
|
|
1041
|
+
Ae as k,
|
|
1042
|
+
Ta as l,
|
|
1043
|
+
La as n,
|
|
1044
|
+
Oa as p,
|
|
1024
1045
|
Aa as r,
|
|
1025
|
-
|
|
1026
|
-
|
|
1046
|
+
xa as s,
|
|
1047
|
+
Fa as t,
|
|
1027
1048
|
Ia as u
|
|
1028
1049
|
};
|