@yudaocode/univer-sheets-ui 1.6.210 → 1.6.212

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/lib/cjs/index.js CHANGED
@@ -207,37 +207,51 @@ var OpenSheetModalOperation = {
207
207
  return true;
208
208
  }
209
209
  };
210
+ function mergeImportedTemplateMetadata(prevMeta, importedMeta) {
211
+ const next = { ...prevMeta, ...importedMeta };
212
+ if (!importedMeta.charts) delete next.charts;
213
+ return next;
214
+ }
210
215
  var ImportSheetFileOperation = {
211
216
  id: "yudao-sheets-ui.operation.import-file",
212
217
  type: import_core2.CommandType.OPERATION,
213
218
  handler: (accessor, params) => {
214
- if (typeof document === "undefined") return false;
215
219
  const commandService = accessor.get(import_core2.ICommandService);
220
+ if (!params?.file) {
221
+ if (commandService.hasCommand(OpenSheetModalOperation.id)) {
222
+ return commandService.syncExecuteCommand(OpenSheetModalOperation.id, { tab: "import" });
223
+ }
224
+ accessor.get(ISheetsUIFeatureService).openModal("import");
225
+ return true;
226
+ }
227
+ const file = params.file;
216
228
  const instanceService = accessor.get(import_core2.IUniverInstanceService);
217
229
  const ioService = accessor.get(import_univer_sheets.ISheetIoService);
218
230
  const templateService = accessor.get(import_univer_sheets.ISheetTemplateService);
219
- const input = document.createElement("input");
220
- input.type = "file";
221
- input.accept = ".xlsx,.xls,.xml,.csv,.json";
222
- input.onchange = async () => {
223
- const file = input.files?.[0];
224
- if (!file) return;
225
- const workbook = instanceService.getCurrentUnitOfType(import_core2.UniverInstanceType.UNIVER_SHEET);
226
- if (!workbook) return;
227
- const unitId = workbook.getUnitId();
228
- const imported = await ioService.importSheet(file, unitId, {
229
- target: params?.target
230
- });
231
+ const workbook = instanceService.getCurrentUnitOfType(import_core2.UniverInstanceType.UNIVER_SHEET);
232
+ if (!workbook) return false;
233
+ const unitId = workbook.getUnitId();
234
+ return ioService.importSheetWithReport(file, {
235
+ unitId,
236
+ target: params.target
237
+ }).then((outcome) => {
238
+ const imported = outcome.snapshot ?? outcome.workbookData;
231
239
  const prevMeta = templateService.getTemplateMetadata(unitId);
232
240
  const xmlMeta = imported.__templateMetadata ?? {};
233
- commandService.syncExecuteCommand(import_univer_sheets.ApplyImportedWorkbookDataCommand.id, {
241
+ const mergedBase = mergeImportedTemplateMetadata(prevMeta, xmlMeta);
242
+ const nextMeta = {
243
+ ...mergedBase,
244
+ ...imported.definedNames ? { definedNames: imported.definedNames } : {},
245
+ ...typeof imported.workbookStructureLocked === "boolean" ? { workbookStructureLocked: imported.workbookStructureLocked } : {},
246
+ ...imported.conditionalRules ? { conditionalRules: imported.conditionalRules } : {},
247
+ ...imported.cellNotes ? { cellNotes: imported.cellNotes } : {}
248
+ };
249
+ return commandService.syncExecuteCommand(import_univer_sheets.ApplyImportedWorkbookDataCommand.id, {
234
250
  unitId,
235
251
  workbookData: imported,
236
- metadata: { ...prevMeta, ...xmlMeta }
252
+ metadata: nextMeta
237
253
  });
238
- };
239
- input.click();
240
- return true;
254
+ });
241
255
  }
242
256
  };
243
257
  var FillSheetSampleDatasetOperation = {
@@ -357,6 +371,7 @@ var enUS = {
357
371
  tagColorLabel: "Tag Accent Color"
358
372
  },
359
373
  modal: {
374
+ tabImport: "Import Workbook (.xlsx/.xls/.csv/.xml)",
360
375
  tabExport: "Live Expansion Preview & Export (.xlsx)",
361
376
  tabPrint: "Pre-Printed Form \xB7 Multi-Column \xB7 Print Preview",
362
377
  tabJson: "{ } Univer IWorkbookData Contract",
@@ -455,6 +470,7 @@ var zhCN = {
455
470
  tagColorLabel: "\u6807\u7B7E\u4E3B\u9898\u8272"
456
471
  },
457
472
  modal: {
473
+ tabImport: "\u5BFC\u5165\u5DE5\u4F5C\u7C3F (.xlsx/.xls/.csv/.xml)",
458
474
  tabExport: "\u52A8\u6001\u5C55\u5F00\u9884\u89C8 & \u5BFC\u51FA Excel (.xlsx)",
459
475
  tabPrint: "\u7968\u636E\u5957\u6253 \xB7 \u591A\u680F \xB7 \u5206\u9875\u6253\u5370\u9884\u89C8",
460
476
  tabJson: "{ } Univer IWorkbookData \u5951\u7EA6",
@@ -469,7 +485,7 @@ var zhCN = {
469
485
  resetBtn: "\u91CD\u7F6E",
470
486
  allOption: "\u5168\u90E8",
471
487
  browserModeBtn: "\u6D4F\u89C8\u5668\u5904\u7406",
472
- serverModeBtn: "\u670D\u52A1\u7AEF",
488
+ serverModeBtn: "\u670D\u52A1\u7AEF\u5904\u7406",
473
489
  serverNotConnected: " (\u672A\u63A5\u5165)",
474
490
  refreshPreviewBtn: "\u5237\u65B0\u53F3\u4FA7\u9884\u89C8",
475
491
  mockDatasetBtn: "\u751F\u6210\u6A21\u62DF\u6570\u636E",
@@ -545,6 +561,9 @@ var SheetInspectorPanel = () => {
545
561
  const [chartTrendline, setChartTrendline] = (0, import_react2.useState)("none");
546
562
  const [chartLogScale, setChartLogScale] = (0, import_react2.useState)(false);
547
563
  const [chartThreeD, setChartThreeD] = (0, import_react2.useState)(false);
564
+ const [chartSmooth, setChartSmooth] = (0, import_react2.useState)(false);
565
+ const [chartShowLegend, setChartShowLegend] = (0, import_react2.useState)(true);
566
+ const [chartLegendPos, setChartLegendPos] = (0, import_react2.useState)("right");
548
567
  const [auditOutput, setAuditOutput] = (0, import_react2.useState)("");
549
568
  const [goalTargetCell, setGoalTargetCell] = (0, import_react2.useState)("F10");
550
569
  const [goalTargetValue, setGoalTargetValue] = (0, import_react2.useState)("1000");
@@ -2288,7 +2307,18 @@ var SheetInspectorPanel = () => {
2288
2307
  }
2289
2308
  )
2290
2309
  ] }),
2291
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "flex", gap: 8, paddingBottom: 4, fontSize: 11, color: "#31363F" }, children: [
2310
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "flex", flexWrap: "wrap", gap: 8, paddingBottom: 4, fontSize: 11, color: "#31363F" }, children: [
2311
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 4, cursor: "pointer" }, children: [
2312
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2313
+ "input",
2314
+ {
2315
+ type: "checkbox",
2316
+ checked: chartSmooth || chartType.endsWith("Smooth"),
2317
+ onChange: (e) => setChartSmooth(e.target.checked)
2318
+ }
2319
+ ),
2320
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u5E73\u6ED1\u66F2\u7EBF" })
2321
+ ] }),
2292
2322
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 4, cursor: "pointer" }, children: [
2293
2323
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2294
2324
  "input",
@@ -2313,6 +2343,51 @@ var SheetInspectorPanel = () => {
2313
2343
  ] })
2314
2344
  ] })
2315
2345
  ] }),
