@gct-paas/word 0.1.17 → 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.
- package/dist/core/command/types.d.ts +2 -0
- package/dist/core/data/DataManager.d.ts +9 -0
- package/dist/core/event/types.d.ts +1 -1
- package/dist/core/index.d.ts +2 -5
- package/dist/core/interaction/InteractionController.d.ts +3 -0
- package/dist/core/interaction/types.d.ts +2 -0
- package/dist/core/interaction/useInteraction.d.ts +1 -0
- package/dist/core/layout/handlers/ImageHandler.d.ts +1 -0
- package/dist/core/layout/handlers/TextHandler.d.ts +5 -0
- package/dist/core/layout/handlers/base/BaseHandler.d.ts +5 -0
- package/dist/core/layout/handlers/fields/BaseHandler.d.ts +5 -0
- package/dist/core/model/DocModel.d.ts +1 -0
- package/dist/core/model/footers/Wfooter.d.ts +6 -0
- package/dist/core/model/headers/Wheader.d.ts +6 -0
- package/dist/core/model/helpers.d.ts +15 -0
- package/dist/core/model/images/Wimages.d.ts +12 -0
- package/dist/core/utils/expand.d.ts +3 -1
- package/dist/core/view/TableCell.d.ts +2 -0
- package/dist/core/view/base/LayoutNode.d.ts +3 -0
- package/dist/core/widget/widget-state.d.ts +14 -5
- package/dist/index.es.js +986 -529
- package/dist/runtime/canvas/doc-layout.vue.d.ts +2 -1
- package/dist/runtime/canvas/table/utils/index.d.ts +1 -0
- package/dist/runtime/canvas/table/utils/useTableSelection.d.ts +1 -0
- package/dist/runtime/designer/main/editable-canvas.vue.d.ts +2 -2
- package/dist/runtime/designer/ribbon/components/sub-table-form-modal.vue.d.ts +6 -6
- package/dist/runtime/factories/modules/useSpecificConfig.d.ts +2 -0
- package/dist/runtime/factories/useRenderData.d.ts +1 -1
- package/dist/runtime/factories/useWidgetInitializer.d.ts +11 -0
- package/dist/runtime/renderer/main/preview-canvas.vue.d.ts +2 -2
- package/dist/sdk/doc-runtime/factories/useDocumentFactory.d.ts +7 -1
- package/dist/sdk/engine/index.d.ts +3 -3
- package/dist/sdk/types/index.d.ts +9 -0
- package/dist/sdk/vue/layouts/doc-render-layout.vue.d.ts +2 -2
- package/dist/{core/sdk → utils/composables}/usePagesToPdf.d.ts +1 -1
- package/dist/utils/func/core.d.ts +26 -9
- package/dist/utils/func/field.d.ts +13 -0
- package/dist/utils/func/file.d.ts +1 -1
- package/dist/utils/func/render.d.ts +10 -1
- package/dist/word.css +114 -114
- package/package.json +1 -2
- package/dist/base/utils/unit-converter-util.d.ts +0 -18
- package/dist/core/render/KonvaRenderer.d.ts +0 -46
- package/dist/core/render/RendererFactory.d.ts +0 -4
- package/dist/core/render/types.d.ts +0 -9
- package/dist/core/sdk/createDoc.d.ts +0 -2
- package/dist/runtime/interface/utils.d.ts +0 -12
- /package/dist/core/{sdk → utils}/DocPubApiContext.d.ts +0 -0
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
|
20582
|
+
function safeParseJson(data, fallback = null, validator2) {
|
|
20583
|
+
if (typeof data !== "string") return fallback;
|
|
20594
20584
|
try {
|
|
20595
|
-
|
|
20585
|
+
const parsed = JSON.parse(data);
|
|
20586
|
+
if (validator2 && !validator2(parsed)) {
|
|
20587
|
+
return fallback;
|
|
20588
|
+
}
|
|
20589
|
+
return parsed;
|
|
20596
20590
|
} catch {
|
|
20597
|
-
return
|
|
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
|
|
20700
|
-
|
|
20701
|
-
|
|
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
|
|
20766
|
-
const
|
|
20767
|
-
|
|
20768
|
-
|
|
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
|
|
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
|
-
|
|
21138
|
-
|
|
21183
|
+
const bOn = parseOnOffToggleFromElement(this.getElement("w:b"));
|
|
21184
|
+
if (bOn !== void 0) {
|
|
21185
|
+
style.b = bOn;
|
|
21139
21186
|
}
|
|
21140
|
-
|
|
21141
|
-
|
|
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
|
-
|
|
21148
|
-
|
|
21195
|
+
const strikeOn = parseOnOffToggleFromElement(this.getElement("w:strike"));
|
|
21196
|
+
if (strikeOn !== void 0) {
|
|
21197
|
+
style.strike = strikeOn;
|
|
21149
21198
|
}
|
|
21150
|
-
|
|
21151
|
-
|
|
21199
|
+
const dstrikeOn = parseOnOffToggleFromElement(this.getElement("w:dstrike"));
|
|
21200
|
+
if (dstrikeOn !== void 0) {
|
|
21201
|
+
style.dstrike = dstrikeOn;
|
|
21152
21202
|
}
|
|
21153
|
-
|
|
21154
|
-
|
|
21203
|
+
const capsOn = parseOnOffToggleFromElement(this.getElement("w:caps"));
|
|
21204
|
+
if (capsOn !== void 0) {
|
|
21205
|
+
style.caps = capsOn;
|
|
21155
21206
|
}
|
|
21156
|
-
|
|
21157
|
-
|
|
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 =
|
|
25905
|
-
if (rPr.i) style.i =
|
|
25906
|
-
if (rPr.strike) style.strike =
|
|
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
|
}
|
|
@@ -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 {
|
|
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) {
|
|
@@ -38938,7 +39025,7 @@ class Paragraph extends LayoutGroup {
|
|
|
38938
39025
|
offset2 = this.width - this.getContextWidth();
|
|
38939
39026
|
}
|
|
38940
39027
|
this.forEachChild((child) => {
|
|
38941
|
-
child.x += offset2;
|
|
39028
|
+
child.x += Math.max(offset2, 0);
|
|
38942
39029
|
});
|
|
38943
39030
|
}
|
|
38944
39031
|
/**
|
|
@@ -39383,9 +39470,17 @@ class LayoutContext {
|
|
|
39383
39470
|
if (!path2.includes("[n]")) {
|
|
39384
39471
|
return path2;
|
|
39385
39472
|
}
|
|
39386
|
-
const
|
|
39387
|
-
|
|
39388
|
-
|
|
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}]`);
|
|
39389
39484
|
}
|
|
39390
39485
|
}
|
|
39391
39486
|
class TextHandler {
|
|
@@ -39398,6 +39493,10 @@ class TextHandler {
|
|
|
39398
39493
|
}
|
|
39399
39494
|
return id;
|
|
39400
39495
|
}
|
|
39496
|
+
static get2DInfo(context) {
|
|
39497
|
+
const { xDataIndex, yDataIndex, valuePath } = context.cell?.subRenderer || {};
|
|
39498
|
+
return { xDataIndex, yDataIndex, valuePath2D: valuePath };
|
|
39499
|
+
}
|
|
39401
39500
|
/**
|
|
39402
39501
|
* 合并部分run
|
|
39403
39502
|
* @param context
|
|
@@ -39430,7 +39529,8 @@ class TextHandler {
|
|
|
39430
39529
|
modelRef: {
|
|
39431
39530
|
id: this.getId(context, wr),
|
|
39432
39531
|
start: charMetrics[0]?.charIndex,
|
|
39433
|
-
end: charMetrics[charMetrics.length - 1]?.charIndex
|
|
39532
|
+
end: charMetrics[charMetrics.length - 1]?.charIndex,
|
|
39533
|
+
...this.get2DInfo(context)
|
|
39434
39534
|
},
|
|
39435
39535
|
style: layoutStyle,
|
|
39436
39536
|
charMetrics
|
|
@@ -39496,7 +39596,8 @@ class TextHandler {
|
|
|
39496
39596
|
modelRef: {
|
|
39497
39597
|
id: this.getId(context, wr),
|
|
39498
39598
|
start: charIndex,
|
|
39499
|
-
end: charIndex
|
|
39599
|
+
end: charIndex,
|
|
39600
|
+
...this.get2DInfo(context)
|
|
39500
39601
|
},
|
|
39501
39602
|
style: layoutStyle,
|
|
39502
39603
|
charMetrics: [
|
|
@@ -39543,19 +39644,42 @@ let ImageHandler$2 = class ImageHandler {
|
|
|
39543
39644
|
static emuToPixels(emu) {
|
|
39544
39645
|
return UnitConverter.emuToPixel(emu);
|
|
39545
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
|
+
}
|
|
39546
39668
|
static layout(context, wr) {
|
|
39547
39669
|
if (!wr.drawing) return;
|
|
39548
39670
|
const width = this.emuToPixels(wr.drawing.width);
|
|
39549
39671
|
const height = this.emuToPixels(wr.drawing.height);
|
|
39550
39672
|
let doc = context.doc;
|
|
39551
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) || "" : "";
|
|
39552
39676
|
const run = new ImageRun({
|
|
39553
39677
|
doc,
|
|
39554
39678
|
width,
|
|
39555
39679
|
height,
|
|
39556
39680
|
x: context.getRunX(),
|
|
39557
39681
|
y: 0,
|
|
39558
|
-
src
|
|
39682
|
+
src,
|
|
39559
39683
|
modelRef: {
|
|
39560
39684
|
id: wr.id,
|
|
39561
39685
|
start: 0,
|
|
@@ -39692,6 +39816,10 @@ let BaseHandler$1 = class BaseHandler {
|
|
|
39692
39816
|
}
|
|
39693
39817
|
return id;
|
|
39694
39818
|
}
|
|
39819
|
+
static get2DInfo(context) {
|
|
39820
|
+
const { xDataIndex, yDataIndex, valuePath } = context.cell?.subRenderer || {};
|
|
39821
|
+
return { xDataIndex, yDataIndex, valuePath2D: valuePath };
|
|
39822
|
+
}
|
|
39695
39823
|
static getValue(ctx, valuePath) {
|
|
39696
39824
|
const { context } = ctx;
|
|
39697
39825
|
const dm = context.doc.dataManager;
|
|
@@ -39785,7 +39913,8 @@ let BaseHandler$1 = class BaseHandler {
|
|
|
39785
39913
|
modelRef: {
|
|
39786
39914
|
id: this.getId(context, wr),
|
|
39787
39915
|
start: charIndex,
|
|
39788
|
-
end: charIndex
|
|
39916
|
+
end: charIndex,
|
|
39917
|
+
...this.get2DInfo(context)
|
|
39789
39918
|
},
|
|
39790
39919
|
widgetMeta: wr.widgetMeta,
|
|
39791
39920
|
valuePath: context.getValuePath(wr.valuePath)
|
|
@@ -39829,7 +39958,8 @@ let BaseHandler$1 = class BaseHandler {
|
|
|
39829
39958
|
modelRef: {
|
|
39830
39959
|
id: this.getId(context, wr),
|
|
39831
39960
|
start: charIndex,
|
|
39832
|
-
end: charIndex
|
|
39961
|
+
end: charIndex,
|
|
39962
|
+
...this.get2DInfo(context)
|
|
39833
39963
|
},
|
|
39834
39964
|
widgetMeta: wr.widgetMeta,
|
|
39835
39965
|
valuePath: context.getValuePath(wr.valuePath),
|
|
@@ -39865,7 +39995,8 @@ let BaseHandler$1 = class BaseHandler {
|
|
|
39865
39995
|
modelRef: {
|
|
39866
39996
|
id: this.getId(context, wr),
|
|
39867
39997
|
start: 0,
|
|
39868
|
-
end: 0
|
|
39998
|
+
end: 0,
|
|
39999
|
+
...this.get2DInfo(context)
|
|
39869
40000
|
},
|
|
39870
40001
|
widgetMeta: wr.widgetMeta,
|
|
39871
40002
|
valuePath: context.getValuePath(wr.valuePath),
|
|
@@ -39902,7 +40033,8 @@ let BaseHandler$1 = class BaseHandler {
|
|
|
39902
40033
|
modelRef: {
|
|
39903
40034
|
id: this.getId(context, wr),
|
|
39904
40035
|
start: charIndex,
|
|
39905
|
-
end: charIndex
|
|
40036
|
+
end: charIndex,
|
|
40037
|
+
...this.get2DInfo(context)
|
|
39906
40038
|
},
|
|
39907
40039
|
widgetMeta: wr.widgetMeta,
|
|
39908
40040
|
valuePath: context.getValuePath(wr.valuePath),
|
|
@@ -39933,7 +40065,8 @@ let BaseHandler$1 = class BaseHandler {
|
|
|
39933
40065
|
modelRef: {
|
|
39934
40066
|
id: this.getId(context, wr),
|
|
39935
40067
|
start: 0,
|
|
39936
|
-
end: 0
|
|
40068
|
+
end: 0,
|
|
40069
|
+
...this.get2DInfo(context)
|
|
39937
40070
|
},
|
|
39938
40071
|
widgetMeta: wr.widgetMeta,
|
|
39939
40072
|
valuePath: context.getValuePath(wr.valuePath),
|
|
@@ -39979,7 +40112,8 @@ let BaseHandler$1 = class BaseHandler {
|
|
|
39979
40112
|
modelRef: {
|
|
39980
40113
|
id: this.getId(context, wr),
|
|
39981
40114
|
start: 0,
|
|
39982
|
-
end: 0
|
|
40115
|
+
end: 0,
|
|
40116
|
+
...this.get2DInfo(context)
|
|
39983
40117
|
},
|
|
39984
40118
|
widgetMeta: wr.widgetMeta,
|
|
39985
40119
|
valuePath: context.getValuePath(wr.valuePath),
|
|
@@ -40130,7 +40264,8 @@ let ImageHandler$1 = class ImageHandler2 extends BaseHandler$1 {
|
|
|
40130
40264
|
modelRef: {
|
|
40131
40265
|
id: this.getId(context, wr),
|
|
40132
40266
|
start: index2,
|
|
40133
|
-
end: index2
|
|
40267
|
+
end: index2,
|
|
40268
|
+
...this.get2DInfo(context)
|
|
40134
40269
|
},
|
|
40135
40270
|
widgetMeta: wr.widgetMeta,
|
|
40136
40271
|
valuePath: context.getValuePath(wr.valuePath)
|
|
@@ -40376,7 +40511,8 @@ class SignatureHandler extends BaseHandler$1 {
|
|
|
40376
40511
|
modelRef: {
|
|
40377
40512
|
id: this.getId(context, wr),
|
|
40378
40513
|
start: index2,
|
|
40379
|
-
end: index2
|
|
40514
|
+
end: index2,
|
|
40515
|
+
...this.get2DInfo(context)
|
|
40380
40516
|
},
|
|
40381
40517
|
widgetMeta: wr.widgetMeta,
|
|
40382
40518
|
valuePath: context.getValuePath(wr.valuePath)
|
|
@@ -40435,7 +40571,8 @@ class InputHandler extends BaseHandler$1 {
|
|
|
40435
40571
|
modelRef: {
|
|
40436
40572
|
id: this.getId(context, wr),
|
|
40437
40573
|
start: charIndex,
|
|
40438
|
-
end: charIndex
|
|
40574
|
+
end: charIndex,
|
|
40575
|
+
...this.get2DInfo(context)
|
|
40439
40576
|
},
|
|
40440
40577
|
widgetMeta: wr.widgetMeta,
|
|
40441
40578
|
valuePath: context.getValuePath(wr.valuePath),
|
|
@@ -40568,17 +40705,37 @@ class BaseHandler2 {
|
|
|
40568
40705
|
*/
|
|
40569
40706
|
getDataIndex(init2 = null) {
|
|
40570
40707
|
const { context } = this;
|
|
40571
|
-
|
|
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;
|
|
40572
40721
|
}
|
|
40573
40722
|
getId() {
|
|
40574
40723
|
const { wr } = this;
|
|
40575
40724
|
let id = wr.id;
|
|
40576
40725
|
const dataIndex = this.getDataIndex();
|
|
40726
|
+
const pageIndex = this.getPaperIndex();
|
|
40577
40727
|
if (typeof dataIndex === "number") {
|
|
40578
40728
|
id = `${wr.id}@${dataIndex}`;
|
|
40729
|
+
} else if (typeof pageIndex === "number") {
|
|
40730
|
+
id = `${wr.id}$p${pageIndex}`;
|
|
40579
40731
|
}
|
|
40580
40732
|
return id;
|
|
40581
40733
|
}
|
|
40734
|
+
get2DInfo() {
|
|
40735
|
+
const { context } = this;
|
|
40736
|
+
const { xDataIndex, yDataIndex } = context.cell?.subRenderer || {};
|
|
40737
|
+
return { xDataIndex, yDataIndex };
|
|
40738
|
+
}
|
|
40582
40739
|
getLayoutStyle() {
|
|
40583
40740
|
const { wr, context } = this;
|
|
40584
40741
|
const textStyle = TextStyleResolver.resolve(wr.rPr, context.doc.model?.styles);
|
|
@@ -40609,7 +40766,8 @@ class SerialNumberHandler extends BaseHandler2 {
|
|
|
40609
40766
|
modelRef: {
|
|
40610
40767
|
id: this.getId(),
|
|
40611
40768
|
start: charIndex,
|
|
40612
|
-
end: charIndex
|
|
40769
|
+
end: charIndex,
|
|
40770
|
+
...this.get2DInfo()
|
|
40613
40771
|
},
|
|
40614
40772
|
pageWidgetMeta: wr.pageWidgetMeta,
|
|
40615
40773
|
charMetrics: [
|
|
@@ -40647,7 +40805,8 @@ class DefaultHandler extends BaseHandler2 {
|
|
|
40647
40805
|
modelRef: {
|
|
40648
40806
|
id: this.getId(),
|
|
40649
40807
|
start: charIndex,
|
|
40650
|
-
end: charIndex
|
|
40808
|
+
end: charIndex,
|
|
40809
|
+
...this.get2DInfo()
|
|
40651
40810
|
},
|
|
40652
40811
|
pageWidgetMeta: wr.pageWidgetMeta,
|
|
40653
40812
|
charMetrics: [
|
|
@@ -40678,7 +40837,7 @@ class QrCodeHandler extends BaseHandler2 {
|
|
|
40678
40837
|
y: 0,
|
|
40679
40838
|
src: "",
|
|
40680
40839
|
modelRef: {
|
|
40681
|
-
id:
|
|
40840
|
+
id: this.getId(),
|
|
40682
40841
|
start: 0,
|
|
40683
40842
|
end: 0
|
|
40684
40843
|
},
|
|
@@ -40736,7 +40895,7 @@ class BarcodeHandler extends BaseHandler2 {
|
|
|
40736
40895
|
y: 0,
|
|
40737
40896
|
src: "",
|
|
40738
40897
|
modelRef: {
|
|
40739
|
-
id:
|
|
40898
|
+
id: this.getId(),
|
|
40740
40899
|
start: 0,
|
|
40741
40900
|
end: 0
|
|
40742
40901
|
},
|
|
@@ -40762,7 +40921,7 @@ class ImageHandler3 extends BaseHandler2 {
|
|
|
40762
40921
|
y: 0,
|
|
40763
40922
|
src: "",
|
|
40764
40923
|
modelRef: {
|
|
40765
|
-
id:
|
|
40924
|
+
id: this.getId(),
|
|
40766
40925
|
start: 0,
|
|
40767
40926
|
end: 0
|
|
40768
40927
|
},
|
|
@@ -40835,7 +40994,8 @@ class PaginationHandler extends BaseHandler2 {
|
|
|
40835
40994
|
modelRef: {
|
|
40836
40995
|
id: this.getId(),
|
|
40837
40996
|
start: charIndex,
|
|
40838
|
-
end: charIndex
|
|
40997
|
+
end: charIndex,
|
|
40998
|
+
...this.get2DInfo()
|
|
40839
40999
|
},
|
|
40840
41000
|
pageWidgetMeta: wr.pageWidgetMeta,
|
|
40841
41001
|
charMetrics: [
|
|
@@ -41412,7 +41572,8 @@ class TableSplitter {
|
|
|
41412
41572
|
doc: cell.doc,
|
|
41413
41573
|
x: cell.x,
|
|
41414
41574
|
modelRef: cell.modelRef,
|
|
41415
|
-
subRenderer: cell.subRenderer
|
|
41575
|
+
subRenderer: cell.subRenderer,
|
|
41576
|
+
backgroundColor: cell.backgroundColor
|
|
41416
41577
|
};
|
|
41417
41578
|
}
|
|
41418
41579
|
}
|
|
@@ -41633,7 +41794,9 @@ class TableExpander {
|
|
|
41633
41794
|
}
|
|
41634
41795
|
} else if (this.rowIndex2DTableMapper.has(r)) {
|
|
41635
41796
|
const region = this.rowIndex2DTableMapper.get(r);
|
|
41636
|
-
|
|
41797
|
+
if (r === region.start.row) {
|
|
41798
|
+
this.initialize2DTableRowsInRange(r, region);
|
|
41799
|
+
}
|
|
41637
41800
|
} else if (this.rowIndexBoundedMapper.has(r)) {
|
|
41638
41801
|
const region = this.rowIndexBoundedMapper.get(r);
|
|
41639
41802
|
this.initializeBoundedRowInRange(r, wtr, region);
|
|
@@ -41648,17 +41811,17 @@ class TableExpander {
|
|
|
41648
41811
|
}
|
|
41649
41812
|
}
|
|
41650
41813
|
}
|
|
41651
|
-
|
|
41814
|
+
getRepeatCount(region) {
|
|
41652
41815
|
if (this.doc.mode === DocModeTypeConst.Edit) {
|
|
41653
41816
|
return 1;
|
|
41654
41817
|
}
|
|
41655
41818
|
return this.data.get(region.valuePath)?.length || 1;
|
|
41656
41819
|
}
|
|
41657
41820
|
initializeRepeatingRowsInRange(region) {
|
|
41658
|
-
const
|
|
41821
|
+
const repeatCount = this.getRepeatCount(region);
|
|
41659
41822
|
const repeatRows = this.table.children.slice(region.start.row, region.end.row + 1);
|
|
41660
41823
|
const repeatRowsCount = repeatRows.length;
|
|
41661
|
-
repeat(
|
|
41824
|
+
repeat(repeatCount, (dataIndex) => {
|
|
41662
41825
|
repeatRows.forEach((_wtr, _wtrIndex) => {
|
|
41663
41826
|
const row = {
|
|
41664
41827
|
id: `${_wtr.id}@${dataIndex}`,
|
|
@@ -41669,14 +41832,14 @@ class TableExpander {
|
|
|
41669
41832
|
const cell2 = {
|
|
41670
41833
|
id: `${wtc.id}@${dataIndex}`,
|
|
41671
41834
|
expandFromId: wtc.id,
|
|
41672
|
-
rowspan: (wtc.rowspan ?? 1) + repeatRowsCount * (
|
|
41835
|
+
rowspan: (wtc.rowspan ?? 1) + repeatRowsCount * (repeatCount - 1),
|
|
41673
41836
|
colspan: wtc.colspan ?? 1
|
|
41674
41837
|
};
|
|
41675
41838
|
this.instanceMapper.set(cell2.id, cell2);
|
|
41676
41839
|
return cell2;
|
|
41677
41840
|
} else {
|
|
41678
41841
|
const instanceCell = this.instanceMapper.get(`${wtc.mergeFromId}@0`) ?? this.instanceMapper.get(wtc.mergeFromId);
|
|
41679
|
-
instanceCell.rowspan = (instanceCell.rowspan ?? 1) + repeatRowsCount * (
|
|
41842
|
+
instanceCell.rowspan = (instanceCell.rowspan ?? 1) + repeatRowsCount * (repeatCount - 1);
|
|
41680
41843
|
}
|
|
41681
41844
|
}
|
|
41682
41845
|
const cell = {
|
|
@@ -41698,31 +41861,53 @@ class TableExpander {
|
|
|
41698
41861
|
});
|
|
41699
41862
|
});
|
|
41700
41863
|
}
|
|
41701
|
-
initialize2DTableRowsInRange(r,
|
|
41702
|
-
const
|
|
41703
|
-
|
|
41704
|
-
|
|
41705
|
-
|
|
41706
|
-
|
|
41707
|
-
const
|
|
41708
|
-
id:
|
|
41709
|
-
expandFromId:
|
|
41710
|
-
|
|
41711
|
-
|
|
41712
|
-
|
|
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
|
+
})
|
|
41713
41906
|
};
|
|
41714
|
-
|
|
41715
|
-
|
|
41716
|
-
|
|
41717
|
-
|
|
41718
|
-
cell.dataIndex = dataIndexMeta.dataIndex;
|
|
41719
|
-
}
|
|
41720
|
-
this.instanceMapper.set(cell.id, cell);
|
|
41721
|
-
return cell;
|
|
41722
|
-
})
|
|
41723
|
-
};
|
|
41724
|
-
this.instanceMapper.set(row.id, row);
|
|
41725
|
-
this.rows.push(row);
|
|
41907
|
+
this.instanceMapper.set(row.id, row);
|
|
41908
|
+
this.rows.push(row);
|
|
41909
|
+
});
|
|
41910
|
+
});
|
|
41726
41911
|
}
|
|
41727
41912
|
initializeBoundedRowInRange(r, wtr, region) {
|
|
41728
41913
|
const row = {
|
|
@@ -41924,7 +42109,10 @@ class TableInfoProvider {
|
|
|
41924
42109
|
return {
|
|
41925
42110
|
id: cell._2DTableId,
|
|
41926
42111
|
type: "2d-table",
|
|
42112
|
+
// 二维表使用 cell 的扩展字段
|
|
41927
42113
|
dataIndex: cell.dataIndex,
|
|
42114
|
+
xDataIndex: cell.xDataIndex,
|
|
42115
|
+
yDataIndex: cell.yDataIndex,
|
|
41928
42116
|
valuePath: region?.valuePath,
|
|
41929
42117
|
widgetMeta: region?.widgetMeta
|
|
41930
42118
|
};
|
|
@@ -42294,7 +42482,7 @@ class LayoutManager {
|
|
|
42294
42482
|
/**
|
|
42295
42483
|
* 布局单元格内容
|
|
42296
42484
|
*/
|
|
42297
|
-
layoutCellContent(cellContent, tableCell
|
|
42485
|
+
layoutCellContent(cellContent, tableCell) {
|
|
42298
42486
|
const cellContext = new LayoutContext({
|
|
42299
42487
|
type: "cell",
|
|
42300
42488
|
doc: this.doc,
|
|
@@ -43634,9 +43822,30 @@ class InteractionController {
|
|
|
43634
43822
|
onChangeDragHoverId(hitId) {
|
|
43635
43823
|
this.doc.interactionManager.set("dragHoverId", hitId);
|
|
43636
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
|
+
}
|
|
43637
43843
|
resolveIntent(id, hitId) {
|
|
43638
43844
|
const meta = this.doc.layoutMapper.getBaseMetaNodeById(id);
|
|
43639
43845
|
const isFillMode = this.doc.isInFillMode();
|
|
43846
|
+
if (this.doc.isInEditMode()) {
|
|
43847
|
+
this.syncActiveTableByMeta(meta);
|
|
43848
|
+
}
|
|
43640
43849
|
if (meta) {
|
|
43641
43850
|
if (isClickSelectAllNode(meta)) {
|
|
43642
43851
|
const widgetMeta = meta.raw.widgetMeta;
|
|
@@ -43740,8 +43949,9 @@ class InteractionController {
|
|
|
43740
43949
|
if (this.doc.isInEditMode() && panelData && panelData.panelType === "panel:widget") {
|
|
43741
43950
|
const node = this.doc.layoutMapper.getModelNodeById(panelData.modelId);
|
|
43742
43951
|
const sel = node?.getSection();
|
|
43952
|
+
const isHeaderFooterEdit = this.doc.interactionManager.get("isHeaderFooterEdit");
|
|
43743
43953
|
this.onActivePanelData({
|
|
43744
|
-
type: "panel:paper",
|
|
43954
|
+
type: isHeaderFooterEdit ? "panel:paper-header-footer" : "panel:paper",
|
|
43745
43955
|
extra: {
|
|
43746
43956
|
secRefId: sel?.id
|
|
43747
43957
|
}
|
|
@@ -43778,28 +43988,52 @@ class InteractionController {
|
|
|
43778
43988
|
destroy() {
|
|
43779
43989
|
}
|
|
43780
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
|
+
}
|
|
43781
44002
|
function resolveWidgetState(ctx) {
|
|
43782
|
-
const required4 = ctx.
|
|
44003
|
+
const required4 = ctx.doc.isInEditMode() ? !!ctx.required : !!ctx.newRequired;
|
|
43783
44004
|
let readonly2 = false;
|
|
43784
|
-
if (ctx.
|
|
44005
|
+
if (ctx.doc.isInEditMode()) {
|
|
43785
44006
|
readonly2 = false;
|
|
43786
|
-
} else if (ctx.
|
|
44007
|
+
} else if (ctx.doc.isInPrintMode()) {
|
|
43787
44008
|
readonly2 = true;
|
|
43788
44009
|
} else if (ctx.newReadonly !== void 0) {
|
|
43789
44010
|
readonly2 = !!ctx.newReadonly;
|
|
43790
44011
|
}
|
|
43791
|
-
const disabled = ctx.
|
|
44012
|
+
const disabled = ctx.doc.isInEditMode() ? !!ctx.disabled : !!ctx.newDisabled;
|
|
43792
44013
|
const readonlyString = ctx.viewState === ViewStateTypeConst.Disabled || ctx.viewState === ViewStateTypeConst.Auto ? "readonly-component" : "readonly-text";
|
|
43793
44014
|
const editString = readonly2 ? "readonly-component" : "edit-component";
|
|
43794
44015
|
let displayStatus;
|
|
44016
|
+
const fromAuth = resolveDisplayStatusFromAuth({
|
|
44017
|
+
info: ctx.doc.docRuntimeMeta.handleInfo.bpmnFieldAuthMap?.[`${ctx.modelLink}.${ctx.fieldLink}`],
|
|
44018
|
+
readonlyString,
|
|
44019
|
+
editString
|
|
44020
|
+
});
|
|
43795
44021
|
if (ctx.isLinkedModelField || ctx.cannotInput) {
|
|
43796
44022
|
displayStatus = readonlyString;
|
|
43797
|
-
} else if (ctx.
|
|
43798
|
-
displayStatus = editString;
|
|
43799
|
-
} else if (ctx.docMode === DocModeTypeConst.Print) {
|
|
44023
|
+
} else if (ctx.doc.mode === DocModeTypeConst.Print) {
|
|
43800
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
|
+
}
|
|
43801
44035
|
} else {
|
|
43802
|
-
displayStatus =
|
|
44036
|
+
displayStatus = editString;
|
|
43803
44037
|
}
|
|
43804
44038
|
const finalDisabled = displayStatus === "edit-component" ? disabled : ctx.viewState === ViewStateTypeConst.Disabled || disabled;
|
|
43805
44039
|
return {
|
|
@@ -43819,21 +44053,21 @@ class InteractionPolicy {
|
|
|
43819
44053
|
if (this.doc.isInPrintMode()) return false;
|
|
43820
44054
|
if (this.doc.preview) return false;
|
|
43821
44055
|
if (validateTextWidgetMarker(run, true)) {
|
|
43822
|
-
const
|
|
44056
|
+
const widgetMeta = run.widgetMeta;
|
|
44057
|
+
const type4 = widgetMeta.type;
|
|
43823
44058
|
const isInput = ["fw:input", "fw:number", "fw:double"].includes(type4);
|
|
43824
44059
|
if (this.doc.isInEditMode()) return false;
|
|
43825
|
-
const widgetMeta = run.widgetMeta;
|
|
43826
44060
|
const state = resolveWidgetState({
|
|
43827
|
-
|
|
43828
|
-
isEditMode: this.doc.isInEditMode(),
|
|
43829
|
-
isPrintMode: this.doc.isInPrintMode(),
|
|
44061
|
+
doc: this.doc,
|
|
43830
44062
|
viewState: widgetMeta.props.viewState,
|
|
43831
44063
|
disabled: widgetMeta.props.disabled,
|
|
43832
44064
|
newDisabled: widgetMeta.props.newSpecificConfig?.newDisabled,
|
|
43833
44065
|
readonly: widgetMeta.props.readonly,
|
|
43834
44066
|
newReadonly: widgetMeta.props.newSpecificConfig?.newReadonly,
|
|
43835
44067
|
cannotInput: widgetMeta.props.cannotInput,
|
|
43836
|
-
isLinkedModelField: widgetMeta.field?.isLinkedModelField
|
|
44068
|
+
isLinkedModelField: widgetMeta.field?.isLinkedModelField,
|
|
44069
|
+
fieldLink: widgetMeta.field?.fieldLink || "",
|
|
44070
|
+
modelLink: widgetMeta.field?.modelLink || ""
|
|
43837
44071
|
});
|
|
43838
44072
|
const isReadonly = state.displayStatus === "readonly-component" || state.displayStatus === "readonly-text";
|
|
43839
44073
|
if (state.disabled || isReadonly) {
|
|
@@ -43850,20 +44084,20 @@ class InteractionPolicy {
|
|
|
43850
44084
|
if (this.doc.preview) return false;
|
|
43851
44085
|
if (validateTextWidgetMarker(run, true)) {
|
|
43852
44086
|
if (this.doc.isInEditMode()) return true;
|
|
43853
|
-
const type4 = run.widgetMeta.type;
|
|
43854
|
-
const isInput = ["fw:input", "fw:number", "fw:double"].includes(type4);
|
|
43855
44087
|
const widgetMeta = run.widgetMeta;
|
|
44088
|
+
const type4 = widgetMeta.type;
|
|
44089
|
+
const isInput = ["fw:input", "fw:number", "fw:double"].includes(type4);
|
|
43856
44090
|
const state = resolveWidgetState({
|
|
43857
|
-
|
|
43858
|
-
isEditMode: this.doc.isInEditMode(),
|
|
43859
|
-
isPrintMode: this.doc.isInPrintMode(),
|
|
44091
|
+
doc: this.doc,
|
|
43860
44092
|
viewState: widgetMeta.props.viewState,
|
|
43861
44093
|
disabled: widgetMeta.props.disabled,
|
|
43862
44094
|
newDisabled: widgetMeta.props.newSpecificConfig?.newDisabled,
|
|
43863
44095
|
readonly: widgetMeta.props.readonly,
|
|
43864
44096
|
newReadonly: widgetMeta.props.newSpecificConfig?.newReadonly,
|
|
43865
44097
|
cannotInput: widgetMeta.props.cannotInput,
|
|
43866
|
-
isLinkedModelField: widgetMeta.field?.isLinkedModelField
|
|
44098
|
+
isLinkedModelField: widgetMeta.field?.isLinkedModelField,
|
|
44099
|
+
fieldLink: widgetMeta.field?.fieldLink || "",
|
|
44100
|
+
modelLink: widgetMeta.field?.modelLink || ""
|
|
43867
44101
|
});
|
|
43868
44102
|
const isReadonly = state.displayStatus === "readonly-component" || state.displayStatus === "readonly-text";
|
|
43869
44103
|
if (state.disabled || isReadonly) {
|
|
@@ -44557,6 +44791,25 @@ class DataManager {
|
|
|
44557
44791
|
getLabel(path2) {
|
|
44558
44792
|
return this.get(this.getLabelPath(path2)) || this.get(path2);
|
|
44559
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
|
+
}
|
|
44560
44813
|
/**
|
|
44561
44814
|
* 根据 jsonpath 设置数据
|
|
44562
44815
|
* @param path jsonpath 路径
|
|
@@ -44942,6 +45195,7 @@ class DataManager {
|
|
|
44942
45195
|
* 调度 emit 事件,自动合并相同 path 的事件
|
|
44943
45196
|
*/
|
|
44944
45197
|
emit(path2, newValue, oldValue, source = "user") {
|
|
45198
|
+
console.log("emitemit", { path: path2, newValue, oldValue, source });
|
|
44945
45199
|
this.emitQueue.set(path2, { newValue, oldValue });
|
|
44946
45200
|
if (this.emitScheduled) return;
|
|
44947
45201
|
this.emitScheduled = true;
|
|
@@ -45165,6 +45419,7 @@ class InteractionManager {
|
|
|
45165
45419
|
const wsecPr = bodyContent.find((item) => item.name === "w:secPr");
|
|
45166
45420
|
this.state = {
|
|
45167
45421
|
tableSelection: null,
|
|
45422
|
+
activeTableId: "",
|
|
45168
45423
|
dragHoverId: "",
|
|
45169
45424
|
hoverModelId: "",
|
|
45170
45425
|
focusModelId: "",
|
|
@@ -45441,9 +45696,6 @@ class Doc {
|
|
|
45441
45696
|
return instances;
|
|
45442
45697
|
}
|
|
45443
45698
|
}
|
|
45444
|
-
function newDoc(options) {
|
|
45445
|
-
return new Doc(options);
|
|
45446
|
-
}
|
|
45447
45699
|
const DESIGN_SUITE_CONTEXT_KEY = Symbol.for("SuiteDesignContext");
|
|
45448
45700
|
const DOC_PUBLIC_API_KEY = Symbol.for("DocPublicApi");
|
|
45449
45701
|
const DOC_INFO_KEY = Symbol.for("DocInfo");
|
|
@@ -45505,162 +45757,6 @@ function useDocPubApiContext() {
|
|
|
45505
45757
|
withLayoutComputed
|
|
45506
45758
|
};
|
|
45507
45759
|
}
|
|
45508
|
-
function convertPxToPaperSize(pageSize, customSize) {
|
|
45509
|
-
if (pageSize === PageSizeEnumConst.A3) {
|
|
45510
|
-
return {
|
|
45511
|
-
size: "a3",
|
|
45512
|
-
width: "297mm",
|
|
45513
|
-
height: "420mm"
|
|
45514
|
-
};
|
|
45515
|
-
}
|
|
45516
|
-
if (pageSize === PageSizeEnumConst.A4) {
|
|
45517
|
-
return {
|
|
45518
|
-
size: "a4",
|
|
45519
|
-
width: "210mm",
|
|
45520
|
-
height: "297mm"
|
|
45521
|
-
};
|
|
45522
|
-
}
|
|
45523
|
-
if (pageSize === PageSizeEnumConst.A5) {
|
|
45524
|
-
return {
|
|
45525
|
-
size: "a5",
|
|
45526
|
-
width: "148mm",
|
|
45527
|
-
height: "210mm"
|
|
45528
|
-
};
|
|
45529
|
-
}
|
|
45530
|
-
return {
|
|
45531
|
-
size: "",
|
|
45532
|
-
width: `${customSize[0]}mm`,
|
|
45533
|
-
height: `${customSize[1]}mm`
|
|
45534
|
-
};
|
|
45535
|
-
}
|
|
45536
|
-
function usePrint() {
|
|
45537
|
-
const getPageSize = (item, paperSize) => {
|
|
45538
|
-
const isLandscape = item.width > item.height;
|
|
45539
|
-
const width = parseInt(isLandscape ? paperSize.height : paperSize.width);
|
|
45540
|
-
const height = parseInt(isLandscape ? paperSize.width : paperSize.height);
|
|
45541
|
-
return { isLandscape, width, height };
|
|
45542
|
-
};
|
|
45543
|
-
const waitImageLoad = (img) => {
|
|
45544
|
-
return new Promise((resolve) => {
|
|
45545
|
-
if (img.complete) return resolve();
|
|
45546
|
-
img.onload = () => resolve();
|
|
45547
|
-
img.onerror = () => resolve();
|
|
45548
|
-
});
|
|
45549
|
-
};
|
|
45550
|
-
const printView = async (paperList, options) => {
|
|
45551
|
-
const { pageSize, customSize, direction } = options;
|
|
45552
|
-
const iframe = document.createElement("iframe");
|
|
45553
|
-
iframe.style.cssText = `
|
|
45554
|
-
visibility:hidden;
|
|
45555
|
-
position:absolute;
|
|
45556
|
-
left: 0;
|
|
45557
|
-
top:0;
|
|
45558
|
-
width:0;
|
|
45559
|
-
height:0;
|
|
45560
|
-
border:none;
|
|
45561
|
-
`;
|
|
45562
|
-
document.body.appendChild(iframe);
|
|
45563
|
-
const doc = iframe.contentWindow.document;
|
|
45564
|
-
doc.open();
|
|
45565
|
-
const container2 = document.createElement("div");
|
|
45566
|
-
const paperSize = convertPxToPaperSize(pageSize, customSize);
|
|
45567
|
-
const isGlobalLandscape = direction === OrientationTypeConst.Landscape;
|
|
45568
|
-
const imgTasks = [];
|
|
45569
|
-
paperList.forEach((item) => {
|
|
45570
|
-
const pageWrapper = document.createElement("div");
|
|
45571
|
-
pageWrapper.style.cssText = `
|
|
45572
|
-
position:relative;
|
|
45573
|
-
width:${paperSize.width};
|
|
45574
|
-
height:${paperSize.height};
|
|
45575
|
-
`;
|
|
45576
|
-
const isPageLandscape = item.width > item.height;
|
|
45577
|
-
const needRotate = isGlobalLandscape && !isPageLandscape || !isGlobalLandscape && isPageLandscape;
|
|
45578
|
-
const img = document.createElement("img");
|
|
45579
|
-
img.src = item.base64;
|
|
45580
|
-
if (needRotate) {
|
|
45581
|
-
img.style.cssText = `
|
|
45582
|
-
position:absolute;
|
|
45583
|
-
left:50%;
|
|
45584
|
-
top:50%;
|
|
45585
|
-
width:${isGlobalLandscape ? paperSize.width : paperSize.height};
|
|
45586
|
-
height:${isGlobalLandscape ? paperSize.height : paperSize.width};
|
|
45587
|
-
transform:translate(-50%, -50%) rotate(90deg);
|
|
45588
|
-
`;
|
|
45589
|
-
} else {
|
|
45590
|
-
img.style.cssText = `
|
|
45591
|
-
position:absolute;
|
|
45592
|
-
left: 0;
|
|
45593
|
-
top:0;
|
|
45594
|
-
width:100%;
|
|
45595
|
-
height:100%;
|
|
45596
|
-
`;
|
|
45597
|
-
}
|
|
45598
|
-
imgTasks.push(waitImageLoad(img));
|
|
45599
|
-
pageWrapper.appendChild(img);
|
|
45600
|
-
container2.appendChild(pageWrapper);
|
|
45601
|
-
});
|
|
45602
|
-
const style = document.createElement("style");
|
|
45603
|
-
style.innerHTML = `
|
|
45604
|
-
* { margin:0; padding:0; }
|
|
45605
|
-
@page {
|
|
45606
|
-
margin:0;
|
|
45607
|
-
size:${paperSize.size} ${isGlobalLandscape ? "landscape" : "portrait"};
|
|
45608
|
-
}
|
|
45609
|
-
`;
|
|
45610
|
-
doc.write(style.outerHTML + container2.innerHTML);
|
|
45611
|
-
await Promise.all(imgTasks);
|
|
45612
|
-
setTimeout(async () => {
|
|
45613
|
-
iframe.contentWindow.print();
|
|
45614
|
-
doc.close();
|
|
45615
|
-
window.addEventListener(
|
|
45616
|
-
"mouseover",
|
|
45617
|
-
() => {
|
|
45618
|
-
iframe?.remove();
|
|
45619
|
-
},
|
|
45620
|
-
{
|
|
45621
|
-
once: true
|
|
45622
|
-
}
|
|
45623
|
-
);
|
|
45624
|
-
});
|
|
45625
|
-
};
|
|
45626
|
-
const exportWordPDF = (paperList, options) => {
|
|
45627
|
-
const { pageSize, customSize, fileName = "document.pdf" } = options;
|
|
45628
|
-
const paperSize = convertPxToPaperSize(pageSize, customSize);
|
|
45629
|
-
let pdf = null;
|
|
45630
|
-
paperList.forEach((item, index2) => {
|
|
45631
|
-
const { isLandscape, width, height } = getPageSize(item, paperSize);
|
|
45632
|
-
if (!pdf) {
|
|
45633
|
-
pdf = new jsPDF({
|
|
45634
|
-
orientation: isLandscape ? "landscape" : "portrait",
|
|
45635
|
-
unit: "mm",
|
|
45636
|
-
format: [width, height]
|
|
45637
|
-
});
|
|
45638
|
-
} else {
|
|
45639
|
-
pdf.addPage([width, height], isLandscape ? "landscape" : "portrait");
|
|
45640
|
-
}
|
|
45641
|
-
pdf.addImage(item.base64, "PNG", 0, 0, width, height);
|
|
45642
|
-
});
|
|
45643
|
-
pdf.save(fileName);
|
|
45644
|
-
};
|
|
45645
|
-
const getPdfBuffer = (paperList, options) => {
|
|
45646
|
-
const { pageSize, customSize } = options;
|
|
45647
|
-
const paperSize = convertPxToPaperSize(pageSize, customSize);
|
|
45648
|
-
const pdf = new jsPDF({ unit: "mm" });
|
|
45649
|
-
paperList.forEach((item, index2) => {
|
|
45650
|
-
const { isLandscape, width, height } = getPageSize(item, paperSize);
|
|
45651
|
-
if (index2 !== 0) {
|
|
45652
|
-
pdf.addPage([width, height], isLandscape ? "landscape" : "portrait");
|
|
45653
|
-
}
|
|
45654
|
-
pdf.addImage(item.base64, "PNG", 0, 0, width, height);
|
|
45655
|
-
});
|
|
45656
|
-
return pdf.output("arraybuffer");
|
|
45657
|
-
};
|
|
45658
|
-
return {
|
|
45659
|
-
printView,
|
|
45660
|
-
exportWordPDF,
|
|
45661
|
-
getPdfBuffer
|
|
45662
|
-
};
|
|
45663
|
-
}
|
|
45664
45760
|
function useInteraction(docRef) {
|
|
45665
45761
|
const state = reactive({});
|
|
45666
45762
|
let unsubscribes = [];
|
|
@@ -45670,6 +45766,7 @@ function useInteraction(docRef) {
|
|
|
45670
45766
|
if (!doc?.eventManager?.eventBus?.on) return;
|
|
45671
45767
|
const interactionTypes = [
|
|
45672
45768
|
"tableSelection",
|
|
45769
|
+
"activeTableId",
|
|
45673
45770
|
"panelData",
|
|
45674
45771
|
"hoverModelId",
|
|
45675
45772
|
"focusModelId",
|
|
@@ -45763,20 +45860,26 @@ class WrunProperties {
|
|
|
45763
45860
|
}
|
|
45764
45861
|
break;
|
|
45765
45862
|
}
|
|
45766
|
-
case "w:b":
|
|
45767
|
-
|
|
45863
|
+
case "w:b": {
|
|
45864
|
+
const on2 = parseOnOffToggleFromElement(el);
|
|
45865
|
+
if (on2 !== void 0) props.b = on2;
|
|
45768
45866
|
break;
|
|
45769
|
-
|
|
45770
|
-
|
|
45867
|
+
}
|
|
45868
|
+
case "w:i": {
|
|
45869
|
+
const on2 = parseOnOffToggleFromElement(el);
|
|
45870
|
+
if (on2 !== void 0) props.i = on2;
|
|
45771
45871
|
break;
|
|
45872
|
+
}
|
|
45772
45873
|
case "w:u": {
|
|
45773
45874
|
const val = el["@attrs"]?.["w:val"];
|
|
45774
45875
|
props.u = val !== "none" ? val || true : false;
|
|
45775
45876
|
break;
|
|
45776
45877
|
}
|
|
45777
|
-
case "w:strike":
|
|
45778
|
-
|
|
45878
|
+
case "w:strike": {
|
|
45879
|
+
const on2 = parseOnOffToggleFromElement(el);
|
|
45880
|
+
if (on2 !== void 0) props.strike = on2;
|
|
45779
45881
|
break;
|
|
45882
|
+
}
|
|
45780
45883
|
case "w:kern": {
|
|
45781
45884
|
const val = el["@attrs"]?.["w:val"];
|
|
45782
45885
|
if (val) {
|
|
@@ -46399,8 +46502,10 @@ class Wstyles {
|
|
|
46399
46502
|
}
|
|
46400
46503
|
class Wimages {
|
|
46401
46504
|
images;
|
|
46505
|
+
scopedImages = /* @__PURE__ */ new Map();
|
|
46402
46506
|
constructor(images = []) {
|
|
46403
46507
|
this.images = images;
|
|
46508
|
+
this.rebuildBodyIndex();
|
|
46404
46509
|
}
|
|
46405
46510
|
/**
|
|
46406
46511
|
* 从 XML JSON 转换为 Wimages 实例
|
|
@@ -46414,13 +46519,32 @@ class Wimages {
|
|
|
46414
46519
|
const images = Array.isArray(json) ? json : [json];
|
|
46415
46520
|
return new Wimages(images);
|
|
46416
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
|
+
}
|
|
46417
46534
|
/**
|
|
46418
46535
|
* 根据图片 ID 获取图片信息
|
|
46419
46536
|
* @param imageId 图片的 Relationship ID
|
|
46420
46537
|
* @returns 对应的 DocImage 对象,如果不存在返回 undefined
|
|
46421
46538
|
*/
|
|
46422
46539
|
getImageById(imageId) {
|
|
46423
|
-
return this.
|
|
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);
|
|
46424
46548
|
}
|
|
46425
46549
|
/**
|
|
46426
46550
|
* 根据图片 ID 获取图片 URL
|
|
@@ -46430,6 +46554,9 @@ class Wimages {
|
|
|
46430
46554
|
getImageUrlById(imageId) {
|
|
46431
46555
|
return this.getImageById(imageId)?.url;
|
|
46432
46556
|
}
|
|
46557
|
+
getImageUrl(query) {
|
|
46558
|
+
return this.getImageByScopedId(query)?.url;
|
|
46559
|
+
}
|
|
46433
46560
|
/**
|
|
46434
46561
|
* 获取所有图片
|
|
46435
46562
|
* @returns 所有图片的数组
|
|
@@ -46443,6 +46570,14 @@ class Wimages {
|
|
|
46443
46570
|
*/
|
|
46444
46571
|
addImage(image) {
|
|
46445
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);
|
|
46446
46581
|
}
|
|
46447
46582
|
/**
|
|
46448
46583
|
* 移除指定 ID 的图片
|
|
@@ -46453,6 +46588,7 @@ class Wimages {
|
|
|
46453
46588
|
const index2 = this.images.findIndex((img) => img["@Relationship"].Id === imageId);
|
|
46454
46589
|
if (index2 > -1) {
|
|
46455
46590
|
this.images.splice(index2, 1);
|
|
46591
|
+
this.scopedImages.delete(this.makeScopedKey({ imageId, scope: "body" }));
|
|
46456
46592
|
return true;
|
|
46457
46593
|
}
|
|
46458
46594
|
return false;
|
|
@@ -46476,6 +46612,7 @@ class Wimages {
|
|
|
46476
46612
|
*/
|
|
46477
46613
|
clear() {
|
|
46478
46614
|
this.images = [];
|
|
46615
|
+
this.scopedImages.clear();
|
|
46479
46616
|
}
|
|
46480
46617
|
}
|
|
46481
46618
|
class Wsettings {
|
|
@@ -46667,6 +46804,7 @@ class Wheader extends ModelGroup {
|
|
|
46667
46804
|
name: this.name,
|
|
46668
46805
|
type: this.type,
|
|
46669
46806
|
"@Relationship": { ...this.raw?.["@Relationship"] },
|
|
46807
|
+
"@Relationships": this.raw?.["@Relationships"] ? this.raw["@Relationships"].map((item) => ({ ...item })) : void 0,
|
|
46670
46808
|
"@attrs": { ...this.attrs },
|
|
46671
46809
|
elements
|
|
46672
46810
|
};
|
|
@@ -46900,6 +47038,7 @@ class Wfooter extends ModelGroup {
|
|
|
46900
47038
|
name: this.name,
|
|
46901
47039
|
type: this.type,
|
|
46902
47040
|
"@Relationship": { ...this.raw?.["@Relationship"] },
|
|
47041
|
+
"@Relationships": this.raw?.["@Relationships"] ? this.raw["@Relationships"].map((item) => ({ ...item })) : void 0,
|
|
46903
47042
|
"@attrs": { ...this.attrs },
|
|
46904
47043
|
elements
|
|
46905
47044
|
};
|
|
@@ -47218,6 +47357,7 @@ class DocModel {
|
|
|
47218
47357
|
model.document.parent = model;
|
|
47219
47358
|
model.headers = Wheaders.fromXmlJsonArray(json.headers || [], model);
|
|
47220
47359
|
model.footers = Wfooters.fromXmlJsonArray(json.footers || [], model);
|
|
47360
|
+
model.collectScopedImagesFromHeaderFooter();
|
|
47221
47361
|
model.overlays = Woverlays.fromXmlJsonArray(json.overlays || [], model);
|
|
47222
47362
|
model.headers.ensureComplete();
|
|
47223
47363
|
model.footers.ensureComplete();
|
|
@@ -47328,6 +47468,42 @@ class DocModel {
|
|
|
47328
47468
|
this.document.body.children.forEach(walk);
|
|
47329
47469
|
return sections;
|
|
47330
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
|
+
}
|
|
47331
47507
|
}
|
|
47332
47508
|
class ModelConverter {
|
|
47333
47509
|
/**
|
|
@@ -48151,7 +48327,32 @@ const _sfc_main$2W = /* @__PURE__ */ defineComponent({
|
|
|
48151
48327
|
};
|
|
48152
48328
|
}
|
|
48153
48329
|
});
|
|
48154
|
-
const HiddenInput = /* @__PURE__ */ _export_sfc(_sfc_main$2W, [["__scopeId", "data-v-
|
|
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
|
+
}
|
|
48155
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" };
|
|
48156
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" }];
|
|
48157
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"}]');
|
|
@@ -48211,6 +48412,28 @@ class RuntimeJsonBuilder {
|
|
|
48211
48412
|
return this.json;
|
|
48212
48413
|
}
|
|
48213
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
|
+
}
|
|
48214
48437
|
class DocRequestStrategy {
|
|
48215
48438
|
props;
|
|
48216
48439
|
payload;
|
|
@@ -48222,6 +48445,8 @@ class DocRequestStrategy {
|
|
|
48222
48445
|
extractDocInfo(docInfo) {
|
|
48223
48446
|
let fillModeType = DocModeTypeConst.Print;
|
|
48224
48447
|
let btnModelType = DocModeTypeConst.Print;
|
|
48448
|
+
let bpmnFieldAuthMap = {};
|
|
48449
|
+
let bpmnType;
|
|
48225
48450
|
if (docInfo.formType === FormTypeConst.BASE || docInfo.formType === FormTypeConst.FILE) {
|
|
48226
48451
|
if (docInfo.instanceStatus) {
|
|
48227
48452
|
fillModeType = docInfo.instanceStatus === "UNFILLED" || docInfo.instanceStatus === "STASH" || docInfo.instanceStatus === "PARTIAL_SUBMIT" ? DocModeTypeConst.Fill : DocModeTypeConst.Print;
|
|
@@ -48230,12 +48455,33 @@ class DocRequestStrategy {
|
|
|
48230
48455
|
fillModeType = docInfo.dataStatus === "SUBMIT" ? DocModeTypeConst.Print : DocModeTypeConst.Fill;
|
|
48231
48456
|
btnModelType = fillModeType;
|
|
48232
48457
|
}
|
|
48458
|
+
bpmnFieldAuthMap = getBpmnFieldAuthMap(
|
|
48459
|
+
deduplicateFields(
|
|
48460
|
+
safeParseJson(docInfo.processFieldPermission, [], Array.isArray)
|
|
48461
|
+
)
|
|
48462
|
+
);
|
|
48233
48463
|
} else if (docInfo.formType === FormTypeConst.PROCESS) {
|
|
48234
48464
|
const { nodeDef = {} } = docInfo.ofProcessOperations ?? {};
|
|
48235
|
-
|
|
48465
|
+
bpmnType = docInfo.instanceStatus === "ABANDON" ? "bpmnEnd" : nodeDef.type ?? "bpmnEnd";
|
|
48236
48466
|
fillModeType = bpmnType === "bpmnEnd" ? DocModeTypeConst.Print : DocModeTypeConst.Fill;
|
|
48237
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
|
+
);
|
|
48238
48483
|
}
|
|
48484
|
+
console.log("bpmnFieldAuthMap", bpmnFieldAuthMap);
|
|
48239
48485
|
const _isDetailPage_ = typeof this.payload.isDetailPage === "function" ? this.payload.isDetailPage() : this.payload.isDetailPage;
|
|
48240
48486
|
if (_isDetailPage_) {
|
|
48241
48487
|
fillModeType = DocModeTypeConst.Print;
|
|
@@ -48248,7 +48494,7 @@ class DocRequestStrategy {
|
|
|
48248
48494
|
...JSON.parse(docInfo.params || "{}"),
|
|
48249
48495
|
...this.payload.paramExtraProps || {}
|
|
48250
48496
|
};
|
|
48251
|
-
return { fillModeType, btnModelType, paramsConfig };
|
|
48497
|
+
return { fillModeType, btnModelType, paramsConfig, bpmnType, bpmnFieldAuthMap };
|
|
48252
48498
|
}
|
|
48253
48499
|
}
|
|
48254
48500
|
class SingleInstanceStrategy extends DocRequestStrategy {
|
|
@@ -48258,7 +48504,7 @@ class SingleInstanceStrategy extends DocRequestStrategy {
|
|
|
48258
48504
|
...this.payload.paramExtraProps?._gct_nocode_doc_query_params_
|
|
48259
48505
|
});
|
|
48260
48506
|
if (isEmpty(res)) return null;
|
|
48261
|
-
const { fillModeType, btnModelType, paramsConfig } = this.extractDocInfo(res);
|
|
48507
|
+
const { fillModeType, btnModelType, paramsConfig, bpmnType, bpmnFieldAuthMap } = this.extractDocInfo(res);
|
|
48262
48508
|
const query = res.dataId ? {
|
|
48263
48509
|
id_: res.dataId,
|
|
48264
48510
|
_gct_dataStatus_: res.dataStatus,
|
|
@@ -48273,10 +48519,10 @@ class SingleInstanceStrategy extends DocRequestStrategy {
|
|
|
48273
48519
|
id,
|
|
48274
48520
|
tid: res.tmplId,
|
|
48275
48521
|
requestInfo: res,
|
|
48276
|
-
|
|
48522
|
+
bpmnType,
|
|
48277
48523
|
fillModeType,
|
|
48278
48524
|
btnModelType,
|
|
48279
|
-
|
|
48525
|
+
bpmnFieldAuthMap,
|
|
48280
48526
|
paramsConfig,
|
|
48281
48527
|
query
|
|
48282
48528
|
};
|
|
@@ -48406,90 +48652,6 @@ var FIELD_TYPE = /* @__PURE__ */ ((FIELD_TYPE2) => {
|
|
|
48406
48652
|
FIELD_TYPE2["DEVICE_REF_MULTI"] = "device_ref_multi";
|
|
48407
48653
|
return FIELD_TYPE2;
|
|
48408
48654
|
})(FIELD_TYPE || {});
|
|
48409
|
-
function transformSourceData(sourceData, i18nData) {
|
|
48410
|
-
const clone2 = cloneDeep(sourceData);
|
|
48411
|
-
const _DICT = i18nData ? Object.keys(clone2).reduce((acc, key) => {
|
|
48412
|
-
const map2 = i18nData[key];
|
|
48413
|
-
const value = clone2[key];
|
|
48414
|
-
if (map2 && value) {
|
|
48415
|
-
const labels = String(value).split(",").map((k) => map2[k]);
|
|
48416
|
-
acc[key] = { [value]: labels };
|
|
48417
|
-
}
|
|
48418
|
-
return acc;
|
|
48419
|
-
}, {}) : clone2._DICT || {};
|
|
48420
|
-
const _OPCT = clone2.__FOREIGN__ ? transformSourceData(clone2.__FOREIGN__, i18nData) : {};
|
|
48421
|
-
const children = Array.isArray(clone2.__CHILDREN__) ? clone2.__CHILDREN__.map((c2) => transformSourceData(c2, i18nData)) : clone2.__CHILDREN__;
|
|
48422
|
-
return {
|
|
48423
|
-
...clone2,
|
|
48424
|
-
_DICT,
|
|
48425
|
-
_OPCT,
|
|
48426
|
-
__FOREIGN__: null,
|
|
48427
|
-
__CHILDREN__: children
|
|
48428
|
-
};
|
|
48429
|
-
}
|
|
48430
|
-
function transformSourceDataList(data, dict = {}) {
|
|
48431
|
-
const list = data?.map((i) => transformSourceData(i, dict));
|
|
48432
|
-
return list || [];
|
|
48433
|
-
}
|
|
48434
|
-
function findFieldWidget(instances, fieldKey, modelKey) {
|
|
48435
|
-
return instances.find((instance2) => {
|
|
48436
|
-
const fieldMeta = instance2.widgetMeta?.field;
|
|
48437
|
-
return fieldKey === getLastSegment(fieldMeta?.fieldLink) && modelKey === getLastSegment(fieldMeta?.modelLink);
|
|
48438
|
-
});
|
|
48439
|
-
}
|
|
48440
|
-
function getSubmitFormData(formData) {
|
|
48441
|
-
const list2D = [];
|
|
48442
|
-
const filterKeys = ["_DICT", "_OPCT", "__FOREIGN__", "_MCTABLE", "__default_render__"];
|
|
48443
|
-
const realFormData = Object.keys(formData).reduce((acc, fieldKey) => {
|
|
48444
|
-
const info = list2D.find(
|
|
48445
|
-
(item) => (item.subTable2d || item.checkTable2d) && item.rowSubFieldKey === fieldKey
|
|
48446
|
-
);
|
|
48447
|
-
if (info) {
|
|
48448
|
-
const colSubTable = formData[info.colSubFieldKey]?.map((item) => ({
|
|
48449
|
-
[info.rowRefFieldKey]: item[info.colRefFieldKey]
|
|
48450
|
-
}));
|
|
48451
|
-
const arr = flatMap(
|
|
48452
|
-
formData[fieldKey],
|
|
48453
|
-
(row) => zip(row["_2DTABLE_"], colSubTable).map(([obj1, obj2]) => merge({}, obj1, obj2)).map(
|
|
48454
|
-
(item) => merge(
|
|
48455
|
-
pickBy(omit(row, filterKeys), (v) => !isNil(v)),
|
|
48456
|
-
pickBy(omit(item, filterKeys), (v) => !isNil(v))
|
|
48457
|
-
)
|
|
48458
|
-
)
|
|
48459
|
-
).map((item) => omit(item, "_2DTABLE_"));
|
|
48460
|
-
acc[fieldKey] = arr.every((item) => Object.keys(item).length === 1 && has(item, "group_")) ? [] : arr;
|
|
48461
|
-
} else if (Array.isArray(formData[fieldKey])) {
|
|
48462
|
-
acc[fieldKey] = formData[fieldKey].map(
|
|
48463
|
-
(item) => Object.fromEntries(
|
|
48464
|
-
Object.entries(item).filter(([key, value]) => {
|
|
48465
|
-
if (filterKeys.includes(key)) return false;
|
|
48466
|
-
if (key.endsWith("_lb_") && isEmpty(value)) return false;
|
|
48467
|
-
return true;
|
|
48468
|
-
})
|
|
48469
|
-
)
|
|
48470
|
-
);
|
|
48471
|
-
} else {
|
|
48472
|
-
acc[fieldKey] = formData[fieldKey];
|
|
48473
|
-
}
|
|
48474
|
-
return acc;
|
|
48475
|
-
}, {});
|
|
48476
|
-
console.log("0506 数据转成真实提交数据(二维表要平铺)", realFormData);
|
|
48477
|
-
return omit(realFormData, filterKeys);
|
|
48478
|
-
}
|
|
48479
|
-
function conversionFormState(payload) {
|
|
48480
|
-
const { interfaceData, masterSlaveList } = payload || {};
|
|
48481
|
-
const formState = {};
|
|
48482
|
-
if (interfaceData && interfaceData.data) {
|
|
48483
|
-
merge(formState, transformSourceData(interfaceData.data, interfaceData.dict));
|
|
48484
|
-
}
|
|
48485
|
-
masterSlaveList.map((item) => item.key).forEach((k) => {
|
|
48486
|
-
const subFormData = formState[k];
|
|
48487
|
-
if (subFormData) {
|
|
48488
|
-
formState[k] = transformSourceDataList([...subFormData.data], subFormData.dict);
|
|
48489
|
-
}
|
|
48490
|
-
});
|
|
48491
|
-
return formState;
|
|
48492
|
-
}
|
|
48493
48655
|
class RequestCache {
|
|
48494
48656
|
pendingMap = /* @__PURE__ */ new Map();
|
|
48495
48657
|
cacheMap = /* @__PURE__ */ new Map();
|
|
@@ -48690,6 +48852,84 @@ const withRequestCache = new RequestCache({
|
|
|
48690
48852
|
enableLogging: true
|
|
48691
48853
|
// 启用日志
|
|
48692
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
|
+
}
|
|
48693
48933
|
const API_CONFIG = {
|
|
48694
48934
|
ENTITY_CATEGORY: "entity",
|
|
48695
48935
|
// DEFAULT_PAGE_SIZE: 100,
|
|
@@ -49100,6 +49340,12 @@ const apiFetchers = {
|
|
|
49100
49340
|
}
|
|
49101
49341
|
})
|
|
49102
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
|
+
}
|
|
49103
49349
|
function resolveFallback(props, fields) {
|
|
49104
49350
|
if (!fields) return void 0;
|
|
49105
49351
|
for (const field of fields) {
|
|
@@ -50404,7 +50650,7 @@ async function initializeDocumentEngine(props, payload, result) {
|
|
|
50404
50650
|
bpmnFieldAuthMap: result.bpmnFieldAuthMap
|
|
50405
50651
|
}
|
|
50406
50652
|
};
|
|
50407
|
-
const doc =
|
|
50653
|
+
const doc = new Doc({
|
|
50408
50654
|
model: docModel,
|
|
50409
50655
|
mode: fillModeType,
|
|
50410
50656
|
mainModelKey,
|
|
@@ -51295,10 +51541,7 @@ function useWidgetStaticAttrs(widget) {
|
|
|
51295
51541
|
const { fieldList, modelInfo, fieldInfo } = useFieldInfo(() => fieldMeta.value);
|
|
51296
51542
|
const widgetState = computed(
|
|
51297
51543
|
() => resolveWidgetState({
|
|
51298
|
-
|
|
51299
|
-
isEditMode: docInst.value.isInEditMode(),
|
|
51300
|
-
isPrintMode: docInst.value.isInPrintMode(),
|
|
51301
|
-
formType: docInst.value.formType,
|
|
51544
|
+
doc: docInst.value,
|
|
51302
51545
|
viewState: widgetProps.value.viewState,
|
|
51303
51546
|
required: widgetProps.value.required,
|
|
51304
51547
|
newRequired: widgetProps.value.newSpecificConfig?.newRequired,
|
|
@@ -51307,7 +51550,9 @@ function useWidgetStaticAttrs(widget) {
|
|
|
51307
51550
|
disabled: widgetProps.value.disabled,
|
|
51308
51551
|
newDisabled: widgetProps.value.newSpecificConfig?.newDisabled,
|
|
51309
51552
|
cannotInput: widgetProps.value.cannotInput,
|
|
51310
|
-
isLinkedModelField: fieldMeta.value?.isLinkedModelField
|
|
51553
|
+
isLinkedModelField: fieldMeta.value?.isLinkedModelField,
|
|
51554
|
+
fieldLink: fieldMeta.value?.fieldLink || "",
|
|
51555
|
+
modelLink: fieldMeta.value?.modelLink || ""
|
|
51311
51556
|
})
|
|
51312
51557
|
);
|
|
51313
51558
|
computed(() => false);
|
|
@@ -52728,10 +52973,7 @@ const validateAllFields = async (doc) => {
|
|
|
52728
52973
|
"fw:tree-select-multiple"
|
|
52729
52974
|
].includes(type4);
|
|
52730
52975
|
const widgetState = resolveWidgetState({
|
|
52731
|
-
|
|
52732
|
-
isEditMode: doc.isInEditMode(),
|
|
52733
|
-
isPrintMode: doc.isInPrintMode(),
|
|
52734
|
-
formType: doc.formType,
|
|
52976
|
+
doc,
|
|
52735
52977
|
viewState: widgetProps.viewState,
|
|
52736
52978
|
required: widgetProps.required,
|
|
52737
52979
|
newRequired: widgetProps.newSpecificConfig?.newRequired,
|
|
@@ -52740,7 +52982,9 @@ const validateAllFields = async (doc) => {
|
|
|
52740
52982
|
disabled: widgetProps.disabled,
|
|
52741
52983
|
newDisabled: widgetProps.newSpecificConfig?.newDisabled,
|
|
52742
52984
|
cannotInput: widgetProps.cannotInput,
|
|
52743
|
-
isLinkedModelField: fieldMeta?.isLinkedModelField
|
|
52985
|
+
isLinkedModelField: fieldMeta?.isLinkedModelField,
|
|
52986
|
+
fieldLink: fieldMeta?.fieldLink || "",
|
|
52987
|
+
modelLink: fieldMeta?.modelLink || ""
|
|
52744
52988
|
});
|
|
52745
52989
|
const readonly2 = widgetState.displayStatus === "readonly-component" || widgetState.displayStatus === "readonly-text";
|
|
52746
52990
|
const showFormItem = !fieldMeta?.isLinkedModelField && fieldMeta?.fieldLink && !widgetState.disabled && !readonly2;
|
|
@@ -52838,6 +53082,29 @@ function useDependency(doc, widget, ctx) {
|
|
|
52838
53082
|
initDependency
|
|
52839
53083
|
};
|
|
52840
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
|
+
}
|
|
52841
53108
|
const _sfc_main$2P = /* @__PURE__ */ defineComponent({
|
|
52842
53109
|
__name: "overlay-render",
|
|
52843
53110
|
props: {
|
|
@@ -52871,6 +53138,12 @@ const _sfc_main$2P = /* @__PURE__ */ defineComponent({
|
|
|
52871
53138
|
showDisabled,
|
|
52872
53139
|
showReadonly
|
|
52873
53140
|
} = useWidgetStaticAttrs(props.widget);
|
|
53141
|
+
const { init: init2 } = useWidgetInitializer({
|
|
53142
|
+
doc: props.doc,
|
|
53143
|
+
widget: props.widget,
|
|
53144
|
+
fieldInfo
|
|
53145
|
+
});
|
|
53146
|
+
init2(props.isLastWidgetId);
|
|
52874
53147
|
const { validateField } = createFormValidator();
|
|
52875
53148
|
onBeforeMount(() => {
|
|
52876
53149
|
if (props.widget.widgetMeta.extra?.biz) {
|
|
@@ -53030,7 +53303,7 @@ const _sfc_main$2P = /* @__PURE__ */ defineComponent({
|
|
|
53030
53303
|
};
|
|
53031
53304
|
}
|
|
53032
53305
|
});
|
|
53033
|
-
const OverlayRender = /* @__PURE__ */ _export_sfc(_sfc_main$2P, [["__scopeId", "data-v-
|
|
53306
|
+
const OverlayRender = /* @__PURE__ */ _export_sfc(_sfc_main$2P, [["__scopeId", "data-v-0a286da7"]]);
|
|
53034
53307
|
let activeHoverId = 0;
|
|
53035
53308
|
function useHoverDelay(callback, delay = 120) {
|
|
53036
53309
|
let timer = null;
|
|
@@ -53967,19 +54240,22 @@ function buildPosMap(layers, getRect, toDom) {
|
|
|
53967
54240
|
return res;
|
|
53968
54241
|
}
|
|
53969
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
|
+
};
|
|
53970
54246
|
const cells = cellsWithId.filter(
|
|
53971
|
-
(cell) => cell
|
|
54247
|
+
(cell) => getDIVal(cell) != null && cell?.subRenderer?.type === type4
|
|
53972
54248
|
);
|
|
53973
54249
|
if (!cells.length) return {};
|
|
53974
54250
|
const grouped = groupBy(
|
|
53975
54251
|
cells,
|
|
53976
|
-
(cell) => `${cell.subRenderer.id}_dataIndex${cell
|
|
54252
|
+
(cell) => `${cell.subRenderer.id}_dataIndex${getDIVal(cell)}`
|
|
53977
54253
|
);
|
|
53978
54254
|
return Object.fromEntries(
|
|
53979
54255
|
Object.entries(grouped).map(([id, cells2]) => {
|
|
53980
54256
|
const firstCell = cells2[0];
|
|
53981
54257
|
const lastCell = cells2[cells2.length - 1];
|
|
53982
|
-
const isZeroGroup = firstCell
|
|
54258
|
+
const isZeroGroup = getDIVal(firstCell) === 0;
|
|
53983
54259
|
const bgLayer = createTableOutlineLayer({
|
|
53984
54260
|
cells: mapCellsToOutlineCells(cells2),
|
|
53985
54261
|
inset: opts.GROUP_BG_INSET
|
|
@@ -54095,7 +54371,6 @@ const _sfc_main$2H = /* @__PURE__ */ defineComponent({
|
|
|
54095
54371
|
}
|
|
54096
54372
|
});
|
|
54097
54373
|
const CORNER_SIZE = 6;
|
|
54098
|
-
const OFFSET_SIZE = 1;
|
|
54099
54374
|
const _sfc_main$2G = /* @__PURE__ */ defineComponent({
|
|
54100
54375
|
__name: "table-cell",
|
|
54101
54376
|
props: {
|
|
@@ -54132,10 +54407,10 @@ const _sfc_main$2G = /* @__PURE__ */ defineComponent({
|
|
|
54132
54407
|
}, [
|
|
54133
54408
|
!cell.mergeFromId ? (openBlock(), createBlock(_component_v_rect, {
|
|
54134
54409
|
key: 0,
|
|
54135
|
-
x: cell.roundX
|
|
54136
|
-
y: cell.roundY
|
|
54137
|
-
width: cell.roundWidth
|
|
54138
|
-
height: cell.roundHeight
|
|
54410
|
+
x: cell.roundX,
|
|
54411
|
+
y: cell.roundY,
|
|
54412
|
+
width: cell.roundWidth,
|
|
54413
|
+
height: cell.roundHeight,
|
|
54139
54414
|
fill: cell.backgroundColor,
|
|
54140
54415
|
id: cell.id
|
|
54141
54416
|
}, null, 8, ["x", "y", "width", "height", "fill", "id"])) : createCommentVNode("", true),
|
|
@@ -54347,7 +54622,11 @@ const _sfc_main$2C = /* @__PURE__ */ defineComponent({
|
|
|
54347
54622
|
() => buildDataIndexLayers(
|
|
54348
54623
|
"fixed-table",
|
|
54349
54624
|
cellsWithId.value,
|
|
54350
|
-
{
|
|
54625
|
+
{
|
|
54626
|
+
BORDER_INSET: BORDER_INSET$1,
|
|
54627
|
+
GROUP_BG_INSET: GROUP_BG_INSET$1,
|
|
54628
|
+
isEdit: props.doc.mode === DocModeTypeConst.Edit
|
|
54629
|
+
},
|
|
54351
54630
|
(cell) => ({
|
|
54352
54631
|
type: "data-group",
|
|
54353
54632
|
valuePath: cell.subRenderer.valuePath,
|
|
@@ -54359,7 +54638,11 @@ const _sfc_main$2C = /* @__PURE__ */ defineComponent({
|
|
|
54359
54638
|
() => buildDataIndexLayers(
|
|
54360
54639
|
"check-table",
|
|
54361
54640
|
cellsWithId.value,
|
|
54362
|
-
{
|
|
54641
|
+
{
|
|
54642
|
+
BORDER_INSET: BORDER_INSET$1,
|
|
54643
|
+
GROUP_BG_INSET: GROUP_BG_INSET$1,
|
|
54644
|
+
isEdit: props.doc.mode === DocModeTypeConst.Edit
|
|
54645
|
+
},
|
|
54363
54646
|
(cell) => ({
|
|
54364
54647
|
type: "data-group-2d",
|
|
54365
54648
|
valuePath: cell.subRenderer.valuePath,
|
|
@@ -54371,11 +54654,15 @@ const _sfc_main$2C = /* @__PURE__ */ defineComponent({
|
|
|
54371
54654
|
() => buildDataIndexLayers(
|
|
54372
54655
|
"2d-table",
|
|
54373
54656
|
cellsWithId.value,
|
|
54374
|
-
{
|
|
54657
|
+
{
|
|
54658
|
+
BORDER_INSET: BORDER_INSET$1,
|
|
54659
|
+
GROUP_BG_INSET: GROUP_BG_INSET$1,
|
|
54660
|
+
isEdit: props.doc.mode === DocModeTypeConst.Edit
|
|
54661
|
+
},
|
|
54375
54662
|
(cell) => ({
|
|
54376
54663
|
type: "data-group-2d",
|
|
54377
54664
|
valuePath: cell.subRenderer.valuePath,
|
|
54378
|
-
placeholder: `${cell.subRenderer.
|
|
54665
|
+
placeholder: `${cell.subRenderer.xDataIndex}`
|
|
54379
54666
|
})
|
|
54380
54667
|
)
|
|
54381
54668
|
);
|
|
@@ -54625,6 +54912,9 @@ const _sfc_main$2B = /* @__PURE__ */ defineComponent({
|
|
|
54625
54912
|
});
|
|
54626
54913
|
});
|
|
54627
54914
|
const tableId = computed(() => props.widget.id);
|
|
54915
|
+
const isCurrentTableActive = computed(() => {
|
|
54916
|
+
return interaction.activeTableId === tableId.value;
|
|
54917
|
+
});
|
|
54628
54918
|
const pageBaseOffset = computed(() => {
|
|
54629
54919
|
const node = props.doc.layoutMapper.getBaseMetaNodeById(tableId.value);
|
|
54630
54920
|
if (!node) return null;
|
|
@@ -54779,7 +55069,7 @@ const _sfc_main$2B = /* @__PURE__ */ defineComponent({
|
|
|
54779
55069
|
key: 0,
|
|
54780
55070
|
to: `#doc-konva-wrap-${__props.doc.id}`
|
|
54781
55071
|
}, [
|
|
54782
|
-
!unref(interaction).isHeaderFooterEdit ? (openBlock(), createElementBlock("div", {
|
|
55072
|
+
!unref(interaction).isHeaderFooterEdit && isCurrentTableActive.value ? (openBlock(), createElementBlock("div", {
|
|
54783
55073
|
key: 0,
|
|
54784
55074
|
class: normalizeClass(["table-action", { preview: isPreview.value }]),
|
|
54785
55075
|
style: normalizeStyle(actionPos.value)
|
|
@@ -54935,7 +55225,7 @@ const _sfc_main$2B = /* @__PURE__ */ defineComponent({
|
|
|
54935
55225
|
};
|
|
54936
55226
|
}
|
|
54937
55227
|
});
|
|
54938
|
-
const TableActionOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$2B, [["__scopeId", "data-v-
|
|
55228
|
+
const TableActionOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$2B, [["__scopeId", "data-v-e9075c2f"]]);
|
|
54939
55229
|
const _sfc_main$2A = /* @__PURE__ */ defineComponent({
|
|
54940
55230
|
__name: "table-guide-line",
|
|
54941
55231
|
props: {
|
|
@@ -55122,18 +55412,6 @@ const _sfc_main$2y = /* @__PURE__ */ defineComponent({
|
|
|
55122
55412
|
"remove-hover-bool": removeHoverBool.value,
|
|
55123
55413
|
"onUpdate:removeHoverBool": _cache[1] || (_cache[1] = ($event) => removeHoverBool.value = $event)
|
|
55124
55414
|
}, null, 8, ["widget", "rows", "colWidths", "doc", "tableWidth", "tableHeight", "axis-hover", "remove-hover-bool"]),
|
|
55125
|
-
createVNode(_sfc_main$2I, {
|
|
55126
|
-
width: tableWidth.value,
|
|
55127
|
-
height: tableHeight.value
|
|
55128
|
-
}, null, 8, ["width", "height"]),
|
|
55129
|
-
createVNode(_sfc_main$2H, {
|
|
55130
|
-
mergeRects: __props.mergeRects,
|
|
55131
|
-
colWidths: __props.colWidths,
|
|
55132
|
-
rows: __props.rows,
|
|
55133
|
-
colLefts: __props.colLefts,
|
|
55134
|
-
tableWidth: tableWidth.value,
|
|
55135
|
-
tableHeight: tableHeight.value
|
|
55136
|
-
}, null, 8, ["mergeRects", "colWidths", "rows", "colLefts", "tableWidth", "tableHeight"]),
|
|
55137
55415
|
createVNode(_sfc_main$2A, {
|
|
55138
55416
|
colWidths: __props.colWidths,
|
|
55139
55417
|
rows: __props.rows,
|
|
@@ -55157,7 +55435,19 @@ const _sfc_main$2y = /* @__PURE__ */ defineComponent({
|
|
|
55157
55435
|
tableHeight: tableHeight.value,
|
|
55158
55436
|
removeHoverBool: removeHoverBool.value
|
|
55159
55437
|
}, null, 8, ["rows", "doc", "table-id", "colWidths", "colLefts", "tableWidth", "tableHeight", "removeHoverBool"]),
|
|
55160
|
-
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"])
|
|
55161
55451
|
]),
|
|
55162
55452
|
_: 1
|
|
55163
55453
|
}, 8, ["config"]);
|
|
@@ -55194,6 +55484,15 @@ const _sfc_main$2x = /* @__PURE__ */ defineComponent({
|
|
|
55194
55484
|
index: subRenderer.dataIndex
|
|
55195
55485
|
};
|
|
55196
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
|
+
});
|
|
55197
55496
|
const insertRows = (index2, count = 1) => {
|
|
55198
55497
|
const { path: path2 } = getCtx();
|
|
55199
55498
|
props.doc.dataManager.insertAt(path2, index2, ...Array.from({ length: count }, () => ({})));
|
|
@@ -55233,7 +55532,8 @@ const _sfc_main$2x = /* @__PURE__ */ defineComponent({
|
|
|
55233
55532
|
return openBlock(), createBlock(Teleport, {
|
|
55234
55533
|
to: `#doc-konva-wrap-${__props.doc.id}`
|
|
55235
55534
|
}, [
|
|
55236
|
-
|
|
55535
|
+
!readonly2.value ? (openBlock(), createElementBlock("div", {
|
|
55536
|
+
key: 0,
|
|
55237
55537
|
class: "sub-table-action",
|
|
55238
55538
|
style: normalizeStyle(__props.pos)
|
|
55239
55539
|
}, [
|
|
@@ -55340,12 +55640,12 @@ const _sfc_main$2x = /* @__PURE__ */ defineComponent({
|
|
|
55340
55640
|
]),
|
|
55341
55641
|
_: 1
|
|
55342
55642
|
})
|
|
55343
|
-
], 4)
|
|
55643
|
+
], 4)) : createCommentVNode("", true)
|
|
55344
55644
|
], 8, ["to"]);
|
|
55345
55645
|
};
|
|
55346
55646
|
}
|
|
55347
55647
|
});
|
|
55348
|
-
const SubTableAction = /* @__PURE__ */ _export_sfc(_sfc_main$2x, [["__scopeId", "data-v-
|
|
55648
|
+
const SubTableAction = /* @__PURE__ */ _export_sfc(_sfc_main$2x, [["__scopeId", "data-v-adc8fb9a"]]);
|
|
55349
55649
|
const BORDER_INSET = 1;
|
|
55350
55650
|
const GROUP_BG_INSET = 4;
|
|
55351
55651
|
const _sfc_main$2w = /* @__PURE__ */ defineComponent({
|
|
@@ -55391,7 +55691,11 @@ const _sfc_main$2w = /* @__PURE__ */ defineComponent({
|
|
|
55391
55691
|
return buildDataIndexLayers(
|
|
55392
55692
|
type4,
|
|
55393
55693
|
cellsWithId.value,
|
|
55394
|
-
{
|
|
55694
|
+
{
|
|
55695
|
+
BORDER_INSET,
|
|
55696
|
+
GROUP_BG_INSET,
|
|
55697
|
+
isEdit: props.doc.mode === DocModeTypeConst.Edit
|
|
55698
|
+
},
|
|
55395
55699
|
() => ({
|
|
55396
55700
|
type: type4,
|
|
55397
55701
|
placeholder: "",
|
|
@@ -55456,13 +55760,18 @@ const _sfc_main$2v = /* @__PURE__ */ defineComponent({
|
|
|
55456
55760
|
const widget = toRef(props, "widget");
|
|
55457
55761
|
const tableWidth = computed(() => Math.round(widget.value.width));
|
|
55458
55762
|
const tableHeight = computed(() => Math.round(widget.value.height));
|
|
55459
|
-
const { showDisabled, showReadonly } = useWidgetStaticAttrs(widget.value);
|
|
55460
55763
|
return (_ctx, _cache) => {
|
|
55461
55764
|
const _component_v_group = resolveComponent("v-group");
|
|
55462
55765
|
return openBlock(), createBlock(_component_v_group, {
|
|
55463
55766
|
config: { x: 0, y: 0, id: widget.value.id }
|
|
55464
55767
|
}, {
|
|
55465
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"]),
|
|
55466
55775
|
createVNode(_sfc_main$2I, {
|
|
55467
55776
|
width: tableWidth.value,
|
|
55468
55777
|
height: tableHeight.value
|
|
@@ -55474,14 +55783,7 @@ const _sfc_main$2v = /* @__PURE__ */ defineComponent({
|
|
|
55474
55783
|
colLefts: __props.colLefts,
|
|
55475
55784
|
tableWidth: tableWidth.value,
|
|
55476
55785
|
tableHeight: tableHeight.value
|
|
55477
|
-
}, null, 8, ["mergeRects", "colWidths", "rows", "colLefts", "tableWidth", "tableHeight"])
|
|
55478
|
-
!(unref(showReadonly) || unref(showDisabled)) ? (openBlock(), createBlock(_sfc_main$2w, {
|
|
55479
|
-
key: 0,
|
|
55480
|
-
rows: __props.rows,
|
|
55481
|
-
"table-id": widget.value.id,
|
|
55482
|
-
doc: widget.value.doc
|
|
55483
|
-
}, null, 8, ["rows", "table-id", "doc"])) : createCommentVNode("", true),
|
|
55484
|
-
createVNode(_sfc_main$2G, { rows: __props.rows }, null, 8, ["rows"])
|
|
55786
|
+
}, null, 8, ["mergeRects", "colWidths", "rows", "colLefts", "tableWidth", "tableHeight"])
|
|
55485
55787
|
]),
|
|
55486
55788
|
_: 1
|
|
55487
55789
|
}, 8, ["config"]);
|
|
@@ -57066,19 +57368,19 @@ const _sfc_main$2m = /* @__PURE__ */ defineComponent({
|
|
|
57066
57368
|
setup(__props, { expose: __expose }) {
|
|
57067
57369
|
const props = __props;
|
|
57068
57370
|
const formData = ref({
|
|
57069
|
-
|
|
57371
|
+
key: void 0,
|
|
57070
57372
|
name: "",
|
|
57071
|
-
|
|
57373
|
+
dynamicKey: void 0
|
|
57072
57374
|
});
|
|
57073
57375
|
const dynamicOptions = computed(() => {
|
|
57074
57376
|
return props.options.map((o) => ({
|
|
57075
57377
|
...o,
|
|
57076
|
-
disabled: o.disabled ? true : o.value === formData.value.
|
|
57378
|
+
disabled: o.disabled ? true : o.value === formData.value.key
|
|
57077
57379
|
}));
|
|
57078
57380
|
});
|
|
57079
57381
|
const handleModelChange = (val, option) => {
|
|
57080
57382
|
formData.value.name = option?.label || "";
|
|
57081
|
-
formData.value.
|
|
57383
|
+
formData.value.dynamicKey = void 0;
|
|
57082
57384
|
};
|
|
57083
57385
|
__expose({
|
|
57084
57386
|
formData
|
|
@@ -57091,8 +57393,8 @@ const _sfc_main$2m = /* @__PURE__ */ defineComponent({
|
|
|
57091
57393
|
}, {
|
|
57092
57394
|
default: withCtx(() => [
|
|
57093
57395
|
createVNode(unref(GctSelect), {
|
|
57094
|
-
modelValue: formData.value.
|
|
57095
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formData.value.
|
|
57396
|
+
modelValue: formData.value.key,
|
|
57397
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formData.value.key = $event),
|
|
57096
57398
|
placeholder: "请选择",
|
|
57097
57399
|
options: __props.options,
|
|
57098
57400
|
onChange: handleModelChange
|
|
@@ -57121,8 +57423,8 @@ const _sfc_main$2m = /* @__PURE__ */ defineComponent({
|
|
|
57121
57423
|
}, {
|
|
57122
57424
|
default: withCtx(() => [
|
|
57123
57425
|
createVNode(unref(GctSelect), {
|
|
57124
|
-
modelValue: formData.value.
|
|
57125
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => formData.value.
|
|
57426
|
+
modelValue: formData.value.dynamicKey,
|
|
57427
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => formData.value.dynamicKey = $event),
|
|
57126
57428
|
placeholder: "请选择",
|
|
57127
57429
|
options: dynamicOptions.value
|
|
57128
57430
|
}, null, 8, ["modelValue", "options"])
|
|
@@ -57133,7 +57435,7 @@ const _sfc_main$2m = /* @__PURE__ */ defineComponent({
|
|
|
57133
57435
|
};
|
|
57134
57436
|
}
|
|
57135
57437
|
});
|
|
57136
|
-
const SubTableFormModal = /* @__PURE__ */ _export_sfc(_sfc_main$2m, [["__scopeId", "data-v-
|
|
57438
|
+
const SubTableFormModal = /* @__PURE__ */ _export_sfc(_sfc_main$2m, [["__scopeId", "data-v-9e3d6c1b"]]);
|
|
57137
57439
|
const _hoisted_1$1G = { class: "container" };
|
|
57138
57440
|
const _sfc_main$2l = /* @__PURE__ */ defineComponent({
|
|
57139
57441
|
__name: "set-table-header-form-modal",
|
|
@@ -57166,12 +57468,6 @@ const _sfc_main$2l = /* @__PURE__ */ defineComponent({
|
|
|
57166
57468
|
]),
|
|
57167
57469
|
_: 1
|
|
57168
57470
|
}),
|
|
57169
|
-
createVNode(unref(GctFormItem), { label: "起始位置" }, {
|
|
57170
|
-
default: withCtx(() => [
|
|
57171
|
-
createTextVNode(toDisplayString(__props.selection), 1)
|
|
57172
|
-
]),
|
|
57173
|
-
_: 1
|
|
57174
|
-
}),
|
|
57175
57471
|
createVNode(unref(GctFormItem), { label: "分页渲染" }, {
|
|
57176
57472
|
default: withCtx(() => [
|
|
57177
57473
|
createVNode(unref(GctRadioGroup), {
|
|
@@ -57204,7 +57500,7 @@ const _sfc_main$2l = /* @__PURE__ */ defineComponent({
|
|
|
57204
57500
|
};
|
|
57205
57501
|
}
|
|
57206
57502
|
});
|
|
57207
|
-
const SetTableHeaderFormModal = /* @__PURE__ */ _export_sfc(_sfc_main$2l, [["__scopeId", "data-v-
|
|
57503
|
+
const SetTableHeaderFormModal = /* @__PURE__ */ _export_sfc(_sfc_main$2l, [["__scopeId", "data-v-e376bf97"]]);
|
|
57208
57504
|
const _hoisted_1$1F = { class: "items-container" };
|
|
57209
57505
|
const _hoisted_2$14 = { class: "ribbon-tab-item" };
|
|
57210
57506
|
const _hoisted_3$P = { class: "ribbon-tab-item" };
|
|
@@ -57308,12 +57604,12 @@ const _sfc_main$2k = /* @__PURE__ */ defineComponent({
|
|
|
57308
57604
|
},
|
|
57309
57605
|
onConfirm: ({ bodyRef, close }) => {
|
|
57310
57606
|
const {
|
|
57311
|
-
|
|
57607
|
+
key,
|
|
57312
57608
|
name: name2,
|
|
57313
|
-
|
|
57609
|
+
dynamicKey
|
|
57314
57610
|
// 动态关联 data-group-2d
|
|
57315
57611
|
} = bodyRef.value.formData;
|
|
57316
|
-
if (!
|
|
57612
|
+
if (!key) {
|
|
57317
57613
|
GctMessage.error("请选择模型");
|
|
57318
57614
|
return;
|
|
57319
57615
|
}
|
|
@@ -57321,13 +57617,13 @@ const _sfc_main$2k = /* @__PURE__ */ defineComponent({
|
|
|
57321
57617
|
GctMessage.error("请输入名称");
|
|
57322
57618
|
return;
|
|
57323
57619
|
}
|
|
57324
|
-
if (type4 === "set2DTable" && !
|
|
57620
|
+
if (type4 === "set2DTable" && !dynamicKey) {
|
|
57325
57621
|
GctMessage.error("请选择关联模型");
|
|
57326
57622
|
return;
|
|
57327
57623
|
}
|
|
57328
57624
|
docInst?.value?.execute(type4, {
|
|
57329
57625
|
name: name2,
|
|
57330
|
-
valuePath: `$.${
|
|
57626
|
+
valuePath: `$.${key}${dynamicKey ? `:${dynamicKey}` : ""}`,
|
|
57331
57627
|
doCallback(_2, output) {
|
|
57332
57628
|
docInst.value.eventManager.cursorController.clearCursor();
|
|
57333
57629
|
if (!output) return;
|
|
@@ -57617,7 +57913,7 @@ const _sfc_main$2k = /* @__PURE__ */ defineComponent({
|
|
|
57617
57913
|
};
|
|
57618
57914
|
}
|
|
57619
57915
|
});
|
|
57620
|
-
const WordTable = /* @__PURE__ */ _export_sfc(_sfc_main$2k, [["__scopeId", "data-v-
|
|
57916
|
+
const WordTable = /* @__PURE__ */ _export_sfc(_sfc_main$2k, [["__scopeId", "data-v-1df12fe0"]]);
|
|
57621
57917
|
const _hoisted_1$1E = { class: "ribbon" };
|
|
57622
57918
|
const _hoisted_2$13 = { class: "ribbon-content-wrapper" };
|
|
57623
57919
|
const _sfc_main$2j = /* @__PURE__ */ defineComponent({
|
|
@@ -57875,7 +58171,8 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
57875
58171
|
const createFieldToWidget = createDesignFieldToWidgetFactory(designCtx.getFieldManifest);
|
|
57876
58172
|
const subFieldKey = computed(() => {
|
|
57877
58173
|
if (!interCtx.panelData) return "";
|
|
57878
|
-
|
|
58174
|
+
const s = getLastSegment(interCtx.panelData.context.subFieldKey);
|
|
58175
|
+
return s.includes(":") ? s.split(":")[0] : s;
|
|
57879
58176
|
});
|
|
57880
58177
|
const modelKey = computed(() => {
|
|
57881
58178
|
if (!interCtx.panelData) return "";
|
|
@@ -57995,7 +58292,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
57995
58292
|
};
|
|
57996
58293
|
}
|
|
57997
58294
|
});
|
|
57998
|
-
const ToolkitContentFields = /* @__PURE__ */ _export_sfc(_sfc_main$2h, [["__scopeId", "data-v-
|
|
58295
|
+
const ToolkitContentFields = /* @__PURE__ */ _export_sfc(_sfc_main$2h, [["__scopeId", "data-v-c740a237"]]);
|
|
57999
58296
|
function createDesignPaperWidgetToWidgetFactory(getPaperWidgetManifest) {
|
|
58000
58297
|
return function(widget, opts = {}) {
|
|
58001
58298
|
const manifest2 = getPaperWidgetManifest(widget.type);
|
|
@@ -58171,7 +58468,7 @@ const _sfc_main$2f = /* @__PURE__ */ defineComponent({
|
|
|
58171
58468
|
};
|
|
58172
58469
|
}
|
|
58173
58470
|
});
|
|
58174
|
-
const Toolkit = /* @__PURE__ */ _export_sfc(_sfc_main$2f, [["__scopeId", "data-v-
|
|
58471
|
+
const Toolkit = /* @__PURE__ */ _export_sfc(_sfc_main$2f, [["__scopeId", "data-v-dddcd6f8"]]);
|
|
58175
58472
|
const _hoisted_1$1z = { class: "designer_panel-wrapper" };
|
|
58176
58473
|
const _hoisted_2$$ = { class: "panel-breadcrumb" };
|
|
58177
58474
|
const _hoisted_3$L = {
|
|
@@ -59714,7 +60011,7 @@ const _sfc_main$22 = /* @__PURE__ */ defineComponent({
|
|
|
59714
60011
|
};
|
|
59715
60012
|
}
|
|
59716
60013
|
});
|
|
59717
|
-
const DocLayout = /* @__PURE__ */ _export_sfc(_sfc_main$22, [["__scopeId", "data-v-
|
|
60014
|
+
const DocLayout = /* @__PURE__ */ _export_sfc(_sfc_main$22, [["__scopeId", "data-v-6f089589"]]);
|
|
59718
60015
|
const _sfc_main$21 = /* @__PURE__ */ defineComponent({
|
|
59719
60016
|
__name: "editable-canvas",
|
|
59720
60017
|
props: {
|
|
@@ -59723,6 +60020,8 @@ const _sfc_main$21 = /* @__PURE__ */ defineComponent({
|
|
|
59723
60020
|
setup(__props) {
|
|
59724
60021
|
const { docInst } = useDocPubApiContext();
|
|
59725
60022
|
const interCtx = useInteractionContext();
|
|
60023
|
+
const modelKey = toRef(docInst.value, "mainModelKey");
|
|
60024
|
+
const { fields: mainModelFields } = useModelData(modelKey);
|
|
59726
60025
|
const pageStageRef = ref(null);
|
|
59727
60026
|
const scrollRef = ref(null);
|
|
59728
60027
|
function canDrop(e, isOutOfFlow) {
|
|
@@ -59757,6 +60056,7 @@ const _sfc_main$21 = /* @__PURE__ */ defineComponent({
|
|
|
59757
60056
|
docInst.value.execute(CommandType.insertField, {
|
|
59758
60057
|
valuePath: widgetMeta.field?.valuePath,
|
|
59759
60058
|
widgetMeta,
|
|
60059
|
+
mainModelFields: mainModelFields.value || [],
|
|
59760
60060
|
doCallback(data) {
|
|
59761
60061
|
if (!data) return;
|
|
59762
60062
|
const focus = Array.isArray(data) ? data[data.length - 1] : data;
|
|
@@ -59846,7 +60146,7 @@ const _sfc_main$21 = /* @__PURE__ */ defineComponent({
|
|
|
59846
60146
|
};
|
|
59847
60147
|
}
|
|
59848
60148
|
});
|
|
59849
|
-
const EditableCanvas = /* @__PURE__ */ _export_sfc(_sfc_main$21, [["__scopeId", "data-v-
|
|
60149
|
+
const EditableCanvas = /* @__PURE__ */ _export_sfc(_sfc_main$21, [["__scopeId", "data-v-02d21574"]]);
|
|
59850
60150
|
const useDocDesignLayoutProps = () => {
|
|
59851
60151
|
const provideProps = (props) => {
|
|
59852
60152
|
provide(DOC_DESIGN_LAYOUT_PROPS, props);
|
|
@@ -60279,6 +60579,162 @@ const _sfc_main$20 = /* @__PURE__ */ defineComponent({
|
|
|
60279
60579
|
}
|
|
60280
60580
|
});
|
|
60281
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
|
+
}
|
|
60282
60738
|
const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
|
|
60283
60739
|
__name: "preview-canvas",
|
|
60284
60740
|
props: {
|
|
@@ -60334,7 +60790,7 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
|
|
|
60334
60790
|
};
|
|
60335
60791
|
}
|
|
60336
60792
|
});
|
|
60337
|
-
const PreviewCanvas = /* @__PURE__ */ _export_sfc(_sfc_main$1$, [["__scopeId", "data-v-
|
|
60793
|
+
const PreviewCanvas = /* @__PURE__ */ _export_sfc(_sfc_main$1$, [["__scopeId", "data-v-c852bc0c"]]);
|
|
60338
60794
|
const _sfc_main$1_ = /* @__PURE__ */ defineComponent({
|
|
60339
60795
|
__name: "doc-render-layout",
|
|
60340
60796
|
setup(__props, { expose: __expose }) {
|
|
@@ -61771,14 +62227,14 @@ const manifest$6 = {
|
|
|
61771
62227
|
text: "render:pw-barcode"
|
|
61772
62228
|
},
|
|
61773
62229
|
defaultLayout: {
|
|
61774
|
-
width:
|
|
62230
|
+
width: 182,
|
|
61775
62231
|
height: 42
|
|
61776
62232
|
},
|
|
61777
62233
|
defaultProps: {
|
|
61778
62234
|
/** 条码类型 */
|
|
61779
62235
|
codeType: BwipCodeTypeConst.Code39,
|
|
61780
62236
|
/** 对齐方式 */
|
|
61781
|
-
justifyContent: "
|
|
62237
|
+
justifyContent: "center",
|
|
61782
62238
|
/** 显示内容类型 */
|
|
61783
62239
|
valueType: ValueTypeConst.Fixed,
|
|
61784
62240
|
/** 条码值 */
|
|
@@ -63093,6 +63549,7 @@ const _sfc_main$1O = /* @__PURE__ */ defineComponent({
|
|
|
63093
63549
|
const { docInst, isDesignMode, pageWidgetProps } = usePaperWidgetStaticAttrs(props.widget);
|
|
63094
63550
|
const readonlyValue = ref();
|
|
63095
63551
|
const valueType = computed(() => pageWidgetProps.value.valueType);
|
|
63552
|
+
const alignType = computed(() => pageWidgetProps.value.justifyContent);
|
|
63096
63553
|
const modelValue = computed(() => {
|
|
63097
63554
|
let text = pageWidgetProps.value.value;
|
|
63098
63555
|
if (valueType.value === ValueTypeConst.Field) {
|
|
@@ -63295,11 +63752,11 @@ const _sfc_main$1O = /* @__PURE__ */ defineComponent({
|
|
|
63295
63752
|
width: renderWidth.value,
|
|
63296
63753
|
height: layout.value.textHeight,
|
|
63297
63754
|
text: textValue.value,
|
|
63298
|
-
align:
|
|
63755
|
+
align: alignType.value,
|
|
63299
63756
|
verticalAlign: "middle",
|
|
63300
63757
|
fontSize: fontSize2.value,
|
|
63301
63758
|
fill: textColor.value
|
|
63302
|
-
}, null, 8, ["y", "width", "height", "text", "fontSize", "fill"])) : createCommentVNode("", true),
|
|
63759
|
+
}, null, 8, ["y", "width", "height", "text", "align", "fontSize", "fill"])) : createCommentVNode("", true),
|
|
63303
63760
|
createVNode(_component_v_rect, { config: bgConfig.value }, null, 8, ["config"])
|
|
63304
63761
|
]),
|
|
63305
63762
|
_: 1
|
|
@@ -63313,6 +63770,7 @@ const __vite_glob_0_8$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.d
|
|
|
63313
63770
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
63314
63771
|
const fontSize = 13;
|
|
63315
63772
|
const lineHeight = 15;
|
|
63773
|
+
const CELL_PADDING = 5;
|
|
63316
63774
|
const _sfc_main$1N = /* @__PURE__ */ defineComponent({
|
|
63317
63775
|
__name: "pw-diagonal-render",
|
|
63318
63776
|
props: {
|
|
@@ -63360,8 +63818,7 @@ const _sfc_main$1N = /* @__PURE__ */ defineComponent({
|
|
|
63360
63818
|
return pageWidgetProps.value.names[index2];
|
|
63361
63819
|
}
|
|
63362
63820
|
const fieldMeta = pageWidgetProps.value.bindFields?.[index2];
|
|
63363
|
-
|
|
63364
|
-
if (fieldMeta.fieldData) {
|
|
63821
|
+
if (fieldMeta && fieldMeta.fieldData) {
|
|
63365
63822
|
const path2 = fieldMeta.fieldData?.valuePath;
|
|
63366
63823
|
if (isDesignMode.value) {
|
|
63367
63824
|
return path2;
|
|
@@ -63441,7 +63898,7 @@ const _sfc_main$1N = /* @__PURE__ */ defineComponent({
|
|
|
63441
63898
|
return result;
|
|
63442
63899
|
}
|
|
63443
63900
|
const topTextLines = computed(() => {
|
|
63444
|
-
const text = names.value[0] || "";
|
|
63901
|
+
const text = names.value[isBackward.value ? 0 : 2] || "";
|
|
63445
63902
|
if (isBackward.value) {
|
|
63446
63903
|
const w2 = size.value === 2 ? width.value : width.value - width.value * 0.4;
|
|
63447
63904
|
return layoutByLineWidth({
|
|
@@ -63465,7 +63922,7 @@ const _sfc_main$1N = /* @__PURE__ */ defineComponent({
|
|
|
63465
63922
|
});
|
|
63466
63923
|
});
|
|
63467
63924
|
const bottomTextLines = computed(() => {
|
|
63468
|
-
const text = names.value[2] || "";
|
|
63925
|
+
const text = names.value[isBackward.value ? 2 : 0] || "";
|
|
63469
63926
|
if (isBackward.value) {
|
|
63470
63927
|
const y0 = size.value === 2 ? 0 : height.value * 0.4;
|
|
63471
63928
|
const h2 = size.value === 2 ? height.value : height.value - height.value * 0.4;
|
|
@@ -63590,7 +64047,7 @@ const _sfc_main$1N = /* @__PURE__ */ defineComponent({
|
|
|
63590
64047
|
const _component_v_rect = resolveComponent("v-rect");
|
|
63591
64048
|
const _component_v_group = resolveComponent("v-group");
|
|
63592
64049
|
return openBlock(), createBlock(_component_v_group, {
|
|
63593
|
-
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 }
|
|
63594
64051
|
}, {
|
|
63595
64052
|
default: withCtx(() => [
|
|
63596
64053
|
(openBlock(true), createElementBlock(Fragment, null, renderList(lines.value, (line, i) => {
|
|
@@ -64496,7 +64953,7 @@ const _sfc_main$1D = /* @__PURE__ */ defineComponent({
|
|
|
64496
64953
|
default: withCtx(() => [
|
|
64497
64954
|
createElementVNode("div", _hoisted_2$S, [
|
|
64498
64955
|
createVNode(unref(GctFormItem), {
|
|
64499
|
-
label: "
|
|
64956
|
+
label: "表单名称",
|
|
64500
64957
|
inline: false
|
|
64501
64958
|
}, {
|
|
64502
64959
|
default: withCtx(() => [
|
|
@@ -64656,10 +65113,10 @@ const _sfc_main$1D = /* @__PURE__ */ defineComponent({
|
|
|
64656
65113
|
};
|
|
64657
65114
|
}
|
|
64658
65115
|
});
|
|
64659
|
-
const PaperPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1D, [["__scopeId", "data-v-
|
|
65116
|
+
const PaperPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1D, [["__scopeId", "data-v-c69e49c7"]]);
|
|
64660
65117
|
const schema$c = {
|
|
64661
65118
|
key: "paper.basic",
|
|
64662
|
-
title: "
|
|
65119
|
+
title: "表单属性",
|
|
64663
65120
|
render: PaperPanel
|
|
64664
65121
|
};
|
|
64665
65122
|
let snapshotScheduled = false;
|
|
@@ -72753,7 +73210,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
72753
73210
|
const alignHorizontalOptions = [
|
|
72754
73211
|
{
|
|
72755
73212
|
label: "左对齐",
|
|
72756
|
-
value: "
|
|
73213
|
+
value: "left",
|
|
72757
73214
|
icon: "icon-zuoduiqi2",
|
|
72758
73215
|
showTip: true
|
|
72759
73216
|
},
|
|
@@ -72765,7 +73222,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
72765
73222
|
},
|
|
72766
73223
|
{
|
|
72767
73224
|
label: "右对齐",
|
|
72768
|
-
value: "
|
|
73225
|
+
value: "right",
|
|
72769
73226
|
icon: "icon-youduiqi2",
|
|
72770
73227
|
showTip: true
|
|
72771
73228
|
}
|
|
@@ -72804,7 +73261,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
72804
73261
|
numberProps
|
|
72805
73262
|
}, null, 8, ["modelValue"]),
|
|
72806
73263
|
createVNode(_sfc_main$W, {
|
|
72807
|
-
label: "
|
|
73264
|
+
label: "内容对齐方式",
|
|
72808
73265
|
modelValue: formState.value.justifyContent,
|
|
72809
73266
|
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => formState.value.justifyContent = $event),
|
|
72810
73267
|
options: alignHorizontalOptions,
|
|
@@ -72826,7 +73283,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
72826
73283
|
};
|
|
72827
73284
|
}
|
|
72828
73285
|
});
|
|
72829
|
-
const widgetBarcodeConfig = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-
|
|
73286
|
+
const widgetBarcodeConfig = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-dd6c8791"]]);
|
|
72830
73287
|
const __vite_glob_1_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
72831
73288
|
__proto__: null,
|
|
72832
73289
|
default: widgetBarcodeConfig
|