@ctzy-web-client/plugin-component-vue 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.
Files changed (138) hide show
  1. package/package.json +43 -0
  2. package/src/advance-select/advance-operation.vue +44 -0
  3. package/src/advance-select/advance-option.vue +115 -0
  4. package/src/advance-select/advance-select.vue +343 -0
  5. package/src/advance-select/events-helpers.js +40 -0
  6. package/src/advance-select/index.js +13 -0
  7. package/src/advance-select/use-advance-option.js +58 -0
  8. package/src/advance-select/use-advance-select.js +142 -0
  9. package/src/application-slot/application-slot.js +70 -0
  10. package/src/application-slot/breadcrumb-item.vue +12 -0
  11. package/src/application-slot/header-tools-item.vue +12 -0
  12. package/src/application-slot/index.js +17 -0
  13. package/src/breadcrumb-select/breadcrumb-select.vue +97 -0
  14. package/src/breadcrumb-select/index.js +6 -0
  15. package/src/components.js +39 -0
  16. package/src/contextmenu/contextmenu-item.vue +13 -0
  17. package/src/contextmenu/contextmenu.vue +56 -0
  18. package/src/contextmenu/index.js +11 -0
  19. package/src/contextmenu/use-contextmenu.js +117 -0
  20. package/src/data-form/data-form-item.vue +49 -0
  21. package/src/data-form/data-form.vue +212 -0
  22. package/src/data-form/dynamic-component.js +24 -0
  23. package/src/data-form/form-components/Blots/AtBlot.js +32 -0
  24. package/src/data-form/form-components/bwa-date-picker.vue +43 -0
  25. package/src/data-form/form-components/bwa-date-time-picker.vue +49 -0
  26. package/src/data-form/form-components/bwa-input-float.vue +41 -0
  27. package/src/data-form/form-components/bwa-input-integer.vue +58 -0
  28. package/src/data-form/form-components/bwa-input.vue +32 -0
  29. package/src/data-form/form-components/bwa-multi-select.vue +27 -0
  30. package/src/data-form/form-components/bwa-rich-text-tinymce.vue +561 -0
  31. package/src/data-form/form-components/bwa-rich-text.vue +395 -0
  32. package/src/data-form/form-components/bwa-select.vue +67 -0
  33. package/src/data-form/form-components/bwa-textarea.vue +28 -0
  34. package/src/data-form/form-components/bwa-upload.vue +145 -0
  35. package/src/data-form/form-components/bwa-user-multi-select.vue +25 -0
  36. package/src/data-form/form-components/bwa-user-select.vue +81 -0
  37. package/src/data-form/index.js +35 -0
  38. package/src/data-table/data-column-view.vue +131 -0
  39. package/src/data-table/data-table-card.vue +81 -0
  40. package/src/data-table/data-table-column.vue +52 -0
  41. package/src/data-table/data-table.vue +426 -0
  42. package/src/data-table/dynamic-component.js +58 -0
  43. package/src/data-table/index.js +13 -0
  44. package/src/data-table/use-datatable-drag.js +156 -0
  45. package/src/datatable-settings/datatable-settings.vue +323 -0
  46. package/src/datatable-settings/index.js +6 -0
  47. package/src/date-range/date-picker.vue +115 -0
  48. package/src/date-range/date-range.vue +202 -0
  49. package/src/date-range/index.js +6 -0
  50. package/src/drag-list/constants.js +1 -0
  51. package/src/drag-list/drag-item.vue +46 -0
  52. package/src/drag-list/drag-list.vue +50 -0
  53. package/src/drag-list/index.js +6 -0
  54. package/src/drag-list/use-drag-list.js +209 -0
  55. package/src/dragable/constants.js +3 -0
  56. package/src/dragable/dragable-item.vue +19 -0
  57. package/src/dragable/dragable-operation.vue +28 -0
  58. package/src/dragable/dragable.vue +26 -0
  59. package/src/dragable/index.js +14 -0
  60. package/src/dragable/use-dragable.js +227 -0
  61. package/src/filter-panel/conditions/condition.js +35 -0
  62. package/src/filter-panel/conditions/date-range-condition.vue +35 -0
  63. package/src/filter-panel/conditions/department-condition/data.json +29537 -0
  64. package/src/filter-panel/conditions/department-condition/department-condition.vue +92 -0
  65. package/src/filter-panel/conditions/department-condition/department-node.vue +52 -0
  66. package/src/filter-panel/conditions/index.js +22 -0
  67. package/src/filter-panel/conditions/input-condition.vue +63 -0
  68. package/src/filter-panel/conditions/multi-user-condition.vue +56 -0
  69. package/src/filter-panel/conditions/multiple-menu-condition.vue +45 -0
  70. package/src/filter-panel/conditions/single-menu-condition.vue +58 -0
  71. package/src/filter-panel/conditions/single-user-condition.vue +56 -0
  72. package/src/filter-panel/filter-panel-item.vue +46 -0
  73. package/src/filter-panel/filter-panel.vue +149 -0
  74. package/src/filter-panel/index.js +17 -0
  75. package/src/filter-panel/use-filter-panel-item.js +59 -0
  76. package/src/filter-panel/use-filter-panel.js +203 -0
  77. package/src/hooks/use-data/index.js +234 -0
  78. package/src/index.js +48 -0
  79. package/src/layout/index.js +6 -0
  80. package/src/layout/layout.vue +74 -0
  81. package/src/make-installer.js +36 -0
  82. package/src/math/Rectangle.js +28 -0
  83. package/src/menu/index.js +6 -0
  84. package/src/menu/menu-item.vue +41 -0
  85. package/src/menu/menu.vue +53 -0
  86. package/src/panel/index.js +6 -0
  87. package/src/panel/panel.vue +42 -0
  88. package/src/panel-tabs/index.js +6 -0
  89. package/src/panel-tabs/panel-tabs.js +92 -0
  90. package/src/pct-filter-panel/index.js +10 -0
  91. package/src/pct-filter-panel/pct-compents/index.js +10 -0
  92. package/src/pct-filter-panel/pct-compents/pct-Input-condition.vue +63 -0
  93. package/src/pct-filter-panel/pct-compents/pct-date-range-condition.vue +60 -0
  94. package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition.vue +177 -0
  95. package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.vue +142 -0
  96. package/src/pct-filter-panel/pct-filter-panel-item.vue +46 -0
  97. package/src/pct-filter-panel/pct-filter-panel.vue +201 -0
  98. package/src/pct-filter-panel/use-filter-panel-item.js +61 -0
  99. package/src/pct-filter-panel/use-filter-panel.js +206 -0
  100. package/src/plugins.js +3 -0
  101. package/src/progress/index.js +8 -0
  102. package/src/progress/progress-item.vue +81 -0
  103. package/src/progress/progress.vue +58 -0
  104. package/src/progress/use-progress.js +66 -0
  105. package/src/utils/db.js +8 -0
  106. package/src/utils.js +263 -0
  107. package/src/where-filter-panel/index.js +0 -0
  108. package/src/where-filter-panel/use-where-filter-panel.js +28 -0
  109. package/src/where-filter-panel/where-filter-panel.vue +9 -0
  110. package/style/advance-select.scss +316 -0
  111. package/style/breadcrumb-select.scss +80 -0
  112. package/style/common/var.scss +240 -0
  113. package/style/common.scss +48 -0
  114. package/style/contextmenu.scss +58 -0
  115. package/style/data-form.scss +35 -0
  116. package/style/data-table.scss +81 -0
  117. package/style/datatable-settings.scss +125 -0
  118. package/style/date-range.scss +136 -0
  119. package/style/department-condition.scss +39 -0
  120. package/style/drag-list.scss +68 -0
  121. package/style/dragable.scss +8 -0
  122. package/style/filter-panel.scss +199 -0
  123. package/style/index.scss +22 -0
  124. package/style/input-condition.scss +30 -0
  125. package/style/layout.scss +70 -0
  126. package/style/menu.scss +184 -0
  127. package/style/mixins/_var.scss +21 -0
  128. package/style/mixins/config.scss +4 -0
  129. package/style/mixins/function.scss +62 -0
  130. package/style/mixins/mixins.scss +88 -0
  131. package/style/panel-tabs.scss +60 -0
  132. package/style/panel.scss +110 -0
  133. package/style/pct-filter-panel.scss +306 -0
  134. package/style/progress.scss +122 -0
  135. package/style/rich-text.scss +30 -0
  136. package/style/theme/theme.scss +161 -0
  137. package/style/theme/var.scss +34 -0
  138. package/style/var.scss +21 -0