2346
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "0.9fr 1.1fr", gap: 4, alignItems: "end" }, children: [
2347
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2348
+ "label",
2349
+ {
2350
+ style: {
2351
+ display: "flex",
2352
+ alignItems: "center",
2353
+ gap: 6,
2354
+ paddingBottom: 4,
2355
+ fontSize: 11,
2356
+ color: "#31363F",
2357
+ cursor: "pointer"
2358
+ },
2359
+ children: [
2360
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2361
+ "input",
2362
+ {
2363
+ type: "checkbox",
2364
+ checked: chartShowLegend,
2365
+ onChange: (e) => setChartShowLegend(e.target.checked)
2366
+ }
2367
+ ),
2368
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u663E\u793A\u56FE\u4F8B" })
2369
+ ]
2370
+ }
2371
+ ),
2372
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "yudao-sheet-field-row", children: [
2373
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\u56FE\u4F8B\u4F4D\u7F6E" }),
2374
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2375
+ "select",
2376
+ {
2377
+ value: chartLegendPos,
2378
+ disabled: !chartShowLegend,
2379
+ onChange: (e) => setChartLegendPos(e.target.value),
2380
+ children: [
2381
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "right", children: "\u53F3\u4FA7 (Right)" }),
2382
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "top", children: "\u9876\u90E8 (Top)" }),
2383
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "bottom", children: "\u5E95\u90E8 (Bottom)" }),
2384
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "left", children: "\u5DE6\u4FA7 (Left)" }),
2385
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "topRight", children: "\u53F3\u4E0A\u89D2 (TopRight)" })
2386
+ ]
2387
+ }
2388
+ )
2389
+ ] })
2390
+ ] }),
2316
2391
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 4 }, children: [
2317
2392
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2318
2393
  "button",
@@ -2320,6 +2395,7 @@ var SheetInspectorPanel = () => {
2320
2395
  type: "button",
2321
2396
  className: "yudao-sheet-btn is-soft-primary",
2322
2397
  onClick: () => {
2398
+ const isSmoothEnabled = chartType.startsWith("line") && (chartSmooth || chartType.endsWith("Smooth"));
2323
2399
  templateService.addOrUpdateChart(unitId, {
2324
2400
  id: `chart-${(0, import_core4.generateRandomId)(5)}`,
2325
2401
  sheetId: sheet.getSheetId(),
@@ -2327,6 +2403,9 @@ var SheetInspectorPanel = () => {
2327
2403
  chartType,
2328
2404
  categoryRange: chartCatRange || "B6:B9",
2329
2405
  valueRange: chartValRange || "F6:F9",
2406
+ smooth: isSmoothEnabled ? true : void 0,
2407
+ showLegend: chartShowLegend,
2408
+ legendPosition: chartShowLegend ? chartLegendPos : void 0,
2330
2409
  trendline: chartTrendline !== "none" ? chartTrendline : void 0,
2331
2410
  yAxisScale: chartLogScale ? "log" : "linear",
2332
2411
  threeD: chartThreeD ? { rotX: 15, rotY: 20 } : void 0,
@@ -2345,6 +2424,7 @@ var SheetInspectorPanel = () => {
2345
2424
  type: "button",
2346
2425
  className: "yudao-sheet-btn",
2347
2426
  onClick: () => {
2427
+ const isSmoothEnabled = chartType.startsWith("line") && (chartSmooth || chartType.endsWith("Smooth"));
2348
2428
  commandService.syncExecuteCommand(import_univer_sheets2.InsertChartSheetCommand.id, {
2349
2429
  unitId,
2350
2430
  name: chartTitle || "\u56FE\u8868\u5DE5\u4F5C\u8868",
@@ -2355,6 +2435,9 @@ var SheetInspectorPanel = () => {
2355
2435
  chartType,
2356
2436
  categoryRange: chartCatRange || "B6:B9",
2357
2437
  valueRange: chartValRange || "F6:F9",
2438
+ smooth: isSmoothEnabled ? true : void 0,
2439
+ showLegend: chartShowLegend,
2440
+ legendPosition: chartShowLegend ? chartLegendPos : void 0,
2358
2441
  trendline: chartTrendline !== "none" ? chartTrendline : void 0,
2359
2442
  yAxisScale: chartLogScale ? "log" : "linear",
2360
2443
  threeD: chartThreeD ? { rotX: 15, rotY: 20 } : void 0,
@@ -3906,6 +3989,10 @@ var SheetPreviewAndIoModal = () => {
3906
3989
  const tab = (0, import_ui5.useObservable)(featureService.modalTab$, featureService.getModalTab());
3907
3990
  const features = (0, import_ui5.useObservable)(featureService.features$, featureService.getFeatures());
3908
3991
  const ioAdapter = (0, import_ui5.useObservable)(ioService.adapter$, ioService.getAdapter());
3992
+ const defaultIoTargetPref = (0, import_ui5.useObservable)(
3993
+ ioService.defaultIoTarget$,
3994
+ ioService.getDefaultIoTarget()
3995
+ );
3909
3996
  const workbook = (0, import_ui5.useObservable)(
3910
3997
  () => instanceService.getCurrentTypeOfUnit$(import_core6.UniverInstanceType.UNIVER_SHEET),
3911
3998
  instanceService.getCurrentUnitOfType(import_core6.UniverInstanceType.UNIVER_SHEET),
@@ -3917,8 +4004,12 @@ var SheetPreviewAndIoModal = () => {
3917
4004
  const [jsonText, setJsonText] = (0, import_react4.useState)("");
3918
4005
  const [statusTip, setStatusTip] = (0, import_react4.useState)("");
3919
4006
  const [ioTarget, setIoTarget] = (0, import_react4.useState)("browser");
4007
+ const [exportFormat, setExportFormat] = (0, import_react4.useState)("xlsx");
4008
+ const [selectedImportFile, setSelectedImportFile] = (0, import_react4.useState)(null);
4009
+ const [pendingImport, setPendingImport] = (0, import_react4.useState)(null);
4010
+ const [ioError, setIoError] = (0, import_react4.useState)(null);
4011
+ const [lastIoAction, setLastIoAction] = (0, import_react4.useState)(null);
3920
4012
  const [skipDatasetOnExport, setSkipDatasetOnExport] = (0, import_react4.useState)(false);
3921
- const [importWarnings, setImportWarnings] = (0, import_react4.useState)([]);
3922
4013
  const [paginationEnabled, setPaginationEnabled] = (0, import_react4.useState)(false);
3923
4014
  const [pageIndex, setPageIndex] = (0, import_react4.useState)(1);
3924
4015
  const [pageSize, setPageSize] = (0, import_react4.useState)(50);
@@ -3929,6 +4020,10 @@ var SheetPreviewAndIoModal = () => {
3929
4020
  const [queryValues, setQueryValues] = (0, import_react4.useState)({});
3930
4021
  const metaVersion = (0, import_ui5.useObservable)(templateService.metadataChange$, "");
3931
4022
  void metaVersion;
4023
+ void defaultIoTargetPref;
4024
+ const userTouchedTargetRef = (0, import_react4.useRef)(false);
4025
+ const prevOpenRef = (0, import_react4.useRef)(false);
4026
+ const fileInputRef = (0, import_react4.useRef)(null);
3932
4027
  const [printCfg, setPrintCfg] = (0, import_react4.useState)({
3933
4028
  paperOrientation: "A4_LANDSCAPE",
3934
4029
  scaleMode: "all",
@@ -4032,7 +4127,10 @@ var SheetPreviewAndIoModal = () => {
4032
4127
  return () => sub.unsubscribe();
4033
4128
  }, [templateService, featureService, workbook]);
4034
4129
  (0, import_react4.useEffect)(() => {
4130
+ const justOpened = open && !prevOpenRef.current;
4131
+ prevOpenRef.current = open;
4035
4132
  if (!open || !workbook) return;
4133
+ if (!justOpened) return;
4036
4134
  const snap = workbook.save();
4037
4135
  const meta = templateService.getTemplateMetadata(workbook.getUnitId());
4038
4136
  const initialData = meta.sampleData ?? {};
@@ -4093,10 +4191,27 @@ var SheetPreviewAndIoModal = () => {
4093
4191
  )
4094
4192
  );
4095
4193
  setJsonText(JSON.stringify(snap, null, 2));
4096
- setIoTarget(ioService.getIoCapabilities().recommendedDefaultTarget);
4097
- setImportWarnings([]);
4194
+ userTouchedTargetRef.current = false;
4195
+ const initExportFmt = tab === "print" ? "pdf" : "xlsx";
4196
+ setExportFormat(initExportFmt);
4197
+ const caps = ioService.getIoCapabilities();
4198
+ const initOp = tab === "import" ? "import" : "export";
4199
+ const initFmt = initOp === "import" ? "xlsx" : initExportFmt;
4200
+ setIoTarget(caps.formats[initOp]?.[initFmt]?.defaultTarget ?? caps.recommendedDefaultTarget);
4201
+ setSelectedImportFile(null);
4202
+ setPendingImport(null);
4203
+ setIoError(null);
4204
+ setLastIoAction(null);
4098
4205
  setStatusTip("");
4099
- }, [open, workbook, features.datasetBinding, templateService, ioService, ioAdapter]);
4206
+ }, [open, tab, workbook, features.datasetBinding, templateService, ioService]);
4207
+ (0, import_react4.useEffect)(() => {
4208
+ if (!open || userTouchedTargetRef.current) return;
4209
+ const caps = ioService.getIoCapabilities();
4210
+ const op = tab === "import" ? "import" : "export";
4211
+ const fmt = op === "import" ? selectedImportFile ? (0, import_univer_sheets4.inferSheetFileFormat)(selectedImportFile.name) : "xlsx" : exportFormat;
4212
+ const nextDefault = caps.formats[op]?.[fmt]?.defaultTarget ?? caps.recommendedDefaultTarget;
4213
+ setIoTarget(nextDefault);
4214
+ }, [open, tab, exportFormat, selectedImportFile, ioAdapter, defaultIoTargetPref, ioService]);
4100
4215
  if (!open || !workbook) return null;
4101
4216
  const ioCaps = ioService.getIoCapabilities();
4102
4217
  const isCustomBackendAdapter = Boolean(
@@ -4104,6 +4219,12 @@ var SheetPreviewAndIoModal = () => {
4104
4219
  );
4105
4220
  const exportCapReport = (0, import_univer_sheets4.inspectWorkbookExportCapabilities)(workbook.save());
4106
4221
  const snapSizeKb = (exportCapReport.snapshotByteSize / 1024).toFixed(1);
4222
+ const activeIoOp = tab === "import" ? "import" : "export";
4223
+ const activeIoFormat = activeIoOp === "import" ? selectedImportFile ? (0, import_univer_sheets4.inferSheetFileFormat)(selectedImportFile.name) : "xlsx" : exportFormat;
4224
+ const activeFormatCap = ioCaps.formats[activeIoOp]?.[activeIoFormat];
4225
+ const browserAvailabilityLabel = (activeFormatCap ? activeFormatCap.browser : true) ? "\u53EF\u7528" : "\u4E0D\u652F\u6301\u5F53\u524D\u683C\u5F0F";
4226
+ const serverHasOpHook = activeIoOp === "import" ? ioCaps.server.importSheet : ioCaps.server.exportSheet;
4227
+ const serverAvailabilityLabel = !serverHasOpHook ? "\u672A\u63A5\u5165" : activeFormatCap && !activeFormatCap.server ? "\u4E0D\u652F\u6301\u5F53\u524D\u683C\u5F0F" : "\u53EF\u7528";
4107
4228
  const queryParamFields = templateService.getQueryParamFields(workbook.getUnitId());
4108
4229
  const rebuildPreview = (nextCfg, nextPaging, nextQueryVals) => {
4109
4230
  try {
@@ -4178,7 +4299,28 @@ var SheetPreviewAndIoModal = () => {
4178
4299
  );
4179
4300
  setStatusTip("\u5DF2\u6839\u636E\u6A21\u677F\u5360\u4F4D\u7B26\u81EA\u52A8\u751F\u6210\u7C7B\u578B\u5316\u6A21\u62DF\u6570\u636E\u96C6");
4180
4301
  };
4181
- const handleDownload = async (format) => {
4302
+ const triggerBrowserBlobDownload = (blob, downloadFileName) => {
4303
+ if (typeof URL === "undefined" || typeof URL.createObjectURL !== "function") {
4304
+ return;
4305
+ }
4306
+ const url = URL.createObjectURL(blob);
4307
+ if (typeof document !== "undefined") {
4308
+ const a = document.createElement("a");
4309
+ a.href = url;
4310
+ a.download = downloadFileName;
4311
+ a.click();
4312
+ }
4313
+ setTimeout(() => {
4314
+ if (typeof URL.revokeObjectURL === "function") {
4315
+ URL.revokeObjectURL(url);
4316
+ }
4317
+ }, 1e3);
4318
+ };
4319
+ const handleDownload = async (format, targetOverride) => {
4320
+ const effectiveTarget = targetOverride ?? ioTarget;
4321
+ setExportFormat(format);
4322
+ setLastIoAction({ kind: "export", format });
4323
+ setIoError(null);
4182
4324
  try {
4183
4325
  const unitId = workbook.getUnitId();
4184
4326
  const rawParsedData = format !== "xml" && features.datasetBinding && !skipDatasetOnExport ? JSON.parse(datasetText) : void 0;
@@ -4192,71 +4334,120 @@ var SheetPreviewAndIoModal = () => {
4192
4334
  printConfig: printCfg,
4193
4335
  metadata: templateService.getTemplateMetadata(unitId),
4194
4336
  implicitExpand: templateService.getImplicitExpand(unitId),
4195
- target: ioTarget
4337
+ target: effectiveTarget
4196
4338
  });
4197
- const mime = format === "xlsx" ? "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" : format === "xls" ? "application/vnd.ms-excel" : format === "pdf" ? "application/pdf" : format === "docx" ? "application/vnd.openxmlformats-officedocument.wordprocessingml.document" : format === "xml" ? "application/xml;charset=utf-8" : format === "html" ? "text/html;charset=utf-8" : "text/csv;charset=utf-8";
4339
+ const mime = format === "xlsx" ? "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" : format === "xls" ? "application/vnd.ms-excel" : format === "pdf" ? "application/pdf" : format === "docx" ? "application/vnd.openxmlformats-officedocument.wordprocessingml.document" : format === "xml" ? "application/xml;charset=utf-8" : format === "html" ? "text/html;charset=utf-8" : format === "json" ? "application/json;charset=utf-8" : "text/csv;charset=utf-8";
4198
4340
  const blob = new Blob([bytes.buffer], { type: mime });
4199
- const url = URL.createObjectURL(blob);
4200
- const a = document.createElement("a");
4201
- a.href = url;
4202
4341
  const ext = format === "xml" ? "report.xml" : format;
4203
- a.download = `${workbook.name || "workbook"}.${ext}`;
4204
- a.click();
4205
- setTimeout(() => URL.revokeObjectURL(url), 1e3);
4206
- const channelLabel = ioTarget === "server" ? `\u670D\u52A1\u7AEF (${ioAdapter.name})` : "\u6D4F\u89C8\u5668\u672C\u5730\u5F15\u64CE";
4342
+ triggerBrowserBlobDownload(blob, `${workbook.name || "workbook"}.${ext}`);
4343
+ const channelLabel = effectiveTarget === "server" ? `\u670D\u52A1\u7AEF (${ioAdapter.name})` : "\u6D4F\u89C8\u5668\u672C\u5730\u5F15\u64CE";
4207
4344
  setStatusTip(`\u5DF2\u901A\u8FC7 ${channelLabel} \u5BFC\u51FA .${ext} \u6587\u4EF6`);
4208
4345
  } catch (err) {
4209
- const hint = err?.suggestedFallback === "server" ? "\uFF08\u672A\u81EA\u52A8\u9759\u9ED8\u964D\u7EA7\uFF0C\u53EF\u5207\u6362\u4E3A\u300C\u670D\u52A1\u7AEF\u5904\u7406\u300D\u91CD\u8BD5\uFF09" : "";
4210
- setStatusTip(`\u5BFC\u51FA\u5931\u8D25: ${err?.message || String(err)}${hint}`);
4346
+ const exactMessage = err?.message || String(err);
4347
+ setIoError(exactMessage);
4348
+ setStatusTip(`\u5BFC\u51FA\u5931\u8D25: ${exactMessage}`);
4211
4349
  }
4212
4350
  };
4213
- const handleImportBySelectedTarget = () => {
4214
- const input = document.createElement("input");
4215
- input.type = "file";
4216
- input.accept = ".xlsx,.xls,.xml,.csv,.json";
4217
- input.onchange = async () => {
4218
- const file = input.files?.[0];
4219
- if (!file) return;
4220
- setImportWarnings([]);
4221
- try {
4222
- const unitId = workbook.getUnitId();
4223
- const outcome = await ioService.importSheetWithReport(file, {
4224
- unitId,
4225
- target: ioTarget
4226
- });
4227
- const imported = outcome.workbookData;
4228
- const prevMeta = templateService.getTemplateMetadata(unitId);
4229
- const xmlMeta = imported.__templateMetadata ?? {};
4230
- const nextMeta = { ...prevMeta, ...xmlMeta };
4231
- commandService.syncExecuteCommand(import_univer_sheets4.ApplyImportedWorkbookDataCommand.id, {
4232
- unitId,
4233
- workbookData: imported,
4234
- metadata: nextMeta
4235
- });
4236
- if (nextMeta.printConfig) {
4237
- setPrintCfg((prev) => ({ ...prev, ...nextMeta.printConfig }));
4238
- }
4239
- setImportWarnings(outcome.warnings.map((w) => w.message));
4240
- setJsonText(JSON.stringify(workbook.save(), null, 2));
4241
- setPreviewHtml(
4242
- renderPreviewSnapshotHtml(
4243
- workbook.save(),
4244
- void 0,
4245
- { ...printCfg, ...nextMeta.printConfig ?? {} },
4246
- paginationEnabled,
4247
- pageIndex,
4248
- pageSize
4249
- )
4250
- );
4251
- setStatusTip(
4252
- `\u5DF2\u901A\u8FC7 ${outcome.executedBy === "server" ? "\u670D\u52A1\u7AEF\u5904\u7406" : "\u6D4F\u89C8\u5668\u5904\u7406"} \u5BFC\u5165\u300C${file.name}\u300D\uFF08\u672A\u843D\u5E93\uFF0C\u70B9\u4FDD\u5B58\u751F\u6548\uFF09`
4253
- );
4254
- } catch (err) {
4255
- const hint = err?.suggestedFallback === "server" ? "\uFF08\u672A\u9759\u9ED8\u964D\u7EA7\uFF0C\u5EFA\u8BAE\u6539\u9009\u300C\u670D\u52A1\u7AEF\u5904\u7406\u300D\u91CD\u8BD5\uFF09" : "";
4256
- setStatusTip(`\u5BFC\u5165\u5931\u8D25: ${err?.message || String(err)}${hint}`);
4257
- }
4351
+ const runStagedImport = async (file, targetOverride) => {
4352
+ const effectiveTarget = targetOverride ?? ioTarget;
4353
+ setSelectedImportFile(file);
4354
+ setLastIoAction({ kind: "import", file });
4355
+ setIoError(null);
4356
+ setPendingImport(null);
4357
+ try {
4358
+ const unitId = workbook.getUnitId();
4359
+ const outcome = await ioService.importSheetWithReport(file, {
4360
+ unitId,
4361
+ target: effectiveTarget
4362
+ });
4363
+ const snapshot = outcome.snapshot ?? outcome.workbookData;
4364
+ setPendingImport({
4365
+ snapshot,
4366
+ warnings: outcome.warnings,
4367
+ executedBy: outcome.executedBy,
4368
+ fileName: outcome.fileName || file.name
4369
+ });
4370
+ setStatusTip(
4371
+ `\u5DF2\u901A\u8FC7${outcome.executedBy === "server" ? "\u670D\u52A1\u7AEF\u5904\u7406" : "\u6D4F\u89C8\u5668\u5904\u7406"}\u5B8C\u6210\u89E3\u6790\u300C${outcome.fileName || file.name}\u300D\uFF0C\u8BF7\u786E\u8BA4\u540E\u5E94\u7528\u5230\u8BBE\u8BA1\u5668`
4372
+ );
4373
+ } catch (err) {
4374
+ const exactMessage = err?.message || String(err);
4375
+ setIoError(exactMessage);
4376
+ setStatusTip(`\u5BFC\u5165\u5931\u8D25: ${exactMessage}`);
4377
+ }
4378
+ };
4379
+ const handleFileInputChange = (e) => {
4380
+ const file = e.target.files?.[0];
4381
+ if (e.target) {
4382
+ e.target.value = "";
4383
+ }
4384
+ if (!file) return;
4385
+ void runStagedImport(file);
4386
+ };
4387
+ const handleConfirmStagedImport = () => {
4388
+ if (!pendingImport) return;
4389
+ const unitId = workbook.getUnitId();
4390
+ const imported = pendingImport.snapshot;
4391
+ const prevMeta = templateService.getTemplateMetadata(unitId);
4392
+ const xmlMeta = imported.__templateMetadata ?? {};
4393
+ const mergedBase = mergeImportedTemplateMetadata(prevMeta, xmlMeta);
4394
+ const nextMeta = {
4395
+ ...mergedBase,
4396
+ ...imported.definedNames ? { definedNames: imported.definedNames } : {},
4397
+ ...typeof imported.workbookStructureLocked === "boolean" ? { workbookStructureLocked: imported.workbookStructureLocked } : {},
4398
+ ...imported.conditionalRules ? { conditionalRules: imported.conditionalRules } : {},
4399
+ ...imported.cellNotes ? { cellNotes: imported.cellNotes } : {}
4258
4400
  };
4259
- input.click();
4401
+ commandService.syncExecuteCommand(import_univer_sheets4.ApplyImportedWorkbookDataCommand.id, {
4402
+ unitId,
4403
+ workbookData: imported,
4404
+ metadata: nextMeta
4405
+ });
4406
+ const effectivePrintCfg = nextMeta.printConfig ? { ...printCfg, ...nextMeta.printConfig } : printCfg;
4407
+ if (nextMeta.printConfig) {
4408
+ setPrintCfg(effectivePrintCfg);
4409
+ }
4410
+ setPendingImport(null);
4411
+ setIoError(null);
4412
+ setJsonText(JSON.stringify(workbook.save(), null, 2));
4413
+ setPreviewHtml(
4414
+ renderPreviewSnapshotHtml(
4415
+ workbook.save(),
4416
+ void 0,
4417
+ effectivePrintCfg,
4418
+ paginationEnabled,
4419
+ pageIndex,
4420
+ pageSize
4421
+ )
4422
+ );
4423
+ setStatusTip("\u5DF2\u5E94\u7528\u5230\u5F53\u524D\u8BBE\u8BA1\u5668\uFF08\u672A\u843D\u5E93\uFF0C\u8BF7\u4F7F\u7528\u4FDD\u5B58\u64CD\u4F5C\u6301\u4E45\u5316\uFF09");
4424
+ };
4425
+ const handleCancelStagedImport = () => {
4426
+ setPendingImport(null);
4427
+ setIoError(null);
4428
+ setStatusTip("\u5DF2\u53D6\u6D88\u672C\u6B21\u5BFC\u5165\uFF0C\u5F53\u524D\u5DE5\u4F5C\u7C3F\u672A\u53D1\u751F\u53D8\u66F4");
4429
+ };
4430
+ const handleSwitchTargetAndRetry = () => {
4431
+ const nextTarget = ioTarget === "server" ? "browser" : "server";
4432
+ userTouchedTargetRef.current = true;
4433
+ setIoTarget(nextTarget);
4434
+ setIoError(null);
4435
+ if (lastIoAction?.kind === "import") {
4436
+ const retryFile = lastIoAction.file ?? selectedImportFile;
4437
+ if (retryFile) {
4438
+ void runStagedImport(retryFile, nextTarget);
4439
+ }
4440
+ return;
4441
+ }
4442
+ if (lastIoAction?.kind === "export") {
4443
+ void handleDownload(lastIoAction.format, nextTarget);
4444
+ return;
4445
+ }
4446
+ if (selectedImportFile && tab === "import") {
4447
+ void runStagedImport(selectedImportFile, nextTarget);
4448
+ return;
4449
+ }
4450
+ void handleDownload(exportFormat, nextTarget);
4260
4451
  };
4261
4452
  const handleExportReportPackage = () => {
4262
4453
  try {
@@ -4266,12 +4457,7 @@ var SheetPreviewAndIoModal = () => {
4266
4457
  templateService.getTemplateMetadata(unitId)
4267
4458
  );
4268
4459
  const blob = new Blob([json], { type: "application/json;charset=utf-8" });
4269
- const url = URL.createObjectURL(blob);
4270
- const a = document.createElement("a");
4271
- a.href = url;
4272
- a.download = `${workbook.name || "report"}.yudao-sheet.json`;
4273
- a.click();
4274
- setTimeout(() => URL.revokeObjectURL(url), 1e3);
4460
+ triggerBrowserBlobDownload(blob, `${workbook.name || "report"}.yudao-sheet.json`);
4275
4461
  setStatusTip("\u5DF2\u5BFC\u51FA\u5B8C\u6574\u62A5\u8868\u8FC1\u79FB\u5305 (.yudao-sheet.json)");
4276
4462
  } catch (err) {
4277
4463
  setStatusTip(`\u5BFC\u51FA\u8FC1\u79FB\u5305\u5931\u8D25: ${err?.message || String(err)}`);
@@ -4337,1096 +4523,1263 @@ var SheetPreviewAndIoModal = () => {
4337
4523
  setStatusTip("\u5DF2\u5524\u8D77\u6D4F\u89C8\u5668\u77E2\u91CF\u6253\u5370\u5E76\u89E6\u53D1 onAfterPrint / onSheetPrintConfirmed \u6253\u5370\u5B8C\u6210\u56DE\u8C03");
4338
4524
  }
4339
4525
  };
4340
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "yudao-sheet-modal-backdrop", onClick: handleCloseModal, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "yudao-sheet-modal-card", onClick: (e) => e.stopPropagation(), children: [
4341
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "yudao-sheet-modal-header", children: [
4342
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "yudao-sheet-modal-tabs", children: [
4343
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4344
- "button",
4345
- {
4346
- type: "button",
4347
- className: `yudao-sheet-modal-tab ${tab === "export" ? "is-active" : ""}`,
4348
- onClick: () => featureService.setModalTab("export"),
4349
- children: t("yudaoSheets.modal.tabExport")
4350
- }
4351
- ),
4352
- features.printTemplate && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4353
- "button",
4354
- {
4355
- type: "button",
4356
- className: `yudao-sheet-modal-tab ${tab === "print" ? "is-active" : ""}`,
4357
- onClick: () => featureService.setModalTab("print"),
4358
- children: t("yudaoSheets.modal.tabPrint")
4359
- }
4360
- ),
4361
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4362
- "button",
4363
- {
4364
- type: "button",
4365
- className: `yudao-sheet-modal-tab ${tab === "json" ? "is-active" : ""}`,
4366
- onClick: () => featureService.setModalTab("json"),
4367
- children: t("yudaoSheets.modal.tabJson")
4368
- }
4369
- )
4370
- ] }),
4371
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [
4372
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4373
- "span",
4374
- {
4375
- style: {
4376
- fontSize: 11,
4377
- padding: "3px 8px",
4378
- borderRadius: 999,
4379
- background: isCustomBackendAdapter ? "#F3F5FF" : "#EEEFF1",
4380
- color: isCustomBackendAdapter ? "#2C53F1" : "#4E5565",
4381
- border: `1px solid ${isCustomBackendAdapter ? "#D2DAFA" : "transparent"}`,
4382
- fontWeight: 500
4383
- },
4384
- children: [
4385
- t("yudaoSheets.modal.ioPipelinePrefix"),
4386
- ": ",
4387
- ioAdapter.name || "frontend-default"
4388
- ]
4389
- }
4390
- ),
4391
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4392
- "button",
4393
- {
4394
- type: "button",
4395
- className: "yudao-sheet-btn",
4396
- onClick: handleCloseModal,
4397
- children: "\xD7"
4398
- }
4399
- )
4400
- ] })
4401
- ] }),
4402
- tab === "export" || tab === "print" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex" }, children: [
4403
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4404
- "div",
4405
- {
4406
- style: {
4407
- width: tab === "export" && features.datasetBinding ? 330 : 305,
4408
- borderRight: "1px solid #E3E5EA",
4409
- padding: 14,
4410
- display: "flex",
4411
- flexDirection: "column",
4412
- gap: 8,
4413
- background: "#F9FAFB",
4414
- overflowY: "auto"
4415
- },
4416
- children: [
4417
- tab === "export" ? features.datasetBinding ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
4418
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 12, fontWeight: 600, color: "#1B1C1F" }, children: "\u6D4B\u8BD5\u6570\u636E\u96C6 JSON\uFF08\u652F\u6301\u5E76\u6392\u5206\u533A\u3001\u4E3B\u5B50\u5757\u3001\u5E73\u94FA\u5361\u7247\u4E0E\u516C\u5F0F\u91CD\u5199\uFF09" }),
4419
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4420
- "textarea",
4421
- {
4422
- className: "yudao-sheet-code-area",
4423
- value: datasetText,
4424
- onChange: (e) => setDatasetText(e.target.value)
4425
- }
4426
- ),
4427
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
4428
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "yudao-sheet-btn", onClick: () => rebuildPreview(), children: t("yudaoSheets.modal.refreshPreviewBtn") }),
4429
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "yudao-sheet-btn", onClick: handleGenerateMockDataset, children: t("yudaoSheets.modal.mockDatasetBtn") }),
4430
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "yudao-sheet-btn", onClick: handleApplyToSheet, children: t("yudaoSheets.modal.applyToSheetBtn") })
4431
- ] })
4432
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { fontSize: 12, color: "#4E5565", lineHeight: 1.6 }, children: [
4433
- "\u5F53\u524D\u5904\u4E8E\u7EAF\u51C0\u7535\u5B50\u8868\u683C\u6A21\u5F0F\u3002\u5185\u7F6E\u96F6\u5916\u90E8\u4F9D\u8D56\u7684 OOXML \u4E0E\u77E2\u91CF PDF \u5F15\u64CE\uFF0C\u53EF\u76F4\u63A5\u5BFC\u51FA\u4FDD\u7559\u516C\u5F0F\u3001\u5408\u5E76\u5355\u5143\u683C\u3001\u5B57\u4F53\u989C\u8272\u4E0E\u8FB9\u6846\u7684\u6807\u51C6",
4434
- " ",
4435
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: ".xlsx" }),
4436
- " \u4E0E ",
4437
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: ".pdf" }),
4438
- " \u6587\u4EF6\u3002"
4439
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
4440
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 12, fontWeight: 600, color: "#1B1C1F" }, children: "\u6253\u5370\u7EB8\u5F20\u3001\u7F29\u653E\u6A21\u5F0F\u3001\u7269\u7406\u5957\u6253\u4E0E\u9875\u7801\u914D\u7F6E" }),
4441
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
4442
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4443
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u7EB8\u5F20\u4E0E\u9488\u5F0F\u7968\u636E\u89C4\u683C" }),
4444
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4445
- "select",
4446
- {
4447
- value: printCfg.paperOrientation,
4448
- onChange: (e) => {
4449
- const next = {
4450
- ...printCfg,
4451
- paperOrientation: e.target.value
4452
- };
4453
- setPrintCfg(next);
4454
- rebuildPreview(next);
4455
- },
4456
- children: [
4457
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "A4_LANDSCAPE", children: "A4 \u6A2A\u5411" }),
4458
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "A4_PORTRAIT", children: "A4 \u7EB5\u5411" }),
4459
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "A3_LANDSCAPE", children: "A3 \u6A2A\u5411" }),
4460
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "INVOICE_240_140", children: "240\xD7140mm \u4E8C\u7B49\u5206" }),
4461
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "INVOICE_240_93", children: "240\xD793mm \u4E09\u7B49\u5206" })
4462
- ]
4463
- }
4464
- )
4465
- ] }),
4466
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4467
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u6253\u5370/PDF \u7F29\u653E\u6A21\u5F0F" }),
4468
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4469
- "select",
4470
- {
4471
- value: printCfg.scaleMode ?? "all",
4472
- onChange: (e) => {
4473
- const next = {
4474
- ...printCfg,
4475
- scaleMode: e.target.value
4476
- };
4477
- setPrintCfg(next);
4478
- rebuildPreview(next);
4479
- },
4480
- children: [
4481
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "all", children: "\u6807\u51C6\u5206\u9875" }),
4482
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "fitWidth", children: "\u9002\u5E94\u9875\u5BBD" }),
4483
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "fitSinglePage", children: "\u7F29\u81F3\u4E00\u9875" }),
4484
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "currentPage", children: "\u5F53\u524D\u9875" })
4485
- ]
4486
- }
4487
- )
4488
- ] })
4489
- ] }),
4490
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
4491
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4492
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u91CD\u590D\u8868\u5934\u884C (thead)" }),
4493
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4494
- "input",
4495
- {
4496
- type: "number",
4497
- min: 0,
4498
- max: 20,
4499
- value: printCfg.repeatHeaderRow ?? 0,
4500
- onChange: (e) => {
4501
- const n = Number(e.target.value);
4502
- const next = { ...printCfg, repeatHeaderRow: n > 0 ? n : null };
4503
- setPrintCfg(next);
4504
- rebuildPreview(next);
4505
- }
4506
- }
4507
- )
4508
- ] }),
4509
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4510
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u91CD\u590D\u5C3E\u884C\u6570 (tfoot)" }),
4511
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4512
- "input",
4513
- {
4514
- type: "number",
4515
- min: 0,
4516
- max: 10,
4517
- value: printCfg.repeatFooterRows ?? 0,
4518
- onChange: (e) => {
4519
- const next = {
4520
- ...printCfg,
4521
- repeatFooterRows: Math.max(0, Number(e.target.value) || 0)
4522
- };
4523
- setPrintCfg(next);
4524
- rebuildPreview(next);
4525
- }
4526
- }
4527
- )
4528
- ] })
4529
- ] }),
4530
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: 6 }, children: [
4531
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4532
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u591A\u680F\u5217\u6570" }),
4533
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4534
- "input",
4535
- {
4536
- type: "number",
4537
- min: 1,
4538
- max: 4,
4539
- value: printCfg.multiColumnCount ?? 1,
4540
- onChange: (e) => {
4541
- const n = Math.max(1, Math.min(4, Number(e.target.value) || 1));
4542
- const next = {
4543
- ...printCfg,
4544
- multiColumnCount: n > 1 ? n : void 0
4545
- };
4546
- setPrintCfg(next);
4547
- rebuildPreview(next);
4548
- }
4549
- }
4550
- )
4551
- ] }),
4552
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4553
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u680F\u95F4\u8DDD (pt)" }),
4526
+ const stagedSheetSummary = pendingImport ? (() => {
4527
+ const sheetsObj = pendingImport.snapshot.sheets ?? {};
4528
+ const orderedIds = pendingImport.snapshot.sheetOrder && pendingImport.snapshot.sheetOrder.length > 0 ? pendingImport.snapshot.sheetOrder.filter((id) => Boolean(sheetsObj[id])) : Object.keys(sheetsObj);
4529
+ const names = orderedIds.map((id, idx) => sheetsObj[id]?.name || `Sheet${idx + 1}`);
4530
+ return { count: names.length, names };
4531
+ })() : null;
4532
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4533
+ "div",
4534
+ {
4535
+ className: "yudao-sheet-modal-backdrop",
4536
+ "data-testid": "yudao-io-modal",
4537
+ onClick: handleCloseModal,
4538
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "yudao-sheet-modal-card", onClick: (e) => e.stopPropagation(), children: [
4539
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "yudao-sheet-modal-header", children: [
4540
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "yudao-sheet-modal-tabs", children: [
4541
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4542
+ "button",
4543
+ {
4544
+ type: "button",
4545
+ className: `yudao-sheet-modal-tab ${tab === "import" ? "is-active" : ""}`,
4546
+ onClick: () => featureService.setModalTab("import"),
4547
+ children: t("yudaoSheets.modal.tabImport")
4548
+ }
4549
+ ),
4550
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4551
+ "button",
4552
+ {
4553
+ type: "button",
4554
+ className: `yudao-sheet-modal-tab ${tab === "export" ? "is-active" : ""}`,
4555
+ onClick: () => featureService.setModalTab("export"),
4556
+ children: t("yudaoSheets.modal.tabExport")
4557
+ }
4558
+ ),
4559
+ features.printTemplate && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4560
+ "button",
4561
+ {
4562
+ type: "button",
4563
+ className: `yudao-sheet-modal-tab ${tab === "print" ? "is-active" : ""}`,
4564
+ onClick: () => featureService.setModalTab("print"),
4565
+ children: t("yudaoSheets.modal.tabPrint")
4566
+ }
4567
+ ),
4568
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4569
+ "button",
4570
+ {
4571
+ type: "button",
4572
+ className: `yudao-sheet-modal-tab ${tab === "json" ? "is-active" : ""}`,
4573
+ onClick: () => featureService.setModalTab("json"),
4574
+ children: t("yudaoSheets.modal.tabJson")
4575
+ }
4576
+ )
4577
+ ] }),
4578
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [
4579
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4580
+ "span",
4581
+ {
4582
+ style: {
4583
+ fontSize: 11,
4584
+ padding: "3px 8px",
4585
+ borderRadius: 999,
4586
+ background: isCustomBackendAdapter ? "#F3F5FF" : "#EEEFF1",
4587
+ color: isCustomBackendAdapter ? "#2C53F1" : "#4E5565",
4588
+ border: `1px solid ${isCustomBackendAdapter ? "#D2DAFA" : "transparent"}`,
4589
+ fontWeight: 500
4590
+ },
4591
+ children: [
4592
+ t("yudaoSheets.modal.ioPipelinePrefix"),
4593
+ ": ",
4594
+ ioAdapter.name || "frontend-default"
4595
+ ]
4596
+ }
4597
+ ),
4598
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4599
+ "button",
4600
+ {
4601
+ type: "button",
4602
+ className: "yudao-sheet-btn",
4603
+ onClick: handleCloseModal,
4604
+ children: "\xD7"
4605
+ }
4606
+ )
4607
+ ] })
4608
+ ] }),
4609
+ tab === "import" || tab === "export" || tab === "print" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex" }, children: [
4610
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4611
+ "div",
4612
+ {
4613
+ style: {
4614
+ width: (tab === "export" || tab === "import") && features.datasetBinding ? 336 : 318,
4615
+ borderRight: "1px solid #E3E5EA",
4616
+ padding: 14,
4617
+ display: "flex",
4618
+ flexDirection: "column",
4619
+ gap: 8,
4620
+ background: "#F9FAFB",
4621
+ overflowY: "auto"
4622
+ },
4623
+ children: [
4624
+ tab === "import" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { fontSize: 12, color: "#4E5565", lineHeight: 1.55 }, children: [
4625
+ "\u652F\u6301\u9884\u68C0\u89E3\u6790\u672C\u5730\u6216\u670D\u52A1\u7AEF ",
4626
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: ".xlsx" }),
4627
+ " / ",
4628
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: ".xls" }),
4629
+ " / ",
4630
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: ".csv" }),
4631
+ " / ",
4632
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: ".xml" }),
4633
+ " / ",
4634
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: ".json" }),
4635
+ " \u6587\u4EF6\uFF0C\u786E\u8BA4\u517C\u5BB9\u6027\u62A5\u544A\u540E\u518D\u5E94\u7528\u81F3\u5F53\u524D\u8BBE\u8BA1\u5668\uFF0C\u907F\u514D\u8BEF\u8986\u76D6\u6B63\u5728\u7F16\u8F91\u7684\u5DE5\u4F5C\u7C3F\u3002"
4636
+ ] }) : tab === "export" ? features.datasetBinding ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
4637
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 12, fontWeight: 600, color: "#1B1C1F" }, children: "\u6D4B\u8BD5\u6570\u636E\u96C6 JSON\uFF08\u652F\u6301\u5E76\u6392\u5206\u533A\u3001\u4E3B\u5B50\u5757\u3001\u5E73\u94FA\u5361\u7247\u4E0E\u516C\u5F0F\u91CD\u5199\uFF09" }),
4554
4638
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4555
- "input",
4639
+ "textarea",
4556
4640
  {
4557
- type: "number",
4558
- min: 0,
4559
- max: 72,
4560
- value: printCfg.columnMarginPt ?? 12,
4561
- onChange: (e) => {
4562
- const next = {
4563
- ...printCfg,
4564
- columnMarginPt: Math.max(0, Number(e.target.value) || 0)
4565
- };
4566
- setPrintCfg(next);
4567
- rebuildPreview(next);
4568
- }
4641
+ className: "yudao-sheet-code-area",
4642
+ value: datasetText,
4643
+ onChange: (e) => setDatasetText(e.target.value)
4569
4644
  }
