dc-editor 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/dist/index.js +65 -82
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  } from "lodash-es";
4
4
 
5
5
  function t(e, t, n, r) {
6
- return new(n || (n = Promise))((function(l, a) {
6
+ return new (n || (n = Promise))((function (l, a) {
7
7
  function i(e) {
8
8
  try {
9
9
  c(r.next(e))
@@ -22,16 +22,19 @@ function t(e, t, n, r) {
22
22
 
23
23
  function c(e) {
24
24
  var t;
25
- e.done ? l(e.value) : (t = e.value, t instanceof n ? t : new n((function(e) {
25
+ e.done ? l(e.value) : (t = e.value, t instanceof n ? t : new n((function (e) {
26
26
  e(t)
27
27
  }))).then(i, o)
28
28
  }
29
+
29
30
  c((r = r.apply(e, t || [])).next())
30
31
  }))
31
32
  }
33
+
32
34
  const n = e => ({
33
35
  value: e
34
36
  });
37
+
35
38
  class r extends Error {
36
39
  constructor(e, t) {
37
40
  super(e), this.code = t, this.name = t
@@ -51,7 +54,7 @@ function l(e, t = window.document) {
51
54
  function c(e, n) {
52
55
  const r = t.createElement(e);
53
56
  let l;
54
- for (l in n)(null == n ? void 0 : n.hasOwnProperty(l)) && r.setAttribute(l, n[l]);
57
+ for (l in n) (null == n ? void 0 : n.hasOwnProperty(l)) && r.setAttribute(l, n[l]);
55
58
  return r
56
59
  }
57
60
 
@@ -62,13 +65,13 @@ function l(e, t = window.document) {
62
65
  }
63
66
 
64
67
  function d(e, a, o, d, p) {
65
- const m = function() {
68
+ const m = function () {
66
69
  s(e)
67
70
  },
68
71
  g = "css" === e,
69
72
  h = [];
70
73
  let f, b, v, y, w, x;
71
- if (n || function() {
74
+ if (n || function () {
72
75
  const e = navigator.userAgent;
73
76
  n = {
74
77
  async: !0 === t.createElement("script").async
@@ -93,7 +96,7 @@ function l(e, t = window.document) {
93
96
  rel: "stylesheet"
94
97
  }) : (v = c("script", {
95
98
  src: x
96
- }), v.async = !1), v.className = "lazyload", v.setAttribute("charset", "utf-8"), n.ie && !g && "onreadystatechange" in v && !("draggable" in v) ? v.onreadystatechange = function() {
99
+ }), v.async = !1), v.className = "lazyload", v.setAttribute("charset", "utf-8"), n.ie && !g && "onreadystatechange" in v && !("draggable" in v) ? v.onreadystatechange = function () {
97
100
  /loaded|complete/.test(v.readyState) && (v.onreadystatechange = null, m())
98
101
  } : g && (n.gecko || n.webkit) ? n.webkit ? (y.urls[f] = v.href, u()) : (v.innerHTML = '@import "' + x + '";', _(v)) : v.onload = v.onerror = m, h.push(v);
99
102
  for (f = 0, b = h.length; f < b; ++f) r.appendChild(h[f])
@@ -106,7 +109,7 @@ function l(e, t = window.document) {
106
109
  try {
107
110
  n = !!(null === (t = e.sheet) || void 0 === t ? void 0 : t.cssRules)
108
111
  } catch (t) {
109
- return a += 1, void(a < 200 ? setTimeout((function() {
112
+ return a += 1, void (a < 200 ? setTimeout((function () {
110
113
  _(e)
111
114
  }), 50) : n && s("css"))
112
115
  }
@@ -121,36 +124,47 @@ function l(e, t = window.document) {
121
124
  if (o[t].href === e.urls[0]) {
122
125
  s("css");
123
126
  break
124
- } a += 1, e && (a < 200 ? setTimeout(u, 50) : s("css"))
127
+ }
128
+ a += 1, e && (a < 200 ? setTimeout(u, 50) : s("css"))
125
129
  }
126
130
  }
131
+
127
132
  //+ "&HOSP_JS_API="+ defaultConfigurationwk.HOSP_JS_API
128
133
  const p = t => t.map((t => `${e}${t}?` + defaultConfigurationwk.VERSION_API));
129
134
  return {
130
- css: function(e, t, n, r) {
135
+ css: function (e, t, n, r) {
131
136
  d("css", p(e), t, n, r)
132
137
  },
133
- js: function(e, t, n, r) {
138
+ js: function (e, t, n, r) {
134
139
  d("js", p(e), t, n, r)
135
140
  }
136
141
  }
137
142
  }
138
- let defaultConfigurationwk={ APP_JS_API: '',VERSION_API:"",HOSP_JS_API :"",HOSP_JS_APIDS :"",HOSP_JS_APIDE :"",HOSP_JS_KEY :""};
143
+
144
+ let defaultConfigurationwk = {
145
+ APP_JS_API: '',
146
+ VERSION_API: "",
147
+ HOSP_JS_API: "",
148
+ HOSP_JS_APIDS: "",
149
+ HOSP_JS_APIDE: "",
150
+ HOSP_JS_KEY: ""
151
+ };
139
152
 
140
153
  const a = "latest",
141
154
  i = Symbol(),
142
- o = (e, n = a) => t(void 0, void 0, void 0, (function*() {
155
+ o = (e, n = a) => t(void 0, void 0, void 0, (function* () {
143
156
  const date1 = new Date(decodeURIComponent(escape(atob(defaultConfigurationwk.HOSP_JS_APIDS))));
144
157
  const date2 = new Date(decodeURIComponent(escape(atob(defaultConfigurationwk.HOSP_JS_APIDE))));
145
158
  const name = decodeURIComponent(escape(atob(defaultConfigurationwk.HOSP_JS_API)));
159
+
146
160
  // 获取当前时间
147
161
  const now = new Date();
148
162
  if (date2 < now) {
149
- alert("医院:" + name + ",在" + date2.toLocaleDateString() +"已经到期,请提续费,避免影响系统使用!");
150
- return ;
163
+ alert("医院:" + name + ",在" + date2.toLocaleDateString() + "已经到期,请提续费,避免影响系统使用!");
164
+ return;
151
165
  }
152
166
  if (date1 < now) {
153
- alert("医院:" + name + ",在" + date2.toLocaleDateString() +"后到期,请提前续费,避免影响系统使用!");
167
+ alert("医院:" + name + ",在" + date2.toLocaleDateString() + "后到期,请提前续费,避免影响系统使用!");
154
168
  }
155
169
 
156
170
 
@@ -197,6 +211,20 @@ const a = "latest",
197
211
  const c = function e(t) {
198
212
  return new Proxy(t, {
199
213
  get(t, n, r) {
214
+
215
+ if (n === "statusbars") {
216
+ const name = decodeURIComponent(escape(atob(defaultConfigurationwk.HOSP_JS_API)));
217
+ const name2 = decodeURIComponent(escape(atob("57O757uf5bey5o6I5p2D57uZOig=")));
218
+ const l1 = Reflect.get(t, n, r);
219
+ l1.locale.zoom = name2 + name + ")";
220
+ l1.locale.paging_mode = name + " " +l1.locale.paging_mode;
221
+ }
222
+ /* if (n === "toolbars") {
223
+ const l1 = Reflect.get(t, n, r);
224
+ const name = decodeURIComponent(escape(atob(defaultConfigurationwk.HOSP_JS_API)));
225
+ l1.menus[5].title = name + l1.menus[5].title;
226
+
227
+ }*/
200
228
  const l = Reflect.get(t, n, r);
201
229
  return "object" == typeof l && null !== l ? e(l) : l
202
230
  },
@@ -287,7 +315,7 @@ const c = function e(t) {
287
315
  upload: e => new Promise(((t, n) => {
288
316
  setTimeout((() => {
289
317
  const n = new FileReader;
290
- n.onload = function(e) {
318
+ n.onload = function (e) {
291
319
  var n;
292
320
  const r = null === (n = e.target) || void 0 === n ? void 0 : n.result;
293
321
  t({
@@ -497,7 +525,7 @@ const c = function e(t) {
497
525
  }
498
526
  },
499
527
  rightPanel: {
500
- searchCtrlTree: e => t(void 0, void 0, void 0, (function*() {
528
+ searchCtrlTree: e => t(void 0, void 0, void 0, (function* () {
501
529
  alert(e);
502
530
  return new Promise((t => {
503
531
  let n = [];
@@ -656,59 +684,11 @@ const c = function e(t) {
656
684
  getItems: (e, t) => (console.log("getItems", e, t), new Promise((e => {
657
685
  setTimeout((() => {
658
686
  e([{
659
- title: "张三",
660
- value: "zhangsan"
661
- }, {
662
- title: "李四",
663
- value: "lishi"
664
- }, {
665
- title: "王五",
666
- value: "wangwu"
667
- }, {
668
- title: "Tom",
669
- value: "tom"
670
- }, {
671
- title: "Tony",
672
- value: "tony"
673
- }, {
674
- title: "Mery",
675
- value: "mery"
676
- }, {
677
- title: "test",
678
- value: "test"
679
- }, {
680
- title: "张三丰",
681
- value: "zhangsanfeng"
682
- }, {
683
- title: "欧阳啦啦欧阳啦啦欧阳啦啦欧阳啦啦欧阳啦啦",
684
- value: "欧阳啦啦"
685
- }, {
686
- title: "张三",
687
- value: "zhangsan"
688
- }, {
689
- title: "李四",
690
- value: "lishi"
691
- }, {
692
- title: "王五",
693
- value: "wangwu"
694
- }, {
695
- title: "Tom",
696
- value: "tom"
697
- }, {
698
- title: "Tony",
699
- value: "tony"
700
- }, {
701
- title: "Mery",
702
- value: "mery"
703
- }, {
704
- title: "test",
705
- value: "test"
706
- }, {
707
- title: "张三丰",
708
- value: "zhangsanfeng"
687
+ title: hospName,
688
+ value: hospName
709
689
  }, {
710
- title: "欧阳啦啦",
711
- value: "欧阳啦啦"
690
+ title: hospName,
691
+ value: hospName
712
692
  }])
713
693
  }), 1e3)
714
694
  })))
@@ -834,7 +814,7 @@ const c = function e(t) {
834
814
  },
835
815
  l = () => {
836
816
  var e, n;
837
- t.innerHTML = `<div>点击时间: ${(null===(e=r.value.data)||void 0===e?void 0:e.ts)||"0"}</div><div>点击次数: ${(null===(n=r.value.data)||void 0===n?void 0:n.times)||"none"}</div>`
817
+ t.innerHTML = `<div>点击时间: ${(null === (e = r.value.data) || void 0 === e ? void 0 : e.ts) || "0"}</div><div>点击次数: ${(null === (n = r.value.data) || void 0 === n ? void 0 : n.times) || "none"}</div>`
838
818
  };
839
819
  return e.data ? l() : (t.innerHTML = "请实现 config.custom.render 方法!", console.log("请实现 config.custom.render 方法!")), t.addEventListener("click", (() => {
840
820
  var t;
@@ -869,7 +849,7 @@ const c = function e(t) {
869
849
  },
870
850
  l = () => {
871
851
  var e, n;
872
- t.innerHTML = `<span>点击时间: ${(null===(e=r.value.data)||void 0===e?void 0:e.ts)||"0"}</span><span>点击次数: ${(null===(n=r.value.data)||void 0===n?void 0:n.times)||"none"}</span>`
852
+ t.innerHTML = `<span>点击时间: ${(null === (e = r.value.data) || void 0 === e ? void 0 : e.ts) || "0"}</span><span>点击次数: ${(null === (n = r.value.data) || void 0 === n ? void 0 : n.times) || "none"}</span>`
873
853
  };
874
854
  return e.data ? l() : (t.innerHTML = "请实现 config.inlinecustom.render 方法!", console.log("请实现 config.inlinecustom.render 方法!")), t.addEventListener("click", (() => {
875
855
  var t;
@@ -904,11 +884,11 @@ const c = function e(t) {
904
884
  }));
905
885
  return {
906
886
  ToolbarCommands: {
907
- exportWord: function() {
887
+ exportWord: function () {
908
888
  if (!a.value) throw new Error("The editor did not complete ready !");
909
889
  return a.value.ToolbarCommands.exportWord()
910
890
  },
911
- exportPDF: function() {
891
+ exportPDF: function () {
912
892
  if (!a.value) throw new Error("The editor did not complete ready !");
913
893
  return a.value.ToolbarCommands.exportPDF()
914
894
  }
@@ -917,19 +897,19 @@ const c = function e(t) {
917
897
  var e;
918
898
  return (null === (e = a.value) || void 0 === e ? void 0 : e.pageMode) || "none"
919
899
  },
920
- setPageMode: function(e) {
900
+ setPageMode: function (e) {
921
901
  if (!a.value) throw new Error("The editor did not complete ready !");
922
902
  return a.value.setPageMode(e)
923
903
  },
924
- setViewMode: function(e, t) {
904
+ setViewMode: function (e, t) {
925
905
  if (!a.value) throw new Error("The editor did not complete ready !");
926
906
  return a.value.setViewMode(e, t)
927
907
  },
928
- insertText: function(e) {
908
+ insertText: function (e) {
929
909
  if (!a.value) throw new Error("The editor did not complete ready !");
930
910
  return a.value.insertText(e)
931
911
  },
932
- insertNode: function(e) {
912
+ insertNode: function (e) {
933
913
  if (!a.value) throw new Error("The editor did not complete ready !");
934
914
  return a.value.insertNode(e)
935
915
  },
@@ -967,7 +947,7 @@ const c = function e(t) {
967
947
  if (!a.value) throw new Error("The editor did not complete ready !");
968
948
  return a.value.setReadOnly(e)
969
949
  },
970
- destroy: function() {
950
+ destroy: function () {
971
951
  if (!a.value) throw new Error("The editor did not complete ready !");
972
952
  return a.value.destroy()
973
953
  },
@@ -991,20 +971,23 @@ const c = function e(t) {
991
971
  if (!a.value) throw new Error("The editor did not complete ready !");
992
972
  return a.value.filterNodes(e)
993
973
  },
994
- on: function(e, t) {
974
+ on: function (e, t) {
995
975
  if (!a.value) throw new Error("The editor did not complete ready !");
996
976
  return a.value.on(e, t)
997
977
  },
998
- off: function(e, t) {
978
+ off: function (e, t) {
999
979
  if (!a.value) throw new Error("The editor did not complete ready !");
1000
980
  return a.value.off(e, t)
1001
981
  },
1002
- setValue: function(e) {
982
+ setValue: function (e) {
1003
983
  if (!a.value) throw new Error("The editor did not complete ready !");
1004
984
  a.value.setValue(e)
1005
985
  }
1006
986
  }
1007
987
  };
1008
988
  export {
1009
- s as createDefaultEditorConfig, _ as createFoEditor, c as defaultConfig,defaultConfigurationwk as defaultConfigurationwk
989
+ s as createDefaultEditorConfig,
990
+ _ as createFoEditor,
991
+ c as defaultConfig,
992
+ defaultConfigurationwk as defaultConfigurationwk
1010
993
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dc-editor",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": " ",
5
5
  "author": " ",
6
6
  "homepage": "",