@@ -0,0 +1,561 @@
1
+ <template>
2
+ <div :class="ns.b()">
3
+ <div :class="ns.e('editor')" ref="editorRef">
4
+ <TinyMCEEditor
5
+ :init="initOptions"
6
+ :disabled="disabled"
7
+ tinymceScriptSrc="/tinymce/tinymce.js"
8
+ ref="tinyMCEEditorRef"
9
+ />
10
+ </div>
11
+ </div>
12
+
13
+ <Teleport to="body">
14
+ <div :class="ns.e('at-list-wrapper')">
15
+ <div
16
+ v-if="atPersonInfos.style"
17
+ :class="ns.e('at-list')"
18
+ :style="atPersonInfos.style"
19
+ >
20
+ <div v-for="i in 4" :key="i" @click="handlePersonSelect(i)">
21
+ 用户{{ i }}
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </Teleport>
26
+ </template>
27
+
28
+ <script setup>
29
+ import {
30
+ ref,
31
+ unref,
32
+ watch,
33
+ computed,
34
+ getCurrentScope,
35
+ onScopeDispose,
36
+ onMounted,
37
+ reactive,
38
+ } from 'vue';
39
+ import { useNamespace, useService } from 'web-base-client-vue';
40
+ import TinyMCEEditor from '@tinymce/tinymce-vue';
41
+ // import Quill from 'quill';
42
+ import 'quill/dist/quill.snow.css';
43
+ import {
44
+ Observable,
45
+ Subject,
46
+ delayWhen,
47
+ filter,
48
+ from,
49
+ map,
50
+ merge,
51
+ mergeMap,
52
+ takeUntil,
53
+ tap,
54
+ timer,
55
+ } from 'rxjs';
56
+ // import { useActiveElement } from '@vueuse/core';
57
+ // import { filter, fromEvent } from 'rxjs';
58
+
59
+ defineOptions({
60
+ name: 'BwaRichText',
61
+ });
62
+
63
+ const props = defineProps({
64
+ placeholder: {
65
+ type: String,
66
+ default: '',
67
+ },
68
+ modelValue: {
69
+ type: null,
70
+ },
71
+ disabled: {
72
+ type: Boolean,
73
+ default: false,
74
+ },
75
+ });
76
+
77
+ let resolve = null;
78
+
79
+ const setupPromise = new Promise((relv) => {
80
+ resolve = relv;
81
+ });
82
+
83
+ const initOptions = {
84
+ promotion: false,
85
+ language: 'zh-Hans',
86
+ setup: resolve,
87
+ };
88
+
89
+ // const DIGIAL_LETTER_REGEXP = /^[\da-z]/i;
90
+
91
+ const emit = defineEmits(['update:modelValue']);
92
+
93
+ const ns = useNamespace('rich-text');
94
+
95
+ const fileService = useService('FileService');
96
+
97
+ /** @type {import('vue').Ref<HTMLElement>} */
98
+ const editorRef = ref(null);
99
+ const tinyMCEEditorRef = ref(null);
100
+
101
+ // const editing = computed(() => {
102
+ // const element = unref(useActiveElement());
103
+
104
+ // if (!element.classList.contains('ql-editor')) {
105
+ // return false;
106
+ // }
107
+
108
+ // const el = unref(editorRef);
109
+
110
+ // return el?.contains(element) ?? false;
111
+ // });
112
+
113
+ const currentScope = getCurrentScope();
114
+
115
+ // const toolbarOptions = [
116
+ // [{ header: [1, 2, 3, 4, 5, 6, false] }],
117
+ // [{ font: [] }],
118
+ // ['bold', 'italic', 'underline', 'strike'],
119
+ // [{ align: [] }],
120
+ // ['blockquote', 'code-block'],
121
+ // [{ header: 1 }, { header: 2 }],
122
+ // [{ list: 'ordered' }, { list: 'bullet' }],
123
+ // [{ script: 'sub' }, { script: 'super' }],
124
+ // [{ indent: '-1' }, { indent: '+1' }],
125
+ // [{ color: [] }, { background: [] }],
126
+ // ['clean'],
127
+ // ];
128
+
129
+ const value = computed({
130
+ get: () => props.modelValue || '',
131
+ set: (v) => {
132
+ emit('update:modelValue', v);
133
+ },
134
+ });
135
+
136
+ // const updateImage = async (file) => {
137
+ // if (!unref(fileService)) {
138
+ // return;
139
+ // }
140
+
141
+ // const uploadFileResult = await unref(fileService).uploadFile(file);
142
+
143
+ // if (uploadFileResult.code != 0) {
144
+ // return uploadFileResult;
145
+ // }
146
+
147
+ // const fileID = uploadFileResult.data.id;
148
+
149
+ // const filePathResult = await unref(fileService).getFilePath(fileID);
150
+
151
+ // if (filePathResult.code != 0) {
152
+ // return filePathResult;
153
+ // }
154
+
155
+ // return {
156
+ // ...filePathResult,
157
+ // data: { id: fileID, path: filePathResult.data },
158
+ // };
159
+ // };
160
+
161
+ const focusing = ref(false);
162
+
163
+ const AT_REGEXP = /[^\da-zA-Z]@[^@]*$/;
164
+
165
+ const atPersonInfos = reactive({
166
+ node: null,
167
+ content: '',
168
+ selection: null,
169
+ index: -1,
170
+ style: null,
171
+ });
172
+
173
+ const selectPersonSubject = new Subject();
174
+
175
+ const handlePersonSelect = selectPersonSubject.next.bind(selectPersonSubject);
176
+
177
+ // const handlePersonSelect = () => {
178
+ // if (!atPersonInfos.node) {
179
+ // return;
180
+ // }
181
+
182
+ // const { node, index, content } = atPersonInfos;
183
+
184
+ // const document = node.ownerDocument;
185
+
186
+ // const documentFragment = document.createDocumentFragment();
187
+
188
+ // if (index) {
189
+ // const textNode = document.createTextNode(node.data.slice(0, index));
190
+
191
+ // documentFragment.appendChild(textNode);
192
+ // }
193
+
194
+ // const span = document.createElement('span');
195
+ // span.innerText = content;
196
+
197
+ // documentFragment.appendChild(span);
198
+
199
+ // const contentEndIndex = index + content.length;
200
+ // if (contentEndIndex < node.data.length) {
201
+ // const textNode = document.createTextNode(node.data.slice(contentEndIndex));
202
+
203
+ // documentFragment.appendChild(textNode);
204
+ // }
205
+
206
+ // const parent = node.parentElement;
207
+
208
+ // parent.insertBefore(documentFragment, node);
209
+ // parent.removeChild(node);
210
+
211
+ // // console.log(
212
+ // // documentFragment
213
+ // // atPersonInfos.node.data,
214
+ // // atPersonInfos.index,
215
+ // // atPersonInfos.content.length
216
+ // // );
217
+
218
+ // // atPersonInfos.node.data;
219
+ // };
220
+
221
+ window.atPersonInfos = atPersonInfos;
222
+
223
+ onMounted(async () => {
224
+ const editor = await setupPromise;
225
+
226
+ window.editor = editor;
227
+
228
+ // const focusObservable = new Observable((observer) => {
229
+ // editor.on('focus', observer.next.bind(observer));
230
+
231
+ // return () => {
232
+ // editor.off('focus', observer.next.bind(observer));
233
+ // };
234
+ // });
235
+
236
+ // const blurObservable = new Observable((observer) => {
237
+ // editor.on('blur', observer.next.bind(observer));
238
+
239
+ // return () => {
240
+ // editor.off('blur', observer.next.bind(observer));
241
+ // };
242
+ // });
243
+
244
+ const inputObservable = new Observable((observer) => {
245
+ const next = observer.next.bind(observer);
246
+ editor.on('input', next);
247
+
248
+ return () => {
249
+ editor.off('input', next);
250
+ };
251
+ });
252
+
253
+ editor.on('change', (event) => {
254
+ console.log(event);
255
+ });
256
+
257
+ const getSelection = (event) => {
258
+ if (
259
+ typeof event.target.nodeType === 'number' &&
260
+ typeof event.target.tagName === 'string'
261
+ ) {
262
+ return event.target.ownerDocument.getSelection();
263
+ }
264
+
265
+ return event.target.iframeElement.contentDocument.getSelection();
266
+ };
267
+
268
+ const subject = new Subject();
269
+
270
+ inputObservable
271
+ .pipe(
272
+ map((event) => {
273
+ if (event.data !== '@') {
274
+ return null;
275
+ }
276
+
277
+ const selection = event.currentTarget.ownerDocument.getSelection();
278
+
279
+ const focusNode = selection.focusNode;
280
+
281
+ if (focusNode.nodeType !== Node.TEXT_NODE) {
282
+ return null;
283
+ }
284
+
285
+ const content = focusNode.data.slice(0, selection.focusOffset);
286
+
287
+ const match = content.match(AT_REGEXP);
288
+
289
+ if (!match) {
290
+ return null;
291
+ }
292
+
293
+ return {
294
+ event: event,
295
+ selection,
296
+ index: match[0].indexOf('@') + match.index,
297
+ node: focusNode,
298
+ content,
299
+ range: selection.getRangeAt(0),
300
+ };
301
+ }),
302
+ filter(Boolean),
303
+ mergeMap(({ event, index, node, content, range }) => {
304
+ const changeObservable = new Observable((observer) => {
305
+ const next = observer.next.bind(observer);
306
+ editor.on('change input undo redo', next);
307
+
308
+ return () => {
309
+ editor.off('change input undo redo', next);
310
+ };
311
+ });
312
+
313
+ return merge(from([event]), changeObservable).pipe(
314
+ delayWhen(() => timer(0)),
315
+ map((event) => {
316
+ const selection = getSelection(event);
317
+
318
+ const content = node.data.slice(index, selection.focusOffset);
319
+
320
+ console.log(content);
321
+
322
+ if (!content) {
323
+ subject.next();
324
+ return null;
325
+ }
326
+
327
+ return {
328
+ index,
329
+ node,
330
+ content,
331
+ range: selection.getRangeAt(0),
332
+ };
333
+ }),
334
+ filter(Boolean),
335
+ takeUntil(
336
+ merge(
337
+ inputObservable.pipe(filter((event) => event.data === '@')),
338
+ subject
339
+ ).pipe(
340
+ tap(() => {
341
+ atPersonInfos.node = null;
342
+ atPersonInfos.content = '';
343
+ atPersonInfos.selection = null;
344
+ atPersonInfos.index = -1;
345
+ atPersonInfos.style = null;
346
+ })
347
+ )
348
+ )
349
+ );
350
+ })
351
+ )
352
+ .subscribe(({ index, node, selection, content, range }) => {
353
+ const searchContent = content.slice(1);
354
+
355
+ const { x: offsetX, y: offsetY, height } = range.getBoundingClientRect();
356
+
357
+ const iframeElement = editor.iframeElement;
358
+ const { x: iframeX, y: iframeY } = iframeElement.getBoundingClientRect();
359
+
360
+ atPersonInfos.node = node;
361
+ atPersonInfos.content = content;
362
+ atPersonInfos.selection = selection;
363
+ atPersonInfos.index = index;
364
+ atPersonInfos.style = {
365
+ '--left': iframeX + offsetX + 'px',
366
+ '--top': iframeY + offsetY + height + 'px',
367
+ };
368
+ });
369
+
370
+ selectPersonSubject.subscribe(() => {
371
+ if (!atPersonInfos.node) {
372
+ return;
373
+ }
374
+
375
+ const { node, index, content } = atPersonInfos;
376
+
377
+ const document = node.ownerDocument;
378
+
379
+ const documentFragment = document.createDocumentFragment();
380
+
381
+ if (index) {
382
+ const textNode = document.createTextNode(node.data.slice(0, index));
383
+
384
+ documentFragment.appendChild(textNode);
385
+ }
386
+
387
+ const span = document.createElement('span');
388
+ span.innerText = content;
389
+
390
+ documentFragment.appendChild(span);
391
+
392
+ const contentEndIndex = index + content.length;
393
+ if (contentEndIndex < node.data.length) {
394
+ const textNode = document.createTextNode(
395
+ node.data.slice(contentEndIndex)
396
+ );
397
+
398
+ documentFragment.appendChild(textNode);
399
+ }
400
+
401
+ const parent = node.parentElement;
402
+
403
+ parent.insertBefore(documentFragment, node);
404
+ parent.removeChild(node);
405
+
406
+ subject.next();
407
+ });
408
+
409
+ // editor.on('keydown', (event) => {ƒ
410
+
411
+ // editor.on('focus', () => {
412
+ // focusing.value = true;
413
+ // });
414
+
415
+ // editor.on('blur', () => {
416
+ // focusing.value = false;
417
+ // });
418
+
419
+ // editor.on('input', (event) => {
420
+ // if (event.data !== '@') {
421
+ // return;
422
+ // }
423
+
424
+ // /** @type {Selection} */
425
+ // const selection = event.target.ownerDocument.getSelection();
426
+
427
+ // console.dir(selection.focusNode);
428
+
429
+ // const focusNode = selection.focusNode;
430
+
431
+ // if (focusNode.nodeType !== Node.TEXT_NODE) {
432
+ // return;
433
+ // }
434
+
435
+ // const content = focusNode.data.slice(0, selection.focusOffset);
436
+
437
+ // const match = content.match(AT_REGEXP);
438
+
439
+ // if (!match) {
440
+ // return;
441
+ // }
442
+
443
+ // const index = match.index;
444
+
445
+ // const range = selection.getRangeAt(0);
446
+
447
+ // const boundary = range.getBoundingClientRect();
448
+
449
+ // console.log(boundary);
450
+ // });
451
+
452
+ // editor.on('SelectionChange', (...args) => {
453
+ // console.log(...args);
454
+ // });
455
+
456
+ // const editor = new Quill(unref(editorRef), {
457
+ // modules: { toolbar: toolbarOptions },
458
+ // theme: 'snow',
459
+ // placeholder: props.placeholder,
460
+ // });
461
+
462
+ // window.aaa = editor;
463
+
464
+ // watch(
465
+ // value,
466
+ // (value) => {
467
+ // if (editor.root.innerHTML !== value) {
468
+ // editor.root.innerHTML = value;
469
+ // }
470
+ // },
471
+ // { immediate: true }
472
+ // );
473
+
474
+ // watch(
475
+ // computed(() => props.disabled),
476
+ // (disabled) => {
477
+ // editor.enable(!disabled);
478
+ // },
479
+ // { immediate: true }
480
+ // );
481
+
482
+ // const atPersonSubcription = fromEvent(document, 'keydown')
483
+ // .pipe(
484
+ // filter(() => unref(editing)),
485
+ // filter((/** @type {KeyboardEvent}*/ e) => e.key === '@')
486
+ // )
487
+ // .subscribe((/** @type {KeyboardEvent}*/ e) => {
488
+ // const selection = editor.getSelection();
489
+
490
+ // if (selection.index > 1) {
491
+ // const preChar = editor.getContents(
492
+ // selection.index - 1,
493
+ // selection.index
494
+ // );
495
+
496
+ // if (
497
+ // preChar.ops.length === 1 &&
498
+ // DIGIAL_LETTER_REGEXP.test(preChar.ops[0].insert)
499
+ // ) {
500
+ // return;
501
+ // }
502
+ // }
503
+
504
+ // e.preventDefault();
505
+ // e.stopPropagation();
506
+
507
+ // console.log(editor.getContents());
508
+
509
+ // // atPersionInfo.value = {
510
+ // // startIndex: selection.index,
511
+ // // endIndex: selection.index + 1,
512
+ // // };
513
+ // });
514
+
515
+ // const handleTextChange = () => {
516
+ // value.value = editor.root.innerHTML;
517
+ // };
518
+
519
+ // const handlePaste = (evt) => {
520
+ // if (
521
+ // evt.clipboardData &&
522
+ // evt.clipboardData.files &&
523
+ // evt.clipboardData.files.length
524
+ // ) {
525
+ // evt.preventDefault();
526
+ // [].forEach.call(evt.clipboardData.files, async (file) => {
527
+ // if (file.type.match(/^image\/(gif|jpe?g|a?png|bmp)/i)) {
528
+ // const filePathResult = await updateImage(file);
529
+
530
+ // if (filePathResult.code != 0) {
531
+ // return;
532
+ // }
533
+
534
+ // const fileData = filePathResult.data;
535
+
536
+ // var range = editor.getSelection();
537
+ // if (range && fileData) {
538
+ // // 在当前光标位置插入图片
539
+ // editor.insertEmbed(range.index, 'image', fileData.path);
540
+ // editor.formatText(range.index, 1, {
541
+ // alt: fileData.id,
542
+ // });
543
+ // // 将光标移动到图片后面
544
+ // editor.setSelection(range.index + 1);
545
+ // }
546
+ // }
547
+ // });
548
+ // }
549
+ // };
550
+
551
+ currentScope.run(() => {
552
+ // editor.on('text-change', handleTextChange);
553
+ // editor.root.addEventListener('paste', handlePaste);
554
+ // onScopeDispose(() => {
555
+ // editor.off('text-change', handleTextChange);
556
+ // editor.root.removeEventListener('paste', handlePaste);
557
+ // atPersonSubcription.unsubscribe();
558
+ // });
559
+ });
560
+ });
561
+ </script>