4570
- )
4571
- ] }),
4572
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4573
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u5B9A\u884C\u5206\u9875" }),
4574
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4575
- "input",
4576
- {
4577
- type: "number",
4578
- min: 0,
4579
- max: 200,
4580
- placeholder: "\u81EA\u52A8",
4581
- value: printCfg.fixedRowsPerPage ?? "",
4582
- onChange: (e) => {
4583
- const raw = e.target.value.trim();
4584
- const n = raw === "" ? 0 : Math.max(0, Number(raw) || 0);
4585
- const next = {
4586
- ...printCfg,
4587
- fixedRowsPerPage: n > 0 ? n : void 0
4588
- };
4589
- setPrintCfg(next);
4590
- rebuildPreview(next);
4591
- }
4592
- }
4593
- )
4594
- ] })
4595
- ] }),
4596
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
4597
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4598
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u7F16\u9875\u8D77\u59CB\u7269\u7406\u9875" }),
4599
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4600
- "input",
4601
- {
4602
- type: "number",
4603
- min: 1,
4604
- max: 99,
4605
- title: "\u5982\u8BBE\u4E3A 2 \u53EF\u8DF3\u8FC7\u7B2C 1 \u9875\u5C01\u9762\u4E0D\u7F16\u9875\u7801",
4606
- value: printCfg.pageNumberStartPage ?? 1,
4607
- onChange: (e) => {
4608
- const next = {
4609
- ...printCfg,
4610
- pageNumberStartPage: Math.max(1, Number(e.target.value) || 1)
4611
- };
4612
- setPrintCfg(next);
4613
- rebuildPreview(next);
4614
- }
4615
- }
4616
- )
4617
- ] }),
4618
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4619
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u9875\u7801\u5BF9\u9F50\u65B9\u5F0F" }),
4620
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4621
- "select",
4622
- {
4623
- value: printCfg.pageNumberAlign ?? "right",
4624
- onChange: (e) => {
4625
- const next = {
4626
- ...printCfg,
4627
- pageNumberAlign: e.target.value
4628
- };
4629
- setPrintCfg(next);
4630
- rebuildPreview(next);
4631
- },
4632
- children: [
4633
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "left", children: "\u5C45\u5DE6" }),
4634
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "center", children: "\u5C45\u4E2D" }),
4635
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "right", children: "\u5C45\u53F3" })
4636
- ]
4637
- }
4638
- )
4639
- ] })
4640
- ] }),
4641
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4642
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u6253\u5370\u9875\u7709\u6807\u9898" }),
4643
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4644
- "input",
4645
- {
4646
- type: "text",
4647
- value: printCfg.headerTitle,
4648
- onChange: (e) => {
4649
- const next = { ...printCfg, headerTitle: e.target.value };
4650
- setPrintCfg(next);
4651
- rebuildPreview(next);
4652
- }
4653
- }
4654
- )
4655
- ] }),
4656
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: 4 }, children: [
4657
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4658
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u9875\u7709\u5DE6 (&D/&F)" }),
4659
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4660
- "input",
4661
- {
4662
- type: "text",
4663
- placeholder: "\u5982 &D",
4664
- value: printCfg.headerLeft ?? "",
4665
- onChange: (e) => {
4666
- const next = { ...printCfg, headerLeft: e.target.value };
4667
- setPrintCfg(next);
4668
- rebuildPreview(next);
4669
- }
4670
- }
4671
- )
4672
- ] }),
4673
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4674
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u9875\u7709\u4E2D" }),
4675
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4676
- "input",
4677
- {
4678
- type: "text",
4679
- placeholder: "\u5982 &A",
4680
- value: printCfg.headerCenter ?? "",
4681
- onChange: (e) => {
4682
- const next = { ...printCfg, headerCenter: e.target.value };
4683
- setPrintCfg(next);
4684
- rebuildPreview(next);
4685
- }
4686
- }
4687
- )
4688
- ] }),
4689
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4690
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u9875\u7709\u53F3 (&P/&N)" }),
4691
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4692
- "input",
4693
- {
4694
- type: "text",
4695
- placeholder: "\u5982 \u7B2C&P/&N\u9875",
4696
- value: printCfg.headerRight ?? "",
4697
- onChange: (e) => {
4698
- const next = { ...printCfg, headerRight: e.target.value };
4699
- setPrintCfg(next);
4700
- rebuildPreview(next);
4701
- }
4702
- }
4703
- )
4704
- ] })
4705
- ] }),
4706
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: 4 }, children: [
4707
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4708
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u9875\u811A\u5DE6" }),
4709
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4710
- "input",
4711
- {
4712
- type: "text",
4713
- placeholder: "\u5236\u8868\u90E8\u95E8",
4714
- value: printCfg.footerLeft ?? "",
4715
- onChange: (e) => {
4716
- const next = { ...printCfg, footerLeft: e.target.value };
4717
- setPrintCfg(next);
4718
- rebuildPreview(next);
4719
- }
4720
- }
4721
- )
4722
- ] }),
4723
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4724
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u9875\u811A\u4E2D" }),
4725
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4726
- "input",
4727
- {
4728
- type: "text",
4729
- placeholder: "&F",
4730
- value: printCfg.footerCenter ?? "",
4731
- onChange: (e) => {
4732
- const next = { ...printCfg, footerCenter: e.target.value };
4733
- setPrintCfg(next);
4734
- rebuildPreview(next);
4735
- }
4736
- }
4737
- )
4738
- ] }),
4739
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4740
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u9875\u811A\u53F3" }),
4741
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4742
- "input",
4743
- {
4744
- type: "text",
4745
- placeholder: "#[PAGE]/#[PAGES]",
4746
- value: printCfg.footerRight ?? "",
4747
- onChange: (e) => {
4748
- const next = { ...printCfg, footerRight: e.target.value };
4749
- setPrintCfg(next);
4750
- rebuildPreview(next);
4645
+ ),
4646
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
4647
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "yudao-sheet-btn", onClick: () => rebuildPreview(), children: t("yudaoSheets.modal.refreshPreviewBtn") }),
4648
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "yudao-sheet-btn", onClick: handleGenerateMockDataset, children: t("yudaoSheets.modal.mockDatasetBtn") }),
4649
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "yudao-sheet-btn", onClick: handleApplyToSheet, children: t("yudaoSheets.modal.applyToSheetBtn") })
4650
+ ] })
4651
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { fontSize: 12, color: "#4E5565", lineHeight: 1.6 }, children: [
4652
+ "\u5F53\u524D\u5904\u4E8E\u7EAF\u51C0\u7535\u5B50\u8868\u683C\u6A21\u5F0F\u3002\u5185\u7F6E\u96F6\u5916\u90E8\u4F9D\u8D56\u7684 OOXML \u4E0E\u77E2\u91CF PDF \u5F15\u64CE\uFF0C\u53EF\u76F4\u63A5\u5BFC\u51FA\u4FDD\u7559\u516C\u5F0F\u3001\u5408\u5E76\u5355\u5143\u683C\u3001\u5B57\u4F53\u989C\u8272\u4E0E\u8FB9\u6846\u7684\u6807\u51C6",
4653
+ " ",
4654
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: ".xlsx" }),
4655
+ " \u4E0E ",
4656
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: ".pdf" }),
4657
+ " \u6587\u4EF6\u3002"
4658
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
4659
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 12, fontWeight: 600, color: "#1B1C1F" }, children: "\u6253\u5370\u7EB8\u5F20\u3001\u7F29\u653E\u6A21\u5F0F\u3001\u7269\u7406\u5957\u6253\u4E0E\u9875\u7801\u914D\u7F6E" }),
4660
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
4661
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4662
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u7EB8\u5F20\u4E0E\u9488\u5F0F\u7968\u636E\u89C4\u683C" }),
4663
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4664
+ "select",
4665
+ {
4666
+ value: printCfg.paperOrientation,
4667
+ onChange: (e) => {
4668
+ const next = {
4669
+ ...printCfg,
4670
+ paperOrientation: e.target.value
4671
+ };
4672
+ setPrintCfg(next);
4673
+ rebuildPreview(next);
4674
+ },
4675
+ children: [
4676
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "A4_LANDSCAPE", children: "A4 \u6A2A\u5411" }),
4677
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "A4_PORTRAIT", children: "A4 \u7EB5\u5411" }),
4678
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "A3_LANDSCAPE", children: "A3 \u6A2A\u5411" }),
4679
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "INVOICE_240_140", children: "240\xD7140mm \u4E8C\u7B49\u5206" }),
4680
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "INVOICE_240_93", children: "240\xD793mm \u4E09\u7B49\u5206" })
4681
+ ]
4682
+ }
4683
+ )
4684
+ ] }),
4685
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4686
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u6253\u5370/PDF \u7F29\u653E\u6A21\u5F0F" }),
4687
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4688
+ "select",
4689
+ {
4690
+ value: printCfg.scaleMode ?? "all",
4691
+ onChange: (e) => {
4692
+ const next = {
4693
+ ...printCfg,
4694
+ scaleMode: e.target.value
4695
+ };
4696
+ setPrintCfg(next);
4697
+ rebuildPreview(next);
4698
+ },
4699
+ children: [
4700
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "all", children: "\u6807\u51C6\u5206\u9875" }),
4701
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "fitWidth", children: "\u9002\u5E94\u9875\u5BBD" }),
4702
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "fitSinglePage", children: "\u7F29\u81F3\u4E00\u9875" }),
4703
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "currentPage", children: "\u5F53\u524D\u9875" })
4704
+ ]
4705
+ }
4706
+ )
4707
+ ] })
4708
+ ] }),
4709
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
4710
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4711
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u91CD\u590D\u8868\u5934\u884C (thead)" }),
4712
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4713
+ "input",
4714
+ {
4715
+ type: "number",
4716
+ min: 0,
4717
+ max: 20,
4718
+ value: printCfg.repeatHeaderRow ?? 0,
4719
+ onChange: (e) => {
4720
+ const n = Number(e.target.value);
4721
+ const next = { ...printCfg, repeatHeaderRow: n > 0 ? n : null };
4722
+ setPrintCfg(next);
4723
+ rebuildPreview(next);
4724
+ }
4725
+ }
4726
+ )
4727
+ ] }),
4728
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4729
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u91CD\u590D\u5C3E\u884C\u6570 (tfoot)" }),
4730
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4731
+ "input",
4732
+ {
4733
+ type: "number",
4734
+ min: 0,
4735
+ max: 10,
4736
+ value: printCfg.repeatFooterRows ?? 0,
4737
+ onChange: (e) => {
4738
+ const next = {
4739
+ ...printCfg,
4740
+ repeatFooterRows: Math.max(0, Number(e.target.value) || 0)
4741
+ };
4742
+ setPrintCfg(next);
4743
+ rebuildPreview(next);
4744
+ }
4745
+ }
4746
+ )
4747
+ ] })
4748
+ ] }),
4749
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: 6 }, children: [
4750
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4751
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u591A\u680F\u5217\u6570" }),
4752
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4753
+ "input",
4754
+ {
4755
+ type: "number",
4756
+ min: 1,
4757
+ max: 4,
4758
+ value: printCfg.multiColumnCount ?? 1,
4759
+ onChange: (e) => {
4760
+ const n = Math.max(1, Math.min(4, Number(e.target.value) || 1));
4761
+ const next = {
4762
+ ...printCfg,
4763
+ multiColumnCount: n > 1 ? n : void 0
4764
+ };
4765
+ setPrintCfg(next);
4766
+ rebuildPreview(next);
4767
+ }
4768
+ }
4769
+ )
4770
+ ] }),
4771
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4772
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u680F\u95F4\u8DDD (pt)" }),
4773
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4774
+ "input",
4775
+ {
4776
+ type: "number",
4777
+ min: 0,
4778
+ max: 72,
4779
+ value: printCfg.columnMarginPt ?? 12,
4780
+ onChange: (e) => {
4781
+ const next = {
4782
+ ...printCfg,
4783
+ columnMarginPt: Math.max(0, Number(e.target.value) || 0)
4784
+ };
4785
+ setPrintCfg(next);
4786
+ rebuildPreview(next);
4787
+ }
4788
+ }
4789
+ )
4790
+ ] }),
4791
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4792
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u5B9A\u884C\u5206\u9875" }),
4793
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4794
+ "input",
4795
+ {
4796
+ type: "number",
4797
+ min: 0,
4798
+ max: 200,
4799
+ placeholder: "\u81EA\u52A8",
4800
+ value: printCfg.fixedRowsPerPage ?? "",
4801
+ onChange: (e) => {
4802
+ const raw = e.target.value.trim();
4803
+ const n = raw === "" ? 0 : Math.max(0, Number(raw) || 0);
4804
+ const next = {
4805
+ ...printCfg,
4806
+ fixedRowsPerPage: n > 0 ? n : void 0
4807
+ };
4808
+ setPrintCfg(next);
4809
+ rebuildPreview(next);
4810
+ }
4811
+ }
4812
+ )
4813
+ ] })
4814
+ ] }),
4815
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
4816
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4817
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u7F16\u9875\u8D77\u59CB\u7269\u7406\u9875" }),
4818
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4819
+ "input",
4820
+ {
4821
+ type: "number",
4822
+ min: 1,
4823
+ max: 99,
4824
+ title: "\u5982\u8BBE\u4E3A 2 \u53EF\u8DF3\u8FC7\u7B2C 1 \u9875\u5C01\u9762\u4E0D\u7F16\u9875\u7801",
4825
+ value: printCfg.pageNumberStartPage ?? 1,
4826
+ onChange: (e) => {
4827
+ const next = {
4828
+ ...printCfg,
4829
+ pageNumberStartPage: Math.max(1, Number(e.target.value) || 1)
4830
+ };
4831
+ setPrintCfg(next);
4832
+ rebuildPreview(next);
4833
+ }
4834
+ }
4835
+ )
4836
+ ] }),
4837
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4838
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u9875\u7801\u5BF9\u9F50\u65B9\u5F0F" }),
4839
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4840
+ "select",
4841
+ {
4842
+ value: printCfg.pageNumberAlign ?? "right",
4843
+ onChange: (e) => {
4844
+ const next = {
4845
+ ...printCfg,
4846
+ pageNumberAlign: e.target.value
4847
+ };
4848
+ setPrintCfg(next);
4849
+ rebuildPreview(next);
4850
+ },
4851
+ children: [
4852
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "left", children: "\u5C45\u5DE6" }),
4853
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "center", children: "\u5C45\u4E2D" }),
4854
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "right", children: "\u5C45\u53F3" })
4855
+ ]
4856
+ }
4857
+ )
4858
+ ] })
4859
+ ] }),
4860
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4861
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u6253\u5370\u9875\u7709\u6807\u9898" }),
4862
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4863
+ "input",
4864
+ {
4865
+ type: "text",
4866
+ value: printCfg.headerTitle,
4867
+ onChange: (e) => {
4868
+ const next = { ...printCfg, headerTitle: e.target.value };
4869
+ setPrintCfg(next);
4870
+ rebuildPreview(next);
4871
+ }
4751
4872
  }
