@agile-team/mach-report 2.23.1 → 2.25.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 +10 -4
- package/dist/{ExcelBindingWizard-BrTmdo7f.cjs → ExcelBindingWizard-BgJG-T6k.cjs} +1 -1
- package/dist/{ExcelBindingWizard-CcDMLO8Q.js → ExcelBindingWizard-NQ_v396s.js} +3 -3
- package/dist/ParamEditor-DEP38mBp.cjs +1 -0
- package/dist/ParamEditor-Z-3yodp5.js +750 -0
- package/dist/{ReportBatchPanel-CHxBtG9R.cjs → ReportBatchPanel-D33LjMrA.cjs} +1 -1
- package/dist/{ReportBatchPanel-CJB67WNd.js → ReportBatchPanel-DG8FV-5X.js} +2 -2
- package/dist/{ReportLabelStudio-Tplc1TLJ.js → ReportLabelStudio-BZp23_hA.js} +68 -68
- package/dist/ReportLabelStudio-Bz-xAayk.cjs +1 -0
- package/dist/ReportParamPanel-B27IGJjk.cjs +1 -0
- package/dist/{ReportParamPanel-GI43aGa0.js → ReportParamPanel-DGXzBzl2.js} +328 -298
- package/dist/ReportPreview-CilFAS9U.js +7170 -0
- package/dist/ReportPreview-dOOzPts2.cjs +6 -0
- package/dist/{ReportTemplateLibrary-KqX4E2sN.js → ReportTemplateLibrary-DpSGgvFa.js} +28 -28
- package/dist/{ReportTemplateLibrary-BFQIX0sg.cjs → ReportTemplateLibrary-uG1gENaW.cjs} +1 -1
- package/dist/{RuleEditor-OPX1awrH.js → RuleEditor-BONALh1Q.js} +846 -835
- package/dist/RuleEditor-bLXiRcxL.cjs +1 -0
- package/dist/{TemplateOutlinePanel-CVYKVLv_.cjs → TemplateOutlinePanel-C3nfHuaR.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-DQS-eOs6.js → TemplateOutlinePanel-JGBKeF3e.js} +10 -10
- package/dist/{TemplateReusePanel-CY6O93Zk.cjs → TemplateReusePanel-BKhgp6kg.cjs} +1 -1
- package/dist/{TemplateReusePanel-DKXiFTyB.js → TemplateReusePanel-DXQUO6nQ.js} +2 -2
- package/dist/TemplateReviewPanel-5RWFUUEf.cjs +1 -0
- package/dist/TemplateReviewPanel-DhL7Hapy.js +602 -0
- package/dist/analytics.d.cts +1 -1
- package/dist/analytics.d.ts +1 -1
- package/dist/artifact-integrity.json +98 -98
- package/dist/assets-BYdpkTIt.cjs +1 -0
- package/dist/assets-C4MIvzQ4.js +137 -0
- package/dist/auto-D-eDZa_V.cjs +1 -0
- package/dist/{auto-BB99S802.js → auto-umW_ozwr.js} +10 -10
- package/dist/capabilities-CN_kSVjO.js +121 -0
- package/dist/capabilities-D4nfhcvB.cjs +1 -0
- package/dist/cell-style-B6Qffrx8.js +37 -0
- package/dist/cell-style-y_uh1pZp.cjs +1 -0
- package/dist/{data-bar-IkI6VvMQ.js → data-bar-Bfh54sT4.js} +1 -1
- package/dist/data-bar-DzceAVeR.cjs +1 -0
- package/dist/designer-CCyj5WYS.js +7595 -0
- package/dist/designer-Cj7fn4Hh.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +143 -10
- package/dist/designer.d.ts +143 -10
- package/dist/designer.js +5 -5
- package/dist/diagnostic-collector-gB07PHy2.js +392 -0
- package/dist/diagnostic-collector-wASg6Fzs.cjs +1 -0
- package/dist/dom-CXWMmwh-.cjs +1 -0
- package/dist/{dom-JWrchIre.js → dom-DxdCMLzs.js} +185 -185
- package/dist/{encoding-CEd-dq9A.js → encoding-CEkBtlUP.js} +2 -2
- package/dist/{encoding-7lquyj0w.cjs → encoding-Cipno7dq.cjs} +1 -1
- package/dist/{font-loader-CNWXomuV.js → font-loader-D4NLIKJL.js} +1 -1
- package/dist/{font-loader-D8pI87fL.cjs → font-loader-p_SyTvqt.cjs} +1 -1
- package/dist/{grid-strokes-EoY66L2f.js → grid-strokes-DkZEZvcI.js} +1 -1
- package/dist/grid-strokes-RFMR91jn.cjs +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +48 -9
- package/dist/index.d.ts +48 -9
- package/dist/index.js +137 -136
- package/dist/json-snapshot-DQdkA_At.cjs +2 -0
- package/dist/{json-snapshot-BRnzKudk.js → json-snapshot-x0JpllWL.js} +919 -791
- package/dist/{pdf-DpMkW72B.cjs → pdf-C060D5UY.cjs} +31 -31
- package/dist/{pdf-CJToa81Z.js → pdf-DU8HelKd.js} +2499 -2492
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.d.cts +18 -0
- package/dist/pdf.d.ts +18 -0
- package/dist/pdf.js +2 -2
- package/dist/{plugin-BWTp-X7b.cjs → plugin-B_k23hut.cjs} +1 -1
- package/dist/{plugin-_BkUVc2z.js → plugin-CttO46hc.js} +1 -1
- package/dist/{prefill-CWGdnqQd.js → prefill-BkF9Fw_p.js} +13 -13
- package/dist/prefill-BvkuwooY.cjs +1 -0
- package/dist/prepared-CSywIEAZ.cjs +1 -0
- package/dist/prepared-Cyuh61fJ.js +128 -0
- package/dist/protocol-BwbJNVZl.cjs +1 -0
- package/dist/protocol-DwtxjXzO.js +96 -0
- package/dist/record-bindings-B7djSjNs.cjs +1 -0
- package/dist/{record-bindings-DatJZv_e.js → record-bindings-Cv7lFiof.js} +47 -47
- package/dist/{region-binding-workflow-l7NGfagJ.cjs → region-binding-workflow-COD8nISZ.cjs} +1 -1
- package/dist/{region-binding-workflow-DjrXuR1q.js → region-binding-workflow-D8I4QWRh.js} +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 → rich-text-layout-Ch_N0Ubu.js} +1 -1
- package/dist/rich-text-layout-yJGuThtC.cjs +3 -0
- package/dist/runtime-BE30icyB.js +227 -0
- package/dist/runtime-DRSuy_SQ.cjs +1 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server/node.d.cts +55 -7
- package/dist/server/node.d.ts +55 -7
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +2742 -2417
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +51 -16
- package/dist/server.d.ts +51 -16
- package/dist/server.js +8 -8
- package/dist/style.css +1 -1
- package/dist/{template-catalog-DtrtT1FY.cjs → template-catalog-C0riwrx7.cjs} +1 -1
- package/dist/{template-catalog-CRuZL3pi.js → template-catalog-D_gl93va.js} +3 -3
- package/dist/template-fragments-CgzPdFKB.cjs +1 -0
- package/dist/{template-fragments-CPpGpQoz.js → template-fragments-D94ZZmPc.js} +2 -2
- package/dist/template-registry-BMScUmM4.cjs +1 -0
- package/dist/{template-registry-O0hNIOfB.js → template-registry-DZOtRY7t.js} +19 -19
- package/dist/{textwrap-D4ZksyMK.js → textwrap-BywMBMXM.js} +1 -1
- package/dist/textwrap-LhJkHWb1.cjs +4 -0
- package/dist/vue/async.d.cts +101 -22
- package/dist/vue/async.d.ts +101 -22
- package/dist/vue/index.d.cts +133 -34
- package/dist/vue/index.d.ts +133 -34
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +192 -162
- package/dist/{workbook-session-C6-SrnCT.cjs → workbook-session-DR2j6Hxm.cjs} +3 -3
- package/dist/{workbook-session-C9ZmCBwY.js → workbook-session-SzfILBJJ.js} +106 -107
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +55 -7
- package/dist/worker.d.ts +55 -7
- package/dist/worker.js +4 -4
- package/dist/xlsx/node.d.cts +30 -1
- package/dist/xlsx/node.d.ts +30 -1
- package/dist/xlsx-node.cjs +42 -42
- package/dist/xlsx-node.js +3908 -3889
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.d.cts +20 -3
- package/dist/xlsx.d.ts +20 -3
- package/dist/xlsx.js +302 -295
- package/package.json +1 -1
- package/dist/ParamEditor-BGjovFUe.js +0 -737
- package/dist/ParamEditor-CeNp4_zQ.cjs +0 -1
- package/dist/ReportLabelStudio-g8PkqJWn.cjs +0 -1
- package/dist/ReportParamPanel-C7fZTllk.cjs +0 -1
- package/dist/ReportPreview-BoGBGyRr.cjs +0 -6
- package/dist/ReportPreview-QLONCyci.js +0 -6257
- package/dist/RuleEditor-BZUP9yvL.cjs +0 -1
- package/dist/TemplateReviewPanel-DbeNC8Ms.cjs +0 -1
- package/dist/TemplateReviewPanel-Dijwm9YE.js +0 -593
- package/dist/assets-D2gHc4Mz.cjs +0 -1
- package/dist/assets-T_gDeFaz.js +0 -132
- package/dist/auto-BrPWo7Xm.cjs +0 -1
- package/dist/capabilities-DiBj4Qgl.cjs +0 -1
- package/dist/capabilities-pg7j7VLT.js +0 -106
- package/dist/data-bar-CeZuFmYl.cjs +0 -1
- package/dist/designer-BZoVWTgl.js +0 -7172
- package/dist/designer-zS2uKJmY.cjs +0 -2
- package/dist/dom-ChE5D-L-.cjs +0 -1
- package/dist/grid-strokes-Be24LGuV.cjs +0 -1
- package/dist/json-snapshot-DNiIbpOr.cjs +0 -2
- package/dist/prefill-PaAy6wLk.cjs +0 -1
- package/dist/prepared-CJy_qk7d.js +0 -94
- package/dist/prepared-D0yCSxSO.cjs +0 -1
- package/dist/progress-BXzlVbIp.js +0 -29
- package/dist/progress-ByiOxUD3.js +0 -250
- package/dist/progress-DJBd9Rb9.cjs +0 -1
- package/dist/progress-WomPRP3B.cjs +0 -1
- package/dist/protocol-BG16rz6D.js +0 -90
- package/dist/protocol-wzhl1Fim.cjs +0 -1
- package/dist/record-bindings-MBxbeBsi.cjs +0 -1
- package/dist/rich-text-layout-DK7A_a5r.cjs +0 -3
- package/dist/runtime-DYMOS_gz.cjs +0 -1
- package/dist/runtime-PiCax9zQ.js +0 -171
- package/dist/template-fragments-GVjpew_q.cjs +0 -1
- package/dist/template-registry-DI59PXVK.cjs +0 -1
- package/dist/textwrap-DEHqAjKZ.cjs +0 -4
package/dist/vue-async.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { m as o } from "./plugin-
|
|
2
|
-
import { M as l } from "./plugin-
|
|
1
|
+
import { m as o } from "./plugin-CttO46hc.js";
|
|
2
|
+
import { M as l } from "./plugin-CttO46hc.js";
|
|
3
3
|
function a() {
|
|
4
|
-
return import("./ReportPreview-
|
|
4
|
+
return import("./ReportPreview-CilFAS9U.js").then((t) => t.x);
|
|
5
5
|
}
|
|
6
6
|
const n = {
|
|
7
7
|
install(t, r = {}) {
|
package/dist/vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("@agile-team/mach-report"),o=require("./ReportPreview-BoGBGyRr.cjs"),i=require("./ReportParamPanel-C7fZTllk.cjs"),f=require("./injection-keys-Db_DyLkm.cjs"),A=require("./plugin-BWTp-X7b.cjs"),h=require("vue"),v=require("./json-snapshot-DNiIbpOr.cjs"),w=require("./progress-WomPRP3B.cjs");function C(r){const e=E.createReportSource(r),a=async t=>{if(t.reportIds.length===0)throw new o.PlanLoadError("缺少报表 ID");for(const n of t.reportIds)if(!Object.prototype.hasOwnProperty.call(r,n)||!r[n])throw new o.PlanLoadError(`本地模板 ${n} 不存在`);return e(t)};return a.getParamDefs=e.getParamDefs,a}const I=Object.freeze({loading:!1,hasPlan:!1,pageCount:0,currentPage:1,exporting:null,printing:!1,canExport:!1,canPrint:!1,error:null,pdfFont:Object.freeze({status:"unchecked",fontUrl:""})});function D(){const r=h.shallowRef(null),e=()=>r.value?.state??I,a=Object.freeze({get loading(){return e().loading},get stale(){return e().stale??!1},get hasPlan(){return e().hasPlan},get pageCount(){return e().pageCount},get currentPage(){return e().currentPage},get exporting(){return e().exporting},get printing(){return e().printing},get canExport(){return e().canExport},get canPrint(){return e().canPrint},get error(){return e().error},get pdfFont(){return e().pdfFont},get editing(){return e().editing??!1},get saving(){return e().saving??!1},get importing(){return e().importing??!1},get dirty(){return e().dirty??!1},get pendingLocalChanges(){return e().pendingLocalChanges??!1},get task(){return e().task??null},get diagnostics(){return e().diagnostics??[]},get reportIds(){return e().reportIds??[]},get params(){return e().params??{}},get canUndo(){return e().canUndo??!1},get canRedo(){return e().canRedo??!1},get changeCount(){return e().changeCount??0},get selection(){return e().selection??null}});function t(){if(!r.value)throw new i.MachReportError("config","报表预览尚未挂载,请在 ready 后调用控制器");return r.value}return{ref(n){const s=n;r.value=s&&typeof s.reload=="function"&&typeof s.print=="function"&&typeof s.exportAs=="function"&&typeof s.openPdfWindow=="function"&&typeof s.gotoPage=="function"&&typeof s.setParams=="function"?s:null},ready:h.computed(()=>r.value!==null),state:a,async checkPdfFont(){const n=t();return n.checkPdfFont?n.checkPdfFont():{status:"unverified",fontUrl:"",message:"旧自定义控制器未提供字体检查,请由宿主确认字体配置"}},cancelTask(){t().cancelTask?.()},async confirmDiscard(n){return await t().confirmDiscard?.(n)??!0},getOutputDiagnostics(n){return t().getOutputDiagnostics?.(n)??[]},async reload(){await t().reload()},async print(){await t().print()},async exportAs(n){await t().exportAs(n)},openPdfWindow(){t().openPdfWindow()},gotoPage(n){t().gotoPage(n)},async setParams(n,s){await t().setParams(n,s)},async importExcel(n,s){const g=t();if(!g.importExcel)throw new i.MachReportError("config","旧自定义控制器未提供 Excel 导入");return g.importExcel(n,s)},getPlan(){return t().getPlan?.()??null},getChanges(){return t().getChanges?.()??[]},getDifferences:()=>t().getDifferences?.()??[],undo:async()=>await t().undo?.()??!1,redo:async()=>await t().redo?.()??!1,restoreChanges:async()=>await t().restoreChanges?.()??!1,getSelection:()=>t().getSelection?.()??null,focusCell:async(n,s)=>await t().focusCell?.(n,s)??!1,focusField:async n=>await t().focusField?.(n)??!1,copySelection:()=>t().copySelection?.()??"",pasteSelection:async n=>await t().pasteSelection?.(n)??!1}}function L(){return h.inject(f.MACH_REPORT_CONTROLLER_KEY,null)}function T(r){return!!r&&typeof r=="object"&&!Array.isArray(r)}function x(r){return Array.isArray(r)&&r.every(e=>T(e)&&typeof e.code=="string"&&typeof e.message=="string"&&["info","warning","error"].includes(e.severity)&&(e.path===void 0||typeof e.path=="string")&&v.hasValidDataExplanation(e))}function F(r,e){return Array.isArray(r)&&r.every(a=>T(a)&&Number.isSafeInteger(a.editIndex)&&a.editIndex>=0&&a.editIndex<e&&typeof a.code=="string"&&typeof a.message=="string")}function b(r,e){let a;if(!T(r)||typeof r.revision!="string"||!r.revision.trim()?a="非空 revision(请先在适配器解包业务响应)":r.sourceToken!==void 0&&typeof r.sourceToken!="string"?a="字符串 sourceToken":r.diagnostics!==void 0&&!x(r.diagnostics)?a="结构化 diagnostics":r.conflicts!==void 0&&!F(r.conflicts,e)&&(a="有效 editIndex/code/message conflicts"),a)throw new i.MachReportError("edit",`ReportProvider.save 必须返回${a};服务器可能已提交,请重新查询确认后再编辑`)}function m(r){return typeof r=="function"?r():r}function q(r,e){const a=new Set(r.flatMap(t=>t.source?.[e]===void 0?[]:[String(t.source[e])]));return a.size===1?[...a][0]:void 0}function O(r,e,a,t){return typeof r=="function"?r():q(e,a)??t??r}function k(r){return r.requestId??globalThis.crypto?.randomUUID?.()??`mr-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function U(r,e){if(!r.save)throw new i.MachReportError("config","ReportProvider.save 未配置,无法启用业务保存");let a="",t,n,s=0;function g(c,l,p){c.conflicts?.length||l!==a||p!==s||(t=c.revision,n=c.sourceToken)}async function S(c,l){if(l.signal.aborted)throw l.signal.reason??new DOMException("Aborted","AbortError");const p=m(e.reportId),_={...m(e.params??{})},R=JSON.stringify([p,_]),M=++s;if(R!==a&&(a=R,t=void 0,n=void 0),e.requireSource!==!1&&c.edits.some(u=>!u.source))throw new E.ReportCellEditError("missing");const d=await r.save({reportId:p,params:_,signal:l.signal,requestId:c.requestId,action:l.action,edits:o.cloneReportSnapshot(c.edits),expectedRevision:O(e.expectedRevision,c.edits,"revision",t),sourceToken:O(e.sourceToken,c.edits,"sourceToken",n)});if(l.signal.aborted)throw l.signal.reason??new DOMException("Aborted","AbortError");b(d,c.edits.length),d.diagnostics?.forEach(u=>w.observeOutput(()=>e.onDiagnostic?.(u)));const P=d.diagnostics?.filter(u=>u.severity==="error");if(P?.length)throw new i.MachReportError("edit",P.map(u=>u.message).join(";"),{diagnostics:P});const y=d.conflicts?.map(u=>({source:c.edits[u.editIndex]?.source,address:c.edits[u.editIndex]?.address,message:u.message}));return g(d,R,M),{revision:d.revision,sourceToken:d.sourceToken,conflicts:y}}return{requireSource:e.requireSource??!0,canEdit:e.canEdit,readOnlyReason:e.readOnlyReason,history:e.history,fields:e.fields,validate:e.validate,validation:e.validation,validateBatch:e.validateBatch,saveBatch:S,save:(c,l)=>S({requestId:k(l),edits:[o.cloneReportSnapshot(c)]},l)}}exports.PlanLoadError=o.PlanLoadError;exports.REPORT_EXPORT_FORMATS=o.REPORT_EXPORT_FORMATS;exports.REPORT_PREVIEW_TOOLS=o.REPORT_PREVIEW_TOOLS;exports.ReportDataComparisonPanel=o._sfc_main;exports.ReportExportMenu=o.ReportExportMenu;exports.ReportPagination=o.ReportPagination;exports.ReportPrefillPanel=o._sfc_main$1;exports.ReportPreview=o.ReportPreview;exports.ReportPrintResourceError=o.ReportPrintResourceError;exports.ReportTaskStatus=o.ReportTaskStatus;exports.ReportToolbar=o.ReportToolbar;exports.ReportValidationPanel=o.ReportValidationPanel;exports.buildPrintDocument=o.buildPrintDocument;exports.buildWordHtml=o.buildWordHtml;exports.createDefaultPdfExporter=o.createDefaultPdfExporter;exports.createFetchRequest=o.createFetchRequest;exports.createPrintCalibrationPlan=o.createPrintCalibrationPlan;exports.createReportStoragePreferences=o.createReportStoragePreferences;exports.joinReportIds=o.joinReportIds;exports.normalizeReportIds=o.normalizeReportIds;exports.preparePrintResources=o.preparePrintResources;exports.printPlans=o.printPlans;exports.usePageWindow=o.usePageWindow;exports.usePrintExport=o.usePrintExport;exports.useZoom=o.useZoom;exports.DEFAULT_CALCULATION_MESSAGES=i.DEFAULT_CALCULATION_MESSAGES;exports.DEFAULT_DATA_REVIEW_MESSAGES=i.DEFAULT_DATA_REVIEW_MESSAGES;exports.DEFAULT_MESSAGES=i.DEFAULT_MESSAGES;exports.DEFAULT_PRINT_MESSAGES=i.DEFAULT_PRINT_MESSAGES;exports.DEFAULT_THEME=i.DEFAULT_THEME;exports.MachReportError=i.MachReportError;exports.PARAM_OPTIONS_MESSAGES=i.PARAM_OPTIONS_MESSAGES;exports.ReportParamPanel=i.ReportParamPanel;exports.SILENT_LOGGER=i.SILENT_LOGGER;exports.defineMachReportConfig=i.defineMachReportConfig;exports.defineMachReportPreset=i.defineMachReportPreset;exports.normalizeReportLoadError=i.normalizeReportLoadError;exports.printCalibration=i.printCalibration;exports.provideMachReportConfig=i.provideMachReportConfig;exports.resolveCalculationMessages=i.resolveCalculationMessages;exports.resolveConfig=i.resolveConfig;exports.resolveDataReviewMessages=i.resolveDataReviewMessages;exports.snapshotPrintOptions=i.snapshotPrintOptions;exports.themeToCssVars=i.themeToCssVars;exports.toErrorDetail=i.toErrorDetail;exports.useMachReportConfig=i.useMachReportConfig;exports.MACH_REPORT_CONFIG_KEY=f.MACH_REPORT_CONFIG_KEY;exports.MACH_REPORT_CONTROLLER_KEY=f.MACH_REPORT_CONTROLLER_KEY;exports.MACH_REPORT_FETCHER_KEY=f.MACH_REPORT_FETCHER_KEY;exports.MACH_REPORT_PDF_EXPORTER_KEY=f.MACH_REPORT_PDF_EXPORTER_KEY;exports.MachReportPreview=A.MachReportPreview;exports.machReportPlugin=A.machReportPlugin;exports.createLocalFetcher=C;exports.createProviderEditing=U;exports.useMachReport=D;exports.useReportPreview=L;Object.keys(E).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(exports,r)&&Object.defineProperty(exports,r,{enumerable:!0,get:()=>E[r]})});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@agile-team/mach-report"),i=require("./ReportPreview-dOOzPts2.cjs"),a=require("./ReportParamPanel-B27IGJjk.cjs"),E=require("./injection-keys-Db_DyLkm.cjs"),M=require("./plugin-B_k23hut.cjs"),m=require("vue"),D=require("./json-snapshot-DQdkA_At.cjs"),L=require("./diagnostic-collector-wASg6Fzs.cjs");function F(e){const r=g.createReportSource(e),n=async t=>{if(t.reportIds.length===0)throw new i.PlanLoadError("缺少报表 ID");for(const o of t.reportIds)if(!Object.prototype.hasOwnProperty.call(e,o)||!e[o])throw new i.PlanLoadError(`本地模板 ${o} 不存在`);return r(t)};return n.getParamDefs=r.getParamDefs,n}const x=Object.freeze({loading:!1,hasPlan:!1,pageCount:0,currentPage:1,exporting:null,printing:!1,canExport:!1,canPrint:!1,error:null,pdfFont:Object.freeze({status:"unchecked",fontUrl:""})});function b(){const e=m.shallowRef(null),r=()=>e.value?.state??x,n=Object.freeze({get loading(){return r().loading},get stale(){return r().stale??!1},get hasPlan(){return r().hasPlan},get pageCount(){return r().pageCount},get currentPage(){return r().currentPage},get exporting(){return r().exporting},get printing(){return r().printing},get canExport(){return r().canExport},get canPrint(){return r().canPrint},get error(){return r().error},get pdfFont(){return r().pdfFont},get editing(){return r().editing??!1},get saving(){return r().saving??!1},get importing(){return r().importing??!1},get dirty(){return r().dirty??!1},get pendingLocalChanges(){return r().pendingLocalChanges??!1},get task(){return r().task??null},get diagnostics(){return r().diagnostics??[]},get reportIds(){return r().reportIds??[]},get params(){return r().params??{}},get canUndo(){return r().canUndo??!1},get canRedo(){return r().canRedo??!1},get changeCount(){return r().changeCount??0},get selection(){return r().selection??null}});function t(){if(!e.value)throw new a.MachReportError("config","报表预览尚未挂载,请在 ready 后调用控制器");return e.value}return{ref(o){const s=o;e.value=s&&typeof s.reload=="function"&&typeof s.print=="function"&&typeof s.exportAs=="function"&&typeof s.openPdfWindow=="function"&&typeof s.gotoPage=="function"&&typeof s.setParams=="function"?s:null},ready:m.computed(()=>e.value!==null),state:n,async checkPdfFont(){const o=t();return o.checkPdfFont?o.checkPdfFont():{status:"unverified",fontUrl:"",message:"旧自定义控制器未提供字体检查,请由宿主确认字体配置"}},cancelTask(){t().cancelTask?.()},async confirmDiscard(o){return await t().confirmDiscard?.(o)??!0},getOutputDiagnostics(o){return t().getOutputDiagnostics?.(o)??[]},async reload(){await t().reload()},async print(){await t().print()},async exportAs(o){await t().exportAs(o)},openPdfWindow(){t().openPdfWindow()},gotoPage(o){t().gotoPage(o)},async setParams(o,s){await t().setParams(o,s)},async importExcel(o,s){const f=t();if(!f.importExcel)throw new a.MachReportError("config","旧自定义控制器未提供 Excel 导入");return f.importExcel(o,s)},getPlan(){return t().getPlan?.()??null},getChanges(){return t().getChanges?.()??[]},getDifferences:()=>t().getDifferences?.()??[],undo:async()=>await t().undo?.()??!1,redo:async()=>await t().redo?.()??!1,restoreChanges:async()=>await t().restoreChanges?.()??!1,getSelection:()=>t().getSelection?.()??null,focusCell:async(o,s)=>await t().focusCell?.(o,s)??!1,focusField:async o=>await t().focusField?.(o)??!1,copySelection:()=>t().copySelection?.()??"",pasteSelection:async o=>await t().pasteSelection?.(o)??!1}}function q(){return m.inject(E.MACH_REPORT_CONTROLLER_KEY,null)}function T(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function N(e){return Array.isArray(e)&&e.every(r=>T(r)&&typeof r.code=="string"&&typeof r.message=="string"&&["info","warning","error"].includes(r.severity)&&(r.path===void 0||typeof r.path=="string")&&D.hasValidDataExplanation(r))}function A(e){return typeof e=="number"&&Number.isFinite(e)&&(!Number.isInteger(e)||Number.isSafeInteger(e))}function k(e){return e==null||typeof e=="string"||typeof e=="boolean"||A(e)}function U(e){return e===void 0||typeof e=="string"&&!!e.trim()||A(e)}function G(e,r){return Array.isArray(e)&&e.every(n=>T(n)&&Number.isSafeInteger(n.editIndex)&&n.editIndex>=0&&n.editIndex<r&&typeof n.code=="string"&&typeof n.message=="string"&&k(n.currentValue)&&U(n.revision))}function j(e,r){let n;if(!T(e)||typeof e.revision!="string"||!e.revision.trim()?n="非空 revision(请先在适配器解包业务响应)":e.sourceToken!==void 0&&typeof e.sourceToken!="string"?n="字符串 sourceToken":e.diagnostics!==void 0&&!N(e.diagnostics)?n="结构化 diagnostics":e.conflicts!==void 0&&!G(e.conflicts,r)&&(n="有效 editIndex/code/message/currentValue/revision conflicts"),n)throw new a.MachReportError("edit",`ReportProvider.save 必须返回${n};服务器可能已提交,请重新查询确认后再编辑`)}function y(e){return typeof e=="function"?e():e}function w(e,r){const n=new Set(e.flatMap(t=>t.source?.[r]===void 0?[]:[String(t.source[r])]));return n.size===1?[...n][0]:void 0}function O(e,r,n,t,o,s=!1){return typeof e=="function"?e():s?t??o?.[n]??w(r,n)??e:w(r,n)??t??e??o?.[n]}function H(e,r,n){const t=r.query,o=e.reportId===void 0;if(o&&(!t||t.reportIds.length!==1))throw new a.MachReportError("config","自动业务保存需要当前成功查询的单个报表上下文");const s=e.reportId===void 0?t.reportIds[0]:y(e.reportId);if(!s.trim())throw new a.MachReportError("config","业务保存缺少报表 ID");if(o&&new Set(n.map(u=>u.source?.sourceScope)).size>1)throw new g.ReportCellEditError("atomic");const f={...y(e.params??t?.params??{})},p=t?.sources.filter(u=>u.reportId===s)??[],c=p.length===1?p[0]:void 0;return{reportId:s,params:f,source:c,automatic:o,identity:JSON.stringify([s,f,t?.queryId??t?.sources])}}function V(e){return e.requestId??globalThis.crypto?.randomUUID?.()??`mr-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function W(e,r={}){if(!e.save)throw new a.MachReportError("config","ReportProvider.save 未配置,无法启用业务保存");let n="",t,o,s=0;function f(c,u,R){c.conflicts?.length||u!==n||R!==s||(t=c.revision,o=c.sourceToken)}async function p(c,u){if(u.signal.aborted)throw u.signal.reason??new DOMException("Aborted","AbortError");const{reportId:R,params:C,identity:P,source:S,automatic:_}=H(r,u,c.edits),v=++s;if(P!==n&&(n=P,t=void 0,o=void 0),r.requireSource!==!1&&c.edits.some(l=>!l.source))throw new g.ReportCellEditError("missing");const d=await e.save({reportId:R,params:C,signal:u.signal,requestId:c.requestId,action:u.action,edits:i.cloneReportSnapshot(c.edits),expectedRevision:O(r.expectedRevision,c.edits,"revision",t,S,_),sourceToken:O(r.sourceToken,c.edits,"sourceToken",o,S,_)});if(u.signal.aborted)throw u.signal.reason??new DOMException("Aborted","AbortError");j(d,c.edits.length),d.diagnostics?.forEach(l=>L.observeOutput(()=>r.onDiagnostic?.(l)));const h=d.diagnostics?.filter(l=>l.severity==="error");if(h?.length)throw new a.MachReportError("edit",h.map(l=>l.message).join(";"),{diagnostics:h});const I=d.conflicts?.map(l=>({source:c.edits[l.editIndex]?.source,address:c.edits[l.editIndex]?.address,message:l.message,...l.currentValue===void 0?{}:{currentValue:l.currentValue},revision:l.revision??d.revision}));return f(d,P,v),{revision:d.revision,sourceToken:d.sourceToken,conflicts:I}}return{requireSource:r.requireSource??!0,canEdit:r.canEdit,readOnlyReason:r.readOnlyReason,history:r.history,fields:r.fields,validate:r.validate,validation:r.validation,validateBatch:r.validateBatch,saveBatch:p,save:(c,u)=>p({requestId:V(u),edits:[i.cloneReportSnapshot(c)]},u)}}exports.PlanLoadError=i.PlanLoadError;exports.REPORT_EXPORT_FORMATS=i.REPORT_EXPORT_FORMATS;exports.REPORT_PREVIEW_TOOLS=i.REPORT_PREVIEW_TOOLS;exports.ReportDataComparisonPanel=i._sfc_main;exports.ReportExportMenu=i.ReportExportMenu;exports.ReportPagination=i.ReportPagination;exports.ReportPrefillPanel=i._sfc_main$1;exports.ReportPreview=i.ReportPreview;exports.ReportPrintResourceError=i.ReportPrintResourceError;exports.ReportTaskStatus=i.ReportTaskStatus;exports.ReportToolbar=i.ReportToolbar;exports.ReportValidationPanel=i.ReportValidationPanel;exports.buildPrintDocument=i.buildPrintDocument;exports.buildWordHtml=i.buildWordHtml;exports.createDefaultPdfExporter=i.createDefaultPdfExporter;exports.createFetchRequest=i.createFetchRequest;exports.createPrintCalibrationPlan=i.createPrintCalibrationPlan;exports.createReportStoragePreferences=i.createReportStoragePreferences;exports.joinReportIds=i.joinReportIds;exports.normalizeReportIds=i.normalizeReportIds;exports.preparePrintResources=i.preparePrintResources;exports.printPlans=i.printPlans;exports.usePageWindow=i.usePageWindow;exports.usePrintExport=i.usePrintExport;exports.useZoom=i.useZoom;exports.DEFAULT_CALCULATION_MESSAGES=a.DEFAULT_CALCULATION_MESSAGES;exports.DEFAULT_DATA_REVIEW_MESSAGES=a.DEFAULT_DATA_REVIEW_MESSAGES;exports.DEFAULT_MESSAGES=a.DEFAULT_MESSAGES;exports.DEFAULT_PRINT_MESSAGES=a.DEFAULT_PRINT_MESSAGES;exports.DEFAULT_THEME=a.DEFAULT_THEME;exports.MachReportError=a.MachReportError;exports.PARAM_OPTIONS_MESSAGES=a.PARAM_OPTIONS_MESSAGES;exports.ReportParamPanel=a.ReportParamPanel;exports.SILENT_LOGGER=a.SILENT_LOGGER;exports.defineMachReportConfig=a.defineMachReportConfig;exports.defineMachReportPreset=a.defineMachReportPreset;exports.normalizeReportLoadError=a.normalizeReportLoadError;exports.printCalibration=a.printCalibration;exports.provideMachReportConfig=a.provideMachReportConfig;exports.resolveCalculationMessages=a.resolveCalculationMessages;exports.resolveConfig=a.resolveConfig;exports.resolveDataReviewMessages=a.resolveDataReviewMessages;exports.snapshotPrintOptions=a.snapshotPrintOptions;exports.themeToCssVars=a.themeToCssVars;exports.toErrorDetail=a.toErrorDetail;exports.useMachReportConfig=a.useMachReportConfig;exports.MACH_REPORT_CONFIG_KEY=E.MACH_REPORT_CONFIG_KEY;exports.MACH_REPORT_CONTROLLER_KEY=E.MACH_REPORT_CONTROLLER_KEY;exports.MACH_REPORT_FETCHER_KEY=E.MACH_REPORT_FETCHER_KEY;exports.MACH_REPORT_PDF_EXPORTER_KEY=E.MACH_REPORT_PDF_EXPORTER_KEY;exports.MachReportPreview=M.MachReportPreview;exports.machReportPlugin=M.machReportPlugin;exports.createLocalFetcher=F;exports.createProviderEditing=W;exports.useMachReport=b;exports.useReportPreview=q;Object.keys(g).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>g[e]})});
|
package/dist/vue.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { createReportSource as
|
|
1
|
+
import { createReportSource as O, ReportCellEditError as T } from "@agile-team/mach-report";
|
|
2
2
|
export * from "@agile-team/mach-report";
|
|
3
|
-
import { P as
|
|
4
|
-
import { R as
|
|
5
|
-
import { M as
|
|
6
|
-
import { D as
|
|
7
|
-
import { M as
|
|
8
|
-
import { a as
|
|
9
|
-
import { M as
|
|
10
|
-
import { shallowRef as
|
|
11
|
-
import { v as
|
|
12
|
-
import {
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
if (t.reportIds.length === 0) throw new
|
|
3
|
+
import { P as h, c as y } from "./ReportPreview-CilFAS9U.js";
|
|
4
|
+
import { R as oe, a as se, _ as ae, b as ie, d as ce, e as ue, f as fe, g as de, h as le, i as ge, j as pe, k as me, l as Pe, m as Ee, n as Re, o as he, p as ye, q as we, r as Se, s as ve, t as Te, u as Ie, v as Ae, w as xe } from "./ReportPreview-CilFAS9U.js";
|
|
5
|
+
import { M as d } from "./ReportParamPanel-DGXzBzl2.js";
|
|
6
|
+
import { D as Oe, a as _e, b as Me, c as De, d as be, P as ke, R as Fe, S as Le, e as qe, f as Ne, n as Ue, p as Ve, g as je, r as Ge, h as ze, i as He, s as We, t as Ye, j as Be, u as Ke } from "./ReportParamPanel-DGXzBzl2.js";
|
|
7
|
+
import { M as _ } from "./injection-keys-e85udZCp.js";
|
|
8
|
+
import { a as Xe, b as Je, c as Ze } from "./injection-keys-e85udZCp.js";
|
|
9
|
+
import { M as er, m as rr } from "./plugin-CttO46hc.js";
|
|
10
|
+
import { shallowRef as M, computed as D, inject as b } from "vue";
|
|
11
|
+
import { v as k } from "./json-snapshot-x0JpllWL.js";
|
|
12
|
+
import { z as F } from "./diagnostic-collector-gB07PHy2.js";
|
|
13
|
+
function J(e) {
|
|
14
|
+
const r = O(e), o = async (t) => {
|
|
15
|
+
if (t.reportIds.length === 0) throw new h("缺少报表 ID");
|
|
16
16
|
for (const n of t.reportIds)
|
|
17
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
18
|
-
throw new
|
|
19
|
-
return
|
|
17
|
+
if (!Object.prototype.hasOwnProperty.call(e, n) || !e[n])
|
|
18
|
+
throw new h(`本地模板 ${n} 不存在`);
|
|
19
|
+
return r(t);
|
|
20
20
|
};
|
|
21
|
-
return o.getParamDefs =
|
|
21
|
+
return o.getParamDefs = r.getParamDefs, o;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const L = Object.freeze({
|
|
24
24
|
loading: !1,
|
|
25
25
|
hasPlan: !1,
|
|
26
26
|
pageCount: 0,
|
|
@@ -32,92 +32,92 @@ const D = Object.freeze({
|
|
|
32
32
|
error: null,
|
|
33
33
|
pdfFont: Object.freeze({ status: "unchecked", fontUrl: "" })
|
|
34
34
|
});
|
|
35
|
-
function
|
|
36
|
-
const
|
|
35
|
+
function Z() {
|
|
36
|
+
const e = M(null), r = () => e.value?.state ?? L, o = Object.freeze({
|
|
37
37
|
get loading() {
|
|
38
|
-
return
|
|
38
|
+
return r().loading;
|
|
39
39
|
},
|
|
40
40
|
get stale() {
|
|
41
|
-
return
|
|
41
|
+
return r().stale ?? !1;
|
|
42
42
|
},
|
|
43
43
|
get hasPlan() {
|
|
44
|
-
return
|
|
44
|
+
return r().hasPlan;
|
|
45
45
|
},
|
|
46
46
|
get pageCount() {
|
|
47
|
-
return
|
|
47
|
+
return r().pageCount;
|
|
48
48
|
},
|
|
49
49
|
get currentPage() {
|
|
50
|
-
return
|
|
50
|
+
return r().currentPage;
|
|
51
51
|
},
|
|
52
52
|
get exporting() {
|
|
53
|
-
return
|
|
53
|
+
return r().exporting;
|
|
54
54
|
},
|
|
55
55
|
get printing() {
|
|
56
|
-
return
|
|
56
|
+
return r().printing;
|
|
57
57
|
},
|
|
58
58
|
get canExport() {
|
|
59
|
-
return
|
|
59
|
+
return r().canExport;
|
|
60
60
|
},
|
|
61
61
|
get canPrint() {
|
|
62
|
-
return
|
|
62
|
+
return r().canPrint;
|
|
63
63
|
},
|
|
64
64
|
get error() {
|
|
65
|
-
return
|
|
65
|
+
return r().error;
|
|
66
66
|
},
|
|
67
67
|
get pdfFont() {
|
|
68
|
-
return
|
|
68
|
+
return r().pdfFont;
|
|
69
69
|
},
|
|
70
70
|
get editing() {
|
|
71
|
-
return
|
|
71
|
+
return r().editing ?? !1;
|
|
72
72
|
},
|
|
73
73
|
get saving() {
|
|
74
|
-
return
|
|
74
|
+
return r().saving ?? !1;
|
|
75
75
|
},
|
|
76
76
|
get importing() {
|
|
77
|
-
return
|
|
77
|
+
return r().importing ?? !1;
|
|
78
78
|
},
|
|
79
79
|
get dirty() {
|
|
80
|
-
return
|
|
80
|
+
return r().dirty ?? !1;
|
|
81
81
|
},
|
|
82
82
|
get pendingLocalChanges() {
|
|
83
|
-
return
|
|
83
|
+
return r().pendingLocalChanges ?? !1;
|
|
84
84
|
},
|
|
85
85
|
get task() {
|
|
86
|
-
return
|
|
86
|
+
return r().task ?? null;
|
|
87
87
|
},
|
|
88
88
|
get diagnostics() {
|
|
89
|
-
return
|
|
89
|
+
return r().diagnostics ?? [];
|
|
90
90
|
},
|
|
91
91
|
get reportIds() {
|
|
92
|
-
return
|
|
92
|
+
return r().reportIds ?? [];
|
|
93
93
|
},
|
|
94
94
|
get params() {
|
|
95
|
-
return
|
|
95
|
+
return r().params ?? {};
|
|
96
96
|
},
|
|
97
97
|
get canUndo() {
|
|
98
|
-
return
|
|
98
|
+
return r().canUndo ?? !1;
|
|
99
99
|
},
|
|
100
100
|
get canRedo() {
|
|
101
|
-
return
|
|
101
|
+
return r().canRedo ?? !1;
|
|
102
102
|
},
|
|
103
103
|
get changeCount() {
|
|
104
|
-
return
|
|
104
|
+
return r().changeCount ?? 0;
|
|
105
105
|
},
|
|
106
106
|
get selection() {
|
|
107
|
-
return
|
|
107
|
+
return r().selection ?? null;
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
function t() {
|
|
111
|
-
if (!
|
|
112
|
-
throw new
|
|
113
|
-
return
|
|
111
|
+
if (!e.value)
|
|
112
|
+
throw new d("config", "报表预览尚未挂载,请在 ready 后调用控制器");
|
|
113
|
+
return e.value;
|
|
114
114
|
}
|
|
115
115
|
return {
|
|
116
116
|
ref(n) {
|
|
117
|
-
const
|
|
118
|
-
|
|
117
|
+
const s = n;
|
|
118
|
+
e.value = s && typeof s.reload == "function" && typeof s.print == "function" && typeof s.exportAs == "function" && typeof s.openPdfWindow == "function" && typeof s.gotoPage == "function" && typeof s.setParams == "function" ? s : null;
|
|
119
119
|
},
|
|
120
|
-
ready:
|
|
120
|
+
ready: D(() => e.value !== null),
|
|
121
121
|
state: o,
|
|
122
122
|
async checkPdfFont() {
|
|
123
123
|
const n = t();
|
|
@@ -147,13 +147,13 @@ function Y() {
|
|
|
147
147
|
gotoPage(n) {
|
|
148
148
|
t().gotoPage(n);
|
|
149
149
|
},
|
|
150
|
-
async setParams(n,
|
|
151
|
-
await t().setParams(n,
|
|
150
|
+
async setParams(n, s) {
|
|
151
|
+
await t().setParams(n, s);
|
|
152
152
|
},
|
|
153
|
-
async importExcel(n,
|
|
154
|
-
const
|
|
155
|
-
if (!
|
|
156
|
-
return
|
|
153
|
+
async importExcel(n, s) {
|
|
154
|
+
const f = t();
|
|
155
|
+
if (!f.importExcel) throw new d("config", "旧自定义控制器未提供 Excel 导入");
|
|
156
|
+
return f.importExcel(n, s);
|
|
157
157
|
},
|
|
158
158
|
getPlan() {
|
|
159
159
|
return t().getPlan?.() ?? null;
|
|
@@ -166,136 +166,166 @@ function Y() {
|
|
|
166
166
|
redo: async () => await t().redo?.() ?? !1,
|
|
167
167
|
restoreChanges: async () => await t().restoreChanges?.() ?? !1,
|
|
168
168
|
getSelection: () => t().getSelection?.() ?? null,
|
|
169
|
-
focusCell: async (n,
|
|
169
|
+
focusCell: async (n, s) => await t().focusCell?.(n, s) ?? !1,
|
|
170
170
|
focusField: async (n) => await t().focusField?.(n) ?? !1,
|
|
171
171
|
copySelection: () => t().copySelection?.() ?? "",
|
|
172
172
|
pasteSelection: async (n) => await t().pasteSelection?.(n) ?? !1
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
return _
|
|
175
|
+
function Q() {
|
|
176
|
+
return b(_, null);
|
|
177
177
|
}
|
|
178
|
-
function P(
|
|
179
|
-
return !!
|
|
178
|
+
function P(e) {
|
|
179
|
+
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
return Array.isArray(
|
|
181
|
+
function q(e) {
|
|
182
|
+
return Array.isArray(e) && e.every((r) => P(r) && typeof r.code == "string" && typeof r.message == "string" && ["info", "warning", "error"].includes(r.severity) && (r.path === void 0 || typeof r.path == "string") && k(r));
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
return
|
|
184
|
+
function I(e) {
|
|
185
|
+
return typeof e == "number" && Number.isFinite(e) && (!Number.isInteger(e) || Number.isSafeInteger(e));
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function N(e) {
|
|
188
|
+
return e == null || typeof e == "string" || typeof e == "boolean" || I(e);
|
|
189
|
+
}
|
|
190
|
+
function U(e) {
|
|
191
|
+
return e === void 0 || typeof e == "string" && !!e.trim() || I(e);
|
|
192
|
+
}
|
|
193
|
+
function V(e, r) {
|
|
194
|
+
return Array.isArray(e) && e.every((o) => P(o) && Number.isSafeInteger(o.editIndex) && o.editIndex >= 0 && o.editIndex < r && typeof o.code == "string" && typeof o.message == "string" && N(o.currentValue) && U(o.revision));
|
|
195
|
+
}
|
|
196
|
+
function j(e, r) {
|
|
188
197
|
let o;
|
|
189
|
-
if (!P(
|
|
198
|
+
if (!P(e) || typeof e.revision != "string" || !e.revision.trim() ? o = "非空 revision(请先在适配器解包业务响应)" : e.sourceToken !== void 0 && typeof e.sourceToken != "string" ? o = "字符串 sourceToken" : e.diagnostics !== void 0 && !q(e.diagnostics) ? o = "结构化 diagnostics" : e.conflicts !== void 0 && !V(e.conflicts, r) && (o = "有效 editIndex/code/message/currentValue/revision conflicts"), o) throw new d("edit", `ReportProvider.save 必须返回${o};服务器可能已提交,请重新查询确认后再编辑`);
|
|
190
199
|
}
|
|
191
|
-
function
|
|
192
|
-
return typeof
|
|
200
|
+
function w(e) {
|
|
201
|
+
return typeof e == "function" ? e() : e;
|
|
193
202
|
}
|
|
194
|
-
function
|
|
195
|
-
const o = new Set(
|
|
203
|
+
function S(e, r) {
|
|
204
|
+
const o = new Set(e.flatMap((t) => t.source?.[r] === void 0 ? [] : [String(t.source[r])]));
|
|
196
205
|
return o.size === 1 ? [...o][0] : void 0;
|
|
197
206
|
}
|
|
198
|
-
function
|
|
199
|
-
return typeof
|
|
207
|
+
function v(e, r, o, t, n, s = !1) {
|
|
208
|
+
return typeof e == "function" ? e() : s ? t ?? n?.[o] ?? S(r, o) ?? e : S(r, o) ?? t ?? e ?? n?.[o];
|
|
209
|
+
}
|
|
210
|
+
function G(e, r, o) {
|
|
211
|
+
const t = r.query, n = e.reportId === void 0;
|
|
212
|
+
if (n && (!t || t.reportIds.length !== 1)) throw new d("config", "自动业务保存需要当前成功查询的单个报表上下文");
|
|
213
|
+
const s = e.reportId === void 0 ? t.reportIds[0] : w(e.reportId);
|
|
214
|
+
if (!s.trim()) throw new d("config", "业务保存缺少报表 ID");
|
|
215
|
+
if (n && new Set(o.map((i) => i.source?.sourceScope)).size > 1) throw new T("atomic");
|
|
216
|
+
const f = { ...w(e.params ?? t?.params ?? {}) }, l = t?.sources.filter((i) => i.reportId === s) ?? [], a = l.length === 1 ? l[0] : void 0;
|
|
217
|
+
return {
|
|
218
|
+
reportId: s,
|
|
219
|
+
params: f,
|
|
220
|
+
source: a,
|
|
221
|
+
automatic: n,
|
|
222
|
+
identity: JSON.stringify([s, f, t?.queryId ?? t?.sources])
|
|
223
|
+
};
|
|
200
224
|
}
|
|
201
|
-
function
|
|
202
|
-
return
|
|
225
|
+
function z(e) {
|
|
226
|
+
return e.requestId ?? globalThis.crypto?.randomUUID?.() ?? `mr-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
203
227
|
}
|
|
204
|
-
function
|
|
205
|
-
if (!
|
|
206
|
-
let o = "", t, n,
|
|
207
|
-
function
|
|
208
|
-
|
|
228
|
+
function ee(e, r = {}) {
|
|
229
|
+
if (!e.save) throw new d("config", "ReportProvider.save 未配置,无法启用业务保存");
|
|
230
|
+
let o = "", t, n, s = 0;
|
|
231
|
+
function f(a, i, g) {
|
|
232
|
+
a.conflicts?.length || i !== o || g !== s || (t = a.revision, n = a.sourceToken);
|
|
209
233
|
}
|
|
210
|
-
async function
|
|
234
|
+
async function l(a, i) {
|
|
211
235
|
if (i.signal.aborted) throw i.signal.reason ?? new DOMException("Aborted", "AbortError");
|
|
212
|
-
const
|
|
213
|
-
if (
|
|
214
|
-
const u = await
|
|
215
|
-
reportId:
|
|
216
|
-
params:
|
|
236
|
+
const { reportId: g, params: A, identity: p, source: E, automatic: R } = G(r, i, a.edits), x = ++s;
|
|
237
|
+
if (p !== o && (o = p, t = void 0, n = void 0), r.requireSource !== !1 && a.edits.some((c) => !c.source)) throw new T("missing");
|
|
238
|
+
const u = await e.save({
|
|
239
|
+
reportId: g,
|
|
240
|
+
params: A,
|
|
217
241
|
signal: i.signal,
|
|
218
|
-
requestId:
|
|
242
|
+
requestId: a.requestId,
|
|
219
243
|
action: i.action,
|
|
220
|
-
edits:
|
|
221
|
-
expectedRevision:
|
|
222
|
-
sourceToken:
|
|
244
|
+
edits: y(a.edits),
|
|
245
|
+
expectedRevision: v(r.expectedRevision, a.edits, "revision", t, E, R),
|
|
246
|
+
sourceToken: v(r.sourceToken, a.edits, "sourceToken", n, E, R)
|
|
223
247
|
});
|
|
224
248
|
if (i.signal.aborted) throw i.signal.reason ?? new DOMException("Aborted", "AbortError");
|
|
225
|
-
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
const
|
|
229
|
-
|
|
249
|
+
j(u, a.edits.length), u.diagnostics?.forEach((c) => F(() => r.onDiagnostic?.(c)));
|
|
250
|
+
const m = u.diagnostics?.filter((c) => c.severity === "error");
|
|
251
|
+
if (m?.length) throw new d("edit", m.map((c) => c.message).join(";"), { diagnostics: m });
|
|
252
|
+
const C = u.conflicts?.map((c) => ({
|
|
253
|
+
source: a.edits[c.editIndex]?.source,
|
|
254
|
+
address: a.edits[c.editIndex]?.address,
|
|
255
|
+
message: c.message,
|
|
256
|
+
...c.currentValue === void 0 ? {} : { currentValue: c.currentValue },
|
|
257
|
+
revision: c.revision ?? u.revision
|
|
258
|
+
}));
|
|
259
|
+
return f(u, p, x), { revision: u.revision, sourceToken: u.sourceToken, conflicts: C };
|
|
230
260
|
}
|
|
231
261
|
return {
|
|
232
|
-
requireSource:
|
|
233
|
-
canEdit:
|
|
234
|
-
readOnlyReason:
|
|
235
|
-
history:
|
|
236
|
-
fields:
|
|
237
|
-
validate:
|
|
238
|
-
validation:
|
|
239
|
-
validateBatch:
|
|
240
|
-
saveBatch:
|
|
241
|
-
save: (
|
|
262
|
+
requireSource: r.requireSource ?? !0,
|
|
263
|
+
canEdit: r.canEdit,
|
|
264
|
+
readOnlyReason: r.readOnlyReason,
|
|
265
|
+
history: r.history,
|
|
266
|
+
fields: r.fields,
|
|
267
|
+
validate: r.validate,
|
|
268
|
+
validation: r.validation,
|
|
269
|
+
validateBatch: r.validateBatch,
|
|
270
|
+
saveBatch: l,
|
|
271
|
+
save: (a, i) => l({ requestId: z(i), edits: [y(a)] }, i)
|
|
242
272
|
};
|
|
243
273
|
}
|
|
244
274
|
export {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
275
|
+
Oe as DEFAULT_CALCULATION_MESSAGES,
|
|
276
|
+
_e as DEFAULT_DATA_REVIEW_MESSAGES,
|
|
277
|
+
Me as DEFAULT_MESSAGES,
|
|
278
|
+
De as DEFAULT_PRINT_MESSAGES,
|
|
279
|
+
be as DEFAULT_THEME,
|
|
280
|
+
Xe as MACH_REPORT_CONFIG_KEY,
|
|
281
|
+
_ as MACH_REPORT_CONTROLLER_KEY,
|
|
282
|
+
Je as MACH_REPORT_FETCHER_KEY,
|
|
283
|
+
Ze as MACH_REPORT_PDF_EXPORTER_KEY,
|
|
284
|
+
d as MachReportError,
|
|
285
|
+
er as MachReportPreview,
|
|
286
|
+
ke as PARAM_OPTIONS_MESSAGES,
|
|
287
|
+
h as PlanLoadError,
|
|
288
|
+
oe as REPORT_EXPORT_FORMATS,
|
|
289
|
+
se as REPORT_PREVIEW_TOOLS,
|
|
290
|
+
ae as ReportDataComparisonPanel,
|
|
291
|
+
ie as ReportExportMenu,
|
|
292
|
+
ce as ReportPagination,
|
|
293
|
+
Fe as ReportParamPanel,
|
|
294
|
+
ue as ReportPrefillPanel,
|
|
295
|
+
fe as ReportPreview,
|
|
296
|
+
de as ReportPrintResourceError,
|
|
297
|
+
le as ReportTaskStatus,
|
|
298
|
+
ge as ReportToolbar,
|
|
299
|
+
pe as ReportValidationPanel,
|
|
300
|
+
Le as SILENT_LOGGER,
|
|
301
|
+
me as buildPrintDocument,
|
|
302
|
+
Pe as buildWordHtml,
|
|
303
|
+
Ee as createDefaultPdfExporter,
|
|
304
|
+
Re as createFetchRequest,
|
|
305
|
+
J as createLocalFetcher,
|
|
306
|
+
he as createPrintCalibrationPlan,
|
|
307
|
+
ee as createProviderEditing,
|
|
308
|
+
ye as createReportStoragePreferences,
|
|
309
|
+
qe as defineMachReportConfig,
|
|
310
|
+
Ne as defineMachReportPreset,
|
|
311
|
+
we as joinReportIds,
|
|
312
|
+
rr as machReportPlugin,
|
|
313
|
+
Se as normalizeReportIds,
|
|
314
|
+
Ue as normalizeReportLoadError,
|
|
315
|
+
ve as preparePrintResources,
|
|
316
|
+
Ve as printCalibration,
|
|
317
|
+
Te as printPlans,
|
|
318
|
+
je as provideMachReportConfig,
|
|
319
|
+
Ge as resolveCalculationMessages,
|
|
320
|
+
ze as resolveConfig,
|
|
321
|
+
He as resolveDataReviewMessages,
|
|
322
|
+
We as snapshotPrintOptions,
|
|
323
|
+
Ye as themeToCssVars,
|
|
324
|
+
Be as toErrorDetail,
|
|
325
|
+
Z as useMachReport,
|
|
326
|
+
Ke as useMachReportConfig,
|
|
327
|
+
Ie as usePageWindow,
|
|
328
|
+
Ae as usePrintExport,
|
|
329
|
+
Q as useReportPreview,
|
|
330
|
+
xe as useZoom
|
|
301
331
|
};
|