@gct-paas/word 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/core/command/commands/MergeCells.d.ts +6 -1
  2. package/dist/core/command/commands/UnmergeCells.d.ts +6 -1
  3. package/dist/core/command/types.d.ts +2 -0
  4. package/dist/core/data/DataManager.d.ts +9 -0
  5. package/dist/core/event/types.d.ts +1 -1
  6. package/dist/core/index.d.ts +2 -5
  7. package/dist/core/interaction/InteractionController.d.ts +3 -0
  8. package/dist/core/interaction/types.d.ts +2 -0
  9. package/dist/core/interaction/useInteraction.d.ts +1 -0
  10. package/dist/core/layout/handlers/ImageHandler.d.ts +1 -0
  11. package/dist/core/layout/handlers/TextHandler.d.ts +5 -0
  12. package/dist/core/layout/handlers/base/BaseHandler.d.ts +5 -0
  13. package/dist/core/layout/handlers/fields/BaseHandler.d.ts +5 -0
  14. package/dist/core/model/DocModel.d.ts +1 -0
  15. package/dist/core/model/footers/Wfooter.d.ts +6 -0
  16. package/dist/core/model/headers/Wheader.d.ts +6 -0
  17. package/dist/core/model/helpers.d.ts +15 -0
  18. package/dist/core/model/images/Wimages.d.ts +12 -0
  19. package/dist/core/utils/expand.d.ts +3 -1
  20. package/dist/core/view/TableCell.d.ts +2 -0
  21. package/dist/core/view/base/LayoutNode.d.ts +3 -0
  22. package/dist/core/widget/widget-state.d.ts +14 -5
  23. package/dist/index.es.js +1005 -532
  24. package/dist/runtime/canvas/doc-layout.vue.d.ts +2 -1
  25. package/dist/runtime/canvas/table/utils/index.d.ts +1 -0
  26. package/dist/runtime/canvas/table/utils/useTableSelection.d.ts +1 -0
  27. package/dist/runtime/designer/main/editable-canvas.vue.d.ts +2 -2
  28. package/dist/runtime/designer/ribbon/components/sub-table-form-modal.vue.d.ts +6 -6
  29. package/dist/runtime/factories/modules/useSpecificConfig.d.ts +2 -0
  30. package/dist/runtime/factories/useRenderData.d.ts +1 -1
  31. package/dist/runtime/factories/useWidgetInitializer.d.ts +11 -0
  32. package/dist/runtime/renderer/main/preview-canvas.vue.d.ts +2 -2
  33. package/dist/sdk/doc-runtime/factories/useDocumentFactory.d.ts +7 -1
  34. package/dist/sdk/engine/index.d.ts +3 -3
  35. package/dist/sdk/types/index.d.ts +9 -0
  36. package/dist/sdk/vue/layouts/doc-render-layout.vue.d.ts +2 -2
  37. package/dist/{core/sdk → utils/composables}/usePagesToPdf.d.ts +1 -1
  38. package/dist/utils/func/core.d.ts +26 -9
  39. package/dist/utils/func/field.d.ts +13 -0
  40. package/dist/utils/func/file.d.ts +1 -1
  41. package/dist/utils/func/render.d.ts +10 -1
  42. package/dist/word.css +114 -114
  43. package/package.json +1 -2
  44. package/dist/base/utils/unit-converter-util.d.ts +0 -18
  45. package/dist/core/render/KonvaRenderer.d.ts +0 -46
  46. package/dist/core/render/RendererFactory.d.ts +0 -4
  47. package/dist/core/render/types.d.ts +0 -9
  48. package/dist/core/sdk/createDoc.d.ts +0 -2
  49. package/dist/runtime/interface/utils.d.ts +0 -12
  50. /package/dist/core/{sdk → utils}/DocPubApiContext.d.ts +0 -0
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ref, defineComponent, useSlots, computed, createElementBlock, openBlock, normalizeClass, createCommentVNode, createElementVNode, unref, renderSlot, cloneVNode, provide, Fragment, renderList, createBlock, resolveDynamicComponent, inject, reactive, watch, nextTick, createVNode, withCtx, toDisplayString, createTextVNode, withModifiers, Transition, withDirectives, vShow, onBeforeMount, normalizeStyle, mergeProps, onMounted, TransitionGroup, render, isVNode, onBeforeUnmount, Teleport, createApp, h as h$1, getCurrentInstance, onUnmounted, resolveComponent, isRef, withKeys, useCssVars, mergeModels, useModel, readonly, shallowRef, defineAsyncComponent, Suspense, normalizeProps, guardReactiveProps, toRef, getCurrentScope, onScopeDispose, toValue, watchEffect, createStaticVNode, createSlots, toRaw, vModelText } from "vue";
1
+ import { defineComponent, useSlots, computed, createElementBlock, openBlock, normalizeClass, createCommentVNode, createElementVNode, unref, renderSlot, cloneVNode, provide, Fragment, renderList, createBlock, resolveDynamicComponent, inject, reactive, watch, nextTick, createVNode, withCtx, toDisplayString, createTextVNode, ref, withModifiers, Transition, withDirectives, vShow, onBeforeMount, normalizeStyle, mergeProps, onMounted, TransitionGroup, render, isVNode, onBeforeUnmount, Teleport, createApp, h as h$1, getCurrentInstance, onUnmounted, resolveComponent, isRef, withKeys, useCssVars, mergeModels, useModel, readonly, shallowRef, defineAsyncComponent, Suspense, normalizeProps, guardReactiveProps, toRef, getCurrentScope, onScopeDispose, toValue, watchEffect, createStaticVNode, createSlots, toRaw, vModelText } from "vue";
2
2
  import FloatingVue, { PopperWrapper } from "floating-vue";
3
3
  import VueKonva from "vue-konva";
4
4
  import Konva from "konva";
@@ -18631,6 +18631,58 @@ function setupVueRuntime(options) {
18631
18631
  app.use(VueKonva);
18632
18632
  setupGlobDirectives(app);
18633
18633
  }
18634
+ const CommandType = {
18635
+ // 插入
18636
+ insertText: "insertText",
18637
+ // 字段
18638
+ insertField: "insertField",
18639
+ // 页面组件
18640
+ insertPaperWidget: "insertPaperWidget",
18641
+ insertFloatingOverlay: "insertFloatingOverlay",
18642
+ backspace: "backspace",
18643
+ enter: "enter",
18644
+ // 表头
18645
+ setTableHeader: "setTableHeader",
18646
+ setBoundedItem: "setBoundedItem",
18647
+ setDataGroup2D: "setDataGroup2D",
18648
+ setSubTableHeader: "setSubTableHeader",
18649
+ deleteRepeating: "deleteRepeating",
18650
+ deleteBoundedItem: "deleteBoundedItem",
18651
+ deleteDataGroup2D: "deleteDataGroup2D",
18652
+ // 表格操作
18653
+ insertRow: "insertRow",
18654
+ insertCol: "insertCol",
18655
+ deleteRow: "deleteRow",
18656
+ deleteCol: "deleteCol",
18657
+ deleteTable: "deleteTable",
18658
+ mergeCells: "mergeCells",
18659
+ // 快照
18660
+ snapshot: "snapshot",
18661
+ // 图片操作
18662
+ resizeImage: "resizeImage",
18663
+ // 表格尺寸调整
18664
+ resizeCol: "resizeCol",
18665
+ resizeRow: "resizeRow"
18666
+ };
18667
+ const isElement = (node) => node?.type === "element";
18668
+ const pickElement = (raw, name) => {
18669
+ return raw.elements?.find((n) => isElement(n) && n.name === name);
18670
+ };
18671
+ const pickAllElements = (raw, name) => {
18672
+ return raw.elements?.filter((n) => isElement(n) && n.name === name) || [];
18673
+ };
18674
+ const parseOnOffToggleFromElement = (el) => {
18675
+ if (!el) return void 0;
18676
+ const val = el["@attrs"]?.["w:val"];
18677
+ if (val === void 0 || val === "") {
18678
+ return true;
18679
+ }
18680
+ const normalized = String(val).trim().toLowerCase();
18681
+ if (normalized === "0" || normalized === "false" || normalized === "off") {
18682
+ return false;
18683
+ }
18684
+ return true;
18685
+ };
18634
18686
  const BuiltinComponentTypeConst = {
18635
18687
  /** 纸张 */
18636
18688
  Paper: "paper",
@@ -20380,6 +20432,9 @@ function isEqual(value, other) {
20380
20432
  function isNil(value) {
20381
20433
  return value == null;
20382
20434
  }
20435
+ var keyBy = createAggregator(function(result, value, key) {
20436
+ baseAssignValue(result, key, value);
20437
+ });
20383
20438
  var merge = createAssigner(function(object4, source, srcIndex) {
20384
20439
  baseMerge(object4, source, srcIndex);
20385
20440
  });
@@ -20486,71 +20541,6 @@ function unzip(array4) {
20486
20541
  });
20487
20542
  }
20488
20543
  var zip = baseRest(unzip);
20489
- function useLatestRequest(execFn) {
20490
- let lastReqId = 0;
20491
- const loading = ref(false);
20492
- const error = ref(null);
20493
- async function run(payload) {
20494
- lastReqId += 1;
20495
- const myId = lastReqId;
20496
- loading.value = true;
20497
- error.value = null;
20498
- try {
20499
- const res = await execFn(payload);
20500
- if (myId !== lastReqId) return null;
20501
- return res;
20502
- } catch (err) {
20503
- error.value = err;
20504
- throw err;
20505
- } finally {
20506
- if (myId === lastReqId) loading.value = false;
20507
- }
20508
- }
20509
- function invalidate() {
20510
- lastReqId += 1;
20511
- }
20512
- return { run, invalidate, loading, error };
20513
- }
20514
- const CommandType = {
20515
- // 插入
20516
- insertText: "insertText",
20517
- // 字段
20518
- insertField: "insertField",
20519
- // 页面组件
20520
- insertPaperWidget: "insertPaperWidget",
20521
- insertFloatingOverlay: "insertFloatingOverlay",
20522
- backspace: "backspace",
20523
- enter: "enter",
20524
- // 表头
20525
- setTableHeader: "setTableHeader",
20526
- setBoundedItem: "setBoundedItem",
20527
- setDataGroup2D: "setDataGroup2D",
20528
- setSubTableHeader: "setSubTableHeader",
20529
- deleteRepeating: "deleteRepeating",
20530
- deleteBoundedItem: "deleteBoundedItem",
20531
- deleteDataGroup2D: "deleteDataGroup2D",
20532
- // 表格操作
20533
- insertRow: "insertRow",
20534
- insertCol: "insertCol",
20535
- deleteRow: "deleteRow",
20536
- deleteCol: "deleteCol",
20537
- deleteTable: "deleteTable",
20538
- mergeCells: "mergeCells",
20539
- // 快照
20540
- snapshot: "snapshot",
20541
- // 图片操作
20542
- resizeImage: "resizeImage",
20543
- // 表格尺寸调整
20544
- resizeCol: "resizeCol",
20545
- resizeRow: "resizeRow"
20546
- };
20547
- const isElement = (node) => node?.type === "element";
20548
- const pickElement = (raw, name) => {
20549
- return raw.elements?.find((n) => isElement(n) && n.name === name);
20550
- };
20551
- const pickAllElements = (raw, name) => {
20552
- return raw.elements?.filter((n) => isElement(n) && n.name === name) || [];
20553
- };
20554
20544
  function fallbackUUID() {
20555
20545
  const bytes = new Uint8Array(16);
20556
20546
  crypto?.getRandomValues?.(bytes);
@@ -20589,12 +20579,16 @@ const isEmptyValue$1 = (value) => {
20589
20579
  }
20590
20580
  return false;
20591
20581
  };
