dc-editor 1.0.0
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.d.ts +2166 -0
- package/dist/index.js +970 -0
- package/package.json +58 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,970 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cloneDeep as e
|
|
3
|
+
} from "lodash-es";
|
|
4
|
+
|
|
5
|
+
function t(e, t, n, r) {
|
|
6
|
+
return new(n || (n = Promise))((function(l, a) {
|
|
7
|
+
function i(e) {
|
|
8
|
+
try {
|
|
9
|
+
c(r.next(e))
|
|
10
|
+
} catch (e) {
|
|
11
|
+
a(e)
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function o(e) {
|
|
16
|
+
try {
|
|
17
|
+
c(r.throw(e))
|
|
18
|
+
} catch (e) {
|
|
19
|
+
a(e)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function c(e) {
|
|
24
|
+
var t;
|
|
25
|
+
e.done ? l(e.value) : (t = e.value, t instanceof n ? t : new n((function(e) {
|
|
26
|
+
e(t)
|
|
27
|
+
}))).then(i, o)
|
|
28
|
+
}
|
|
29
|
+
c((r = r.apply(e, t || [])).next())
|
|
30
|
+
}))
|
|
31
|
+
}
|
|
32
|
+
const n = e => ({
|
|
33
|
+
value: e
|
|
34
|
+
});
|
|
35
|
+
class r extends Error {
|
|
36
|
+
constructor(e, t) {
|
|
37
|
+
super(e), this.code = t, this.name = t
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function l(e, t = window.document) {
|
|
42
|
+
let n, r;
|
|
43
|
+
const l = {};
|
|
44
|
+
let a = 0;
|
|
45
|
+
const i = {
|
|
46
|
+
css: [],
|
|
47
|
+
js: []
|
|
48
|
+
},
|
|
49
|
+
o = t.styleSheets;
|
|
50
|
+
|
|
51
|
+
function c(e, n) {
|
|
52
|
+
const r = t.createElement(e);
|
|
53
|
+
let l;
|
|
54
|
+
for (l in n)(null == n ? void 0 : n.hasOwnProperty(l)) && r.setAttribute(l, n[l]);
|
|
55
|
+
return r
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function s(e) {
|
|
59
|
+
const t = l[e];
|
|
60
|
+
let n, r;
|
|
61
|
+
t && (n = t.callback, r = t.urls, r.shift(), a = 0, r.length || (n && n.call(t.context, t.obj), l[e] = void 0, i[e].length && d(e)))
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function d(e, a, o, d, p) {
|
|
65
|
+
const m = function() {
|
|
66
|
+
s(e)
|
|
67
|
+
},
|
|
68
|
+
g = "css" === e,
|
|
69
|
+
h = [];
|
|
70
|
+
let f, b, v, y, w, x;
|
|
71
|
+
if (n || function() {
|
|
72
|
+
const e = navigator.userAgent;
|
|
73
|
+
n = {
|
|
74
|
+
async: !0 === t.createElement("script").async
|
|
75
|
+
}, (n.webkit = /AppleWebKit\//.test(e)) || (n.ie = /MSIE|Trident/.test(e)) || (n.opera = /Opera/.test(e)) || (n.gecko = /Gecko\//.test(e)) || (n.unknown = !0)
|
|
76
|
+
}(), a)
|
|
77
|
+
if (a = "string" == typeof a ? [a] : a.concat(), g || n.async || n.gecko || n.opera) i[e].push({
|
|
78
|
+
urls: a,
|
|
79
|
+
callback: o,
|
|
80
|
+
obj: d,
|
|
81
|
+
context: p
|
|
82
|
+
});
|
|
83
|
+
else
|
|
84
|
+
for (f = 0, b = a.length; f < b; ++f) i[e].push({
|
|
85
|
+
urls: [a[f]],
|
|
86
|
+
callback: f === b - 1 ? o : null,
|
|
87
|
+
obj: d,
|
|
88
|
+
context: p
|
|
89
|
+
});
|
|
90
|
+
if (!l[e] && (y = l[e] = i[e].shift())) {
|
|
91
|
+
for (r || (r = t.head || t.getElementsByTagName("head")[0]), w = y.urls.concat(), f = 0, b = w.length; f < b; ++f) x = w[f], g ? v = n.gecko ? c("style") : c("link", {
|
|
92
|
+
href: x,
|
|
93
|
+
rel: "stylesheet"
|
|
94
|
+
}) : (v = c("script", {
|
|
95
|
+
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() {
|
|
97
|
+
/loaded|complete/.test(v.readyState) && (v.onreadystatechange = null, m())
|
|
98
|
+
} : 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
|
+
for (f = 0, b = h.length; f < b; ++f) r.appendChild(h[f])
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function _(e) {
|
|
104
|
+
var t;
|
|
105
|
+
let n = !1;
|
|
106
|
+
try {
|
|
107
|
+
n = !!(null === (t = e.sheet) || void 0 === t ? void 0 : t.cssRules)
|
|
108
|
+
} catch (t) {
|
|
109
|
+
return a += 1, void(a < 200 ? setTimeout((function() {
|
|
110
|
+
_(e)
|
|
111
|
+
}), 50) : n && s("css"))
|
|
112
|
+
}
|
|
113
|
+
s("css")
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function u() {
|
|
117
|
+
const e = l.css;
|
|
118
|
+
let t;
|
|
119
|
+
if (e) {
|
|
120
|
+
for (t = o.length; --t >= 0;)
|
|
121
|
+
if (o[t].href === e.urls[0]) {
|
|
122
|
+
s("css");
|
|
123
|
+
break
|
|
124
|
+
} a += 1, e && (a < 200 ? setTimeout(u, 50) : s("css"))
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const p = t => t.map((t => `${e}${t}?` + import.meta.env.VITE_APP_VERSION_API));
|
|
128
|
+
return {
|
|
129
|
+
css: function(e, t, n, r) {
|
|
130
|
+
d("css", p(e), t, n, r)
|
|
131
|
+
},
|
|
132
|
+
js: function(e, t, n, r) {
|
|
133
|
+
d("js", p(e), t, n, r)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const a = "latest",
|
|
139
|
+
i = Symbol(),
|
|
140
|
+
o = (e, n = a) => t(void 0, void 0, void 0, (function*() {
|
|
141
|
+
//"http://192.168.31.137:8066/"
|
|
142
|
+
/* alert(import.meta.env.VITE_APP_JS_API);*/
|
|
143
|
+
//alert(decodeURIComponent(escape(atob(import.meta.env.VITE_APP_JS_API))));
|
|
144
|
+
const t = ((e = decodeURIComponent(escape(atob(import.meta.env.VITE_APP_JS_API))), t = a) => `${e}/${t}/`)(e, n),
|
|
145
|
+
r = ["fo-core.js"],
|
|
146
|
+
o = window.FoEditor;
|
|
147
|
+
return o && window[i] ? o : new Promise(((e, n) => {
|
|
148
|
+
try {
|
|
149
|
+
l(t).js(r, (() => {
|
|
150
|
+
const t = window.FoCore;
|
|
151
|
+
t ? (window[i] = !0, e(t)) : (console.error("editor js load failed!"), n())
|
|
152
|
+
}))
|
|
153
|
+
} catch (e) {
|
|
154
|
+
console.error("editor js load failed!", e), n()
|
|
155
|
+
}
|
|
156
|
+
}))
|
|
157
|
+
}));
|
|
158
|
+
const c = function e(t) {
|
|
159
|
+
return new Proxy(t, {
|
|
160
|
+
get(t, n, r) {
|
|
161
|
+
const l = Reflect.get(t, n, r);
|
|
162
|
+
return "object" == typeof l && null !== l ? e(l) : l
|
|
163
|
+
},
|
|
164
|
+
set() {
|
|
165
|
+
throw new Error("不允许修改 defaultConfig 的属性值,请使用 解构 形式获取新的 config 对象,或者调用 createDefaultEditorConfig")
|
|
166
|
+
}
|
|
167
|
+
})
|
|
168
|
+
}({
|
|
169
|
+
doc: {},
|
|
170
|
+
watermark: {
|
|
171
|
+
printImg: ""
|
|
172
|
+
},
|
|
173
|
+
page: {
|
|
174
|
+
locale: {
|
|
175
|
+
paging_info: "第 {page} 页",
|
|
176
|
+
new_page_bar: "新建页",
|
|
177
|
+
remove_page_bar: "删除页",
|
|
178
|
+
margins_bar: "边框",
|
|
179
|
+
orientation_bar: "方向",
|
|
180
|
+
orientation_portrait_bar: "纵向",
|
|
181
|
+
orientation_landscape_bar: "横向",
|
|
182
|
+
size_bar: "大小",
|
|
183
|
+
top_title: "上边距",
|
|
184
|
+
bottom_title: "下边距",
|
|
185
|
+
left_title: "左边距",
|
|
186
|
+
right_title: "右边距",
|
|
187
|
+
normal_title: "常规",
|
|
188
|
+
narrow_title: "窄",
|
|
189
|
+
moderate_title: "中等",
|
|
190
|
+
wide_title: "宽",
|
|
191
|
+
auto_title: "自定义",
|
|
192
|
+
input_width: "宽度",
|
|
193
|
+
input_height: "高度",
|
|
194
|
+
panel_title: "页",
|
|
195
|
+
title_title: "标题",
|
|
196
|
+
name_title: "名称",
|
|
197
|
+
code_title: "编码"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
viewMode: {
|
|
201
|
+
locale: {
|
|
202
|
+
view_mode: "视图模式",
|
|
203
|
+
view_mode_readonly: "只读模式",
|
|
204
|
+
view_mode_form: "表单模式",
|
|
205
|
+
view_mode_edit: "编辑模式",
|
|
206
|
+
view_mode_setting: "设置模式"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
br: {
|
|
210
|
+
locale: {
|
|
211
|
+
break_placeholder: " -- 分行符 --",
|
|
212
|
+
break_page_placeholder: " -- 分页符 --",
|
|
213
|
+
break_bar: "分行符",
|
|
214
|
+
break_page_bar: "分页符"
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
findAndReplace: {
|
|
218
|
+
locale: {
|
|
219
|
+
find_title: "查找",
|
|
220
|
+
find_placeholder: "在文档内查找",
|
|
221
|
+
replace_title: "替换",
|
|
222
|
+
replace_label: "替换为",
|
|
223
|
+
replace_all_title: "替换全部",
|
|
224
|
+
replace_placeholder: "请输入替换文字",
|
|
225
|
+
next_title: "下一个",
|
|
226
|
+
prev_title: "上一个",
|
|
227
|
+
find_and_replace_bar: "查找替换"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
history: {
|
|
231
|
+
locale: {
|
|
232
|
+
redo_bar: "重做",
|
|
233
|
+
undo_bar: "撤销"
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
image: {
|
|
237
|
+
locale: {
|
|
238
|
+
insert_image_bar: "插入图片",
|
|
239
|
+
setting_reload: "重试",
|
|
240
|
+
setting_delete: "删除",
|
|
241
|
+
panel_title: "图片",
|
|
242
|
+
name_title: "名称",
|
|
243
|
+
code_title: "编码",
|
|
244
|
+
w_title: "宽",
|
|
245
|
+
h_title: "高",
|
|
246
|
+
hide_title: "隐藏"
|
|
247
|
+
},
|
|
248
|
+
upload: e => new Promise(((t, n) => {
|
|
249
|
+
setTimeout((() => {
|
|
250
|
+
const n = new FileReader;
|
|
251
|
+
n.onload = function(e) {
|
|
252
|
+
var n;
|
|
253
|
+
const r = null === (n = e.target) || void 0 === n ? void 0 : n.result;
|
|
254
|
+
t({
|
|
255
|
+
src: r
|
|
256
|
+
})
|
|
257
|
+
}, n.readAsDataURL(e)
|
|
258
|
+
}), 500)
|
|
259
|
+
}))
|
|
260
|
+
},
|
|
261
|
+
link: {
|
|
262
|
+
locale: {
|
|
263
|
+
link_bar: "插入链接",
|
|
264
|
+
unlink_bar: "取消链接"
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
marks: {
|
|
268
|
+
locale: {
|
|
269
|
+
italic_bar: "倾斜",
|
|
270
|
+
bold_bar: "加粗",
|
|
271
|
+
underline_bar: "下划线",
|
|
272
|
+
strike_bar: "删除线",
|
|
273
|
+
sup_bar: "上标",
|
|
274
|
+
sub_bar: "下标",
|
|
275
|
+
color_bar: "字体颜色",
|
|
276
|
+
bgcolor_bar: "背景色",
|
|
277
|
+
fontsize_bar: "字号",
|
|
278
|
+
fontfamily_bar: "字体",
|
|
279
|
+
increase_fontsize_bar: "增大字体",
|
|
280
|
+
decrease_fontsize_bar: "减小字体",
|
|
281
|
+
clear_color_bgcolor: "恢复默认",
|
|
282
|
+
clear_style_bar: "清除格式"
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
formula: {
|
|
286
|
+
locale: {
|
|
287
|
+
placeholder: "医学公式",
|
|
288
|
+
insert_formula_bar: "医学公式",
|
|
289
|
+
tooth_item: "牙位图",
|
|
290
|
+
general_item: "通用公式",
|
|
291
|
+
menstrual_item: "月经史",
|
|
292
|
+
menarche_age_title: "初潮年龄",
|
|
293
|
+
menopausal_age_title: "绝经年龄/末次月经",
|
|
294
|
+
menstrual_cycle_title: "周期(天)",
|
|
295
|
+
menstrual_days_title: "经期(天)"
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
paragraph: {
|
|
299
|
+
locale: {
|
|
300
|
+
increase_indent_bar: "增大缩进",
|
|
301
|
+
decrease_indent_bar: "减小缩进",
|
|
302
|
+
placeholder_bar: "提示文案",
|
|
303
|
+
line_height_bar: "行高",
|
|
304
|
+
left_text_align_bar: "左对齐",
|
|
305
|
+
letter_spacing_bar: "字间距",
|
|
306
|
+
paragraph_margin_top_bar: "段前距",
|
|
307
|
+
paragraph_margin_bottom_bar: "段后距",
|
|
308
|
+
right_text_align_bar: "右对齐",
|
|
309
|
+
center_text_align_bar: "居中",
|
|
310
|
+
justify_text_align_bar: "两端对齐",
|
|
311
|
+
panel_title: "段落",
|
|
312
|
+
textAlign_title: "对齐方式",
|
|
313
|
+
textIndent_title: "缩进",
|
|
314
|
+
lineHeight_title: "行高",
|
|
315
|
+
letterSpacing_title: "字间距",
|
|
316
|
+
placeholder_title: "提示文案",
|
|
317
|
+
underline_title: "下划线",
|
|
318
|
+
name_title: "名称",
|
|
319
|
+
code_title: "编码"
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
ccpa: {
|
|
323
|
+
locale: {
|
|
324
|
+
cut_bar: "剪切",
|
|
325
|
+
copy_bar: "复制",
|
|
326
|
+
paste_bar: "粘贴",
|
|
327
|
+
selectall_bar: "全选"
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
table: {
|
|
331
|
+
locale: {
|
|
332
|
+
insert_table_bar: "插入表格",
|
|
333
|
+
merge_cells_bar: "合并单元格",
|
|
334
|
+
auto_column_width_bar: "自适应列宽",
|
|
335
|
+
split_cells_bar: "拆分单元格",
|
|
336
|
+
delete_table_bar: "删除表格",
|
|
337
|
+
delete_rows_bar: "删除当前行",
|
|
338
|
+
delete_columns_bar: "删除当前列",
|
|
339
|
+
insert_row_top_bar: "顶部新增行",
|
|
340
|
+
insert_row_bottom_bar: "底部新增行",
|
|
341
|
+
insert_column_left_bar: "左侧新增列",
|
|
342
|
+
insert_column_right_bar: "右侧新增列",
|
|
343
|
+
vertical_align_top_bar: "靠上对齐",
|
|
344
|
+
vertical_align_center_bar: "垂直居中",
|
|
345
|
+
vertical_align_bottom_bar: "靠下对齐",
|
|
346
|
+
text_align_left_bar: "靠左",
|
|
347
|
+
text_align_center_bar: "居中",
|
|
348
|
+
text_align_right_bar: "靠右",
|
|
349
|
+
name_title: "名称",
|
|
350
|
+
code_title: "编码",
|
|
351
|
+
not_delete_title: "禁删",
|
|
352
|
+
panel_title: "表格",
|
|
353
|
+
bgcolor_bar: "单元格背景色",
|
|
354
|
+
clear_bgcolor: "恢复默认",
|
|
355
|
+
cell_border_bar: "表格边框",
|
|
356
|
+
border_reset: "恢复默认",
|
|
357
|
+
border_none: "无边框"
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
toolbars: {
|
|
361
|
+
activeIndex: 1,
|
|
362
|
+
menus: [{
|
|
363
|
+
title: "文件",
|
|
364
|
+
groups: [
|
|
365
|
+
[85, "big-upload-file", "big-download-file"]
|
|
366
|
+
]
|
|
367
|
+
}, {
|
|
368
|
+
title: "编辑",
|
|
369
|
+
groups: [
|
|
370
|
+
[60, "icon-text-undo", "icon-text-redo"],
|
|
371
|
+
[75, "icon-cut", "icon-copy", "icon-paste", "icon-selectall"],
|
|
372
|
+
[30, "icon-clear-style", "icon-format-painter"],
|
|
373
|
+
[226, "icon-fontfamily", "icon-fontsize", "icon-increase-fontsize", "icon-decrease-fontsize", "icon-bold", "icon-italic", "icon-underline", "icon-strike", "icon-sup", "icon-sub", "icon-color"],
|
|
374
|
+
[228, "icon-marginTop", "icon-increase-indent", "icon-decrease-indent", "icon-placeholder", "icon-lineheight", "icon-letterspacing", "icon-marginBottom", "icon-text-align-left", "icon-text-align-center", "icon-text-align-right", "icon-text-align-justify"],
|
|
375
|
+
["big-find-and-replace"],
|
|
376
|
+
["big-paging-mode"],
|
|
377
|
+
["big-view-mode"]
|
|
378
|
+
/*,
|
|
379
|
+
[() => {
|
|
380
|
+
const e = document.createElement("button");
|
|
381
|
+
return e.innerHTML = "自定义按钮", e.addEventListener("click", (() => {
|
|
382
|
+
alert(`click ${e.innerText}`)
|
|
383
|
+
})), e
|
|
384
|
+
}]*/
|
|
385
|
+
]
|
|
386
|
+
}, {
|
|
387
|
+
title: "插入",
|
|
388
|
+
groups: [
|
|
389
|
+
[80, "icon-text-insert-image", "icon-text-insert-table"],
|
|
390
|
+
["big-link"],
|
|
391
|
+
["big-insert-formula"],
|
|
392
|
+
["big-spechars"],
|
|
393
|
+
["big-new-page"],
|
|
394
|
+
["big-insert-br"],
|
|
395
|
+
[248, "icon-text-ctext", "icon-text-cdate", "icon-text-ctag", "icon-text-csign", "icon-text-cselect", "icon-text-cradio", "icon-text-ccheckbox"],
|
|
396
|
+
[62, "icon-text-area", "icon-text-section"],
|
|
397
|
+
[80, "icon-text-cqrcode", "icon-text-barcode"],
|
|
398
|
+
[90, "icon-text-custom", "icon-text-inlinecustom"]
|
|
399
|
+
]
|
|
400
|
+
}, {
|
|
401
|
+
title: "布局",
|
|
402
|
+
groups: [
|
|
403
|
+
["big-new-page"],
|
|
404
|
+
[70, "icon-text-new-page", "icon-text-remove-page"],
|
|
405
|
+
["big-page-margins"],
|
|
406
|
+
["big-page-orientation"],
|
|
407
|
+
["big-page-size"],
|
|
408
|
+
[100, "input-page-size-width", "input-page-size-height"],
|
|
409
|
+
[208, "input-page-margins-top", "input-page-margins-bottom", "input-page-margins-left", "input-page-margins-right"]
|
|
410
|
+
]
|
|
411
|
+
}, {
|
|
412
|
+
title: "表格",
|
|
413
|
+
groups: [
|
|
414
|
+
["big-insert-table"],
|
|
415
|
+
[30, "icon-merge-cells", "icon-split-cells"],
|
|
416
|
+
[60, "icon-insert-row-top", "icon-insert-row-bottom", "icon-insert-column-left", "icon-insert-column-right"],
|
|
417
|
+
[136, "icon-cell-vertical-align-top", "icon-cell-vertical-align-center", "icon-cell-vertical-align-bottom", "cell-bgcolor", "icon-cell-text-align-left", "icon-cell-text-align-center", "icon-cell-text-align-right"],
|
|
418
|
+
["big-delete-table"],
|
|
419
|
+
[30, "icon-delete-rows", "icon-delete-columns"],
|
|
420
|
+
["big-auto-column-width"],
|
|
421
|
+
["big-cell-border"]
|
|
422
|
+
]
|
|
423
|
+
}, {
|
|
424
|
+
title: "工具",
|
|
425
|
+
groups: [
|
|
426
|
+
["big-preview-print", "big-print"],
|
|
427
|
+
["big-export-file"]
|
|
428
|
+
]
|
|
429
|
+
}/*, {
|
|
430
|
+
title: "其他",
|
|
431
|
+
groups: [
|
|
432
|
+
[() => {
|
|
433
|
+
const e = document.createElement("button");
|
|
434
|
+
return e.innerHTML = "自定义按钮 1", e.addEventListener("click", (() => {
|
|
435
|
+
alert(`click ${e.innerText}`)
|
|
436
|
+
})), e
|
|
437
|
+
}, () => {
|
|
438
|
+
const e = document.createElement("button");
|
|
439
|
+
return e.style.marginLeft = "10px", e.innerHTML = "自定义按钮 2", e.addEventListener("click", (() => {
|
|
440
|
+
alert(`click ${e.innerText}`)
|
|
441
|
+
})), e
|
|
442
|
+
}]
|
|
443
|
+
]
|
|
444
|
+
}*/
|
|
445
|
+
],
|
|
446
|
+
locale: {
|
|
447
|
+
download_file_bar: "下载文件",
|
|
448
|
+
upload_file_bar: "上传文件",
|
|
449
|
+
spechars_bar: "特殊字符",
|
|
450
|
+
rome_spechars: "罗马字符",
|
|
451
|
+
math_spechars: "数学字符",
|
|
452
|
+
japanese_spechars: "日文字符",
|
|
453
|
+
greek_spechars: "希腊字母",
|
|
454
|
+
russian_spechars: "俄文字符",
|
|
455
|
+
pinyin_spechars: "拼音字符",
|
|
456
|
+
english_spechars: "英语音标",
|
|
457
|
+
other_spechars: "其他"
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
rightPanel: {
|
|
461
|
+
searchCtrlTree: e => t(void 0, void 0, void 0, (function*() {
|
|
462
|
+
alert(e);
|
|
463
|
+
return new Promise((t => {
|
|
464
|
+
let n = [];
|
|
465
|
+
n = e ? [{
|
|
466
|
+
title: "基本信息(模版,推荐)1",
|
|
467
|
+
type: "folder",
|
|
468
|
+
child: [{
|
|
469
|
+
title: "患者姓名模版",
|
|
470
|
+
type: "ctrl",
|
|
471
|
+
insert: {
|
|
472
|
+
model: "fragment",
|
|
473
|
+
jsonString: '{"type":"doc","content":[{"type":"page","attrs":{"pgMar":{"type":"normal","top":"25.4mm","right":"31.8mm","bottom":"25.4mm","left":"31.8mm"},"pgSz":{"name":"A4","w":"210mm","h":"297mm","orient":"portrait"}},"content":[{"type":"header","content":[{"type":"paragraph","attrs":{"underline":false}}]},{"type":"main","content":[{"type":"paragraph","attrs":{"underline":false},"content":[{"type":"text","text":"患者姓名:"},{"type":"ctext","attrs":{"name":"user_name","placeholder":"请输入患者姓名","underline":false}},{"type":"text","text":" "}]}]},{"type":"footer","content":[{"type":"paragraph","attrs":{"underline":false}}]}]}]}'
|
|
474
|
+
}
|
|
475
|
+
}, {
|
|
476
|
+
title: "患者性别模版",
|
|
477
|
+
type: "ctrl",
|
|
478
|
+
insert: {
|
|
479
|
+
model: "fragment",
|
|
480
|
+
jsonString: '{"type":"doc","content":[{"type":"page","attrs":{"pgMar":{"type":"normal","top":"25.4mm","right":"31.8mm","bottom":"25.4mm","left":"31.8mm"},"pgSz":{"name":"A4","w":"210mm","h":"297mm","orient":"portrait"}},"content":[{"type":"header","content":[{"type":"paragraph","attrs":{"underline":false}}]},{"type":"main","content":[{"type":"paragraph","attrs":{"underline":false},"content":[{"type":"text","text":"患者性别:"},{"type":"cselect","attrs":{"mult":false,"name":"sex","placeholder":"患者性别","items":[{"title":"男","value":"man"},{"title":"女","value":"woman"}],"selectedItems":[],"joinString":"、","underline":false,"expand":false}},{"type":"text","text":" "}]}]},{"type":"footer","content":[{"type":"paragraph","attrs":{"underline":false}}]}]}]}'
|
|
481
|
+
}
|
|
482
|
+
}]
|
|
483
|
+
}] : [{
|
|
484
|
+
title: "基本信息(控件)2",
|
|
485
|
+
type: "folder",
|
|
486
|
+
child: [{
|
|
487
|
+
title: "患者姓名控件",
|
|
488
|
+
type: "ctrl",
|
|
489
|
+
insert: {
|
|
490
|
+
model: "inline",
|
|
491
|
+
prefixText: "可选,1前缀字符",
|
|
492
|
+
suffixText: "可选,2后缀字符",
|
|
493
|
+
type: "ctext",
|
|
494
|
+
attrs: {
|
|
495
|
+
code: "user_name",
|
|
496
|
+
name: "user_name1",
|
|
497
|
+
placeholder: "患者姓名"
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}, {
|
|
501
|
+
title: "患者性别控件",
|
|
502
|
+
type: "ctrl",
|
|
503
|
+
insert: {
|
|
504
|
+
model: "inline",
|
|
505
|
+
prefixText: "可选,前缀字符",
|
|
506
|
+
suffixText: "可选,后缀字符",
|
|
507
|
+
type: "cselect",
|
|
508
|
+
attrs: {
|
|
509
|
+
code: "user_sex",
|
|
510
|
+
name: "user_sex",
|
|
511
|
+
placeholder: "患者性别",
|
|
512
|
+
mult: !1,
|
|
513
|
+
items: [{
|
|
514
|
+
title: "男",
|
|
515
|
+
value: "man"
|
|
516
|
+
}, {
|
|
517
|
+
title: "女",
|
|
518
|
+
value: "woman"
|
|
519
|
+
}]
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}]
|
|
523
|
+
}, {
|
|
524
|
+
title: "基本信息(模版,推荐)",
|
|
525
|
+
type: "folder",
|
|
526
|
+
child: [{
|
|
527
|
+
title: "患者姓名模版",
|
|
528
|
+
type: "ctrl",
|
|
529
|
+
insert: {
|
|
530
|
+
model: "fragment",
|
|
531
|
+
jsonString: '{"type":"doc","content":[{"type":"page","attrs":{"pgMar":{"type":"normal","top":"25.4mm","right":"31.8mm","bottom":"25.4mm","left":"31.8mm"},"pgSz":{"name":"A4","w":"210mm","h":"297mm","orient":"portrait"}},"content":[{"type":"header","content":[{"type":"paragraph","attrs":{"underline":false}}]},{"type":"main","content":[{"type":"paragraph","attrs":{"underline":false},"content":[{"type":"text","text":"患者姓名:"},{"type":"ctext","attrs":{"name":"user_name","placeholder":"请输入患者姓名","underline":false}},{"type":"text","text":" "}]}]},{"type":"footer","content":[{"type":"paragraph","attrs":{"underline":false}}]}]}]}'
|
|
532
|
+
}
|
|
533
|
+
}, {
|
|
534
|
+
title: "患者性别模版",
|
|
535
|
+
type: "ctrl",
|
|
536
|
+
insert: {
|
|
537
|
+
model: "fragment",
|
|
538
|
+
jsonString: '{"type":"doc","content":[{"type":"page","attrs":{"pgMar":{"type":"normal","top":"25.4mm","right":"31.8mm","bottom":"25.4mm","left":"31.8mm"},"pgSz":{"name":"A4","w":"210mm","h":"297mm","orient":"portrait"}},"content":[{"type":"header","content":[{"type":"paragraph","attrs":{"underline":false}}]},{"type":"main","content":[{"type":"paragraph","attrs":{"underline":false},"content":[{"type":"text","text":"患者性别:"},{"type":"cselect","attrs":{"mult":false,"name":"sex","placeholder":"患者性别","items":[{"title":"男","value":"man"},{"title":"女","value":"woman"}],"selectedItems":[],"joinString":"、","underline":false,"expand":false}},{"type":"text","text":" "}]}]},{"type":"footer","content":[{"type":"paragraph","attrs":{"underline":false}}]}]}]}'
|
|
539
|
+
}
|
|
540
|
+
}]
|
|
541
|
+
}], console.warn("模拟返回 searchCtrlTree,实际业务中请实现 config.rightPanel.searchCtrlTree", n), t(n)
|
|
542
|
+
}))
|
|
543
|
+
}))
|
|
544
|
+
},
|
|
545
|
+
statusbars: {
|
|
546
|
+
leftMenus: ["icon-paging-mode", "page-status"],
|
|
547
|
+
rightMenus: ["zoom-status", "icon-fullscreen"],
|
|
548
|
+
locale: {
|
|
549
|
+
pages_info: "当前{page},共{count}页",
|
|
550
|
+
paging_mode: "分页模式",
|
|
551
|
+
paging_mode_none: "无分页",
|
|
552
|
+
paging_mode_line: "虚拟分页",
|
|
553
|
+
paging_mode_print: "打印分页",
|
|
554
|
+
zoom: "缩放",
|
|
555
|
+
zoom_placeholder: "请通过快捷键 Ctrl +/- 缩放",
|
|
556
|
+
fullscreen: "全屏"
|
|
557
|
+
}
|
|
558
|
+
},
|
|
559
|
+
print: {
|
|
560
|
+
locale: {
|
|
561
|
+
print: "直接打印",
|
|
562
|
+
preview: "打印预览",
|
|
563
|
+
exitPreview: "取消预览"
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
pgnum: {
|
|
567
|
+
locale: {
|
|
568
|
+
num_placeholder: "{页码}",
|
|
569
|
+
count_placeholder: "{总页数}"
|
|
570
|
+
},
|
|
571
|
+
template: "第 {{num}} 页,共 {{count}}页"
|
|
572
|
+
},
|
|
573
|
+
ctag: {
|
|
574
|
+
locale: {
|
|
575
|
+
insert_bar: "标签",
|
|
576
|
+
html_title: "Html",
|
|
577
|
+
not_delete_title: "禁删",
|
|
578
|
+
readonly_title: "只读",
|
|
579
|
+
data_title: "数据",
|
|
580
|
+
name_title: "Name",
|
|
581
|
+
code_title: "编码",
|
|
582
|
+
panel_title: "标签"
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
ctext: {
|
|
586
|
+
locale: {
|
|
587
|
+
insert_bar: "文本",
|
|
588
|
+
panel_title: "文本",
|
|
589
|
+
name_title: "Name",
|
|
590
|
+
code_title: "编码",
|
|
591
|
+
not_delete_title: "禁删",
|
|
592
|
+
placeholder_title: "提示文案",
|
|
593
|
+
readonly_title: "只读",
|
|
594
|
+
underline_title: "下划线",
|
|
595
|
+
requiredContent_title: "必填项"
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
cselect: {
|
|
599
|
+
locale: {
|
|
600
|
+
insert_bar: "下拉",
|
|
601
|
+
select_all: "全选",
|
|
602
|
+
clear_all: "清空",
|
|
603
|
+
panel_title: "选择",
|
|
604
|
+
name_title: "Name",
|
|
605
|
+
code_title: "编码",
|
|
606
|
+
placeholder_title: "提示文案",
|
|
607
|
+
join_string_title: "连接符",
|
|
608
|
+
mult_title: "多选",
|
|
609
|
+
items_title: "选项",
|
|
610
|
+
default_value_title: "默认值",
|
|
611
|
+
items_title_title: "名",
|
|
612
|
+
items_value_title: "值",
|
|
613
|
+
exts_title: "扩展",
|
|
614
|
+
underline_title: "下划线",
|
|
615
|
+
expand_title: "展开"
|
|
616
|
+
},
|
|
617
|
+
getItems: (e, t) => (console.log("getItems", e, t), new Promise((e => {
|
|
618
|
+
setTimeout((() => {
|
|
619
|
+
e([{
|
|
620
|
+
title: "张三",
|
|
621
|
+
value: "zhangsan"
|
|
622
|
+
}, {
|
|
623
|
+
title: "李四",
|
|
624
|
+
value: "lishi"
|
|
625
|
+
}, {
|
|
626
|
+
title: "王五",
|
|
627
|
+
value: "wangwu"
|
|
628
|
+
}, {
|
|
629
|
+
title: "Tom",
|
|
630
|
+
value: "tom"
|
|
631
|
+
}, {
|
|
632
|
+
title: "Tony",
|
|
633
|
+
value: "tony"
|
|
634
|
+
}, {
|
|
635
|
+
title: "Mery",
|
|
636
|
+
value: "mery"
|
|
637
|
+
}, {
|
|
638
|
+
title: "test",
|
|
639
|
+
value: "test"
|
|
640
|
+
}, {
|
|
641
|
+
title: "张三丰",
|
|
642
|
+
value: "zhangsanfeng"
|
|
643
|
+
}, {
|
|
644
|
+
title: "欧阳啦啦欧阳啦啦欧阳啦啦欧阳啦啦欧阳啦啦",
|
|
645
|
+
value: "欧阳啦啦"
|
|
646
|
+
}, {
|
|
647
|
+
title: "张三",
|
|
648
|
+
value: "zhangsan"
|
|
649
|
+
}, {
|
|
650
|
+
title: "李四",
|
|
651
|
+
value: "lishi"
|
|
652
|
+
}, {
|
|
653
|
+
title: "王五",
|
|
654
|
+
value: "wangwu"
|
|
655
|
+
}, {
|
|
656
|
+
title: "Tom",
|
|
657
|
+
value: "tom"
|
|
658
|
+
}, {
|
|
659
|
+
title: "Tony",
|
|
660
|
+
value: "tony"
|
|
661
|
+
}, {
|
|
662
|
+
title: "Mery",
|
|
663
|
+
value: "mery"
|
|
664
|
+
}, {
|
|
665
|
+
title: "test",
|
|
666
|
+
value: "test"
|
|
667
|
+
}, {
|
|
668
|
+
title: "张三丰",
|
|
669
|
+
value: "zhangsanfeng"
|
|
670
|
+
}, {
|
|
671
|
+
title: "欧阳啦啦",
|
|
672
|
+
value: "欧阳啦啦"
|
|
673
|
+
}])
|
|
674
|
+
}), 1e3)
|
|
675
|
+
})))
|
|
676
|
+
},
|
|
677
|
+
cdate: {
|
|
678
|
+
locale: {
|
|
679
|
+
insert_bar: "日期",
|
|
680
|
+
clear_bar: "清空",
|
|
681
|
+
name_title: "Name",
|
|
682
|
+
code_title: "编码",
|
|
683
|
+
panel_title: "日期",
|
|
684
|
+
not_delete_title: "禁删",
|
|
685
|
+
placeholder_title: "提示文案",
|
|
686
|
+
readonly_title: "只读",
|
|
687
|
+
format_title: "格式化*",
|
|
688
|
+
underline_title: "下划线"
|
|
689
|
+
}
|
|
690
|
+
},
|
|
691
|
+
area: {
|
|
692
|
+
locale: {
|
|
693
|
+
insert_bar: "区域",
|
|
694
|
+
panel_title: "区域",
|
|
695
|
+
script_title: "脚本",
|
|
696
|
+
def_placeholder: "区域"
|
|
697
|
+
}
|
|
698
|
+
},
|
|
699
|
+
section: {
|
|
700
|
+
locale: {
|
|
701
|
+
insert_bar: "集合",
|
|
702
|
+
panel_title: "集合",
|
|
703
|
+
script_title: "脚本",
|
|
704
|
+
def_placeholder: "集合",
|
|
705
|
+
name_title: "名称",
|
|
706
|
+
code_title: "编码"
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
cradio: {
|
|
710
|
+
locale: {
|
|
711
|
+
insert_bar: "单选",
|
|
712
|
+
name_title: "Name",
|
|
713
|
+
code_title: "编码",
|
|
714
|
+
panel_title: "单选",
|
|
715
|
+
not_delete_title: "禁删",
|
|
716
|
+
readonly_title: "只读",
|
|
717
|
+
text_title: "文本",
|
|
718
|
+
value_title: "值"
|
|
719
|
+
}
|
|
720
|
+
},
|
|
721
|
+
ccheckbox: {
|
|
722
|
+
locale: {
|
|
723
|
+
insert_bar: "多选",
|
|
724
|
+
name_title: "Name",
|
|
725
|
+
code_title: "编码",
|
|
726
|
+
panel_title: "多选",
|
|
727
|
+
not_delete_title: "禁删",
|
|
728
|
+
readonly_title: "只读",
|
|
729
|
+
text_title: "文本",
|
|
730
|
+
value_title: "值"
|
|
731
|
+
}
|
|
732
|
+
},
|
|
733
|
+
cqrcode: {
|
|
734
|
+
locale: {
|
|
735
|
+
insert_bar: "条码",
|
|
736
|
+
name_title: "名称",
|
|
737
|
+
code_title: "编码",
|
|
738
|
+
panel_title: "条码",
|
|
739
|
+
placeholder_title: "占位符",
|
|
740
|
+
w_title: "宽",
|
|
741
|
+
type_title: "类型",
|
|
742
|
+
value_title: "值",
|
|
743
|
+
qrcode_type_title: "二维码",
|
|
744
|
+
barcode_type_title: "条形码",
|
|
745
|
+
hide_title: "隐藏"
|
|
746
|
+
}
|
|
747
|
+
},
|
|
748
|
+
csign: {
|
|
749
|
+
locale: {
|
|
750
|
+
insert_bar: "签名",
|
|
751
|
+
ok_title: "确认",
|
|
752
|
+
cancel_title: "取消",
|
|
753
|
+
undo: "撤销",
|
|
754
|
+
placeholder_title: "占位符",
|
|
755
|
+
w_title: "宽",
|
|
756
|
+
h_title: "高",
|
|
757
|
+
name_title: "Name",
|
|
758
|
+
code_title: "编码",
|
|
759
|
+
panel_title: "签名",
|
|
760
|
+
not_delete_title: "禁删",
|
|
761
|
+
readonly_title: "只读",
|
|
762
|
+
exts_title: "扩展",
|
|
763
|
+
hide_title: "隐藏"
|
|
764
|
+
},
|
|
765
|
+
rightPanelInputRendered(e, t, n, r) {
|
|
766
|
+
var l;
|
|
767
|
+
if ("code" === t) {
|
|
768
|
+
const e = document.createElement("button");
|
|
769
|
+
e.innerHTML = "按钮", null === (l = n.parentElement) || void 0 === l || l.appendChild(e), e.addEventListener("click", (() => {
|
|
770
|
+
alert("设置为:code-123"), r("code-123")
|
|
771
|
+
}))
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
exportfile: {
|
|
776
|
+
locale: {
|
|
777
|
+
export_file: "导出文件",
|
|
778
|
+
docx: "导出 Word",
|
|
779
|
+
pdf: "导出 PDF"
|
|
780
|
+
}
|
|
781
|
+
},
|
|
782
|
+
custom: {
|
|
783
|
+
locale: {
|
|
784
|
+
insert_bar: "自定义控件",
|
|
785
|
+
not_delete_title: "禁删",
|
|
786
|
+
readonly_title: "只读",
|
|
787
|
+
data_title: "数据",
|
|
788
|
+
name_title: "名称",
|
|
789
|
+
code_title: "编码",
|
|
790
|
+
panel_title: "自定义控件"
|
|
791
|
+
},
|
|
792
|
+
render: (e, t, n) => {
|
|
793
|
+
const r = {
|
|
794
|
+
value: e
|
|
795
|
+
},
|
|
796
|
+
l = () => {
|
|
797
|
+
var e, n;
|
|
798
|
+
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>`
|
|
799
|
+
};
|
|
800
|
+
return e.data ? l() : (t.innerHTML = "请实现 config.custom.render 方法!", console.log("请实现 config.custom.render 方法!")), t.addEventListener("click", (() => {
|
|
801
|
+
var t;
|
|
802
|
+
const l = (null === (t = r.value.data) || void 0 === t ? void 0 : t.times) || 1;
|
|
803
|
+
n && n({
|
|
804
|
+
data: Object.assign(Object.assign({}, e.data), {
|
|
805
|
+
times: l + 1,
|
|
806
|
+
ts: Date.now()
|
|
807
|
+
})
|
|
808
|
+
})
|
|
809
|
+
})), {
|
|
810
|
+
updateDOM: e => {
|
|
811
|
+
r.value = e, l()
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
,
|
|
817
|
+
inlinecustom: {
|
|
818
|
+
locale: {
|
|
819
|
+
insert_bar: "自定义行内控件",
|
|
820
|
+
not_delete_title: "禁删",
|
|
821
|
+
readonly_title: "只读",
|
|
822
|
+
data_title: "数据",
|
|
823
|
+
name_title: "名称",
|
|
824
|
+
code_title: "编码",
|
|
825
|
+
panel_title: "自定义行内控件"
|
|
826
|
+
},
|
|
827
|
+
render: (e, t, n) => {
|
|
828
|
+
const r = {
|
|
829
|
+
value: e
|
|
830
|
+
},
|
|
831
|
+
l = () => {
|
|
832
|
+
var e, n;
|
|
833
|
+
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>`
|
|
834
|
+
};
|
|
835
|
+
return e.data ? l() : (t.innerHTML = "请实现 config.inlinecustom.render 方法!", console.log("请实现 config.inlinecustom.render 方法!")), t.addEventListener("click", (() => {
|
|
836
|
+
var t;
|
|
837
|
+
const l = (null === (t = r.value.data) || void 0 === t ? void 0 : t.times) || 1;
|
|
838
|
+
n && n({
|
|
839
|
+
data: Object.assign(Object.assign({}, e.data), {
|
|
840
|
+
times: l + 1,
|
|
841
|
+
ts: Date.now()
|
|
842
|
+
})
|
|
843
|
+
})
|
|
844
|
+
})), {
|
|
845
|
+
updateDOM: e => {
|
|
846
|
+
r.value = e, l()
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
}),
|
|
852
|
+
s = () => e(c),
|
|
853
|
+
d = n(void 0),
|
|
854
|
+
_ = e => {
|
|
855
|
+
const {
|
|
856
|
+
ready: t,
|
|
857
|
+
onError: l
|
|
858
|
+
} = e, a = n(void 0);
|
|
859
|
+
d.value || (d.value = o(e.baseUrl)), d.value.then((n => {
|
|
860
|
+
a.value = n.createEditor(Object.assign(Object.assign({}, e), {
|
|
861
|
+
config: e.config || c
|
|
862
|
+
})), t && t()
|
|
863
|
+
})).catch((e => {
|
|
864
|
+
console.error("Load Fail !", e), console.error(e), l && l(new r("Load Fo Editor Failed!", "FO_ERR_READY"))
|
|
865
|
+
}));
|
|
866
|
+
return {
|
|
867
|
+
ToolbarCommands: {
|
|
868
|
+
exportWord: function() {
|
|
869
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
870
|
+
return a.value.ToolbarCommands.exportWord()
|
|
871
|
+
},
|
|
872
|
+
exportPDF: function() {
|
|
873
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
874
|
+
return a.value.ToolbarCommands.exportPDF()
|
|
875
|
+
}
|
|
876
|
+
},
|
|
877
|
+
get pageMode() {
|
|
878
|
+
var e;
|
|
879
|
+
return (null === (e = a.value) || void 0 === e ? void 0 : e.pageMode) || "none"
|
|
880
|
+
},
|
|
881
|
+
setPageMode: function(e) {
|
|
882
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
883
|
+
return a.value.setPageMode(e)
|
|
884
|
+
},
|
|
885
|
+
setViewMode: function(e, t) {
|
|
886
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
887
|
+
return a.value.setViewMode(e, t)
|
|
888
|
+
},
|
|
889
|
+
insertText: function(e) {
|
|
890
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
891
|
+
return a.value.insertText(e)
|
|
892
|
+
},
|
|
893
|
+
insertNode: function(e) {
|
|
894
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
895
|
+
return a.value.insertNode(e)
|
|
896
|
+
},
|
|
897
|
+
print() {
|
|
898
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
899
|
+
return a.value.print()
|
|
900
|
+
},
|
|
901
|
+
focus: () => {
|
|
902
|
+
var e;
|
|
903
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
904
|
+
null === (e = a.value) || void 0 === e || e.focus()
|
|
905
|
+
},
|
|
906
|
+
toValue: () => {
|
|
907
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
908
|
+
return a.value.toValue()
|
|
909
|
+
},
|
|
910
|
+
toJSON: () => {
|
|
911
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
912
|
+
return console.warn("推荐使用 toValue"), JSON.parse(JSON.stringify(a.value.toJSON()))
|
|
913
|
+
},
|
|
914
|
+
toSchemaDOM: e => {
|
|
915
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
916
|
+
return a.value.toSchemaDOM(e)
|
|
917
|
+
},
|
|
918
|
+
toHTML: () => {
|
|
919
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
920
|
+
return a.value.toHTML()
|
|
921
|
+
},
|
|
922
|
+
isReadOnly: () => {
|
|
923
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
924
|
+
return a.value.isReadOnly()
|
|
925
|
+
},
|
|
926
|
+
setReadOnly: e => {
|
|
927
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
928
|
+
return a.value.setReadOnly(e)
|
|
929
|
+
},
|
|
930
|
+
destroy: function() {
|
|
931
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
932
|
+
return a.value.destroy()
|
|
933
|
+
},
|
|
934
|
+
getFocusNode: () => {
|
|
935
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
936
|
+
return a.value.getFocusNode()
|
|
937
|
+
},
|
|
938
|
+
queryNodesByName: e => {
|
|
939
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
940
|
+
return a.value.queryNodesByName(e)
|
|
941
|
+
},
|
|
942
|
+
queryNodesByCode: e => {
|
|
943
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
944
|
+
return a.value.queryNodesByCode(e)
|
|
945
|
+
},
|
|
946
|
+
queryNodesByType: e => {
|
|
947
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
948
|
+
return a.value.queryNodesByType(e)
|
|
949
|
+
},
|
|
950
|
+
filterNodes: e => {
|
|
951
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
952
|
+
return a.value.filterNodes(e)
|
|
953
|
+
},
|
|
954
|
+
on: function(e, t) {
|
|
955
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
956
|
+
return a.value.on(e, t)
|
|
957
|
+
},
|
|
958
|
+
off: function(e, t) {
|
|
959
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
960
|
+
return a.value.off(e, t)
|
|
961
|
+
},
|
|
962
|
+
setValue: function(e) {
|
|
963
|
+
if (!a.value) throw new Error("The editor did not complete ready !");
|
|
964
|
+
a.value.setValue(e)
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
};
|
|
968
|
+
export {
|
|
969
|
+
s as createDefaultEditorConfig, _ as createFoEditor, c as defaultConfig
|
|
970
|
+
};
|