4752
- }
4753
- )
4754
- ] })
4755
- ] }),
4756
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4757
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u659C\u5411\u9632\u4F2A\u5E73\u94FA\u6C34\u5370\u6587\u5B57" }),
4758
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4759
- "input",
4760
- {
4761
- type: "text",
4762
- placeholder: "\u5982\uFF1A\u4F01\u4E1A\u62A5\u8868 \xB7 \u5185\u90E8\u8D44\u6599",
4763
- value: printCfg.watermarkText ?? "",
4764
- onChange: (e) => {
4765
- const next = { ...printCfg, watermarkText: e.target.value };
4766
- setPrintCfg(next);
4767
- rebuildPreview(next);
4768
- }
4769
- }
4770
- )
4771
- ] }),
4772
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4773
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u7269\u7406\u5957\u6253\u6821\u51C6\u5E95\u56FE URL\uFF08\u53EF\u9009\uFF09" }),
4774
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4775
- "input",
4776
- {
4777
- type: "text",
4778
- placeholder: "\u8F93\u5165\u9884\u5370\u53D1\u7968/\u8BC1\u4E66\u626B\u63CF\u4EF6\u56FE\u7247 URL",
4779
- value: printCfg.overlayBackgroundUrl ?? "",
4780
- onChange: (e) => {
4781
- const next = { ...printCfg, overlayBackgroundUrl: e.target.value };
4782
- setPrintCfg(next);
4783
- rebuildPreview(next);
4784
- }
4785
- }
4786
- )
4787
- ] }),
4788
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 11.5 }, children: [
4789
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4790
- "input",
4791
- {
4792
- type: "checkbox",
4793
- checked: Boolean(printCfg.pinFooterToBottom),
4794
- onChange: (e) => {
4795
- const next = { ...printCfg, pinFooterToBottom: e.target.checked };
4796
- setPrintCfg(next);
4797
- rebuildPreview(next);
4798
- }
4799
- }
4800
- ),
4801
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u5C3E\u884C\u8D34\u5E95\u56FA\u5B9A\u6253\u5370 (pinFooterToBottom)" })
4802
- ] }),
4803
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 11.5 }, children: [
4804
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4805
- "input",
4806
- {
4807
- type: "checkbox",
4808
- checked: Boolean(printCfg.pageBreakAfterGroup),
4809
- onChange: (e) => {
4810
- const next = { ...printCfg, pageBreakAfterGroup: e.target.checked };
4811
- setPrintCfg(next);
4812
- rebuildPreview(next);
4813
- }
4814
- }
4815
- ),
4816
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u6309\u7EC4\u81EA\u52A8\u5206\u9875 (pageBreakAfterGroup)" })
4817
- ] }),
4818
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 11.5 }, children: [
4819
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4820
- "input",
4821
- {
4822
- type: "checkbox",
4823
- checked: printCfg.showPageNumbers !== false,
4824
- onChange: (e) => {
4825
- const next = { ...printCfg, showPageNumbers: e.target.checked };
4826
- setPrintCfg(next);
4827
- rebuildPreview(next);
4828
- }
4829
- }
4830
- ),
4831
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u663E\u793A\u9875\u7801 (showPageNumbers)" })
4832
- ] }),
4833
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 11.5 }, children: [
4834
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4835
- "input",
4836
- {
4837
- type: "checkbox",
4838
- checked: printCfg.excludeBackgroundOnPrint ?? true,
4839
- onChange: (e) => {
4840
- const next = { ...printCfg, excludeBackgroundOnPrint: e.target.checked };
4841
- setPrintCfg(next);
4842
- rebuildPreview(next);
4843
- }
4844
- }
4845
- ),
4846
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u5957\u6253\u6A21\u5F0F\uFF1A\u4EC5\u9884\u89C8\u53C2\u8003\u5E95\u56FE\uFF0C\u6253\u5370\u81EA\u52A8\u5265\u79BB\u5E95\u56FE" })
4847
- ] }),
4848
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 11.5 }, children: [
4849
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4850
- "input",
4851
- {
4852
- type: "checkbox",
4853
- checked: printCfg.showGridlines,
4854
- onChange: (e) => {
4855
- const next = { ...printCfg, showGridlines: e.target.checked };
4856
- setPrintCfg(next);
4857
- rebuildPreview(next);
4858
- }
4859
- }
4860
- ),
4861
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u663E\u793A\u7A7A\u767D\u5355\u5143\u683C\u8F85\u52A9\u7F51\u683C\u7EBF" })
4862
- ] }),
4863
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 11.5 }, children: [
4864
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4865
- "input",
4866
- {
4867
- type: "checkbox",
4868
- checked: Boolean(printCfg.wordFormStyle),
4869
- onChange: (e) => {
4870
- const next = { ...printCfg, wordFormStyle: e.target.checked };
4871
- setPrintCfg(next);
4872
- rebuildPreview(next);
4873
- }
4874
- }
4875
- ),
4876
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u7C7B Word \u65E0\u8FB9\u6846\u516C\u6587/\u8868\u5355\u98CE\u683C" })
4877
- ] })
4878
- ] }),
4879
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4880
- "div",
4881
- {
4882
- style: {
4883
- padding: "6px 8px",
4884
- background: "#FFFFFF",
4885
- border: "1px solid #E3E5EA",
4886
- borderRadius: 6,
4887
- display: "flex",
4888
- flexDirection: "column",
4889
- gap: 5
4890
- },
4891
- children: [
4892
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", fontSize: 11.5, cursor: "pointer" }, children: [
4893
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { display: "inline-flex", alignItems: "center", gap: 5, fontWeight: 600, color: "#1B1C1F" }, children: [
4873
+ )
4874
+ ] }),
4875
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: 4 }, children: [
4876
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4877
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u9875\u7709\u5DE6 (&D/&F)" }),
4894
4878
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4895
4879
  "input",
4896
4880
  {
4897
- type: "checkbox",
4898
- checked: paginationEnabled,
4881
+ type: "text",
4882
+ placeholder: "\u5982 &D",
4883
+ value: printCfg.headerLeft ?? "",
4899
4884
  onChange: (e) => {
4900
- const enabled = e.target.checked;
4901
- setPaginationEnabled(enabled);
4902
- setPageIndex(1);
4903
- rebuildPreview(void 0, { enabled, page: 1, pageSize });
4885
+ const next = { ...printCfg, headerLeft: e.target.value };
4886
+ setPrintCfg(next);
4887
+ rebuildPreview(next);
4904
4888
  }
4905
4889
  }
4906
- ),
4907
- "\u5927\u6570\u636E\u5206\u9875\u5207\u7247\u9884\u89C8"
4890
+ )
4908
4891
  ] }),
