@agile-team/mach-report 2.16.0 → 2.18.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.
Files changed (177) hide show
  1. package/README.md +25 -12
  2. package/dist/{ExcelBindingWizard-CP6h2x1f.cjs → ExcelBindingWizard-Czn3C2yE.cjs} +1 -1
  3. package/dist/{ExcelBindingWizard-HhB3hAJE.js → ExcelBindingWizard-DMGZj6I6.js} +3 -3
  4. package/dist/ParamEditor-KzDQvbHY.js +732 -0
  5. package/dist/ParamEditor-oDfD8LgE.cjs +1 -0
  6. package/dist/{ReportBatchPanel-ruxcbfY6.js → ReportBatchPanel-BJK7PvZ4.js} +39 -39
  7. package/dist/ReportBatchPanel-DnmNRssu.cjs +1 -0
  8. package/dist/ReportParamPanel-mQkeN70Q.js +1020 -0
  9. package/dist/ReportParamPanel-sOANVRz-.cjs +1 -0
  10. package/dist/ReportPreview-BxWWTUL5.js +5583 -0
  11. package/dist/ReportPreview-Yf99omi3.cjs +6 -0
  12. package/dist/{ReportTemplateLibrary-DcwrH-63.js → ReportTemplateLibrary-BFjB08Wu.js} +1 -1
  13. package/dist/{ReportTemplateLibrary-BDlNT8JN.cjs → ReportTemplateLibrary-BO42QnWd.cjs} +1 -1
  14. package/dist/RuleEditor-CqxT1a-W.js +2337 -0
  15. package/dist/RuleEditor-D7YWigD9.cjs +1 -0
  16. package/dist/{TemplateOutlinePanel-CGrT5DFN.cjs → TemplateOutlinePanel-B0XX350V.cjs} +1 -1
  17. package/dist/{TemplateOutlinePanel-SXCjaPKR.js → TemplateOutlinePanel-zG0DrsIB.js} +2 -2
  18. package/dist/{TemplateReusePanel-6Z3wRFz8.cjs → TemplateReusePanel-BD0HSKp_.cjs} +1 -1
  19. package/dist/{TemplateReusePanel-lHLOS9Wn.js → TemplateReusePanel-Czwe5GbC.js} +2 -2
  20. package/dist/{TemplateReviewPanel-Dpk7sLcF.cjs → TemplateReviewPanel-CA5sdffM.cjs} +1 -1
  21. package/dist/{TemplateReviewPanel-CJ9PLc48.js → TemplateReviewPanel-NhmQI65C.js} +2 -2
  22. package/dist/analytics.cjs +1 -1
  23. package/dist/analytics.d.cts +163 -42
  24. package/dist/analytics.d.ts +163 -42
  25. package/dist/analytics.js +76 -141
  26. package/dist/artifact-integrity.json +110 -108
  27. package/dist/assets-2eC3mOcV.js +232 -0
  28. package/dist/assets-B0Hxn4l6.cjs +1 -0
  29. package/dist/{auto-uVBjX1j5.cjs → auto-B0EZFIK1.cjs} +1 -1
  30. package/dist/{auto-YR7a4BtF.js → auto-BlchZ1b8.js} +10 -10
  31. package/dist/{batch-WzDIXJAt.js → batch-DGCt44XM.js} +1 -1
  32. package/dist/{batch-z6Aw5GEY.cjs → batch-DYcokH4v.cjs} +1 -1
  33. package/dist/charts-Dlv8j2AG.js +141 -0
  34. package/dist/charts-aCtoswXq.cjs +1 -0
  35. package/dist/codes.cjs +9 -9
  36. package/dist/codes.d.cts +54 -0
  37. package/dist/codes.d.ts +54 -0
  38. package/dist/codes.js +12097 -13668
  39. package/dist/column-visual-BpgQVWwT.js +238 -0
  40. package/dist/column-visual-CtYxnBCP.cjs +1 -0
  41. package/dist/component-tree-6TV7W6Yj.cjs +1 -0
  42. package/dist/component-tree-CvW4lzpv.js +67 -0
  43. package/dist/computed-4TnxzgIh.cjs +1 -0
  44. package/dist/computed-C8NRZQss.js +739 -0
  45. package/dist/data-bar-Ce38juRZ.cjs +1 -0
  46. package/dist/data-bar-PtjXhMgN.js +9 -0
  47. package/dist/dataset-DL83majE.js +161 -0
  48. package/dist/dataset-IrlXbUvh.cjs +1 -0
  49. package/dist/designer--TKECSEc.cjs +2 -0
  50. package/dist/designer-d6hJS41w.js +5683 -0
  51. package/dist/designer.cjs +1 -1
  52. package/dist/designer.d.cts +835 -45
  53. package/dist/designer.d.ts +835 -45
  54. package/dist/designer.js +23 -20
  55. package/dist/{encoding-BYF9ZTl9.cjs → encoding-B--eZpp1.cjs} +1 -1
  56. package/dist/{encoding-BOGq4qYL.js → encoding-mctOLocI.js} +2 -2
  57. package/dist/{font-loader-EKLzOJxf.cjs → font-loader-DBBJ5KE9.cjs} +1 -1
  58. package/dist/{font-loader-CzI1GuBc.js → font-loader-DW8tIaNp.js} +1 -1
  59. package/dist/index-CPh6tqge.js +1575 -0
  60. package/dist/index-CUNw7dL9.cjs +1 -0
  61. package/dist/index.cjs +8 -8
  62. package/dist/index.d.cts +534 -16
  63. package/dist/index.d.ts +534 -16
  64. package/dist/index.js +1393 -955
  65. package/dist/json-snapshot-By4ZVVUt.js +1967 -0
  66. package/dist/json-snapshot-jiXff4lc.cjs +2 -0
  67. package/dist/matrix-0hywp0-F.cjs +1 -0
  68. package/dist/matrix-Dy-tyY7E.js +381 -0
  69. package/dist/param-validation-C-8sRJLq.cjs +1 -0
  70. package/dist/param-validation-CnDEd2l-.js +333 -0
  71. package/dist/{pdf-DJ5S6ukC.js → pdf-CKROKygt.js} +1845 -1845
  72. package/dist/{pdf-ByVCb1i6.cjs → pdf-DqyxJ96U.cjs} +47 -47
  73. package/dist/pdf.cjs +1 -1
  74. package/dist/pdf.d.cts +66 -0
  75. package/dist/pdf.d.ts +66 -0
  76. package/dist/pdf.js +2 -2
  77. package/dist/{plugin-C2j5_mhx.js → plugin-ByjF2kiV.js} +5 -5
  78. package/dist/{plugin-Dr39GBRG.cjs → plugin-DM1M2wlI.cjs} +1 -1
  79. package/dist/prefill-B8H9qwE4.js +371 -0
  80. package/dist/prefill-D7EswyTI.cjs +1 -0
  81. package/dist/{prepared-DqtpvRTn.js → prepared-BE-4jfX5.js} +2 -2
  82. package/dist/{prepared-DdrjLC7L.cjs → prepared-CGVphji3.cjs} +1 -1
  83. package/dist/{protocol-BzwMP4Vw.cjs → protocol-ByRVzzQG.cjs} +1 -1
  84. package/dist/{protocol-kt4Iy6-3.js → protocol-Cr81vFSQ.js} +3 -3
  85. package/dist/{record-bindings-CZWBJ1fU.js → record-bindings-DEJtmo3p.js} +67 -107
  86. package/dist/record-bindings-ehjnCDHt.cjs +1 -0
  87. package/dist/{region-binding-workflow-CWNvIjkV.js → region-binding-workflow-CBg0l_tj.js} +2 -2
  88. package/dist/{region-binding-workflow-CqSMxQ4p.cjs → region-binding-workflow-D05tOYn3.cjs} +1 -1
  89. package/dist/report-encoding-worker.cjs +1 -1
  90. package/dist/report-encoding-worker.js +1 -1
  91. package/dist/{report-params-B1RzkhJj.js → report-params-D9tBuM9B.js} +1 -1
  92. package/dist/{report-params-WDGrA4oP.cjs → report-params-VTg8MoCp.cjs} +1 -1
  93. package/dist/runtime-CDA6d263.cjs +1 -0
  94. package/dist/runtime-CEMvybO7.js +170 -0
  95. package/dist/sbom.cdx.json +1 -1
  96. package/dist/server/node.d.cts +121 -7
  97. package/dist/server/node.d.ts +121 -7
  98. package/dist/server-node.cjs +4 -4
  99. package/dist/server-node.js +3446 -2115
  100. package/dist/server.cjs +1 -1
  101. package/dist/server.d.cts +417 -29
  102. package/dist/server.d.ts +417 -29
  103. package/dist/server.js +787 -544
  104. package/dist/sha256-BDQ1Qk7A.js +158 -0
  105. package/dist/sha256-DgZAKXqI.cjs +1 -0
  106. package/dist/style.css +1 -1
  107. package/dist/template-bindings-Cg5oBLFT.cjs +1 -0
  108. package/dist/template-bindings-TKnXM7ll.js +62 -0
  109. package/dist/{template-catalog-BtR2JmCL.js → template-catalog-CmbWOJqy.js} +16 -16
  110. package/dist/template-catalog-Utu4GP09.cjs +1 -0
  111. package/dist/{template-fragments-BVsbxs4a.cjs → template-fragments-C_zSHJAa.cjs} +1 -1
  112. package/dist/{template-fragments-By0aZC1D.js → template-fragments-DWgo9tlZ.js} +2 -2
  113. package/dist/{template-outline-BwRV_eRo.cjs → template-outline-DWkzZXVC.cjs} +1 -1
  114. package/dist/{template-outline-cnWfT_LK.js → template-outline-DiADphlq.js} +1 -1
  115. package/dist/{template-registry-Cw3vRTX2.js → template-registry-BIhIHOab.js} +319 -314
  116. package/dist/template-registry-DzWswQI5.cjs +1 -0
  117. package/dist/vue/async.d.cts +636 -35
  118. package/dist/vue/async.d.ts +636 -35
  119. package/dist/vue/index.d.cts +746 -67
  120. package/dist/vue/index.d.ts +746 -67
  121. package/dist/vue-async.cjs +1 -1
  122. package/dist/vue-async.js +3 -3
  123. package/dist/vue.cjs +1 -1
  124. package/dist/vue.js +94 -89
  125. package/dist/{workbook-session-Cbts-22R.cjs → workbook-session-B94EwVa_.cjs} +1 -1
  126. package/dist/{workbook-session-BeSO8PFB.js → workbook-session-BoScoOg-.js} +2 -2
  127. package/dist/worker.cjs +1 -1
  128. package/dist/worker.d.cts +75 -7
  129. package/dist/worker.d.ts +75 -7
  130. package/dist/worker.js +4 -4
  131. package/dist/xlsx.cjs +4 -4
  132. package/dist/xlsx.d.cts +208 -15
  133. package/dist/xlsx.d.ts +208 -15
  134. package/dist/xlsx.js +288 -252
  135. package/package.json +1 -1
  136. package/dist/ParamEditor-CUQLgoxa.cjs +0 -1
  137. package/dist/ParamEditor-OKesP_nO.js +0 -594
  138. package/dist/ReportBatchPanel-cZCAMAwH.cjs +0 -1
  139. package/dist/ReportPreview-BcDKCLiK.js +0 -4834
  140. package/dist/ReportPreview-Bk9nLfO9.cjs +0 -6
  141. package/dist/RuleEditor-BX5S8RSF.cjs +0 -1
  142. package/dist/RuleEditor-CGl9XY2s.js +0 -2037
  143. package/dist/assets-CqIbfbTr.js +0 -126
  144. package/dist/assets-e4YSke8n.cjs +0 -1
  145. package/dist/capabilities-DDwXr_cA.js +0 -103
  146. package/dist/capabilities-DNLyZdNw.cjs +0 -1
  147. package/dist/component-tree-Ca6YYfHq.js +0 -61
  148. package/dist/component-tree-DkGLEfZC.cjs +0 -1
  149. package/dist/computed-C-4C2S5h.js +0 -521
  150. package/dist/computed-CGV2a809.cjs +0 -1
  151. package/dist/config-Dg_o8e7m.cjs +0 -1
  152. package/dist/config-XQ4qrQ7Q.js +0 -844
  153. package/dist/dataset-BkRmwgeJ.cjs +0 -1
  154. package/dist/dataset-H5pFuQGU.js +0 -121
  155. package/dist/designer-BfQSahxq.js +0 -5163
  156. package/dist/designer-CPPdeM5_.cjs +0 -2
  157. package/dist/diagnostic-notification-B9K9We3h.cjs +0 -1
  158. package/dist/diagnostic-notification-qGAYZdkB.js +0 -7
  159. package/dist/drill-CsdjgkRM.cjs +0 -1
  160. package/dist/drill-DIGsZfyB.js +0 -145
  161. package/dist/json-snapshot-D6ioHth9.js +0 -1702
  162. package/dist/json-snapshot-DknkjvxP.cjs +0 -2
  163. package/dist/matrix-CGRGkn5s.js +0 -112
  164. package/dist/matrix-gEO7ZM_u.cjs +0 -1
  165. package/dist/param-validation-C3HlcLLO.cjs +0 -1
  166. package/dist/param-validation-Do7Eg8Zv.js +0 -181
  167. package/dist/record-bindings-DUX1VMlR.cjs +0 -1
  168. package/dist/runtime-BjKBI530.js +0 -168
  169. package/dist/runtime-CBFEPKEs.cjs +0 -1
  170. package/dist/sha256-BshdOkCC.cjs +0 -1
  171. package/dist/sha256-DTG-Gq8i.js +0 -157
  172. package/dist/template-bindings-C2SpvsMU.js +0 -58
  173. package/dist/template-bindings-CEtWyiLX.cjs +0 -1
  174. package/dist/template-catalog-C2NLdrwB.cjs +0 -1
  175. package/dist/template-registry-C62vpv4a.cjs +0 -1
  176. package/dist/tree-BX380Rr7.cjs +0 -1
  177. package/dist/tree-CjVZLRw7.js +0 -172
