vg-print 1.0.302 → 1.0.304

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.
@@ -30636,11 +30636,11 @@ const defaultOption = {
30636
30636
  // 水印文字水平对齐方式
30637
30637
  textBaseline: "middle",
30638
30638
  // 水印文字垂直对齐方式
30639
- fontSize: "14px",
30639
+ fontSize: "16px",
30640
30640
  // 水印文字大小
30641
30641
  fontFamily: "Microsoft Yahei",
30642
30642
  // 水印文字字体
30643
- fillStyle: "rgba(184, 184, 184, 0.3)",
30643
+ fillStyle: "rgba(87, 13, 248, 0.5)",
30644
30644
  // 水印文字颜色
30645
30645
  rotate: 25,
30646
30646
  // 水印文字旋转角度
@@ -60346,7 +60346,7 @@ ${i18n$1.__("转大小写")}
60346
60346
  watch: Ie,
60347
60347
  container: Be.target[0]
60348
60348
  });
60349
- Ee.container && (Ee.content ? (Ie && watermark.destroyWatermark(Object.assign({}, Ee, {
60349
+ Ee.container && (Ee.content || (Ie || typeof window < "u" && window.hiprint && !window.hiprint._authKey) && (Ee.content = "vg-print", Ee.timestamp = Ee.timestamp == null ? !0 : Ee.timestamp), Ee.content ? (Ie && watermark.destroyWatermark(Object.assign({}, Ee, {
60350
60350
  id: `${Be.templateId}_${Be.panelIdx}_${Ae || 1}_${Be.index}`
60351
60351
  })), watermark.createWatermark(Ee)) : watermark.destroyWatermark(Ee));
60352
60352
  }, t.prototype.displayHeight = function() {
@@ -65480,7 +65480,7 @@ ${i18n$1.__("转大小写")}
65480
65480
  }
65481
65481
  };
65482
65482
  })();
65483
- const version = "1.0.302";
65483
+ const version = "1.0.304";
65484
65484
  let autoConnect = function(Ie) {
65485
65485
  console.log("autoConnect"), window.autoConnect = !0, window.hiwebSocket && window.hiwebSocket.hasIo() && window.hiwebSocket.start(Ie);
65486
65486
  }, disAutoConnect = function() {
@@ -65599,7 +65599,21 @@ function getPrinterList(Ie) {
65599
65599
  return Array.isArray(je) ? je : [];
65600
65600
  }
65601
65601
  function setHiwebSocket(Ie, Ae, je) {
65602
- return hiprint.hiwebSocket.setHost(Ie, Ae, je);
65602
+ try {
65603
+ typeof Ae == "function" && (je = Ae, Ae = void 0), hiprint.hiwebSocket.host = Ie, hiprint.hiwebSocket.token = Ae;
65604
+ try {
65605
+ hiprint.hiwebSocket.stop();
65606
+ } catch {
65607
+ }
65608
+ if (window.autoConnect)
65609
+ try {
65610
+ hiprint.hiwebSocket.start(je);
65611
+ } catch {
65612
+ }
65613
+ return !0;
65614
+ } catch {
65615
+ return !1;
65616
+ }
65603
65617
  }
65604
65618
  function connect(Ie) {
65605
65619
  return hiprint.hiwebSocket.start(Ie);
@@ -79187,117 +79201,120 @@ b`.split(/\n/).length != 3 ? function(Fe) {
79187
79201
  });
79188
79202
  }(codemirror)), codemirror.exports;
79189
79203
  }
79190
- (function(Ie, Ae) {
79191
- (function(je) {
79192
- je(requireCodemirror());
79193
- })(function(je) {
79194
- function Be(Pe, De, Ue, He) {
79195
- if (Ue && Ue.call) {
79196
- var Ge = Ue;
79197
- Ue = null;
79198
- } else
79199
- var Ge = Te(Pe, Ue, "rangeFinder");
79200
- typeof De == "number" && (De = je.Pos(De, 0));
79201
- var Oe = Te(Pe, Ue, "minFoldSize");
79202
- function Qe(Ke) {
79203
- var rr = Ge(Pe, De);
79204
- if (!rr || rr.to.line - rr.from.line < Oe) return null;
79205
- if (He === "fold") return rr;
79206
- for (var or = Pe.findMarksAt(rr.from), er = 0; er < or.length; ++er)
79207
- if (or[er].__isFold) {
79208
- if (!Ke) return null;
79209
- rr.cleared = !0, or[er].clear();
79210
- }
79211
- return rr;
79212
- }
79213
- var Ye = Qe(!0);
79214
- if (Te(Pe, Ue, "scanUp")) for (; !Ye && De.line > Pe.firstLine(); )
79215
- De = je.Pos(De.line - 1, 0), Ye = Qe(!1);
79216
- if (!(!Ye || Ye.cleared || He === "unfold")) {
79217
- var Je = Ee(Pe, Ue, Ye);
79218
- je.on(Je, "mousedown", function(Ke) {
79219
- St.clear(), je.e_preventDefault(Ke);
79204
+ var hasRequiredFoldcode;
79205
+ function requireFoldcode() {
79206
+ return hasRequiredFoldcode || (hasRequiredFoldcode = 1, function(Ie, Ae) {
79207
+ (function(je) {
79208
+ je(requireCodemirror());
79209
+ })(function(je) {
79210
+ function Be(Pe, De, Ue, He) {
79211
+ if (Ue && Ue.call) {
79212
+ var Ge = Ue;
79213
+ Ue = null;
79214
+ } else
79215
+ var Ge = Te(Pe, Ue, "rangeFinder");
79216
+ typeof De == "number" && (De = je.Pos(De, 0));
79217
+ var Oe = Te(Pe, Ue, "minFoldSize");
79218
+ function Qe(Ke) {
79219
+ var rr = Ge(Pe, De);
79220
+ if (!rr || rr.to.line - rr.from.line < Oe) return null;
79221
+ if (He === "fold") return rr;
79222
+ for (var or = Pe.findMarksAt(rr.from), er = 0; er < or.length; ++er)
79223
+ if (or[er].__isFold) {
79224
+ if (!Ke) return null;
79225
+ rr.cleared = !0, or[er].clear();
79226
+ }
79227
+ return rr;
79228
+ }
79229
+ var Ye = Qe(!0);
79230
+ if (Te(Pe, Ue, "scanUp")) for (; !Ye && De.line > Pe.firstLine(); )
79231
+ De = je.Pos(De.line - 1, 0), Ye = Qe(!1);
79232
+ if (!(!Ye || Ye.cleared || He === "unfold")) {
79233
+ var Je = Ee(Pe, Ue, Ye);
79234
+ je.on(Je, "mousedown", function(Ke) {
79235
+ St.clear(), je.e_preventDefault(Ke);
79236
+ });
79237
+ var St = Pe.markText(Ye.from, Ye.to, {
79238
+ replacedWith: Je,
79239
+ clearOnEnter: Te(Pe, Ue, "clearOnEnter"),
79240
+ __isFold: !0
79241
+ });
79242
+ St.on("clear", function(Ke, rr) {
79243
+ je.signal(Pe, "unfold", Pe, Ke, rr);
79244
+ }), je.signal(Pe, "fold", Pe, Ye.from, Ye.to);
79245
+ }
79246
+ }
79247
+ function Ee(Pe, De, Ue) {
79248
+ var He = Te(Pe, De, "widget");
79249
+ if (typeof He == "function" && (He = He(Ue.from, Ue.to)), typeof He == "string") {
79250
+ var Ge = document.createTextNode(He);
79251
+ He = document.createElement("span"), He.appendChild(Ge), He.className = "CodeMirror-foldmarker";
79252
+ } else He && (He = He.cloneNode(!0));
79253
+ return He;
79254
+ }
79255
+ je.newFoldFunction = function(Pe, De) {
79256
+ return function(Ue, He) {
79257
+ Be(Ue, He, { rangeFinder: Pe, widget: De });
79258
+ };
79259
+ }, je.defineExtension("foldCode", function(Pe, De, Ue) {
79260
+ Be(this, Pe, De, Ue);
79261
+ }), je.defineExtension("isFolded", function(Pe) {
79262
+ for (var De = this.findMarksAt(Pe), Ue = 0; Ue < De.length; ++Ue)
79263
+ if (De[Ue].__isFold) return !0;
79264
+ }), je.commands.toggleFold = function(Pe) {
79265
+ Pe.foldCode(Pe.getCursor());
79266
+ }, je.commands.fold = function(Pe) {
79267
+ Pe.foldCode(Pe.getCursor(), null, "fold");
79268
+ }, je.commands.unfold = function(Pe) {
79269
+ Pe.foldCode(Pe.getCursor(), { scanUp: !1 }, "unfold");
79270
+ }, je.commands.foldAll = function(Pe) {
79271
+ Pe.operation(function() {
79272
+ for (var De = Pe.firstLine(), Ue = Pe.lastLine(); De <= Ue; De++)
79273
+ Pe.foldCode(je.Pos(De, 0), { scanUp: !1 }, "fold");
79220
79274
  });
79221
- var St = Pe.markText(Ye.from, Ye.to, {
79222
- replacedWith: Je,
79223
- clearOnEnter: Te(Pe, Ue, "clearOnEnter"),
79224
- __isFold: !0
79275
+ }, je.commands.unfoldAll = function(Pe) {
79276
+ Pe.operation(function() {
79277
+ for (var De = Pe.firstLine(), Ue = Pe.lastLine(); De <= Ue; De++)
79278
+ Pe.foldCode(je.Pos(De, 0), { scanUp: !1 }, "unfold");
79225
79279
  });
79226
- St.on("clear", function(Ke, rr) {
79227
- je.signal(Pe, "unfold", Pe, Ke, rr);
79228
- }), je.signal(Pe, "fold", Pe, Ye.from, Ye.to);
79229
- }
79230
- }
79231
- function Ee(Pe, De, Ue) {
79232
- var He = Te(Pe, De, "widget");
79233
- if (typeof He == "function" && (He = He(Ue.from, Ue.to)), typeof He == "string") {
79234
- var Ge = document.createTextNode(He);
79235
- He = document.createElement("span"), He.appendChild(Ge), He.className = "CodeMirror-foldmarker";
79236
- } else He && (He = He.cloneNode(!0));
79237
- return He;
79238
- }
79239
- je.newFoldFunction = function(Pe, De) {
79240
- return function(Ue, He) {
79241
- Be(Ue, He, { rangeFinder: Pe, widget: De });
79242
- };
79243
- }, je.defineExtension("foldCode", function(Pe, De, Ue) {
79244
- Be(this, Pe, De, Ue);
79245
- }), je.defineExtension("isFolded", function(Pe) {
79246
- for (var De = this.findMarksAt(Pe), Ue = 0; Ue < De.length; ++Ue)
79247
- if (De[Ue].__isFold) return !0;
79248
- }), je.commands.toggleFold = function(Pe) {
79249
- Pe.foldCode(Pe.getCursor());
79250
- }, je.commands.fold = function(Pe) {
79251
- Pe.foldCode(Pe.getCursor(), null, "fold");
79252
- }, je.commands.unfold = function(Pe) {
79253
- Pe.foldCode(Pe.getCursor(), { scanUp: !1 }, "unfold");
79254
- }, je.commands.foldAll = function(Pe) {
79255
- Pe.operation(function() {
79256
- for (var De = Pe.firstLine(), Ue = Pe.lastLine(); De <= Ue; De++)
79257
- Pe.foldCode(je.Pos(De, 0), { scanUp: !1 }, "fold");
79258
- });
79259
- }, je.commands.unfoldAll = function(Pe) {
79260
- Pe.operation(function() {
79261
- for (var De = Pe.firstLine(), Ue = Pe.lastLine(); De <= Ue; De++)
79262
- Pe.foldCode(je.Pos(De, 0), { scanUp: !1 }, "unfold");
79263
- });
79264
- }, je.registerHelper("fold", "combine", function() {
79265
- var Pe = Array.prototype.slice.call(arguments, 0);
79266
- return function(De, Ue) {
79267
- for (var He = 0; He < Pe.length; ++He) {
79268
- var Ge = Pe[He](De, Ue);
79280
+ }, je.registerHelper("fold", "combine", function() {
79281
+ var Pe = Array.prototype.slice.call(arguments, 0);
79282
+ return function(De, Ue) {
79283
+ for (var He = 0; He < Pe.length; ++He) {
79284
+ var Ge = Pe[He](De, Ue);
79285
+ if (Ge) return Ge;
79286
+ }
79287
+ };
79288
+ }), je.registerHelper("fold", "auto", function(Pe, De) {
79289
+ for (var Ue = Pe.getHelpers(De, "fold"), He = 0; He < Ue.length; He++) {
79290
+ var Ge = Ue[He](Pe, De);
79269
79291
  if (Ge) return Ge;
79270
79292
  }
79293
+ });
79294
+ var Se = {
79295
+ rangeFinder: je.fold.auto,
79296
+ widget: "↔",
79297
+ minFoldSize: 0,
79298
+ scanUp: !1,
79299
+ clearOnEnter: !0
79271
79300
  };
79272
- }), je.registerHelper("fold", "auto", function(Pe, De) {
79273
- for (var Ue = Pe.getHelpers(De, "fold"), He = 0; He < Ue.length; He++) {
79274
- var Ge = Ue[He](Pe, De);
79275
- if (Ge) return Ge;
79276
- }
79277
- });
79278
- var Se = {
79279
- rangeFinder: je.fold.auto,
79280
- widget: "↔",
79281
- minFoldSize: 0,
79282
- scanUp: !1,
79283
- clearOnEnter: !0
79284
- };
79285
- je.defineOption("foldOptions", null);
79286
- function Te(Pe, De, Ue) {
79287
- if (De && De[Ue] !== void 0)
79288
- return De[Ue];
79289
- var He = Pe.options.foldOptions;
79290
- return He && He[Ue] !== void 0 ? He[Ue] : Se[Ue];
79291
- }
79292
- je.defineExtension("foldOption", function(Pe, De) {
79293
- return Te(this, Pe, De);
79301
+ je.defineOption("foldOptions", null);
79302
+ function Te(Pe, De, Ue) {
79303
+ if (De && De[Ue] !== void 0)
79304
+ return De[Ue];
79305
+ var He = Pe.options.foldOptions;
79306
+ return He && He[Ue] !== void 0 ? He[Ue] : Se[Ue];
79307
+ }
79308
+ je.defineExtension("foldOption", function(Pe, De) {
79309
+ return Te(this, Pe, De);
79310
+ });
79294
79311
  });
79295
- });
79296
- })();
79297
- var foldcodeExports = foldcode.exports;
79312
+ }()), foldcode.exports;
79313
+ }
79314
+ requireFoldcode();
79298
79315
  (function(Ie, Ae) {
79299
79316
  (function(je) {
79300
- je(requireCodemirror(), foldcodeExports);
79317
+ je(requireCodemirror(), requireFoldcode());
79301
79318
  })(function(je) {
79302
79319
  je.defineOption("foldGutter", !1, function(St, Ke, rr) {
79303
79320
  rr && rr != je.Init && (St.clearGutter(St.state.foldGutter.options.gutter), St.state.foldGutter = null, St.off("gutterClick", Ge), St.off("changes", Qe), St.off("viewportChange", Ye), St.off("fold", Je), St.off("unfold", Je), St.off("swapDoc", Qe), St.off("optionChange", Oe)), Ke && (St.state.foldGutter = new Ee(Se(Ke)), He(St), St.on("gutterClick", Ge), St.on("changes", Qe), St.on("viewportChange", Ye), St.on("fold", Je), St.on("unfold", Je), St.on("swapDoc", Qe), St.on("optionChange", Oe));
@@ -85366,7 +85383,7 @@ const t = (Ie) => i18n && i18n.global && typeof i18n.global.t == "function" ? i1
85366
85383
  paperNumberContinue: !0,
85367
85384
  watermarkOptions: {
85368
85385
  content: "",
85369
- fillStyle: "rgba(184, 184, 184, 0.3)",
85386
+ fillStyle: "rgba(87, 13, 248, 0.5)",
85370
85387
  fontSize: "14px",
85371
85388
  rotate: 25,
85372
85389
  width: 200,
@@ -86815,7 +86832,11 @@ const _sfc_main = {
86815
86832
  const Ie = !(typeof window < "u" && window.autoConnect === !1);
86816
86833
  (this.hiAutoConnect === !1 ? !1 : Ie) ? autoConnect() : disAutoConnect();
86817
86834
  const je = this.hiHost || hiprint.hiwebSocket.host, Be = this.hiToken || hiprint.hiwebSocket.token;
86818
- (this.hiHost || this.hiToken) && hiprint.hiwebSocket.setHost(je, Be);
86835
+ if (this.hiHost || this.hiToken)
86836
+ try {
86837
+ this.setHiwebSocket(je, Be);
86838
+ } catch {
86839
+ }
86819
86840
  const Se = {
86820
86841
  cn: "zh_CN",
86821
86842
  cn_tw: "zh_TW",
@@ -86838,13 +86859,13 @@ const _sfc_main = {
86838
86859
  watch: {
86839
86860
  hiHost(Ie) {
86840
86861
  try {
86841
- hiprint.hiwebSocket.setHost(Ie || hiprint.hiwebSocket.host, this.hiToken || hiprint.hiwebSocket.token);
86862
+ this.setHiwebSocket(Ie || hiprint.hiwebSocket.host, this.hiToken || hiprint.hiwebSocket.token);
86842
86863
  } catch {
86843
86864
  }
86844
86865
  },
86845
86866
  hiToken(Ie) {
86846
86867
  try {
86847
- hiprint.hiwebSocket.setHost(this.hiHost || hiprint.hiwebSocket.host, Ie || hiprint.hiwebSocket.token);
86868
+ this.setHiwebSocket(this.hiHost || hiprint.hiwebSocket.host, Ie || hiprint.hiwebSocket.token);
86848
86869
  } catch {
86849
86870
  }
86850
86871
  },
@@ -86997,10 +87018,7 @@ const _sfc_main = {
86997
87018
  //fields: [{"text":'姓名1',"field":'name'},{"text":'性别1',"field":'gender'}],
86998
87019
  // fontList: [{"title":'微软雅黑',"value":'Microsoft YaHei'}], // 自定义字体
86999
87020
  defaultPanelName: i18n.global.t("hiprintMeta.defaultPanelName"),
87000
- watermarkOptions: hiprint._authKey ? void 0 : {
87001
- content: "vg-print",
87002
- timestamp: !0
87003
- }
87021
+ watermarkOptions: {}
87004
87022
  /*onPanelAddClick: (panel, createPanel) => {
87005
87023
  panel.name = '新面板' + (panel.index + 1);
87006
87024
  that.$message.success('弹出个东西,让你们知道,在这里可以自定义面板名称');
@@ -87191,7 +87209,16 @@ const _sfc_main = {
87191
87209
  },
87192
87210
  setHiwebSocket(Ie, Ae, je) {
87193
87211
  try {
87194
- hiprint.hiwebSocket.setHost(Ie, Ae, je);
87212
+ typeof Ae == "function" && (je = Ae, Ae = void 0), hiprint.hiwebSocket.host = Ie, hiprint.hiwebSocket.token = Ae;
87213
+ try {
87214
+ hiprint.hiwebSocket.stop();
87215
+ } catch {
87216
+ }
87217
+ if (window.autoConnect)
87218
+ try {
87219
+ hiprint.hiwebSocket.start(je);
87220
+ } catch {
87221
+ }
87195
87222
  } catch {
87196
87223
  }
87197
87224
  },
@@ -87978,7 +88005,7 @@ function _sfc_render(Ie, Ae, je, Be, Ee, Se) {
87978
88005
  }, null, 8, ["template", "onApply"])
87979
88006
  ], 64);
87980
88007
  }
87981
- const FullDesigner = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-9c8237ca"]]), index = {
88008
+ const FullDesigner = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-76b9d8c5"]]), index = {
87982
88009
  install(Ie) {
87983
88010
  Ie.component("FullDesigner", FullDesigner);
87984
88011
  try {