vg-print 1.0.213 → 1.0.214
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/style.css +1 -1
- package/dist/vg-print.es.js +255 -224
- package/dist/vg-print.umd.js +2 -2
- package/package.json +1 -1
package/dist/vg-print.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { effectScope, ref, shallowRef, computed, watch, isRef, defineComponent, getCurrentInstance, h as h$1, Fragment, inject, onBeforeMount, onMounted, onUnmounted, createVNode, Text, createElementBlock, openBlock, createElementVNode, nextTick, resolveComponent, createBlock, withCtx, withDirectives, toDisplayString as toDisplayString$1, unref, normalizeStyle, vShow, withModifiers, createCommentVNode, renderList, normalizeClass,
|
|
1
|
+
import { effectScope, ref, shallowRef, computed, watch, isRef, defineComponent, getCurrentInstance, h as h$1, Fragment, inject, onBeforeMount, onMounted, onUnmounted, createVNode, Text, createElementBlock, openBlock, createElementVNode, nextTick, resolveComponent, createBlock, withCtx, withDirectives, toDisplayString as toDisplayString$1, unref, normalizeStyle, vShow, withModifiers, createCommentVNode, renderList, normalizeClass, createStaticVNode, createTextVNode, renderSlot } from "vue";
|
|
2
2
|
import { ElMessage } from "element-plus";
|
|
3
3
|
function _mergeNamespaces(Me, Ce) {
|
|
4
4
|
for (var Ee = 0; Ee < Ce.length; Ee++) {
|
|
@@ -83398,7 +83398,7 @@ ${i18n$1.__("转大小写")}
|
|
|
83398
83398
|
}
|
|
83399
83399
|
};
|
|
83400
83400
|
})();
|
|
83401
|
-
const version = "1.0.
|
|
83401
|
+
const version = "1.0.214";
|
|
83402
83402
|
let autoConnect = function(Me) {
|
|
83403
83403
|
console.log("autoConnect"), window.autoConnect = !0, window.hiwebSocket && window.hiwebSocket.hasIo() && window.hiwebSocket.start(Me);
|
|
83404
83404
|
}, disAutoConnect = function() {
|
|
@@ -91909,216 +91909,6 @@ function _sfc_render$5(Me, Ce, Ee, Be, Pe, Te) {
|
|
|
91909
91909
|
], 4);
|
|
91910
91910
|
}
|
|
91911
91911
|
const HistoryPanel = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-e31ece18"]]), _sfc_main$4 = {
|
|
91912
|
-
name: "Designer",
|
|
91913
|
-
components: { SecondaryToolbar, HipStructureList, HistoryPanel },
|
|
91914
|
-
props: {
|
|
91915
|
-
template: { type: Object, default: () => ({}) },
|
|
91916
|
-
printData: { type: Object, default: () => ({}) },
|
|
91917
|
-
templateKey: { type: String, default: "default-template" },
|
|
91918
|
-
title: { type: String, default: "默认模板.json" },
|
|
91919
|
-
designOptions: { type: Object, default: () => ({ grid: !0, activePanel: !0 }) },
|
|
91920
|
-
paperList: { type: Array, default: () => [] },
|
|
91921
|
-
config: { type: Object, default: () => ({}) },
|
|
91922
|
-
plugins: { type: Array, default: () => [] },
|
|
91923
|
-
authKey: { type: String, default: "" },
|
|
91924
|
-
provider: { type: Object, default: () => providerDefault },
|
|
91925
|
-
providerModuleKey: { type: String, default: "taskProviderModule" },
|
|
91926
|
-
showToolbar: { type: Boolean, default: !0 }
|
|
91927
|
-
},
|
|
91928
|
-
emits: ["ready"],
|
|
91929
|
-
data() {
|
|
91930
|
-
return { hiprintTemplate: null, showStructureList: !1, showHistory: !1, propVisible: !0, propCollapsed: !1, propStyle: { right: "12px", top: "64px", position: "fixed", width: "320px" } };
|
|
91931
|
-
},
|
|
91932
|
-
mounted() {
|
|
91933
|
-
try {
|
|
91934
|
-
this.config && Object.keys(this.config).length && vuePluginHiprintExports.hiprint.setConfig(this.config), Array.isArray(this.plugins) && this.plugins.length && vuePluginHiprintExports.hiprint.register({ authKey: this.authKey || "", plugins: this.plugins }), vuePluginHiprintExports.hiprint.init({ providers: [this.provider] });
|
|
91935
|
-
try {
|
|
91936
|
-
const Ce = ".hiprintEpContainer";
|
|
91937
|
-
try {
|
|
91938
|
-
$$2(Ce).empty();
|
|
91939
|
-
} catch {
|
|
91940
|
-
}
|
|
91941
|
-
vuePluginHiprintExports.hiprint.PrintElementTypeManager.build(Ce, this.providerModuleKey);
|
|
91942
|
-
} catch {
|
|
91943
|
-
}
|
|
91944
|
-
const Me = new vuePluginHiprintExports.hiprint.PrintTemplate({
|
|
91945
|
-
template: this.getInitialTemplate(),
|
|
91946
|
-
settingContainer: "#PrintElementOptionSetting",
|
|
91947
|
-
paginationContainer: ".hiprint-printPagination"
|
|
91948
|
-
});
|
|
91949
|
-
this.hiprintTemplate = Me, Me.design("#hiprint-printTemplate", { ...this.designOptions || {} }), this.$emit("ready", Me), this.persistTemplateDebounced = this.debounce(() => this.persistTemplate(), 500), this.bindPersist();
|
|
91950
|
-
} catch {
|
|
91951
|
-
}
|
|
91952
|
-
},
|
|
91953
|
-
beforeUnmount() {
|
|
91954
|
-
try {
|
|
91955
|
-
this.persistTemplate();
|
|
91956
|
-
} catch {
|
|
91957
|
-
}
|
|
91958
|
-
},
|
|
91959
|
-
methods: {
|
|
91960
|
-
startDragProp(Me) {
|
|
91961
|
-
try {
|
|
91962
|
-
const Ce = Me.clientX - (parseInt(this.propStyle.right) ? window.innerWidth - parseInt(this.propStyle.right) : 0), Ee = Me.clientY - parseInt(this.propStyle.top), Be = (Te) => {
|
|
91963
|
-
const je = Te.clientX - Ce, De = Math.max(0, Te.clientY - Ee), Ue = Math.max(0, window.innerWidth - je - (parseInt(this.propStyle.width) || 320));
|
|
91964
|
-
this.propStyle = { ...this.propStyle, right: Ue + "px", top: De + "px" };
|
|
91965
|
-
}, Pe = () => {
|
|
91966
|
-
window.removeEventListener("mousemove", Be), window.removeEventListener("mouseup", Pe);
|
|
91967
|
-
};
|
|
91968
|
-
window.addEventListener("mousemove", Be), window.addEventListener("mouseup", Pe);
|
|
91969
|
-
} catch {
|
|
91970
|
-
}
|
|
91971
|
-
},
|
|
91972
|
-
getTarget() {
|
|
91973
|
-
return this.hiprintTemplate;
|
|
91974
|
-
},
|
|
91975
|
-
getInitialTemplate() {
|
|
91976
|
-
try {
|
|
91977
|
-
const Me = `vg-designer:${this.templateKey}`, Ce = localStorage.getItem(Me);
|
|
91978
|
-
if (Ce) return JSON.parse(Ce);
|
|
91979
|
-
} catch {
|
|
91980
|
-
}
|
|
91981
|
-
return this.template || {};
|
|
91982
|
-
},
|
|
91983
|
-
persistTemplate() {
|
|
91984
|
-
try {
|
|
91985
|
-
if (!this.hiprintTemplate) return;
|
|
91986
|
-
const Me = `vg-designer:${this.templateKey}`, Ce = this.hiprintTemplate.getJson();
|
|
91987
|
-
localStorage.setItem(Me, JSON.stringify(Ce));
|
|
91988
|
-
} catch {
|
|
91989
|
-
}
|
|
91990
|
-
},
|
|
91991
|
-
bindPersist() {
|
|
91992
|
-
try {
|
|
91993
|
-
const Me = window.hinnn && window.hinnn.event, Ce = this.hiprintTemplate && this.hiprintTemplate.getPrintElementSelectEventKey && this.hiprintTemplate.getPrintElementSelectEventKey();
|
|
91994
|
-
Me && Ce && (Me.on(Ce, () => this.persistTemplateDebounced()), Me.on("clearSettingContainer", () => this.persistTemplateDebounced()));
|
|
91995
|
-
} catch {
|
|
91996
|
-
}
|
|
91997
|
-
},
|
|
91998
|
-
debounce(Me, Ce) {
|
|
91999
|
-
let Ee;
|
|
92000
|
-
return function(...Be) {
|
|
92001
|
-
clearTimeout(Ee), Ee = setTimeout(() => Me.apply(this, Be), Ce);
|
|
92002
|
-
};
|
|
92003
|
-
}
|
|
92004
|
-
}
|
|
92005
|
-
}, _hoisted_1$4 = { class: "vg-designer" }, _hoisted_2$2 = { class: "vg-designer-body" }, _hoisted_3$2 = { class: "vg-center" }, _hoisted_4$2 = { class: "header-actions" }, _hoisted_5$2 = { class: "prop-body hinnn-layout-sider" };
|
|
92006
|
-
function _sfc_render$4(Me, Ce, Ee, Be, Pe, Te) {
|
|
92007
|
-
const je = resolveComponent("SecondaryToolbar"), De = resolveComponent("HipStructureList"), Ue = resolveComponent("HistoryPanel");
|
|
92008
|
-
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
92009
|
-
renderSlot(Me.$slots, "header", {}, void 0, !0),
|
|
92010
|
-
Ee.showToolbar && Pe.hiprintTemplate ? (openBlock(), createBlock(je, {
|
|
92011
|
-
key: 0,
|
|
92012
|
-
template: Pe.hiprintTemplate,
|
|
92013
|
-
onToggleStructure: Ce[0] || (Ce[0] = (He) => Pe.showStructureList = !Pe.showStructureList),
|
|
92014
|
-
onToggleHistory: Ce[1] || (Ce[1] = (He) => Pe.showHistory = !Pe.showHistory),
|
|
92015
|
-
onTogglePalette: Ce[2] || (Ce[2] = (He) => Pe.propVisible = !Pe.propVisible)
|
|
92016
|
-
}, null, 8, ["template"])) : createCommentVNode("", !0),
|
|
92017
|
-
createElementVNode("div", _hoisted_2$2, [
|
|
92018
|
-
Ce[12] || (Ce[12] = createElementVNode("div", { class: "vg-left" }, [
|
|
92019
|
-
createElementVNode("div", { class: "hiprintEpContainer rect-printElement-types" })
|
|
92020
|
-
], -1)),
|
|
92021
|
-
createElementVNode("div", _hoisted_3$2, [
|
|
92022
|
-
Ce[10] || (Ce[10] = createElementVNode("div", {
|
|
92023
|
-
id: "hiprint-printTemplate",
|
|
92024
|
-
class: "hiprint-printTemplate"
|
|
92025
|
-
}, null, -1)),
|
|
92026
|
-
Ce[11] || (Ce[11] = createElementVNode("div", { class: "hiprint-printPagination" }, null, -1)),
|
|
92027
|
-
renderSlot(Me.$slots, "other", {}, void 0, !0),
|
|
92028
|
-
Pe.showStructureList && Pe.hiprintTemplate ? (openBlock(), createBlock(De, {
|
|
92029
|
-
key: 0,
|
|
92030
|
-
template: Pe.hiprintTemplate,
|
|
92031
|
-
onClose: Ce[3] || (Ce[3] = (He) => Pe.showStructureList = !1)
|
|
92032
|
-
}, null, 8, ["template"])) : createCommentVNode("", !0),
|
|
92033
|
-
Pe.showHistory && Pe.hiprintTemplate ? (openBlock(), createBlock(Ue, {
|
|
92034
|
-
key: 1,
|
|
92035
|
-
template: Pe.hiprintTemplate,
|
|
92036
|
-
onClose: Ce[4] || (Ce[4] = (He) => Pe.showHistory = !1)
|
|
92037
|
-
}, null, 8, ["template"])) : createCommentVNode("", !0)
|
|
92038
|
-
])
|
|
92039
|
-
]),
|
|
92040
|
-
withDirectives(createElementVNode("div", {
|
|
92041
|
-
class: "prop-floating",
|
|
92042
|
-
style: normalizeStyle(Pe.propStyle)
|
|
92043
|
-
}, [
|
|
92044
|
-
createElementVNode("div", {
|
|
92045
|
-
class: "prop-header",
|
|
92046
|
-
onMousedown: Ce[9] || (Ce[9] = withModifiers((...He) => Te.startDragProp && Te.startDragProp(...He), ["prevent"]))
|
|
92047
|
-
}, [
|
|
92048
|
-
Ce[14] || (Ce[14] = createElementVNode("span", { class: "title" }, "属性", -1)),
|
|
92049
|
-
createElementVNode("div", _hoisted_4$2, [
|
|
92050
|
-
createElementVNode("button", {
|
|
92051
|
-
class: "icon-btn",
|
|
92052
|
-
onMousedown: Ce[5] || (Ce[5] = withModifiers(() => {
|
|
92053
|
-
}, ["stop", "prevent"])),
|
|
92054
|
-
onClick: Ce[6] || (Ce[6] = withModifiers((He) => Pe.propCollapsed = !Pe.propCollapsed, ["stop"]))
|
|
92055
|
-
}, [
|
|
92056
|
-
createElementVNode("i", {
|
|
92057
|
-
class: normalizeClass(["iconfont", Pe.propCollapsed ? "icon-zhankai" : "icon-shousuo"])
|
|
92058
|
-
}, null, 2)
|
|
92059
|
-
], 32),
|
|
92060
|
-
createElementVNode("button", {
|
|
92061
|
-
class: "icon-btn",
|
|
92062
|
-
onMousedown: Ce[7] || (Ce[7] = withModifiers(() => {
|
|
92063
|
-
}, ["stop", "prevent"])),
|
|
92064
|
-
onClick: Ce[8] || (Ce[8] = withModifiers((He) => Pe.propVisible = !1, ["stop"]))
|
|
92065
|
-
}, [...Ce[13] || (Ce[13] = [
|
|
92066
|
-
createElementVNode("i", { class: "iconfont icon-guanbi" }, null, -1)
|
|
92067
|
-
])], 32)
|
|
92068
|
-
])
|
|
92069
|
-
], 32),
|
|
92070
|
-
withDirectives(createElementVNode("div", _hoisted_5$2, [...Ce[15] || (Ce[15] = [
|
|
92071
|
-
createElementVNode("div", { id: "PrintElementOptionSetting" }, null, -1)
|
|
92072
|
-
])], 512), [
|
|
92073
|
-
[vShow, !Pe.propCollapsed]
|
|
92074
|
-
])
|
|
92075
|
-
], 4), [
|
|
92076
|
-
[vShow, Pe.propVisible]
|
|
92077
|
-
])
|
|
92078
|
-
]);
|
|
92079
|
-
}
|
|
92080
|
-
const Designer = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-71c44545"]]), _sfc_main$3 = {
|
|
92081
|
-
name: "Header",
|
|
92082
|
-
props: {
|
|
92083
|
-
logoHtml: { type: String, default: '<i class="svp-header-logo svicon sv-print"></i>' },
|
|
92084
|
-
title: { type: String, default: "sv-print" },
|
|
92085
|
-
reEle: { type: Boolean, default: !1 },
|
|
92086
|
-
eleList: { type: Array, default: () => [] },
|
|
92087
|
-
reMenu: { type: Boolean, default: !1 },
|
|
92088
|
-
menuList: { type: Array, default: () => [] },
|
|
92089
|
-
onPreviewClick: { type: Function, default: null }
|
|
92090
|
-
},
|
|
92091
|
-
methods: {
|
|
92092
|
-
onPreviewClickInner(Me) {
|
|
92093
|
-
typeof this.onPreviewClick == "function" && this.onPreviewClick(Me) === !0 || this.$emit("preview");
|
|
92094
|
-
}
|
|
92095
|
-
}
|
|
92096
|
-
}, _hoisted_1$3 = { class: "vg-header" }, _hoisted_2$1 = { class: "left" }, _hoisted_3$1 = ["innerHTML"], _hoisted_4$1 = { class: "title" }, _hoisted_5$1 = { class: "center" }, _hoisted_6 = { class: "right" };
|
|
92097
|
-
function _sfc_render$3(Me, Ce, Ee, Be, Pe, Te) {
|
|
92098
|
-
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
92099
|
-
createElementVNode("div", _hoisted_2$1, [
|
|
92100
|
-
renderSlot(Me.$slots, "headerLeft", {}, () => [
|
|
92101
|
-
createElementVNode("span", {
|
|
92102
|
-
class: "logo",
|
|
92103
|
-
innerHTML: Ee.logoHtml
|
|
92104
|
-
}, null, 8, _hoisted_3$1),
|
|
92105
|
-
createElementVNode("span", _hoisted_4$1, toDisplayString$1(Ee.title), 1)
|
|
92106
|
-
], !0)
|
|
92107
|
-
]),
|
|
92108
|
-
createElementVNode("div", _hoisted_5$1, [
|
|
92109
|
-
renderSlot(Me.$slots, "headerCenter", {}, void 0, !0)
|
|
92110
|
-
]),
|
|
92111
|
-
createElementVNode("div", _hoisted_6, [
|
|
92112
|
-
renderSlot(Me.$slots, "headerRight", {}, () => [
|
|
92113
|
-
createElementVNode("button", {
|
|
92114
|
-
class: "btn",
|
|
92115
|
-
onClick: Ce[0] || (Ce[0] = (...je) => Te.onPreviewClickInner && Te.onPreviewClickInner(...je))
|
|
92116
|
-
}, "预览")
|
|
92117
|
-
], !0)
|
|
92118
|
-
])
|
|
92119
|
-
]);
|
|
92120
|
-
}
|
|
92121
|
-
const Header = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-d3c1be26"]]), _sfc_main$2 = {
|
|
92122
91912
|
name: "FanSpinner",
|
|
92123
91913
|
props: {
|
|
92124
91914
|
size: { type: Number, default: 56 },
|
|
@@ -92130,11 +91920,11 @@ const Header = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$
|
|
|
92130
91920
|
overlay: { type: Boolean, default: !1 },
|
|
92131
91921
|
text: { type: String, default: "" }
|
|
92132
91922
|
}
|
|
92133
|
-
}, _hoisted_1$
|
|
91923
|
+
}, _hoisted_1$4 = {
|
|
92134
91924
|
key: 0,
|
|
92135
91925
|
class: "label"
|
|
92136
91926
|
};
|
|
92137
|
-
function _sfc_render$
|
|
91927
|
+
function _sfc_render$4(Me, Ce, Ee, Be, Pe, Te) {
|
|
92138
91928
|
return openBlock(), createElementBlock("div", {
|
|
92139
91929
|
class: normalizeClass(["fan-spinner", { overlay: Ee.overlay }]),
|
|
92140
91930
|
role: "status",
|
|
@@ -92149,10 +91939,10 @@ function _sfc_render$2(Me, Ce, Ee, Be, Pe, Te) {
|
|
|
92149
91939
|
})
|
|
92150
91940
|
}, [
|
|
92151
91941
|
Ce[0] || (Ce[0] = createStaticVNode('<div class="fan" data-v-4bdcfaeb><span class="blade b1" data-v-4bdcfaeb></span><span class="blade b2" data-v-4bdcfaeb></span><span class="blade b3" data-v-4bdcfaeb></span><span class="blade b4" data-v-4bdcfaeb></span></div>', 1)),
|
|
92152
|
-
Ee.text ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
91942
|
+
Ee.text ? (openBlock(), createElementBlock("div", _hoisted_1$4, toDisplayString$1(Ee.text), 1)) : createCommentVNode("", !0)
|
|
92153
91943
|
], 6);
|
|
92154
91944
|
}
|
|
92155
|
-
const FanSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
91945
|
+
const FanSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-4bdcfaeb"]]), _sfc_main$3 = {
|
|
92156
91946
|
name: "Preview",
|
|
92157
91947
|
components: { FanSpinner },
|
|
92158
91948
|
props: {
|
|
@@ -92245,8 +92035,8 @@ const FanSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_ren
|
|
|
92245
92035
|
}
|
|
92246
92036
|
}
|
|
92247
92037
|
}
|
|
92248
|
-
}, _hoisted_1$
|
|
92249
|
-
function _sfc_render$
|
|
92038
|
+
}, _hoisted_1$3 = { class: "preview-header" }, _hoisted_2$2 = { class: "left-tools" }, _hoisted_3$2 = { class: "center-tools" }, _hoisted_4$2 = { class: "right-tools" }, _hoisted_5$2 = { class: "preview-wrap" };
|
|
92039
|
+
function _sfc_render$3(Me, Ce, Ee, Be, Pe, Te) {
|
|
92250
92040
|
const je = resolveComponent("el-button"), De = resolveComponent("el-option"), Ue = resolveComponent("el-select"), He = resolveComponent("FanSpinner"), Re = resolveComponent("el-dialog");
|
|
92251
92041
|
return openBlock(), createBlock(Re, {
|
|
92252
92042
|
modelValue: Pe.visible,
|
|
@@ -92257,8 +92047,8 @@ function _sfc_render$1(Me, Ce, Ee, Be, Pe, Te) {
|
|
|
92257
92047
|
"destroy-on-close": !0
|
|
92258
92048
|
}, {
|
|
92259
92049
|
header: withCtx(() => [
|
|
92260
|
-
createElementVNode("div", _hoisted_1$
|
|
92261
|
-
createElementVNode("div", _hoisted_2, [
|
|
92050
|
+
createElementVNode("div", _hoisted_1$3, [
|
|
92051
|
+
createElementVNode("div", _hoisted_2$2, [
|
|
92262
92052
|
Ee.showPdf ? (openBlock(), createBlock(je, {
|
|
92263
92053
|
key: 0,
|
|
92264
92054
|
size: "small",
|
|
@@ -92284,7 +92074,7 @@ function _sfc_render$1(Me, Ce, Ee, Be, Pe, Te) {
|
|
|
92284
92074
|
_: 1
|
|
92285
92075
|
}, 8, ["onClick"])) : createCommentVNode("", !0)
|
|
92286
92076
|
]),
|
|
92287
|
-
createElementVNode("div", _hoisted_3, [
|
|
92077
|
+
createElementVNode("div", _hoisted_3$2, [
|
|
92288
92078
|
Ce[5] || (Ce[5] = createElementVNode("span", { class: "label" }, "选择打印机:", -1)),
|
|
92289
92079
|
createVNode(Ue, {
|
|
92290
92080
|
modelValue: Pe.selected,
|
|
@@ -92315,7 +92105,7 @@ function _sfc_render$1(Me, Ce, Ee, Be, Pe, Te) {
|
|
|
92315
92105
|
_: 1
|
|
92316
92106
|
}, 8, ["onClick", "loading"])
|
|
92317
92107
|
]),
|
|
92318
|
-
createElementVNode("div", _hoisted_4, [
|
|
92108
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
92319
92109
|
Ee.showPrint2 ? (openBlock(), createBlock(je, {
|
|
92320
92110
|
key: 0,
|
|
92321
92111
|
size: "small",
|
|
@@ -92346,7 +92136,7 @@ function _sfc_render$1(Me, Ce, Ee, Be, Pe, Te) {
|
|
|
92346
92136
|
])
|
|
92347
92137
|
]),
|
|
92348
92138
|
default: withCtx(() => [
|
|
92349
|
-
createElementVNode("div", _hoisted_5, [
|
|
92139
|
+
createElementVNode("div", _hoisted_5$2, [
|
|
92350
92140
|
Pe.spinning ? (openBlock(), createBlock(He, {
|
|
92351
92141
|
key: 0,
|
|
92352
92142
|
overlay: !0,
|
|
@@ -92358,7 +92148,248 @@ function _sfc_render$1(Me, Ce, Ee, Be, Pe, Te) {
|
|
|
92358
92148
|
_: 1
|
|
92359
92149
|
}, 8, ["modelValue", "width", "onCancel"]);
|
|
92360
92150
|
}
|
|
92361
|
-
const Preview = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
92151
|
+
const Preview = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-f121227d"]]), _sfc_main$2 = {
|
|
92152
|
+
name: "Designer",
|
|
92153
|
+
components: { SecondaryToolbar, HipStructureList, HistoryPanel },
|
|
92154
|
+
props: {
|
|
92155
|
+
template: { type: Object, default: () => ({}) },
|
|
92156
|
+
printData: { type: Object, default: () => ({}) },
|
|
92157
|
+
templateKey: { type: String, default: "default-template" },
|
|
92158
|
+
title: { type: String, default: "默认模板.json" },
|
|
92159
|
+
designOptions: { type: Object, default: () => ({ grid: !0, activePanel: !0 }) },
|
|
92160
|
+
paperList: { type: Array, default: () => [] },
|
|
92161
|
+
config: { type: Object, default: () => ({}) },
|
|
92162
|
+
plugins: { type: Array, default: () => [] },
|
|
92163
|
+
authKey: { type: String, default: "" },
|
|
92164
|
+
provider: { type: Object, default: () => providerDefault },
|
|
92165
|
+
providerModuleKey: { type: String, default: "taskProviderModule" },
|
|
92166
|
+
showToolbar: { type: Boolean, default: !0 },
|
|
92167
|
+
showPdf: { type: Boolean, default: !0 },
|
|
92168
|
+
showImg: { type: Boolean, default: !0 },
|
|
92169
|
+
showPrint2: { type: Boolean, default: !0 }
|
|
92170
|
+
},
|
|
92171
|
+
emits: ["ready"],
|
|
92172
|
+
data() {
|
|
92173
|
+
return { hiprintTemplate: null, showStructureList: !1, showHistory: !1, propVisible: !0, propCollapsed: !1, propStyle: { right: "12px", top: "64px", position: "fixed", width: "320px" }, previewRef: null };
|
|
92174
|
+
},
|
|
92175
|
+
mounted() {
|
|
92176
|
+
try {
|
|
92177
|
+
this.config && Object.keys(this.config).length && vuePluginHiprintExports.hiprint.setConfig(this.config), Array.isArray(this.plugins) && this.plugins.length && vuePluginHiprintExports.hiprint.register({ authKey: this.authKey || "", plugins: this.plugins }), vuePluginHiprintExports.hiprint.init({ providers: [this.provider] });
|
|
92178
|
+
try {
|
|
92179
|
+
const Ce = ".hiprintEpContainer";
|
|
92180
|
+
try {
|
|
92181
|
+
$$2(Ce).empty();
|
|
92182
|
+
} catch {
|
|
92183
|
+
}
|
|
92184
|
+
vuePluginHiprintExports.hiprint.PrintElementTypeManager.build(Ce, this.providerModuleKey);
|
|
92185
|
+
} catch {
|
|
92186
|
+
}
|
|
92187
|
+
const Me = new vuePluginHiprintExports.hiprint.PrintTemplate({
|
|
92188
|
+
template: this.getInitialTemplate(),
|
|
92189
|
+
settingContainer: "#PrintElementOptionSetting",
|
|
92190
|
+
paginationContainer: ".hiprint-printPagination"
|
|
92191
|
+
});
|
|
92192
|
+
this.hiprintTemplate = Me, Me.design("#hiprint-printTemplate", { ...this.designOptions || {} }), this.$emit("ready", Me);
|
|
92193
|
+
try {
|
|
92194
|
+
window.addEventListener("vg-print-preview", this.openPreview);
|
|
92195
|
+
} catch {
|
|
92196
|
+
}
|
|
92197
|
+
this.persistTemplateDebounced = this.debounce(() => this.persistTemplate(), 500), this.bindPersist();
|
|
92198
|
+
} catch {
|
|
92199
|
+
}
|
|
92200
|
+
},
|
|
92201
|
+
beforeUnmount() {
|
|
92202
|
+
try {
|
|
92203
|
+
this.persistTemplate();
|
|
92204
|
+
} catch {
|
|
92205
|
+
}
|
|
92206
|
+
try {
|
|
92207
|
+
window.removeEventListener("vg-print-preview", this.openPreview);
|
|
92208
|
+
} catch {
|
|
92209
|
+
}
|
|
92210
|
+
},
|
|
92211
|
+
methods: {
|
|
92212
|
+
openPreview() {
|
|
92213
|
+
try {
|
|
92214
|
+
if (this.previewRef || (this.previewRef = this.$refs.previewRef), !this.previewRef || !this.hiprintTemplate) return;
|
|
92215
|
+
this.previewRef.init(this.hiprintTemplate, this.printData || {}), this.previewRef.show();
|
|
92216
|
+
} catch {
|
|
92217
|
+
}
|
|
92218
|
+
},
|
|
92219
|
+
startDragProp(Me) {
|
|
92220
|
+
try {
|
|
92221
|
+
const Ce = Me.clientX - (parseInt(this.propStyle.right) ? window.innerWidth - parseInt(this.propStyle.right) : 0), Ee = Me.clientY - parseInt(this.propStyle.top), Be = (Te) => {
|
|
92222
|
+
const je = Te.clientX - Ce, De = Math.max(0, Te.clientY - Ee), Ue = Math.max(0, window.innerWidth - je - (parseInt(this.propStyle.width) || 320));
|
|
92223
|
+
this.propStyle = { ...this.propStyle, right: Ue + "px", top: De + "px" };
|
|
92224
|
+
}, Pe = () => {
|
|
92225
|
+
window.removeEventListener("mousemove", Be), window.removeEventListener("mouseup", Pe);
|
|
92226
|
+
};
|
|
92227
|
+
window.addEventListener("mousemove", Be), window.addEventListener("mouseup", Pe);
|
|
92228
|
+
} catch {
|
|
92229
|
+
}
|
|
92230
|
+
},
|
|
92231
|
+
getTarget() {
|
|
92232
|
+
return this.hiprintTemplate;
|
|
92233
|
+
},
|
|
92234
|
+
getInitialTemplate() {
|
|
92235
|
+
try {
|
|
92236
|
+
const Me = `vg-designer:${this.templateKey}`, Ce = localStorage.getItem(Me);
|
|
92237
|
+
if (Ce) return JSON.parse(Ce);
|
|
92238
|
+
} catch {
|
|
92239
|
+
}
|
|
92240
|
+
return this.template || {};
|
|
92241
|
+
},
|
|
92242
|
+
persistTemplate() {
|
|
92243
|
+
try {
|
|
92244
|
+
if (!this.hiprintTemplate) return;
|
|
92245
|
+
const Me = `vg-designer:${this.templateKey}`, Ce = this.hiprintTemplate.getJson();
|
|
92246
|
+
localStorage.setItem(Me, JSON.stringify(Ce));
|
|
92247
|
+
} catch {
|
|
92248
|
+
}
|
|
92249
|
+
},
|
|
92250
|
+
bindPersist() {
|
|
92251
|
+
try {
|
|
92252
|
+
const Me = window.hinnn && window.hinnn.event, Ce = this.hiprintTemplate && this.hiprintTemplate.getPrintElementSelectEventKey && this.hiprintTemplate.getPrintElementSelectEventKey();
|
|
92253
|
+
Me && Ce && (Me.on(Ce, () => this.persistTemplateDebounced()), Me.on("clearSettingContainer", () => this.persistTemplateDebounced()));
|
|
92254
|
+
} catch {
|
|
92255
|
+
}
|
|
92256
|
+
},
|
|
92257
|
+
debounce(Me, Ce) {
|
|
92258
|
+
let Ee;
|
|
92259
|
+
return function(...Be) {
|
|
92260
|
+
clearTimeout(Ee), Ee = setTimeout(() => Me.apply(this, Be), Ce);
|
|
92261
|
+
};
|
|
92262
|
+
}
|
|
92263
|
+
}
|
|
92264
|
+
}, _hoisted_1$2 = { class: "vg-designer" }, _hoisted_2$1 = { class: "vg-designer-body" }, _hoisted_3$1 = { class: "vg-center" }, _hoisted_4$1 = { class: "header-actions" }, _hoisted_5$1 = { class: "prop-body hinnn-layout-sider" };
|
|
92265
|
+
function _sfc_render$2(Me, Ce, Ee, Be, Pe, Te) {
|
|
92266
|
+
const je = resolveComponent("SecondaryToolbar"), De = resolveComponent("HipStructureList"), Ue = resolveComponent("HistoryPanel"), He = resolveComponent("Preview");
|
|
92267
|
+
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
92268
|
+
renderSlot(Me.$slots, "header", {}, void 0, !0),
|
|
92269
|
+
Ee.showToolbar && Pe.hiprintTemplate ? (openBlock(), createBlock(je, {
|
|
92270
|
+
key: 0,
|
|
92271
|
+
template: Pe.hiprintTemplate,
|
|
92272
|
+
onToggleStructure: Ce[0] || (Ce[0] = (Re) => Pe.showStructureList = !Pe.showStructureList),
|
|
92273
|
+
onToggleHistory: Ce[1] || (Ce[1] = (Re) => Pe.showHistory = !Pe.showHistory),
|
|
92274
|
+
onTogglePalette: Ce[2] || (Ce[2] = (Re) => Pe.propVisible = !Pe.propVisible)
|
|
92275
|
+
}, null, 8, ["template"])) : createCommentVNode("", !0),
|
|
92276
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
92277
|
+
Ce[12] || (Ce[12] = createElementVNode("div", { class: "vg-left" }, [
|
|
92278
|
+
createElementVNode("div", { class: "hiprintEpContainer rect-printElement-types" })
|
|
92279
|
+
], -1)),
|
|
92280
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
92281
|
+
Ce[10] || (Ce[10] = createElementVNode("div", {
|
|
92282
|
+
id: "hiprint-printTemplate",
|
|
92283
|
+
class: "hiprint-printTemplate"
|
|
92284
|
+
}, null, -1)),
|
|
92285
|
+
Ce[11] || (Ce[11] = createElementVNode("div", { class: "hiprint-printPagination" }, null, -1)),
|
|
92286
|
+
renderSlot(Me.$slots, "other", {}, void 0, !0),
|
|
92287
|
+
Pe.showStructureList && Pe.hiprintTemplate ? (openBlock(), createBlock(De, {
|
|
92288
|
+
key: 0,
|
|
92289
|
+
template: Pe.hiprintTemplate,
|
|
92290
|
+
onClose: Ce[3] || (Ce[3] = (Re) => Pe.showStructureList = !1)
|
|
92291
|
+
}, null, 8, ["template"])) : createCommentVNode("", !0),
|
|
92292
|
+
Pe.showHistory && Pe.hiprintTemplate ? (openBlock(), createBlock(Ue, {
|
|
92293
|
+
key: 1,
|
|
92294
|
+
template: Pe.hiprintTemplate,
|
|
92295
|
+
onClose: Ce[4] || (Ce[4] = (Re) => Pe.showHistory = !1)
|
|
92296
|
+
}, null, 8, ["template"])) : createCommentVNode("", !0)
|
|
92297
|
+
])
|
|
92298
|
+
]),
|
|
92299
|
+
withDirectives(createElementVNode("div", {
|
|
92300
|
+
class: "prop-floating",
|
|
92301
|
+
style: normalizeStyle(Pe.propStyle)
|
|
92302
|
+
}, [
|
|
92303
|
+
createElementVNode("div", {
|
|
92304
|
+
class: "prop-header",
|
|
92305
|
+
onMousedown: Ce[9] || (Ce[9] = withModifiers((...Re) => Te.startDragProp && Te.startDragProp(...Re), ["prevent"]))
|
|
92306
|
+
}, [
|
|
92307
|
+
Ce[14] || (Ce[14] = createElementVNode("span", { class: "title" }, "属性", -1)),
|
|
92308
|
+
createElementVNode("div", _hoisted_4$1, [
|
|
92309
|
+
createElementVNode("button", {
|
|
92310
|
+
class: "icon-btn",
|
|
92311
|
+
onMousedown: Ce[5] || (Ce[5] = withModifiers(() => {
|
|
92312
|
+
}, ["stop", "prevent"])),
|
|
92313
|
+
onClick: Ce[6] || (Ce[6] = withModifiers((Re) => Pe.propCollapsed = !Pe.propCollapsed, ["stop"]))
|
|
92314
|
+
}, [
|
|
92315
|
+
createElementVNode("i", {
|
|
92316
|
+
class: normalizeClass(["iconfont", Pe.propCollapsed ? "icon-zhankai" : "icon-shousuo"])
|
|
92317
|
+
}, null, 2)
|
|
92318
|
+
], 32),
|
|
92319
|
+
createElementVNode("button", {
|
|
92320
|
+
class: "icon-btn",
|
|
92321
|
+
onMousedown: Ce[7] || (Ce[7] = withModifiers(() => {
|
|
92322
|
+
}, ["stop", "prevent"])),
|
|
92323
|
+
onClick: Ce[8] || (Ce[8] = withModifiers((Re) => Pe.propVisible = !1, ["stop"]))
|
|
92324
|
+
}, [...Ce[13] || (Ce[13] = [
|
|
92325
|
+
createElementVNode("i", { class: "iconfont icon-guanbi" }, null, -1)
|
|
92326
|
+
])], 32)
|
|
92327
|
+
])
|
|
92328
|
+
], 32),
|
|
92329
|
+
withDirectives(createElementVNode("div", _hoisted_5$1, [...Ce[15] || (Ce[15] = [
|
|
92330
|
+
createElementVNode("div", { id: "PrintElementOptionSetting" }, null, -1)
|
|
92331
|
+
])], 512), [
|
|
92332
|
+
[vShow, !Pe.propCollapsed]
|
|
92333
|
+
])
|
|
92334
|
+
], 4), [
|
|
92335
|
+
[vShow, Pe.propVisible]
|
|
92336
|
+
]),
|
|
92337
|
+
createVNode(He, {
|
|
92338
|
+
ref: "previewRef",
|
|
92339
|
+
showPdf: Ee.showPdf,
|
|
92340
|
+
showImg: Ee.showImg,
|
|
92341
|
+
showPrint2: Ee.showPrint2
|
|
92342
|
+
}, null, 8, ["showPdf", "showImg", "showPrint2"])
|
|
92343
|
+
]);
|
|
92344
|
+
}
|
|
92345
|
+
const Designer = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-ce1915d7"]]), _sfc_main$1 = {
|
|
92346
|
+
name: "Header",
|
|
92347
|
+
props: {
|
|
92348
|
+
logoHtml: { type: String, default: '<i class="svp-header-logo svicon sv-print"></i>' },
|
|
92349
|
+
title: { type: String, default: "sv-print" },
|
|
92350
|
+
reEle: { type: Boolean, default: !1 },
|
|
92351
|
+
eleList: { type: Array, default: () => [] },
|
|
92352
|
+
reMenu: { type: Boolean, default: !1 },
|
|
92353
|
+
menuList: { type: Array, default: () => [] },
|
|
92354
|
+
onPreviewClick: { type: Function, default: null }
|
|
92355
|
+
},
|
|
92356
|
+
methods: {
|
|
92357
|
+
onPreviewClickInner(Me) {
|
|
92358
|
+
if (!(typeof this.onPreviewClick == "function" && this.onPreviewClick(Me) === !0)) {
|
|
92359
|
+
this.$emit("preview");
|
|
92360
|
+
try {
|
|
92361
|
+
window.dispatchEvent(new CustomEvent("vg-print-preview"));
|
|
92362
|
+
} catch {
|
|
92363
|
+
}
|
|
92364
|
+
}
|
|
92365
|
+
}
|
|
92366
|
+
}
|
|
92367
|
+
}, _hoisted_1$1 = { class: "vg-header" }, _hoisted_2 = { class: "left" }, _hoisted_3 = ["innerHTML"], _hoisted_4 = { class: "title" }, _hoisted_5 = { class: "center" }, _hoisted_6 = { class: "right" };
|
|
92368
|
+
function _sfc_render$1(Me, Ce, Ee, Be, Pe, Te) {
|
|
92369
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
92370
|
+
createElementVNode("div", _hoisted_2, [
|
|
92371
|
+
renderSlot(Me.$slots, "headerLeft", {}, () => [
|
|
92372
|
+
createElementVNode("span", {
|
|
92373
|
+
class: "logo",
|
|
92374
|
+
innerHTML: Ee.logoHtml
|
|
92375
|
+
}, null, 8, _hoisted_3),
|
|
92376
|
+
createElementVNode("span", _hoisted_4, toDisplayString$1(Ee.title), 1)
|
|
92377
|
+
], !0)
|
|
92378
|
+
]),
|
|
92379
|
+
createElementVNode("div", _hoisted_5, [
|
|
92380
|
+
renderSlot(Me.$slots, "headerCenter", {}, void 0, !0)
|
|
92381
|
+
]),
|
|
92382
|
+
createElementVNode("div", _hoisted_6, [
|
|
92383
|
+
renderSlot(Me.$slots, "headerRight", {}, () => [
|
|
92384
|
+
createElementVNode("button", {
|
|
92385
|
+
class: "btn",
|
|
92386
|
+
onClick: Ce[0] || (Ce[0] = (...je) => Te.onPreviewClickInner && Te.onPreviewClickInner(...je))
|
|
92387
|
+
}, "预览")
|
|
92388
|
+
], !0)
|
|
92389
|
+
])
|
|
92390
|
+
]);
|
|
92391
|
+
}
|
|
92392
|
+
const Header = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-b599272c"]]), _sfc_main = {
|
|
92362
92393
|
name: "DragBox",
|
|
92363
92394
|
props: {
|
|
92364
92395
|
target: { type: String, default: "SVPrint" },
|