4909
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4910
- "select",
4892
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4893
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u9875\u7709\u4E2D" }),
4894
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4895
+ "input",
4896
+ {
4897
+ type: "text",
4898
+ placeholder: "\u5982 &A",
4899
+ value: printCfg.headerCenter ?? "",
4900
+ onChange: (e) => {
4901
+ const next = { ...printCfg, headerCenter: e.target.value };
4902
+ setPrintCfg(next);
4903
+ rebuildPreview(next);
4904
+ }
4905
+ }
4906
+ )
4907
+ ] }),
4908
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4909
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u9875\u7709\u53F3 (&P/&N)" }),
4910
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4911
+ "input",
4912
+ {
4913
+ type: "text",
4914
+ placeholder: "\u5982 \u7B2C&P/&N\u9875",
4915
+ value: printCfg.headerRight ?? "",
4916
+ onChange: (e) => {
4917
+ const next = { ...printCfg, headerRight: e.target.value };
4918
+ setPrintCfg(next);
4919
+ rebuildPreview(next);
4920
+ }
4921
+ }
4922
+ )
4923
+ ] })
4924
+ ] }),
4925
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: 4 }, children: [
4926
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4927
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u9875\u811A\u5DE6" }),
4928
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4929
+ "input",
4930
+ {
4931
+ type: "text",
4932
+ placeholder: "\u5236\u8868\u90E8\u95E8",
4933
+ value: printCfg.footerLeft ?? "",
4934
+ onChange: (e) => {
4935
+ const next = { ...printCfg, footerLeft: e.target.value };
4936
+ setPrintCfg(next);
4937
+ rebuildPreview(next);
4938
+ }
4939
+ }
4940
+ )
4941
+ ] }),
4942
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4943
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u9875\u811A\u4E2D" }),
4944
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4945
+ "input",
4946
+ {
4947
+ type: "text",
4948
+ placeholder: "&F",
4949
+ value: printCfg.footerCenter ?? "",
4950
+ onChange: (e) => {
4951
+ const next = { ...printCfg, footerCenter: e.target.value };
4952
+ setPrintCfg(next);
4953
+ rebuildPreview(next);
4954
+ }
4955
+ }
4956
+ )
4957
+ ] }),
4958
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4959
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u9875\u811A\u53F3" }),
4960
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4961
+ "input",
4962
+ {
4963
+ type: "text",
4964
+ placeholder: "#[PAGE]/#[PAGES]",
4965
+ value: printCfg.footerRight ?? "",
4966
+ onChange: (e) => {
4967
+ const next = { ...printCfg, footerRight: e.target.value };
4968
+ setPrintCfg(next);
4969
+ rebuildPreview(next);
4970
+ }
4971
+ }
4972
+ )
4973
+ ] })
4974
+ ] }),
4975
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4976
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u659C\u5411\u9632\u4F2A\u5E73\u94FA\u6C34\u5370\u6587\u5B57" }),
4977
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4978
+ "input",
4911
4979
  {
4912
- style: {
4913
- fontSize: 10.5,
4914
- padding: "1px 4px",
4915
- borderRadius: 4,
4916
- border: "1px solid #E3E5EA",
4917
- background: "#FFFFFF",
4918
- color: "#31363F"
4919
- },
4920
- value: pageSize,
4921
- disabled: !paginationEnabled,
4980
+ type: "text",
4981
+ placeholder: "\u5982\uFF1A\u4F01\u4E1A\u62A5\u8868 \xB7 \u5185\u90E8\u8D44\u6599",
4982
+ value: printCfg.watermarkText ?? "",
4922
4983
  onChange: (e) => {
4923
- const nextSize = Number(e.target.value);
4924
- setPageSize(nextSize);
4925
- setPageIndex(1);
4926
- rebuildPreview(void 0, { enabled: paginationEnabled, page: 1, pageSize: nextSize });
4927
- },
4928
- children: [
4929
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: 25, children: "25 \u884C/\u9875" }),
4930
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: 50, children: "50 \u884C/\u9875" }),
4931
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: 100, children: "100 \u884C/\u9875" }),
4932
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: 500, children: "500 \u884C/\u9875" })
4933
- ]
4984
+ const next = { ...printCfg, watermarkText: e.target.value };
4985
+ setPrintCfg(next);
4986
+ rebuildPreview(next);
4987
+ }
4934
4988
  }
4935
4989
  )
4936
4990
  ] }),
4937
- paginationEnabled && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", fontSize: 11 }, children: [
4991
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "yudao-sheet-field-row", children: [
4992
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u7269\u7406\u5957\u6253\u6821\u51C6\u5E95\u56FE URL\uFF08\u53EF\u9009\uFF09" }),
4938
4993
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4939
- "button",
4994
+ "input",
4940
4995
  {
4941
- type: "button",
4942
- className: "yudao-sheet-btn",
4943
- style: { padding: "2px 6px", fontSize: 10.5 },
4944
- disabled: pageIndex <= 1,
4945
- onClick: () => {
4946
- const prev = Math.max(1, pageIndex - 1);
4947
- setPageIndex(prev);
4948
- rebuildPreview(void 0, { enabled: true, page: prev, pageSize });
4949
- },
4950
- children: "\u4E0A\u4E00\u9875"
4996
+ type: "text",
4997
+ placeholder: "\u8F93\u5165\u9884\u5370\u53D1\u7968/\u8BC1\u4E66\u626B\u63CF\u4EF6\u56FE\u7247 URL",
4998
+ value: printCfg.overlayBackgroundUrl ?? "",
4999
+ onChange: (e) => {
5000
+ const next = { ...printCfg, overlayBackgroundUrl: e.target.value };
5001
+ setPrintCfg(next);
5002
+ rebuildPreview(next);
5003
+ }
5004
+ }
5005
+ )
5006
+ ] }),
5007
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 11.5 }, children: [
5008
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5009
+ "input",
5010
+ {
5011
+ type: "checkbox",
5012
+ checked: Boolean(printCfg.pinFooterToBottom),
5013
+ onChange: (e) => {
5014
+ const next = { ...printCfg, pinFooterToBottom: e.target.checked };
5015
+ setPrintCfg(next);
5016
+ rebuildPreview(next);
5017
+ }
4951
5018
  }
4952
5019
  ),
4953
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { color: "#4E5565" }, children: [
4954
- "\u7B2C ",
4955
- pageIndex,
4956
- "/",
4957
- pageSummary.totalPages,
4958
- " \u9875 \xB7 \u5171 ",
4959
- pageSummary.totalRows,
4960
- " \u884C"
4961
- ] }),
5020
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u5C3E\u884C\u8D34\u5E95\u56FA\u5B9A\u6253\u5370 (pinFooterToBottom)" })
5021
+ ] }),
5022
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 11.5 }, children: [
4962
5023
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4963
- "button",
5024
+ "input",
4964
5025
  {
4965
- type: "button",
4966
- className: "yudao-sheet-btn",
4967
- style: { padding: "2px 6px", fontSize: 10.5 },
4968
- disabled: pageIndex >= pageSummary.totalPages,
4969
- onClick: () => {
4970
- const next = Math.min(pageSummary.totalPages, pageIndex + 1);
4971
- setPageIndex(next);
4972
- rebuildPreview(void 0, { enabled: true, page: next, pageSize });
4973
- },
4974
- children: "\u4E0B\u4E00\u9875"
5026
+ type: "checkbox",
5027
+ checked: Boolean(printCfg.pageBreakAfterGroup),
5028
+ onChange: (e) => {
5029
+ const next = { ...printCfg, pageBreakAfterGroup: e.target.checked };
5030
+ setPrintCfg(next);
5031
+ rebuildPreview(next);
5032
+ }
4975
5033
  }
4976
- )
4977
- ] })
4978
- ]
4979
- }
4980
- ),
4981
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4982
- "div",
4983
- {
4984
- style: {
4985
- marginTop: "auto",
4986
- padding: "8px 10px",
4987
- background: "#FFFFFF",
4988
- border: "1px solid #E3E5EA",
4989
- borderRadius: 8,
4990
- display: "flex",
4991
- flexDirection: "column",
4992
- gap: 6
4993
- },
4994
- children: [
4995
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", fontSize: 11.5 }, children: [
4996
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { style: { fontWeight: 600, color: "#1B1C1F" }, children: "\u5BFC\u5165/\u5BFC\u51FA\u5904\u7406\u65B9\u5F0F\uFF08\u6309\u6B21\u9009\u62E9\uFF09" }),
4997
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { fontSize: 10.5, color: "#7D8698" }, children: [
4998
- "\u5FEB\u7167 ",
4999
- snapSizeKb,
5000
- " KB"
5001
- ] })
5034
+ ),
5035
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u6309\u7EC4\u81EA\u52A8\u5206\u9875 (pageBreakAfterGroup)" })
5002
5036
  ] }),
5003
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "yudao-sheet-segmented", style: { gridTemplateColumns: "1fr 1fr" }, children: [
5037
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 11.5 }, children: [
5004
5038
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5005
- "button",
5039
+ "input",
5006
5040
  {
5007
- type: "button",
5008
- className: `yudao-sheet-segmented-item ${ioTarget === "browser" ? "is-active" : ""}`,
5009
- onClick: () => setIoTarget("browser"),
5010
- children: t("yudaoSheets.modal.browserModeBtn")
5041
+ type: "checkbox",
5042
+ checked: printCfg.showPageNumbers !== false,
5043
+ onChange: (e) => {
5044
+ const next = { ...printCfg, showPageNumbers: e.target.checked };
5045
+ setPrintCfg(next);
5046
+ rebuildPreview(next);
5047
+ }
5011
5048
  }
5012
5049
  ),
5013
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5014
- "button",
5050
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u663E\u793A\u9875\u7801 (showPageNumbers)" })
5051
+ ] }),
5052
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 11.5 }, children: [
5053
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5054
+ "input",
5015
5055
  {
5016
- type: "button",
5017
- className: `yudao-sheet-segmented-item ${ioTarget === "server" ? "is-active" : ""}`,
5018
- onClick: () => setIoTarget("server"),
5019
- title: ioCaps.server.exportSheet || ioCaps.server.importSheet ? `\u8D70\u670D\u52A1\u7AEF\u9002\u914D\u5668 (${ioCaps.server.adapterName})` : "\u5F53\u524D\u672A\u6CE8\u518C\u670D\u52A1\u7AEF\u5BFC\u5165/\u5BFC\u51FA\u9002\u914D\u5668",
5020
- children: [
5021
- t("yudaoSheets.modal.serverModeBtn"),
5022
- ioCaps.server.exportSheet || ioCaps.server.importSheet ? "" : t("yudaoSheets.modal.serverNotConnected")
5023
- ]
5056
+ type: "checkbox",
5057
+ checked: printCfg.excludeBackgroundOnPrint ?? true,
5058
+ onChange: (e) => {
5059
+ const next = { ...printCfg, excludeBackgroundOnPrint: e.target.checked };
5060
+ setPrintCfg(next);
5061
+ rebuildPreview(next);
5062
+ }
5024
5063
  }
5025
- )
5064
+ ),
5065
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u5957\u6253\u6A21\u5F0F\uFF1A\u4EC5\u9884\u89C8\u53C2\u8003\u5E95\u56FE\uFF0C\u6253\u5370\u81EA\u52A8\u5265\u79BB\u5E95\u56FE" })
5026
5066
  ] }),
5027
- ioTarget === "browser" ? exportCapReport.warnings.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5028
- "div",
5029
- {
5030
- style: {
5031
- fontSize: 10.5,
5032
- color: "#4E5565",
5033
- background: "#F9FAFB",
5034
- border: "1px solid #E3E5EA",
5035
- padding: "4px 6px",
5036
- borderRadius: 5,
5037
- lineHeight: 1.4
5038
- },
5039
- children: [
5040
- "\u6D4F\u89C8\u5668\u7AEF\u63D0\u793A\uFF1A",
5041
- exportCapReport.warnings.join("\uFF1B"),
5042
- "\uFF08\u9AD8\u4FDD\u771F\u5EFA\u8BAE\u9009\u670D\u52A1\u7AEF\uFF09\u3002"
5043
- ]
5044
- }
5045
- ) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 10.5, color: "#4E5565", lineHeight: 1.4 }, children: "\u6D4F\u89C8\u5668\u672C\u5730\u5904\u7406\uFF1A\u96F6\u6587\u4EF6\u4E0A\u4F20\uFF0C\u652F\u6301\u56FE\u7247/\u6570\u636E\u9A8C\u8BC1/\u6761\u4EF6\u683C\u5F0F\u4E0E\u77E2\u91CF PDF\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 10.5, color: "#4E5565", lineHeight: 1.4 }, children: "\u670D\u52A1\u7AEF\u5904\u7406\uFF1A\u8D70\u540E\u7AEF POI \u9AD8\u4FDD\u771F\u8BFB\u5199\uFF08\u91CD\u65B0\u53D6\u6570\u5C55\u5F00\uFF0C\u5931\u8D25\u4E0D\u9759\u9ED8\u8F6C\u524D\u7AEF\uFF09\u3002" }),
5046
- features.datasetBinding && ioTarget === "browser" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 5, fontSize: 11, color: "#31363F", cursor: "pointer" }, children: [
5067
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 11.5 }, children: [
5068
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5069
+ "input",
5070
+ {
5071
+ type: "checkbox",
5072
+ checked: printCfg.showGridlines,
5073
+ onChange: (e) => {
5074
+ const next = { ...printCfg, showGridlines: e.target.checked };
5075
+ setPrintCfg(next);
5076
+ rebuildPreview(next);
5077
+ }
5078
+ }
5079
+ ),
5080
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u663E\u793A\u7A7A\u767D\u5355\u5143\u683C\u8F85\u52A9\u7F51\u683C\u7EBF" })
5081
+ ] }),
5082
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 11.5 }, children: [
5047
5083
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5048
5084
  "input",
5049
5085
  {
5050
5086
  type: "checkbox",
5051
- checked: skipDatasetOnExport,
5052
- onChange: (e) => setSkipDatasetOnExport(e.target.checked)
5087
+ checked: Boolean(printCfg.wordFormStyle),
5088
+ onChange: (e) => {
5089
+ const next = { ...printCfg, wordFormStyle: e.target.checked };
5090
+ setPrintCfg(next);
5091
+ rebuildPreview(next);
5092
+ }
5053
5093
  }
5054
5094
  ),
5055
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u4EC5\u7F16\u7801\u5F53\u524D\u5FEB\u7167\uFF08\u4E0D\u91CD\u590D\u6267\u884C\u6570\u636E\u96C6\u586B\u6570\uFF09" })
5095
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u7C7B Word \u65E0\u8FB9\u6846\u516C\u6587/\u8868\u5355\u98CE\u683C" })
5056
5096
  ] })