@@ -0,0 +1,1020 @@
1
+ import { ref as k, watch as D, 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 I, normalizeClass as Y, createVNode as W, withModifiers as he, createBlock as ne, withKeys as K } from "vue";
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 Pe, parseReportParamSelection as Ce, formatReportParamSelection as Oe } from "@agile-team/mach-report";
4
+ import { w as xe } from "./progress-Hc2vxoCs.js";
5
+ import { _ as ee, a as X } from "./_plugin-vue_export-helper-8SL1F89S.js";
6
+ const Ae = {
7
+ printPrepareTimeout: "打印资源准备超时,请检查字体与图片后重试。",
8
+ printImageFailed: "第 {index} 张图片未能加载,已停止打印,避免输出缺失内容。",
9
+ printFontFailed: "打印字体 {family} 未能加载,请检查字体资源后重试。",
10
+ printPrepareFailed: "打印准备失败,请检查打印配置或改用 PDF。",
11
+ printCalibration: "打印校准",
12
+ printOffsetX: "水平偏移(mm)",
13
+ printOffsetY: "垂直偏移(mm)",
14
+ printCalibrationTest: "打印校准页",
15
+ printCalibrationHint: "正值向右/向下移动,负值向左/向上。使用同规格纸张及 100% 比例,先试打一张。系统对话框关闭不代表设备已完成。"
16
+ };
17
+ function Ca(e) {
18
+ const l = e?.calibration?.offsetXmm ?? 0, n = e?.calibration?.offsetYmm ?? 0;
19
+ if (![l, n].every((t) => Number.isFinite(t) && Math.abs(t) <= 20)) throw new RangeError("Print calibration must be within ±20 mm");
20
+ return { x: l, y: n };
21
+ }
22
+ function Oa(e = {}) {
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((l) => ({ ...l })) } : {}, ...e.calibration ? { calibration: { ...e.calibration } } : {} };
25
+ }
26
+ function Re(e = {}) {
27
+ const l = k(!1), n = k(null), t = k(null), i = k(null);
28
+ function c(d = !1) {
29
+ l.value = !1, d && V(() => t.value?.focus());
30
+ }
31
+ function g(d) {
32
+ d.target instanceof Node && !n.value?.contains(d.target) && c();
33
+ }
34
+ function s(d) {
35
+ d.key !== "Escape" || !l.value || d.isComposing || (d.preventDefault(), d.stopPropagation(), c(!0));
36
+ }
37
+ return D(l, (d) => {
38
+ !d || e.focusOnOpen === !1 || V(() => (i.value?.querySelector("input") ?? i.value?.querySelector("button:not(:disabled)"))?.focus());
39
+ }), ge(() => {
40
+ document.addEventListener("pointerdown", g), document.addEventListener("focusin", g);
41
+ }), ie(() => {
42
+ document.removeEventListener("pointerdown", g), document.removeEventListener("focusin", g);
43
+ }), { opened: l, root: n, trigger: t, panel: i, close: c, onKeydown: s };
44
+ }
45
+ const ae = {
46
+ paramOptionsLoading: "正在搜索选项…",
47
+ paramOptionsEmpty: "没有匹配选项",
48
+ paramOptionsFailed: "选项加载失败,请重试",
49
+ paramOptionsMissingLoader: "尚未配置选项加载服务",
50
+ paramOptionsDependencies: "请先选择上级条件",
51
+ paramOptionsClear: "清除选择",
52
+ paramNumberRangeStart: "最小值",
53
+ paramNumberRangeEnd: "最大值"
54
+ }, de = {
55
+ prefillTitle: "安全预填",
56
+ prefillHint: "按业务主键匹配白名单字段,先核对差异再整批应用;默认只补空白。",
57
+ prefillCurrent: "当前值",
58
+ prefillReference: "参考 / 待填值",
59
+ prefillLoad: "读取参考数据",
60
+ prefillApply: "应用预填",
61
+ prefillMatched: "一致",
62
+ prefillChanged: "可补入",
63
+ prefillSkipped: "已跳过",
64
+ prefillConflict: "需处理",
65
+ prefillUnchanged: "值一致",
66
+ prefillReadonly: "只读",
67
+ prefillOccupied: "保留已有值",
68
+ prefillMissingSource: "来源为空",
69
+ prefillMissingTarget: "无匹配目标",
70
+ prefillAmbiguous: "同源值不一致",
71
+ prefillInvalid: "值格式无效",
72
+ comparisonTitle: "业务数据对比",
73
+ comparisonHint: "按稳定业务主键比较参考数据与本次查询,不按显示行号匹配。",
74
+ comparisonLoad: "读取并对比",
75
+ comparisonAdded: "新增",
76
+ comparisonRemoved: "删除",
77
+ comparisonChanged: "变化",
78
+ comparisonUnchanged: "一致",
79
+ reviewCancel: "取消读取",
80
+ reviewClose: "关闭数据核对",
81
+ reviewBefore: "参考值",
82
+ reviewAfter: "当前 / 待填值",
83
+ reviewField: "字段",
84
+ reviewKey: "业务主键",
85
+ reviewDelta: "差额",
86
+ reviewRatio: "变化比率",
87
+ reviewLocate: "定位",
88
+ reviewEmpty: "暂无差异记录",
89
+ reviewPrevious: "上一页",
90
+ reviewNext: "下一页",
91
+ reviewPage: "差异分页"
92
+ };
93
+ function xa(e) {
94
+ return { ...de, ...Object.fromEntries(Object.entries(e).filter(([, l]) => l !== void 0)) };
95
+ }
96
+ const ue = {
97
+ calculationTitle: "选区计算",
98
+ calculationLocal: "仅本地分析,不写回实绩、不重算原公式。请选取同一单位与量纲的数值。",
99
+ calculationHint: "点击起点,Shift + 点击终点或方向键扩选。",
100
+ calculationFormula: "计算方式",
101
+ calculationExpression: "组合公式",
102
+ calculationExpressionHint: "支持 SUM、AVERAGE/AVG、MIN、MAX、COUNT、MEDIAN 及 + - * / 和括号,不执行 Excel 公式;采用浮点数,精度仅用于展示。",
103
+ calculationPrecision: "展示小数位",
104
+ calculationRun: "计算选区",
105
+ calculationCancel: "取消计算",
106
+ calculationResult: "计算结果",
107
+ calculationIncluded: "参与数值",
108
+ calculationExcluded: "排除单元格",
109
+ calculationEmpty: "选区没有可计算数值,计数为 0,其余结果为空。",
110
+ calculationNoSelection: "先关闭设置并选择数据,再从底部工具栏打开选区计算。",
111
+ calculationSum: "求和 SUM",
112
+ calculationAverage: "平均值 AVERAGE",
113
+ calculationMin: "最小值 MIN",
114
+ calculationMax: "最大值 MAX",
115
+ calculationCount: "数值计数 COUNT",
116
+ calculationMedian: "中位数 MEDIAN",
117
+ calculationCustom: "组合公式",
118
+ calculationErrorSelection: "请选择同一明细区域中的数据。",
119
+ calculationErrorLimit: "选区超过计算预算,请缩小范围后重试。",
120
+ calculationErrorExpression: "公式无效,请使用支持的摘要名称、运算符与括号。",
121
+ calculationErrorDivision: "除数不能为 0。",
122
+ calculationErrorOverflow: "结果超出有效数值范围。",
123
+ calculationErrorPrecision: "数值超出安全精度,或展示小数位不是 0 至 12 的整数。"
124
+ };
125
+ function Aa(e) {
126
+ const l = { ...ue };
127
+ for (const n of Object.keys(l)) {
128
+ const t = e[n];
129
+ typeof t == "string" && (l[n] = t);
130
+ }
131
+ return l;
132
+ }
133
+ const ke = {
134
+ ...ae,
135
+ ...de,
136
+ reviewTools: "数据工具",
137
+ validationTitle: "数据校验",
138
+ validationError: "错误",
139
+ validationWarning: "提示",
140
+ validationDataset: "全表",
141
+ validationRow: "行",
142
+ validationMore: "请缩小范围查看更多问题",
143
+ drillActions: "查看关联",
144
+ drillOpening: "正在打开…",
145
+ drillMissingValue: "当前单元格缺少关联参数",
146
+ drillFailed: "关联内容打开失败,请重试",
147
+ ...Ae,
148
+ ...ue,
149
+ exportMenu: "导出",
150
+ exportMenuDescription: "选择文件格式",
151
+ clearSearch: "清除搜索",
152
+ searchHint: "Enter 下一个 · Shift+Enter 上一个",
153
+ searchNoMatches: "没有匹配内容",
154
+ pageJump: "跳至页",
155
+ pageJumpInvalid: "请输入有效页码",
156
+ pageJumpHint: "Enter 跳转",
157
+ pagination: "报表分页",
158
+ recordNavigation: "标签记录",
159
+ recordInfo: "记录 {cur} / {total}",
160
+ prevRecord: "上一条记录",
161
+ nextRecord: "下一条记录",
162
+ dataExplanation: "来源数据说明",
163
+ dataExplanationHint: "按字段查看来源与计算说明",
164
+ dataExplanationSearch: "搜索说明、字段或记录",
165
+ dataExplanationEmpty: "没有匹配的数据说明",
166
+ dataMissingSource: "暂无来源",
167
+ dataNotApplicable: "业务不适用",
168
+ dataNotCalculable: "无法计算",
169
+ columnSearchHint: "输入列名或字段标识",
170
+ columnSearchShortcut: "↑ ↓ 选择 · Enter 定位",
171
+ closeColumnDirectory: "关闭字段目录",
172
+ columnResultsMore: "{count} 个匹配字段,显示前 {limit} 个;继续输入可缩小范围",
173
+ columnCount: "{count} 个字段",
174
+ settingsGeneral: "常规",
175
+ settingsTools: "工具",
176
+ settingsAdvanced: "高级",
177
+ settingsAdvancedDescription: "按需开启分析能力,保持日常阅读简洁。",
178
+ settingsCalculations: "启用选区计算",
179
+ settingsCalculationsDescription: "选取数值后计算求和、平均值或组合公式,仅用于本地分析。",
180
+ title: "报表预览",
181
+ prevPage: "‹ 上一页",
182
+ nextPage: "下一页 ›",
183
+ pageInfo: "{cur} / {total}",
184
+ fitWidth: "适宽",
185
+ exportHtml: "导出 HTML",
186
+ exportPdf: "导出 PDF",
187
+ exportExcel: "导出 Excel",
188
+ exportImage: "导出图片",
189
+ exportWord: "导出 Word",
190
+ exporting: "正在生成 {format}…",
191
+ print: "打印",
192
+ pdfWindow: "PDF 窗口",
193
+ loading: "报表渲染中…",
194
+ empty: "暂无预览数据",
195
+ errorPrefix: "",
196
+ retry: "重试",
197
+ pdfFontUnavailable: "PDF 字体尚未就绪,请联系管理员检查字体配置;预览及其它导出仍可使用。",
198
+ searchPlaceholder: "搜索报表内容",
199
+ matchInfo: "{cur}/{total}",
200
+ prevMatch: "‹",
201
+ nextMatch: "›",
202
+ thumbnails: "缩略图",
203
+ paramsTitle: "查询条件",
204
+ query: "查 询",
205
+ reset: "重 置",
206
+ paramRequired: "请填写{label}",
207
+ paramInvalid: "{label}:{message}",
208
+ paramPrompt: "请先完善查询条件",
209
+ paramPromptDescription: "填写必填条件后点击查询,即可生成报表。",
210
+ paramSelectPlaceholder: "请选择{label}",
211
+ paramTextPlaceholder: "请输入{label}",
212
+ paramRangeStart: "开始日期",
213
+ paramRangeEnd: "结束日期",
214
+ searching: "搜索中…",
215
+ importExcel: "导入 Excel 模板",
216
+ importing: "正在导入 Excel…",
217
+ editCell: "编辑单元格",
218
+ editingHint: "双击单元格编辑 · Enter 确认 · Esc 取消",
219
+ saving: "正在保存修改…",
220
+ editInvalidNumber: "请输入有效数字;清空表示无值",
221
+ editInvalidBoolean: "请输入 true / false、是 / 否或 1 / 0",
222
+ editConflict: "该单元格已变化,请重新打开编辑",
223
+ settings: "设置",
224
+ settingsDisplay: "阅读工具",
225
+ settingsExport: "导出与打印",
226
+ settingsData: "数据操作",
227
+ settingsUnavailable: "需由接入方配置启用",
228
+ settingsReset: "恢复默认",
229
+ settingsClose: "关闭设置",
230
+ search: "内容搜索",
231
+ closeSearch: "关闭搜索",
232
+ prevSearchMatch: "上一个匹配",
233
+ nextSearchMatch: "下一个匹配",
234
+ zoom: "缩放工具",
235
+ settingsLocal: "按需启用工具,仅作用于当前预览。",
236
+ editingLocal: "修改为本地草稿;不会自动写入业务数据库。",
237
+ editingSaved: "修改将通过接入方配置的保存回调提交。",
238
+ importLocal: "导入仅生成本地预览,不自动替换业务数据。",
239
+ emptyDescription: "当前查询没有明细,请调整查询条件后重试。",
240
+ undo: "撤销",
241
+ redo: "重做",
242
+ restoreChanges: "恢复来源值",
243
+ changes: "修改明细",
244
+ changesCount: "{count} 处修改",
245
+ changesEmpty: "尚无修改",
246
+ changesBefore: "来源值",
247
+ changesAfter: "当前值",
248
+ editAtomicRequired: "批量保存需要接入方提供原子 saveBatch 回调;本次未写入任何单元格。",
249
+ clipboardLimit: "单次最多粘贴 10000 个单元格,请分批处理。",
250
+ preferencesError: "偏好存储不可用,设置仍在当前预览中生效。",
251
+ freezeHeaders: "冻结表头",
252
+ frozenColumns: "冻结前列",
253
+ sections: "工作表与章节",
254
+ locateField: "定位字段",
255
+ locateFieldPlaceholder: "输入字段标识,Enter 定位",
256
+ locateFieldMissing: "未找到该字段,请核对字段标识。",
257
+ importSummary: "Excel 导入摘要",
258
+ importPreserved: "已导入 {sheets} 个工作表,保留内容、合并和样式。",
259
+ importWarnings: "兼容性提示",
260
+ importReadOnly: "公式、日期及受保护单元格保持只读;公式不重算。",
261
+ conflicts: "保存冲突",
262
+ editReadOnly: "选区包含只读或无权限单元格,本次修改未应用。",
263
+ editMissing: "选区超出报表范围或缺少业务来源,请重新选择。",
264
+ editRecalculationUnavailable: "此报表缺少重算会话或稳定数据来源,暂不支持编辑;请使用 reports/本地数据源重新加载。",
265
+ editDuplicate: "选区包含同一业务字段的重复单元格,请缩小选区。",
266
+ clipboardInvalid: "剪贴板内容无法识别,请使用矩形表格文本重新粘贴。",
267
+ editSaved: "修改已通过保存回调确认",
268
+ settingsPanes: "冻结窗格",
269
+ columnDirectory: "字段目录",
270
+ columnSearch: "搜索列名或字段",
271
+ columnNoMatches: "未找到匹配字段",
272
+ columnResults: "匹配字段",
273
+ columnGroup: "明细区域",
274
+ discardTitle: "保留当前修改?",
275
+ discardDescription: "当前报表有尚未保存的输入或本地草稿,继续操作将替换这些内容。",
276
+ discardKeep: "继续编辑",
277
+ discardProceed: "放弃修改并继续",
278
+ taskQuery: "正在获取数据…",
279
+ taskValidate: "正在校验数据…",
280
+ taskLayout: "正在生成版式…",
281
+ taskAssets: "正在准备图片和字体…",
282
+ taskEncode: "正在生成文件…",
283
+ taskDownload: "正在准备下载…",
284
+ taskPrint: "正在准备打印…",
285
+ taskCancel: "取消任务",
286
+ taskCancelled: "任务已取消,可重新操作。",
287
+ diagnosticsSearch: "搜索提示、错误码或位置",
288
+ diagnosticsMore: "共 {count} 条匹配,当前展示前 100 条;请搜索缩小范围。",
289
+ diagnosticsTitle: "输出兼容性提示",
290
+ diagnosticsLocate: "定位",
291
+ diagnosticsLocation: "第 {page} 页 · 组件 {component}",
292
+ diagnosticsStrict: "当前格式存在已知内容降级,请查看兼容性提示或选择其他输出格式。",
293
+ diagnosticsDetails: "查看技术详情",
294
+ diagnosticMissingImage: "图片或图表资源尚未准备完成,请重试或联系管理员。",
295
+ diagnosticUnsupported: "当前输出格式会省略此内容,建议选择 PDF 或图片格式。",
296
+ diagnosticUnsupportedStyle: "当前格式无法保留部分样式,请查看位置并选择适合的输出格式。",
297
+ diagnosticImageFormat: "当前图片格式无法直接导出,请转换资源后重试。",
298
+ diagnosticRichText: "文字内容会保留,部分字体与段落样式将简化。",
299
+ diagnosticNested: "单元格中的嵌套内容会省略,单元格文字会保留。",
300
+ diagnosticImageAsync: "图片需要完成加载后才能输出。",
301
+ diagnosticImageDecode: "图片加载失败,请检查资源后重试。",
302
+ diagnosticAssetFailed: "图表或图片生成失败,请重试或联系管理员。",
303
+ diagnosticAssetBudget: "图片资源超出处理范围,请减少资源或缩小报表范围。"
304
+ }, Me = {
305
+ emptyAccent: "#79a7e8",
306
+ shellBg: "#f4f7fc",
307
+ shellFg: "#334155",
308
+ toolbarBg: "#ffffff",
309
+ toolbarBorder: "#e4eaf3",
310
+ toolbarFg: "#334155",
311
+ btnFg: "#526078",
312
+ btnBorder: "#dbe3ef",
313
+ btnHoverBg: "#edf3ff",
314
+ btnHoverFg: "#315fba",
315
+ btnActiveBg: "#3569d4"
316
+ };
317
+ function $e(e = {}) {
318
+ return { ...e, defaults: e.defaults ?? {}, presets: e.presets ?? {} };
319
+ }
320
+ function Ra(e) {
321
+ return e;
322
+ }
323
+ const T = {
324
+ showExport: !0,
325
+ showPrint: !0,
326
+ showPdfWindow: !0,
327
+ showSettings: !0,
328
+ showParams: !0,
329
+ gapPx: 18,
330
+ pdfFontUrl: "/simhei.ttf",
331
+ logger: console
332
+ }, ka = { warn: () => {
333
+ }, info: () => {
334
+ } };
335
+ function Fe(e, l) {
336
+ if (!(!e && !l))
337
+ return { ...e, ...l, calibration: { ...e?.calibration, ...l?.calibration } };
338
+ }
339
+ function j(e, l) {
340
+ return {
341
+ ...e,
342
+ ...l,
343
+ theme: { ...e?.theme, ...l?.theme },
344
+ messages: { ...e?.messages, ...l?.messages },
345
+ preview: { ...e?.preview, ...l?.preview },
346
+ xlsx: { ...e?.xlsx, ...l?.xlsx },
347
+ toolbar: { ...e?.toolbar, ...l?.toolbar },
348
+ interaction: { ...e?.interaction, ...l?.interaction },
349
+ output: { ...e?.output, ...l?.output },
350
+ printOptions: Fe(e?.printOptions, l?.printOptions)
351
+ };
352
+ }
353
+ function Ie(e) {
354
+ return {
355
+ showExport: e.showExport ?? T.showExport,
356
+ showPrint: e.showPrint ?? T.showPrint,
357
+ showPdfWindow: e.showPdfWindow ?? T.showPdfWindow,
358
+ showSettings: e.showSettings ?? T.showSettings,
359
+ showParams: e.showParams ?? T.showParams,
360
+ gapPx: e.gapPx ?? T.gapPx
361
+ };
362
+ }
363
+ function Ma(e, l) {
364
+ const n = l ? e?.presets?.[l] : e?.defaultPreset ? e?.presets?.[e.defaultPreset] : void 0, t = j(e?.defaults, n);
365
+ return {
366
+ drill: t.drill,
367
+ prefill: t.prefill,
368
+ dataComparison: t.dataComparison,
369
+ exportExecution: t.exportExecution,
370
+ loadParamOptions: t.loadParamOptions,
371
+ ...Ie(t),
372
+ pdfFontUrl: t.pdfFontUrl ?? T.pdfFontUrl,
373
+ theme: { ...Me, ...t.theme },
374
+ messages: { ...ke, ...t.messages },
375
+ logger: t.logger ?? T.logger,
376
+ preview: {
377
+ overscanPages: re(t.preview?.overscanPages, 1, 10, !0),
378
+ searchDebounceMs: re(t.preview?.searchDebounceMs, 200, 2e3)
379
+ },
380
+ xlsx: { ...t.xlsx },
381
+ editable: t.editable ?? !1,
382
+ excelImport: t.excelImport ?? !1,
383
+ toolbar: { ...t.toolbar },
384
+ interaction: { ...t.interaction },
385
+ preferences: t.preferences,
386
+ assets: t.assets,
387
+ guardChanges: t.guardChanges ?? !0,
388
+ beforeDiscard: t.beforeDiscard,
389
+ output: { ...t.output },
390
+ printOptions: t.printOptions
391
+ };
392
+ }
393
+ function re(e, l, n, t = !1) {
394
+ if (e == null || !Number.isFinite(e)) return l;
395
+ const i = Math.max(0, Math.min(n, e));
396
+ return t ? Math.floor(i) : i;
397
+ }
398
+ function $a(e) {
399
+ const l = {};
400
+ 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;
401
+ }
402
+ function Fa(e) {
403
+ const l = se(Q, null), n = E(() => {
404
+ const t = l?.value ?? null, i = "defaults" in e || "presets" in e || "defaultPreset" in e ? $e(e) : { defaults: e, presets: {} };
405
+ if (!t) return i;
406
+ const c = { ...t.presets, ...i.presets };
407
+ for (const g of Object.keys(c))
408
+ c[g] = j(
409
+ j(t.presets[g], i.defaults),
410
+ i.presets[g]
411
+ );
412
+ return {
413
+ defaults: j(t.defaults, i.defaults),
414
+ presets: c,
415
+ defaultPreset: i.defaultPreset ?? t.defaultPreset
416
+ };
417
+ });
418
+ be(Q, n);
419
+ }
420
+ function Ia() {
421
+ return se(Q, E(() => null));
422
+ }
423
+ class B extends Error {
424
+ constructor(l, n, t) {
425
+ super(n), this.name = "MachReportError", this.code = l, this.cause = t;
426
+ }
427
+ }
428
+ function Da(e) {
429
+ return e instanceof B ? { code: e.code, cause: e.cause } : { code: "render", cause: e };
430
+ }
431
+ function qa(e) {
432
+ if (e instanceof B) return e;
433
+ if (e instanceof we) return new B("param", e.message, e);
434
+ if (e instanceof Ee) return new B(e.code, e.message, e.cause);
435
+ if (e instanceof Error) {
436
+ const l = { params: "param", config: "config", validate: "validate", fetch: "fetch" }, n = e.code;
437
+ if (typeof n == "string" && Object.prototype.hasOwnProperty.call(l, n)) return new B(l[n], e.message, e);
438
+ }
439
+ return new B("fetch", e instanceof Error ? e.message : "预览加载失败", e);
440
+ }
441
+ let De = 0;
442
+ function qe() {
443
+ return `mrp-params-${++De}`;
444
+ }
445
+ function ce(e, l, n) {
446
+ const t = (Array.isArray(l) ? l.find((i) => i?.field === e.field)?.label : void 0) ?? e.field;
447
+ return e.code === "required" ? n.paramRequired.replace("{label}", t) : (n.paramInvalid ?? "{label}:{message}").replace("{label}", t).replace("{message}", e.message);
448
+ }
449
+ function La(e) {
450
+ const l = k({}), n = k(!1);
451
+ function t() {
452
+ const s = {};
453
+ for (const d of Array.isArray(e.defs.value) ? e.defs.value : [])
454
+ typeof d?.field == "string" && Object.defineProperty(s, d.field, { value: e.params()[d.field] ?? d.defaultValue ?? "", writable: !0, enumerable: !0, configurable: !0 });
455
+ l.value = s, n.value = !1;
456
+ }
457
+ t(), D(e.defs, t), D(e.reportIds, t), D(() => JSON.stringify(e.params()), t);
458
+ const i = E(() => oe(e.defs.value, { ...e.params(), ...l.value })), c = E(() => !n.value && i.value.issues.length > 0 && i.value.issues.every((s) => s.code === "required"));
459
+ function g() {
460
+ const s = i.value;
461
+ if (!s.ok) {
462
+ const y = s.issues[0];
463
+ return { quiet: c.value, error: new B(y.code === "definition" ? "config" : "param", ce(y, e.defs.value, e.messages()), { issues: s.issues }) };
464
+ }
465
+ const d = { ...s.values }, R = new Set(e.defs.value.filter((y) => y.defaultValue !== void 0).map((y) => y.field));
466
+ for (const [y, u] of Object.entries(d)) u === "" && !R.has(y) && delete d[y];
467
+ return { params: d, quiet: !1 };
468
+ }
469
+ return { values: l, attempted: n, validation: i, pendingRequired: c, reset: t, query: g };
470
+ }
471
+ const Z = 100, Le = 32, Te = 6e4, Ne = 15e3;
472
+ function Be(e) {
473
+ let l = 0;
474
+ const n = /* @__PURE__ */ new Set();
475
+ function t(i, c) {
476
+ if (!Array.isArray(i) || c > 16 || i.length > Z) throw new Error("Invalid option response");
477
+ const g = /* @__PURE__ */ new Set();
478
+ return Object.freeze(i.map((s) => {
479
+ if (++l > Z || !s || n.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");
480
+ return n.add(s), g.add(s.value), Object.freeze({ label: s.label, value: s.value, ...s.children === void 0 ? {} : { children: t(s.children, c + 1) } });
481
+ }));
482
+ }
483
+ return t(e, 1);
484
+ }
485
+ function fe(e) {
486
+ const l = k(""), n = ye([]), t = k(!1), i = k(!1), c = E(() => Object.fromEntries((Array.isArray(e.def().dependsOn) ? e.def().dependsOn : []).map((A) => [A, e.values()[A] ?? ""]))), g = E(() => Object.values(c.value).some((A) => !A.trim())), s = E(() => !e.loader()), d = /* @__PURE__ */ new Map();
487
+ let R, y, u = 0;
488
+ function h() {
489
+ u++, R?.abort(), R = void 0, clearTimeout(y), t.value = !1;
490
+ }
491
+ async function b() {
492
+ h(), i.value = !1;
493
+ const A = e.loader(), M = e.def();
494
+ if (!A || !M.optionsSource || g.value || e.disabled() || !e.opened()) return;
495
+ const F = { source: M.optionsSource, field: M.field, query: l.value.trim().slice(0, 256), params: Object.freeze({ ...c.value }), limit: Z }, r = JSON.stringify(F), p = d.get(r);
496
+ if (p && Date.now() - p.at < Te) {
497
+ d.delete(r), d.set(r, p), n.value = p.options;
498
+ return;
499
+ }
500
+ const a = u, o = new AbortController();
501
+ R = o, t.value = !0;
502
+ const S = setTimeout(() => o.abort(), Ne);
503
+ try {
504
+ const O = Be(await xe(A(Object.freeze({ ...F, signal: o.signal })), o.signal));
505
+ if (a !== u) return;
506
+ for (n.value = O, d.delete(r), d.set(r, { at: Date.now(), options: O }); d.size > Le; ) d.delete(d.keys().next().value);
507
+ } catch {
508
+ a === u && (i.value = !0);
509
+ } finally {
510
+ clearTimeout(S), a === u && (t.value = !1, R = void 0);
511
+ }
512
+ }
513
+ function C() {
514
+ h(), n.value = [], i.value = !1, y = setTimeout(() => {
515
+ b();
516
+ }, 180);
517
+ }
518
+ return D(l, C, { flush: "sync" }), D([() => e.def().field, () => e.def().type, () => e.def().optionsSource, () => JSON.stringify(c.value), e.loader], () => {
519
+ d.clear(), l.value = "", h(), n.value = [], i.value = !1, e.opened() && b();
520
+ }, { flush: "sync" }), D([e.opened, e.disabled], () => {
521
+ !e.opened() || e.disabled() ? h() : b();
522
+ }, { immediate: !0 }), ie(() => {
523
+ h(), d.clear();
524
+ }), { query: l, options: n, loading: t, failed: i, waiting: g, missingLoader: s, request: b, cancel: h };
525
+ }
526
+ const Ue = ["aria-labelledby"], He = ["value", "disabled", "aria-label", "aria-invalid", "aria-describedby", "aria-required", "onChange"], Ve = { value: "" }, je = ["value"], Ge = ["id"], ze = /* @__PURE__ */ _({
527
+ __name: "ReportCascaderParam",
528
+ props: {
529
+ def: {},
530
+ value: {},
531
+ values: {},
532
+ loadOptions: { type: Function },
533
+ messages: {},
534
+ disabled: { type: Boolean },
535
+ id: {},
536
+ invalid: { type: Boolean }
537
+ },
538
+ emits: ["change"],
539
+ setup(e, { emit: l }) {
540
+ const n = e, t = l, i = fe({ def: () => n.def, values: () => n.values, loader: () => n.loadOptions, opened: () => !0, disabled: () => n.disabled === !0 }), c = E(() => {
541
+ const y = Se(n.value);
542
+ if (y) return y;
543
+ try {
544
+ const u = JSON.parse(n.value);
545
+ 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) : [];
546
+ } catch {
547
+ return [];
548
+ }
549
+ }), g = E(() => ({ ...ae, ...n.messages })), s = E(() => {
550
+ const y = [];
551
+ let u = n.def.optionsSource ? i.options.value : n.def.options ?? [];
552
+ for (let h = 0; h < 16 && u.length; h++)
553
+ y.push(u), u = u.find((b) => b.value === c.value[h])?.children ?? [];
554
+ return y;
555
+ }), d = E(() => n.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 : "");
556
+ function R(y, u) {
557
+ if (n.disabled) return;
558
+ const h = c.value.slice(0, y);
559
+ u && h.push(u);
560
+ const b = u ? s.value[y]?.find((C) => C.value === u)?.children : s.value[y];
561
+ t("change", h.length ? b?.length ? JSON.stringify([...h, null]) : Pe(h) : "");
562
+ }
563
+ return (y, u) => (f(), m("div", {
564
+ class: "mrp-cascader",
565
+ role: "group",
566
+ "aria-labelledby": `${e.id}-label`
567
+ }, [
568
+ (f(!0), m(U, null, H(s.value, (h, b) => (f(), m("select", {
569
+ key: b,
570
+ class: "mrp-param-input",
571
+ value: c.value[b] ?? "",
572
+ disabled: e.disabled || w(i).loading.value,
573
+ "aria-label": `${e.def.label ?? e.def.field} · ${b + 1}`,
574
+ "aria-invalid": e.invalid || void 0,
575
+ "aria-describedby": e.invalid ? `${e.id}-error` : d.value ? `${e.id}-status` : void 0,
576
+ "aria-required": e.def.required || void 0,
577
+ onChange: (C) => R(b, C.target.value)
578
+ }, [
579
+ q("option", Ve, x(e.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", e.def.label ?? e.def.field)), 1),
580
+ (f(!0), m(U, null, H(h, (C) => (f(), m("option", {
581
+ key: C.value,
582
+ value: C.value
583
+ }, x(C.label), 9, je))), 128))
584
+ ], 40, He))), 128)),
585
+ d.value ? (f(), m("small", {
586
+ key: 0,
587
+ id: `${e.id}-status`,
588
+ role: "status"
589
+ }, [
590
+ G(x(d.value), 1),
591
+ w(i).failed.value ? (f(), m("button", {
592
+ key: 0,
593
+ type: "button",
594
+ onClick: u[0] || (u[0] = //@ts-ignore
595
+ (...h) => w(i).request && w(i).request(...h))
596
+ }, x(e.messages.retry), 1)) : I("", !0)
597
+ ], 8, Ge)) : I("", !0)
598
+ ], 8, Ue));
599
+ }
600
+ }), Je = /* @__PURE__ */ ee(ze, [["__scopeId", "data-v-734dde49"]]), We = ["id", "value", "aria-labelledby", "aria-invalid", "aria-required", "aria-describedby", "aria-expanded", "aria-controls", "aria-activedescendant", "disabled", "placeholder"], Ke = ["aria-label", "disabled"], Xe = ["aria-label", "disabled"], Ye = ["id"], Qe = ["id", "aria-label", "aria-busy", "aria-multiselectable"], Ze = ["id", "aria-selected", "disabled", "onPointermove", "onClick"], _e = {
601
+ key: 0,
602
+ "aria-hidden": "true",
603
+ class: "mrp-option-check"
604
+ }, ea = { key: 0 }, aa = {
605
+ key: 0,
606
+ role: "status"
607
+ }, ta = /* @__PURE__ */ _({
608
+ __name: "ReportRemoteParamSelect",
609
+ props: {
610
+ def: {},
611
+ value: {},
612
+ values: {},
613
+ loadOptions: { type: Function },
614
+ messages: {},
615
+ disabled: { type: Boolean },
616
+ id: {},
617
+ invalid: { type: Boolean }
618
+ },
619
+ emits: ["change"],
620
+ setup(e, { emit: l }) {
621
+ const n = e, t = l, i = Re({ focusOnOpen: !1 }), { root: c, panel: g, opened: s } = i, d = fe({ def: () => n.def, values: () => n.values, loader: () => n.loadOptions, opened: () => s.value, disabled: () => n.disabled === !0 }), { query: R, options: y, loading: u, failed: h, waiting: b, missingLoader: C } = d, A = E(() => ({ ...ae, ...n.messages })), M = E(() => n.def.type === "multiSelect"), F = E(() => M.value ? Ce(n.value) ?? [] : [n.value]), r = E(() => n.def.optionsSource ? y.value : (n.def.options ?? []).filter((v) => `${v.label} ${v.value}`.toLocaleLowerCase().includes(R.value.toLocaleLowerCase())).slice(0, 100)), p = /* @__PURE__ */ new Map(), a = E(() => M.value ? F.value.map((v) => p.get(v) ?? n.def.options?.find((P) => P.value === v)?.label ?? v).join("、") : S.value || n.value), o = k(0), S = k(""), O = k(), N = E(() => `${n.id}-options`), L = E(() => b.value ? A.value.paramOptionsDependencies : n.def.optionsSource && C.value ? A.value.paramOptionsMissingLoader : h.value ? A.value.paramOptionsFailed : u.value ? A.value.paramOptionsLoading : r.value.length ? "" : A.value.paramOptionsEmpty);
622
+ D(() => n.value, () => {
623
+ S.value = "";
624
+ }), D(r, () => {
625
+ o.value = 0;
626
+ }), D(() => [n.def.field, n.def.optionsSource, JSON.stringify(n.def.options)], () => {
627
+ p.clear(), S.value = "";
628
+ }), D(s, (v) => {
629
+ v && V(() => O.value?.focus());
630
+ });
631
+ function te(v) {
632
+ if (!(n.disabled || b.value || u.value || h.value)) {
633
+ p.set(v.value, v.label);
634
+ for (const P of p.keys()) P !== v.value && !F.value.includes(P) && p.delete(P);
635
+ if (M.value) {
636
+ const P = F.value.includes(v.value) ? F.value.filter(($) => $ !== v.value) : [...F.value, v.value];
637
+ if (P.length > Math.min(n.def.maxItems ?? 100, 100)) return;
638
+ t("change", P.length ? Oe(P) : "");
639
+ } else
640
+ t("change", v.value), i.close();
641
+ V(() => {
642
+ S.value = v.label, O.value?.focus();
643
+ });
644
+ }
645
+ }
646
+ function le(v) {
647
+ v.isComposing || (s.value = !0, R.value = v.target.value);
648
+ }
649
+ function z() {
650
+ !n.disabled && !b.value && (!n.def.optionsSource || !C.value) && (R.value = "", s.value = !0);
651
+ }
652
+ function pe(v) {
653
+ if (!(v.isComposing || v.keyCode === 229)) {
654
+ if (v.key === "Escape") {
655
+ s.value && (v.preventDefault(), v.stopPropagation(), i.close());
656
+ return;
657
+ }
658
+ if (["ArrowUp", "ArrowDown", "Enter"].includes(v.key)) {
659
+ if (v.preventDefault(), v.stopPropagation(), !s.value) {
660
+ z();
661
+ return;
662
+ }
663
+ if (v.key === "Enter") {
664
+ const P = r.value[o.value];
665
+ P && te(P);
666
+ return;
667
+ }
668
+ 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" })));
669
+ }
670
+ }
671
+ }
672
+ function ve() {
673
+ n.disabled || (t("change", ""), S.value = "", i.close());
674
+ }
675
+ return (v, P) => (f(), m("div", {
676
+ ref_key: "root",
677
+ ref: c,
678
+ class: "mrp-remote-param"
679
+ }, [
680
+ q("div", {
681
+ class: Y(["mrp-remote-control", { "is-invalid": e.invalid }])
682
+ }, [
683
+ W(X, {
684
+ name: "search",
685
+ size: 14
686
+ }),
687
+ q("input", {
688
+ id: e.id,
689
+ ref_key: "input",
690
+ ref: O,
691
+ type: "text",
692
+ role: "combobox",
693
+ autocomplete: "off",
694
+ value: w(s) ? w(R) : a.value,
695
+ maxlength: 256,
696
+ "aria-labelledby": `${e.id}-label`,
697
+ "aria-invalid": e.invalid || void 0,
698
+ "aria-required": e.def.required || void 0,
699
+ "aria-describedby": e.invalid ? `${e.id}-error` : w(b) || e.def.optionsSource && w(C) ? `${e.id}-remote-status` : void 0,
700
+ "aria-autocomplete": "list",
701
+ "aria-expanded": w(s),
702
+ "aria-controls": w(s) ? N.value : void 0,
703
+ "aria-activedescendant": w(s) && r.value.length ? `${N.value}-${o.value}` : void 0,
704
+ disabled: e.disabled || w(b) || !!e.def.optionsSource && w(C),
705
+ placeholder: e.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", e.def.label ?? e.def.field),
706
+ onClick: z,
707
+ onInput: le,
708
+ onCompositionend: le,
709
+ onKeydown: pe
710
+ }, null, 40, We),
711
+ e.value ? (f(), m("button", {
712
+ key: 0,
713
+ type: "button",
714
+ "aria-label": A.value.paramOptionsClear,
715
+ disabled: e.disabled,
716
+ onClick: ve
717
+ }, [
718
+ W(X, {
719
+ name: "close",
720
+ size: 12
721
+ })
722
+ ], 8, Ke)) : (f(), m("button", {
723
+ key: 1,
724
+ type: "button",
725
+ "aria-label": e.def.label ?? e.def.field,
726
+ disabled: e.disabled || w(b) || !!e.def.optionsSource && w(C),
727
+ onClick: P[0] || (P[0] = ($) => w(s) ? w(i).close() : z())
728
+ }, [
729
+ W(X, {
730
+ name: "chevron-down",
731
+ size: 12
732
+ })
733
+ ], 8, Xe))
734
+ ], 2),
735
+ w(b) || e.def.optionsSource && w(C) ? (f(), m("small", {
736
+ key: 0,
737
+ id: `${e.id}-remote-status`,
738
+ role: "status"
739
+ }, x(L.value), 9, Ye)) : I("", !0),
740
+ w(s) ? (f(), m("div", {
741
+ key: 1,
742
+ ref_key: "panel",
743
+ ref: g,
744
+ class: "mrp-remote-options"
745
+ }, [
746
+ q("div", {
747
+ id: N.value,
748
+ role: "listbox",
749
+ "aria-label": e.def.label ?? e.def.field,
750
+ "aria-busy": w(u),
751
+ "aria-multiselectable": M.value || void 0
752
+ }, [
753
+ (f(!0), m(U, null, H(r.value, ($, J) => (f(), m("button", {
754
+ id: `${N.value}-${J}`,
755
+ key: $.value,
756
+ type: "button",
757
+ role: "option",
758
+ tabindex: "-1",
759
+ "aria-selected": F.value.includes($.value),
760
+ class: Y({ active: J === o.value }),
761
+ disabled: w(u),
762
+ onPointermove: (me) => o.value = J,
763
+ onMousedown: P[1] || (P[1] = he(() => {
764
+ }, ["prevent"])),
765
+ onClick: (me) => te($)
766
+ }, [
767
+ q("span", null, [
768
+ M.value ? (f(), m("span", _e, x(F.value.includes($.value) ? "✓" : ""), 1)) : I("", !0),
769
+ G(x($.label), 1)
770
+ ]),
771
+ $.label !== $.value ? (f(), m("small", ea, x($.value), 1)) : I("", !0)
772
+ ], 42, Ze))), 128))
773
+ ], 8, Qe),
774
+ L.value ? (f(), m("p", aa, [
775
+ G(x(L.value), 1),
776
+ w(h) ? (f(), m("button", {
777
+ key: 0,
778
+ type: "button",
779
+ onClick: P[2] || (P[2] = //@ts-ignore
780
+ (...$) => w(d).request && w(d).request(...$))
781
+ }, x(e.messages.retry), 1)) : I("", !0)
782
+ ])) : I("", !0)
783
+ ], 512)) : I("", !0)
784
+ ], 512));
785
+ }
786
+ }), la = /* @__PURE__ */ ee(ta, [["__scopeId", "data-v-6ad41cf4"]]), na = {
787
+ key: 0,
788
+ class: "mrp-params-title"
789
+ }, ra = { class: "mrp-params-grid" }, ia = ["id"], sa = {
790
+ key: 0,
791
+ class: "mrp-param-star",
792
+ "aria-hidden": "true"
793
+ }, oa = ["value", "disabled", "aria-labelledby", "aria-invalid", "aria-describedby", "aria-required", "onChange"], da = ["disabled", "hidden"], ua = ["value"], ca = ["aria-labelledby"], fa = ["type", "step", "value", "disabled", "min", "max", "aria-label", "aria-invalid", "aria-describedby", "aria-required", "onInput"], pa = ["type", "inputmode", "maxlength", "placeholder", "value", "disabled", "min", "max", "step", "aria-labelledby", "aria-invalid", "aria-describedby", "aria-required", "onInput"], va = ["id"], ma = {
794
+ key: 1,
795
+ class: "mrp-params-actions"
796
+ }, ga = ["disabled"], ba = ["disabled"], ya = /* @__PURE__ */ _({
797
+ __name: "ReportParamPanel",
798
+ props: {
799
+ defs: {},
800
+ modelValue: {},
801
+ messages: {},
802
+ attempted: { type: Boolean },
803
+ issues: { default: void 0 },
804
+ showActions: { type: Boolean, default: !0 },
805
+ showTitle: { type: Boolean, default: !0 },
806
+ disabled: { type: Boolean, default: !1 },
807
+ loadOptions: { type: Function, default: void 0 }
808
+ },
809
+ emits: ["update:modelValue", "query", "reset"],
810
+ setup(e, { expose: l, emit: n }) {
811
+ const t = e, i = n, c = k({ ...t.modelValue }), g = k(null), s = qe();
812
+ D(
813
+ () => t.modelValue,
814
+ (r) => {
815
+ c.value = { ...r };
816
+ }
817
+ );
818
+ const d = E(() => t.issues ?? oe(t.defs, c.value).issues), R = E(
819
+ () => (Array.isArray(t.defs) ? t.defs : []).filter((r) => r && typeof r.field == "string").map((r, p) => ({
820
+ def: r,
821
+ id: `${s}-${p}`,
822
+ label: r.label ?? r.field,
823
+ value: c.value[r.field] ?? "",
824
+ error: t.attempted ? d.value.find((a) => a.field === r.field) : void 0
825
+ }))
826
+ ), y = E(() => {
827
+ const r = /* @__PURE__ */ new Map();
828
+ for (const p of t.defs) for (const a of Array.isArray(p.dependsOn) ? p.dependsOn : []) {
829
+ const o = r.get(a) ?? [];
830
+ o.push(p.field), r.set(a, o);
831
+ }
832
+ return r;
833
+ });
834
+ function u(r, p) {
835
+ if (t.disabled || c.value[r] === p) return;
836
+ c.value = { ...c.value, [r]: p };
837
+ const a = /* @__PURE__ */ new Set([r]), o = [r];
838
+ for (let S = 0; S < o.length; S++) for (const O of y.value.get(o[S]) ?? [])
839
+ a.has(O) || (c.value[O] = "", a.add(O), o.push(O));
840
+ i("update:modelValue", { ...c.value });
841
+ }
842
+ function h(r) {
843
+ return r.type === "number" ? "number" : r.type === "date" || r.type === "month" ? r.type : "text";
844
+ }
845
+ function b(r, p, a = !1) {
846
+ if (!a) return r.split("/")[p] ?? "";
847
+ try {
848
+ const o = JSON.parse(r);
849
+ return Array.isArray(o) && (typeof o[p] == "number" || typeof o[p] == "string") ? String(o[p]) : "";
850
+ } catch {
851
+ return "";
852
+ }
853
+ }
854
+ function C(r, p, a) {
855
+ return a ? !!b(r, 0) != !!b(r, 1) ? !b(r, p) || void 0 : !0 : void 0;
856
+ }
857
+ function A(r, p, a) {
858
+ const o = r.type === "numberRange", S = c.value[r.field] ?? "", O = [b(S, 0, o), b(S, 1, o)];
859
+ O[p] = a;
860
+ const N = o ? JSON.stringify(O.map((L) => L === "" ? null : Number(L))) : O.join("/");
861
+ u(r.field, O.every((L) => !L) ? "" : N);
862
+ }
863
+ function M(r) {
864
+ r.isComposing || i("query");
865
+ }
866
+ function F() {
867
+ g.value?.querySelector('[aria-invalid="true"]')?.focus();
868
+ }
869
+ return l({ focusInvalid: F }), (r, p) => (f(), m("div", {
870
+ ref_key: "root",
871
+ ref: g,
872
+ class: "mrp-params"
873
+ }, [
874
+ e.showTitle !== !1 ? (f(), m("span", na, x(e.messages.paramsTitle), 1)) : I("", !0),
875
+ q("div", ra, [
876
+ (f(!0), m(U, null, H(R.value, (a) => (f(), m("label", {
877
+ key: a.id,
878
+ class: Y(["mrp-param", { "mrp-param-missing": !!a.error }])
879
+ }, [
880
+ q("span", {
881
+ id: `${a.id}-label`,
882
+ class: "mrp-param-label"
883
+ }, [
884
+ G(x(a.label), 1),
885
+ a.def.required ? (f(), m("i", sa, "*")) : I("", !0)
886
+ ], 8, ia),
887
+ a.def.type === "cascader" ? (f(), ne(Je, {
888
+ key: 0,
889
+ id: a.id,
890
+ def: a.def,
891
+ value: a.value,
892
+ values: c.value,
893
+ "load-options": e.loadOptions,
894
+ messages: e.messages,
895
+ disabled: e.disabled,
896
+ invalid: !!a.error,
897
+ onChange: (o) => u(a.def.field, o)
898
+ }, null, 8, ["id", "def", "value", "values", "load-options", "messages", "disabled", "invalid", "onChange"])) : a.def.optionsSource || a.def.type === "multiSelect" ? (f(), ne(la, {
899
+ key: 1,
900
+ id: a.id,
901
+ def: a.def,
902
+ value: a.value,
903
+ values: c.value,
904
+ "load-options": e.loadOptions,
905
+ messages: e.messages,
906
+ disabled: e.disabled,
907
+ invalid: !!a.error,
908
+ onChange: (o) => u(a.def.field, o)
909
+ }, null, 8, ["id", "def", "value", "values", "load-options", "messages", "disabled", "invalid", "onChange"])) : (a.def.type ?? "text") === "select" ? (f(), m("select", {
910
+ key: 2,
911
+ class: "mrp-param-input",
912
+ value: a.value,
913
+ disabled: e.disabled,
914
+ "aria-labelledby": `${a.id}-label`,
915
+ "aria-invalid": a.error ? !0 : void 0,
916
+ "aria-describedby": a.error ? `${a.id}-error` : void 0,
917
+ "aria-required": a.def.required || void 0,
918
+ onChange: (o) => u(a.def.field, o.target.value),
919
+ onKeydown: K(M, ["enter"])
920
+ }, [
921
+ q("option", {
922
+ value: "",
923
+ disabled: a.def.required,
924
+ hidden: a.def.required
925
+ }, x(a.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", a.label)), 9, da),
926
+ (f(!0), m(U, null, H(a.def.options ?? [], (o) => (f(), m("option", {
927
+ key: o.value,
928
+ value: o.value
929
+ }, x(o.label), 9, ua))), 128))
930
+ ], 40, oa)) : a.def.type === "dateRange" || a.def.type === "numberRange" ? (f(), m("div", {
931
+ key: 3,
932
+ class: "mrp-param-range",
933
+ role: "group",
934
+ "aria-labelledby": `${a.id}-label`
935
+ }, [
936
+ (f(!0), m(U, null, H(a.def.type === "numberRange" ? [e.messages.paramNumberRangeStart ?? "最小值", e.messages.paramNumberRangeEnd ?? "最大值"] : [e.messages.paramRangeStart ?? "开始日期", e.messages.paramRangeEnd ?? "结束日期"], (o, S) => (f(), m("input", {
937
+ key: S,
938
+ class: "mrp-param-input",
939
+ type: a.def.type === "numberRange" ? "number" : "date",
940
+ step: a.def.type === "numberRange" ? "any" : void 0,
941
+ value: b(a.value, S, a.def.type === "numberRange"),
942
+ disabled: e.disabled,
943
+ min: a.def.min,
944
+ max: a.def.max,
945
+ "aria-label": `${a.label} · ${o}`,
946
+ "aria-invalid": a.def.type === "numberRange" ? !!a.error || void 0 : C(a.value, S, a.error),
947
+ "aria-describedby": a.error ? `${a.id}-error` : void 0,
948
+ "aria-required": a.def.required || void 0,
949
+ onInput: (O) => A(a.def, S, O.target.value),
950
+ onKeydown: K(M, ["enter"])
951
+ }, null, 40, fa))), 128))
952
+ ], 8, ca)) : (f(), m("input", {
953
+ key: 4,
954
+ class: "mrp-param-input",
955
+ type: h(a.def),
956
+ inputmode: a.def.type === "year" ? "numeric" : void 0,
957
+ maxlength: a.def.type === "year" ? 4 : void 0,
958
+ placeholder: a.def.placeholder ?? (e.messages.paramTextPlaceholder ?? "请输入{label}").replace("{label}", a.label),
959
+ value: a.value,
960
+ disabled: e.disabled,
961
+ min: a.def.min,
962
+ max: a.def.max,
963
+ step: a.def.type === "number" ? "any" : void 0,
964
+ "aria-labelledby": `${a.id}-label`,
965
+ "aria-invalid": a.error ? !0 : void 0,
966
+ "aria-describedby": a.error ? `${a.id}-error` : void 0,
967
+ "aria-required": a.def.required || void 0,
968
+ onInput: (o) => u(a.def.field, o.target.value),
969
+ onKeydown: K(M, ["enter"])
970
+ }, null, 40, pa)),
971
+ a.error ? (f(), m("small", {
972
+ key: 5,
973
+ id: `${a.id}-error`,
974
+ class: "mrp-param-error",
975
+ role: "status"
976
+ }, x(w(ce)(a.error, e.defs, e.messages)), 9, va)) : I("", !0)
977
+ ], 2))), 128))
978
+ ]),
979
+ e.showActions !== !1 ? (f(), m("div", ma, [
980
+ q("button", {
981
+ class: "mrp-nav mrp-param-query",
982
+ type: "button",
983
+ disabled: e.disabled,
984
+ onClick: p[0] || (p[0] = (a) => r.$emit("query"))
985
+ }, x(e.messages.query), 9, ga),
986
+ q("button", {
987
+ class: "mrp-nav",
988
+ type: "button",
989
+ disabled: e.disabled,
990
+ onClick: p[1] || (p[1] = (a) => r.$emit("reset"))
991
+ }, x(e.messages.reset), 9, ba)
992
+ ])) : I("", !0)
993
+ ], 512));
994
+ }
995
+ }), Ta = /* @__PURE__ */ ee(ya, [["__scopeId", "data-v-e74206d7"]]);
996
+ export {
997
+ ue as D,
998
+ B as M,
999
+ ae as P,
1000
+ Ta as R,
1001
+ ka as S,
1002
+ de as a,
1003
+ ke as b,
1004
+ Ae as c,
1005
+ Me as d,
1006
+ $e as e,
1007
+ Ra as f,
1008
+ Fa as g,
1009
+ Ma as h,
1010
+ xa as i,
1011
+ Da as j,
1012
+ Re as k,
1013
+ La as l,
1014
+ qa as n,
1015
+ Ca as p,
1016
+ Aa as r,
1017
+ Oa as s,
1018
+ $a as t,
1019
+ Ia as u
1020
+ };