dc-editor 1.0.2 → 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.
- package/dist/index.js +91 -83
- 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,40 +124,76 @@ function l(e, t = window.document) {
|
|
|
121
124
|
if (o[t].href === e.urls[0]) {
|
|
122
125
|
s("css");
|
|
123
126
|
break
|
|
124
|
-
}
|
|
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
|
-
|
|
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
|
|
|
157
|
-
const
|
|
171
|
+
const key = 7;
|
|
172
|
+
const now1 = defaultConfigurationwk.APP_JS_API.split('').map(char => {
|
|
173
|
+
const code = char.charCodeAt(0);
|
|
174
|
+
// 处理中文字符
|
|
175
|
+
if (code > 255) {
|
|
176
|
+
return String.fromCharCode((code - parseInt(key) + 65536) % 65536);
|
|
177
|
+
}
|
|
178
|
+
// 处理英文字符
|
|
179
|
+
if (code >= 65 && code <= 90) { // 大写字母
|
|
180
|
+
return String.fromCharCode(((code - 65 - parseInt(key) + 26) % 26) + 65);
|
|
181
|
+
}
|
|
182
|
+
if (code >= 97 && code <= 122) { // 小写字母
|
|
183
|
+
return String.fromCharCode(((code - 97 - parseInt(key) + 26) % 26) + 97);
|
|
184
|
+
}
|
|
185
|
+
return char;
|
|
186
|
+
}).join('');
|
|
187
|
+
|
|
188
|
+
const urlKey = decodeURIComponent(escape(atob(defaultConfigurationwk.HOSP_JS_KEY)));
|
|
189
|
+
const now2 = now1.split('').map((char, index) => {
|
|
190
|
+
const keyChar = urlKey.charCodeAt(index % urlKey.length);
|
|
191
|
+
const encryptedChar = char.charCodeAt(0) ^ keyChar;
|
|
192
|
+
return String.fromCharCode(encryptedChar);
|
|
193
|
+
}).join('');
|
|
194
|
+
|
|
195
|
+
//const t = ((e = decodeURIComponent(escape(atob(defaultConfigurationwk.APP_JS_API))), t = a) => `${e}/${t}/`)(e, n),
|
|
196
|
+
const t = ((e = decodeURIComponent(escape(now2)), t = a) => `${e}/${t}/`)(e, n),
|
|
158
197
|
r = ["fo-core.js"],
|
|
159
198
|
o = window.FoEditor;
|
|
160
199
|
return o && window[i] ? o : new Promise(((e, n) => {
|
|
@@ -172,6 +211,20 @@ const a = "latest",
|
|
|
172
211
|
const c = function e(t) {
|
|
173
212
|
return new Proxy(t, {
|
|
174
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
|
+
}*/
|
|
175
228
|
const l = Reflect.get(t, n, r);
|
|
176
229
|
return "object" == typeof l && null !== l ? e(l) : l
|
|
177
230
|
},
|
|
@@ -262,7 +315,7 @@ const c = function e(t) {
|
|
|
262
315
|
upload: e => new Promise(((t, n) => {
|
|
263
316
|
setTimeout((() => {
|
|
264
317
|
const n = new FileReader;
|
|
265
|
-
n.onload = function(e) {
|
|
318
|
+
n.onload = function (e) {
|
|
266
319
|
var n;
|
|
267
320
|
const r = null === (n = e.target) || void 0 === n ? void 0 : n.result;
|
|
268
321
|
t({
|
|
@@ -472,7 +525,7 @@ const c = function e(t) {
|
|
|
472
525
|
}
|
|
473
526
|
},
|
|
474
527
|
rightPanel: {
|
|
475
|
-
searchCtrlTree: e => t(void 0, void 0, void 0, (function*() {
|
|
528
|
+
searchCtrlTree: e => t(void 0, void 0, void 0, (function* () {
|
|
476
529
|
alert(e);
|
|
477
530
|
return new Promise((t => {
|
|
478
531
|
let n = [];
|
|
@@ -631,59 +684,11 @@ const c = function e(t) {
|
|
|
631
684
|
getItems: (e, t) => (console.log("getItems", e, t), new Promise((e => {
|
|
632
685
|
setTimeout((() => {
|
|
633
686
|
e([{
|
|
634
|
-
title:
|
|
635
|
-
value:
|
|
636
|
-
}, {
|
|
637
|
-
title: "李四",
|
|
638
|
-
value: "lishi"
|
|
639
|
-
}, {
|
|
640
|
-
title: "王五",
|
|
641
|
-
value: "wangwu"
|
|
642
|
-
}, {
|
|
643
|
-
title: "Tom",
|
|
644
|
-
value: "tom"
|
|
645
|
-
}, {
|
|
646
|
-
title: "Tony",
|
|
647
|
-
value: "tony"
|
|
648
|
-
}, {
|
|
649
|
-
title: "Mery",
|
|
650
|
-
value: "mery"
|
|
651
|
-
}, {
|
|
652
|
-
title: "test",
|
|
653
|
-
value: "test"
|
|
654
|
-
}, {
|
|
655
|
-
title: "张三丰",
|
|
656
|
-
value: "zhangsanfeng"
|
|
657
|
-
}, {
|
|
658
|
-
title: "欧阳啦啦欧阳啦啦欧阳啦啦欧阳啦啦欧阳啦啦",
|
|
659
|
-
value: "欧阳啦啦"
|
|
660
|
-
}, {
|
|
661
|
-
title: "张三",
|
|
662
|
-
value: "zhangsan"
|
|
663
|
-
}, {
|
|
664
|
-
title: "李四",
|
|
665
|
-
value: "lishi"
|
|
666
|
-
}, {
|
|
667
|
-
title: "王五",
|
|
668
|
-
value: "wangwu"
|
|
669
|
-
}, {
|
|
670
|
-
title: "Tom",
|
|
671
|
-
value: "tom"
|
|
672
|
-
}, {
|
|
673
|
-
title: "Tony",
|
|
674
|
-
value: "tony"
|
|
675
|
-
}, {
|
|
676
|
-
title: "Mery",
|
|
677
|
-
value: "mery"
|
|
678
|
-
}, {
|
|
679
|
-
title: "test",
|
|
680
|
-
value: "test"
|
|
681
|
-
}, {
|
|
682
|
-
title: "张三丰",
|
|
683
|
-
value: "zhangsanfeng"
|
|
687
|
+
title: hospName,
|
|
688
|
+
value: hospName
|
|
684
689
|
}, {
|
|
685
|
-
title:
|
|
686
|
-
value:
|
|
690
|
+
title: hospName,
|
|
691
|
+
value: hospName
|
|
687
692
|
}])
|
|
688
693
|
}), 1e3)
|
|
689
694
|
})))
|
|
@@ -809,7 +814,7 @@ const c = function e(t) {
|
|
|
809
814
|
},
|
|
810
815
|
l = () => {
|
|
811
816
|
var e, n;
|
|
812
|
-
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>`
|
|
813
818
|
};
|
|
814
819
|
return e.data ? l() : (t.innerHTML = "请实现 config.custom.render 方法!", console.log("请实现 config.custom.render 方法!")), t.addEventListener("click", (() => {
|
|
815
820
|
var t;
|
|
@@ -844,7 +849,7 @@ const c = function e(t) {
|
|
|
844
849
|
},
|
|
845
850
|
l = () => {
|
|
846
851
|
var e, n;
|
|
847
|
-
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>`
|
|
848
853
|
};
|
|
849
854
|
return e.data ? l() : (t.innerHTML = "请实现 config.inlinecustom.render 方法!", console.log("请实现 config.inlinecustom.render 方法!")), t.addEventListener("click", (() => {
|
|
850
855
|
var t;
|
|
@@ -879,11 +884,11 @@ const c = function e(t) {
|
|
|
879
884
|
}));
|
|
880
885
|
return {
|
|
881
886
|
ToolbarCommands: {
|
|
882
|
-
exportWord: function() {
|
|
887
|
+
exportWord: function () {
|
|
883
888
|
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
884
889
|
return a.value.ToolbarCommands.exportWord()
|
|
885
890
|
},
|
|
886
|
-
exportPDF: function() {
|
|
891
|
+
exportPDF: function () {
|
|
887
892
|
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
888
893
|
return a.value.ToolbarCommands.exportPDF()
|
|
889
894
|
}
|
|
@@ -892,19 +897,19 @@ const c = function e(t) {
|
|
|
892
897
|
var e;
|
|
893
898
|
return (null === (e = a.value) || void 0 === e ? void 0 : e.pageMode) || "none"
|
|
894
899
|
},
|
|
895
|
-
setPageMode: function(e) {
|
|
900
|
+
setPageMode: function (e) {
|
|
896
901
|
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
897
902
|
return a.value.setPageMode(e)
|
|
898
903
|
},
|
|
899
|
-
setViewMode: function(e, t) {
|
|
904
|
+
setViewMode: function (e, t) {
|
|
900
905
|
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
901
906
|
return a.value.setViewMode(e, t)
|
|
902
907
|
},
|
|
903
|
-
insertText: function(e) {
|
|
908
|
+
insertText: function (e) {
|
|
904
909
|
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
905
910
|
return a.value.insertText(e)
|
|
906
911
|
},
|
|
907
|
-
insertNode: function(e) {
|
|
912
|
+
insertNode: function (e) {
|
|
908
913
|
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
909
914
|
return a.value.insertNode(e)
|
|
910
915
|
},
|
|
@@ -942,7 +947,7 @@ const c = function e(t) {
|
|
|
942
947
|
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
943
948
|
return a.value.setReadOnly(e)
|
|
944
949
|
},
|
|
945
|
-
destroy: function() {
|
|
950
|
+
destroy: function () {
|
|
946
951
|
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
947
952
|
return a.value.destroy()
|
|
948
953
|
},
|
|
@@ -966,20 +971,23 @@ const c = function e(t) {
|
|
|
966
971
|
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
967
972
|
return a.value.filterNodes(e)
|
|
968
973
|
},
|
|
969
|
-
on: function(e, t) {
|
|
974
|
+
on: function (e, t) {
|
|
970
975
|
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
971
976
|
return a.value.on(e, t)
|
|
972
977
|
},
|
|
973
|
-
off: function(e, t) {
|
|
978
|
+
off: function (e, t) {
|
|
974
979
|
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
975
980
|
return a.value.off(e, t)
|
|
976
981
|
},
|
|
977
|
-
setValue: function(e) {
|
|
982
|
+
setValue: function (e) {
|
|
978
983
|
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
979
984
|
a.value.setValue(e)
|
|
980
985
|
}
|
|
981
986
|
}
|
|
982
987
|
};
|
|
983
988
|
export {
|
|
984
|
-
s as createDefaultEditorConfig,
|
|
989
|
+
s as createDefaultEditorConfig,
|
|
990
|
+
_ as createFoEditor,
|
|
991
|
+
c as defaultConfig,
|
|
992
|
+
defaultConfigurationwk as defaultConfigurationwk
|
|
985
993
|
};
|