5057
- ]
5058
- }
5059
- ),
5060
- importWarnings.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5061
- "div",
5062
- {
5063
- style: {
5064
- fontSize: 10.5,
5065
- color: "#4E5565",
5066
- background: "#F9FAFB",
5067
- border: "1px solid #E3E5EA",
5068
- padding: "5px 7px",
5069
- borderRadius: 6,
5070
- lineHeight: 1.4
5071
- },
5072
- children: [
5073
- "\u5BFC\u5165\u964D\u7EA7\u6E05\u5355\uFF1A",
5074
- importWarnings.join("\uFF1B")
5075
- ]
5076
- }
5077
- ),
5078
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
5079
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
5080
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5081
- "button",
5082
- {
5083
- type: "button",
5084
- className: `yudao-sheet-btn ${tab !== "print" ? "is-primary" : ""}`,
5085
- onClick: () => handleDownload("xlsx"),
5086
- children: "\u5BFC\u51FA Excel (.xlsx)"
5087
- }
5088
- ),
5089
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5090
- "button",
5091
- {
5092
- type: "button",
5093
- className: "yudao-sheet-btn",
5094
- onClick: () => handleDownload("xls"),
5095
- children: "\u5BFC\u51FA\u517C\u5BB9 (.xls)"
5096
- }
5097
- )
5098
- ] }),
5099
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
5100
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5101
- "button",
5102
- {
5103
- type: "button",
5104
- className: `yudao-sheet-btn ${tab === "print" ? "is-primary" : ""}`,
5105
- onClick: () => handleDownload("pdf"),
5106
- children: "\u5BFC\u51FA\u77E2\u91CF PDF"
5107
- }
5108
- ),
5109
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5110
- "button",
5111
- {
5112
- type: "button",
5113
- className: "yudao-sheet-btn",
5114
- onClick: () => handleDownload("docx"),
5115
- children: "\u5BFC\u51FA Word (.docx)"
5116
- }
5117
- )
5118
- ] }),
5119
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
5120
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "yudao-sheet-btn", onClick: handleImportBySelectedTarget, children: "\u5BFC\u5165 (.xlsx/.xls/.xml/.csv)" }),
5121
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5122
- "button",
5123
- {
5124
- type: "button",
5125
- className: "yudao-sheet-btn",
5126
- onClick: () => handleDownload("csv"),
5127
- children: "\u5BFC\u51FA CSV"
5128
- }
5129
- )
5130
- ] }),
5131
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
5132
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5133
- "button",
5097
+ ] }),
5098
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5099
+ "div",
5134
5100
  {
5135
- type: "button",
5136
- className: "yudao-sheet-btn",
5137
- onClick: () => handleDownload("xml"),
5138
- children: "\u5BFC\u51FA\u6807\u51C6\u62A5\u8868 XML"
5101
+ style: {
5102
+ padding: "6px 8px",
5103
+ background: "#FFFFFF",
5104
+ border: "1px solid #E3E5EA",
5105
+ borderRadius: 6,
5106
+ display: "flex",
5107
+ flexDirection: "column",
5108
+ gap: 5
5109
+ },
5110
+ children: [
5111
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", fontSize: 11.5, cursor: "pointer" }, children: [
5112
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { display: "inline-flex", alignItems: "center", gap: 5, fontWeight: 600, color: "#1B1C1F" }, children: [
5113
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5114
+ "input",
5115
+ {
5116
+ type: "checkbox",
5117
+ checked: paginationEnabled,
5118
+ onChange: (e) => {
5119
+ const enabled = e.target.checked;
5120
+ setPaginationEnabled(enabled);
5121
+ setPageIndex(1);
5122
+ rebuildPreview(void 0, { enabled, page: 1, pageSize });
5123
+ }
5124
+ }
5125
+ ),
5126
+ "\u5927\u6570\u636E\u5206\u9875\u5207\u7247\u9884\u89C8"
5127
+ ] }),
5128
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5129
+ "select",
5130
+ {
5131
+ style: {
5132
+ fontSize: 10.5,
5133
+ padding: "1px 4px",
5134
+ borderRadius: 4,
5135
+ border: "1px solid #E3E5EA",
5136
+ background: "#FFFFFF",
5137
+ color: "#31363F"
5138
+ },
5139
+ value: pageSize,
5140
+ disabled: !paginationEnabled,
5141
+ onChange: (e) => {
5142
+ const nextSize = Number(e.target.value);
5143
+ setPageSize(nextSize);
5144
+ setPageIndex(1);
5145
+ rebuildPreview(void 0, { enabled: paginationEnabled, page: 1, pageSize: nextSize });
5146
+ },
5147
+ children: [
5148
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: 25, children: "25 \u884C/\u9875" }),
5149
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: 50, children: "50 \u884C/\u9875" }),
5150
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: 100, children: "100 \u884C/\u9875" }),
5151
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: 500, children: "500 \u884C/\u9875" })
5152
+ ]
5153
+ }
5154
+ )
5155
+ ] }),
5156
+ paginationEnabled && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", fontSize: 11 }, children: [
5157
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5158
+ "button",
5159
+ {
5160
+ type: "button",
5161
+ className: "yudao-sheet-btn",
5162
+ style: { padding: "2px 6px", fontSize: 10.5 },
5163
+ disabled: pageIndex <= 1,
5164
+ onClick: () => {
5165
+ const prev = Math.max(1, pageIndex - 1);
5166
+ setPageIndex(prev);
5167
+ rebuildPreview(void 0, { enabled: true, page: prev, pageSize });
5168
+ },
5169
+ children: "\u4E0A\u4E00\u9875"
5170
+ }
5171
+ ),
5172
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { color: "#4E5565" }, children: [
5173
+ "\u7B2C ",
5174
+ pageIndex,
5175
+ "/",
5176
+ pageSummary.totalPages,
5177
+ " \u9875 \xB7 \u5171 ",
5178
+ pageSummary.totalRows,
5179
+ " \u884C"
5180
+ ] }),
5181
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5182
+ "button",
5183
+ {
5184
+ type: "button",
5185
+ className: "yudao-sheet-btn",
5186
+ style: { padding: "2px 6px", fontSize: 10.5 },
5187
+ disabled: pageIndex >= pageSummary.totalPages,
5188
+ onClick: () => {
5189
+ const next = Math.min(pageSummary.totalPages, pageIndex + 1);
5190
+ setPageIndex(next);
5191
+ rebuildPreview(void 0, { enabled: true, page: next, pageSize });
5192
+ },
5193
+ children: "\u4E0B\u4E00\u9875"
5194
+ }
5195
+ )
5196
+ ] })
5197
+ ]
5139
5198
  }
5140
5199
  ),
5141
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "yudao-sheet-btn", onClick: handleExportReportPackage, children: "\u5BFC\u51FA\u62A5\u8868\u8FC1\u79FB\u5305 (.json)" })
5142
- ] }),
5143
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "yudao-sheet-btn", onClick: handleImportReportPackage, children: "\u5BFC\u5165\u62A5\u8868\u8FC1\u79FB\u5305 (.yudao-sheet.json)" }),
5144
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "yudao-sheet-btn", onClick: handleBrowserPrint, children: t("yudaoSheets.modal.triggerPrintBtn") }),
5145
- Boolean(ioAdapter.onSave) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "yudao-sheet-btn", onClick: handleSaveToHost, children: "\u4FDD\u5B58\u6A21\u677F\u81F3\u4E1A\u52A1\u540E\u7AEF (onSave)" })
5146
- ] }),
5147
- statusTip && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5148
- "div",
5149
- {
5150
- style: {
5151
- fontSize: 11,
5152
- color: "#31363F",
5153
- background: "#F3F5FF",
5154
- border: "1px solid #D2DAFA",
5155
- padding: "6px 8px",
5156
- borderRadius: 6,
5157
- lineHeight: 1.4
5158
- },
5159
- children: statusTip
5160
- }
5161
- )
5162
- ]
5163
- }
5164
- ),
5165
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", minWidth: 0, overflow: "hidden" }, children: [
5166
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5167
- "div",
5168
- {
5169
- className: "yudao-sheet-quick-export-bar",
5170
- style: {
5171
- background: "#F9FAFB",
5172
- borderBottom: "1px solid #E3E5EA",
5173
- padding: "6px 16px",
5174
- display: "flex",
5175
- alignItems: "center",
5176
- justifyContent: "space-between",
5177
- gap: 8,
5178
- flexWrap: "wrap"
5179
- },
5180
- children: [
5181
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "inline-flex", alignItems: "center", gap: 6, flexWrap: "wrap" }, children: [
5182
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { style: { fontSize: 11.5, fontWeight: 600, color: "#31363F" }, children: t("yudaoSheets.modal.quickExportLabel") }),
5183
- [
5184
- ["xlsx", t("yudaoSheets.modal.quickExportXlsx")],
5185
- ["pdf", t("yudaoSheets.modal.quickExportPdf")],
5186
- ["docx", t("yudaoSheets.modal.quickExportDocx")],
5187
- ["csv", t("yudaoSheets.modal.quickExportCsv")],
5188
- ["html", t("yudaoSheets.modal.quickExportHtml")]
5189
- ].map(([fmt, label]) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5190
- "button",
5191
- {
5192
- type: "button",
5193
- className: `yudao-sheet-btn ${fmt === "xlsx" ? "is-primary" : ""}`,
5194
- style: { height: 24, padding: "0 9px", fontSize: 11 },
5195
- onClick: () => handleDownload(fmt),
5196
- children: label
5197
- },
5198
- fmt
5199
- ))
5200
- ] }),
5201
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5202
- "button",
5203
- {
5204
- type: "button",
5205
- className: "yudao-sheet-btn",
5206
- style: { height: 24, padding: "0 10px", fontSize: 11 },
5207
- onClick: handleBrowserPrint,
5208
- children: t("yudaoSheets.modal.triggerPrintBtn")
5209
- }
5210
- )
5211
- ]
5212
- }
5213
- ),
5214
- queryParamFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5215
- "div",
5216
- {
5217
- className: "yudao-sheet-query-bar",
5218
- style: {
5219
- background: "#FFFFFF",
5220
- borderBottom: "1px solid #E3E5EA",
5221
- padding: "10px 16px",
5222
- display: "flex",
5223
- flexWrap: "wrap",
5224
- alignItems: "center",
5225
- gap: 10
5226
- },
5227
- children: [
5228
- queryParamFields.map((field) => {
5229
- const rawVal = queryValues[field.name];
5230
- const dictOpts = field.options ?? (field.dictCode ? templateService.getTemplateMetadata(workbook.getUnitId()).dicts?.[field.dictCode] : void 0) ?? [];
5231
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5200
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5232
5201
  "div",
5233
5202
  {
5234
5203
  style: {
5235
- display: "inline-flex",
5236
- alignItems: "center",
5237
- gap: 6,
5238
- fontSize: 12,
5239
- color: "#31363F"
5204
+ marginTop: "auto",
5205
+ padding: "8px 10px",
5206
+ background: "#FFFFFF",
5207
+ border: "1px solid #E3E5EA",
5208
+ borderRadius: 8,
5209
+ display: "flex",
5210
+ flexDirection: "column",
5211
+ gap: 6
5240
5212
  },
5241
5213
  children: [
5242
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { fontWeight: 500, color: "#1B1C1F", whiteSpace: "nowrap" }, children: [
5243
- field.label || field.name,
5244
- field.required ? " *" : "",
5245
- ":"
5214
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", fontSize: 11.5 }, children: [
5215
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { fontWeight: 600, color: "#1B1C1F" }, children: [
5216
+ "\u5BFC\u5165/\u5BFC\u51FA\u5904\u7406\u65B9\u5F0F\uFF08\u5F53\u524D .",
5217
+ activeIoFormat,
5218
+ "\uFF09"
5219
+ ] }),
5220
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { fontSize: 10.5, color: "#7D8698" }, children: [
5221
+ "\u5FEB\u7167 ",
5222
+ snapSizeKb,
5223
+ " KB"
5224
+ ] })
5246
5225
  ] }),
5247
- field.widget === "select" || field.widget === "cascader" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5248
- "select",
5226
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "yudao-sheet-segmented", style: { gridTemplateColumns: "1fr 1fr" }, children: [
5227
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5228
+ "button",
5229
+ {
5230
+ type: "button",
5231
+ "data-testid": "yudao-io-target-browser",
5232
+ className: `yudao-sheet-segmented-item ${ioTarget === "browser" ? "is-active" : ""}`,
5233
+ onClick: () => {
5234
+ userTouchedTargetRef.current = true;
5235
+ setIoTarget("browser");
5236
+ },
5237
+ children: [
5238
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u6D4F\u89C8\u5668\u5904\u7406" }),
5239
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { fontSize: 10, marginLeft: 3, opacity: 0.85 }, children: [
5240
+ "(",
5241
+ browserAvailabilityLabel,
5242
+ ")"
5243
+ ] })
5244
+ ]
5245
+ }
5246
+ ),
5247
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5248
+ "button",
5249
+ {
5250
+ type: "button",
5251
+ "data-testid": "yudao-io-target-server",
5252
+ className: `yudao-sheet-segmented-item ${ioTarget === "server" ? "is-active" : ""}`,
5253
+ onClick: () => {
5254
+ userTouchedTargetRef.current = true;
5255
+ setIoTarget("server");
5256
+ },
5257
+ title: ioCaps.server.exportSheet || ioCaps.server.importSheet ? `\u8D70\u670D\u52A1\u7AEF\u9002\u914D\u5668 (${ioCaps.server.adapterName})` : "\u5F53\u524D\u672A\u6CE8\u518C\u670D\u52A1\u7AEF\u5BFC\u5165/\u5BFC\u51FA\u9002\u914D\u5668",
5258
+ children: [
5259
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u670D\u52A1\u7AEF\u5904\u7406" }),
5260
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { fontSize: 10, marginLeft: 3, opacity: 0.85 }, children: [
5261
+ "(",
5262
+ serverAvailabilityLabel,
5263
+ ")"
5264
+ ] })
5265
+ ]
5266
+ }
5267
+ )
5268
+ ] }),
5269
+ ioTarget === "browser" ? exportCapReport.warnings.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5270
+ "div",
5249
5271
  {
5250
5272
  style: {
5251
- height: 28,
5252
- padding: "0 8px",
5253
- fontSize: 12,
5254
- borderRadius: 6,
5273
+ fontSize: 10.5,
5274
+ color: "#4E5565",
5275
+ background: "#F9FAFB",
5255
5276
  border: "1px solid #E3E5EA",
5256
- background: "#FFFFFF",
5257
- color: "#1B1C1F",
5258
- minWidth: 110
5277
+ padding: "4px 6px",
5278
+ borderRadius: 5,
5279
+ lineHeight: 1.4
5259
5280
  },
5260
- value: rawVal == null ? "" : String(rawVal),
5261
- onChange: (e) => setQueryValues((prev) => ({ ...prev, [field.name]: e.target.value })),
5262
5281
  children: [
5263
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("yudaoSheets.modal.allOption") }),
5264
- dictOpts.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: opt.value, children: opt.label }, opt.value))
5282
+ "\u6D4F\u89C8\u5668\u7AEF\u63D0\u793A\uFF1A",
5283
+ exportCapReport.warnings.join("\uFF1B"),
5284
+ "\uFF08\u9AD8\u4FDD\u771F\u5EFA\u8BAE\u9009\u670D\u52A1\u7AEF\uFF09\u3002"
5265
5285
  ]
5266
5286
  }
5267
- ) : field.widget === "multiSelect" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5268
- "input",
5269
- {
5270
- type: "text",
5271
- placeholder: "\u591A\u503C\u9017\u53F7\u5206\u9694",
5272
- style: {
5273
- height: 28,
5274
- padding: "0 8px",
5275
- fontSize: 12,
5276
- borderRadius: 6,
5277
- border: "1px solid #E3E5EA",
5278
- background: "#FFFFFF",
5279
- color: "#1B1C1F",
5280
- width: 132
5281
- },
5282
- value: Array.isArray(rawVal) ? rawVal.join(",") : rawVal == null ? "" : String(rawVal),
5283
- onChange: (e) => setQueryValues((prev) => ({
5284
- ...prev,
5285
- [field.name]: e.target.value.split(",").map((s) => s.trim()).filter(Boolean)
5286
- }))
5287
- }
5288
- ) : field.widget === "dateRange" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
5287
+ ) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 10.5, color: "#4E5565", lineHeight: 1.4 }, children: "\u6D4F\u89C8\u5668\u672C\u5730\u5904\u7406\uFF1A\u96F6\u6587\u4EF6\u4E0A\u4F20\uFF0C\u652F\u6301\u56FE\u7247/\u6570\u636E\u9A8C\u8BC1/\u6761\u4EF6\u683C\u5F0F\u4E0E\u77E2\u91CF PDF\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 10.5, color: "#4E5565", lineHeight: 1.4 }, children: "\u670D\u52A1\u7AEF\u5904\u7406\uFF1A\u8D70\u540E\u7AEF\u9AD8\u4FDD\u771F\u8BFB\u5199\u63A5\u53E3\uFF08\u5931\u8D25\u663E\u5F0F\u63D0\u793A\uFF0C\u7EDD\u4E0D\u9759\u9ED8\u964D\u7EA7\uFF09\u3002" }),
5288
+ features.datasetBinding && ioTarget === "browser" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "flex", alignItems: "center", gap: 5, fontSize: 11, color: "#31363F", cursor: "pointer" }, children: [
5289
5289
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5290
5290
  "input",
5291
5291
  {
5292
- type: "date",
5293
- style: {
5294
- height: 28,
5295
- padding: "0 6px",
5296
- fontSize: 11.5,
5297
- borderRadius: 6,
5298
- border: "1px solid #E3E5EA",
5299
- background: "#FFFFFF",
5300
- color: "#1B1C1F"
5301
- },
5302
- value: Array.isArray(rawVal) ? String(rawVal[0] ?? "") : "",
5303
- onChange: (e) => {
5304
- const curArr = Array.isArray(rawVal) ? [...rawVal] : ["", ""];
5305
- curArr[0] = e.target.value;
5306
- setQueryValues((prev) => ({ ...prev, [field.name]: curArr }));
5307
- }
5292
+ type: "checkbox",
5293
+ checked: skipDatasetOnExport,
5294
+ onChange: (e) => setSkipDatasetOnExport(e.target.checked)
5308
5295
  }
5309
5296
  ),
