print-design-myprint 1.0.13 → 1.0.15
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/index.full.js +389 -346
- package/dist/index.full.mjs +388 -346
- package/es/components/content/index.vue2.mjs +2 -7
- package/es/components/content/index.vue2.mjs.map +1 -1
- package/es/components/content/widget/base-widget.vue2.mjs +2 -1
- package/es/components/content/widget/base-widget.vue2.mjs.map +1 -1
- package/es/components/design/table/data-table/column-view.vue.d.ts +1 -0
- package/es/components/design/table/data-table/data-table.vue.d.ts +2 -0
- package/es/components/design/table/data-table/table-design.vue.d.ts +2 -0
- package/es/components/design/text/text.vue.d.ts +1 -0
- package/es/components/design/text/text.vue2.mjs +25 -5
- package/es/components/design/text/text.vue2.mjs.map +1 -1
- package/es/components/preview/autoPage.d.ts +1 -3
- package/es/components/preview/autoPage.mjs +45 -38
- package/es/components/preview/autoPage.mjs.map +1 -1
- package/es/components/preview/preview-panel.vue.mjs +1 -2
- package/es/components/preview/preview-panel.vue.mjs.map +1 -1
- package/es/components/preview/preview-panel.vue2.mjs +187 -269
- package/es/components/preview/preview-panel.vue2.mjs.map +1 -1
- package/es/components/preview/preview.vue2.mjs +4 -2
- package/es/components/preview/preview.vue2.mjs.map +1 -1
- package/es/preview.d.ts +3 -1
- package/es/preview.mjs +10 -6
- package/es/preview.mjs.map +1 -1
- package/es/types/entity.d.ts +4 -0
- package/es/types/entity.mjs.map +1 -1
- package/es/utils/elementUtil.d.ts +8 -0
- package/es/utils/elementUtil.mjs +98 -7
- package/es/utils/elementUtil.mjs.map +1 -1
- package/es/utils/historyUtil.mjs +3 -1
- package/es/utils/historyUtil.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/content/index.vue2.js +1 -6
- package/lib/components/content/index.vue2.js.map +1 -1
- package/lib/components/content/widget/base-widget.vue2.js +2 -1
- package/lib/components/content/widget/base-widget.vue2.js.map +1 -1
- package/lib/components/design/table/data-table/column-view.vue.d.ts +1 -0
- package/lib/components/design/table/data-table/data-table.vue.d.ts +2 -0
- package/lib/components/design/table/data-table/table-design.vue.d.ts +2 -0
- package/lib/components/design/text/text.vue.d.ts +1 -0
- package/lib/components/design/text/text.vue2.js +23 -3
- package/lib/components/design/text/text.vue2.js.map +1 -1
- package/lib/components/preview/autoPage.d.ts +1 -3
- package/lib/components/preview/autoPage.js +44 -37
- package/lib/components/preview/autoPage.js.map +1 -1
- package/lib/components/preview/preview-panel.vue.js +1 -2
- package/lib/components/preview/preview-panel.vue.js.map +1 -1
- package/lib/components/preview/preview-panel.vue2.js +184 -266
- package/lib/components/preview/preview-panel.vue2.js.map +1 -1
- package/lib/components/preview/preview.vue2.js +4 -2
- package/lib/components/preview/preview.vue2.js.map +1 -1
- package/lib/preview.d.ts +3 -1
- package/lib/preview.js +8 -3
- package/lib/preview.js.map +1 -1
- package/lib/types/entity.d.ts +4 -0
- package/lib/types/entity.js.map +1 -1
- package/lib/utils/elementUtil.d.ts +8 -0
- package/lib/utils/elementUtil.js +99 -5
- package/lib/utils/elementUtil.js.map +1 -1
- package/lib/utils/historyUtil.js +2 -0
- package/lib/utils/historyUtil.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
package/dist/index.full.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('pinia'), require('vue-cropper/dist/index.css'), require('/Users/miro/Desktop/project/myprint/packages/design/src/components/design/image/image.vue?vue&type=style&index=0&scoped=923ed041&lang.css'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'pinia', 'vue-cropper/dist/index.css', '/Users/miro/Desktop/project/myprint/packages/design/src/components/design/image/image.vue?vue&type=style&index=0&scoped=923ed041&lang.css', '
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('pinia'), require('vue-cropper/dist/index.css'), require('/Users/miro/Desktop/project/myprint/packages/design/src/components/design/image/image.vue?vue&type=style&index=0&scoped=923ed041&lang.css'), require('vue3-colorpicker/style.css')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'pinia', 'vue-cropper/dist/index.css', '/Users/miro/Desktop/project/myprint/packages/design/src/components/design/image/image.vue?vue&type=style&index=0&scoped=923ed041&lang.css', 'vue3-colorpicker/style.css'], factory) :
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MyPrinterDesign = {}, global.Vue, global.pinia));
|
|
5
5
|
})(this, (function (exports, vue, pinia) { 'use strict';
|
|
6
6
|
|
|
@@ -25787,6 +25787,7 @@
|
|
|
25787
25787
|
panel.elementList = snapshot.panel.elementList;
|
|
25788
25788
|
panel.pageHeader = snapshot.panel.pageHeader;
|
|
25789
25789
|
panel.pageFooter = snapshot.panel.pageFooter;
|
|
25790
|
+
normalizePanelStructure(panel);
|
|
25790
25791
|
installPanelParentElement(panel);
|
|
25791
25792
|
updatePanel();
|
|
25792
25793
|
}
|
|
@@ -25801,6 +25802,7 @@
|
|
|
25801
25802
|
panel.elementList = snapshot.panel.elementList;
|
|
25802
25803
|
panel.pageHeader = snapshot.panel.pageHeader;
|
|
25803
25804
|
panel.pageFooter = snapshot.panel.pageFooter;
|
|
25805
|
+
normalizePanelStructure(panel);
|
|
25804
25806
|
installPanelParentElement(panel);
|
|
25805
25807
|
updatePanel();
|
|
25806
25808
|
}
|
|
@@ -34100,11 +34102,103 @@
|
|
|
34100
34102
|
return element.runtimeOption.previewIs;
|
|
34101
34103
|
}
|
|
34102
34104
|
function setCurrentPanel(panel) {
|
|
34105
|
+
normalizePanelStructure(panel);
|
|
34103
34106
|
useAppStoreHook().currentPanel = panel;
|
|
34104
34107
|
useAppStoreHook().lastPageUnit = panel.pageUnit;
|
|
34105
34108
|
}
|
|
34109
|
+
function clonePanelForPreview(source) {
|
|
34110
|
+
const cloned = parse$4(
|
|
34111
|
+
stringify$1(source, "target", "parent", "cellParent"),
|
|
34112
|
+
vue.reactive({})
|
|
34113
|
+
);
|
|
34114
|
+
if (cloned.runtimeOption == null) {
|
|
34115
|
+
cloned.runtimeOption = {};
|
|
34116
|
+
} else {
|
|
34117
|
+
const { printRealHeight: _printRealHeight, ...runtimeRest } = source.runtimeOption;
|
|
34118
|
+
cloned.runtimeOption = runtimeRest;
|
|
34119
|
+
}
|
|
34120
|
+
normalizePanelStructure(cloned);
|
|
34121
|
+
cloned.width == null && (cloned.width = _defaultNum(0, 210));
|
|
34122
|
+
cloned.height == null && (cloned.height = _defaultNum(0, 297));
|
|
34123
|
+
if (cloned.pageUnit == null) {
|
|
34124
|
+
cloned.pageUnit = "mm";
|
|
34125
|
+
}
|
|
34126
|
+
if (cloned.pageSize == null) {
|
|
34127
|
+
cloned.pageSize = "A4";
|
|
34128
|
+
}
|
|
34129
|
+
installPanelParentElement(cloned);
|
|
34130
|
+
for (let i = 0; i < cloned.elementList.length; i++) {
|
|
34131
|
+
parentInitElement(cloned, cloned, cloned.elementList[i], i);
|
|
34132
|
+
}
|
|
34133
|
+
cloned.pageHeader && parentInitElement(cloned, cloned, cloned.pageHeader, 0);
|
|
34134
|
+
cloned.pageFooter && parentInitElement(cloned, cloned, cloned.pageFooter, 0);
|
|
34135
|
+
return cloned;
|
|
34136
|
+
}
|
|
34137
|
+
function clearPanelPreviewRuntimeFlags(panel) {
|
|
34138
|
+
var _a, _b;
|
|
34139
|
+
if (panel == null) {
|
|
34140
|
+
return;
|
|
34141
|
+
}
|
|
34142
|
+
const walk = (el) => {
|
|
34143
|
+
var _a2, _b2, _c, _d;
|
|
34144
|
+
if (el == null) {
|
|
34145
|
+
return;
|
|
34146
|
+
}
|
|
34147
|
+
if (el.runtimeOption) {
|
|
34148
|
+
el.runtimeOption.previewIs = false;
|
|
34149
|
+
el.runtimeOption.target = void 0;
|
|
34150
|
+
}
|
|
34151
|
+
if ((_a2 = el.elementList) == null ? void 0 : _a2.length) {
|
|
34152
|
+
for (const child of el.elementList) {
|
|
34153
|
+
walk(child);
|
|
34154
|
+
}
|
|
34155
|
+
}
|
|
34156
|
+
if (el.type === "DataTable") {
|
|
34157
|
+
for (const row of (_b2 = el.tableHeadList) != null ? _b2 : []) {
|
|
34158
|
+
for (const cell of row != null ? row : []) {
|
|
34159
|
+
walk(cell != null ? cell : void 0);
|
|
34160
|
+
}
|
|
34161
|
+
}
|
|
34162
|
+
for (const row of (_c = el.tableBodyList) != null ? _c : []) {
|
|
34163
|
+
for (const cell of row != null ? row : []) {
|
|
34164
|
+
walk(cell != null ? cell : void 0);
|
|
34165
|
+
}
|
|
34166
|
+
}
|
|
34167
|
+
for (const row of (_d = el.statisticsList) != null ? _d : []) {
|
|
34168
|
+
for (const cell of row != null ? row : []) {
|
|
34169
|
+
walk(cell != null ? cell : void 0);
|
|
34170
|
+
}
|
|
34171
|
+
}
|
|
34172
|
+
}
|
|
34173
|
+
};
|
|
34174
|
+
walk(panel.pageHeader);
|
|
34175
|
+
walk(panel.pageFooter);
|
|
34176
|
+
for (const el of (_a = panel.elementList) != null ? _a : []) {
|
|
34177
|
+
walk(el);
|
|
34178
|
+
}
|
|
34179
|
+
if (((_b = panel.runtimeOption) == null ? void 0 : _b.printRealHeight) != null && panel.pageSize !== "AutoHeight") {
|
|
34180
|
+
const { printRealHeight: _printRealHeight, ...runtimeRest } = panel.runtimeOption;
|
|
34181
|
+
panel.runtimeOption = runtimeRest;
|
|
34182
|
+
}
|
|
34183
|
+
}
|
|
34184
|
+
function normalizePanelStructure(panel) {
|
|
34185
|
+
if (panel == null) {
|
|
34186
|
+
return;
|
|
34187
|
+
}
|
|
34188
|
+
if (!Array.isArray(panel.elementList)) {
|
|
34189
|
+
panel.elementList = [];
|
|
34190
|
+
}
|
|
34191
|
+
if (!Array.isArray(panel.groupList)) {
|
|
34192
|
+
panel.groupList = [];
|
|
34193
|
+
}
|
|
34194
|
+
if (!Array.isArray(panel.auxiliaryLineList)) {
|
|
34195
|
+
panel.auxiliaryLineList = [];
|
|
34196
|
+
}
|
|
34197
|
+
}
|
|
34106
34198
|
function getCurrentPanel(panel) {
|
|
34107
|
-
|
|
34199
|
+
const current = panel != null ? panel : useAppStoreHook().currentPanel;
|
|
34200
|
+
normalizePanelStructure(current);
|
|
34201
|
+
return current;
|
|
34108
34202
|
}
|
|
34109
34203
|
function setPreviewData(previewData) {
|
|
34110
34204
|
useAppStoreHook().previewData = previewData == null ? [] : previewData;
|
|
@@ -34157,9 +34251,7 @@
|
|
|
34157
34251
|
panel.pageUnit == null && (panel.pageUnit = _defaultVal(provider.value.pageUnit, "mm"));
|
|
34158
34252
|
panel.dragSnapPanelIs == null && (panel.dragSnapPanelIs = provider.value.dragSnapPanelIs);
|
|
34159
34253
|
panel.dragSnapIs == null && (panel.dragSnapIs = provider.value.dragSnapIs);
|
|
34160
|
-
|
|
34161
|
-
panel.groupList == null && (panel.groupList = []);
|
|
34162
|
-
panel.auxiliaryLineList == null && (panel.auxiliaryLineList = []);
|
|
34254
|
+
normalizePanelStructure(panel);
|
|
34163
34255
|
}
|
|
34164
34256
|
function none$1(element) {
|
|
34165
34257
|
if (element == null) {
|
|
@@ -34534,16 +34626,20 @@
|
|
|
34534
34626
|
return -1;
|
|
34535
34627
|
}
|
|
34536
34628
|
function element2PreviewWrapper(element) {
|
|
34629
|
+
var _a;
|
|
34537
34630
|
const previewWrapper = parse$4(stringify$1(element, "parent", "target", "elementList", "previewWrapperList", "nestColumnList"), vue.reactive({}));
|
|
34538
34631
|
previewWrapper.id = generateUUID();
|
|
34539
34632
|
previewWrapper.heightIs = true;
|
|
34540
34633
|
if (previewWrapper.runtimeOption == null) {
|
|
34541
34634
|
previewWrapper.runtimeOption = {};
|
|
34542
34635
|
}
|
|
34543
|
-
if (element.runtimeOption != null) {
|
|
34636
|
+
if (((_a = element.runtimeOption) == null ? void 0 : _a.parent) != null) {
|
|
34544
34637
|
previewWrapper.runtimeOption.parent = element.runtimeOption.parent;
|
|
34545
34638
|
}
|
|
34546
34639
|
previewWrapper.runtimeOption.previewIs = true;
|
|
34640
|
+
if (previewWrapper.data == null && element.data != null) {
|
|
34641
|
+
previewWrapper.data = element.data;
|
|
34642
|
+
}
|
|
34547
34643
|
if (previewWrapper.option == null) {
|
|
34548
34644
|
previewWrapper.option = {};
|
|
34549
34645
|
}
|
|
@@ -35395,6 +35491,7 @@
|
|
|
35395
35491
|
clearEventBubble(ev);
|
|
35396
35492
|
dragNewElement(element.runtimeOption.target, ev);
|
|
35397
35493
|
function mouseMove(evMove) {
|
|
35494
|
+
var _a;
|
|
35398
35495
|
let diffXNum = -evMove.clientX + appStore.panelPosition.x;
|
|
35399
35496
|
let diffYNum = -evMove.clientY + appStore.panelPosition.y;
|
|
35400
35497
|
if (diffXNum < 0) {
|
|
@@ -35430,7 +35527,8 @@
|
|
|
35430
35527
|
panel.pageFooter.runtimeOption.dragInIs = true;
|
|
35431
35528
|
parentElement = panel.pageFooter;
|
|
35432
35529
|
} else {
|
|
35433
|
-
|
|
35530
|
+
const canvasList = (_a = getCurrentPanel().elementList) != null ? _a : [];
|
|
35531
|
+
for (const elementOf of canvasList) {
|
|
35434
35532
|
if (elementOf.type == "Container" && innerElementIs(point, element, elementOf)) {
|
|
35435
35533
|
elementOf.runtimeOption.dragInIs = true;
|
|
35436
35534
|
parentElement = elementOf;
|
|
@@ -76534,10 +76632,30 @@
|
|
|
76534
76632
|
const style = vue.computed(() => {
|
|
76535
76633
|
return elementCommonStyle(props.element);
|
|
76536
76634
|
});
|
|
76635
|
+
function syncTextContent() {
|
|
76636
|
+
const raw = props.element.data;
|
|
76637
|
+
if (raw != null && raw !== "") {
|
|
76638
|
+
data.content = n2br(raw);
|
|
76639
|
+
data.innerContent = raw;
|
|
76640
|
+
return;
|
|
76641
|
+
}
|
|
76642
|
+
if (displayPreview(props.element)) {
|
|
76643
|
+
const elementData = formatter(props.element);
|
|
76644
|
+
if (elementData != null) {
|
|
76645
|
+
props.element.data = elementData;
|
|
76646
|
+
data.content = n2br(elementData);
|
|
76647
|
+
data.innerContent = elementData;
|
|
76648
|
+
}
|
|
76649
|
+
}
|
|
76650
|
+
}
|
|
76651
|
+
vue.watchEffect(() => {
|
|
76652
|
+
if (displayPreview(props.element)) {
|
|
76653
|
+
syncTextContent();
|
|
76654
|
+
}
|
|
76655
|
+
});
|
|
76537
76656
|
vue.onMounted(() => {
|
|
76538
|
-
|
|
76539
|
-
|
|
76540
|
-
if (props.element.data == null) {
|
|
76657
|
+
syncTextContent();
|
|
76658
|
+
if (!displayPreview(props.element) && props.element.data == null) {
|
|
76541
76659
|
const elementData = formatter(props.element);
|
|
76542
76660
|
if (elementData != null) {
|
|
76543
76661
|
props.element.data = elementData;
|
|
@@ -78396,13 +78514,13 @@
|
|
|
78396
78514
|
class: "choose-img_wrapper"
|
|
78397
78515
|
};
|
|
78398
78516
|
const _hoisted_6$1 = { style: { "width": "640px", "height": "640px" } };
|
|
78399
|
-
const _hoisted_7
|
|
78400
|
-
const _hoisted_8
|
|
78401
|
-
const _hoisted_9
|
|
78517
|
+
const _hoisted_7 = { class: "image-handle-wrapper" };
|
|
78518
|
+
const _hoisted_8 = { class: "choose-image-type-dialog-header display-flex" };
|
|
78519
|
+
const _hoisted_9 = {
|
|
78402
78520
|
key: 0,
|
|
78403
78521
|
class: "choose-image-localFile-panel display-flex"
|
|
78404
78522
|
};
|
|
78405
|
-
const _hoisted_10
|
|
78523
|
+
const _hoisted_10 = {
|
|
78406
78524
|
key: 1,
|
|
78407
78525
|
class: "choose-image-url-panel display-flex display-flex-column"
|
|
78408
78526
|
};
|
|
@@ -78694,7 +78812,7 @@
|
|
|
78694
78812
|
onImgLoad: imgLoad
|
|
78695
78813
|
}, null, 8, ["img", "outputSize", "outputType", "info", "canScale", "autoCrop", "autoCropWidth", "autoCropHeight", "fixed", "fixedNumber", "full", "fixedBox", "canMove", "canMoveBox", "original", "centerBox", "height", "infoTrue", "maxImgSize", "enlarge", "mode"])
|
|
78696
78814
|
]),
|
|
78697
|
-
vue.createElementVNode("div", _hoisted_7
|
|
78815
|
+
vue.createElementVNode("div", _hoisted_7, [
|
|
78698
78816
|
vue.createVNode(MyIcon, {
|
|
78699
78817
|
class: "image-handle-icon",
|
|
78700
78818
|
onClick: imageZoomIn
|
|
@@ -78759,7 +78877,7 @@
|
|
|
78759
78877
|
width: "520px"
|
|
78760
78878
|
}, {
|
|
78761
78879
|
default: vue.withCtx(() => [
|
|
78762
|
-
vue.createElementVNode("div", _hoisted_8
|
|
78880
|
+
vue.createElementVNode("div", _hoisted_8, [
|
|
78763
78881
|
vue.createCommentVNode(' <div class="choose-image-type-dialog-header_tab">'),
|
|
78764
78882
|
vue.createCommentVNode(' <div class="choose-image-type-dialog-header-title">\u672C\u5730\u4E0A\u4F20</div>'),
|
|
78765
78883
|
vue.createCommentVNode(' <div class="choose-image-type-dialog-header-title">\u56FE\u7247\u94FE\u63A5</div>'),
|
|
@@ -78783,13 +78901,13 @@
|
|
|
78783
78901
|
/* STABLE */
|
|
78784
78902
|
})
|
|
78785
78903
|
]),
|
|
78786
|
-
vue.unref(data).chooseImageType == "localFile" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9
|
|
78904
|
+
vue.unref(data).chooseImageType == "localFile" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9, [
|
|
78787
78905
|
vue.createElementVNode("div", {
|
|
78788
78906
|
class: "choose-image-localFile-btn",
|
|
78789
78907
|
onClick: chooseImage
|
|
78790
78908
|
}, "\u4E0A\u4F20\u672C\u5730\u56FE\u7247")
|
|
78791
78909
|
])) : vue.createCommentVNode("v-if", true),
|
|
78792
|
-
vue.unref(data).chooseImageType == "url" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10
|
|
78910
|
+
vue.unref(data).chooseImageType == "url" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
|
|
78793
78911
|
vue.createVNode(MyInput, {
|
|
78794
78912
|
class: "choose-image-url-input",
|
|
78795
78913
|
placeholder: "\u8BF7\u8F93\u5165\u7F51\u7EDC\u5730\u5740http/https",
|
|
@@ -81504,17 +81622,20 @@
|
|
|
81504
81622
|
},
|
|
81505
81623
|
setup(__props) {
|
|
81506
81624
|
const style = vue.computed(() => {
|
|
81625
|
+
var _a, _b;
|
|
81507
81626
|
const _style = {
|
|
81508
81627
|
width: valueUnit(props.preview.width, getRecursionParentPanel(props.preview)),
|
|
81509
81628
|
left: valueUnit(props.preview.x, getRecursionParentPanel(props.preview)),
|
|
81510
81629
|
top: valueUnit(props.preview.y, getRecursionParentPanel(props.preview)),
|
|
81511
|
-
zIndex: props.preview.runtimeOption.index
|
|
81630
|
+
zIndex: (_a = props.preview.runtimeOption) == null ? void 0 : _a.index
|
|
81512
81631
|
};
|
|
81513
|
-
if (props.preview.option.rotate != null) {
|
|
81632
|
+
if (((_b = props.preview.option) == null ? void 0 : _b.rotate) != null) {
|
|
81514
81633
|
_style.transform = `rotate(${props.preview.option.rotate}deg)`;
|
|
81515
81634
|
}
|
|
81516
81635
|
if (props.preview.heightIs) {
|
|
81517
81636
|
_style.height = valueUnit(props.preview.height, getRecursionParentPanel(props.preview));
|
|
81637
|
+
} else if (props.preview.height != null && (props.preview.type === "Text" || props.preview.type === "TextTime" || props.preview.type === "PageNum")) {
|
|
81638
|
+
_style.minHeight = valueUnit(props.preview.height, getRecursionParentPanel(props.preview));
|
|
81518
81639
|
}
|
|
81519
81640
|
return _style;
|
|
81520
81641
|
});
|
|
@@ -81667,7 +81788,10 @@
|
|
|
81667
81788
|
}
|
|
81668
81789
|
function normalizePreviewRecords(panel, previewDataList) {
|
|
81669
81790
|
var _a;
|
|
81670
|
-
if (
|
|
81791
|
+
if (previewDataList.length === 0) {
|
|
81792
|
+
previewDataList = [{}];
|
|
81793
|
+
}
|
|
81794
|
+
if (!panelHasDataTable(panel)) {
|
|
81671
81795
|
return { records: previewDataList, tableBodyRows: null };
|
|
81672
81796
|
}
|
|
81673
81797
|
if (previewDataList.length > 1) {
|
|
@@ -81700,9 +81824,9 @@
|
|
|
81700
81824
|
}
|
|
81701
81825
|
return [{}];
|
|
81702
81826
|
}
|
|
81703
|
-
async function autoPage(previewEl, pageList, panel, previewDataList
|
|
81704
|
-
var _a, _b;
|
|
81705
|
-
|
|
81827
|
+
async function autoPage(previewEl, pageList, panel, previewDataList) {
|
|
81828
|
+
var _a, _b, _c;
|
|
81829
|
+
normalizePanelStructure(panel);
|
|
81706
81830
|
if (previewDataList == null) {
|
|
81707
81831
|
previewDataList = [{}];
|
|
81708
81832
|
} else if (!Array.isArray(previewDataList)) {
|
|
@@ -81712,7 +81836,6 @@
|
|
|
81712
81836
|
previewDataList = [{}];
|
|
81713
81837
|
}
|
|
81714
81838
|
const { records: previewRecords, tableBodyRows } = normalizePreviewRecords(panel, previewDataList);
|
|
81715
|
-
const pagesBuffer = [];
|
|
81716
81839
|
const variable = {
|
|
81717
81840
|
pageIndex: 0,
|
|
81718
81841
|
pageSize: 0,
|
|
@@ -81734,7 +81857,7 @@
|
|
|
81734
81857
|
pagingRepetition: true,
|
|
81735
81858
|
tableBodyRows
|
|
81736
81859
|
};
|
|
81737
|
-
for (let myElement of previewContext.panel.elementList) {
|
|
81860
|
+
for (let myElement of (_a = previewContext.panel.elementList) != null ? _a : []) {
|
|
81738
81861
|
handleElement(myElement);
|
|
81739
81862
|
}
|
|
81740
81863
|
if (previewContext.panel.pageHeader) {
|
|
@@ -81793,31 +81916,23 @@
|
|
|
81793
81916
|
}
|
|
81794
81917
|
}
|
|
81795
81918
|
previewContext.autoPageIs = false;
|
|
81796
|
-
variable.pageSize =
|
|
81797
|
-
for (let i = 0; i <
|
|
81798
|
-
previewContext.currentPage =
|
|
81919
|
+
variable.pageSize = pageList.length;
|
|
81920
|
+
for (let i = 0; i < pageList.length; i++) {
|
|
81921
|
+
previewContext.currentPage = pageList[i];
|
|
81799
81922
|
variable.pageIndex = i + 1;
|
|
81800
|
-
if (measureList !== pageList) {
|
|
81801
|
-
measureList.splice(0, measureList.length, pagesBuffer[i]);
|
|
81802
|
-
await vue.nextTick();
|
|
81803
|
-
}
|
|
81804
81923
|
await installPreviewElement(fixedPreviewElementList);
|
|
81805
81924
|
}
|
|
81806
81925
|
if (panel.pageSize == "AutoHeight") {
|
|
81807
81926
|
await vue.nextTick();
|
|
81808
|
-
const lastElementChild = (
|
|
81927
|
+
const lastElementChild = (_c = (_b = previewEl.value) == null ? void 0 : _b[0]) == null ? void 0 : _c.lastElementChild;
|
|
81809
81928
|
if (lastElementChild) {
|
|
81810
81929
|
const rect = lastElementChild.getBoundingClientRect();
|
|
81811
|
-
|
|
81812
|
-
panel.runtimeOption.printRealHeight =
|
|
81930
|
+
pageList[0].height = px2unit(rect.bottom, panel);
|
|
81931
|
+
panel.runtimeOption.printRealHeight = pageList[0].height;
|
|
81813
81932
|
}
|
|
81814
81933
|
}
|
|
81815
|
-
pageList.splice(0, pageList.length, ...pagesBuffer);
|
|
81816
|
-
if (measureList !== pageList) {
|
|
81817
|
-
measureList.length = 0;
|
|
81818
|
-
}
|
|
81819
81934
|
async function installPreviewElement(previewElementList2) {
|
|
81820
|
-
var _a2, _b2,
|
|
81935
|
+
var _a2, _b2, _c2, _d, _e, _f;
|
|
81821
81936
|
for (let i = 0; i < previewElementList2.length; i++) {
|
|
81822
81937
|
const oldPreviewWrapper = previewElementList2[i];
|
|
81823
81938
|
let previewWrapper = element2PreviewWrapper(previewElementList2[i]);
|
|
@@ -81863,13 +81978,13 @@
|
|
|
81863
81978
|
previewContext.currentPreview = previewWrapper;
|
|
81864
81979
|
let previewDataTmp;
|
|
81865
81980
|
if (previewWrapper.field) {
|
|
81866
|
-
previewDataTmp = previewContext.previewData[previewWrapper.field];
|
|
81981
|
+
previewDataTmp = (_c2 = previewContext.previewData) == null ? void 0 : _c2[previewWrapper.field];
|
|
81867
81982
|
}
|
|
81868
|
-
if (
|
|
81983
|
+
if (previewDataTmp == null) {
|
|
81869
81984
|
previewDataTmp = formatter(previewWrapper, variable);
|
|
81870
81985
|
}
|
|
81871
|
-
if (
|
|
81872
|
-
previewDataTmp = previewWrapper.data;
|
|
81986
|
+
if (previewDataTmp == null) {
|
|
81987
|
+
previewDataTmp = (_d = previewWrapper.data) != null ? _d : oldPreviewWrapper.data;
|
|
81873
81988
|
}
|
|
81874
81989
|
if (previewWrapper.type == "Image") {
|
|
81875
81990
|
previewWrapper.data = previewDataTmp;
|
|
@@ -81893,11 +82008,13 @@
|
|
|
81893
82008
|
}
|
|
81894
82009
|
previewWrapper.data = previewDataTmp;
|
|
81895
82010
|
if (previewWrapper.contentType === "Text") {
|
|
81896
|
-
|
|
81897
|
-
|
|
81898
|
-
previewWrapper.data =
|
|
82011
|
+
const textPayload = previewDataTmp != null ? String(previewDataTmp) : (_e = previewWrapper.data) != null ? _e : "";
|
|
82012
|
+
if (textPayload) {
|
|
82013
|
+
previewWrapper.data = replaceSpacesOutsideHTMLTags(textPayload);
|
|
82014
|
+
} else {
|
|
82015
|
+
previewWrapper.data = textPayload;
|
|
81899
82016
|
}
|
|
81900
|
-
await autoTextElement(
|
|
82017
|
+
await autoTextElement(previewWrapper.data, true);
|
|
81901
82018
|
} else if (previewWrapper.contentType === "QrCode" || previewWrapper.contentType === "Barcode") {
|
|
81902
82019
|
previewContext.currentPage.previewWrapperList.push(previewWrapper);
|
|
81903
82020
|
await vue.nextTick();
|
|
@@ -81907,7 +82024,7 @@
|
|
|
81907
82024
|
}
|
|
81908
82025
|
} else if (previewWrapper.type == "DataTable") {
|
|
81909
82026
|
const source = previewElementList2[i];
|
|
81910
|
-
const tableRowIndex = (
|
|
82027
|
+
const tableRowIndex = (_f = source.previewTableRowIndex) != null ? _f : 0;
|
|
81911
82028
|
const tableRows = resolveTableBodyRows(previewContext, previewWrapper, previewDataTmp);
|
|
81912
82029
|
await autoTableRow(previewContext, tableRows, tableRowIndex, source);
|
|
81913
82030
|
if (!previewContext.pagingRepetition) {
|
|
@@ -81938,7 +82055,10 @@
|
|
|
81938
82055
|
previewContext.currentPage.previewWrapperList.push(previewWrapper);
|
|
81939
82056
|
}
|
|
81940
82057
|
if (!previewContext.currentPreview.heightIs) {
|
|
81941
|
-
|
|
82058
|
+
const bottom = await computeBottom(previewContext.currentPreview);
|
|
82059
|
+
if (bottom != null) {
|
|
82060
|
+
previewContext.currentPage.offsetTop = bottom;
|
|
82061
|
+
}
|
|
81942
82062
|
}
|
|
81943
82063
|
previewContext.currentPreview = previewWrapper;
|
|
81944
82064
|
}
|
|
@@ -81946,16 +82066,19 @@
|
|
|
81946
82066
|
async function autoTextElement(previewData, first) {
|
|
81947
82067
|
var _a2, _b2;
|
|
81948
82068
|
let previewWrapper = previewContext.currentPreview;
|
|
81949
|
-
previewWrapper.data
|
|
81950
|
-
previewWrapper.
|
|
82069
|
+
const textData = (_a2 = previewData != null ? previewData : previewWrapper.data) != null ? _a2 : "";
|
|
82070
|
+
previewWrapper.data = textData;
|
|
82071
|
+
const measureAutoHeight = ((_b2 = previewWrapper.option) == null ? void 0 : _b2.autoTextHeight) === true;
|
|
82072
|
+
previewWrapper.heightIs = !measureAutoHeight;
|
|
81951
82073
|
previewContext.currentPage.previewWrapperList.push(previewWrapper);
|
|
81952
82074
|
await vue.nextTick();
|
|
82075
|
+
await vue.nextTick();
|
|
81953
82076
|
if (!previewWrapper.target) {
|
|
81954
82077
|
previewWrapper.heightIs = true;
|
|
81955
82078
|
return false;
|
|
81956
82079
|
}
|
|
81957
82080
|
const height = previewWrapper.target.clientHeight;
|
|
81958
|
-
if (
|
|
82081
|
+
if (!measureAutoHeight) {
|
|
81959
82082
|
previewWrapper.heightIs = true;
|
|
81960
82083
|
return false;
|
|
81961
82084
|
}
|
|
@@ -81966,20 +82089,20 @@
|
|
|
81966
82089
|
if (previewWrapper.y + px2unit(height, panel) < previewContext.bottom) {
|
|
81967
82090
|
return false;
|
|
81968
82091
|
}
|
|
81969
|
-
let mid = await binary_search(previewWrapper,
|
|
81970
|
-
if (mid > 0 && mid <
|
|
82092
|
+
let mid = await binary_search(previewWrapper, textData, 1, textData.length);
|
|
82093
|
+
if (mid > 0 && mid < textData.length) {
|
|
81971
82094
|
if (previewContext.autoPageIs) {
|
|
81972
82095
|
await newPage();
|
|
81973
82096
|
previewContext.currentPreview = element2PreviewWrapper(previewWrapper);
|
|
81974
82097
|
previewContext.currentPreview.y = previewContext.top;
|
|
81975
|
-
await autoTextElement(
|
|
82098
|
+
await autoTextElement(textData.substring(mid + 1, textData.length), false);
|
|
81976
82099
|
return true;
|
|
81977
82100
|
}
|
|
81978
82101
|
}
|
|
81979
82102
|
return false;
|
|
81980
82103
|
}
|
|
81981
82104
|
async function autoTableRow(previewContext2, previewDataList2, index, tableSource, recursionDepth = 0) {
|
|
81982
|
-
var _a2, _b2,
|
|
82105
|
+
var _a2, _b2, _c2;
|
|
81983
82106
|
const MAX_TABLE_RECURSION = 100;
|
|
81984
82107
|
if (recursionDepth > MAX_TABLE_RECURSION) {
|
|
81985
82108
|
console.error("[MyPrint] \u8868\u683C\u5206\u9875\u9012\u5F52\u8FC7\u6DF1\uFF0C\u5DF2\u4E2D\u6B62");
|
|
@@ -82092,7 +82215,7 @@
|
|
|
82092
82215
|
statisticsData(previewDataTmpList, statisticsListWrapper);
|
|
82093
82216
|
previewContext2.currentPreview = element2PreviewWrapper(previewWrapper);
|
|
82094
82217
|
previewWrapper = previewContext2.currentPreview;
|
|
82095
|
-
if (!((
|
|
82218
|
+
if (!((_c2 = previewWrapper.option) == null ? void 0 : _c2.tablePageHeadIs)) {
|
|
82096
82219
|
previewWrapper.tableHeadHiddenIs = true;
|
|
82097
82220
|
}
|
|
82098
82221
|
previewWrapper.tableHeadList = [...tableHeadList];
|
|
@@ -82140,18 +82263,23 @@
|
|
|
82140
82263
|
});
|
|
82141
82264
|
previewContext.pageList.push(previewContext.currentPage);
|
|
82142
82265
|
previewContext.autoPageIs = true;
|
|
82143
|
-
|
|
82144
|
-
measureList.splice(0, measureList.length, previewContext.currentPage);
|
|
82266
|
+
pageList.push(previewContext.currentPage);
|
|
82145
82267
|
await vue.nextTick();
|
|
82146
82268
|
if (previewContext.panel.pageHeader) {
|
|
82147
82269
|
const preview = element2PreviewWrapper(previewContext.panel.pageHeader);
|
|
82148
82270
|
previewContext.currentPage.previewWrapperList.push(preview);
|
|
82149
|
-
|
|
82271
|
+
const top = await computeBottom(preview);
|
|
82272
|
+
if (top != null) {
|
|
82273
|
+
previewContext.top = top;
|
|
82274
|
+
}
|
|
82150
82275
|
}
|
|
82151
82276
|
if (previewContext.panel.pageFooter) {
|
|
82152
82277
|
const preview = element2PreviewWrapper(previewContext.panel.pageFooter);
|
|
82153
82278
|
previewContext.currentPage.previewWrapperList.push(preview);
|
|
82154
|
-
|
|
82279
|
+
const bottom = await computeTop(preview);
|
|
82280
|
+
if (bottom != null) {
|
|
82281
|
+
previewContext.bottom = bottom;
|
|
82282
|
+
}
|
|
82155
82283
|
}
|
|
82156
82284
|
}
|
|
82157
82285
|
async function computeBottom(previewWrapper) {
|
|
@@ -82653,73 +82781,37 @@
|
|
|
82653
82781
|
}
|
|
82654
82782
|
}
|
|
82655
82783
|
|
|
82656
|
-
const _hoisted_1$a = {
|
|
82657
|
-
class: "my-print-print_hidden",
|
|
82658
|
-
"aria-hidden": "true"
|
|
82659
|
-
};
|
|
82784
|
+
const _hoisted_1$a = { class: "preview-panel" };
|
|
82660
82785
|
const _hoisted_2$9 = { class: "my-print-preview-panel__wrap" };
|
|
82661
82786
|
const _hoisted_3$8 = { class: "preview-panel__model" };
|
|
82662
82787
|
const _hoisted_4$3 = { class: "my-print-preview-panel__content" };
|
|
82663
|
-
const _hoisted_5$2 = {
|
|
82664
|
-
|
|
82665
|
-
class: "preview-panel"
|
|
82666
|
-
};
|
|
82667
|
-
const _hoisted_6 = { class: "my-print-preview-panel__wrap" };
|
|
82668
|
-
const _hoisted_7 = { class: "preview-panel__model" };
|
|
82669
|
-
const _hoisted_8 = { class: "my-print-preview-panel__content" };
|
|
82670
|
-
const _hoisted_9 = { class: "preview-panel__tool display-flex-column display-flex-wrap" };
|
|
82671
|
-
const _hoisted_10 = { key: 1 };
|
|
82672
|
-
const _hoisted_11 = {
|
|
82673
|
-
key: 1,
|
|
82674
|
-
class: "preview-panel preview-panel--loading"
|
|
82675
|
-
};
|
|
82788
|
+
const _hoisted_5$2 = { class: "preview-panel__tool display-flex-column display-flex-wrap" };
|
|
82789
|
+
const _hoisted_6 = { key: 1 };
|
|
82676
82790
|
var _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
82677
82791
|
__name: "preview-panel",
|
|
82678
82792
|
setup(__props, { expose: __expose }) {
|
|
82679
82793
|
__expose({ handleChromePreview });
|
|
82794
|
+
vue.onMounted(() => {
|
|
82795
|
+
registerPreviewPanel(handleChromePreview);
|
|
82796
|
+
});
|
|
82797
|
+
vue.onUnmounted(() => {
|
|
82798
|
+
registerPreviewPanel(null);
|
|
82799
|
+
});
|
|
82680
82800
|
const clientConnectIs = vue.computed(() => myPrintClientService.connectIs());
|
|
82681
82801
|
const configStore = useConfigStore();
|
|
82682
82802
|
const data = vue.reactive({
|
|
82683
82803
|
dialogVisible: false,
|
|
82684
82804
|
printer: configStore.defaultPrinter,
|
|
82685
82805
|
pageList: [],
|
|
82686
|
-
measurePages: [],
|
|
82687
82806
|
resolveMap: {},
|
|
82688
82807
|
previewTimeOutMap: {},
|
|
82689
82808
|
taskId: null
|
|
82690
82809
|
});
|
|
82691
|
-
const
|
|
82692
|
-
const
|
|
82810
|
+
const previewContentRef = vue.ref();
|
|
82811
|
+
const scrollbarRef = vue.ref();
|
|
82693
82812
|
const panel = vue.ref({});
|
|
82813
|
+
let designPanelSnapshot = null;
|
|
82694
82814
|
let itemRefs = {};
|
|
82695
|
-
function pageStyle(page) {
|
|
82696
|
-
return {
|
|
82697
|
-
width: valueUnit(page.width, panel.value),
|
|
82698
|
-
minHeight: valueUnit(page.height, panel.value)
|
|
82699
|
-
};
|
|
82700
|
-
}
|
|
82701
|
-
function setMeasurePageRef(el, index) {
|
|
82702
|
-
if (!measureContentRef.value) {
|
|
82703
|
-
measureContentRef.value = [];
|
|
82704
|
-
}
|
|
82705
|
-
if (el) {
|
|
82706
|
-
measureContentRef.value[index] = el;
|
|
82707
|
-
}
|
|
82708
|
-
}
|
|
82709
|
-
function setPreviewPageRef(el, index) {
|
|
82710
|
-
if (!previewContentRef.value) {
|
|
82711
|
-
previewContentRef.value = [];
|
|
82712
|
-
}
|
|
82713
|
-
if (el) {
|
|
82714
|
-
previewContentRef.value[index] = el;
|
|
82715
|
-
}
|
|
82716
|
-
}
|
|
82717
|
-
function clearMeasureRefs() {
|
|
82718
|
-
measureContentRef.value = [];
|
|
82719
|
-
}
|
|
82720
|
-
function clearPreviewPageRefs() {
|
|
82721
|
-
previewContentRef.value = [];
|
|
82722
|
-
}
|
|
82723
82815
|
const printList = vue.computed(() => {
|
|
82724
82816
|
var _a;
|
|
82725
82817
|
const list = (_a = myPrintClientService.getPrinterList()) != null ? _a : [];
|
|
@@ -82799,35 +82891,30 @@
|
|
|
82799
82891
|
}
|
|
82800
82892
|
}
|
|
82801
82893
|
function handleChromePreview(printProps) {
|
|
82802
|
-
var _a;
|
|
82894
|
+
var _a, _b;
|
|
82803
82895
|
data.pageList = [];
|
|
82804
|
-
data.measurePages = [];
|
|
82805
|
-
clearMeasureRefs();
|
|
82806
|
-
clearPreviewPageRefs();
|
|
82807
82896
|
data.dialogVisible = true;
|
|
82808
|
-
|
|
82809
|
-
|
|
82897
|
+
designPanelSnapshot = (_a = printProps.panel) != null ? _a : getCurrentPanel();
|
|
82898
|
+
panel.value = clonePanelForPreview(designPanelSnapshot);
|
|
82899
|
+
data.taskId = (_b = printProps.taskId) != null ? _b : null;
|
|
82810
82900
|
handleTimeOut(printProps, data.previewTimeOutMap, data.resolveMap);
|
|
82811
82901
|
return new Promise((resolve, reject) => {
|
|
82812
82902
|
data.resolveMap[printProps.taskId] = resolve;
|
|
82813
|
-
|
|
82814
|
-
|
|
82815
|
-
|
|
82816
|
-
|
|
82817
|
-
|
|
82818
|
-
|
|
82819
|
-
|
|
82820
|
-
|
|
82821
|
-
|
|
82822
|
-
|
|
82823
|
-
|
|
82824
|
-
|
|
82825
|
-
|
|
82826
|
-
}).then(() => vue.nextTick()).catch((e) => {
|
|
82903
|
+
(async () => {
|
|
82904
|
+
var _a2, _b2, _c;
|
|
82905
|
+
await vue.nextTick();
|
|
82906
|
+
await vue.nextTick();
|
|
82907
|
+
await autoPage(
|
|
82908
|
+
previewContentRef,
|
|
82909
|
+
data.pageList,
|
|
82910
|
+
panel.value,
|
|
82911
|
+
printProps.previewDataList
|
|
82912
|
+
);
|
|
82913
|
+
await vue.nextTick();
|
|
82914
|
+
(_c = (_b2 = (_a2 = scrollbarRef.value) == null ? void 0 : _a2.ps) == null ? void 0 : _b2.update) == null ? void 0 : _c.call(_b2);
|
|
82915
|
+
})().catch((e) => {
|
|
82827
82916
|
var _a2;
|
|
82828
|
-
|
|
82829
|
-
data.measurePages = [];
|
|
82830
|
-
clearMeasureRefs();
|
|
82917
|
+
console.error("[MyPrint] \u9884\u89C8\u5931\u8D25", e);
|
|
82831
82918
|
printResult(printProps.taskId, {
|
|
82832
82919
|
status: "ERROR",
|
|
82833
82920
|
msg: (_a2 = e == null ? void 0 : e.message) != null ? _a2 : String(e),
|
|
@@ -82839,234 +82926,194 @@
|
|
|
82839
82926
|
}
|
|
82840
82927
|
function closePreviewPanel() {
|
|
82841
82928
|
data.pageList = [];
|
|
82842
|
-
|
|
82843
|
-
|
|
82844
|
-
|
|
82929
|
+
if (designPanelSnapshot) {
|
|
82930
|
+
clearPanelPreviewRuntimeFlags(designPanelSnapshot);
|
|
82931
|
+
designPanelSnapshot = null;
|
|
82932
|
+
}
|
|
82933
|
+
panel.value = {};
|
|
82934
|
+
mitt.emit("updatePanel");
|
|
82935
|
+
mitt.emit("changePageSize");
|
|
82845
82936
|
printResult(data.taskId, {
|
|
82846
82937
|
status: "CLOSE",
|
|
82847
82938
|
type: "CLOSE"
|
|
82848
82939
|
}, data.previewTimeOutMap, data.resolveMap);
|
|
82849
82940
|
}
|
|
82850
82941
|
return (_ctx, _cache) => {
|
|
82851
|
-
return vue.openBlock(), vue.
|
|
82852
|
-
vue.
|
|
82853
|
-
|
|
82854
|
-
|
|
82855
|
-
|
|
82942
|
+
return vue.openBlock(), vue.createBlock(MyDialog, {
|
|
82943
|
+
modelValue: vue.unref(data).dialogVisible,
|
|
82944
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.unref(data).dialogVisible = $event),
|
|
82945
|
+
class: "preview-dialog",
|
|
82946
|
+
fullscreen: "",
|
|
82947
|
+
showHeader: false,
|
|
82948
|
+
onClose: closePreviewPanel
|
|
82949
|
+
}, {
|
|
82950
|
+
default: vue.withCtx(() => [
|
|
82856
82951
|
vue.createElementVNode("div", _hoisted_1$a, [
|
|
82857
|
-
vue.
|
|
82858
|
-
|
|
82859
|
-
|
|
82860
|
-
|
|
82861
|
-
|
|
82862
|
-
|
|
82863
|
-
|
|
82864
|
-
|
|
82865
|
-
|
|
82866
|
-
|
|
82867
|
-
|
|
82868
|
-
|
|
82869
|
-
|
|
82870
|
-
|
|
82871
|
-
|
|
82872
|
-
|
|
82873
|
-
|
|
82874
|
-
|
|
82875
|
-
|
|
82876
|
-
|
|
82877
|
-
|
|
82878
|
-
|
|
82879
|
-
|
|
82880
|
-
|
|
82881
|
-
|
|
82882
|
-
|
|
82883
|
-
|
|
82884
|
-
|
|
82885
|
-
|
|
82886
|
-
|
|
82887
|
-
|
|
82888
|
-
|
|
82889
|
-
|
|
82890
|
-
|
|
82891
|
-
|
|
82892
|
-
|
|
82893
|
-
|
|
82894
|
-
|
|
82895
|
-
|
|
82896
|
-
|
|
82897
|
-
|
|
82898
|
-
|
|
82899
|
-
|
|
82900
|
-
|
|
82901
|
-
|
|
82902
|
-
|
|
82903
|
-
|
|
82904
|
-
|
|
82905
|
-
|
|
82906
|
-
|
|
82907
|
-
|
|
82908
|
-
|
|
82909
|
-
|
|
82910
|
-
vue.createVNode(MyScrollbar, {
|
|
82911
|
-
height: "100%",
|
|
82912
|
-
class: "preview-panel__scrollbar",
|
|
82913
|
-
style: vue.normalizeStyle({ minWidth: vue.unref(valueUnit)(vue.unref(panel).width, vue.unref(panel)) })
|
|
82914
|
-
}, {
|
|
82915
|
-
default: vue.withCtx(() => [
|
|
82916
|
-
vue.createElementVNode("div", _hoisted_6, [
|
|
82917
|
-
vue.createElementVNode("div", _hoisted_7, [
|
|
82918
|
-
vue.createElementVNode("div", _hoisted_8, [
|
|
82919
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
82920
|
-
vue.Fragment,
|
|
82921
|
-
null,
|
|
82922
|
-
vue.renderList(vue.unref(data).pageList, (page, index) => {
|
|
82923
|
-
var _a;
|
|
82924
|
-
return vue.openBlock(), vue.createElementBlock(
|
|
82925
|
-
"div",
|
|
82926
|
-
{
|
|
82927
|
-
key: "v-" + ((_a = page.id) != null ? _a : index),
|
|
82928
|
-
ref_for: true,
|
|
82929
|
-
ref: (el) => setPreviewPageRef(el, index),
|
|
82930
|
-
class: "my-print-preview-panel__content_page preview-page-top",
|
|
82931
|
-
style: vue.normalizeStyle(pageStyle(page))
|
|
82932
|
-
},
|
|
82933
|
-
[
|
|
82934
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
82935
|
-
vue.Fragment,
|
|
82936
|
-
null,
|
|
82937
|
-
vue.renderList(page.previewWrapperList, (element, elIndex) => {
|
|
82938
|
-
var _a2;
|
|
82939
|
-
return vue.openBlock(), vue.createBlock(Preview, {
|
|
82940
|
-
ref_for: true,
|
|
82941
|
-
ref: (el) => setItemRef(el, element),
|
|
82942
|
-
key: (_a2 = element.id) != null ? _a2 : elIndex,
|
|
82943
|
-
preview: element
|
|
82944
|
-
}, null, 8, ["preview"]);
|
|
82945
|
-
}),
|
|
82946
|
-
128
|
|
82947
|
-
/* KEYED_FRAGMENT */
|
|
82948
|
-
))
|
|
82949
|
-
],
|
|
82950
|
-
4
|
|
82951
|
-
/* STYLE */
|
|
82952
|
-
);
|
|
82953
|
-
}),
|
|
82954
|
-
128
|
|
82955
|
-
/* KEYED_FRAGMENT */
|
|
82956
|
-
))
|
|
82957
|
-
])
|
|
82958
|
-
])
|
|
82952
|
+
vue.createVNode(MyScrollbar, {
|
|
82953
|
+
ref_key: "scrollbarRef",
|
|
82954
|
+
ref: scrollbarRef,
|
|
82955
|
+
height: "100%",
|
|
82956
|
+
class: "preview-panel__scrollbar",
|
|
82957
|
+
style: vue.normalizeStyle({ minWidth: vue.unref(valueUnit)(vue.unref(panel).width, vue.unref(panel)) })
|
|
82958
|
+
}, {
|
|
82959
|
+
default: vue.withCtx(() => [
|
|
82960
|
+
vue.createElementVNode("div", _hoisted_2$9, [
|
|
82961
|
+
vue.createElementVNode("div", _hoisted_3$8, [
|
|
82962
|
+
vue.createElementVNode("div", _hoisted_4$3, [
|
|
82963
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
82964
|
+
vue.Fragment,
|
|
82965
|
+
null,
|
|
82966
|
+
vue.renderList(vue.unref(data).pageList, (page, index) => {
|
|
82967
|
+
var _a, _b;
|
|
82968
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
82969
|
+
"div",
|
|
82970
|
+
{
|
|
82971
|
+
key: (_a = page.id) != null ? _a : index,
|
|
82972
|
+
ref_for: true,
|
|
82973
|
+
ref_key: "previewContentRef",
|
|
82974
|
+
ref: previewContentRef,
|
|
82975
|
+
class: "my-print-preview-panel__content_page preview-page-top",
|
|
82976
|
+
style: vue.normalizeStyle({
|
|
82977
|
+
width: vue.unref(valueUnit)(page.width, vue.unref(panel)),
|
|
82978
|
+
minHeight: vue.unref(valueUnit)(page.height, vue.unref(panel))
|
|
82979
|
+
})
|
|
82980
|
+
},
|
|
82981
|
+
[
|
|
82982
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
82983
|
+
vue.Fragment,
|
|
82984
|
+
null,
|
|
82985
|
+
vue.renderList((_b = page.previewWrapperList) != null ? _b : [], (element, elIndex) => {
|
|
82986
|
+
var _a2;
|
|
82987
|
+
return vue.openBlock(), vue.createBlock(Preview, {
|
|
82988
|
+
ref_for: true,
|
|
82989
|
+
ref: (el) => setItemRef(el, element),
|
|
82990
|
+
key: (_a2 = element.id) != null ? _a2 : elIndex,
|
|
82991
|
+
preview: element
|
|
82992
|
+
}, null, 8, ["preview"]);
|
|
82993
|
+
}),
|
|
82994
|
+
128
|
|
82995
|
+
/* KEYED_FRAGMENT */
|
|
82996
|
+
))
|
|
82997
|
+
],
|
|
82998
|
+
4
|
|
82999
|
+
/* STYLE */
|
|
83000
|
+
);
|
|
83001
|
+
}),
|
|
83002
|
+
128
|
|
83003
|
+
/* KEYED_FRAGMENT */
|
|
83004
|
+
))
|
|
82959
83005
|
])
|
|
83006
|
+
])
|
|
83007
|
+
])
|
|
83008
|
+
]),
|
|
83009
|
+
_: 1
|
|
83010
|
+
/* STABLE */
|
|
83011
|
+
}, 8, ["style"]),
|
|
83012
|
+
vue.createElementVNode("div", _hoisted_5$2, [
|
|
83013
|
+
vue.createElementVNode(
|
|
83014
|
+
"div",
|
|
83015
|
+
null,
|
|
83016
|
+
"\u540D\u79F0\uFF1A" + vue.toDisplayString(vue.unref(panel).name),
|
|
83017
|
+
1
|
|
83018
|
+
/* TEXT */
|
|
83019
|
+
),
|
|
83020
|
+
vue.unref(clientConnectIs) ? (vue.openBlock(), vue.createElementBlock(
|
|
83021
|
+
vue.Fragment,
|
|
83022
|
+
{ key: 0 },
|
|
83023
|
+
[
|
|
83024
|
+
vue.createElementVNode("div", null, [
|
|
83025
|
+
vue.createTextVNode(
|
|
83026
|
+
vue.toDisplayString(vue.unref(i18n)("toolbar.printer")) + "\uFF1A ",
|
|
83027
|
+
1
|
|
83028
|
+
/* TEXT */
|
|
83029
|
+
),
|
|
83030
|
+
vue.createVNode(MySelect, {
|
|
83031
|
+
modelValue: vue.unref(data).printer,
|
|
83032
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.unref(data).printer = $event),
|
|
83033
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
83034
|
+
size: "middle",
|
|
83035
|
+
"data-list": vue.unref(printList)
|
|
83036
|
+
}, null, 8, ["modelValue", "data-list"])
|
|
82960
83037
|
]),
|
|
82961
|
-
_: 1
|
|
82962
|
-
/* STABLE */
|
|
82963
|
-
}, 8, ["style"]),
|
|
82964
|
-
vue.createElementVNode("div", _hoisted_9, [
|
|
82965
|
-
vue.createElementVNode(
|
|
82966
|
-
"div",
|
|
82967
|
-
null,
|
|
82968
|
-
"\u540D\u79F0\uFF1A" + vue.toDisplayString(vue.unref(panel).name),
|
|
82969
|
-
1
|
|
82970
|
-
/* TEXT */
|
|
82971
|
-
),
|
|
82972
|
-
vue.unref(clientConnectIs) ? (vue.openBlock(), vue.createElementBlock(
|
|
82973
|
-
vue.Fragment,
|
|
82974
|
-
{ key: 0 },
|
|
82975
|
-
[
|
|
82976
|
-
vue.createElementVNode("div", null, [
|
|
82977
|
-
vue.createTextVNode(
|
|
82978
|
-
vue.toDisplayString(vue.unref(i18n)("toolbar.printer")) + "\uFF1A ",
|
|
82979
|
-
1
|
|
82980
|
-
/* TEXT */
|
|
82981
|
-
),
|
|
82982
|
-
vue.createVNode(MySelect, {
|
|
82983
|
-
modelValue: vue.unref(data).printer,
|
|
82984
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.unref(data).printer = $event),
|
|
82985
|
-
placeholder: "\u8BF7\u9009\u62E9",
|
|
82986
|
-
size: "middle",
|
|
82987
|
-
"data-list": vue.unref(printList)
|
|
82988
|
-
}, null, 8, ["modelValue", "data-list"])
|
|
82989
|
-
]),
|
|
82990
|
-
vue.createVNode(MyButton, {
|
|
82991
|
-
style: { "margin-top": "40px" },
|
|
82992
|
-
disabled: !vue.unref(data).printer,
|
|
82993
|
-
onClick: print
|
|
82994
|
-
}, {
|
|
82995
|
-
default: vue.withCtx(() => [
|
|
82996
|
-
vue.createTextVNode(
|
|
82997
|
-
vue.toDisplayString(vue.unref(i18n)("toolbar.print")),
|
|
82998
|
-
1
|
|
82999
|
-
/* TEXT */
|
|
83000
|
-
)
|
|
83001
|
-
]),
|
|
83002
|
-
_: 1
|
|
83003
|
-
/* STABLE */
|
|
83004
|
-
}, 8, ["disabled"])
|
|
83005
|
-
],
|
|
83006
|
-
64
|
|
83007
|
-
/* STABLE_FRAGMENT */
|
|
83008
|
-
)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, "\u5BA2\u6237\u7AEF\u672A\u8FDE\u63A5\uFF0C\u65E0\u6CD5\u4F7F\u7528\u76F4\u63A5\u6253\u5370\u529F\u80FD\uFF0C\u53BB\u4E0B\u8F7D")),
|
|
83009
|
-
vue.createVNode(MyButton, {
|
|
83010
|
-
class: "preview-panel__tool_button",
|
|
83011
|
-
onClick: printChromePdf
|
|
83012
|
-
}, {
|
|
83013
|
-
default: vue.withCtx(() => [
|
|
83014
|
-
vue.createTextVNode(
|
|
83015
|
-
vue.toDisplayString(vue.unref(i18n)("toolbar.chrome.print")),
|
|
83016
|
-
1
|
|
83017
|
-
/* TEXT */
|
|
83018
|
-
)
|
|
83019
|
-
]),
|
|
83020
|
-
_: 1
|
|
83021
|
-
/* STABLE */
|
|
83022
|
-
}),
|
|
83023
|
-
vue.createVNode(MyButton, {
|
|
83024
|
-
class: "preview-panel__tool_button",
|
|
83025
|
-
onClick: downloadPdf
|
|
83026
|
-
}, {
|
|
83027
|
-
default: vue.withCtx(() => [
|
|
83028
|
-
vue.createTextVNode(
|
|
83029
|
-
vue.toDisplayString(vue.unref(i18n)("preview.download.pdf")),
|
|
83030
|
-
1
|
|
83031
|
-
/* TEXT */
|
|
83032
|
-
)
|
|
83033
|
-
]),
|
|
83034
|
-
_: 1
|
|
83035
|
-
/* STABLE */
|
|
83036
|
-
}),
|
|
83037
83038
|
vue.createVNode(MyButton, {
|
|
83038
|
-
|
|
83039
|
-
|
|
83039
|
+
style: { "margin-top": "40px" },
|
|
83040
|
+
disabled: !vue.unref(data).printer,
|
|
83041
|
+
onClick: print
|
|
83040
83042
|
}, {
|
|
83041
83043
|
default: vue.withCtx(() => [
|
|
83042
83044
|
vue.createTextVNode(
|
|
83043
|
-
vue.toDisplayString(vue.unref(i18n)("
|
|
83045
|
+
vue.toDisplayString(vue.unref(i18n)("toolbar.print")),
|
|
83044
83046
|
1
|
|
83045
83047
|
/* TEXT */
|
|
83046
83048
|
)
|
|
83047
83049
|
]),
|
|
83048
83050
|
_: 1
|
|
83049
83051
|
/* STABLE */
|
|
83050
|
-
})
|
|
83051
|
-
]
|
|
83052
|
-
|
|
83053
|
-
|
|
83054
|
-
|
|
83055
|
-
|
|
83056
|
-
|
|
83057
|
-
|
|
83058
|
-
|
|
83059
|
-
|
|
83060
|
-
|
|
83052
|
+
}, 8, ["disabled"])
|
|
83053
|
+
],
|
|
83054
|
+
64
|
|
83055
|
+
/* STABLE_FRAGMENT */
|
|
83056
|
+
)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, "\u5BA2\u6237\u7AEF\u672A\u8FDE\u63A5\uFF0C\u65E0\u6CD5\u4F7F\u7528\u76F4\u63A5\u6253\u5370\u529F\u80FD\uFF0C\u53BB\u4E0B\u8F7D")),
|
|
83057
|
+
vue.createVNode(MyButton, {
|
|
83058
|
+
class: "preview-panel__tool_button",
|
|
83059
|
+
onClick: printChromePdf
|
|
83060
|
+
}, {
|
|
83061
|
+
default: vue.withCtx(() => [
|
|
83062
|
+
vue.createTextVNode(
|
|
83063
|
+
vue.toDisplayString(vue.unref(i18n)("toolbar.chrome.print")),
|
|
83064
|
+
1
|
|
83065
|
+
/* TEXT */
|
|
83066
|
+
)
|
|
83067
|
+
]),
|
|
83068
|
+
_: 1
|
|
83069
|
+
/* STABLE */
|
|
83070
|
+
}),
|
|
83071
|
+
vue.createVNode(MyButton, {
|
|
83072
|
+
class: "preview-panel__tool_button",
|
|
83073
|
+
onClick: downloadPdf
|
|
83074
|
+
}, {
|
|
83075
|
+
default: vue.withCtx(() => [
|
|
83076
|
+
vue.createTextVNode(
|
|
83077
|
+
vue.toDisplayString(vue.unref(i18n)("preview.download.pdf")),
|
|
83078
|
+
1
|
|
83079
|
+
/* TEXT */
|
|
83080
|
+
)
|
|
83081
|
+
]),
|
|
83082
|
+
_: 1
|
|
83083
|
+
/* STABLE */
|
|
83084
|
+
}),
|
|
83085
|
+
vue.createVNode(MyButton, {
|
|
83086
|
+
class: "preview-panel__tool_button",
|
|
83087
|
+
onClick: _cache[1] || (_cache[1] = () => vue.unref(data).dialogVisible = false)
|
|
83088
|
+
}, {
|
|
83089
|
+
default: vue.withCtx(() => [
|
|
83090
|
+
vue.createTextVNode(
|
|
83091
|
+
vue.toDisplayString(vue.unref(i18n)("common.close")),
|
|
83092
|
+
1
|
|
83093
|
+
/* TEXT */
|
|
83094
|
+
)
|
|
83095
|
+
]),
|
|
83096
|
+
_: 1
|
|
83097
|
+
/* STABLE */
|
|
83098
|
+
})
|
|
83099
|
+
])
|
|
83100
|
+
])
|
|
83101
|
+
]),
|
|
83102
|
+
_: 1
|
|
83103
|
+
/* STABLE */
|
|
83104
|
+
}, 8, ["modelValue"]);
|
|
83061
83105
|
};
|
|
83062
83106
|
}
|
|
83063
83107
|
});
|
|
83064
83108
|
|
|
83065
|
-
var previewPanelView = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["
|
|
83109
|
+
var previewPanelView = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__file", "preview-panel.vue"]]);
|
|
83066
83110
|
|
|
83067
83111
|
let previewNode = null;
|
|
83068
83112
|
let handleChromePreview = null;
|
|
83069
|
-
function
|
|
83113
|
+
function registerPreviewPanel(handler) {
|
|
83114
|
+
handleChromePreview = handler != null ? handler : null;
|
|
83115
|
+
}
|
|
83116
|
+
function bindPreviewHandlerFromNode() {
|
|
83070
83117
|
var _a, _b;
|
|
83071
83118
|
const handler = (_b = (_a = previewNode == null ? void 0 : previewNode.component) == null ? void 0 : _a.exposed) == null ? void 0 : _b.handleChromePreview;
|
|
83072
83119
|
if (handler) {
|
|
@@ -83102,6 +83149,7 @@
|
|
|
83102
83149
|
if (panelReady.runtimeOption == null) {
|
|
83103
83150
|
panelReady.runtimeOption = {};
|
|
83104
83151
|
}
|
|
83152
|
+
normalizePanelStructure(panelReady);
|
|
83105
83153
|
installPanelParentElement(panelReady);
|
|
83106
83154
|
for (let i = 0; i < panelReady.elementList.length; i++) {
|
|
83107
83155
|
parentInitElement(panelReady, panelReady, panelReady.elementList[i], i);
|
|
@@ -83126,10 +83174,10 @@
|
|
|
83126
83174
|
previewNode.appContext = app._context;
|
|
83127
83175
|
vue.render(previewNode, container);
|
|
83128
83176
|
document.body.appendChild(container);
|
|
83129
|
-
|
|
83177
|
+
bindPreviewHandlerFromNode();
|
|
83130
83178
|
}
|
|
83131
83179
|
function openPreview(printProps) {
|
|
83132
|
-
if (!
|
|
83180
|
+
if (!bindPreviewHandlerFromNode() && !handleChromePreview) {
|
|
83133
83181
|
return Promise.reject(new Error("[MyPrint] \u9884\u89C8\u672A\u521D\u59CB\u5316\uFF0C\u8BF7\u5148\u6267\u884C app.use(createPrint)"));
|
|
83134
83182
|
}
|
|
83135
83183
|
return convertPreviewProps(printProps != null ? printProps : {}).then((props) => handleChromePreview(props));
|
|
@@ -93936,14 +93984,9 @@ ${$$g(r2)}`), n2;
|
|
|
93936
93984
|
return;
|
|
93937
93985
|
}
|
|
93938
93986
|
to$2(JSON.parse(props.template.content), panel);
|
|
93987
|
+
normalizePanelStructure(panel);
|
|
93939
93988
|
setCurrentPanel(panel);
|
|
93940
93989
|
if (!panel.watermarkContent) ;
|
|
93941
|
-
if (!panel.groupList) {
|
|
93942
|
-
panel.groupList = [];
|
|
93943
|
-
}
|
|
93944
|
-
if (!panel.auxiliaryLineList) {
|
|
93945
|
-
panel.auxiliaryLineList = [];
|
|
93946
|
-
}
|
|
93947
93990
|
for (let myAuxiliaryLine of panel.auxiliaryLineList) {
|
|
93948
93991
|
myAuxiliaryLine.runtimeOption = { x: 0, y: 0, auxiliaryLineStatus: "SHOW" };
|
|
93949
93992
|
}
|
|
@@ -94050,7 +94093,7 @@ ${$$g(r2)}`), n2;
|
|
|
94050
94093
|
}
|
|
94051
94094
|
}
|
|
94052
94095
|
|
|
94053
|
-
const version$1 = "1.0.
|
|
94096
|
+
const version$1 = "1.0.15";
|
|
94054
94097
|
|
|
94055
94098
|
function isDataTableWidget(d) {
|
|
94056
94099
|
return d.type === "DataTable";
|