20592
- function safeParseJson(data) {
20593
- if (typeof data !== "string") return null;
20582
+ function safeParseJson(data, fallback = null, validator2) {
20583
+ if (typeof data !== "string") return fallback;
20594
20584
  try {
20595
- return JSON.parse(data);
20585
+ const parsed = JSON.parse(data);
20586
+ if (validator2 && !validator2(parsed)) {
20587
+ return fallback;
20588
+ }
20589
+ return parsed;
20596
20590
  } catch {
20597
- return null;
20591
+ return fallback;
20598
20592
  }
20599
20593
  }
20600
20594
  function generateValuePath(fieldLink, subFieldKey) {
@@ -20606,6 +20600,9 @@ function generateValuePath(fieldLink, subFieldKey) {
20606
20600
  }
20607
20601
  function replacePathIndexPlaceholder(refPath, templatePath) {
20608
20602
  let index2;
20603
+ if (refPath === void 0) {
20604
+ return templatePath;
20605
+ }
20609
20606
  if (typeof refPath === "number") {
20610
20607
  index2 = refPath.toString();
20611
20608
  } else {
@@ -20696,9 +20693,31 @@ function getFileName(url2) {
20696
20693
  return url2.split("/").pop() || "";
20697
20694
  }
20698
20695
  }
20699
- function isNumberText(text) {
20700
- const numberReg = /^-?(0|[1-9]\d*)(\.\d+)?$/;
20701
- return numberReg.test(text.trim());
20696
+ function isNumberTextEditing(text) {
20697
+ if (text == null || typeof text !== "string") return false;
20698
+ if (/\s/.test(text)) return false;
20699
+ return /^-?\d*\.?\d*$/.test(text);
20700
+ }
20701
+ function mergeByMultiKey(A2, B2, {
20702
+ keyFields = ["type", "isCustom"],
20703
+ fieldsToMerge = ["alias", "enable"],
20704
+ isAllowMerge = true,
20705
+ isConcat = false
20706
+ } = {}) {
20707
+ if (!Array.isArray(A2)) return [];
20708
+ if (!isAllowMerge || !Array.isArray(B2) || B2.length === 0) return [...A2];
20709
+ if (isConcat && Array.isArray(A2) && A2.length === 0) return [...B2];
20710
+ const keyFn = (item) => keyFields.map((k) => {
20711
+ const v = item?.[k];
20712
+ if (typeof v === "boolean") return String(v);
20713
+ return v == null ? "" : String(v);
20714
+ }).join("::");
20715
+ const bMap = keyBy(B2, keyFn);
20716
+ const result = A2.map((a) => {
20717
+ const info = bMap[keyFn(a)];
20718
+ return info ? { ...a, ...pick(info, fieldsToMerge) } : { ...a };
20719
+ });
20720
+ return result;
20702
20721
  }
20703
20722
  function getCurrentIndex(self2) {
20704
20723
  if (!self2.parent) {
@@ -20762,12 +20781,39 @@ class ModelNode {
20762
20781
  return current;
20763
20782
  }
20764
20783
  getSection() {
20765
- const topBlock = this.getTopBlock();
20766
- const currentIndex = topBlock.getCurrentIndex();
20767
- const section = topBlock.parent?.children.find((item, index2) => {
20768
- return index2 > currentIndex && item.name == "w:secPr";
20784
+ const current = this;
20785
+ const bodyTopBlock = (() => {
20786
+ let node = current;
20787
+ while (node?.parent) {
20788
+ if (node.parent?.name === "w:body") return node;
20789
+ node = node.parent;
20790
+ }
20791
+ return null;
20792
+ })();
20793
+ if (bodyTopBlock) {
20794
+ const currentIndex = bodyTopBlock.getCurrentIndex();
20795
+ const section = bodyTopBlock.parent?.children.find((item, index2) => {
20796
+ return index2 > currentIndex && item.name === "w:secPr";
20797
+ });
20798
+ return section ?? null;
20799
+ }
20800
+ const headerFooterNode = (() => {
20801
+ let node = current;
20802
+ while (node) {
20803
+ if (node?.name === "w:hdr" || node?.name === "w:ftr") return node;
20804
+ node = node.parent;
20805
+ }
20806
+ return null;
20807
+ })();
20808
+ if (!headerFooterNode?.relId) return null;
20809
+ const root2 = this.getRoot();
20810
+ const bodyChildren = root2?.document?.body?.children ?? [];
20811
+ const sections = bodyChildren.filter((item) => item?.name === "w:secPr");
20812
+ const targetSection = sections.find((sec) => {
20813
+ const refs = headerFooterNode.name === "w:hdr" ? sec.headerRefManager?.refs : sec.footerRefManager?.refs;
20814
+ return refs?.some((ref2) => ref2.rId === headerFooterNode.relId);
20769
20815
  });
20770
- return section ?? null;
20816
+ return targetSection ?? sections[0] ?? null;
20771
20817
  }
20772
20818
  /**
20773
20819
  * 获取根节点(顶层 DocModel 对象)
@@ -21134,27 +21180,33 @@ class WrPr extends ModelNode {
21134
21180
  */
21135
21181
  get directStyle() {
21136
21182
  const style = {};
21137
- if (this.getElement("w:b")) {
21138
- style.b = true;
21183
+ const bOn = parseOnOffToggleFromElement(this.getElement("w:b"));
21184
+ if (bOn !== void 0) {
21185
+ style.b = bOn;
21139
21186
  }
21140
- if (this.getElement("w:i")) {
21141
- style.i = true;
21187
+ const iOn = parseOnOffToggleFromElement(this.getElement("w:i"));
21188
+ if (iOn !== void 0) {
21189
+ style.i = iOn;
21142
21190
  }
21143
21191
  const uElem = this.getElement("w:u");
21144
21192
  if (uElem) {
21145
21193
  style.u = uElem["@attrs"]?.["w:val"] || "single";
21146
21194
  }
21147
- if (this.getElement("w:strike")) {
21148
- style.strike = true;
21195
+ const strikeOn = parseOnOffToggleFromElement(this.getElement("w:strike"));
21196
+ if (strikeOn !== void 0) {
21197
+ style.strike = strikeOn;
21149
21198
  }
21150
- if (this.getElement("w:dstrike")) {
21151
- style.dstrike = true;
21199
+ const dstrikeOn = parseOnOffToggleFromElement(this.getElement("w:dstrike"));
21200
+ if (dstrikeOn !== void 0) {
21201
+ style.dstrike = dstrikeOn;
21152
21202
  }
21153
- if (this.getElement("w:caps")) {
21154
- style.caps = true;
21203
+ const capsOn = parseOnOffToggleFromElement(this.getElement("w:caps"));
21204
+ if (capsOn !== void 0) {
21205
+ style.caps = capsOn;
21155
21206
  }
21156
- if (this.getElement("w:smallCaps")) {
21157
- style.smallCaps = true;
21207
+ const smallCapsOn = parseOnOffToggleFromElement(this.getElement("w:smallCaps"));
21208
+ if (smallCapsOn !== void 0) {
21209
+ style.smallCaps = smallCapsOn;
21158
21210
  }
21159
21211
  const vertAlignElem = this.getElement("w:vertAlign");
21160
21212
  if (vertAlignElem) {
@@ -25901,9 +25953,9 @@ class TextStyleResolver {
25901
25953
  return {};
25902
25954
  }
25903
25955
  const style = {};
25904
- if (rPr.b) style.b = true;
25905
- if (rPr.i) style.i = true;
25906
- if (rPr.strike) style.strike = true;
25956
+ if (rPr.b !== void 0) style.b = rPr.b;
25957
+ if (rPr.i !== void 0) style.i = rPr.i;
25958
+ if (rPr.strike !== void 0) style.strike = rPr.strike;
25907
25959
  if (rPr.u) {
25908
25960
  style.u = rPr.u === true ? "single" : rPr.u;
25909
25961
  }
@@ -28646,7 +28698,7 @@ class Enter extends CommandBase {
28646
28698
  const wp = mapper.getModelNodeById(run.parent.modelRef.id);
28647
28699
  let targetModelIndex = 0;
28648
28700
  if (!run.isPlaceholderRun) {
28649
- if (run.isWidgetRun) {
28701
+ if (run.isWidgetRun || run.isPageWidgetRun) {
28650
28702
  const hitwr = mapper.getModelNodeByLayoutId(run.id);
28651
28703
  let wrIndex = wp.children.findIndex((r) => r.id === hitwr.id);
28652
28704
  targetModelIndex = ++wrIndex;
@@ -28804,17 +28856,28 @@ class InsertField extends CommandBase {
28804
28856
  handleCollapseText() {
28805
28857
  const cursor = this.doc.cursorManager;
28806
28858
  const { nodeId, offset: offset2, side } = cursor.getCursor();
28807
- const { valuePath, widgetMeta } = this.payload;
28859
+ const {
28860
+ valuePath: _valuePath,
28861
+ widgetMeta,
28862
+ mainModelFields
28863
+ } = this.payload;
28808
28864
  const mapper = this.doc.layoutMapper;
28809
28865
  const run = mapper.getLayoutNodeById(nodeId);
28810
28866
  const wp = mapper.getModelNodeById(run.parent.modelRef.id);
28867
+ let valuePath = _valuePath;
28868
+ if (run.modelRef?.valuePath2D) {
28869
+ const [subTableKey, dataGroup2DKey] = run.modelRef.valuePath2D.replace("$.", "").split(":") || [];
28870
+ const subTableModelKey = mainModelFields.find((f) => f.key === subTableKey)?.bindInfo;
28871
+ const dataGroup2DModelKey = mainModelFields.find((f) => f.key === dataGroup2DKey)?.bindInfo;
28872
+ valuePath = `$.${subTableModelKey}:${dataGroup2DModelKey}.${valuePath.replace("$.", "")}`;
28873
+ }
28811
28874
  const wr = new WrField({ text: valuePath, valuePath, widgetMeta });
28812
28875
  if (!this.validateFieldPath(valuePath, wp)) {
28813
28876
  console.warn("字段路径不合法,无法插入字段", valuePath);
28814
28877
  return null;
28815
28878
  }
28816
28879
  if (!run.isPlaceholderRun) {
28817
- if (run.isWidgetRun) {
28880
+ if (run.isWidgetRun || run.isPageWidgetRun) {
28818
28881
  const hitwr = mapper.getModelNodeByLayoutId(run.id);
28819
28882
  if (side === "before") {
28820
28883
  wp.insertBefore(hitwr, wr);
@@ -29337,7 +29400,7 @@ class InsertPaperWidget extends CommandBase {
29337
29400
  return null;
29338
29401
  } else {
29339
29402
  if (!run.isPlaceholderRun) {
29340
- if (run.isWidgetRun) {
29403
+ if (run.isWidgetRun || run.isPageWidgetRun) {
29341
29404
  const hitwr = mapper.getModelNodeByLayoutId(run.id);
29342
29405
  if (side === "before") {
29343
29406
  wp.insertBefore(hitwr, wr);
@@ -37054,15 +37117,39 @@ class InsertText extends CommandBase {
37054
37117
  }
37055
37118
  const type4 = run.widgetMeta.type;
37056
37119
  const isNumberInput = ["fw:number", "fw:double"].includes(type4);
37057
- if (isNumberInput && !isNumberText(text)) {
37058
- GctMessage.warning("输入内容不是有效的数值,请重新输入!");
37059
- this.isTerminated = true;
37060
- return null;
37061
- }
37062
37120
  const valuePath = raw.valuePath;
37063
37121
  const position2 = raw.modelRef.start + offset2 + (side === "after" ? 1 : 0);
37064
37122
  const oldText2 = String(this.doc.dataManager.get(valuePath) || "");
37065
37123
  const newText = oldText2.slice(0, position2) + text + oldText2.slice(position2);
37124
+ if (isNumberInput) {
37125
+ if (/\s/.test(text)) {
37126
+ GctMessage.warning("数值字段不允许输入空格");
37127
+ this.isTerminated = true;
37128
+ return null;
37129
+ }
37130
+ if (!isNumberTextEditing(newText)) {
37131
+ GctMessage.warning("请输入数字、小数点或负号");
37132
+ this.isTerminated = true;
37133
+ return null;
37134
+ }
37135
+ if (type4 === "fw:number") {
37136
+ const digits = Number(raw.widgetMeta?.props?.newSpecificConfig?.digits);
37137
+ if (Number.isFinite(digits) && digits > 0) {
37138
+ const decimalLimitReg = new RegExp(`^-?\\d*(\\.\\d{0,${digits}})?$`);
37139
+ if (!decimalLimitReg.test(newText)) {
37140
+ GctMessage.warning(`该字段最多保留 ${digits} 位小数`);
37141
+ this.isTerminated = true;
37142
+ return null;
37143
+ }
37144
+ } else {
37145
+ if (!/^-?\d*$/.test(newText)) {
37146
+ GctMessage.warning("该字段仅支持输入整数");
37147
+ this.isTerminated = true;
37148
+ return null;
37149
+ }
37150
+ }
37151
+ }
37152
+ }
37066
37153
  this.doc.dataManager.set(valuePath, newText);
37067
37154
  this.needsReLayout = false;
37068
37155
  if (oldText2) {
@@ -37210,7 +37297,15 @@ class MergeCells extends CommandBase {
37210
37297
  topLeftCell.merge(rowSpan, colSpan, { skipConsistency: true });
37211
37298
  }
37212
37299
  });
37213
- return null;
37300
+ const mapper = this.doc.layoutMapper;
37301
+ const normalized = this.doc.cursorManager.normalizeRange(cursor.getSelection());
37302
+ const start = mapper.getLayoutNodeById(normalized.rangeStart.nodeId);
37303
+ const wr = mapper.getModelNodeById(start.modelRef.id);
37304
+ return {
37305
+ wr,
37306
+ pos: -1,
37307
+ side: "after"
37308
+ };
37214
37309
  }
37215
37310
  }
37216
37311
  const __vite_glob_0_21$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -38036,7 +38131,15 @@ class UnmergeCells extends CommandBase {
38036
38131
  });
38037
38132
  }
38038
38133
  });
38039
- return null;
38134
+ const mapper = this.doc.layoutMapper;
38135
+ const normalized = this.doc.cursorManager.normalizeRange(cursor.getSelection());
38136
+ const start = mapper.getLayoutNodeById(normalized.rangeStart.nodeId);
38137
+ const wr = mapper.getModelNodeById(start.modelRef.id);
38138
+ return {
38139
+ wr,
38140
+ pos: -1,
38141
+ side: "after"
38142
+ };
38040
38143
  }
38041
38144
  }
38042
38145
  const __vite_glob_0_47 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -38922,7 +39025,7 @@ class Paragraph extends LayoutGroup {
38922
39025
  offset2 = this.width - this.getContextWidth();
38923
39026
  }
38924
39027
  this.forEachChild((child) => {
38925
- child.x += offset2;
39028
+ child.x += Math.max(offset2, 0);
38926
39029
  });
38927
39030
  }
38928
39031
  /**
@@ -39367,9 +39470,17 @@ class LayoutContext {
39367
39470
  if (!path2.includes("[n]")) {
39368
39471
  return path2;
39369
39472
  }
39370
- const dataIndex = this.cell?.subRenderer?.dataIndex;
39371
- if (dataIndex === void 0) return path2;
39372
- return path2.replace(/\[n\]/g, `[${dataIndex}]`);
39473
+ const {
39474
+ type: type4,
39475
+ dataIndex,
39476
+ xDataIndex
39477
+ } = this.cell?.subRenderer || {};
39478
+ let n = dataIndex;
39479
+ if (type4 === "2d-table") {
39480
+ n = xDataIndex;
39481
+ }
39482
+ if (n === void 0) return path2;
39483
+ return path2.replace(/\[n\]/g, `[${n}]`);
39373
39484
  }
39374
39485
  }
39375
39486
  class TextHandler {
@@ -39382,6 +39493,10 @@ class TextHandler {
39382
39493
  }
39383
39494
  return id;
39384
39495
  }
39496
+ static get2DInfo(context) {
39497
+ const { xDataIndex, yDataIndex, valuePath } = context.cell?.subRenderer || {};
39498
+ return { xDataIndex, yDataIndex, valuePath2D: valuePath };
39499
+ }
39385
39500
  /**
39386
39501
  * 合并部分run
39387
39502
  * @param context
@@ -39414,7 +39529,8 @@ class TextHandler {
39414
39529
  modelRef: {
39415
39530
  id: this.getId(context, wr),
39416
39531
  start: charMetrics[0]?.charIndex,
39417
- end: charMetrics[charMetrics.length - 1]?.charIndex
39532
+ end: charMetrics[charMetrics.length - 1]?.charIndex,
39533
+ ...this.get2DInfo(context)
39418
39534
  },
39419
39535
  style: layoutStyle,
39420
39536
  charMetrics
@@ -39480,7 +39596,8 @@ class TextHandler {
39480
39596
  modelRef: {
39481
39597
  id: this.getId(context, wr),
39482
39598
  start: charIndex,
39483
- end: charIndex
39599
+ end: charIndex,
39600
+ ...this.get2DInfo(context)
39484
39601
  },
39485
39602
  style: layoutStyle,
39486
39603
  charMetrics: [
@@ -39527,19 +39644,42 @@ let ImageHandler$2 = class ImageHandler {
39527
39644
  static emuToPixels(emu) {
39528
39645
  return UnitConverter.emuToPixel(emu);
39529
39646
  }
39647
+ static resolveImageQuery(context, wr) {
39648
+ const imageId = wr.drawing?.embedId;
39649
+ if (!imageId) return null;
39650
+ if (context.type !== "header" && context.type !== "footer") {
39651
+ return { imageId };
39652
+ }
39653
+ let current = wr.parent;
39654
+ while (current) {
39655
+ if (current.name === "w:hdr" || current.name === "w:ftr") {
39656
+ const ownerRelId = current.relId;
39657
+ if (!ownerRelId) break;
39658
+ return {
39659
+ imageId,
39660
+ scope: context.type,
39661
+ ownerRelId
39662
+ };
39663
+ }
39664
+ current = current.parent;
39665
+ }
39666
+ return { imageId };
39667
+ }
39530
39668
  static layout(context, wr) {
39531
39669
  if (!wr.drawing) return;
39532
39670
  const width = this.emuToPixels(wr.drawing.width);
39533
39671
  const height = this.emuToPixels(wr.drawing.height);
39534
39672
  let doc = context.doc;
39535
39673
  context.ensureParagraphSpace(width, height);
39674
+ const imageQuery = this.resolveImageQuery(context, wr);
39675
+ const src = imageQuery ? doc.model.images.getImageUrl(imageQuery) || doc.model.images.getImageUrlById(imageQuery.imageId) || "" : "";
39536
39676
  const run = new ImageRun({
39537
39677
  doc,
39538
39678
  width,
39539
39679
  height,
39540
39680
  x: context.getRunX(),
39541
39681
  y: 0,
39542
- src: doc.model.images.getImageUrlById(wr.drawing.embedId),
39682
+ src,
39543
39683
  modelRef: {
39544
39684
  id: wr.id,
39545
39685
  start: 0,
@@ -39676,6 +39816,10 @@ let BaseHandler$1 = class BaseHandler {
39676
39816
  }
39677
39817
  return id;
39678
39818
  }
39819
+ static get2DInfo(context) {
39820
+ const { xDataIndex, yDataIndex, valuePath } = context.cell?.subRenderer || {};
39821
+ return { xDataIndex, yDataIndex, valuePath2D: valuePath };
39822
+ }
39679
39823
  static getValue(ctx, valuePath) {
39680
39824
  const { context } = ctx;
39681
39825
  const dm = context.doc.dataManager;
@@ -39769,7 +39913,8 @@ let BaseHandler$1 = class BaseHandler {
39769
39913
  modelRef: {
39770
39914
  id: this.getId(context, wr),
39771
39915
  start: charIndex,
39772
- end: charIndex
39916
+ end: charIndex,
39917
+ ...this.get2DInfo(context)
39773
39918
  },
39774
39919
  widgetMeta: wr.widgetMeta,
39775
39920
  valuePath: context.getValuePath(wr.valuePath)
@@ -39813,7 +39958,8 @@ let BaseHandler$1 = class BaseHandler {
39813
39958
  modelRef: {
39814
39959
  id: this.getId(context, wr),
39815
39960
  start: charIndex,
39816
- end: charIndex
39961
+ end: charIndex,
39962
+ ...this.get2DInfo(context)
39817
39963
  },
39818
39964
  widgetMeta: wr.widgetMeta,
39819
39965
  valuePath: context.getValuePath(wr.valuePath),
@@ -39849,7 +39995,8 @@ let BaseHandler$1 = class BaseHandler {
39849
39995
  modelRef: {
39850
39996
  id: this.getId(context, wr),
39851
39997
  start: 0,
39852
- end: 0
39998
+ end: 0,
39999
+ ...this.get2DInfo(context)
39853
40000
  },
39854
40001
  widgetMeta: wr.widgetMeta,
39855
40002
  valuePath: context.getValuePath(wr.valuePath),
@@ -39886,7 +40033,8 @@ let BaseHandler$1 = class BaseHandler {
39886
40033
  modelRef: {
39887
40034
  id: this.getId(context, wr),
39888
40035
  start: charIndex,
39889
- end: charIndex
40036
+ end: charIndex,
40037
+ ...this.get2DInfo(context)
39890
40038
  },
39891
40039
  widgetMeta: wr.widgetMeta,
39892
40040
  valuePath: context.getValuePath(wr.valuePath),
@@ -39917,7 +40065,8 @@ let BaseHandler$1 = class BaseHandler {
39917
40065
  modelRef: {
39918
40066
  id: this.getId(context, wr),
39919
40067
  start: 0,
39920
- end: 0
40068
+ end: 0,
40069
+ ...this.get2DInfo(context)
39921
40070
  },
39922
40071
  widgetMeta: wr.widgetMeta,
39923
40072
  valuePath: context.getValuePath(wr.valuePath),
@@ -39963,7 +40112,8 @@ let BaseHandler$1 = class BaseHandler {
39963
40112
  modelRef: {
39964
40113
  id: this.getId(context, wr),
39965
40114
  start: 0,
39966
- end: 0
40115
+ end: 0,
40116
+ ...this.get2DInfo(context)
39967
40117
  },
39968
40118
  widgetMeta: wr.widgetMeta,
39969
40119
  valuePath: context.getValuePath(wr.valuePath),
@@ -40114,7 +40264,8 @@ let ImageHandler$1 = class ImageHandler2 extends BaseHandler$1 {
40114
40264
  modelRef: {
40115
40265
  id: this.getId(context, wr),
40116
40266
  start: index2,
40117
- end: index2
40267
+ end: index2,
40268
+ ...this.get2DInfo(context)
40118
40269
  },
40119
40270
  widgetMeta: wr.widgetMeta,
40120
40271
  valuePath: context.getValuePath(wr.valuePath)
@@ -40360,7 +40511,8 @@ class SignatureHandler extends BaseHandler$1 {
40360
40511
  modelRef: {
40361
40512
  id: this.getId(context, wr),
40362
40513
  start: index2,
40363
- end: index2
40514
+ end: index2,
40515
+ ...this.get2DInfo(context)
40364
40516
  },
40365
40517
  widgetMeta: wr.widgetMeta,
40366
40518
  valuePath: context.getValuePath(wr.valuePath)
@@ -40419,7 +40571,8 @@ class InputHandler extends BaseHandler$1 {
40419
40571
  modelRef: {
40420
40572
  id: this.getId(context, wr),
40421
40573
  start: charIndex,
40422
- end: charIndex
40574
+ end: charIndex,
40575
+ ...this.get2DInfo(context)
40423
40576
  },
40424
40577
  widgetMeta: wr.widgetMeta,
40425
40578
  valuePath: context.getValuePath(wr.valuePath),
@@ -40552,17 +40705,37 @@ class BaseHandler2 {
40552
40705
  */
40553
40706
  getDataIndex(init2 = null) {
40554
40707
  const { context } = this;
40555
- return context.cell?.subRenderer?.dataIndex ?? init2;
40708
+ const {
40709
+ type: type4,
40710
+ dataIndex,
40711
+ xDataIndex
40712
+ } = context.cell?.subRenderer || {};
40713
+ return (type4 === "2d-table" ? xDataIndex : dataIndex) ?? init2;
40714
+ }
40715
+ getPaperIndex() {
40716
+ const { context } = this;
40717
+ if (context.type === "header" || context.type === "footer") {
40718
+ return Math.max(0, context.page?.pageIndex);
40719
+ }
40720
+ return null;
40556
40721
  }
40557
40722
  getId() {
40558
40723
  const { wr } = this;
40559
40724
  let id = wr.id;
40560
40725
  const dataIndex = this.getDataIndex();
40726
+ const pageIndex = this.getPaperIndex();
40561
40727
  if (typeof dataIndex === "number") {
40562
40728
  id = `${wr.id}@${dataIndex}`;
40729
+ } else if (typeof pageIndex === "number") {
40730
+ id = `${wr.id}$p${pageIndex}`;
40563
40731
  }
40564
40732
  return id;
40565
40733
  }
40734
+ get2DInfo() {
40735
+ const { context } = this;
40736
+ const { xDataIndex, yDataIndex } = context.cell?.subRenderer || {};
40737
+ return { xDataIndex, yDataIndex };
40738
+ }
40566
40739
  getLayoutStyle() {
40567
40740
  const { wr, context } = this;
40568
40741
  const textStyle = TextStyleResolver.resolve(wr.rPr, context.doc.model?.styles);
@@ -40593,7 +40766,8 @@ class SerialNumberHandler extends BaseHandler2 {
40593
40766
  modelRef: {
40594
40767
  id: this.getId(),
40595
40768
  start: charIndex,
40596
- end: charIndex
40769
+ end: charIndex,
40770
+ ...this.get2DInfo()
40597
40771
  },
40598
40772
  pageWidgetMeta: wr.pageWidgetMeta,
40599
40773
  charMetrics: [
@@ -40631,7 +40805,8 @@ class DefaultHandler extends BaseHandler2 {
40631
40805
  modelRef: {
40632
40806
  id: this.getId(),
40633
40807
  start: charIndex,
40634
- end: charIndex
40808
+ end: charIndex,
40809
+ ...this.get2DInfo()
40635
40810
  },
40636
40811
  pageWidgetMeta: wr.pageWidgetMeta,
40637
40812
  charMetrics: [
@@ -40662,7 +40837,7 @@ class QrCodeHandler extends BaseHandler2 {
40662
40837
  y: 0,
40663
40838
  src: "",
40664
40839
  modelRef: {
40665
- id: wr.id,
40840
+ id: this.getId(),
40666
40841
  start: 0,
40667
40842
  end: 0
40668
40843
  },
@@ -40720,7 +40895,7 @@ class BarcodeHandler extends BaseHandler2 {
40720
40895
  y: 0,
40721
40896
  src: "",
40722
40897
  modelRef: {
40723
- id: wr.id,
40898
+ id: this.getId(),
40724
40899
  start: 0,
40725
40900
  end: 0
40726
40901
  },
@@ -40746,7 +40921,7 @@ class ImageHandler3 extends BaseHandler2 {
40746
40921
  y: 0,
40747
40922
  src: "",
40748
40923
  modelRef: {
40749
- id: wr.id,
40924
+ id: this.getId(),
40750
40925
  start: 0,
40751
40926
  end: 0
40752
40927
  },
@@ -40819,7 +40994,8 @@ class PaginationHandler extends BaseHandler2 {
40819
40994
  modelRef: {
40820
40995
  id: this.getId(),
40821
40996
  start: charIndex,
40822
- end: charIndex
40997
+ end: charIndex,
40998
+ ...this.get2DInfo()
40823
40999
  },
40824
41000
  pageWidgetMeta: wr.pageWidgetMeta,
40825
41001
  charMetrics: [
@@ -41396,7 +41572,8 @@ class TableSplitter {
41396
41572
  doc: cell.doc,
41397
41573
  x: cell.x,
41398
41574
  modelRef: cell.modelRef,
41399
- subRenderer: cell.subRenderer
41575
+ subRenderer: cell.subRenderer,
41576
+ backgroundColor: cell.backgroundColor
41400
41577
  };
41401
41578
  }
41402
41579
  }
@@ -41617,7 +41794,9 @@ class TableExpander {
41617
41794
  }
41618
41795
  } else if (this.rowIndex2DTableMapper.has(r)) {
41619
41796
  const region = this.rowIndex2DTableMapper.get(r);
41620
- this.initialize2DTableRowsInRange(r, wtr, region);
41797
+ if (r === region.start.row) {
41798
+ this.initialize2DTableRowsInRange(r, region);
41799
+ }
41621
41800
  } else if (this.rowIndexBoundedMapper.has(r)) {
41622
41801
  const region = this.rowIndexBoundedMapper.get(r);
41623
41802
  this.initializeBoundedRowInRange(r, wtr, region);
@@ -41632,17 +41811,17 @@ class TableExpander {
41632
41811
  }
41633
41812
  }
41634
41813
  }
41635
- getDataCount(region) {
41814
+ getRepeatCount(region) {
41636
41815
  if (this.doc.mode === DocModeTypeConst.Edit) {
41637
41816
  return 1;
41638
41817
  }
41639
41818
  return this.data.get(region.valuePath)?.length || 1;
41640
41819
  }
41641
41820
  initializeRepeatingRowsInRange(region) {
41642
- const dataCount = this.getDataCount(region);
41821
+ const repeatCount = this.getRepeatCount(region);
41643
41822
  const repeatRows = this.table.children.slice(region.start.row, region.end.row + 1);
41644
41823
  const repeatRowsCount = repeatRows.length;
41645
- repeat(dataCount, (dataIndex) => {
41824
+ repeat(repeatCount, (dataIndex) => {
41646
41825
  repeatRows.forEach((_wtr, _wtrIndex) => {
41647
41826
  const row = {
41648
41827
  id: `${_wtr.id}@${dataIndex}`,
@@ -41653,14 +41832,14 @@ class TableExpander {
41653
41832
  const cell2 = {
41654
41833
  id: `${wtc.id}@${dataIndex}`,
41655
41834
  expandFromId: wtc.id,
41656
- rowspan: (wtc.rowspan ?? 1) + repeatRowsCount * (dataCount - 1),
41835
+ rowspan: (wtc.rowspan ?? 1) + repeatRowsCount * (repeatCount - 1),
41657
41836
  colspan: wtc.colspan ?? 1
41658
41837
  };
41659
41838
  this.instanceMapper.set(cell2.id, cell2);
41660
41839
  return cell2;
41661
41840
  } else {
41662
41841
  const instanceCell = this.instanceMapper.get(`${wtc.mergeFromId}@0`) ?? this.instanceMapper.get(wtc.mergeFromId);
41663
- instanceCell.rowspan = (instanceCell.rowspan ?? 1) + repeatRowsCount * (dataCount - 1);
41842
+ instanceCell.rowspan = (instanceCell.rowspan ?? 1) + repeatRowsCount * (repeatCount - 1);
41664
41843
  }
41665
41844
  }
41666
41845
  const cell = {
@@ -41682,31 +41861,53 @@ class TableExpander {
41682
41861
  });
41683
41862
  });
41684
41863
  }
41685
- initialize2DTableRowsInRange(r, wtr, region) {
41686
- const row = {
41687
- id: wtr.id,
41688
- expandFromId: wtr.id,
41689
- cells: wtr.children.map((wtc, wtcIndex) => {
41690
- const dataIndexMeta = this._2DTableCellDataIndexMap.get(`${r},${wtcIndex}`);
41691
- const cell = {
41692
- id: wtc.id,
41693
- expandFromId: dataIndexMeta?.refCellId ?? wtc.id,
41694
- // 这里的id需要复用
41695
- rowspan: wtc.rowspan ?? 1,
41696
- colspan: wtc.colspan ?? 1
41864
+ initialize2DTableRowsInRange(r, region) {
41865
+ const repeatCount = this.getRepeatCount(region);
41866
+ const repeatRows = this.table.children.slice(region.start.row, region.end.row + 1);
41867
+ const repeatRowsCount = repeatRows.length;
41868
+ repeat(repeatCount, (yDataIndex) => {
41869
+ repeatRows.forEach((_wtr, _wtrIndex) => {
41870
+ const row = {
41871
+ id: `${_wtr.id}@${yDataIndex}`,
41872
+ expandFromId: _wtr.id,
41873
+ cells: _wtr.children.map((wtc, wtcIndex) => {
41874
+ const dataIndexMeta = this._2DTableCellDataIndexMap.get(`${r + _wtrIndex},${wtcIndex}`);
41875
+ const xDataIndex = dataIndexMeta?.dataIndex;
41876
+ if (yDataIndex === 0 && _wtrIndex === repeatRowsCount - 1 && (wtcIndex < region.start.col || wtcIndex > region.end.col)) {
41877
+ if (!wtc.mergeFromId) {
41878
+ const cell2 = {
41879
+ id: `${wtc.id}@${yDataIndex}`,
41880
+ expandFromId: wtc.id,
41881
+ rowspan: (wtc.rowspan ?? 1) + repeatRowsCount * (repeatCount - 1),
41882
+ colspan: wtc.colspan ?? 1
41883
+ };
41884
+ this.instanceMapper.set(cell2.id, cell2);
41885
+ return cell2;
41886
+ } else {
41887
+ const instanceCell = this.instanceMapper.get(`${wtc.mergeFromId}@0`) ?? this.instanceMapper.get(wtc.mergeFromId);
41888
+ instanceCell.rowspan = (instanceCell.rowspan ?? 1) + repeatRowsCount * (repeatCount - 1);
41889
+ }
41890
+ }
41891
+ const cell = {
41892
+ id: `${wtc.id}@${yDataIndex}`,
41893
+ expandFromId: dataIndexMeta?.refCellId || wtc.id,
41894
+ rowspan: wtc.rowspan ?? 1,
41895
+ colspan: wtc.colspan ?? 1,
41896
+ xDataIndex
41897
+ };
41898
+ if (region.contains(region.start.row + _wtrIndex, wtcIndex)) {
41899
+ cell.dataIndex = yDataIndex;
41900
+ cell.yDataIndex = yDataIndex;
41901
+ cell._2DTableId = region.id;
41902
+ }
41903
+ this.instanceMapper.set(cell.id, cell);
41904
+ return cell;
41905
+ })
41697
41906
  };
41698
- if (region.start.col <= wtcIndex && wtcIndex <= region.end.col) {
41699
- cell._2DTableId = region.id;
41700
- }
41701
- if (dataIndexMeta?.dataIndex !== void 0) {
41702
- cell.dataIndex = dataIndexMeta.dataIndex;
41703
- }
41704
- this.instanceMapper.set(cell.id, cell);
41705
- return cell;
41706
- })
41707
- };
41708
- this.instanceMapper.set(row.id, row);
41709
- this.rows.push(row);
41907
+ this.instanceMapper.set(row.id, row);
41908
+ this.rows.push(row);
41909
+ });
41910
+ });
41710
41911
  }
41711
41912
  initializeBoundedRowInRange(r, wtr, region) {
41712
41913
  const row = {
@@ -41908,7 +42109,10 @@ class TableInfoProvider {
41908
42109
  return {
41909
42110
  id: cell._2DTableId,
41910
42111
  type: "2d-table",
42112
+ // 二维表使用 cell 的扩展字段
41911
42113
  dataIndex: cell.dataIndex,
42114
+ xDataIndex: cell.xDataIndex,
42115
+ yDataIndex: cell.yDataIndex,
41912
42116
  valuePath: region?.valuePath,
41913
42117
  widgetMeta: region?.widgetMeta
41914
42118
  };
@@ -42278,7 +42482,7 @@ class LayoutManager {
42278
42482
  /**
42279
42483
  * 布局单元格内容
42280
42484
  */
42281
- layoutCellContent(cellContent, tableCell, dataIndex) {
42485
+ layoutCellContent(cellContent, tableCell) {
42282
42486
  const cellContext = new LayoutContext({
42283
42487
  type: "cell",
42284
42488
  doc: this.doc,
@@ -43618,9 +43822,30 @@ class InteractionController {
43618
43822
  onChangeDragHoverId(hitId) {
43619
43823
  this.doc.interactionManager.set("dragHoverId", hitId);
43620
43824
  }
43825
+ onSetActiveTableId(tableId) {
43826
+ this.doc.interactionManager.set("activeTableId", tableId);
43827
+ }
43828
+ clearActiveTableId() {
43829
+ this.doc.interactionManager.clear("activeTableId");
43830
+ }
43831
+ syncActiveTableByMeta(meta) {
43832
+ if (!meta?.line || meta.line.lineType !== "tablerow" || isClickPaperWidgetAllNode(meta)) {
43833
+ this.clearActiveTableId();
43834
+ return;
43835
+ }
43836
+ const tableId = meta.line.tableId;
43837
+ if (!tableId) {
43838
+ this.clearActiveTableId();
43839
+ return;
43840
+ }
43841
+ this.onSetActiveTableId(tableId);
43842
+ }
43621
43843
  resolveIntent(id, hitId) {
43622
43844
  const meta = this.doc.layoutMapper.getBaseMetaNodeById(id);
43623
43845
  const isFillMode = this.doc.isInFillMode();
43846
+ if (this.doc.isInEditMode()) {
43847
+ this.syncActiveTableByMeta(meta);
43848
+ }
43624
43849
  if (meta) {
43625
43850
  if (isClickSelectAllNode(meta)) {
43626
43851
  const widgetMeta = meta.raw.widgetMeta;
@@ -43724,8 +43949,9 @@ class InteractionController {
43724
43949
  if (this.doc.isInEditMode() && panelData && panelData.panelType === "panel:widget") {
43725
43950
  const node = this.doc.layoutMapper.getModelNodeById(panelData.modelId);
43726
43951
  const sel = node?.getSection();
43952
+ const isHeaderFooterEdit = this.doc.interactionManager.get("isHeaderFooterEdit");
43727
43953
  this.onActivePanelData({
43728
- type: "panel:paper",
43954
+ type: isHeaderFooterEdit ? "panel:paper-header-footer" : "panel:paper",
43729
43955
  extra: {
43730
43956
  secRefId: sel?.id
43731
43957
  }
@@ -43762,28 +43988,52 @@ class InteractionController {
43762
43988
  destroy() {
43763
43989
  }
43764
43990
  }
43991
+ function resolveDisplayStatusFromAuth(options) {
43992
+ const { info, readonlyString, editString } = options;
43993
+ if (isEmpty(info)) return null;
43994
+ if (info.edit && !info.readonly) {
43995
+ return editString;
43996
+ }
43997
+ if (info.readonly && !info.edit) {
43998
+ return readonlyString;
43999
+ }
44000
+ return null;
44001
+ }
43765
44002
  function resolveWidgetState(ctx) {
43766
- const required4 = ctx.isEditMode ? !!ctx.required : !!ctx.newRequired;
44003
+ const required4 = ctx.doc.isInEditMode() ? !!ctx.required : !!ctx.newRequired;
43767
44004
  let readonly2 = false;
43768
- if (ctx.isEditMode) {
44005
+ if (ctx.doc.isInEditMode()) {
43769
44006
  readonly2 = false;
43770
- } else if (ctx.isPrintMode) {
44007
+ } else if (ctx.doc.isInPrintMode()) {
43771
44008
  readonly2 = true;
43772
44009
  } else if (ctx.newReadonly !== void 0) {
43773
44010
  readonly2 = !!ctx.newReadonly;
43774
44011
  }
43775
- const disabled = ctx.isEditMode ? !!ctx.disabled : !!ctx.newDisabled;
44012
+ const disabled = ctx.doc.isInEditMode() ? !!ctx.disabled : !!ctx.newDisabled;
43776
44013
  const readonlyString = ctx.viewState === ViewStateTypeConst.Disabled || ctx.viewState === ViewStateTypeConst.Auto ? "readonly-component" : "readonly-text";
43777
44014
  const editString = readonly2 ? "readonly-component" : "edit-component";
43778
44015
  let displayStatus;
44016
+ const fromAuth = resolveDisplayStatusFromAuth({
44017
+ info: ctx.doc.docRuntimeMeta.handleInfo.bpmnFieldAuthMap?.[`${ctx.modelLink}.${ctx.fieldLink}`],
44018
+ readonlyString,
44019
+ editString
44020
+ });
43779
44021
  if (ctx.isLinkedModelField || ctx.cannotInput) {
43780
44022
  displayStatus = readonlyString;
43781
- } else if (ctx.docMode === DocModeTypeConst.Fill) {
43782
- displayStatus = editString;
43783
- } else if (ctx.docMode === DocModeTypeConst.Print) {
44023
+ } else if (ctx.doc.mode === DocModeTypeConst.Print) {
43784
44024
  displayStatus = readonlyString;
44025
+ } else if (ctx.doc.mode === DocModeTypeConst.Fill) {
44026
+ if (fromAuth) {
44027
+ displayStatus = fromAuth;
44028
+ } else if (ctx.doc.formType !== FormTypeConst.PROCESS) {
44029
+ displayStatus = editString;
44030
+ } else {
44031
+ const bpmnType = ctx.doc.docRuntimeMeta.handleInfo?.bpmnType;
44032
+ const isReadonlyNode = bpmnType === "bpmnApproval" || bpmnType === "bpmnJudge";
44033
+ displayStatus = isReadonlyNode ? readonlyString : editString;
44034
+ }
43785
44035
  } else {
43786
- displayStatus = readonly2 ? "readonly-text" : "edit-component";
44036
+ displayStatus = editString;
43787
44037
  }
43788
44038
  const finalDisabled = displayStatus === "edit-component" ? disabled : ctx.viewState === ViewStateTypeConst.Disabled || disabled;
43789
44039
  return {
@@ -43803,21 +44053,21 @@ class InteractionPolicy {
43803
44053
  if (this.doc.isInPrintMode()) return false;
43804
44054
  if (this.doc.preview) return false;
43805
44055
  if (validateTextWidgetMarker(run, true)) {
43806
- const type4 = run.widgetMeta.type;
44056
+ const widgetMeta = run.widgetMeta;
44057
+ const type4 = widgetMeta.type;
43807
44058
  const isInput = ["fw:input", "fw:number", "fw:double"].includes(type4);
43808
44059
  if (this.doc.isInEditMode()) return false;
43809
- const widgetMeta = run.widgetMeta;
43810
44060
  const state = resolveWidgetState({
43811
- docMode: this.doc.mode,
43812
- isEditMode: this.doc.isInEditMode(),
43813
- isPrintMode: this.doc.isInPrintMode(),
44061
+ doc: this.doc,
43814
44062
  viewState: widgetMeta.props.viewState,
43815
44063
  disabled: widgetMeta.props.disabled,
43816
44064
  newDisabled: widgetMeta.props.newSpecificConfig?.newDisabled,
43817
44065
  readonly: widgetMeta.props.readonly,
43818
44066
  newReadonly: widgetMeta.props.newSpecificConfig?.newReadonly,
43819
44067
  cannotInput: widgetMeta.props.cannotInput,
43820
- isLinkedModelField: widgetMeta.field?.isLinkedModelField
44068
+ isLinkedModelField: widgetMeta.field?.isLinkedModelField,
44069
+ fieldLink: widgetMeta.field?.fieldLink || "",
44070
+ modelLink: widgetMeta.field?.modelLink || ""
43821
44071
  });
43822
44072
  const isReadonly = state.displayStatus === "readonly-component" || state.displayStatus === "readonly-text";
43823
44073
  if (state.disabled || isReadonly) {
@@ -43834,20 +44084,20 @@ class InteractionPolicy {
43834
44084
  if (this.doc.preview) return false;
43835
44085
  if (validateTextWidgetMarker(run, true)) {
43836
44086
  if (this.doc.isInEditMode()) return true;
43837
- const type4 = run.widgetMeta.type;
43838
- const isInput = ["fw:input", "fw:number", "fw:double"].includes(type4);
43839
44087
  const widgetMeta = run.widgetMeta;
44088
+ const type4 = widgetMeta.type;
44089
+ const isInput = ["fw:input", "fw:number", "fw:double"].includes(type4);
43840
44090
  const state = resolveWidgetState({
43841
- docMode: this.doc.mode,
43842
- isEditMode: this.doc.isInEditMode(),
43843
- isPrintMode: this.doc.isInPrintMode(),
44091
+ doc: this.doc,
43844
44092
  viewState: widgetMeta.props.viewState,
43845
44093
  disabled: widgetMeta.props.disabled,
43846
44094
  newDisabled: widgetMeta.props.newSpecificConfig?.newDisabled,
43847
44095
  readonly: widgetMeta.props.readonly,
43848
44096
  newReadonly: widgetMeta.props.newSpecificConfig?.newReadonly,
43849
44097
  cannotInput: widgetMeta.props.cannotInput,
43850
- isLinkedModelField: widgetMeta.field?.isLinkedModelField
44098
+ isLinkedModelField: widgetMeta.field?.isLinkedModelField,
44099
+ fieldLink: widgetMeta.field?.fieldLink || "",
44100
+ modelLink: widgetMeta.field?.modelLink || ""
43851
44101
  });
43852
44102
  const isReadonly = state.displayStatus === "readonly-component" || state.displayStatus === "readonly-text";
43853
44103
  if (state.disabled || isReadonly) {
@@ -44541,6 +44791,25 @@ class DataManager {
44541
44791
  getLabel(path2) {
44542
44792
  return this.get(this.getLabelPath(path2)) || this.get(path2);
44543
44793
  }
44794
+ /**
44795
+ * 根据 jsonpath 设置数据
44796
+ * @param path jsonpath 路径
44797
+ * @param value 要设置的值
44798
+ * @param x
44799
+ * @param y
44800
+ * @returns 是否设置成功
44801
+ */
44802
+ set2D(path2, value, x2, y2, source = "user") {
44803
+ try {
44804
+ const oldValue = this.getByPath(this.rawData, path2);
44805
+ this.setByPath(this.rawData, path2, value);
44806
+ this.emit(path2, value, oldValue, source);
44807
+ return true;
44808
+ } catch (error) {
44809
+ console.error(`Failed to set value at path "${path2}":`, error);
44810
+ return false;
44811
+ }
44812
+ }
44544
44813
  /**
44545
44814
  * 根据 jsonpath 设置数据
44546
44815
  * @param path jsonpath 路径
@@ -44926,6 +45195,7 @@ class DataManager {
44926
45195
  * 调度 emit 事件,自动合并相同 path 的事件
44927
45196
  */
44928
45197
  emit(path2, newValue, oldValue, source = "user") {
45198
+ console.log("emitemit", { path: path2, newValue, oldValue, source });
44929
45199
  this.emitQueue.set(path2, { newValue, oldValue });
44930
45200
  if (this.emitScheduled) return;
44931
45201
  this.emitScheduled = true;
@@ -45149,6 +45419,7 @@ class InteractionManager {
45149
45419
  const wsecPr = bodyContent.find((item) => item.name === "w:secPr");
45150
45420
  this.state = {
45151
45421
  tableSelection: null,
45422
+ activeTableId: "",
45152
45423
  dragHoverId: "",
45153
45424
  hoverModelId: "",
45154
45425
  focusModelId: "",
@@ -45425,9 +45696,6 @@ class Doc {
45425
45696
  return instances;
45426
45697
  }
45427
45698
  }
45428
- function newDoc(options) {
45429
- return new Doc(options);
45430
- }
45431
45699
  const DESIGN_SUITE_CONTEXT_KEY = Symbol.for("SuiteDesignContext");
45432
45700
  const DOC_PUBLIC_API_KEY = Symbol.for("DocPublicApi");
45433
45701
  const DOC_INFO_KEY = Symbol.for("DocInfo");
@@ -45489,162 +45757,6 @@ function useDocPubApiContext() {
45489
45757
  withLayoutComputed
45490
45758
  };
45491
45759
  }
45492
- function convertPxToPaperSize(pageSize, customSize) {
45493
- if (pageSize === PageSizeEnumConst.A3) {
45494
- return {
45495
- size: "a3",
45496
- width: "297mm",
45497
- height: "420mm"
45498
- };
45499
- }
45500
- if (pageSize === PageSizeEnumConst.A4) {
45501
- return {
45502
- size: "a4",
45503
- width: "210mm",
45504
- height: "297mm"
45505
- };
45506
- }
45507
- if (pageSize === PageSizeEnumConst.A5) {
45508
- return {
45509
- size: "a5",
45510
- width: "148mm",
45511
- height: "210mm"
45512
- };
45513
- }
45514
- return {
45515
- size: "",
45516
- width: `${customSize[0]}mm`,
45517
- height: `${customSize[1]}mm`
45518
- };
45519
- }
45520
- function usePrint() {
45521
- const getPageSize = (item, paperSize) => {
45522
- const isLandscape = item.width > item.height;
45523
- const width = parseInt(isLandscape ? paperSize.height : paperSize.width);
45524
- const height = parseInt(isLandscape ? paperSize.width : paperSize.height);
45525
- return { isLandscape, width, height };
45526
- };
45527
- const waitImageLoad = (img) => {
45528
- return new Promise((resolve) => {
45529
- if (img.complete) return resolve();
45530
- img.onload = () => resolve();
45531
- img.onerror = () => resolve();
45532
- });
45533
- };
45534
- const printView = async (paperList, options) => {
45535
- const { pageSize, customSize, direction } = options;
45536
- const iframe = document.createElement("iframe");
45537
- iframe.style.cssText = `
45538
- visibility:hidden;
45539
- position:absolute;
45540
- left: 0;
45541
- top:0;
45542
- width:0;
45543
- height:0;
45544
- border:none;
45545
- `;
45546
- document.body.appendChild(iframe);
45547
- const doc = iframe.contentWindow.document;
45548
- doc.open();
45549
- const container2 = document.createElement("div");
45550
- const paperSize = convertPxToPaperSize(pageSize, customSize);
45551
- const isGlobalLandscape = direction === OrientationTypeConst.Landscape;
45552
- const imgTasks = [];
45553
- paperList.forEach((item) => {
45554
- const pageWrapper = document.createElement("div");
45555
- pageWrapper.style.cssText = `
45556
- position:relative;
45557
- width:${paperSize.width};
45558
- height:${paperSize.height};
45559
- `;
45560
- const isPageLandscape = item.width > item.height;
45561
- const needRotate = isGlobalLandscape && !isPageLandscape || !isGlobalLandscape && isPageLandscape;
45562
- const img = document.createElement("img");
45563
- img.src = item.base64;
45564
- if (needRotate) {
45565
- img.style.cssText = `
45566
- position:absolute;
45567
- left:50%;
45568
- top:50%;
45569
- width:${isGlobalLandscape ? paperSize.width : paperSize.height};
45570
- height:${isGlobalLandscape ? paperSize.height : paperSize.width};
45571
- transform:translate(-50%, -50%) rotate(90deg);
45572
- `;
45573
- } else {
45574
- img.style.cssText = `
45575
- position:absolute;
45576
- left: 0;
45577
- top:0;
45578
- width:100%;
45579
- height:100%;
45580
- `;
45581
- }
45582
- imgTasks.push(waitImageLoad(img));
45583
- pageWrapper.appendChild(img);
45584
- container2.appendChild(pageWrapper);
45585
- });
45586
- const style = document.createElement("style");
45587
- style.innerHTML = `
45588
- * { margin:0; padding:0; }
45589
- @page {
45590
- margin:0;
45591
- size:${paperSize.size} ${isGlobalLandscape ? "landscape" : "portrait"};
45592
- }
45593
- `;
45594
- doc.write(style.outerHTML + container2.innerHTML);
45595
- await Promise.all(imgTasks);
45596
- setTimeout(async () => {
45597
- iframe.contentWindow.print();
45598
- doc.close();
45599
- window.addEventListener(
45600
- "mouseover",
45601
- () => {
45602
- iframe?.remove();
45603
- },
45604
- {
45605
- once: true
45606
- }
45607
- );
45608
- });
45609
- };
45610
- const exportWordPDF = (paperList, options) => {
45611
- const { pageSize, customSize, fileName = "document.pdf" } = options;
45612
- const paperSize = convertPxToPaperSize(pageSize, customSize);
45613
- let pdf = null;
45614
- paperList.forEach((item, index2) => {
45615
- const { isLandscape, width, height } = getPageSize(item, paperSize);
45616
- if (!pdf) {
45617
- pdf = new jsPDF({
45618
- orientation: isLandscape ? "landscape" : "portrait",
45619
- unit: "mm",
45620
- format: [width, height]
45621
- });
45622
- } else {
45623
- pdf.addPage([width, height], isLandscape ? "landscape" : "portrait");
45624
- }
45625
- pdf.addImage(item.base64, "PNG", 0, 0, width, height);
45626
- });
45627
- pdf.save(fileName);
45628
- };
45629
- const getPdfBuffer = (paperList, options) => {
45630
- const { pageSize, customSize } = options;
45631
- const paperSize = convertPxToPaperSize(pageSize, customSize);
45632
- const pdf = new jsPDF({ unit: "mm" });
45633
- paperList.forEach((item, index2) => {
45634
- const { isLandscape, width, height } = getPageSize(item, paperSize);
45635
- if (index2 !== 0) {
45636
- pdf.addPage([width, height], isLandscape ? "landscape" : "portrait");
45637
- }
45638
- pdf.addImage(item.base64, "PNG", 0, 0, width, height);
45639
- });
45640
- return pdf.output("arraybuffer");
45641
- };
45642
- return {
45643
- printView,
45644
- exportWordPDF,
45645
- getPdfBuffer
45646
- };
45647
- }
45648
45760
  function useInteraction(docRef) {
45649
45761
  const state = reactive({});
45650
45762
  let unsubscribes = [];
@@ -45654,6 +45766,7 @@ function useInteraction(docRef) {
45654
45766
  if (!doc?.eventManager?.eventBus?.on) return;
45655
45767
  const interactionTypes = [
45656
45768
  "tableSelection",
45769
+ "activeTableId",
45657
45770
  "panelData",
45658
45771
  "hoverModelId",
45659
45772
  "focusModelId",
@@ -45747,20 +45860,26 @@ class WrunProperties {
45747
45860
  }
45748
45861
  break;
45749
45862
  }
45750
- case "w:b":
45751
- props.b = true;
45863
+ case "w:b": {
45864
+ const on2 = parseOnOffToggleFromElement(el);
45865
+ if (on2 !== void 0) props.b = on2;
45752
45866
  break;
45753
- case "w:i":
45754
- props.i = true;
45867
+ }
45868
+ case "w:i": {
45869
+ const on2 = parseOnOffToggleFromElement(el);
45870
+ if (on2 !== void 0) props.i = on2;
45755
45871
  break;
45872
+ }
45756
45873
  case "w:u": {
45757
45874
  const val = el["@attrs"]?.["w:val"];
45758
45875
  props.u = val !== "none" ? val || true : false;
45759
45876
  break;
45760
45877
  }
45761
- case "w:strike":
45762
- props.strike = true;
45878
+ case "w:strike": {
45879
+ const on2 = parseOnOffToggleFromElement(el);
45880
+ if (on2 !== void 0) props.strike = on2;
45763
45881
  break;
45882
+ }
45764
45883
  case "w:kern": {
45765
45884
  const val = el["@attrs"]?.["w:val"];
45766
45885
  if (val) {
@@ -46383,8 +46502,10 @@ class Wstyles {
46383
46502
  }
46384
46503
  class Wimages {
46385
46504
  images;
46505
+ scopedImages = /* @__PURE__ */ new Map();
46386
46506
  constructor(images = []) {
46387
46507
  this.images = images;
46508
+ this.rebuildBodyIndex();
46388
46509
  }
46389
46510
  /**
46390
46511
  * 从 XML JSON 转换为 Wimages 实例
@@ -46398,13 +46519,32 @@ class Wimages {
46398
46519
  const images = Array.isArray(json) ? json : [json];
46399
46520
  return new Wimages(images);
46400
46521
  }
46522
+ rebuildBodyIndex() {
46523
+ this.images.forEach((image) => {
46524
+ const imageId = image?.["@Relationship"]?.Id;
46525
+ if (!imageId) return;
46526
+ this.scopedImages.set(this.makeScopedKey({ imageId, scope: "body" }), image);
46527
+ });
46528
+ }
46529
+ makeScopedKey(query) {
46530
+ const scope = query.scope || "body";
46531
+ const ownerRelId = query.ownerRelId || "__default__";
46532
+ return `${scope}::${ownerRelId}::${query.imageId}`;
46533
+ }
46401
46534
  /**
46402
46535
  * 根据图片 ID 获取图片信息
46403
46536
  * @param imageId 图片的 Relationship ID
46404
46537
  * @returns 对应的 DocImage 对象,如果不存在返回 undefined
46405
46538
  */
46406
46539
  getImageById(imageId) {
46407
- return this.images.find((img) => img["@Relationship"].Id === imageId);
46540
+ return this.scopedImages.get(this.makeScopedKey({ imageId, scope: "body" }));
46541
+ }
46542
+ getImageByScopedId(query) {
46543
+ if (query.scope && query.scope !== "body") {
46544
+ const scoped = this.scopedImages.get(this.makeScopedKey(query));
46545
+ if (scoped) return scoped;
46546
+ }
46547
+ return this.getImageById(query.imageId);
46408
46548
  }
46409
46549
  /**
46410
46550
  * 根据图片 ID 获取图片 URL
@@ -46414,6 +46554,9 @@ class Wimages {
46414
46554
  getImageUrlById(imageId) {
46415
46555
  return this.getImageById(imageId)?.url;
46416
46556
  }
46557
+ getImageUrl(query) {
46558
+ return this.getImageByScopedId(query)?.url;
46559
+ }
46417
46560
  /**
46418
46561
  * 获取所有图片
46419
46562
  * @returns 所有图片的数组
@@ -46427,6 +46570,14 @@ class Wimages {
46427
46570
  */
46428
46571
  addImage(image) {
46429
46572
  this.images.push(image);
46573
+ const imageId = image?.["@Relationship"]?.Id;
46574
+ if (imageId) {
46575
+ this.scopedImages.set(this.makeScopedKey({ imageId, scope: "body" }), image);
46576
+ }
46577
+ }
46578
+ addScopedImage(query, image) {
46579
+ if (!query.imageId) return;
46580
+ this.scopedImages.set(this.makeScopedKey(query), image);
46430
46581
  }
46431
46582
  /**
46432
46583
  * 移除指定 ID 的图片
@@ -46437,6 +46588,7 @@ class Wimages {
46437
46588
  const index2 = this.images.findIndex((img) => img["@Relationship"].Id === imageId);
46438
46589
  if (index2 > -1) {
46439
46590
  this.images.splice(index2, 1);
46591
+ this.scopedImages.delete(this.makeScopedKey({ imageId, scope: "body" }));
46440
46592
  return true;
46441
46593
  }
46442
46594
  return false;
@@ -46460,6 +46612,7 @@ class Wimages {
46460
46612
  */
46461
46613
  clear() {
46462
46614
  this.images = [];
46615
+ this.scopedImages.clear();
46463
46616
  }
46464
46617
  }
46465
46618
  class Wsettings {
@@ -46651,6 +46804,7 @@ class Wheader extends ModelGroup {
46651
46804
  name: this.name,
46652
46805
  type: this.type,
46653
46806
  "@Relationship": { ...this.raw?.["@Relationship"] },
46807
+ "@Relationships": this.raw?.["@Relationships"] ? this.raw["@Relationships"].map((item) => ({ ...item })) : void 0,
46654
46808
  "@attrs": { ...this.attrs },
46655
46809
  elements
46656
46810
  };
@@ -46884,6 +47038,7 @@ class Wfooter extends ModelGroup {
46884
47038
  name: this.name,
46885
47039
  type: this.type,
46886
47040
  "@Relationship": { ...this.raw?.["@Relationship"] },
47041
+ "@Relationships": this.raw?.["@Relationships"] ? this.raw["@Relationships"].map((item) => ({ ...item })) : void 0,
46887
47042
  "@attrs": { ...this.attrs },
46888
47043
  elements
46889
47044
  };
@@ -47202,6 +47357,7 @@ class DocModel {
47202
47357
  model.document.parent = model;
47203
47358
  model.headers = Wheaders.fromXmlJsonArray(json.headers || [], model);
47204
47359
  model.footers = Wfooters.fromXmlJsonArray(json.footers || [], model);
47360
+ model.collectScopedImagesFromHeaderFooter();
47205
47361
  model.overlays = Woverlays.fromXmlJsonArray(json.overlays || [], model);
47206
47362
  model.headers.ensureComplete();
47207
47363
  model.footers.ensureComplete();
@@ -47312,6 +47468,42 @@ class DocModel {
47312
47468
  this.document.body.children.forEach(walk);
47313
47469
  return sections;
47314
47470
  }
47471
+ collectScopedImagesFromHeaderFooter() {
47472
+ const registerFromPart = (scope, part) => {
47473
+ if (!part) return;
47474
+ const ownerRelId = part["@Relationship"]?.Id;
47475
+ if (!ownerRelId) return;
47476
+ const rels = part["@Relationships"];
47477
+ if (!Array.isArray(rels)) return;
47478
+ rels.forEach((rel) => {
47479
+ if (!rel || rel.Type !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") {
47480
+ return;
47481
+ }
47482
+ if (!rel.Id || !rel.Target) return;
47483
+ this.images.addScopedImage(
47484
+ {
47485
+ scope,
47486
+ ownerRelId,
47487
+ imageId: rel.Id
47488
+ },
47489
+ {
47490
+ "@Relationship": {
47491
+ Type: rel.Type,
47492
+ Id: rel.Id,
47493
+ Target: rel.Target
47494
+ },
47495
+ url: rel.url || ""
47496
+ }
47497
+ );
47498
+ });
47499
+ };
47500
+ this.headers.headers.forEach((header) => {
47501
+ registerFromPart("header", header.raw);
47502
+ });
47503
+ this.footers.footers.forEach((footer) => {
47504
+ registerFromPart("footer", footer.raw);
47505
+ });
47506
+ }
47315
47507
  }
47316
47508
  class ModelConverter {
47317
47509
  /**
@@ -48135,7 +48327,32 @@ const _sfc_main$2W = /* @__PURE__ */ defineComponent({
48135
48327
  };
48136
48328
  }
48137
48329
  });
48138
- const HiddenInput = /* @__PURE__ */ _export_sfc(_sfc_main$2W, [["__scopeId", "data-v-fc40fb60"]]);
48330
+ const HiddenInput = /* @__PURE__ */ _export_sfc(_sfc_main$2W, [["__scopeId", "data-v-58dae928"]]);
48331
+ function useLatestRequest(execFn) {
48332
+ let lastReqId = 0;
48333
+ const loading = ref(false);
48334
+ const error = ref(null);
48335
+ async function run(payload) {
48336
+ lastReqId += 1;
48337
+ const myId = lastReqId;
48338
+ loading.value = true;
48339
+ error.value = null;
48340
+ try {
48341
+ const res = await execFn(payload);
48342
+ if (myId !== lastReqId) return null;
48343
+ return res;
48344
+ } catch (err) {
48345
+ error.value = err;
48346
+ throw err;
48347
+ } finally {
48348
+ if (myId === lastReqId) loading.value = false;
48349
+ }
48350
+ }
48351
+ function invalidate() {
48352
+ lastReqId += 1;
48353
+ }
48354
+ return { run, invalidate, loading, error };
48355
+ }
48139
48356
  const settings = { "@attrs": { "xmlns:o": "urn:schemas-microsoft-com:office:office", "xmlns:w10": "urn:schemas-microsoft-com:office:word", "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships", "xmlns:wpsCustomData": "http://www.wps.cn/officeDocument/2013/wpsCustomData", "xmlns:sl": "http://schemas.openxmlformats.org/schemaLibrary/2006/main", "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006", "xmlns:w14": "http://schemas.microsoft.com/office/word/2010/wordml", "xmlns:w": "http://schemas.openxmlformats.org/wordprocessingml/2006/main", "xmlns:v": "urn:schemas-microsoft-com:vml", "mc:Ignorable": "w14", "xmlns:m": "http://schemas.openxmlformats.org/officeDocument/2006/math" }, "elements": [{ "@attrs": { "w:percent": "130" }, "name": "w:zoom", "type": "element" }, { "name": "w:embedSystemFonts", "type": "element" }, { "@attrs": { "w:val": "1" }, "name": "w:bordersDoNotSurroundHeader", "type": "element" }, { "@attrs": { "w:val": "1" }, "name": "w:bordersDoNotSurroundFooter", "type": "element" }, { "@attrs": { "w:enforcement": "0" }, "name": "w:documentProtection", "type": "element" }, { "@attrs": { "w:val": "420" }, "name": "w:defaultTabStop", "type": "element" }, { "@attrs": { "w:val": "156" }, "name": "w:drawingGridVerticalSpacing", "type": "element" }, { "@attrs": { "w:val": "0" }, "name": "w:displayHorizontalDrawingGridEvery", "type": "element" }, { "@attrs": { "w:val": "2" }, "name": "w:displayVerticalDrawingGridEvery", "type": "element" }, { "@attrs": { "w:val": "compressPunctuation" }, "name": "w:characterSpacingControl", "type": "element" }, { "elements": [{ "name": "w:spaceForUL", "type": "element" }, { "name": "w:balanceSingleByteDoubleByteWidth", "type": "element" }, { "name": "w:doNotLeaveBackslashAlone", "type": "element" }, { "name": "w:ulTrailSpace", "type": "element" }, { "name": "w:doNotExpandShiftReturn", "type": "element" }, { "name": "w:adjustLineHeightInTable", "type": "element" }, { "name": "w:useFELayout", "type": "element" }, { "@attrs": { "w:uri": "http://schemas.microsoft.com/office/word", "w:val": "14", "w:name": "compatibilityMode" }, "name": "w:compatSetting", "type": "element" }, { "@attrs": { "w:uri": "http://schemas.microsoft.com/office/word", "w:val": "1", "w:name": "overrideTableStyleFontSizeAndJustification" }, "name": "w:compatSetting", "type": "element" }, { "@attrs": { "w:uri": "http://schemas.microsoft.com/office/word", "w:val": "1", "w:name": "enableOpenTypeFeatures" }, "name": "w:compatSetting", "type": "element" }, { "@attrs": { "w:uri": "http://schemas.microsoft.com/office/word", "w:val": "1", "w:name": "doNotFlipMirrorIndents" }, "name": "w:compatSetting", "type": "element" }], "name": "w:compat", "type": "element" }, { "elements": [{ "@attrs": { "w:val": "B99C4C00" }, "name": "w:rsidRoot", "type": "element" }, { "@attrs": { "w:val": "B99C4C00" }, "name": "w:rsid", "type": "element" }], "name": "w:rsids", "type": "element" }, { "elements": [{ "@attrs": { "m:val": "Cambria Math" }, "name": "m:mathFont", "type": "element" }, { "@attrs": { "m:val": "before" }, "name": "m:brkBin", "type": "element" }, { "@attrs": { "m:val": "--" }, "name": "m:brkBinSub", "type": "element" }, { "@attrs": { "m:val": "0" }, "name": "m:smallFrac", "type": "element" }, { "name": "m:dispDef", "type": "element" }, { "@attrs": { "m:val": "0" }, "name": "m:lMargin", "type": "element" }, { "@attrs": { "m:val": "0" }, "name": "m:rMargin", "type": "element" }, { "@attrs": { "m:val": "centerGroup" }, "name": "m:defJc", "type": "element" }, { "@attrs": { "m:val": "1440" }, "name": "m:wrapIndent", "type": "element" }, { "@attrs": { "m:val": "subSup" }, "name": "m:intLim", "type": "element" }, { "@attrs": { "m:val": "undOvr" }, "name": "m:naryLim", "type": "element" }], "name": "m:mathPr", "type": "element" }, { "@attrs": { "w:val": "en-US", "w:eastAsia": "zh-CN" }, "name": "w:themeFontLang", "type": "element" }, { "@attrs": { "w:bg1": "light1", "w:bg2": "light2", "w:accent3": "accent3", "w:accent4": "accent4", "w:t2": "dark2", "w:accent1": "accent1", "w:t1": "dark1", "w:accent2": "accent2", "w:hyperlink": "hyperlink", "w:accent5": "accent5", "w:accent6": "accent6", "w:followedHyperlink": "followedHyperlink" }, "name": "w:clrSchemeMapping", "type": "element" }, { "name": "w:doNotIncludeSubdocsInStats", "type": "element" }], "name": "w:settings", "@Relationship": { "Type": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings", "Target": "/word/settings.xml", "Id": "rId2" }, "type": "element" };
48140
48357
  const headers = [{ "@attrs": { "xmlns:o": "urn:schemas-microsoft-com:office:office", "xmlns:w10": "urn:schemas-microsoft-com:office:word", "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships", "xmlns:w14": "http://schemas.microsoft.com/office/word/2010/wordml", "xmlns:wps": "http://schemas.microsoft.com/office/word/2010/wordprocessingShape", "xmlns:w15": "http://schemas.microsoft.com/office/word/2012/wordml", "xmlns:wpi": "http://schemas.microsoft.com/office/word/2010/wordprocessingInk", "xmlns:w": "http://schemas.openxmlformats.org/wordprocessingml/2006/main", "xmlns:v": "urn:schemas-microsoft-com:vml", "mc:Ignorable": "w14 w15 wp14", "xmlns:wpg": "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup", "xmlns:wne": "http://schemas.microsoft.com/office/word/2006/wordml", "xmlns:wpsCustomData": "http://www.wps.cn/officeDocument/2013/wpsCustomData", "xmlns:wp": "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "xmlns:wpc": "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas", "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006", "xmlns:wp14": "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing", "xmlns:m": "http://schemas.openxmlformats.org/officeDocument/2006/math" }, "elements": [{ "@attrs": { "w14:paraId": "16961003" }, "elements": [{ "elements": [{ "@attrs": { "w:val": "3" }, "name": "w:pStyle", "type": "element" }, { "elements": [{ "@attrs": { "w:eastAsiaTheme": "minorEastAsia", "w:hint": "default" }, "name": "w:rFonts", "type": "element" }, { "@attrs": { "w:val": "en-US", "w:eastAsia": "zh-CN" }, "name": "w:lang", "type": "element" }], "name": "w:rPr", "type": "element" }], "name": "w:pPr", "type": "element" }], "name": "w:p", "type": "element" }], "name": "w:hdr", "@Relationship": { "Type": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", "Target": "/word/header1.xml", "Id": "rId3" }, "type": "element" }, { "@attrs": { "xmlns:o": "urn:schemas-microsoft-com:office:office", "xmlns:w10": "urn:schemas-microsoft-com:office:word", "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships", "xmlns:w14": "http://schemas.microsoft.com/office/word/2010/wordml", "xmlns:wps": "http://schemas.microsoft.com/office/word/2010/wordprocessingShape", "xmlns:w15": "http://schemas.microsoft.com/office/word/2012/wordml", "xmlns:wpi": "http://schemas.microsoft.com/office/word/2010/wordprocessingInk", "xmlns:w": "http://schemas.openxmlformats.org/wordprocessingml/2006/main", "xmlns:v": "urn:schemas-microsoft-com:vml", "mc:Ignorable": "w14 w15 wp14", "xmlns:wpg": "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup", "xmlns:wne": "http://schemas.microsoft.com/office/word/2006/wordml", "xmlns:wpsCustomData": "http://www.wps.cn/officeDocument/2013/wpsCustomData", "xmlns:wp": "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "xmlns:wpc": "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas", "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006", "xmlns:wp14": "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing", "xmlns:m": "http://schemas.openxmlformats.org/officeDocument/2006/math" }, "elements": [{ "@attrs": { "w14:paraId": "04516E4F" }, "elements": [{ "elements": [{ "@attrs": { "w:val": "3" }, "name": "w:pStyle", "type": "element" }, { "elements": [{ "@attrs": { "w:eastAsiaTheme": "minorEastAsia", "w:hint": "default" }, "name": "w:rFonts", "type": "element" }, { "@attrs": { "w:val": "en-US", "w:eastAsia": "zh-CN" }, "name": "w:lang", "type": "element" }], "name": "w:rPr", "type": "element" }], "name": "w:pPr", "type": "element" }], "name": "w:p", "type": "element" }], "name": "w:hdr", "@Relationship": { "Type": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", "Target": "/word/header2.xml", "Id": "rId4" }, "type": "element" }, { "@attrs": { "xmlns:o": "urn:schemas-microsoft-com:office:office", "xmlns:w10": "urn:schemas-microsoft-com:office:word", "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships", "xmlns:w14": "http://schemas.microsoft.com/office/word/2010/wordml", "xmlns:wps": "http://schemas.microsoft.com/office/word/2010/wordprocessingShape", "xmlns:w15": "http://schemas.microsoft.com/office/word/2012/wordml", "xmlns:wpi": "http://schemas.microsoft.com/office/word/2010/wordprocessingInk", "xmlns:w": "http://schemas.openxmlformats.org/wordprocessingml/2006/main", "xmlns:v": "urn:schemas-microsoft-com:vml", "mc:Ignorable": "w14 w15 wp14", "xmlns:wpg": "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup", "xmlns:wne": "http://schemas.microsoft.com/office/word/2006/wordml", "xmlns:wpsCustomData": "http://www.wps.cn/officeDocument/2013/wpsCustomData", "xmlns:wp": "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "xmlns:wpc": "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas", "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006", "xmlns:wp14": "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing", "xmlns:m": "http://schemas.openxmlformats.org/officeDocument/2006/math" }, "elements": [{ "@attrs": { "w14:paraId": "659ACBE9" }, "elements": [{ "elements": [{ "@attrs": { "w:val": "3" }, "name": "w:pStyle", "type": "element" }, { "elements": [{ "@attrs": { "w:eastAsiaTheme": "minorEastAsia", "w:hint": "default" }, "name": "w:rFonts", "type": "element" }, { "@attrs": { "w:val": "en-US", "w:eastAsia": "zh-CN" }, "name": "w:lang", "type": "element" }], "name": "w:rPr", "type": "element" }], "name": "w:pPr", "type": "element" }], "name": "w:p", "type": "element" }], "name": "w:hdr", "@Relationship": { "Type": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", "Target": "/word/header3.xml", "Id": "rId5" }, "type": "element" }];
48141
48358
  const themes = /* @__PURE__ */ JSON.parse('[{"@attrs":{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","name":"WPS"},"elements":[{"elements":[{"@attrs":{"name":"WPS"},"elements":[{"elements":[{"@attrs":{"val":"windowText","lastClr":"000000"},"name":"a:sysClr","type":"element"}],"name":"a:dk1","type":"element"},{"elements":[{"@attrs":{"val":"window","lastClr":"FFFFFF"},"name":"a:sysClr","type":"element"}],"name":"a:lt1","type":"element"},{"elements":[{"@attrs":{"val":"44546A"},"name":"a:srgbClr","type":"element"}],"name":"a:dk2","type":"element"},{"elements":[{"@attrs":{"val":"E7E6E6"},"name":"a:srgbClr","type":"element"}],"name":"a:lt2","type":"element"},{"elements":[{"@attrs":{"val":"4874CB"},"name":"a:srgbClr","type":"element"}],"name":"a:accent1","type":"element"},{"elements":[{"@attrs":{"val":"EE822F"},"name":"a:srgbClr","type":"element"}],"name":"a:accent2","type":"element"},{"elements":[{"@attrs":{"val":"F2BA02"},"name":"a:srgbClr","type":"element"}],"name":"a:accent3","type":"element"},{"elements":[{"@attrs":{"val":"75BD42"},"name":"a:srgbClr","type":"element"}],"name":"a:accent4","type":"element"},{"elements":[{"@attrs":{"val":"30C0B4"},"name":"a:srgbClr","type":"element"}],"name":"a:accent5","type":"element"},{"elements":[{"@attrs":{"val":"E54C5E"},"name":"a:srgbClr","type":"element"}],"name":"a:accent6","type":"element"},{"elements":[{"@attrs":{"val":"0026E5"},"name":"a:srgbClr","type":"element"}],"name":"a:hlink","type":"element"},{"elements":[{"@attrs":{"val":"7E1FAD"},"name":"a:srgbClr","type":"element"}],"name":"a:folHlink","type":"element"}],"name":"a:clrScheme","type":"element"},{"@attrs":{"name":"WPS"},"elements":[{"elements":[{"@attrs":{"typeface":"Calibri Light"},"name":"a:latin","type":"element"},{"@attrs":{"typeface":""},"name":"a:ea","type":"element"},{"@attrs":{"typeface":""},"name":"a:cs","type":"element"},{"@attrs":{"script":"Jpan","typeface":"MS ゴシック"},"name":"a:font","type":"element"},{"@attrs":{"script":"Hang","typeface":"맑은 고딕"},"name":"a:font","type":"element"},{"@attrs":{"script":"Hans","typeface":"宋体"},"name":"a:font","type":"element"},{"@attrs":{"script":"Hant","typeface":"新細明體"},"name":"a:font","type":"element"},{"@attrs":{"script":"Arab","typeface":"Times New Roman"},"name":"a:font","type":"element"},{"@attrs":{"script":"Hebr","typeface":"Times New Roman"},"name":"a:font","type":"element"},{"@attrs":{"script":"Thai","typeface":"Angsana New"},"name":"a:font","type":"element"},{"@attrs":{"script":"Ethi","typeface":"Nyala"},"name":"a:font","type":"element"},{"@attrs":{"script":"Beng","typeface":"Vrinda"},"name":"a:font","type":"element"},{"@attrs":{"script":"Gujr","typeface":"Shruti"},"name":"a:font","type":"element"},{"@attrs":{"script":"Khmr","typeface":"MoolBoran"},"name":"a:font","type":"element"},{"@attrs":{"script":"Knda","typeface":"Tunga"},"name":"a:font","type":"element"},{"@attrs":{"script":"Guru","typeface":"Raavi"},"name":"a:font","type":"element"},{"@attrs":{"script":"Cans","typeface":"Euphemia"},"name":"a:font","type":"element"},{"@attrs":{"script":"Cher","typeface":"Plantagenet Cherokee"},"name":"a:font","type":"element"},{"@attrs":{"script":"Yiii","typeface":"Microsoft Yi Baiti"},"name":"a:font","type":"element"},{"@attrs":{"script":"Tibt","typeface":"Microsoft Himalaya"},"name":"a:font","type":"element"},{"@attrs":{"script":"Thaa","typeface":"MV Boli"},"name":"a:font","type":"element"},{"@attrs":{"script":"Deva","typeface":"Mangal"},"name":"a:font","type":"element"},{"@attrs":{"script":"Telu","typeface":"Gautami"},"name":"a:font","type":"element"},{"@attrs":{"script":"Taml","typeface":"Latha"},"name":"a:font","type":"element"},{"@attrs":{"script":"Syrc","typeface":"Estrangelo Edessa"},"name":"a:font","type":"element"},{"@attrs":{"script":"Orya","typeface":"Kalinga"},"name":"a:font","type":"element"},{"@attrs":{"script":"Mlym","typeface":"Kartika"},"name":"a:font","type":"element"},{"@attrs":{"script":"Laoo","typeface":"DokChampa"},"name":"a:font","type":"element"},{"@attrs":{"script":"Sinh","typeface":"Iskoola Pota"},"name":"a:font","type":"element"},{"@attrs":{"script":"Mong","typeface":"Mongolian Baiti"},"name":"a:font","type":"element"},{"@attrs":{"script":"Viet","typeface":"Times New Roman"},"name":"a:font","type":"element"},{"@attrs":{"script":"Uigh","typeface":"Microsoft Uighur"},"name":"a:font","type":"element"},{"@attrs":{"script":"Geor","typeface":"Sylfaen"},"name":"a:font","type":"element"}],"name":"a:majorFont","type":"element"},{"elements":[{"@attrs":{"typeface":"Calibri"},"name":"a:latin","type":"element"},{"@attrs":{"typeface":""},"name":"a:ea","type":"element"},{"@attrs":{"typeface":""},"name":"a:cs","type":"element"},{"@attrs":{"script":"Jpan","typeface":"MS 明朝"},"name":"a:font","type":"element"},{"@attrs":{"script":"Hang","typeface":"맑은 고딕"},"name":"a:font","type":"element"},{"@attrs":{"script":"Hans","typeface":"宋体"},"name":"a:font","type":"element"},{"@attrs":{"script":"Hant","typeface":"新細明體"},"name":"a:font","type":"element"},{"@attrs":{"script":"Arab","typeface":"Arial"},"name":"a:font","type":"element"},{"@attrs":{"script":"Hebr","typeface":"Arial"},"name":"a:font","type":"element"},{"@attrs":{"script":"Thai","typeface":"Cordia New"},"name":"a:font","type":"element"},{"@attrs":{"script":"Ethi","typeface":"Nyala"},"name":"a:font","type":"element"},{"@attrs":{"script":"Beng","typeface":"Vrinda"},"name":"a:font","type":"element"},{"@attrs":{"script":"Gujr","typeface":"Shruti"},"name":"a:font","type":"element"},{"@attrs":{"script":"Khmr","typeface":"DaunPenh"},"name":"a:font","type":"element"},{"@attrs":{"script":"Knda","typeface":"Tunga"},"name":"a:font","type":"element"},{"@attrs":{"script":"Guru","typeface":"Raavi"},"name":"a:font","type":"element"},{"@attrs":{"script":"Cans","typeface":"Euphemia"},"name":"a:font","type":"element"},{"@attrs":{"script":"Cher","typeface":"Plantagenet Cherokee"},"name":"a:font","type":"element"},{"@attrs":{"script":"Yiii","typeface":"Microsoft Yi Baiti"},"name":"a:font","type":"element"},{"@attrs":{"script":"Tibt","typeface":"Microsoft Himalaya"},"name":"a:font","type":"element"},{"@attrs":{"script":"Thaa","typeface":"MV Boli"},"name":"a:font","type":"element"},{"@attrs":{"script":"Deva","typeface":"Mangal"},"name":"a:font","type":"element"},{"@attrs":{"script":"Telu","typeface":"Gautami"},"name":"a:font","type":"element"},{"@attrs":{"script":"Taml","typeface":"Latha"},"name":"a:font","type":"element"},{"@attrs":{"script":"Syrc","typeface":"Estrangelo Edessa"},"name":"a:font","type":"element"},{"@attrs":{"script":"Orya","typeface":"Kalinga"},"name":"a:font","type":"element"},{"@attrs":{"script":"Mlym","typeface":"Kartika"},"name":"a:font","type":"element"},{"@attrs":{"script":"Laoo","typeface":"DokChampa"},"name":"a:font","type":"element"},{"@attrs":{"script":"Sinh","typeface":"Iskoola Pota"},"name":"a:font","type":"element"},{"@attrs":{"script":"Mong","typeface":"Mongolian Baiti"},"name":"a:font","type":"element"},{"@attrs":{"script":"Viet","typeface":"Arial"},"name":"a:font","type":"element"},{"@attrs":{"script":"Uigh","typeface":"Microsoft Uighur"},"name":"a:font","type":"element"},{"@attrs":{"script":"Geor","typeface":"Sylfaen"},"name":"a:font","type":"element"}],"name":"a:minorFont","type":"element"}],"name":"a:fontScheme","type":"element"},{"@attrs":{"name":"WPS"},"elements":[{"elements":[{"elements":[{"@attrs":{"val":"phClr"},"name":"a:schemeClr","type":"element"}],"name":"a:solidFill","type":"element"},{"elements":[{"elements":[{"@attrs":{"pos":"0"},"elements":[{"@attrs":{"val":"phClr"},"elements":[{"@attrs":{"val":"17500"},"name":"a:lumOff","type":"element"}],"name":"a:schemeClr","type":"element"}],"name":"a:gs","type":"element"},{"@attrs":{"pos":"100000"},"elements":[{"@attrs":{"val":"phClr"},"name":"a:schemeClr","type":"element"}],"name":"a:gs","type":"element"}],"name":"a:gsLst","type":"element"},{"@attrs":{"scaled":"0","ang":"2700000"},"name":"a:lin","type":"element"}],"name":"a:gradFill","type":"element"},{"elements":[{"elements":[{"@attrs":{"pos":"0"},"elements":[{"@attrs":{"val":"phClr"},"elements":[{"@attrs":{"val":"-2520000"},"name":"a:hueOff","type":"element"}],"name":"a:schemeClr","type":"element"}],"name":"a:gs","type":"element"},{"@attrs":{"pos":"100000"},"elements":[{"@attrs":{"val":"phClr"},"name":"a:schemeClr","type":"element"}],"name":"a:gs","type":"element"}],"name":"a:gsLst","type":"element"},{"@attrs":{"scaled":"0","ang":"2700000"},"name":"a:lin","type":"element"}],"name":"a:gradFill","type":"element"}],"name":"a:fillStyleLst","type":"element"},{"elements":[{"@attrs":{"cmpd":"sng","cap":"flat","w":"12700","algn":"ctr"},"elements":[{"elements":[{"@attrs":{"val":"phClr"},"name":"a:schemeClr","type":"element"}],"name":"a:solidFill","type":"element"},{"@attrs":{"val":"solid"},"name":"a:prstDash","type":"element"},{"@attrs":{"lim":"800000"},"name":"a:miter","type":"element"}],"name":"a:ln","type":"element"},{"@attrs":{"cmpd":"sng","cap":"flat","w":"12700","algn":"ctr"},"elements":[{"elements":[{"@attrs":{"val":"phClr"},"name":"a:schemeClr","type":"element"}],"name":"a:solidFill","type":"element"},{"@attrs":{"val":"solid"},"name":"a:prstDash","type":"element"},{"@attrs":{"lim":"800000"},"name":"a:miter","type":"element"}],"name":"a:ln","type":"element"},{"@attrs":{"cmpd":"sng","cap":"flat","w":"12700","algn":"ctr"},"elements":[{"elements":[{"elements":[{"@attrs":{"pos":"0"},"elements":[{"@attrs":{"val":"phClr"},"elements":[{"@attrs":{"val":"-4200000"},"name":"a:hueOff","type":"element"}],"name":"a:schemeClr","type":"element"}],"name":"a:gs","type":"element"},{"@attrs":{"pos":"100000"},"elements":[{"@attrs":{"val":"phClr"},"name":"a:schemeClr","type":"element"}],"name":"a:gs","type":"element"}],"name":"a:gsLst","type":"element"},{"@attrs":{"scaled":"1","ang":"2700000"},"name":"a:lin","type":"element"}],"name":"a:gradFill","type":"element"},{"@attrs":{"val":"solid"},"name":"a:prstDash","type":"element"},{"@attrs":{"lim":"800000"},"name":"a:miter","type":"element"}],"name":"a:ln","type":"element"}],"name":"a:lnStyleLst","type":"element"},{"elements":[{"elements":[{"elements":[{"@attrs":{"rotWithShape":"0","dist":"50800","dir":"5400000","blurRad":"101600","algn":"ctr"},"elements":[{"@attrs":{"val":"phClr"},"elements":[{"@attrs":{"val":"60000"},"name":"a:alpha","type":"element"}],"name":"a:schemeClr","type":"element"}],"name":"a:outerShdw","type":"element"}],"name":"a:effectLst","type":"element"}],"name":"a:effectStyle","type":"element"},{"elements":[{"elements":[{"@attrs":{"stA":"50000","rotWithShape":"0","sy":"-100000","endA":"300","dist":"25400","dir":"5400000","endPos":"40000","algn":"bl"},"name":"a:reflection","type":"element"}],"name":"a:effectLst","type":"element"}],"name":"a:effectStyle","type":"element"},{"elements":[{"elements":[{"@attrs":{"rotWithShape":"0","dist":"19050","dir":"5400000","blurRad":"57150","algn":"ctr"},"elements":[{"@attrs":{"val":"000000"},"elements":[{"@attrs":{"val":"63000"},"name":"a:alpha","type":"element"}],"name":"a:srgbClr","type":"element"}],"name":"a:outerShdw","type":"element"}],"name":"a:effectLst","type":"element"}],"name":"a:effectStyle","type":"element"}],"name":"a:effectStyleLst","type":"element"},{"elements":[{"elements":[{"@attrs":{"val":"phClr"},"name":"a:schemeClr","type":"element"}],"name":"a:solidFill","type":"element"},{"elements":[{"@attrs":{"val":"phClr"},"elements":[{"@attrs":{"val":"95000"},"name":"a:tint","type":"element"},{"@attrs":{"val":"170000"},"name":"a:satMod","type":"element"}],"name":"a:schemeClr","type":"element"}],"name":"a:solidFill","type":"element"},{"@attrs":{"rotWithShape":"1"},"elements":[{"elements":[{"@attrs":{"pos":"0"},"elements":[{"@attrs":{"val":"phClr"},"elements":[{"@attrs":{"val":"93000"},"name":"a:tint","type":"element"},{"@attrs":{"val":"150000"},"name":"a:satMod","type":"element"},{"@attrs":{"val":"98000"},"name":"a:shade","type":"element"},{"@attrs":{"val":"102000"},"name":"a:lumMod","type":"element"}],"name":"a:schemeClr","type":"element"}],"name":"a:gs","type":"element"},{"@attrs":{"pos":"50000"},"elements":[{"@attrs":{"val":"phClr"},"elements":[{"@attrs":{"val":"98000"},"name":"a:tint","type":"element"},{"@attrs":{"val":"130000"},"name":"a:satMod","type":"element"},{"@attrs":{"val":"90000"},"name":"a:shade","type":"element"},{"@attrs":{"val":"103000"},"name":"a:lumMod","type":"element"}],"name":"a:schemeClr","type":"element"}],"name":"a:gs","type":"element"},{"@attrs":{"pos":"100000"},"elements":[{"@attrs":{"val":"phClr"},"elements":[{"@attrs":{"val":"63000"},"name":"a:shade","type":"element"},{"@attrs":{"val":"120000"},"name":"a:satMod","type":"element"}],"name":"a:schemeClr","type":"element"}],"name":"a:gs","type":"element"}],"name":"a:gsLst","type":"element"},{"@attrs":{"scaled":"0","ang":"5400000"},"name":"a:lin","type":"element"}],"name":"a:gradFill","type":"element"}],"name":"a:bgFillStyleLst","type":"element"}],"name":"a:fmtScheme","type":"element"}],"name":"a:themeElements","type":"element"},{"name":"a:objectDefaults","type":"element"}],"name":"a:theme","@Relationship":{"Type":"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme","Target":"/word/theme/theme1.xml","Id":"rId9"},"type":"element"}]');
@@ -48195,6 +48412,28 @@ class RuntimeJsonBuilder {
48195
48412
  return this.json;
48196
48413
  }
48197
48414
  }
48415
+ function getBpmnFieldAuthMap(list) {
48416
+ return Object.fromEntries(
48417
+ list.map((item) => {
48418
+ return [`${item.modelKey}.${item.field}`, { ...item }];
48419
+ })
48420
+ );
48421
+ }
48422
+ function deduplicateFields(data) {
48423
+ const map2 = /* @__PURE__ */ new Map();
48424
+ data.forEach((item) => {
48425
+ const key = `${item.modelKey}_${item.field}`;
48426
+ if (!map2.has(key)) {
48427
+ map2.set(key, item);
48428
+ } else {
48429
+ const existing = map2.get(key);
48430
+ if (item.edit && !existing.edit) {
48431
+ map2.set(key, item);
48432
+ }
48433
+ }
48434
+ });
48435
+ return [...map2.values()];
48436
+ }
48198
48437
  class DocRequestStrategy {
48199
48438
  props;
48200
48439
  payload;
@@ -48206,6 +48445,8 @@ class DocRequestStrategy {
48206
48445
  extractDocInfo(docInfo) {
48207
48446
  let fillModeType = DocModeTypeConst.Print;
48208
48447
  let btnModelType = DocModeTypeConst.Print;
48448
+ let bpmnFieldAuthMap = {};
48449
+ let bpmnType;
48209
48450
  if (docInfo.formType === FormTypeConst.BASE || docInfo.formType === FormTypeConst.FILE) {
48210
48451
  if (docInfo.instanceStatus) {
48211
48452
  fillModeType = docInfo.instanceStatus === "UNFILLED" || docInfo.instanceStatus === "STASH" || docInfo.instanceStatus === "PARTIAL_SUBMIT" ? DocModeTypeConst.Fill : DocModeTypeConst.Print;
@@ -48214,12 +48455,33 @@ class DocRequestStrategy {
48214
48455
  fillModeType = docInfo.dataStatus === "SUBMIT" ? DocModeTypeConst.Print : DocModeTypeConst.Fill;
48215
48456
  btnModelType = fillModeType;
48216
48457
  }
48458
+ bpmnFieldAuthMap = getBpmnFieldAuthMap(
48459
+ deduplicateFields(
48460
+ safeParseJson(docInfo.processFieldPermission, [], Array.isArray)
48461
+ )
48462
+ );
48217
48463
  } else if (docInfo.formType === FormTypeConst.PROCESS) {
48218
48464
  const { nodeDef = {} } = docInfo.ofProcessOperations ?? {};
48219
- const bpmnType = docInfo.instanceStatus === "ABANDON" ? "bpmnEnd" : nodeDef.type ?? "bpmnEnd";
48465
+ bpmnType = docInfo.instanceStatus === "ABANDON" ? "bpmnEnd" : nodeDef.type ?? "bpmnEnd";
48220
48466
  fillModeType = bpmnType === "bpmnEnd" ? DocModeTypeConst.Print : DocModeTypeConst.Fill;
48221
48467
  btnModelType = fillModeType;
48468
+ bpmnFieldAuthMap = getBpmnFieldAuthMap(
48469
+ mergeByMultiKey(
48470
+ deduplicateFields(safeParseJson(nodeDef.fieldConfig, [], Array.isArray)),
48471
+ deduplicateFields(
48472
+ safeParseJson(docInfo.processFieldPermission, [], Array.isArray)
48473
+ ),
48474
+ {
48475
+ keyFields: ["modelKey", "field"],
48476
+ fieldsToMerge: ["readonly", "edit"],
48477
+ isAllowMerge: bpmnType === "bpmnSubmit",
48478
+ // 只有开始节点可以合并字段权限配置
48479
+ isConcat: true
48480
+ }
48481
+ )
48482
+ );
48222
48483
  }
48484
+ console.log("bpmnFieldAuthMap", bpmnFieldAuthMap);
48223
48485
  const _isDetailPage_ = typeof this.payload.isDetailPage === "function" ? this.payload.isDetailPage() : this.payload.isDetailPage;
48224
48486
  if (_isDetailPage_) {
48225
48487
  fillModeType = DocModeTypeConst.Print;
@@ -48232,7 +48494,7 @@ class DocRequestStrategy {
48232
48494
  ...JSON.parse(docInfo.params || "{}"),
48233
48495
  ...this.payload.paramExtraProps || {}
48234
48496
  };
48235
- return { fillModeType, btnModelType, paramsConfig };
48497
+ return { fillModeType, btnModelType, paramsConfig, bpmnType, bpmnFieldAuthMap };
48236
48498
  }
48237
48499
  }
48238
48500
  class SingleInstanceStrategy extends DocRequestStrategy {
@@ -48242,7 +48504,7 @@ class SingleInstanceStrategy extends DocRequestStrategy {
48242
48504
  ...this.payload.paramExtraProps?._gct_nocode_doc_query_params_
48243
48505
  });
48244
48506
  if (isEmpty(res)) return null;
48245
- const { fillModeType, btnModelType, paramsConfig } = this.extractDocInfo(res);
48507
+ const { fillModeType, btnModelType, paramsConfig, bpmnType, bpmnFieldAuthMap } = this.extractDocInfo(res);
48246
48508
  const query = res.dataId ? {
48247
48509
  id_: res.dataId,
48248
48510
  _gct_dataStatus_: res.dataStatus,
@@ -48257,10 +48519,10 @@ class SingleInstanceStrategy extends DocRequestStrategy {
48257
48519
  id,
48258
48520
  tid: res.tmplId,
48259
48521
  requestInfo: res,
48260
- // bpmnType,
48522
+ bpmnType,
48261
48523
  fillModeType,
48262
48524
  btnModelType,
48263
- // bpmnFieldAuthMap,
48525
+ bpmnFieldAuthMap,
48264
48526
  paramsConfig,
48265
48527
  query
48266
48528
  };
@@ -48390,90 +48652,6 @@ var FIELD_TYPE = /* @__PURE__ */ ((FIELD_TYPE2) => {
48390
48652
  FIELD_TYPE2["DEVICE_REF_MULTI"] = "device_ref_multi";
48391
48653
  return FIELD_TYPE2;
48392
48654
  })(FIELD_TYPE || {});
48393
- function transformSourceData(sourceData, i18nData) {
48394
- const clone2 = cloneDeep(sourceData);
48395
- const _DICT = i18nData ? Object.keys(clone2).reduce((acc, key) => {
48396
- const map2 = i18nData[key];
48397
- const value = clone2[key];
48398
- if (map2 && value) {
48399
- const labels = String(value).split(",").map((k) => map2[k]);
48400
- acc[key] = { [value]: labels };
48401
- }
48402
- return acc;
48403
- }, {}) : clone2._DICT || {};
48404
- const _OPCT = clone2.__FOREIGN__ ? transformSourceData(clone2.__FOREIGN__, i18nData) : {};
48405
- const children = Array.isArray(clone2.__CHILDREN__) ? clone2.__CHILDREN__.map((c2) => transformSourceData(c2, i18nData)) : clone2.__CHILDREN__;
48406
- return {
48407
- ...clone2,
48408
- _DICT,
48409
- _OPCT,
48410
- __FOREIGN__: null,
48411
- __CHILDREN__: children
48412
- };
48413
- }
48414
- function transformSourceDataList(data, dict = {}) {
48415
- const list = data?.map((i) => transformSourceData(i, dict));
48416
- return list || [];
48417
- }
48418
- function findFieldWidget(instances, fieldKey, modelKey) {
48419
- return instances.find((instance2) => {
48420
- const fieldMeta = instance2.widgetMeta?.field;
48421
- return fieldKey === getLastSegment(fieldMeta?.fieldLink) && modelKey === getLastSegment(fieldMeta?.modelLink);
48422
- });
48423
- }
48424
- function getSubmitFormData(formData) {
48425
- const list2D = [];
48426
- const filterKeys = ["_DICT", "_OPCT", "__FOREIGN__", "_MCTABLE", "__default_render__"];
48427
- const realFormData = Object.keys(formData).reduce((acc, fieldKey) => {
48428
- const info = list2D.find(
48429
- (item) => (item.subTable2d || item.checkTable2d) && item.rowSubFieldKey === fieldKey
48430
- );
48431
- if (info) {
48432
- const colSubTable = formData[info.colSubFieldKey]?.map((item) => ({
48433
- [info.rowRefFieldKey]: item[info.colRefFieldKey]
48434
- }));
48435
- const arr = flatMap(
48436
- formData[fieldKey],
48437
- (row) => zip(row["_2DTABLE_"], colSubTable).map(([obj1, obj2]) => merge({}, obj1, obj2)).map(
48438
- (item) => merge(
48439
- pickBy(omit(row, filterKeys), (v) => !isNil(v)),
48440
- pickBy(omit(item, filterKeys), (v) => !isNil(v))
48441
- )
48442
- )
48443
- ).map((item) => omit(item, "_2DTABLE_"));
48444
- acc[fieldKey] = arr.every((item) => Object.keys(item).length === 1 && has(item, "group_")) ? [] : arr;
48445
- } else if (Array.isArray(formData[fieldKey])) {
48446
- acc[fieldKey] = formData[fieldKey].map(
48447
- (item) => Object.fromEntries(
48448
- Object.entries(item).filter(([key, value]) => {
48449
- if (filterKeys.includes(key)) return false;
48450
- if (key.endsWith("_lb_") && isEmpty(value)) return false;
48451
- return true;
48452
- })
48453
- )
48454
- );
48455
- } else {
48456
- acc[fieldKey] = formData[fieldKey];
48457
- }
48458
- return acc;
48459
- }, {});
48460
- console.log("0506 数据转成真实提交数据(二维表要平铺)", realFormData);
48461
- return omit(realFormData, filterKeys);
48462
- }
48463
- function conversionFormState(payload) {
48464
- const { interfaceData, masterSlaveList } = payload || {};
48465
- const formState = {};
48466
- if (interfaceData && interfaceData.data) {
48467
- merge(formState, transformSourceData(interfaceData.data, interfaceData.dict));
48468
- }
48469
- masterSlaveList.map((item) => item.key).forEach((k) => {
48470
- const subFormData = formState[k];
48471
- if (subFormData) {
48472
- formState[k] = transformSourceDataList([...subFormData.data], subFormData.dict);
48473
- }
48474
- });
48475
- return formState;
48476
- }
48477
48655
  class RequestCache {
48478
48656
  pendingMap = /* @__PURE__ */ new Map();
48479
48657
  cacheMap = /* @__PURE__ */ new Map();
@@ -48674,6 +48852,84 @@ const withRequestCache = new RequestCache({
48674
48852
  enableLogging: true
48675
48853
  // 启用日志
48676
48854
  });
48855
+ function transformSourceData(sourceData, i18nData) {
48856
+ const clone2 = cloneDeep(sourceData);
48857
+ const _DICT = i18nData ? Object.keys(clone2).reduce((acc, key) => {
48858
+ const map2 = i18nData[key];
48859
+ const value = clone2[key];
48860
+ if (map2 && value) {
48861
+ const labels = String(value).split(",").map((k) => map2[k]);
48862
+ acc[key] = { [value]: labels };
48863
+ }
48864
+ return acc;
48865
+ }, {}) : clone2._DICT || {};
48866
+ const _OPCT = clone2.__FOREIGN__ ? transformSourceData(clone2.__FOREIGN__, i18nData) : {};
48867
+ const children = Array.isArray(clone2.__CHILDREN__) ? clone2.__CHILDREN__.map((c2) => transformSourceData(c2, i18nData)) : clone2.__CHILDREN__;
48868
+ return {
48869
+ ...clone2,
48870
+ _DICT,
48871
+ _OPCT,
48872
+ __FOREIGN__: null,
48873
+ __CHILDREN__: children
48874
+ };
48875
+ }
48876
+ function transformSourceDataList(data, dict = {}) {
48877
+ const list = data?.map((i) => transformSourceData(i, dict));
48878
+ return list || [];
48879
+ }
48880
+ function conversionFormState(payload) {
48881
+ const { interfaceData, masterSlaveList } = payload || {};
48882
+ const formState = {};
48883
+ if (interfaceData && interfaceData.data) {
48884
+ merge(formState, transformSourceData(interfaceData.data, interfaceData.dict));
48885
+ }
48886
+ masterSlaveList.map((item) => item.key).forEach((k) => {
48887
+ const subFormData = formState[k];
48888
+ if (subFormData) {
48889
+ formState[k] = transformSourceDataList([...subFormData.data], subFormData.dict);
48890
+ }
48891
+ });
48892
+ return formState;
48893
+ }
48894
+ function getSubmitFormData(formData) {
48895
+ const list2D = [];
48896
+ const filterKeys = ["_DICT", "_OPCT", "__FOREIGN__", "_MCTABLE", "__default_render__"];
48897
+ const realFormData = Object.keys(formData).reduce((acc, fieldKey) => {
48898
+ const info = list2D.find(
48899
+ (item) => (item.subTable2d || item.checkTable2d) && item.rowSubFieldKey === fieldKey
48900
+ );
48901
+ if (info) {
48902
+ const colSubTable = formData[info.colSubFieldKey]?.map((item) => ({
48903
+ [info.rowRefFieldKey]: item[info.colRefFieldKey]
48904
+ }));
48905
+ const arr = flatMap(
48906
+ formData[fieldKey],
48907
+ (row) => zip(row["_2DTABLE_"], colSubTable).map(([obj1, obj2]) => merge({}, obj1, obj2)).map(
48908
+ (item) => merge(
48909
+ pickBy(omit(row, filterKeys), (v) => !isNil(v)),
48910
+ pickBy(omit(item, filterKeys), (v) => !isNil(v))
48911
+ )
48912
+ )
48913
+ ).map((item) => omit(item, "_2DTABLE_"));
48914
+ acc[fieldKey] = arr.every((item) => Object.keys(item).length === 1 && has(item, "group_")) ? [] : arr;
48915
+ } else if (Array.isArray(formData[fieldKey])) {
48916
+ acc[fieldKey] = formData[fieldKey].map(
48917
+ (item) => Object.fromEntries(
48918
+ Object.entries(item).filter(([key, value]) => {
48919
+ if (filterKeys.includes(key)) return false;
48920
+ if (key.endsWith("_lb_") && isEmpty(value)) return false;
48921
+ return true;
48922
+ })
48923
+ )
48924
+ );
48925
+ } else {
48926
+ acc[fieldKey] = formData[fieldKey];
48927
+ }
48928
+ return acc;
48929
+ }, {});
48930
+ console.log("0506 数据转成真实提交数据(二维表要平铺)", realFormData);
48931
+ return omit(realFormData, filterKeys);
48932
+ }
48677
48933
  const API_CONFIG = {
48678
48934
  ENTITY_CATEGORY: "entity",
48679
48935
  // DEFAULT_PAGE_SIZE: 100,
@@ -49084,6 +49340,12 @@ const apiFetchers = {
49084
49340
  }
49085
49341
  })
49086
49342
  };
49343
+ function findFieldWidget(instances, fieldKey, modelKey) {
49344
+ return instances.find((instance2) => {
49345
+ const fieldMeta = instance2.widgetMeta?.field;
49346
+ return fieldKey === getLastSegment(fieldMeta?.fieldLink) && modelKey === getLastSegment(fieldMeta?.modelLink);
49347
+ });
49348
+ }
49087
49349
  function resolveFallback(props, fields) {
49088
49350
  if (!fields) return void 0;
49089
49351
  for (const field of fields) {
@@ -50388,7 +50650,7 @@ async function initializeDocumentEngine(props, payload, result) {
50388
50650
  bpmnFieldAuthMap: result.bpmnFieldAuthMap
50389
50651
  }
50390
50652
  };
50391
- const doc = newDoc({
50653
+ const doc = new Doc({
50392
50654
  model: docModel,
50393
50655
  mode: fillModeType,
50394
50656
  mainModelKey,
@@ -51279,10 +51541,7 @@ function useWidgetStaticAttrs(widget) {
51279
51541
  const { fieldList, modelInfo, fieldInfo } = useFieldInfo(() => fieldMeta.value);
51280
51542
  const widgetState = computed(
51281
51543
  () => resolveWidgetState({
51282
- docMode: docInst.value.mode,
51283
- isEditMode: docInst.value.isInEditMode(),
51284
- isPrintMode: docInst.value.isInPrintMode(),
51285
- formType: docInst.value.formType,
51544
+ doc: docInst.value,
51286
51545
  viewState: widgetProps.value.viewState,
51287
51546
  required: widgetProps.value.required,
51288
51547
  newRequired: widgetProps.value.newSpecificConfig?.newRequired,
@@ -51291,7 +51550,9 @@ function useWidgetStaticAttrs(widget) {
51291
51550
  disabled: widgetProps.value.disabled,
51292
51551
  newDisabled: widgetProps.value.newSpecificConfig?.newDisabled,
51293
51552
  cannotInput: widgetProps.value.cannotInput,
51294
- isLinkedModelField: fieldMeta.value?.isLinkedModelField
51553
+ isLinkedModelField: fieldMeta.value?.isLinkedModelField,
51554
+ fieldLink: fieldMeta.value?.fieldLink || "",
51555
+ modelLink: fieldMeta.value?.modelLink || ""
51295
51556
  })
51296
51557
  );
51297
51558
  computed(() => false);
@@ -52712,10 +52973,7 @@ const validateAllFields = async (doc) => {
52712
52973
  "fw:tree-select-multiple"
52713
52974
  ].includes(type4);
52714
52975
  const widgetState = resolveWidgetState({
52715
- docMode: doc.mode,
52716
- isEditMode: doc.isInEditMode(),
52717
- isPrintMode: doc.isInPrintMode(),
52718
- formType: doc.formType,
52976
+ doc,
52719
52977
  viewState: widgetProps.viewState,
52720
52978
  required: widgetProps.required,
52721
52979
  newRequired: widgetProps.newSpecificConfig?.newRequired,
@@ -52724,7 +52982,9 @@ const validateAllFields = async (doc) => {
52724
52982
  disabled: widgetProps.disabled,
52725
52983
  newDisabled: widgetProps.newSpecificConfig?.newDisabled,
52726
52984
  cannotInput: widgetProps.cannotInput,
52727
- isLinkedModelField: fieldMeta?.isLinkedModelField
52985
+ isLinkedModelField: fieldMeta?.isLinkedModelField,
52986
+ fieldLink: fieldMeta?.fieldLink || "",
52987
+ modelLink: fieldMeta?.modelLink || ""
52728
52988
  });
52729
52989
  const readonly2 = widgetState.displayStatus === "readonly-component" || widgetState.displayStatus === "readonly-text";
52730
52990
  const showFormItem = !fieldMeta?.isLinkedModelField && fieldMeta?.fieldLink && !widgetState.disabled && !readonly2;
@@ -52822,6 +53082,29 @@ function useDependency(doc, widget, ctx) {
52822
53082
  initDependency
52823
53083
  };
52824
53084
  }
53085
+ function useSpecificConfig(options) {
53086
+ const { widget, fieldInfo } = options;
53087
+ const widgetType = widget.widgetMeta?.type;
53088
+ if (widgetType !== "fw:number") {
53089
+ return;
53090
+ }
53091
+ const specificConfig = widget.widgetMeta.props.newSpecificConfig;
53092
+ const digits = fieldInfo?.value?.specificConfig?.digits;
53093
+ if (digits !== void 0) {
53094
+ specificConfig.digits = digits;
53095
+ }
53096
+ }
53097
+ function useWidgetInitializer(options) {
53098
+ const init2 = (isSupport) => {
53099
+ if (!isSupport) {
53100
+ return;
53101
+ }
53102
+ useSpecificConfig(options);
53103
+ };
53104
+ return {
53105
+ init: init2
53106
+ };
53107
+ }
52825
53108
  const _sfc_main$2P = /* @__PURE__ */ defineComponent({
52826
53109
  __name: "overlay-render",
52827
53110
  props: {
@@ -52855,6 +53138,12 @@ const _sfc_main$2P = /* @__PURE__ */ defineComponent({
52855
53138
  showDisabled,
52856
53139
  showReadonly
52857
53140
  } = useWidgetStaticAttrs(props.widget);
53141
+ const { init: init2 } = useWidgetInitializer({
53142
+ doc: props.doc,
53143
+ widget: props.widget,
53144
+ fieldInfo
53145
+ });
53146
+ init2(props.isLastWidgetId);
52858
53147
  const { validateField } = createFormValidator();
52859
53148
  onBeforeMount(() => {
52860
53149
  if (props.widget.widgetMeta.extra?.biz) {
@@ -53014,7 +53303,7 @@ const _sfc_main$2P = /* @__PURE__ */ defineComponent({
53014
53303
  };
53015
53304
  }
53016
53305
  });
53017
- const OverlayRender = /* @__PURE__ */ _export_sfc(_sfc_main$2P, [["__scopeId", "data-v-57af50f0"]]);
53306
+ const OverlayRender = /* @__PURE__ */ _export_sfc(_sfc_main$2P, [["__scopeId", "data-v-0a286da7"]]);
53018
53307
  let activeHoverId = 0;
53019
53308
  function useHoverDelay(callback, delay = 120) {
53020
53309
  let timer = null;
@@ -53951,19 +54240,22 @@ function buildPosMap(layers, getRect, toDom) {
53951
54240
  return res;
53952
54241
  }
53953
54242
  function buildDataIndexLayers(type4, cellsWithId, opts, extra) {
54243
+ const getDIVal = (cell) => {
54244
+ return type4 === "2d-table" && opts.isEdit ? cell.subRenderer?.xDataIndex : cell.subRenderer?.dataIndex;
54245
+ };
53954
54246
  const cells = cellsWithId.filter(
53955
- (cell) => cell?.subRenderer?.dataIndex != null && cell?.subRenderer?.type === type4
54247
+ (cell) => getDIVal(cell) != null && cell?.subRenderer?.type === type4
53956
54248
  );
53957
54249
  if (!cells.length) return {};
53958
54250
  const grouped = groupBy(
53959
54251
  cells,
53960
- (cell) => `${cell.subRenderer.id}_dataIndex${cell.subRenderer.dataIndex}`
54252
+ (cell) => `${cell.subRenderer.id}_dataIndex${getDIVal(cell)}`
53961
54253
  );
53962
54254
  return Object.fromEntries(
53963
54255
  Object.entries(grouped).map(([id, cells2]) => {
53964
54256
  const firstCell = cells2[0];
53965
54257
  const lastCell = cells2[cells2.length - 1];
53966
- const isZeroGroup = firstCell.subRenderer.dataIndex === 0;
54258
+ const isZeroGroup = getDIVal(firstCell) === 0;
53967
54259
  const bgLayer = createTableOutlineLayer({
53968
54260
  cells: mapCellsToOutlineCells(cells2),
53969
54261
  inset: opts.GROUP_BG_INSET
@@ -54079,7 +54371,6 @@ const _sfc_main$2H = /* @__PURE__ */ defineComponent({
54079
54371
  }
54080
54372
  });
54081
54373
  const CORNER_SIZE = 6;
54082
- const OFFSET_SIZE = 1;
54083
54374
  const _sfc_main$2G = /* @__PURE__ */ defineComponent({
54084
54375
  __name: "table-cell",
54085
54376
  props: {
@@ -54116,10 +54407,10 @@ const _sfc_main$2G = /* @__PURE__ */ defineComponent({
54116
54407
  }, [
54117
54408
  !cell.mergeFromId ? (openBlock(), createBlock(_component_v_rect, {
54118
54409
  key: 0,
54119
- x: cell.roundX + OFFSET_SIZE,
54120
- y: cell.roundY + OFFSET_SIZE,
54121
- width: cell.roundWidth - OFFSET_SIZE,
54122
- height: cell.roundHeight - OFFSET_SIZE,
54410
+ x: cell.roundX,
54411
+ y: cell.roundY,
54412
+ width: cell.roundWidth,
54413
+ height: cell.roundHeight,
54123
54414
  fill: cell.backgroundColor,
54124
54415
  id: cell.id
54125
54416
  }, null, 8, ["x", "y", "width", "height", "fill", "id"])) : createCommentVNode("", true),
@@ -54331,7 +54622,11 @@ const _sfc_main$2C = /* @__PURE__ */ defineComponent({
54331
54622
  () => buildDataIndexLayers(
54332
54623
  "fixed-table",
54333
54624
  cellsWithId.value,
54334
- { BORDER_INSET: BORDER_INSET$1, GROUP_BG_INSET: GROUP_BG_INSET$1 },
54625
+ {
54626
+ BORDER_INSET: BORDER_INSET$1,
54627
+ GROUP_BG_INSET: GROUP_BG_INSET$1,
54628
+ isEdit: props.doc.mode === DocModeTypeConst.Edit
54629
+ },
54335
54630
  (cell) => ({
54336
54631
  type: "data-group",
54337
54632
  valuePath: cell.subRenderer.valuePath,
@@ -54343,7 +54638,11 @@ const _sfc_main$2C = /* @__PURE__ */ defineComponent({
54343
54638
  () => buildDataIndexLayers(
54344
54639
  "check-table",
54345
54640
  cellsWithId.value,
54346
- { BORDER_INSET: BORDER_INSET$1, GROUP_BG_INSET: GROUP_BG_INSET$1 },
54641
+ {
54642
+ BORDER_INSET: BORDER_INSET$1,
54643
+ GROUP_BG_INSET: GROUP_BG_INSET$1,
54644
+ isEdit: props.doc.mode === DocModeTypeConst.Edit
54645
+ },
54347
54646
  (cell) => ({
54348
54647
  type: "data-group-2d",
54349
54648
  valuePath: cell.subRenderer.valuePath,
@@ -54355,11 +54654,15 @@ const _sfc_main$2C = /* @__PURE__ */ defineComponent({
54355
54654
  () => buildDataIndexLayers(
54356
54655
  "2d-table",
54357
54656
  cellsWithId.value,
54358
- { BORDER_INSET: BORDER_INSET$1, GROUP_BG_INSET: GROUP_BG_INSET$1 },
54657
+ {
54658
+ BORDER_INSET: BORDER_INSET$1,
54659
+ GROUP_BG_INSET: GROUP_BG_INSET$1,
54660
+ isEdit: props.doc.mode === DocModeTypeConst.Edit
54661
+ },
54359
54662
  (cell) => ({
54360
54663
  type: "data-group-2d",
54361
54664
  valuePath: cell.subRenderer.valuePath,
54362
- placeholder: `${cell.subRenderer.dataIndex}`
54665
+ placeholder: `${cell.subRenderer.xDataIndex}`
54363
54666
  })
54364
54667
  )
54365
54668
  );
@@ -54609,6 +54912,9 @@ const _sfc_main$2B = /* @__PURE__ */ defineComponent({
54609
54912
  });
54610
54913
  });
54611
54914
  const tableId = computed(() => props.widget.id);
54915
+ const isCurrentTableActive = computed(() => {
54916
+ return interaction.activeTableId === tableId.value;
54917
+ });
54612
54918
  const pageBaseOffset = computed(() => {
54613
54919
  const node = props.doc.layoutMapper.getBaseMetaNodeById(tableId.value);
54614
54920
  if (!node) return null;
@@ -54763,7 +55069,7 @@ const _sfc_main$2B = /* @__PURE__ */ defineComponent({
54763
55069
  key: 0,
54764
55070
  to: `#doc-konva-wrap-${__props.doc.id}`
54765
55071
  }, [
54766
- !unref(interaction).isHeaderFooterEdit ? (openBlock(), createElementBlock("div", {
55072
+ !unref(interaction).isHeaderFooterEdit && isCurrentTableActive.value ? (openBlock(), createElementBlock("div", {
54767
55073
  key: 0,
54768
55074
  class: normalizeClass(["table-action", { preview: isPreview.value }]),
54769
55075
  style: normalizeStyle(actionPos.value)
@@ -54919,7 +55225,7 @@ const _sfc_main$2B = /* @__PURE__ */ defineComponent({
54919
55225
  };
54920
55226
  }
54921
55227
  });
54922
- const TableActionOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$2B, [["__scopeId", "data-v-a2a0f070"]]);
55228
+ const TableActionOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$2B, [["__scopeId", "data-v-e9075c2f"]]);
54923
55229
  const _sfc_main$2A = /* @__PURE__ */ defineComponent({
54924
55230
  __name: "table-guide-line",
54925
55231
  props: {
@@ -55106,18 +55412,6 @@ const _sfc_main$2y = /* @__PURE__ */ defineComponent({
55106
55412
  "remove-hover-bool": removeHoverBool.value,
55107
55413
  "onUpdate:removeHoverBool": _cache[1] || (_cache[1] = ($event) => removeHoverBool.value = $event)
55108
55414
  }, null, 8, ["widget", "rows", "colWidths", "doc", "tableWidth", "tableHeight", "axis-hover", "remove-hover-bool"]),
55109
- createVNode(_sfc_main$2I, {
55110
- width: tableWidth.value,
55111
- height: tableHeight.value
55112
- }, null, 8, ["width", "height"]),
55113
- createVNode(_sfc_main$2H, {
55114
- mergeRects: __props.mergeRects,
55115
- colWidths: __props.colWidths,
55116
- rows: __props.rows,
55117
- colLefts: __props.colLefts,
55118
- tableWidth: tableWidth.value,
55119
- tableHeight: tableHeight.value
55120
- }, null, 8, ["mergeRects", "colWidths", "rows", "colLefts", "tableWidth", "tableHeight"]),
55121
55415
  createVNode(_sfc_main$2A, {
55122
55416
  colWidths: __props.colWidths,
55123
55417
  rows: __props.rows,
@@ -55141,7 +55435,19 @@ const _sfc_main$2y = /* @__PURE__ */ defineComponent({
55141
55435
  tableHeight: tableHeight.value,
55142
55436
  removeHoverBool: removeHoverBool.value
55143
55437
  }, null, 8, ["rows", "doc", "table-id", "colWidths", "colLefts", "tableWidth", "tableHeight", "removeHoverBool"]),
55144
- createVNode(_sfc_main$2G, { rows: __props.rows }, null, 8, ["rows"])
55438
+ createVNode(_sfc_main$2G, { rows: __props.rows }, null, 8, ["rows"]),
55439
+ createVNode(_sfc_main$2I, {
55440
+ width: tableWidth.value,
55441
+ height: tableHeight.value
55442
+ }, null, 8, ["width", "height"]),
55443
+ createVNode(_sfc_main$2H, {
55444
+ mergeRects: __props.mergeRects,
55445
+ colWidths: __props.colWidths,
55446
+ rows: __props.rows,
55447
+ colLefts: __props.colLefts,
55448
+ tableWidth: tableWidth.value,
55449
+ tableHeight: tableHeight.value
55450
+ }, null, 8, ["mergeRects", "colWidths", "rows", "colLefts", "tableWidth", "tableHeight"])
55145
55451
  ]),
55146
55452
  _: 1
55147
55453
  }, 8, ["config"]);
@@ -55178,6 +55484,15 @@ const _sfc_main$2x = /* @__PURE__ */ defineComponent({
55178
55484
  index: subRenderer.dataIndex
55179
55485
  };
55180
55486
  };
55487
+ const readonly2 = computed(() => {
55488
+ const subFieldKey = getLastSegment(getCtx().path);
55489
+ const state = resolveWidgetState({
55490
+ doc: props.doc,
55491
+ fieldLink: subFieldKey,
55492
+ modelLink: props.doc.mainModelKey
55493
+ });
55494
+ return state.displayStatus === "readonly-component" || state.displayStatus === "readonly-text";
55495
+ });
55181
55496
  const insertRows = (index2, count = 1) => {
55182
55497
  const { path: path2 } = getCtx();
55183
55498
  props.doc.dataManager.insertAt(path2, index2, ...Array.from({ length: count }, () => ({})));
@@ -55217,7 +55532,8 @@ const _sfc_main$2x = /* @__PURE__ */ defineComponent({
55217
55532
  return openBlock(), createBlock(Teleport, {
55218
55533
  to: `#doc-konva-wrap-${__props.doc.id}`
55219
55534
  }, [
55220
- createElementVNode("div", {
55535
+ !readonly2.value ? (openBlock(), createElementBlock("div", {
55536
+ key: 0,
55221
55537
  class: "sub-table-action",
55222
55538
  style: normalizeStyle(__props.pos)
55223
55539
  }, [
@@ -55324,12 +55640,12 @@ const _sfc_main$2x = /* @__PURE__ */ defineComponent({
55324
55640
  ]),
55325
55641
  _: 1
55326
55642
  })
55327
- ], 4)
55643
+ ], 4)) : createCommentVNode("", true)
55328
55644
  ], 8, ["to"]);
55329
55645
  };
55330
55646
  }
55331
55647
  });
55332
- const SubTableAction = /* @__PURE__ */ _export_sfc(_sfc_main$2x, [["__scopeId", "data-v-19e46d18"]]);
55648
+ const SubTableAction = /* @__PURE__ */ _export_sfc(_sfc_main$2x, [["__scopeId", "data-v-adc8fb9a"]]);
55333
55649
  const BORDER_INSET = 1;
55334
55650
  const GROUP_BG_INSET = 4;
55335
55651
  const _sfc_main$2w = /* @__PURE__ */ defineComponent({
@@ -55375,7 +55691,11 @@ const _sfc_main$2w = /* @__PURE__ */ defineComponent({
55375
55691
  return buildDataIndexLayers(
55376
55692
  type4,
55377
55693
  cellsWithId.value,
55378
- { BORDER_INSET, GROUP_BG_INSET },
55694
+ {
55695
+ BORDER_INSET,
55696
+ GROUP_BG_INSET,
55697
+ isEdit: props.doc.mode === DocModeTypeConst.Edit
55698
+ },
55379
55699
  () => ({
55380
55700
  type: type4,
55381
55701
  placeholder: "",
@@ -55440,13 +55760,18 @@ const _sfc_main$2v = /* @__PURE__ */ defineComponent({
55440
55760
  const widget = toRef(props, "widget");
55441
55761
  const tableWidth = computed(() => Math.round(widget.value.width));
55442
55762
  const tableHeight = computed(() => Math.round(widget.value.height));
55443
- const { showDisabled, showReadonly } = useWidgetStaticAttrs(widget.value);
55444
55763
  return (_ctx, _cache) => {
55445
55764
  const _component_v_group = resolveComponent("v-group");
55446
55765
  return openBlock(), createBlock(_component_v_group, {
55447
55766
  config: { x: 0, y: 0, id: widget.value.id }
55448
55767
  }, {
55449
55768
  default: withCtx(() => [
55769
+ createVNode(_sfc_main$2w, {
55770
+ rows: __props.rows,
55771
+ "table-id": widget.value.id,
55772
+ doc: widget.value.doc
55773
+ }, null, 8, ["rows", "table-id", "doc"]),
55774
+ createVNode(_sfc_main$2G, { rows: __props.rows }, null, 8, ["rows"]),
55450
55775
  createVNode(_sfc_main$2I, {
55451
55776
  width: tableWidth.value,
55452
55777
  height: tableHeight.value
@@ -55458,14 +55783,7 @@ const _sfc_main$2v = /* @__PURE__ */ defineComponent({
55458
55783
  colLefts: __props.colLefts,
55459
55784
  tableWidth: tableWidth.value,
55460
55785
  tableHeight: tableHeight.value
55461
- }, null, 8, ["mergeRects", "colWidths", "rows", "colLefts", "tableWidth", "tableHeight"]),
55462
- !(unref(showReadonly) || unref(showDisabled)) ? (openBlock(), createBlock(_sfc_main$2w, {
55463
- key: 0,
55464
- rows: __props.rows,
55465
- "table-id": widget.value.id,
55466
- doc: widget.value.doc
55467
- }, null, 8, ["rows", "table-id", "doc"])) : createCommentVNode("", true),
55468
- createVNode(_sfc_main$2G, { rows: __props.rows }, null, 8, ["rows"])
55786
+ }, null, 8, ["mergeRects", "colWidths", "rows", "colLefts", "tableWidth", "tableHeight"])
55469
55787
  ]),
55470
55788
  _: 1
55471
55789
  }, 8, ["config"]);
@@ -57050,19 +57368,19 @@ const _sfc_main$2m = /* @__PURE__ */ defineComponent({
57050
57368
  setup(__props, { expose: __expose }) {
57051
57369
  const props = __props;
57052
57370
  const formData = ref({
57053
- modelKey: void 0,
57371
+ key: void 0,
57054
57372
  name: "",
57055
- dynamicModelKey: void 0
57373
+ dynamicKey: void 0
57056
57374
  });
57057
57375
  const dynamicOptions = computed(() => {
57058
57376
  return props.options.map((o) => ({
57059
57377
  ...o,
57060
- disabled: o.disabled ? true : o.value === formData.value.modelKey
57378
+ disabled: o.disabled ? true : o.value === formData.value.key
57061
57379
  }));
57062
57380
  });
57063
57381
  const handleModelChange = (val, option) => {
57064
57382
  formData.value.name = option?.label || "";
57065
- formData.value.dynamicModelKey = void 0;
57383
+ formData.value.dynamicKey = void 0;
57066
57384
  };
57067
57385
  __expose({
57068
57386
  formData
@@ -57075,8 +57393,8 @@ const _sfc_main$2m = /* @__PURE__ */ defineComponent({
57075
57393
  }, {
57076
57394
  default: withCtx(() => [
57077
57395
  createVNode(unref(GctSelect), {
57078
- modelValue: formData.value.modelKey,
57079
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formData.value.modelKey = $event),
57396
+ modelValue: formData.value.key,
57397
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formData.value.key = $event),
57080
57398
  placeholder: "请选择",
57081
57399
  options: __props.options,
57082
57400
  onChange: handleModelChange
@@ -57105,8 +57423,8 @@ const _sfc_main$2m = /* @__PURE__ */ defineComponent({
57105
57423
  }, {
57106
57424
  default: withCtx(() => [
57107
57425
  createVNode(unref(GctSelect), {
57108
- modelValue: formData.value.dynamicModelKey,
57109
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => formData.value.dynamicModelKey = $event),
57426
+ modelValue: formData.value.dynamicKey,
57427
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => formData.value.dynamicKey = $event),
57110
57428
  placeholder: "请选择",
57111
57429
  options: dynamicOptions.value
57112
57430
  }, null, 8, ["modelValue", "options"])
@@ -57117,7 +57435,7 @@ const _sfc_main$2m = /* @__PURE__ */ defineComponent({
57117
57435
  };
57118
57436
  }
57119
57437
  });
57120
- const SubTableFormModal = /* @__PURE__ */ _export_sfc(_sfc_main$2m, [["__scopeId", "data-v-d7b93bef"]]);
57438
+ const SubTableFormModal = /* @__PURE__ */ _export_sfc(_sfc_main$2m, [["__scopeId", "data-v-9e3d6c1b"]]);
57121
57439
  const _hoisted_1$1G = { class: "container" };
57122
57440
  const _sfc_main$2l = /* @__PURE__ */ defineComponent({
57123
57441
  __name: "set-table-header-form-modal",
@@ -57150,12 +57468,6 @@ const _sfc_main$2l = /* @__PURE__ */ defineComponent({
57150
57468
  ]),
57151
57469
  _: 1
57152
57470
  }),
57153
- createVNode(unref(GctFormItem), { label: "起始位置" }, {
57154
- default: withCtx(() => [
57155
- createTextVNode(toDisplayString(__props.selection), 1)
57156
- ]),
57157
- _: 1
57158
- }),
57159
57471
  createVNode(unref(GctFormItem), { label: "分页渲染" }, {
57160
57472
  default: withCtx(() => [
57161
57473
  createVNode(unref(GctRadioGroup), {
@@ -57188,7 +57500,7 @@ const _sfc_main$2l = /* @__PURE__ */ defineComponent({
57188
57500
  };
57189
57501
  }
57190
57502
  });
57191
- const SetTableHeaderFormModal = /* @__PURE__ */ _export_sfc(_sfc_main$2l, [["__scopeId", "data-v-8f09ae3e"]]);
57503
+ const SetTableHeaderFormModal = /* @__PURE__ */ _export_sfc(_sfc_main$2l, [["__scopeId", "data-v-e376bf97"]]);
57192
57504
  const _hoisted_1$1F = { class: "items-container" };
57193
57505
  const _hoisted_2$14 = { class: "ribbon-tab-item" };
57194
57506
  const _hoisted_3$P = { class: "ribbon-tab-item" };
@@ -57292,12 +57604,12 @@ const _sfc_main$2k = /* @__PURE__ */ defineComponent({
57292
57604
  },
57293
57605
  onConfirm: ({ bodyRef, close }) => {
57294
57606
  const {
57295
- modelKey: modelKey2,
57607
+ key,
57296
57608
  name: name2,
57297
- dynamicModelKey
57609
+ dynamicKey
57298
57610
  // 动态关联 data-group-2d
57299
57611
  } = bodyRef.value.formData;
57300
- if (!modelKey2) {
57612
+ if (!key) {
57301
57613
  GctMessage.error("请选择模型");
57302
57614
  return;
57303
57615
  }
@@ -57305,13 +57617,13 @@ const _sfc_main$2k = /* @__PURE__ */ defineComponent({
57305
57617
  GctMessage.error("请输入名称");
57306
57618
  return;
57307
57619
  }
57308
- if (type4 === "set2DTable" && !dynamicModelKey) {
57620
+ if (type4 === "set2DTable" && !dynamicKey) {
57309
57621
  GctMessage.error("请选择关联模型");
57310
57622
  return;
57311
57623
  }
57312
57624
  docInst?.value?.execute(type4, {
57313
57625
  name: name2,
57314
- valuePath: `$.${modelKey2}${dynamicModelKey ? `:${dynamicModelKey}` : ""}`,
57626
+ valuePath: `$.${key}${dynamicKey ? `:${dynamicKey}` : ""}`,
57315
57627
  doCallback(_2, output) {
57316
57628
  docInst.value.eventManager.cursorController.clearCursor();
57317
57629
  if (!output) return;
@@ -57601,7 +57913,7 @@ const _sfc_main$2k = /* @__PURE__ */ defineComponent({
57601
57913
  };
57602
57914
  }
57603
57915
  });
57604
- const WordTable = /* @__PURE__ */ _export_sfc(_sfc_main$2k, [["__scopeId", "data-v-12bc9666"]]);
57916
+ const WordTable = /* @__PURE__ */ _export_sfc(_sfc_main$2k, [["__scopeId", "data-v-1df12fe0"]]);
57605
57917
  const _hoisted_1$1E = { class: "ribbon" };
57606
57918
  const _hoisted_2$13 = { class: "ribbon-content-wrapper" };
57607
57919
  const _sfc_main$2j = /* @__PURE__ */ defineComponent({
@@ -57859,7 +58171,8 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
57859
58171
  const createFieldToWidget = createDesignFieldToWidgetFactory(designCtx.getFieldManifest);
57860
58172
  const subFieldKey = computed(() => {
57861
58173
  if (!interCtx.panelData) return "";
57862
- return getLastSegment(interCtx.panelData.context.subFieldKey);
58174
+ const s = getLastSegment(interCtx.panelData.context.subFieldKey);
58175
+ return s.includes(":") ? s.split(":")[0] : s;
57863
58176
  });
57864
58177
  const modelKey = computed(() => {
57865
58178
  if (!interCtx.panelData) return "";
@@ -57979,7 +58292,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
57979
58292
  };
57980
58293
  }
57981
58294
  });
57982
- const ToolkitContentFields = /* @__PURE__ */ _export_sfc(_sfc_main$2h, [["__scopeId", "data-v-5450612d"]]);
58295
+ const ToolkitContentFields = /* @__PURE__ */ _export_sfc(_sfc_main$2h, [["__scopeId", "data-v-c740a237"]]);
57983
58296
  function createDesignPaperWidgetToWidgetFactory(getPaperWidgetManifest) {
57984
58297
  return function(widget, opts = {}) {
57985
58298
  const manifest2 = getPaperWidgetManifest(widget.type);
@@ -58155,7 +58468,7 @@ const _sfc_main$2f = /* @__PURE__ */ defineComponent({
58155
58468
  };
58156
58469
  }
58157
58470
  });
58158
- const Toolkit = /* @__PURE__ */ _export_sfc(_sfc_main$2f, [["__scopeId", "data-v-0ead3dc7"]]);
58471
+ const Toolkit = /* @__PURE__ */ _export_sfc(_sfc_main$2f, [["__scopeId", "data-v-dddcd6f8"]]);
58159
58472
  const _hoisted_1$1z = { class: "designer_panel-wrapper" };
58160
58473
  const _hoisted_2$$ = { class: "panel-breadcrumb" };
58161
58474
  const _hoisted_3$L = {
@@ -59698,7 +60011,7 @@ const _sfc_main$22 = /* @__PURE__ */ defineComponent({
59698
60011
  };
59699
60012
  }
59700
60013
  });
59701
- const DocLayout = /* @__PURE__ */ _export_sfc(_sfc_main$22, [["__scopeId", "data-v-81ef140d"]]);
60014
+ const DocLayout = /* @__PURE__ */ _export_sfc(_sfc_main$22, [["__scopeId", "data-v-6f089589"]]);
59702
60015
  const _sfc_main$21 = /* @__PURE__ */ defineComponent({
59703
60016
  __name: "editable-canvas",
59704
60017
  props: {
@@ -59707,6 +60020,8 @@ const _sfc_main$21 = /* @__PURE__ */ defineComponent({
59707
60020
  setup(__props) {
59708
60021
  const { docInst } = useDocPubApiContext();
59709
60022
  const interCtx = useInteractionContext();
60023
+ const modelKey = toRef(docInst.value, "mainModelKey");
60024
+ const { fields: mainModelFields } = useModelData(modelKey);
59710
60025
  const pageStageRef = ref(null);
59711
60026
  const scrollRef = ref(null);
59712
60027
  function canDrop(e, isOutOfFlow) {
@@ -59741,6 +60056,7 @@ const _sfc_main$21 = /* @__PURE__ */ defineComponent({
59741
60056
  docInst.value.execute(CommandType.insertField, {
59742
60057
  valuePath: widgetMeta.field?.valuePath,
59743
60058
  widgetMeta,
60059
+ mainModelFields: mainModelFields.value || [],
59744
60060
  doCallback(data) {
59745
60061
  if (!data) return;
59746
60062
  const focus = Array.isArray(data) ? data[data.length - 1] : data;
@@ -59830,7 +60146,7 @@ const _sfc_main$21 = /* @__PURE__ */ defineComponent({
59830
60146
  };
59831
60147
  }
59832
60148
  });
59833
- const EditableCanvas = /* @__PURE__ */ _export_sfc(_sfc_main$21, [["__scopeId", "data-v-6f52e110"]]);
60149
+ const EditableCanvas = /* @__PURE__ */ _export_sfc(_sfc_main$21, [["__scopeId", "data-v-02d21574"]]);
59834
60150
  const useDocDesignLayoutProps = () => {
59835
60151
  const provideProps = (props) => {
59836
60152
  provide(DOC_DESIGN_LAYOUT_PROPS, props);
@@ -60263,6 +60579,162 @@ const _sfc_main$20 = /* @__PURE__ */ defineComponent({
60263
60579
  }
60264
60580
  });
60265
60581
  const docDesignLayout = /* @__PURE__ */ _export_sfc(_sfc_main$20, [["__scopeId", "data-v-e7fd4de6"]]);
60582
+ function convertPxToPaperSize(pageSize, customSize) {
60583
+ if (pageSize === PageSizeEnumConst.A3) {
60584
+ return {
60585
+ size: "a3",
60586
+ width: "297mm",
60587
+ height: "420mm"
60588
+ };
60589
+ }
60590
+ if (pageSize === PageSizeEnumConst.A4) {
60591
+ return {
60592
+ size: "a4",
60593
+ width: "210mm",
60594
+ height: "297mm"
60595
+ };
60596
+ }
60597
+ if (pageSize === PageSizeEnumConst.A5) {
60598
+ return {
60599
+ size: "a5",
60600
+ width: "148mm",
60601
+ height: "210mm"
60602
+ };
60603
+ }
60604
+ return {
60605
+ size: "",
60606
+ width: `${customSize[0]}mm`,
60607
+ height: `${customSize[1]}mm`
60608
+ };
60609
+ }
60610
+ function usePrint() {
60611
+ const getPageSize = (item, paperSize) => {
60612
+ const isLandscape = item.width > item.height;
60613
+ const width = parseInt(isLandscape ? paperSize.height : paperSize.width);
60614
+ const height = parseInt(isLandscape ? paperSize.width : paperSize.height);
60615
+ return { isLandscape, width, height };
60616
+ };
60617
+ const waitImageLoad = (img) => {
60618
+ return new Promise((resolve) => {
60619
+ if (img.complete) return resolve();
60620
+ img.onload = () => resolve();
60621
+ img.onerror = () => resolve();
60622
+ });
60623
+ };
60624
+ const printView = async (paperList, options) => {
60625
+ const { pageSize, customSize, direction } = options;
60626
+ const iframe = document.createElement("iframe");
60627
+ iframe.style.cssText = `
60628
+ visibility:hidden;
60629
+ position:absolute;
60630
+ left: 0;
60631
+ top:0;
60632
+ width:0;
60633
+ height:0;
60634
+ border:none;
60635
+ `;
60636
+ document.body.appendChild(iframe);
60637
+ const doc = iframe.contentWindow.document;
60638
+ doc.open();
60639
+ const container2 = document.createElement("div");
60640
+ const paperSize = convertPxToPaperSize(pageSize, customSize);
60641
+ const isGlobalLandscape = direction === OrientationTypeConst.Landscape;
60642
+ const imgTasks = [];
60643
+ paperList.forEach((item) => {
60644
+ const pageWrapper = document.createElement("div");
60645
+ pageWrapper.style.cssText = `
60646
+ position:relative;
60647
+ width:${paperSize.width};
60648
+ height:${paperSize.height};
60649
+ `;
60650
+ const isPageLandscape = item.width > item.height;
60651
+ const needRotate = isGlobalLandscape && !isPageLandscape || !isGlobalLandscape && isPageLandscape;
60652
+ const img = document.createElement("img");
60653
+ img.src = item.base64;
60654
+ if (needRotate) {
60655
+ img.style.cssText = `
60656
+ position:absolute;
60657
+ left:50%;
60658
+ top:50%;
60659
+ width:${isGlobalLandscape ? paperSize.width : paperSize.height};
60660
+ height:${isGlobalLandscape ? paperSize.height : paperSize.width};
60661
+ transform:translate(-50%, -50%) rotate(90deg);
60662
+ `;
60663
+ } else {
60664
+ img.style.cssText = `
60665
+ position:absolute;
60666
+ left: 0;
60667
+ top:0;
60668
+ width:100%;
60669
+ height:100%;
60670
+ `;
60671
+ }
60672
+ imgTasks.push(waitImageLoad(img));
60673
+ pageWrapper.appendChild(img);
60674
+ container2.appendChild(pageWrapper);
60675
+ });
60676
+ const style = document.createElement("style");
60677
+ style.innerHTML = `
60678
+ * { margin:0; padding:0; }
60679
+ @page {
60680
+ margin:0;
60681
+ size:${paperSize.size} ${isGlobalLandscape ? "landscape" : "portrait"};
60682
+ }
60683
+ `;
60684
+ doc.write(style.outerHTML + container2.innerHTML);
60685
+ await Promise.all(imgTasks);
60686
+ setTimeout(async () => {
60687
+ iframe.contentWindow.print();
60688
+ doc.close();
60689
+ window.addEventListener(
60690
+ "mouseover",
60691
+ () => {
60692
+ iframe?.remove();
60693
+ },
60694
+ {
60695
+ once: true
60696
+ }
60697
+ );
60698
+ });
60699
+ };
60700
+ const exportWordPDF = (paperList, options) => {
60701
+ const { pageSize, customSize, fileName = "document.pdf" } = options;
60702
+ const paperSize = convertPxToPaperSize(pageSize, customSize);
60703
+ let pdf = null;
60704
+ paperList.forEach((item, index2) => {
60705
+ const { isLandscape, width, height } = getPageSize(item, paperSize);
60706
+ if (!pdf) {
60707
+ pdf = new jsPDF({
60708
+ orientation: isLandscape ? "landscape" : "portrait",
60709
+ unit: "mm",
60710
+ format: [width, height]
60711
+ });
60712
+ } else {
60713
+ pdf.addPage([width, height], isLandscape ? "landscape" : "portrait");
60714
+ }
60715
+ pdf.addImage(item.base64, "PNG", 0, 0, width, height);
60716
+ });
60717
+ pdf.save(fileName);
60718
+ };
60719
+ const getPdfBuffer = (paperList, options) => {
60720
+ const { pageSize, customSize } = options;
60721
+ const paperSize = convertPxToPaperSize(pageSize, customSize);
60722
+ const pdf = new jsPDF({ unit: "mm" });
60723
+ paperList.forEach((item, index2) => {
60724
+ const { isLandscape, width, height } = getPageSize(item, paperSize);
60725
+ if (index2 !== 0) {
60726
+ pdf.addPage([width, height], isLandscape ? "landscape" : "portrait");
60727
+ }
60728
+ pdf.addImage(item.base64, "PNG", 0, 0, width, height);
60729
+ });
60730
+ return pdf.output("arraybuffer");
60731
+ };
60732
+ return {
60733
+ printView,
60734
+ exportWordPDF,
60735
+ getPdfBuffer
60736
+ };
60737
+ }
60266
60738
  const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
60267
60739
  __name: "preview-canvas",
60268
60740
  props: {
@@ -60318,7 +60790,7 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
60318
60790
  };
60319
60791
  }
60320
60792
  });
60321
- const PreviewCanvas = /* @__PURE__ */ _export_sfc(_sfc_main$1$, [["__scopeId", "data-v-ff207f6a"]]);
60793
+ const PreviewCanvas = /* @__PURE__ */ _export_sfc(_sfc_main$1$, [["__scopeId", "data-v-c852bc0c"]]);
60322
60794
  const _sfc_main$1_ = /* @__PURE__ */ defineComponent({
60323
60795
  __name: "doc-render-layout",
60324
60796
  setup(__props, { expose: __expose }) {
@@ -61755,14 +62227,14 @@ const manifest$6 = {
61755
62227
  text: "render:pw-barcode"
61756
62228
  },
61757
62229
  defaultLayout: {
61758
- width: 120,
62230
+ width: 182,
61759
62231
  height: 42
61760
62232
  },
61761
62233
  defaultProps: {
61762
62234
  /** 条码类型 */
61763
62235
  codeType: BwipCodeTypeConst.Code39,
61764
62236
  /** 对齐方式 */
61765
- justifyContent: "flex-start",
62237
+ justifyContent: "center",
61766
62238
  /** 显示内容类型 */
61767
62239
  valueType: ValueTypeConst.Fixed,
61768
62240
  /** 条码值 */
@@ -63077,6 +63549,7 @@ const _sfc_main$1O = /* @__PURE__ */ defineComponent({
63077
63549
  const { docInst, isDesignMode, pageWidgetProps } = usePaperWidgetStaticAttrs(props.widget);
63078
63550
  const readonlyValue = ref();
63079
63551
  const valueType = computed(() => pageWidgetProps.value.valueType);
63552
+ const alignType = computed(() => pageWidgetProps.value.justifyContent);
63080
63553
  const modelValue = computed(() => {
63081
63554
  let text = pageWidgetProps.value.value;
63082
63555
  if (valueType.value === ValueTypeConst.Field) {
@@ -63279,11 +63752,11 @@ const _sfc_main$1O = /* @__PURE__ */ defineComponent({
63279
63752
  width: renderWidth.value,
63280
63753
  height: layout.value.textHeight,
63281
63754
  text: textValue.value,
63282
- align: "center",
63755
+ align: alignType.value,
63283
63756
  verticalAlign: "middle",
63284
63757
  fontSize: fontSize2.value,
63285
63758
  fill: textColor.value
63286
- }, null, 8, ["y", "width", "height", "text", "fontSize", "fill"])) : createCommentVNode("", true),
63759
+ }, null, 8, ["y", "width", "height", "text", "align", "fontSize", "fill"])) : createCommentVNode("", true),
63287
63760
  createVNode(_component_v_rect, { config: bgConfig.value }, null, 8, ["config"])
63288
63761
  ]),
63289
63762
  _: 1
@@ -63297,6 +63770,7 @@ const __vite_glob_0_8$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.d
63297
63770
  }, Symbol.toStringTag, { value: "Module" }));
63298
63771
  const fontSize = 13;
63299
63772
  const lineHeight = 15;
63773
+ const CELL_PADDING = 5;
63300
63774
  const _sfc_main$1N = /* @__PURE__ */ defineComponent({
63301
63775
  __name: "pw-diagonal-render",
63302
63776
  props: {
@@ -63344,8 +63818,7 @@ const _sfc_main$1N = /* @__PURE__ */ defineComponent({
63344
63818
  return pageWidgetProps.value.names[index2];
63345
63819
  }
63346
63820
  const fieldMeta = pageWidgetProps.value.bindFields?.[index2];
63347
- console.log("fieldData", fieldMeta);
63348
- if (fieldMeta.fieldData) {
63821
+ if (fieldMeta && fieldMeta.fieldData) {
63349
63822
  const path2 = fieldMeta.fieldData?.valuePath;
63350
63823
  if (isDesignMode.value) {
63351
63824
  return path2;
@@ -63425,7 +63898,7 @@ const _sfc_main$1N = /* @__PURE__ */ defineComponent({
63425
63898
  return result;
63426
63899
  }
63427
63900
  const topTextLines = computed(() => {
63428
- const text = names.value[0] || "";
63901
+ const text = names.value[isBackward.value ? 0 : 2] || "";
63429
63902
  if (isBackward.value) {
63430
63903
  const w2 = size.value === 2 ? width.value : width.value - width.value * 0.4;
63431
63904
  return layoutByLineWidth({
@@ -63449,7 +63922,7 @@ const _sfc_main$1N = /* @__PURE__ */ defineComponent({
63449
63922
  });
63450
63923
  });
63451
63924
  const bottomTextLines = computed(() => {
63452
- const text = names.value[2] || "";
63925
+ const text = names.value[isBackward.value ? 2 : 0] || "";
63453
63926
  if (isBackward.value) {
63454
63927
  const y0 = size.value === 2 ? 0 : height.value * 0.4;
63455
63928
  const h2 = size.value === 2 ? height.value : height.value - height.value * 0.4;
@@ -63574,7 +64047,7 @@ const _sfc_main$1N = /* @__PURE__ */ defineComponent({
63574
64047
  const _component_v_rect = resolveComponent("v-rect");
63575
64048
  const _component_v_group = resolveComponent("v-group");
63576
64049
  return openBlock(), createBlock(_component_v_group, {
63577
- config: { x: __props.widget.x, y: __props.widget.y, id: __props.widget.id }
64050
+ config: { x: __props.widget.x - CELL_PADDING, y: __props.widget.y - CELL_PADDING, id: __props.widget.id }
63578
64051
  }, {
63579
64052
  default: withCtx(() => [
63580
64053
  (openBlock(true), createElementBlock(Fragment, null, renderList(lines.value, (line, i) => {
@@ -64480,7 +64953,7 @@ const _sfc_main$1D = /* @__PURE__ */ defineComponent({
64480
64953
  default: withCtx(() => [
64481
64954
  createElementVNode("div", _hoisted_2$S, [
64482
64955
  createVNode(unref(GctFormItem), {
64483
- label: "页面名称",
64956
+ label: "表单名称",
64484
64957
  inline: false
64485
64958
  }, {
64486
64959
  default: withCtx(() => [
@@ -64640,10 +65113,10 @@ const _sfc_main$1D = /* @__PURE__ */ defineComponent({
64640
65113
  };
64641
65114
  }
64642
65115
  });
64643
- const PaperPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1D, [["__scopeId", "data-v-1558f1e5"]]);
65116
+ const PaperPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1D, [["__scopeId", "data-v-c69e49c7"]]);
64644
65117
  const schema$c = {
64645
65118
  key: "paper.basic",
64646
- title: "页面属性",
65119
+ title: "表单属性",
64647
65120
  render: PaperPanel
64648
65121
  };
64649
65122
  let snapshotScheduled = false;
@@ -72737,7 +73210,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
72737
73210
  const alignHorizontalOptions = [
72738
73211
  {
72739
73212
  label: "左对齐",
72740
- value: "flex-start",
73213
+ value: "left",
72741
73214
  icon: "icon-zuoduiqi2",
72742
73215
  showTip: true
72743
73216
  },
@@ -72749,7 +73222,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
72749
73222
  },
72750
73223
  {
72751
73224
  label: "右对齐",
72752
- value: "flex-end",
73225
+ value: "right",
72753
73226
  icon: "icon-youduiqi2",
72754
73227
  showTip: true
72755
73228
  }
@@ -72788,7 +73261,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
72788
73261
  numberProps
72789
73262
  }, null, 8, ["modelValue"]),
72790
73263
  createVNode(_sfc_main$W, {
72791
- label: "对齐方式",
73264
+ label: "内容对齐方式",
72792
73265
  modelValue: formState.value.justifyContent,
72793
73266
  "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => formState.value.justifyContent = $event),
72794
73267
  options: alignHorizontalOptions,
@@ -72810,7 +73283,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
72810
73283
  };
72811
73284
  }
72812
73285
  });
72813
- const widgetBarcodeConfig = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-03ac348e"]]);
73286
+ const widgetBarcodeConfig = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-dd6c8791"]]);
72814
73287
  const __vite_glob_1_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
72815
73288
  __proto__: null,
72816
73289
  default: widgetBarcodeConfig