5310
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { style: { color: "#7D8698" }, children: "-" }),
5311
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5312
- "input",
5297
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u4EC5\u7F16\u7801\u5F53\u524D\u5FEB\u7167\uFF08\u4E0D\u91CD\u590D\u6267\u884C\u6570\u636E\u96C6\u586B\u6570\uFF09" })
5298
+ ] })
5299
+ ]
5300
+ }
5301
+ ),
5302
+ ioError && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5303
+ "div",
5304
+ {
5305
+ "data-testid": "yudao-io-error-banner",
5306
+ style: {
5307
+ fontSize: 11,
5308
+ color: "#B42318",
5309
+ background: "#FEF3F2",
5310
+ border: "1px solid #FECDCA",
5311
+ padding: "8px 10px",
5312
+ borderRadius: 6,
5313
+ lineHeight: 1.45,
5314
+ display: "flex",
5315
+ flexDirection: "column",
5316
+ gap: 6
5317
+ },
5318
+ children: [
5319
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { children: ioError }),
5320
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5321
+ "button",
5322
+ {
5323
+ type: "button",
5324
+ "data-testid": "yudao-io-switch-retry",
5325
+ className: "yudao-sheet-btn",
5326
+ style: { alignSelf: "flex-start", borderColor: "#FDA29B", color: "#B42318" },
5327
+ onClick: handleSwitchTargetAndRetry,
5328
+ children: ioTarget === "server" ? "\u5207\u6362\u4E3A\u300C\u6D4F\u89C8\u5668\u5904\u7406\u300D\u91CD\u8BD5" : "\u5207\u6362\u4E3A\u300C\u670D\u52A1\u7AEF\u5904\u7406\u300D\u91CD\u8BD5"
5329
+ }
5330
+ )
5331
+ ]
5332
+ }
5333
+ ),
5334
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5335
+ "div",
5336
+ {
5337
+ style: {
5338
+ padding: "8px 10px",
5339
+ background: "#FFFFFF",
5340
+ border: "1px solid #E3E5EA",
5341
+ borderRadius: 8,
5342
+ display: "flex",
5343
+ flexDirection: "column",
5344
+ gap: 6
5345
+ },
5346
+ children: [
5347
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", fontSize: 11.5 }, children: [
5348
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { style: { fontWeight: 600, color: "#1B1C1F" }, children: "\u5DE5\u4F5C\u7C3F\u5BFC\u5165\uFF08\u9884\u68C0\u6682\u5B58\uFF09" }),
5349
+ selectedImportFile && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5350
+ "span",
5313
5351
  {
5314
- type: "date",
5315
5352
  style: {
5316
- height: 28,
5317
- padding: "0 6px",
5318
- fontSize: 11.5,
5319
- borderRadius: 6,
5320
- border: "1px solid #E3E5EA",
5321
- background: "#FFFFFF",
5322
- color: "#1B1C1F"
5353
+ fontSize: 10.5,
5354
+ color: "#4E5565",
5355
+ maxWidth: 155,
5356
+ overflow: "hidden",
5357
+ textOverflow: "ellipsis",
5358
+ whiteSpace: "nowrap"
5323
5359
  },
5324
- value: Array.isArray(rawVal) ? String(rawVal[1] ?? "") : "",
5325
- onChange: (e) => {
5326
- const curArr = Array.isArray(rawVal) ? [...rawVal] : ["", ""];
5327
- curArr[1] = e.target.value;
5328
- setQueryValues((prev) => ({ ...prev, [field.name]: curArr }));
5329
- }
5360
+ title: selectedImportFile.name,
5361
+ children: selectedImportFile.name
5330
5362
  }
5331
5363
  )
5332
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5364
+ ] }),
5365
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5333
5366
  "input",
5334
5367
  {
5335
- type: field.widget === "number" ? "number" : field.widget === "date" ? "date" : "text",
5336
- placeholder: `\u8F93\u5165${field.label || field.name}`,
5368
+ ref: fileInputRef,
5369
+ type: "file",
5370
+ "data-testid": "yudao-io-file-input",
5371
+ accept: ".xlsx,.xls,.xml,.csv,.json",
5372
+ style: { display: "none" },
5373
+ onChange: handleFileInputChange
5374
+ }
5375
+ ),
5376
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5377
+ "button",
5378
+ {
5379
+ type: "button",
5380
+ "data-testid": "yudao-io-pick-file",
5381
+ className: `yudao-sheet-btn ${tab === "import" && !pendingImport ? "is-primary" : ""}`,
5382
+ onClick: () => fileInputRef.current?.click(),
5383
+ children: "\u9009\u62E9\u6587\u4EF6\u5BFC\u5165"
5384
+ }
5385
+ ),
5386
+ pendingImport && stagedSheetSummary && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5387
+ "div",
5388
+ {
5389
+ "data-testid": "yudao-io-staged-result",
5337
5390
  style: {
5338
- height: 28,
5339
- padding: "0 8px",
5340
- fontSize: 12,
5391
+ fontSize: 11,
5392
+ color: "#31363F",
5393
+ background: "#F9FAFB",
5394
+ border: "1px solid #D2DAFA",
5395
+ padding: "8px",
5341
5396
  borderRadius: 6,
5342
- border: "1px solid #E3E5EA",
5343
- background: "#FFFFFF",
5344
- color: "#1B1C1F",
5345
- width: field.widget === "number" ? 96 : 124
5397
+ display: "flex",
5398
+ flexDirection: "column",
5399
+ gap: 5,
5400
+ lineHeight: 1.45
5346
5401
  },
5347
- value: rawVal == null ? "" : String(rawVal),
5348
- onChange: (e) => setQueryValues((prev) => ({
5349
- ...prev,
5350
- [field.name]: field.widget === "number" && e.target.value !== "" ? Number(e.target.value) : e.target.value
5351
- }))
5402
+ children: [
5403
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { fontWeight: 600, color: "#1B1C1F" }, children: [
5404
+ "\u5F85\u786E\u8BA4\u6587\u4EF6\uFF1A",
5405
+ pendingImport.fileName
5406
+ ] }),
5407
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
5408
+ "\u89E3\u6790\u901A\u9053\uFF1A",
5409
+ pendingImport.executedBy === "server" ? "\u670D\u52A1\u7AEF\u5904\u7406" : "\u6D4F\u89C8\u5668\u5904\u7406"
5410
+ ] }),
5411
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
5412
+ "\u5DE5\u4F5C\u8868\u6982\u89C8\uFF1A\u5171 ",
5413
+ stagedSheetSummary.count,
5414
+ " \u4E2A\u5DE5\u4F5C\u8868\uFF08",
5415
+ stagedSheetSummary.names.join("\u3001") || "-",
5416
+ "\uFF09"
5417
+ ] }),
5418
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { "data-testid": "yudao-io-warnings", style: { color: "#4E5565" }, children: pendingImport.warnings.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { style: { margin: "2px 0 0", paddingLeft: 16 }, children: pendingImport.warnings.map((w, idx) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: w.message }, `${w.code}-${idx}`)) }) : "\u65E0\u517C\u5BB9\u6027\u8B66\u544A" }),
5419
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6, marginTop: 2 }, children: [
5420
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5421
+ "button",
5422
+ {
5423
+ type: "button",
5424
+ "data-testid": "yudao-io-confirm-import",
5425
+ className: "yudao-sheet-btn is-primary",
5426
+ onClick: handleConfirmStagedImport,
5427
+ children: "\u786E\u8BA4\u5E94\u7528\u5230\u8BBE\u8BA1\u5668"
5428
+ }
5429
+ ),
5430
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5431
+ "button",
5432
+ {
5433
+ type: "button",
5434
+ "data-testid": "yudao-io-cancel-import",
5435
+ className: "yudao-sheet-btn",
5436
+ onClick: handleCancelStagedImport,
5437
+ children: "\u53D6\u6D88\u672C\u6B21\u5BFC\u5165"
5438
+ }
5439
+ )
5440
+ ] })
5441
+ ]
5352
5442
  }
5353
5443
  )
5354
5444
  ]
5355
- },
5356
- field.name
5357
- );
5358
- }),
5359
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "inline-flex", alignItems: "center", gap: 6, marginLeft: "auto" }, children: [
5360
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5361
- "button",
5362
- {
5363
- type: "button",
5364
- className: "yudao-sheet-btn is-primary",
5365
- style: { height: 28, padding: "0 12px", fontSize: 12 },
5366
- onClick: () => {
5367
- setPageIndex(1);
5368
- rebuildPreview(void 0, { enabled: paginationEnabled, page: 1, pageSize }, queryValues);
5369
- setStatusTip("\u5DF2\u6309\u67E5\u8BE2\u6761\u4EF6\u8FC7\u6EE4\u6570\u636E\u96C6\u5E76\u5237\u65B0\u9884\u89C8");
5370
- },
5371
- children: t("yudaoSheets.modal.queryBtn")
5372
5445
  }
5373
5446
  ),
5374
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5375
- "button",
5447
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
5448
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "112px 1fr", gap: 6 }, children: [
5449
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5450
+ "select",
5451
+ {
5452
+ "data-testid": "yudao-io-export-format",
5453
+ style: {
5454
+ height: 30,
5455
+ padding: "0 6px",
5456
+ fontSize: 11.5,
5457
+ borderRadius: 6,
5458
+ border: "1px solid #E3E5EA",
5459
+ background: "#FFFFFF",
5460
+ color: "#1B1C1F"
5461
+ },
5462
+ value: exportFormat,
5463
+ onChange: (e) => setExportFormat(e.target.value),
5464
+ children: [
5465
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "xlsx", children: "Excel (.xlsx)" }),
5466
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "xls", children: "\u517C\u5BB9 (.xls)" }),
5467
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "pdf", children: "\u77E2\u91CF (.pdf)" }),
5468
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "docx", children: "Word (.docx)" }),
5469
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "csv", children: "\u8868\u683C (.csv)" }),
5470
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "xml", children: "\u62A5\u8868 (.xml)" }),
5471
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "html", children: "\u7F51\u9875 (.html)" }),
5472
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "json", children: "\u5FEB\u7167 (.json)" })
5473
+ ]
5474
+ }
5475
+ ),
5476
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5477
+ "button",
5478
+ {
5479
+ type: "button",
5480
+ "data-testid": "yudao-io-export-download",
5481
+ className: `yudao-sheet-btn ${tab !== "import" ? "is-primary" : ""}`,
5482
+ onClick: () => handleDownload(exportFormat),
5483
+ children: [
5484
+ "\u5BFC\u51FA\u4E0B\u8F7D (.",
5485
+ exportFormat === "xml" ? "report.xml" : exportFormat,
5486
+ ")"
5487
+ ]
5488
+ }
5489
+ )
5490
+ ] }),
5491
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 6 }, children: [
5492
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "yudao-sheet-btn", onClick: handleExportReportPackage, children: "\u5BFC\u51FA\u62A5\u8868\u8FC1\u79FB\u5305 (.json)" }),
5493
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "yudao-sheet-btn", onClick: handleImportReportPackage, children: "\u5BFC\u5165\u62A5\u8868\u8FC1\u79FB\u5305 (.json)" })
5494
+ ] }),
5495
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "yudao-sheet-btn", onClick: handleBrowserPrint, children: t("yudaoSheets.modal.triggerPrintBtn") }),
5496
+ Boolean(ioAdapter.onSave) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "yudao-sheet-btn", onClick: handleSaveToHost, children: "\u4FDD\u5B58\u6A21\u677F\u81F3\u4E1A\u52A1\u540E\u7AEF (onSave)" })
5497
+ ] }),
5498
+ statusTip && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5499
+ "div",
5376
5500
  {
5377
- type: "button",
5378
- className: "yudao-sheet-btn",
5379
- style: { height: 28, padding: "0 12px", fontSize: 12 },
5380
- onClick: () => {
5381
- const resetVals = buildInitialQueryValues(queryParamFields);
5382
- setQueryValues(resetVals);
5383
- setPageIndex(1);
5384
- rebuildPreview(void 0, { enabled: paginationEnabled, page: 1, pageSize }, resetVals);
5385
- setStatusTip("\u5DF2\u91CD\u7F6E\u67E5\u8BE2\u6761\u4EF6");
5501
+ style: {
5502
+ fontSize: 11,
5503
+ color: "#31363F",
5504
+ background: "#F3F5FF",
5505
+ border: "1px solid #D2DAFA",
5506
+ padding: "6px 8px",
5507
+ borderRadius: 6,
5508
+ lineHeight: 1.4
5386
5509
  },
5387
- children: t("yudaoSheets.modal.resetBtn")
5510
+ children: statusTip
5388
5511
  }
5389
5512
  )
