hoeditor-web 3.2.28 → 3.2.32

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/lib/hoeditor.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import "vue";
2
- import { H as i, d as r, b as e, a as l, e as t, T as H, f as d, i as f } from "./index-CkGezwsU.mjs";
2
+ import { H as i, d as r, b as e, a as l, e as t, T as H, f as d, i as f } from "./index-DwjHgIT9.mjs";
3
3
  export {
4
4
  i as HoDocs,
5
5
  r as HoEditorProvide,
@@ -5393,7 +5393,7 @@ class CombineStyle {
5393
5393
  r *= this.scale;
5394
5394
  break;
5395
5395
  }
5396
- let o = this._bold ? "bold " : "", n = this.font.replace(/宋体|黑体|微软雅黑/g, "SimSun");
5396
+ let o = this._bold ? "bold " : "", n = this.font.replace(/宋体|黑体|微软雅黑/g, "SimSun").replace(/仿宋/g, "FangSong");
5397
5397
  return this.font == "黑体" && (o = "bold "), (this._italic ? "italic " : "") + o + r + "px " + n;
5398
5398
  }
5399
5399
  /**
@@ -10414,7 +10414,7 @@ let TableFormula$1 = class _TableFormula extends ControlNode {
10414
10414
  if (m >= 0 && g >= 0 && m < d.rowCount && g < d.colCount) {
10415
10415
  const [v, C] = this.getCellNumber(d, m, g);
10416
10416
  if (v)
10417
- isNaN(Number(C)) ? s[f] = "0" : s[f] = Number(C).toString().replace(/\+|-/g, "");
10417
+ C.trim() == "" ? s[f] = "" : isNaN(Number(C)) ? s[f] = "0" : s[f] = Number(C).toString().replace(/\+|-/g, "");
10418
10418
  else {
10419
10419
  u = !1;
10420
10420
  break;
@@ -10426,7 +10426,7 @@ let TableFormula$1 = class _TableFormula extends ControlNode {
10426
10426
  else
10427
10427
  this._cellRange.push([y, w]);
10428
10428
  }
10429
- if (!t)
10429
+ if (!t || s.filter(Boolean).length == 0)
10430
10430
  return " ";
10431
10431
  if (u) {
10432
10432
  const f = HOEditorFactorys.instance().getFactory(this._hoEditorFactoryID);
@@ -10626,32 +10626,43 @@ let TableFormula$1 = class _TableFormula extends ControlNode {
10626
10626
  }
10627
10627
  return t;
10628
10628
  }
10629
+ getHeightNum(t) {
10630
+ if (t) {
10631
+ const r = this.getParentCell().table;
10632
+ let o = 0;
10633
+ const [n, s] = this.getRowColByCellAdress(t);
10634
+ if (n >= 0 && s >= 0 && r.rows[n] && r.rows[n][s]) {
10635
+ const [c, d] = this.getCellNumber(r, n, s);
10636
+ if (c && d)
10637
+ return o = Number(d), o;
10638
+ }
10639
+ }
10640
+ return !1;
10641
+ }
10629
10642
  clacBodySurfaceArea() {
10630
10643
  let t = " ";
10631
10644
  const r = this.getParentCell().table;
10632
10645
  this.formulaStr == "" && message.warn(/* @__PURE__ */ i18nHelper("04-001-009-EMR.3.3.442", null, "体重的单元格编号传入有误:") + this.formulaStr);
10633
10646
  const o = this.formulaStr.split("__");
10634
- let n, s, l, c, d = 0;
10647
+ let n, s, l = 0;
10635
10648
  if (o[0] && ([n, s] = this.getRowColByCellAdress(o[0]), n >= 0 && s >= 0)) {
10636
10649
  if (!r.rows[n]) return t;
10637
10650
  if (r.rows[n][s]) {
10638
- const [f, p] = this.getCellNumber(r, n, s);
10639
- f && p && (d = Number(p));
10640
- }
10641
- }
10642
- if (o[2] != "1" && d) {
10643
- let u = 0;
10644
- return d > 30 ? u = 1.05 + (d - 30) * 0.02 : u = 0.035 * d + 0.1, u.toFixed(2);
10645
- } else if (d) {
10646
- let u = 0;
10647
- if (o[1] && ([l, c] = this.getRowColByCellAdress(o[1]), l >= 0 && c >= 0)) {
10648
- if (!r.rows[l]) return t;
10649
- if (r.rows[l][c]) {
10650
- const [p, m] = this.getCellNumber(r, l, c);
10651
- if (p && m)
10652
- return u = Number(m), (61e-4 * u + 0.0128 * d - 0.1529).toFixed(4);
10653
- }
10654
- }
10651
+ const [d, u] = this.getCellNumber(r, n, s);
10652
+ d && u && (l = Number(u));
10653
+ }
10654
+ }
10655
+ if (o[2] == "2") {
10656
+ const c = this.getHeightNum(o[1]);
10657
+ if (typeof c == "number" && l)
10658
+ return (7184e-6 * Math.pow(l, 0.425) * Math.pow(c, 0.725)).toFixed(4);
10659
+ } else if (o[2] != "1" && l) {
10660
+ let c = 0;
10661
+ return l > 30 ? c = 1.05 + (l - 30) * 0.02 : c = 0.035 * l + 0.1, c.toFixed(2);
10662
+ } else if (l) {
10663
+ const c = this.getHeightNum(o[1]);
10664
+ if (typeof c == "number")
10665
+ return (61e-4 * c + 0.0128 * l - 0.1529).toFixed(4);
10655
10666
  }
10656
10667
  return t;
10657
10668
  }
@@ -10689,18 +10700,13 @@ let TableFormula$1 = class _TableFormula extends ControlNode {
10689
10700
  let f = d.getCellText(), p = u.getCellText();
10690
10701
  if (!f || !p) return t;
10691
10702
  if (f.indexOf("年") >= 0 && f.indexOf("时") >= 0 && (f = dateFormat(f, "yyyy-MM-dd HH:mm:ss")), p.indexOf("年") >= 0 && p.indexOf("时") >= 0 && (p = dateFormat(p, "yyyy-MM-dd HH:mm:ss")), f.indexOf("年") >= 0 && f.indexOf("时") == -1 && (f = dateFormat(f, "yyyy/MM/dd")), p.indexOf("年") >= 0 && p.indexOf("时") == -1 && (p = dateFormat(p, "yyyy/MM/dd")), f.indexOf("-") >= 0 && f.indexOf(" ") == -1 && (f = dateFormat(f, "yyyy/MM/dd")), p.indexOf("-") >= 0 && p.indexOf(" ") == -1 && (p = dateFormat(p, "yyyy/MM/dd")), isDate(f) && isDate(p)) {
10692
- const m = new Date(f), g = new Date(p), y = m.getHours(), w = g.getHours();
10693
- if (y === 0 && w === 0) {
10694
- const v = Date.UTC(m.getFullYear(), m.getMonth(), m.getDate()), C = Date.UTC(g.getFullYear(), g.getMonth(), g.getDate()), _ = Math.abs(C - v);
10695
- let S = Math.floor(_ / (1e3 * 60 * 60 * 24));
10696
- return S == 0 && (S = 1), S.toString() + /* @__PURE__ */ i18nHelper("04-001-009-EMR.3.3.35", null, "天");
10697
- } else {
10698
- const v = g.getTime() - m.getTime();
10699
- if (v < 0) return "";
10700
- const C = Math.floor(v / (1e3 * 60)), _ = Math.floor(C / 60), S = C % 60, E = _ % 24, T = Math.floor(_ / 24);
10701
- let I = "";
10702
- return T > 0 && (I += `${T}天`), E > 0 && (I += `${E}小时`), (S > 0 || I === "") && (I += `${S}分钟`), I || "0";
10703
- }
10703
+ const m = new Date(f), g = new Date(p);
10704
+ m.getHours(), g.getHours();
10705
+ const y = g.getTime() - m.getTime();
10706
+ if (y < 0) return "";
10707
+ const w = Math.floor(y / (1e3 * 60)), v = Math.floor(w / 60), C = w % 60, _ = v % 24, S = Math.floor(v / 24);
10708
+ let E = "";
10709
+ return S > 0 && (E += `${S}天`), _ > 0 && (E += `${_}小时`), (C > 0 || E === "") && (E += `${C}分钟`), E || "0";
10704
10710
  }
10705
10711
  }
10706
10712
  }
@@ -14898,7 +14904,7 @@ class DrawSignNode extends DrawCombineNode {
14898
14904
  }
14899
14905
  }
14900
14906
  }
14901
- const version = "3.2.28";
14907
+ const version = "3.2.32";
14902
14908
  var FingerPosition = /* @__PURE__ */ ((a) => (a[a.left = 0] = "left", a[a.center = 1] = "center", a[a.right = 2] = "right", a))(FingerPosition || {});
14903
14909
  class SignNode extends BaseNode {
14904
14910
  constructor(hoEditorFactoryID, rootNodes, pNode, nodeType, number, type, name, signType, signFormat, signor, signTime, signTimeFormat, imgSrc, imgWidth, imgHeight, customProperty, isTemplate, styleIndex, connectMode, isFront, allowEditSignTime, fingerPrintSrc, fingerPosition, attribute, connectChar, otherProperties, dataId, associatedElement, isTemp, innerIdentifier) {
@@ -39605,23 +39611,30 @@ class HTMLconverter2 {
39605
39611
  }
39606
39612
  for (let y = 0; y < g.length; y++) {
39607
39613
  const w = new Array(), v = Array.from(g[y].children);
39608
- for (let C = 0; C < d; C++)
39609
- if (v[C]) {
39610
- const _ = parseInt(v[C].getAttribute("rowspan") || "1"), S = parseInt(v[C].getAttribute("colspan") || "1");
39611
- if (_ > 1)
39612
- for (let E = y + 1; E < y + _; E++)
39614
+ let C = [];
39615
+ for (let _ = 0; _ < v.length; _++) {
39616
+ const S = parseInt(v[_].getAttribute("colspan") || "1");
39617
+ if (C.push(v[_]), S > 1) {
39618
+ const E = Array(S - 1).fill(void 0);
39619
+ C = C.concat(E);
39620
+ }
39621
+ }
39622
+ for (let _ = 0; _ < d; _++)
39623
+ if (C[_]) {
39624
+ const S = parseInt(C[_].getAttribute("rowspan") || "1"), E = parseInt(C[_].getAttribute("colspan") || "1");
39625
+ if (S > 1)
39626
+ for (let T = y + 1; T < y + S; T++)
39613
39627
  f.push({
39614
- rowCount: E,
39615
- colCount: C
39628
+ rowCount: T,
39629
+ colCount: _
39616
39630
  });
39617
- if (S > 1)
39618
- for (let E = C + 1; E < C + S; E++)
39631
+ if (E > 1)
39632
+ for (let T = _ + 1; T < _ + E; T++)
39619
39633
  u.push({
39620
39634
  rowCount: y,
39621
- colCount: E
39635
+ colCount: T
39622
39636
  });
39623
- } else
39624
- v[C] = void 0;
39637
+ }
39625
39638
  w.push(...v), l.push(w);
39626
39639
  }
39627
39640
  }
@@ -64172,7 +64185,7 @@ WebPDecoder.prototype.getData = function() {
64172
64185
  (function(a) {
64173
64186
  function t() {
64174
64187
  return function() {
64175
- return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-DJ05PGDj.mjs");
64188
+ return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-C7GsGahP.mjs");
64176
64189
  }().catch(function(r) {
64177
64190
  return Promise.reject(new Error("Could not load canvg: " + r));
64178
64191
  }).then(function(r) {
@@ -65463,22 +65476,21 @@ class PrintController {
65463
65476
  })), f = f.then(() => new Promise((m) => {
65464
65477
  Print.createPDFBase64(this._hoEditorFactoryID, m, this.PDF);
65465
65478
  }));
65466
- const p = await f.then((m) => {
65467
- var y, w;
65468
- o.drawTree.paintStatus = s, o.vueController.openXml(l);
65469
- const g = this.PDF.internal.getNumberOfPages() - m;
65470
- if (g >= 2)
65471
- for (let v = 0; v < g; v++)
65472
- (y = this.PDF) == null || y.deletePage(1);
65473
- else g <= 1 && ((w = this.PDF) == null || w.deletePage(1));
65474
- return new Promise((v) => {
65475
- let C = "";
65476
- r == "url" ? C = this.PDF.output("bloburl") : C = this.PDF.output("datauristring"), t && t && t({
65479
+ const p = await f.then((m) => (o.drawTree.paintStatus = s, new Promise((g) => {
65480
+ o.vueController.openXml(l).then(() => {
65481
+ var v, C;
65482
+ const y = this.PDF.internal.getNumberOfPages() - m;
65483
+ if (y >= 2)
65484
+ for (let _ = 0; _ < y; _++)
65485
+ (v = this.PDF) == null || v.deletePage(1);
65486
+ else y <= 1 && ((C = this.PDF) == null || C.deletePage(1));
65487
+ let w = "";
65488
+ r == "url" ? w = this.PDF.output("bloburl") : w = this.PDF.output("datauristring"), t && t && t({
65477
65489
  page: m,
65478
- pdf: C.replace(/^data:application\/pdf;filename=generated.pdf;base64,/, "")
65479
- }), v(C);
65490
+ pdf: w.replace(/^data:application\/pdf;filename=generated.pdf;base64,/, "")
65491
+ }), g(w);
65480
65492
  });
65481
- });
65493
+ })));
65482
65494
  return p ? (setTimeout(() => {
65483
65495
  o.vueController.moveCaretToPath(n), this.clearJsPDF();
65484
65496
  }, 0), r == "url" ? p : p.replace(/^data:application\/pdf;filename=generated.pdf;base64,/, "")) : null;
@@ -76246,11 +76258,11 @@ var _sfc_render$S = function a() {
76246
76258
  }, expression: "item.range[1]" } }), r("span", { staticStyle: { padding: "0 10px" } }, [t._v(" :")]), r("a-input", { staticClass: "ft-score-mapping-input ft-score-mapping-textarea", staticStyle: { width: "173px" }, attrs: { type: "textarea", autocomplete: "off" }, model: { value: o.text, callback: function(s) {
76247
76259
  t.$set(o, "text", s);
76248
76260
  }, expression: "item.text" } })], 1);
76249
- }), r("li", [r("a-button", { on: { click: t.addFtScoreMappingItem } }, [r("a-icon", { staticStyle: { "font-size": "20px" }, attrs: { type: "folder-add" } })], 1)], 1)], 2)])]) : t.formula === "bodySurfaceArea" ? r("section", [t._m(0), r("a-radio-group", { staticStyle: { "font-size": "14px" }, attrs: { size: "large" }, model: { value: t.bodySurfaceAreaType, callback: function(o) {
76261
+ }), r("li", [r("a-button", { on: { click: t.addFtScoreMappingItem } }, [r("a-icon", { staticStyle: { "font-size": "20px" }, attrs: { type: "folder-add" } })], 1)], 1)], 2)])]) : t.formula === "bodySurfaceArea" ? r("section", [r("div", { staticStyle: { "line-height": "20px", "font-size": "14px" } }, [r("div", { directives: [{ name: "show", rawName: "v-show", value: t.bodySurfaceAreaType == "0", expression: "bodySurfaceAreaType == '0'" }] }, [r("p", { staticStyle: { "font-weight": "bold" } }, [t._v(" 体表面积公式1: ")]), r("p", [t._v(" ")]), r("p", { staticStyle: { "margin-bottom": "6px" } }, [t._v("体重 > 30kg "), r("a-tag", { attrs: { color: "blue" } }, [t._v("BSA (m²) = 1.05 + (体重(kg) - 30) * 0.02")])], 1), r("p", [t._v("体重 <= 30kg "), r("a-tag", { attrs: { color: "blue" } }, [t._v("BSA (m²) = 0.035 * 体重(kg) + 0.1")])], 1), r("p", [t._v(" ")])]), r("div", { directives: [{ name: "show", rawName: "v-show", value: t.bodySurfaceAreaType == "1", expression: "bodySurfaceAreaType == '1'" }] }, [t._m(0), r("p", [t._v(" ")]), r("p", [t._v("许文生公式(Mosteller 简化版): "), r("a-tag", { attrs: { color: "blue" } }, [t._v("BSA (m²) = 0.0061*身高 (cm) +0.0128*体重(kg) -0.1529")])], 1), r("p", [t._v(" ")])]), r("div", { directives: [{ name: "show", rawName: "v-show", value: t.bodySurfaceAreaType == "2", expression: "bodySurfaceAreaType == '2'" }] }, [r("p", { staticStyle: { "font-weight": "bold" } }, [t._v(" 体表面积公式3: ")]), r("p", [t._v(" ")]), r("p", [t._v("杜波依斯公式(DuBois): "), r("a-tag", { attrs: { color: "blue" } }, [t._v("BSA (m²) = 0.007184 * ( 体重(kg)"), r("sup", [t._v("0.425")]), t._v(" * 身高(cm)"), r("sup", [t._v("0.725")]), t._v(" )")])], 1), r("p", [t._v(" ")])])]), r("a-radio-group", { staticStyle: { "font-size": "14px" }, attrs: { size: "large" }, model: { value: t.bodySurfaceAreaType, callback: function(o) {
76250
76262
  t.bodySurfaceAreaType = o;
76251
- }, expression: "bodySurfaceAreaType" } }, [r("a-radio", { attrs: { value: "0" } }, [t._v("体表面积公式1")]), r("a-radio", { attrs: { value: "1" } }, [t._v("体表面积公式2"), r("span", { staticStyle: { color: "red" } }, [t._v("(推荐)")])])], 1), r("div", { staticClass: "ho-table-features-list" }, [r("p", [t._v(/* @__PURE__ */ i18nHelper("04-001-009-EMR.3.3.292", null, "体重"))]), r("a-input", { attrs: { autocomplete: "off", "addon-after": "kg" }, model: { value: t.bodySurfaceAreaWeight, callback: function(o) {
76263
+ }, expression: "bodySurfaceAreaType" } }, [r("a-radio", { attrs: { value: "0" } }, [t._v("体表面积公式1")]), r("a-radio", { attrs: { value: "1" } }, [t._v("体表面积公式2"), r("span", { staticStyle: { color: "red" } }, [t._v("(推荐)")])]), r("a-radio", { attrs: { value: "2" } }, [t._v("体表面积公式3")])], 1), r("div", { staticClass: "ho-table-features-list" }, [r("p", [t._v(/* @__PURE__ */ i18nHelper("04-001-009-EMR.3.3.292", null, "体重"))]), r("a-input", { attrs: { autocomplete: "off", "addon-after": "kg" }, model: { value: t.bodySurfaceAreaWeight, callback: function(o) {
76252
76264
  t.bodySurfaceAreaWeight = o;
76253
- }, expression: "bodySurfaceAreaWeight" } })], 1), t.bodySurfaceAreaType == "1" ? r("div", { staticClass: "ho-table-features-list" }, [r("p", [t._v(/* @__PURE__ */ i18nHelper("04-001-009-EMR.3.3.293", null, "身高"))]), r("a-input", { attrs: { autocomplete: "off", "addon-after": "cm" }, model: { value: t.bodySurfaceAreaHeight, callback: function(o) {
76265
+ }, expression: "bodySurfaceAreaWeight" } })], 1), t.bodySurfaceAreaType == "1" || t.bodySurfaceAreaType == "2" ? r("div", { staticClass: "ho-table-features-list" }, [r("p", [t._v(/* @__PURE__ */ i18nHelper("04-001-009-EMR.3.3.293", null, "身高"))]), r("a-input", { attrs: { autocomplete: "off", "addon-after": "cm" }, model: { value: t.bodySurfaceAreaHeight, callback: function(o) {
76254
76266
  t.bodySurfaceAreaHeight = o;
76255
76267
  }, expression: "bodySurfaceAreaHeight" } })], 1) : t._e()], 1) : t.formula === "idealWeight" ? r("section", [r("div", { staticStyle: { height: "36px", "line-height": "36px" } }, [t._v("示例:理想体重 = (身高cm)-105")]), r("div", { staticStyle: { height: "36px", "line-height": "36px" } }, [t._v("范围 = (0.9 * (身高(cm) - 105)) ~ (1.1 * (身高(cm) - 105)), 计算结果小于0时, 显示“?”")]), r("div", { staticClass: "ho-table-features-list" }, [r("span", { staticStyle: { "margin-right": "34px" } }, [t._v(/* @__PURE__ */ i18nHelper("04-001-009-EMR.3.3.293", null, "身高"))]), r("a-input", { attrs: { autocomplete: "off", "addon-after": "cm" }, model: { value: t.idealWeightHeight, callback: function(o) {
76256
76268
  t.idealWeightHeight = o;
@@ -76287,7 +76299,7 @@ var _sfc_render$S = function a() {
76287
76299
  }, expression: "curve.lineColor" } })], 1)]) : t._e()]), r("footer", { staticClass: "ho-modal-footer" }, [r("a-button", { attrs: { type: "primary" }, on: { click: t.sure } }, [t._v(/* @__PURE__ */ i18nHelper("04-001-009-EMR.3.3.347", null, "确定"))]), r("a-button", { staticStyle: { "margin-left": "30px" }, on: { click: t.handleClose } }, [t._v(/* @__PURE__ */ i18nHelper("04-001-009-EMR.3.3.346", null, "取消"))])], 1)]);
76288
76300
  }, _sfc_staticRenderFns$S = [function() {
76289
76301
  var a = this, t = a._self._c;
76290
- return t("div", { staticStyle: { "line-height": "20px", "font-size": "14px" } }, [t("p", [a._v(" 体表面积公式1 ")]), t("p", [a._v("体重>30kg 体表面积= 1.05 + (体重kg - 30) * 0.02")]), t("p", [a._v("体重<= 30kg 体表面积= 0.035 * 体重kg + 0.1")]), t("p", [a._v(" ")]), t("p", [a._v(" 体表面积公式2"), t("span", { staticStyle: { color: "red" } }, [a._v("(推荐)")])]), t("p", [a._v("BSA (m²) =0.0061*身高 (cm) +0.0128*体重(kg) -0.1529")]), t("p", [a._v(" ")])]);
76302
+ return t("p", { staticStyle: { "font-weight": "bold" } }, [a._v(" 体表面积公式2: "), t("span", { staticStyle: { color: "red" } }, [a._v("(推荐)")])]);
76291
76303
  }, function() {
76292
76304
  var a = this, t = a._self._c;
76293
76305
  return t("p", { staticStyle: { "margin-top": "10px" } }, [t("span", [a._v(/* @__PURE__ */ i18nHelper("04-001-009-EMR.3.3.254", null, "单元格编号"))]), a._v(":")]);
@@ -82947,6 +82959,16 @@ const HoDocs = __component__$s.exports, _sfc_main$r = defineComponent({
82947
82959
  { ch: "arial", en: "arial", family: "arial" },
82948
82960
  { ch: "Times New Roman", en: "Times New Roman", family: "Times New Roman" },
82949
82961
  { ch: "himalaya", en: "himalaya", family: "himalaya(藏语字体)" }
82962
+ // {
82963
+ // "ch": "仿宋",
82964
+ // "en": "FangSong",
82965
+ // "family": "仿宋, FangSong, STFangsong, serif"
82966
+ // },
82967
+ // {
82968
+ // "ch": "黑体",
82969
+ // "en": "SimHei",
82970
+ // "family": "黑体, SimHei, Heiti SC, sans-serif"
82971
+ // },
82950
82972
  ],
82951
82973
  fontSize: fontSizes,
82952
82974
  isSuperScript: !1,
@@ -1,4 +1,4 @@
1
- import { c as Ma, _ as qa, g as Zu } from "./index-CkGezwsU.mjs";
1
+ import { c as Ma, _ as qa, g as Zu } from "./index-DwjHgIT9.mjs";
2
2
  var un = {}, ln = {}, lr, hn;
3
3
  function Z() {
4
4
  if (hn) return lr;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hoeditor-web",
3
- "version": "3.2.28",
3
+ "version": "3.2.32",
4
4
  "private": false,
5
5
  "main": "lib/hoeditor.mjs",
6
6
  "typings": "types/index.d.ts",