5390
- ] })
5391
- ]
5392
- }
5393
- ),
5394
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { flex: 1, background: "#EEEFF1", padding: 16, overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5395
- "iframe",
5396
- {
5397
- ref: printIframeRef,
5398
- title: "Sheet Print & Expansion Preview",
5399
- srcDoc: previewHtml,
5400
- style: {
5401
- width: "100%",
5402
- height: "100%",
5403
- border: "1px solid #E3E5EA",
5404
- borderRadius: 8,
5405
- background: "#FFFFFF",
5406
- boxShadow: "0 4px 16px rgba(27, 28, 31, 0.08)"
5513
+ ]
5407
5514
  }
5408
- }
5409
- ) })
5515
+ ),
5516
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", minWidth: 0, overflow: "hidden" }, children: [
5517
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5518
+ "div",
5519
+ {
5520
+ className: "yudao-sheet-quick-export-bar",
5521
+ style: {
5522
+ background: "#F9FAFB",
5523
+ borderBottom: "1px solid #E3E5EA",
5524
+ padding: "6px 16px",
5525
+ display: "flex",
5526
+ alignItems: "center",
5527
+ justifyContent: "space-between",
5528
+ gap: 8,
5529
+ flexWrap: "wrap"
5530
+ },
5531
+ children: [
5532
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "inline-flex", alignItems: "center", gap: 6, flexWrap: "wrap" }, children: [
5533
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { style: { fontSize: 11.5, fontWeight: 600, color: "#31363F" }, children: t("yudaoSheets.modal.quickExportLabel") }),
5534
+ [
5535
+ ["xlsx", t("yudaoSheets.modal.quickExportXlsx")],
5536
+ ["pdf", t("yudaoSheets.modal.quickExportPdf")],
5537
+ ["docx", t("yudaoSheets.modal.quickExportDocx")],
5538
+ ["csv", t("yudaoSheets.modal.quickExportCsv")],
5539
+ ["html", t("yudaoSheets.modal.quickExportHtml")]
5540
+ ].map(([fmt, label]) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5541
+ "button",
5542
+ {
5543
+ type: "button",
5544
+ className: `yudao-sheet-btn ${fmt === "xlsx" ? "is-primary" : ""}`,
5545
+ style: { height: 24, padding: "0 9px", fontSize: 11 },
5546
+ onClick: () => handleDownload(fmt),
5547
+ children: label
5548
+ },
5549
+ fmt
5550
+ ))
5551
+ ] }),
5552
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5553
+ "button",
5554
+ {
5555
+ type: "button",
5556
+ className: "yudao-sheet-btn",
5557
+ style: { height: 24, padding: "0 10px", fontSize: 11 },
5558
+ onClick: handleBrowserPrint,
5559
+ children: t("yudaoSheets.modal.triggerPrintBtn")
5560
+ }
5561
+ )
5562
+ ]
5563
+ }
5564
+ ),
5565
+ queryParamFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5566
+ "div",
5567
+ {
5568
+ className: "yudao-sheet-query-bar",
5569
+ style: {
5570
+ background: "#FFFFFF",
5571
+ borderBottom: "1px solid #E3E5EA",
5572
+ padding: "10px 16px",
5573
+ display: "flex",
5574
+ flexWrap: "wrap",
5575
+ alignItems: "center",
5576
+ gap: 10
5577
+ },
5578
+ children: [
5579
+ queryParamFields.map((field) => {
5580
+ const rawVal = queryValues[field.name];
5581
+ const dictOpts = field.options ?? (field.dictCode ? templateService.getTemplateMetadata(workbook.getUnitId()).dicts?.[field.dictCode] : void 0) ?? [];
5582
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5583
+ "div",
5584
+ {
5585
+ style: {
5586
+ display: "inline-flex",
5587
+ alignItems: "center",
5588
+ gap: 6,
5589
+ fontSize: 12,
5590
+ color: "#31363F"
5591
+ },
5592
+ children: [
5593
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { fontWeight: 500, color: "#1B1C1F", whiteSpace: "nowrap" }, children: [
5594
+ field.label || field.name,
5595
+ field.required ? " *" : "",
5596
+ ":"
5597
+ ] }),
5598
+ field.widget === "select" || field.widget === "cascader" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
5599
+ "select",
5600
+ {
5601
+ style: {
5602
+ height: 28,
5603
+ padding: "0 8px",
5604
+ fontSize: 12,
5605
+ borderRadius: 6,
5606
+ border: "1px solid #E3E5EA",
5607
+ background: "#FFFFFF",
5608
+ color: "#1B1C1F",
5609
+ minWidth: 110
5610
+ },
5611
+ value: rawVal == null ? "" : String(rawVal),
5612
+ onChange: (e) => setQueryValues((prev) => ({ ...prev, [field.name]: e.target.value })),
5613
+ children: [
5614
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("yudaoSheets.modal.allOption") }),
5615
+ dictOpts.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: opt.value, children: opt.label }, opt.value))
5616
+ ]
5617
+ }
5618
+ ) : field.widget === "multiSelect" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5619
+ "input",
5620
+ {
5621
+ type: "text",
5622
+ placeholder: "\u591A\u503C\u9017\u53F7\u5206\u9694",
5623
+ style: {
5624
+ height: 28,
5625
+ padding: "0 8px",
5626
+ fontSize: 12,
5627
+ borderRadius: 6,
5628
+ border: "1px solid #E3E5EA",
5629
+ background: "#FFFFFF",
5630
+ color: "#1B1C1F",
5631
+ width: 132
5632
+ },
5633
+ value: Array.isArray(rawVal) ? rawVal.join(",") : rawVal == null ? "" : String(rawVal),
5634
+ onChange: (e) => setQueryValues((prev) => ({
5635
+ ...prev,
5636
+ [field.name]: e.target.value.split(",").map((s) => s.trim()).filter(Boolean)
5637
+ }))
5638
+ }
5639
+ ) : field.widget === "dateRange" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
5640
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5641
+ "input",
5642
+ {
5643
+ type: "date",
5644
+ style: {
5645
+ height: 28,
5646
+ padding: "0 6px",
5647
+ fontSize: 11.5,
5648
+ borderRadius: 6,
5649
+ border: "1px solid #E3E5EA",
5650
+ background: "#FFFFFF",
5651
+ color: "#1B1C1F"
5652
+ },
5653
+ value: Array.isArray(rawVal) ? String(rawVal[0] ?? "") : "",
5654
+ onChange: (e) => {
5655
+ const curArr = Array.isArray(rawVal) ? [...rawVal] : ["", ""];
5656
+ curArr[0] = e.target.value;
5657
+ setQueryValues((prev) => ({ ...prev, [field.name]: curArr }));
5658
+ }
5659
+ }
5660
+ ),
5661
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { style: { color: "#7D8698" }, children: "-" }),
5662
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5663
+ "input",
5664
+ {
5665
+ type: "date",
5666
+ style: {
5667
+ height: 28,
5668
+ padding: "0 6px",
5669
+ fontSize: 11.5,
5670
+ borderRadius: 6,
5671
+ border: "1px solid #E3E5EA",
5672
+ background: "#FFFFFF",
5673
+ color: "#1B1C1F"
5674
+ },
5675
+ value: Array.isArray(rawVal) ? String(rawVal[1] ?? "") : "",
5676
+ onChange: (e) => {
5677
+ const curArr = Array.isArray(rawVal) ? [...rawVal] : ["", ""];
5678
+ curArr[1] = e.target.value;
5679
+ setQueryValues((prev) => ({ ...prev, [field.name]: curArr }));
5680
+ }
5681
+ }
5682
+ )
5683
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5684
+ "input",
5685
+ {
5686
+ type: field.widget === "number" ? "number" : field.widget === "date" ? "date" : "text",
5687
+ placeholder: `\u8F93\u5165${field.label || field.name}`,
5688
+ style: {
5689
+ height: 28,
5690
+ padding: "0 8px",
5691
+ fontSize: 12,
5692
+ borderRadius: 6,
5693
+ border: "1px solid #E3E5EA",
5694
+ background: "#FFFFFF",
5695
+ color: "#1B1C1F",
5696
+ width: field.widget === "number" ? 96 : 124
5697
+ },
5698
+ value: rawVal == null ? "" : String(rawVal),
5699
+ onChange: (e) => setQueryValues((prev) => ({
5700
+ ...prev,
5701
+ [field.name]: field.widget === "number" && e.target.value !== "" ? Number(e.target.value) : e.target.value
5702
+ }))
5703
+ }
5704
+ )
5705
+ ]
5706
+ },
5707
+ field.name
5708
+ );
5709
+ }),
5710
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "inline-flex", alignItems: "center", gap: 6, marginLeft: "auto" }, children: [
5711
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5712
+ "button",
5713
+ {
5714
+ type: "button",
5715
+ className: "yudao-sheet-btn is-primary",
5716
+ style: { height: 28, padding: "0 12px", fontSize: 12 },
5717
+ onClick: () => {
5718
+ setPageIndex(1);
5719
+ rebuildPreview(void 0, { enabled: paginationEnabled, page: 1, pageSize }, queryValues);
5720
+ setStatusTip("\u5DF2\u6309\u67E5\u8BE2\u6761\u4EF6\u8FC7\u6EE4\u6570\u636E\u96C6\u5E76\u5237\u65B0\u9884\u89C8");
5721
+ },
5722
+ children: t("yudaoSheets.modal.queryBtn")
5723
+ }
5724
+ ),
5725
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5726
+ "button",
5727
+ {
5728
+ type: "button",
5729
+ className: "yudao-sheet-btn",
5730
+ style: { height: 28, padding: "0 12px", fontSize: 12 },
5731
+ onClick: () => {
5732
+ const resetVals = buildInitialQueryValues(queryParamFields);
5733
+ setQueryValues(resetVals);
5734
+ setPageIndex(1);
5735
+ rebuildPreview(void 0, { enabled: paginationEnabled, page: 1, pageSize }, resetVals);
5736
+ setStatusTip("\u5DF2\u91CD\u7F6E\u67E5\u8BE2\u6761\u4EF6");
5737
+ },
5738
+ children: t("yudaoSheets.modal.resetBtn")
5739
+ }
5740
+ )
5741
+ ] })
5742
+ ]
5743
+ }
5744
+ ),
5745
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { flex: 1, background: "#EEEFF1", padding: 16, overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5746
+ "iframe",
5747
+ {
5748
+ ref: printIframeRef,
5749
+ title: "Sheet Print & Expansion Preview",
5750
+ srcDoc: previewHtml,
5751
+ style: {
5752
+ width: "100%",
5753
+ height: "100%",
5754
+ border: "1px solid #E3E5EA",
5755
+ borderRadius: 8,
5756
+ background: "#FFFFFF",
5757
+ boxShadow: "0 4px 16px rgba(27, 28, 31, 0.08)"
5758
+ }
5759
+ }
5760
+ ) })
5761
+ ] })
5762
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { flex: 1, padding: 16, display: "flex", flexDirection: "column", gap: 8 }, children: [
5763
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { fontSize: 12, color: "#4E5565" }, children: [
5764
+ "\u5F53\u524D\u5DE5\u4F5C\u7C3F\u9075\u5FAA\u6807\u51C6 Univer ",
5765
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: "IWorkbookData" }),
5766
+ " JSON \u89C4\u8303\uFF08\u6269\u5C55\u5C5E\u6027\u5B58\u50A8\u5728",
5767
+ " ",
5768
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: "cell.custom.yudaoMeta" }),
5769
+ "\uFF0C\u65E0\u79C1\u6709\u5916\u90E8\u4F9D\u8D56\uFF09\uFF1A"
5770
+ ] }),
5771
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("textarea", { className: "yudao-sheet-code-area", readOnly: true, value: jsonText })
5772
+ ] })
5410
5773
  ] })
5411
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { flex: 1, padding: 16, display: "flex", flexDirection: "column", gap: 8 }, children: [
5412
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { fontSize: 12, color: "#4E5565" }, children: [
5413
- "\u5F53\u524D\u5DE5\u4F5C\u7C3F\u9075\u5FAA\u6807\u51C6 Univer ",
5414
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: "IWorkbookData" }),
5415
- " JSON \u89C4\u8303\uFF08\u6269\u5C55\u5C5E\u6027\u5B58\u50A8\u5728",
5416
- " ",
5417
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: "cell.custom.yudaoMeta" }),
5418
- "\uFF0C\u65E0\u79C1\u6709\u5916\u90E8\u4F9D\u8D56\uFF09\uFF1A"
5419
- ] }),
5420
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("textarea", { className: "yudao-sheet-code-area", readOnly: true, value: jsonText })
5421
- ] })
5422
- ] }) });
5774
+ }
5775
+ );
5423
5776
  };
5424
5777
 
5425
5778
  // src/views/overlay/SheetRichOverlayHost.tsx
5426
5779
  var import_core7 = require("@univerjs/core");
5427
5780
  var import_engine_render = require("@univerjs/engine-render");
5428
5781
  var import_sheets3 = require("@univerjs/sheets");
5429
- var import_sheets_ui3 = require("@univerjs/sheets-ui");
5782
+ var import_sheets_ui4 = require("@univerjs/sheets-ui");
5430
5783
  var import_ui6 = require("@univerjs/ui");
5431
5784
  var import_univer_sheets5 = require("@yudaocode/univer-sheets");
5432
5785
  var import_react5 = require("react");
@@ -5524,7 +5877,7 @@ var BuiltinSvgChart = ({ chart, data, onSelectItem }) => {
5524
5877
  index
5525
5878
  });
5526
5879
  };
5527
- const hasWave2Config = Boolean(chart.trendline) && chart.trendline !== "none" || Boolean(chart.errorBars && chart.errorBars.length > 0) || chart.yAxisScale === "log" || Boolean(chart.threeD) || chart.radarShape === "circle" || chart.radarFill !== void 0;
5880
+ const hasWave2Config = Boolean(chart.trendline) && chart.trendline !== "none" || Boolean(chart.errorBars && chart.errorBars.length > 0) || chart.yAxisScale === "log" || Boolean(chart.threeD) || chart.radarShape === "circle" || chart.radarFill !== void 0 || Boolean(chart.smooth) || cType === "lineSmooth" || cType === "lineStackedSmooth" || cType === "linePercentStackedSmooth" || chart.showLegend !== void 0 || Boolean(chart.legendPosition) || Boolean(chart.seriesOrientation) || Boolean(chart.series && chart.series.length > 0);
5528
5881
  if (!LEGACY_INLINE_CHART_TYPES.has(cType) || hasWave2Config) {
5529
5882
  const svgHtml = (0, import_univer_sheets5.renderSheetChartSvg)(chart, data).replace(
5530
5883
  "<svg ",
@@ -6819,14 +7172,27 @@ var SheetRichOverlayHost = () => {
6819
7172
  });
6820
7173
  const unitId2 = workbook.getUnitId();
6821
7174
  const renderUnit = renderManagerService.getRenderUnitById(unitId2);
6822
- let scrollSub;
6823
- let skelSub;
6824
- try {
6825
- const scrollMgr = renderUnit?.with(import_sheets_ui3.SheetScrollManagerService);
6826
- scrollSub = scrollMgr?.validViewportScrollInfo$.subscribe(() => setTick((v) => v + 1));
6827
- const skelMgr = renderUnit?.with(import_sheets_ui3.SheetSkeletonManagerService);
6828
- skelSub = skelMgr?.currentSkeleton$.subscribe(() => setTick((v) => v + 1));
6829
- } catch {
7175
+ const renderSubs = [];
7176
+ const bump = () => setTick((v) => v + 1);
7177
+ const watchRenderUnit = (unit) => {
7178
+ if (!unit) return;
7179
+ try {
7180
+ renderSubs.push(unit.with(import_sheets_ui4.SheetScrollManagerService).validViewportScrollInfo$.subscribe(bump));
7181
+ renderSubs.push(unit.with(import_sheets_ui4.SheetSkeletonManagerService).currentSkeleton$.subscribe(bump));
7182
+ } catch {
7183
+ }
7184
+ renderSubs.push(unit.engine.onTransformChange$.subscribeEvent(bump));
7185
+ bump();
7186
+ };
7187
+ if (renderUnit) {
7188
+ watchRenderUnit(renderUnit);
7189
+ } else {
7190
+ const createdSub = renderManagerService.created$.subscribe((unit) => {
7191
+ if (unit.unitId !== unitId2) return;
7192
+ createdSub.unsubscribe();
7193
+ watchRenderUnit(renderManagerService.getRenderUnitById(unitId2));
7194
+ });
7195
+ renderSubs.push(createdSub);
6830
7196
  }
6831
7197
  const onResize = () => setTick((v) => v + 1);
6832
7198
  window.addEventListener("resize", onResize);
@@ -6846,7 +7212,7 @@ var SheetRichOverlayHost = () => {
6846
7212
  if (!expr || !canvasEl || !renderUnit?.scene) return;
6847
7213
  e.preventDefault();
6848
7214
  try {
6849
- const skel = renderUnit.with(import_sheets_ui3.SheetSkeletonManagerService).getCurrentSkeleton();
7215
+ const skel = renderUnit.with(import_sheets_ui4.SheetSkeletonManagerService).getCurrentSkeleton();
6850
7216
  const activeSheet = workbook.getActiveSheet();
6851
7217
  if (!skel || !activeSheet) return;
6852
7218
  const rect = canvasEl.getBoundingClientRect();
@@ -6912,8 +7278,7 @@ var SheetRichOverlayHost = () => {
6912
7278
  canvasEl?.addEventListener("drop", onDrop);
6913
7279
  return () => {
6914
7280
  disp.dispose();
6915
- scrollSub?.unsubscribe();
6916
- skelSub?.unsubscribe();
7281
+ renderSubs.forEach((sub) => sub.unsubscribe());
6917
7282
  window.removeEventListener("resize", onResize);
6918
7283
  canvasEl?.removeEventListener("dragover", onDragOver);
6919
7284
  canvasEl?.removeEventListener("drop", onDrop);
@@ -6934,7 +7299,7 @@ var SheetRichOverlayHost = () => {
6934
7299
  let scrollX = 0;
6935
7300
  let scrollY = 0;
6936
7301
  try {
6937
- const skelMgr = renderUnit.with(import_sheets_ui3.SheetSkeletonManagerService);
7302
+ const skelMgr = renderUnit.with(import_sheets_ui4.SheetSkeletonManagerService);
6938
7303
  skeleton = skelMgr.getCurrentSkeleton();
6939
7304
  } catch {
6940
7305
  return null;
@@ -7847,7 +8212,7 @@ SheetsExtUIController = __decorateClass([
7847
8212
  // src/plugin.ts
7848
8213
  var import_core9 = require("@univerjs/core");
7849
8214
  var import_sheets4 = require("@univerjs/sheets");
7850
- var import_sheets_ui6 = require("@univerjs/sheets-ui");
8215
+ var import_sheets_ui7 = require("@univerjs/sheets-ui");
7851
8216
  var import_univer_sheets7 = require("@yudaocode/univer-sheets");
7852
8217
  var UNIVER_SHEETS_EXT_UI_PLUGIN_NAME = "YUDAO_UNIVER_SHEETS_EXT_UI_PLUGIN";
7853
8218
  var UniverSheetsExtUIPlugin = class extends import_core9.Plugin {
@@ -7886,7 +8251,7 @@ UniverSheetsExtUIPlugin.pluginName = UNIVER_SHEETS_EXT_UI_PLUGIN_NAME;
7886
8251
  UniverSheetsExtUIPlugin.packageName = "@yudaocode/univer-sheets-ui";
7887
8252
  UniverSheetsExtUIPlugin.type = import_core9.UniverInstanceType.UNIVER_SHEET;
7888
8253
  UniverSheetsExtUIPlugin = __decorateClass([
7889
- (0, import_core9.DependentOn)(import_sheets4.UniverSheetsPlugin, import_sheets_ui6.UniverSheetsUIPlugin, import_univer_sheets7.UniverSheetsExtPlugin),
8254
+ (0, import_core9.DependentOn)(import_sheets4.UniverSheetsPlugin, import_sheets_ui7.UniverSheetsUIPlugin, import_univer_sheets7.UniverSheetsExtPlugin),
7890
8255
  __decorateParam(1, (0, import_core9.Inject)(import_core9.Injector))
7891
8256
  ], UniverSheetsExtUIPlugin);
7892
8257
  // Annotate the CommonJS export names for ESM import in node: