@haluo/biz 2.0.40 → 2.0.41-next.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.
@@ -2,9 +2,6 @@
2
2
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("element-plus"), require("vue"), require("@element-plus/icons-vue"), require("@haluo/util"), require("vuedraggable")) : typeof define === "function" && define.amd ? define(["exports", "element-plus", "vue", "@element-plus/icons-vue", "@haluo/util", "vuedraggable"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["haluo-biz"] = {}, global2["element-plus"], global2.Vue, global2["@element-plus/icons-vue"], global2.hUtil, global2.vuedraggable));
3
3
  })(this, function(exports2, elementPlus, vue, iconsVue, util, draggable) {
4
4
  "use strict";
5
- const _interopDefaultLegacy = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
6
- const util__default = /* @__PURE__ */ _interopDefaultLegacy(util);
7
- const draggable__default = /* @__PURE__ */ _interopDefaultLegacy(draggable);
8
5
  const __vite_glob_0_1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLBAMAAADKYGfZAAAAG1BMVEUAAAAAAABHcExSUlLz8/P////IyMifn5/k5OQx49C2AAAACXRSTlMzZgB/7//CpN1ci7LLAAABHUlEQVR4AY3TgUbAUBjF8e0NmiiAY28QIYCkXqB9GUBIT7AHCHvvss3l73Y4g3vx87ft3m8Yp+C5GZSxecyYMuZzZMqYz5EpYz5Hpoz5HJkS1uceP67N7TeYyF7r59xs9XmxlgNbj/W+6hmMua86c9vfCsbcXdV6xpYHsj53xF4msj7XYmB97oqB9bmlxcC6XIuBdbkWI2Nur3qfyFouqc0K3g05/6XI+f+GnD8F5NyZMmdvCHP2vjFX7vYyt7tZYO7p7f/JYs7NKXMZk2fMZUyeMZcxecZcxuQZcxmTZ8xlTJ4xlzF5xlzG5BlzGZNnzGVMnjGXMXnGXMbkGXMZk2fMZUyeMZcxecZcxuQZcxmTZ8xlTJ4xlzFlbB5+AVncQI3j46OFAAAAAElFTkSuQmCC";
9
6
  const __vite_glob_0_2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkU2MThGQUEzOUM3QTExRThBMkI0RDI5RUQ4MzE1NUMwIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkU2MThGQUE0OUM3QTExRThBMkI0RDI5RUQ4MzE1NUMwIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RTYxOEZBQTE5QzdBMTFFOEEyQjREMjlFRDgzMTU1QzAiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RTYxOEZBQTI5QzdBMTFFOEEyQjREMjlFRDgzMTU1QzAiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6cZvOcAAABiklEQVR42uyXu0rEQBRAs3GxtlHEIqDFioWIkA+wUBCsFKwUGxdRrHSx8Ed8gIWlIKyICKIigu0uYmFjIbIfIFqJyhrPwC3CEIvNZEKEGThMHpAcJvcxKUVR5BV5+F7BhxN0gk7QCTpBSyMMw37oLqQgYgNMt1A3lfQtyd3AMMyYSvoW5dTcMpX0LcrNw5SpZCntdouXxU974U6Te5V7FbiCAM5hrtFofOW9gj3wJnILsAhdcu8JLuR4GiY6eXDZUKxPVu8RNuAZdmFWVnMd9mEF2lBl9S7zElQxdy2fchOacCRy6tpBgtxhLkkSS4gR+IQXTW4SVk3lUgkmZKuKuT1N7htGZU4t13EW/yG3o8n9wAOMq8xF7tQkyMuGde4dPrTPOgbLcC94uQgytkVOFd61WJ1bgkHYisXckGR2rruZmhTaQApvRa63NbkqnGXVoTqNQdWq6tK6WtLKallka2atLkEysCWXuhdrktbkTDcLSvIYTmzJGQm6nyYn6ASdoBN0gv9D8FeAAQD7bZlccR+RLgAAAABJRU5ErkJggg==";
10
7
  const __vite_glob_0_3 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAA8CAYAAAAOhRhuAAAAAXNSR0IArs4c6QAAALZJREFUaEPtlLENwCAMBGEilmAOhmNMmkTp0h1BLqzoIlGdYqzzm7rWukqir9oQTENDFFcNaYgMEDdDGiIDxM2QhsgAcTMUYmjOSXWOeGutPOf9bY2s9350If00xijP+dwQFY7kW4YiL6RaNqQhMkB8K0Pp1j7dw0iaI/nWyCIvpFo29E9D6bYs3TtEc4/kbhnZ1NA/DaVb+3QPI809krtlZFNDGiIDxM2QhsgAcTOkITJAPF2GbhF2A9gQfAOGAAAAAElFTkSuQmCC";
@@ -113,7 +110,6 @@
113
110
  }
114
111
  const D = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, R = "__vueuse_ssr_handlers__";
115
112
  D[R] = D[R] || {};
116
- D[R];
117
113
  var q;
118
114
  (function(e) {
119
115
  e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
@@ -155,7 +151,7 @@
155
151
  ke({
156
152
  linear: me
157
153
  }, he);
158
- const J = (e) => (vue.pushScopeId("data-v-b46fc003"), e = e(), vue.popScopeId(), e), we = { class: "hd" }, Oe = { class: "bd" }, Ie = /* @__PURE__ */ J(() => /* @__PURE__ */ vue.createElementVNode("h3", null, "\u4E3B\u9898\u989C\u8272", -1)), Ee = { class: "tColor" }, Pe = ["onMouseover", "onClick"], Me = { class: "bColor" }, Ae = ["onMouseover", "onClick"], $e = /* @__PURE__ */ J(() => /* @__PURE__ */ vue.createElementVNode("h3", null, "\u6807\u51C6\u989C\u8272", -1)), Te = { class: "tColor" }, Be = ["onMouseover", "onClick"], Ve = {
154
+ const J = (e) => (vue.pushScopeId("data-v-b46fc003"), e = e(), vue.popScopeId(), e), we = { class: "hd" }, Oe = { class: "bd" }, Ie = /* @__PURE__ */ J(() => /* @__PURE__ */ vue.createElementVNode("h3", null, "主题颜色", -1)), Ee = { class: "tColor" }, Pe = ["onMouseover", "onClick"], Me = { class: "bColor" }, Ae = ["onMouseover", "onClick"], $e = /* @__PURE__ */ J(() => /* @__PURE__ */ vue.createElementVNode("h3", null, "标准颜色", -1)), Te = { class: "tColor" }, Be = ["onMouseover", "onClick"], Ve = {
159
155
  name: "colorPicker"
160
156
  }, Ne = /* @__PURE__ */ vue.defineComponent({
161
157
  ...Ve,
@@ -220,13 +216,13 @@
220
216
  l.stopPropagation();
221
217
  })
222
218
  }, [
223
- vue.createCommentVNode(" \u989C\u8272\u663E\u793A\u5C0F\u65B9\u5757 "),
219
+ vue.createCommentVNode(" 颜色显示小方块 "),
224
220
  vue.createElementVNode("div", {
225
221
  class: vue.normalizeClass(["colorBtn", { disabled: e.disabled }]),
226
222
  style: vue.normalizeStyle(`background-color: ${vue.unref(a)}`),
227
223
  onClick: p
228
224
  }, null, 6),
229
- vue.createCommentVNode(" \u989C\u8272\u8272\u76D8 "),
225
+ vue.createCommentVNode(" 颜色色盘 "),
230
226
  vue.createElementVNode("div", {
231
227
  class: vue.normalizeClass(["box", { open: s.value }])
232
228
  }, [
@@ -240,7 +236,7 @@
240
236
  onClick: Y,
241
237
  onMouseover: r[0] || (r[0] = (l) => d(e.defaultColor)),
242
238
  onMouseout: r[1] || (r[1] = (l) => d(""))
243
- }, "\u9ED8\u8BA4\u989C\u8272", 32)
239
+ }, "默认颜色", 32)
244
240
  ]),
245
241
  vue.createElementVNode("div", Oe, [
246
242
  Ie,
@@ -276,8 +272,8 @@
276
272
  onClick: (f) => E(l)
277
273
  }, null, 44, Be)), 64))
278
274
  ]),
279
- vue.createElementVNode("h3", { onClick: X }, "\u66F4\u591A\u989C\u8272..."),
280
- vue.createCommentVNode(" \u7528\u4EE5\u6FC0\u6D3BHTML5\u989C\u8272\u9762\u677F "),
275
+ vue.createElementVNode("h3", { onClick: X }, "更多颜色..."),
276
+ vue.createCommentVNode(" 用以激活HTML5颜色面板 "),
281
277
  vue.withDirectives(vue.createElementVNode("input", {
282
278
  type: "color",
283
279
  ref_key: "html5ColorEl",
@@ -311,7 +307,7 @@
311
307
  colorPicker: O
312
308
  };
313
309
  const style = "";
314
- const ToolBar_vue_vue_type_style_index_0_scoped_true_lang = "";
310
+ const ToolBar_vue_vue_type_style_index_0_scoped_50235bb8_lang = "";
315
311
  const ToolBar_vue_vue_type_style_index_1_lang = "";
316
312
  const _export_sfc = (sfc, props) => {
317
313
  const target = sfc.__vccOpts || sfc;
@@ -320,7 +316,7 @@
320
316
  }
321
317
  return target;
322
318
  };
323
- const _sfc_main$7 = {
319
+ const _sfc_main$8 = {
324
320
  components: {
325
321
  ElTooltip: elementPlus.ElTooltip,
326
322
  ElDivider: elementPlus.ElDivider,
@@ -341,15 +337,15 @@
341
337
  activeImgType: false,
342
338
  activeAlign: "",
343
339
  alignMethods: [
344
- { value: "left", name: "\u5DE6\u5BF9\u9F50" },
345
- { value: "right", name: "\u53F3\u5BF9\u9F50" },
346
- { value: "center", name: "\u5C45\u4E2D\u5BF9\u9F50" },
347
- { value: "justify", name: "\u4E24\u7AEF\u5BF9\u9F50" }
340
+ { value: "left", name: "左对齐" },
341
+ { value: "right", name: "右对齐" },
342
+ { value: "center", name: "居中对齐" },
343
+ { value: "justify", name: "两端对齐" }
348
344
  ],
349
345
  activeFontsize: "17",
350
346
  fontsizes: [
351
- { value: "17px", name: "17", desc: "\u9ED8\u8BA4\u6B63\u6587\u5B57\u53F7" },
352
- { value: "18px", name: "18", desc: "\u9ED8\u8BA4\u6807\u9898\u5B57\u53F7" },
347
+ { value: "17px", name: "17", desc: "默认正文字号" },
348
+ { value: "18px", name: "18", desc: "默认标题字号" },
353
349
  { value: "19px", name: "19" },
354
350
  { value: "20px", name: "20" },
355
351
  { value: "24px", name: "24" },
@@ -430,7 +426,7 @@
430
426
  this.editor.clearFormat();
431
427
  },
432
428
  setColor(val) {
433
- console.log("\u6587\u5B57\u989C\u8272");
429
+ console.log("文字颜色");
434
430
  this.updatePosition(() => {
435
431
  this.editor.setColor(val);
436
432
  });
@@ -489,6 +485,7 @@
489
485
  this.popoverVisibleList = false;
490
486
  this.popoverVisibleImg = false;
491
487
  },
488
+ // todo 富文本设置样式位置会回到顶部
492
489
  updatePosition(fn) {
493
490
  const scrollTop = document.documentElement.scrollTop;
494
491
  fn && fn();
@@ -521,13 +518,13 @@
521
518
  }
522
519
  }
523
520
  };
524
- const _hoisted_1$7 = {
521
+ const _hoisted_1$8 = {
525
522
  key: 0,
526
523
  class: "tools"
527
524
  };
528
- const _hoisted_2$7 = { class: "tools-content" };
529
- const _hoisted_3$7 = ["src"];
530
- const _hoisted_4$4 = ["src"];
525
+ const _hoisted_2$5 = { class: "tools-content" };
526
+ const _hoisted_3$5 = ["src"];
527
+ const _hoisted_4$3 = ["src"];
531
528
  const _hoisted_5$3 = ["src"];
532
529
  const _hoisted_6$2 = { class: "box" };
533
530
  const _hoisted_7$2 = ["src"];
@@ -568,9 +565,9 @@
568
565
  key: 0,
569
566
  class: "box-mask"
570
567
  };
571
- const _hoisted_30$1 = { class: "box" };
572
- const _hoisted_31$1 = ["src"];
573
- const _hoisted_32$1 = ["src"];
568
+ const _hoisted_30 = { class: "box" };
569
+ const _hoisted_31 = ["src"];
570
+ const _hoisted_32 = ["src"];
574
571
  const _hoisted_33 = ["src"];
575
572
  const _hoisted_34 = ["src"];
576
573
  const _hoisted_35 = { class: "tools-title" };
@@ -587,18 +584,18 @@
587
584
  const _hoisted_43 = ["src"];
588
585
  const _hoisted_44 = ["src"];
589
586
  const _hoisted_45 = ["src"];
590
- function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
587
+ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
591
588
  const _component_el_tooltip = vue.resolveComponent("el-tooltip");
592
589
  const _component_el_divider = vue.resolveComponent("el-divider");
593
590
  const _component_el_popover = vue.resolveComponent("el-popover");
594
591
  const _component_colorPicker = vue.resolveComponent("colorPicker");
595
592
  const _directive_click_outside = vue.resolveDirective("click-outside");
596
- return $props.editor.fontInfo ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
597
- vue.createElementVNode("div", _hoisted_2$7, [
593
+ return $props.editor.fontInfo ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
594
+ vue.createElementVNode("div", _hoisted_2$5, [
598
595
  vue.createVNode(_component_el_tooltip, {
599
596
  class: "item",
600
597
  effect: "dark",
601
- content: "\u64A4\u56DE",
598
+ content: "撤回",
602
599
  placement: "top"
603
600
  }, {
604
601
  default: vue.withCtx(() => [
@@ -610,14 +607,14 @@
610
607
  height: "40",
611
608
  alt: "",
612
609
  onClick: _cache[0] || (_cache[0] = ($event) => $options.back($event))
613
- }, null, 12, _hoisted_3$7)
610
+ }, null, 12, _hoisted_3$5)
614
611
  ]),
615
612
  _: 1
616
613
  }),
617
614
  vue.createVNode(_component_el_tooltip, {
618
615
  class: "item",
619
616
  effect: "dark",
620
- content: "\u53CD\u64A4\u56DE",
617
+ content: "反撤回",
621
618
  placement: "top"
622
619
  }, {
623
620
  default: vue.withCtx(() => [
@@ -629,7 +626,7 @@
629
626
  height: "40",
630
627
  alt: "",
631
628
  onClick: _cache[1] || (_cache[1] = ($event) => $options.forward($event))
632
- }, null, 12, _hoisted_4$4)
629
+ }, null, 12, _hoisted_4$3)
633
630
  ]),
634
631
  _: 1
635
632
  }),
@@ -640,7 +637,7 @@
640
637
  vue.createVNode(_component_el_tooltip, {
641
638
  class: "item",
642
639
  effect: "dark",
643
- content: "\u6E05\u9664\u683C\u5F0F",
640
+ content: "清除格式",
644
641
  placement: "top"
645
642
  }, {
646
643
  default: vue.withCtx(() => [
@@ -657,7 +654,7 @@
657
654
  vue.createVNode(_component_el_tooltip, {
658
655
  class: "item",
659
656
  effect: "dark",
660
- content: "\u683C\u5F0F\u5237",
657
+ content: "格式刷",
661
658
  placement: "top"
662
659
  }, {
663
660
  default: vue.withCtx(() => [
@@ -688,7 +685,7 @@
688
685
  vue.createVNode(_component_el_tooltip, {
689
686
  class: "item",
690
687
  effect: "dark",
691
- content: "\u5B57\u53F7",
688
+ content: "字号",
692
689
  placement: "top"
693
690
  }, {
694
691
  default: vue.withCtx(() => [
@@ -738,7 +735,7 @@
738
735
  vue.createVNode(_component_el_tooltip, {
739
736
  class: "item",
740
737
  effect: "dark",
741
- content: "\u6807\u9898",
738
+ content: "标题",
742
739
  placement: "top"
743
740
  }, {
744
741
  default: vue.withCtx(() => [
@@ -759,7 +756,7 @@
759
756
  vue.createVNode(_component_el_tooltip, {
760
757
  class: "item",
761
758
  effect: "dark",
762
- content: "\u52A0\u7C97",
759
+ content: "加粗",
763
760
  placement: "top"
764
761
  }, {
765
762
  default: vue.withCtx(() => [
@@ -787,7 +784,7 @@
787
784
  vue.createVNode(_component_el_tooltip, {
788
785
  class: "item",
789
786
  effect: "dark",
790
- content: "\u5217\u8868",
787
+ content: "列表",
791
788
  placement: "top"
792
789
  }, {
793
790
  default: vue.withCtx(() => [
@@ -821,13 +818,13 @@
821
818
  onClick: _cache[8] || (_cache[8] = ($event) => $options.updatePosition(() => {
822
819
  $options.setStyle("makeUnorderedList");
823
820
  }))
824
- }, "\u65E0\u5E8F\u5217\u8868"),
821
+ }, "无序列表"),
825
822
  vue.createElementVNode("li", {
826
823
  "data-editor-id": "makeHeader",
827
824
  onClick: _cache[9] || (_cache[9] = ($event) => $options.updatePosition(() => {
828
825
  $options.setStyle("makeOrderedList");
829
826
  }))
830
- }, "\u6709\u5E8F\u5217\u8868")
827
+ }, "有序列表")
831
828
  ])), [
832
829
  [_directive_click_outside, $options.handlePopover]
833
830
  ])
@@ -838,7 +835,7 @@
838
835
  vue.createVNode(_component_el_tooltip, {
839
836
  class: "item",
840
837
  effect: "dark",
841
- content: "\u503E\u659C",
838
+ content: "倾斜",
842
839
  placement: "top"
843
840
  }, {
844
841
  default: vue.withCtx(() => [
@@ -858,7 +855,7 @@
858
855
  vue.createVNode(_component_el_tooltip, {
859
856
  class: "item",
860
857
  effect: "dark",
861
- content: "\u4E0B\u5212\u7EBF",
858
+ content: "下划线",
862
859
  placement: "top"
863
860
  }, {
864
861
  default: vue.withCtx(() => [
@@ -879,18 +876,18 @@
879
876
  key: 0,
880
877
  class: "item",
881
878
  effect: "dark",
882
- content: "\u94FE\u63A5",
879
+ content: "链接",
883
880
  placement: "top"
884
881
  }, {
885
882
  default: vue.withCtx(() => [
886
- vue.createElementVNode("div", _hoisted_30$1, [
883
+ vue.createElementVNode("div", _hoisted_30, [
887
884
  vue.createElementVNode("img", {
888
885
  src: $options.getImageUrl("icon_web_link@2x.png"),
889
886
  width: "40",
890
887
  height: "40",
891
888
  alt: "",
892
889
  onClick: _cache[12] || (_cache[12] = (...args) => $options.insertLink && $options.insertLink(...args))
893
- }, null, 8, _hoisted_31$1)
890
+ }, null, 8, _hoisted_31)
894
891
  ])
895
892
  ]),
896
893
  _: 1
@@ -898,7 +895,7 @@
898
895
  vue.createVNode(_component_el_tooltip, {
899
896
  class: "item",
900
897
  effect: "dark",
901
- content: "\u9996\u884C\u7F29\u8FDB",
898
+ content: "首行缩进",
902
899
  placement: "top"
903
900
  }, {
904
901
  default: vue.withCtx(() => [
@@ -908,14 +905,14 @@
908
905
  height: "40",
909
906
  alt: "",
910
907
  onClick: _cache[13] || (_cache[13] = ($event) => $options.setStyle("setIndent"))
911
- }, null, 8, _hoisted_32$1)
908
+ }, null, 8, _hoisted_32)
912
909
  ]),
913
910
  _: 1
914
911
  }),
915
912
  vue.createVNode(_component_el_tooltip, {
916
913
  class: "item",
917
914
  effect: "dark",
918
- content: "\u6587\u5B57\u989C\u8272",
915
+ content: "文字颜色",
919
916
  placement: "top"
920
917
  }, {
921
918
  default: vue.withCtx(() => [
@@ -959,7 +956,7 @@
959
956
  vue.createVNode(_component_el_tooltip, {
960
957
  class: "item",
961
958
  effect: "dark",
962
- content: "\u5BF9\u9F50\u65B9\u5F0F",
959
+ content: "对齐方式",
963
960
  placement: "top"
964
961
  }, {
965
962
  default: vue.withCtx(() => [
@@ -1017,7 +1014,7 @@
1017
1014
  vue.createVNode(_component_el_tooltip, {
1018
1015
  class: "item",
1019
1016
  effect: "dark",
1020
- content: "\u63D2\u5165\u56FE\u7247",
1017
+ content: "插入图片",
1021
1018
  placement: "top"
1022
1019
  }, {
1023
1020
  default: vue.withCtx(() => [
@@ -1039,11 +1036,11 @@
1039
1036
  vue.createElementVNode("li", {
1040
1037
  class: vue.normalizeClass([$data.activeImgType === "normal" ? "active" : ""]),
1041
1038
  onClick: _cache[18] || (_cache[18] = ($event) => $options.insertImg("normal"))
1042
- }, vue.toDisplayString("\u4E0A\u4F20\u56FE\u7247"), 2),
1039
+ }, vue.toDisplayString("上传图片"), 2),
1043
1040
  vue.createElementVNode("li", {
1044
1041
  class: vue.normalizeClass([$data.activeImgType === "seamless" ? "active" : ""]),
1045
1042
  onClick: _cache[19] || (_cache[19] = ($event) => $options.insertImg("seamless"))
1046
- }, vue.toDisplayString("\u4E0A\u4F20\u65E0\u7F1D\u62FC\u63A5\u56FE\u7247"), 2)
1043
+ }, vue.toDisplayString("上传无缝拼接图片"), 2)
1047
1044
  ])), [
1048
1045
  [_directive_click_outside, $options.handlePopover]
1049
1046
  ])
@@ -1054,7 +1051,7 @@
1054
1051
  key: 2,
1055
1052
  class: "item",
1056
1053
  effect: "dark",
1057
- content: "\u63D2\u5165\u89C6\u9891",
1054
+ content: "插入视频",
1058
1055
  placement: "top"
1059
1056
  }, {
1060
1057
  default: vue.withCtx(() => [
@@ -1072,7 +1069,7 @@
1072
1069
  key: 3,
1073
1070
  class: "item",
1074
1071
  effect: "dark",
1075
- content: "\u63D2\u5165\u6587\u7AE0/\u89C6\u9891",
1072
+ content: "插入文章/视频",
1076
1073
  placement: "top"
1077
1074
  }, {
1078
1075
  default: vue.withCtx(() => [
@@ -1090,7 +1087,7 @@
1090
1087
  key: 4,
1091
1088
  class: "item",
1092
1089
  effect: "dark",
1093
- content: "\u91C7\u96C6\u6587\u7AE0",
1090
+ content: "采集文章",
1094
1091
  placement: "top"
1095
1092
  }, {
1096
1093
  default: vue.withCtx(() => [
@@ -1107,17 +1104,15 @@
1107
1104
  ])
1108
1105
  ])) : vue.createCommentVNode("", true);
1109
1106
  }
1110
- const ToolBar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$3], ["__scopeId", "data-v-52e48332"]]);
1107
+ const ToolBar = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$4], ["__scopeId", "data-v-50235bb8"]]);
1111
1108
  const __vite_glob_0_0 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAmCAYAAAClI5npAAAA0UlEQVR42uWYwQnDMAxFfckAXkFDmGzgS1foDpnFS3gTb+IFtIDyA4UeBKUtNR8qwTvlkAdyfmSletySmRUwgIIJOijXs9VcLxegwNVDRFYLdHtdCg6wrRKY9l4NUFYIqH1WDeTfCXxXE9w5Ar4tQhBwh7SBjSDg2lJJAj47SAI+OwgC7pDuJAGfHQQBnx0kAZ8dBAF3SOtTgCchybjV2QLKFpihW6BAQn6GA0i4KG4g037H4QaSDiTWUMocyweQcFezBjLrer5TFxR/uaKhL6lOdeUQ8G6X1pQAAAAASUVORK5CYII=";
1112
- const index_vue_vue_type_style_index_0_lang$4 = "";
1113
- const _hoisted_1$6 = { key: 0 };
1114
- const _hoisted_2$6 = { class: "basic-dialog_title" };
1115
- const _hoisted_3$6 = /* @__PURE__ */ vue.createElementVNode("span", { class: "basic-dialog_divider" }, null, -1);
1116
- const _hoisted_4$3 = {
1109
+ const _hoisted_1$7 = { key: 0 };
1110
+ const _hoisted_2$4 = { class: "basic-dialog_title" };
1111
+ const _hoisted_3$4 = {
1117
1112
  key: 0,
1118
1113
  class: "dialog-footer"
1119
1114
  };
1120
- const _sfc_main$6 = vue.defineComponent({
1115
+ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
1121
1116
  __name: "index",
1122
1117
  props: {
1123
1118
  visible: { type: Boolean, default: false },
@@ -1158,24 +1153,24 @@
1158
1153
  class: vue.normalizeClass(["basic-dialog", { "hide-title": !_ctx.showTitle }])
1159
1154
  }, {
1160
1155
  header: vue.withCtx(() => [
1161
- _ctx.showTitle ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
1162
- vue.createElementVNode("div", _hoisted_2$6, [
1163
- _hoisted_3$6,
1156
+ _ctx.showTitle ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
1157
+ vue.createElementVNode("div", _hoisted_2$4, [
1158
+ _cache[1] || (_cache[1] = vue.createElementVNode("span", { class: "basic-dialog_divider" }, null, -1)),
1164
1159
  vue.renderSlot(_ctx.$slots, "title")
1165
1160
  ])
1166
1161
  ])) : vue.createCommentVNode("", true)
1167
1162
  ]),
1168
1163
  footer: vue.withCtx(() => [
1169
- _ctx.showBtn ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$3, [
1164
+ _ctx.showBtn ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$4, [
1170
1165
  vue.createVNode(vue.unref(elementPlus.ElButton), {
1171
1166
  style: { "width": "120px", "border-color": "#cccccc", "color": "#333333" },
1172
1167
  plain: "",
1173
1168
  round: "",
1174
1169
  onClick: handleClose
1175
1170
  }, {
1176
- default: vue.withCtx(() => [
1177
- vue.createTextVNode("\u53D6\u6D88")
1178
- ]),
1171
+ default: vue.withCtx(() => _cache[2] || (_cache[2] = [
1172
+ vue.createTextVNode("取消")
1173
+ ])),
1179
1174
  _: 1
1180
1175
  }),
1181
1176
  vue.createVNode(vue.unref(elementPlus.ElButton), {
@@ -1184,9 +1179,9 @@
1184
1179
  type: "primary",
1185
1180
  onClick: confirm
1186
1181
  }, {
1187
- default: vue.withCtx(() => [
1188
- vue.createTextVNode("\u786E\u8BA4")
1189
- ]),
1182
+ default: vue.withCtx(() => _cache[3] || (_cache[3] = [
1183
+ vue.createTextVNode("确认")
1184
+ ])),
1190
1185
  _: 1
1191
1186
  })
1192
1187
  ])) : vue.createCommentVNode("", true)
@@ -1199,12 +1194,14 @@
1199
1194
  };
1200
1195
  }
1201
1196
  });
1197
+ const index_vue_vue_type_style_index_0_lang$5 = "";
1202
1198
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
1203
1199
  function getDefaultExportFromCjs(x) {
1204
1200
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
1205
1201
  }
1206
- var date$1 = { exports: {} };
1207
- Object.defineProperty(date$1.exports, "__esModule", { value: true });
1202
+ var date$2 = { exports: {} };
1203
+ var date = date$2.exports;
1204
+ Object.defineProperty(date, "__esModule", { value: true });
1208
1205
  function replacementDate(data, fmt) {
1209
1206
  for (var k in data) {
1210
1207
  if (new RegExp("(" + k + ")").test(fmt)) {
@@ -1219,126 +1216,130 @@
1219
1216
  }
1220
1217
  return fmt;
1221
1218
  }
1222
- var DateClass = function() {
1223
- function DateClass2() {
1224
- }
1225
- DateClass2.prototype.format = function(date2, fmt) {
1226
- if (fmt === void 0) {
1227
- fmt = "YYYY-MM-DD HH:mm:ss";
1228
- }
1229
- if (!date2)
1230
- return "";
1231
- var timeData = typeof date2 === "string" ? new Date(date2.replace(/-/g, "/")) : date2;
1232
- timeData = typeof date2 === "number" ? new Date(date2) : timeData;
1233
- var o = {
1234
- "M+": timeData.getMonth() + 1,
1235
- "D+": timeData.getDate(),
1236
- "h+": timeData.getHours() % 12 === 0 ? 12 : timeData.getHours() % 12,
1237
- "H+": timeData.getHours(),
1238
- "m+": timeData.getMinutes(),
1239
- "s+": timeData.getSeconds(),
1240
- "q+": Math.floor((timeData.getMonth() + 3) / 3),
1241
- "S": timeData.getMilliseconds()
1219
+ var DateClass = (
1220
+ /** @class */
1221
+ function() {
1222
+ function DateClass2() {
1223
+ }
1224
+ DateClass2.prototype.format = function(date2, fmt) {
1225
+ if (fmt === void 0) {
1226
+ fmt = "YYYY-MM-DD HH:mm:ss";
1227
+ }
1228
+ if (!date2)
1229
+ return "";
1230
+ var timeData = typeof date2 === "string" ? new Date(date2.replace(/-/g, "/")) : date2;
1231
+ timeData = typeof date2 === "number" ? new Date(date2) : timeData;
1232
+ var o = {
1233
+ "M+": timeData.getMonth() + 1,
1234
+ "D+": timeData.getDate(),
1235
+ "h+": timeData.getHours() % 12 === 0 ? 12 : timeData.getHours() % 12,
1236
+ "H+": timeData.getHours(),
1237
+ "m+": timeData.getMinutes(),
1238
+ "s+": timeData.getSeconds(),
1239
+ "q+": Math.floor((timeData.getMonth() + 3) / 3),
1240
+ "S": timeData.getMilliseconds()
1241
+ };
1242
+ var week = {
1243
+ "0": "日",
1244
+ "1": "一",
1245
+ "2": "二",
1246
+ "3": "三",
1247
+ "4": "四",
1248
+ "5": "五",
1249
+ "6": "六"
1250
+ };
1251
+ fmt = replacementYear(timeData, fmt);
1252
+ if (/(E+)/.test(fmt)) {
1253
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length > 1 ? RegExp.$1.length > 2 ? "星期" : "周" : "") + week["".concat(timeData.getDay(), " ")]);
1254
+ }
1255
+ return replacementDate(o, fmt);
1242
1256
  };
1243
- var week = {
1244
- "0": "\u65E5",
1245
- "1": "\u4E00",
1246
- "2": "\u4E8C",
1247
- "3": "\u4E09",
1248
- "4": "\u56DB",
1249
- "5": "\u4E94",
1250
- "6": "\u516D"
1257
+ DateClass2.prototype.addDaysToDate = function(date2, days) {
1258
+ var d = typeof date2 === "object" ? date2 : new Date(date2);
1259
+ d.setDate(d.getDate() + days);
1260
+ return d.toISOString().split("T")[0];
1251
1261
  };
1252
- fmt = replacementYear(timeData, fmt);
1253
- if (/(E+)/.test(fmt)) {
1254
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length > 1 ? RegExp.$1.length > 2 ? "\u661F\u671F" : "\u5468" : "") + week["".concat(timeData.getDay(), " ")]);
1255
- }
1256
- return replacementDate(o, fmt);
1257
- };
1258
- DateClass2.prototype.addDaysToDate = function(date2, days) {
1259
- var d = typeof date2 === "object" ? date2 : new Date(date2);
1260
- d.setDate(d.getDate() + days);
1261
- return d.toISOString().split("T")[0];
1262
- };
1263
- DateClass2.prototype.remainTime = function(endTime, startTime) {
1264
- if (startTime === void 0) {
1265
- startTime = new Date();
1266
- }
1267
- var ts = Number(endTime) - Number(startTime);
1268
- var dd = Math.floor(ts / 1e3 / 60 / 60 / 24);
1269
- var hh = Math.floor(ts / 1e3 / 60 / 60 % 24);
1270
- var mm = Math.floor(ts / 1e3 / 60 % 60);
1271
- var ss = Math.floor(ts / 1e3 % 60);
1272
- if (ts <= 0)
1273
- return false;
1274
- return {
1275
- dd: dd < 10 ? "0".concat(dd) : dd,
1276
- hh: hh < 10 ? "0".concat(hh) : hh,
1277
- mm: mm < 10 ? "0".concat(mm) : mm,
1278
- ss: ss < 10 ? "0".concat(ss) : ss
1262
+ DateClass2.prototype.remainTime = function(endTime, startTime) {
1263
+ if (startTime === void 0) {
1264
+ startTime = /* @__PURE__ */ new Date();
1265
+ }
1266
+ var ts = Number(endTime) - Number(startTime);
1267
+ var dd = Math.floor(ts / 1e3 / 60 / 60 / 24);
1268
+ var hh = Math.floor(ts / 1e3 / 60 / 60 % 24);
1269
+ var mm = Math.floor(ts / 1e3 / 60 % 60);
1270
+ var ss = Math.floor(ts / 1e3 % 60);
1271
+ if (ts <= 0)
1272
+ return false;
1273
+ return {
1274
+ dd: dd < 10 ? "0".concat(dd) : dd,
1275
+ hh: hh < 10 ? "0".concat(hh) : hh,
1276
+ mm: mm < 10 ? "0".concat(mm) : mm,
1277
+ ss: ss < 10 ? "0".concat(ss) : ss
1278
+ };
1279
1279
  };
1280
- };
1281
- DateClass2.prototype.formatPassTime = function(startTime) {
1282
- var currentTime = new Date();
1283
- var time = currentTime - startTime;
1284
- var year = Math.floor(time / (1e3 * 60 * 60 * 24) / 30 / 12);
1285
- if (year)
1286
- return "".concat(year, "\u5E74\u524D");
1287
- var month = Math.floor(time / (1e3 * 60 * 60 * 24) / 30);
1288
- if (month)
1289
- return "".concat(month, "\u4E2A\u6708\u524D");
1290
- var day = Math.floor(time / (1e3 * 60 * 60 * 24));
1291
- if (day)
1292
- return "".concat(day, "\u5929\u524D");
1293
- var hour = Math.floor(time / (1e3 * 60 * 60));
1294
- if (hour)
1295
- return "".concat(hour, "\u5C0F\u65F6\u524D");
1296
- var min = Math.floor(time / (1e3 * 60));
1297
- if (min)
1298
- return "".concat(min, "\u5206\u949F\u524D");
1299
- else
1300
- return "\u521A\u521A";
1301
- };
1302
- DateClass2.prototype.formatPassTimeForList = function(time) {
1303
- return DateClass2.prototype.formatPassTimeForDetail(time, "YYYY\u5E74MM\u6708DD\u65E5", true);
1304
- };
1305
- DateClass2.prototype.formatPassTimeForDetail = function(time, fmt, noYear) {
1306
- if (fmt === void 0) {
1307
- fmt = "YYYY-MM-DD";
1308
- }
1309
- var date2 = typeof time === "number" ? new Date(time) : new Date((time || "").replace(/-/g, "/"));
1310
- var diff = (new Date().getTime() - date2.getTime()) / 1e3;
1311
- var dayDiff = Math.floor(diff / 86400);
1312
- var isValidDate = Object.prototype.toString.call(date2) === "[object Date]" && !isNaN(date2.getTime());
1313
- if (!isValidDate)
1314
- return "";
1315
- var formatDate = function() {
1316
- var today = new Date(date2);
1317
- var o = {
1318
- "Y+": today.getFullYear(),
1319
- "M+": ("0" + (today.getMonth() + 1)).slice(-2),
1320
- "D+": ("0" + today.getDate()).slice(-2)
1280
+ DateClass2.prototype.formatPassTime = function(startTime) {
1281
+ var currentTime = /* @__PURE__ */ new Date();
1282
+ var time = currentTime - startTime;
1283
+ var year = Math.floor(time / (1e3 * 60 * 60 * 24) / 30 / 12);
1284
+ if (year)
1285
+ return "".concat(year, "年前");
1286
+ var month = Math.floor(time / (1e3 * 60 * 60 * 24) / 30);
1287
+ if (month)
1288
+ return "".concat(month, "个月前");
1289
+ var day = Math.floor(time / (1e3 * 60 * 60 * 24));
1290
+ if (day)
1291
+ return "".concat(day, "天前");
1292
+ var hour = Math.floor(time / (1e3 * 60 * 60));
1293
+ if (hour)
1294
+ return "".concat(hour, "小时前");
1295
+ var min = Math.floor(time / (1e3 * 60));
1296
+ if (min)
1297
+ return "".concat(min, "分钟前");
1298
+ else
1299
+ return "刚刚";
1300
+ };
1301
+ DateClass2.prototype.formatPassTimeForList = function(time) {
1302
+ return DateClass2.prototype.formatPassTimeForDetail(time, "YYYY年MM月DD日", true);
1303
+ };
1304
+ DateClass2.prototype.formatPassTimeForDetail = function(time, fmt, noYear) {
1305
+ if (fmt === void 0) {
1306
+ fmt = "YYYY-MM-DD";
1307
+ }
1308
+ var date2 = typeof time === "number" ? new Date(time) : new Date((time || "").replace(/-/g, "/"));
1309
+ var diff = ((/* @__PURE__ */ new Date()).getTime() - date2.getTime()) / 1e3;
1310
+ var dayDiff = Math.floor(diff / 86400);
1311
+ var isValidDate = Object.prototype.toString.call(date2) === "[object Date]" && !isNaN(date2.getTime());
1312
+ if (!isValidDate)
1313
+ return "";
1314
+ var formatDate = function() {
1315
+ var today = new Date(date2);
1316
+ var o = {
1317
+ "Y+": today.getFullYear(),
1318
+ "M+": ("0" + (today.getMonth() + 1)).slice(-2),
1319
+ "D+": ("0" + today.getDate()).slice(-2)
1320
+ };
1321
+ fmt = replacementYear(date2, fmt);
1322
+ var year = today.getFullYear();
1323
+ if (!((/* @__PURE__ */ new Date()).getFullYear() > year) && noYear) {
1324
+ var backData = replacementDate(o, fmt);
1325
+ return backData.split("年")[1];
1326
+ }
1327
+ return replacementDate(o, fmt);
1321
1328
  };
1322
- fmt = replacementYear(date2, fmt);
1323
- var year = today.getFullYear();
1324
- if (!(new Date().getFullYear() > year) && noYear) {
1325
- var backData = replacementDate(o, fmt);
1326
- return backData.split("\u5E74")[1];
1329
+ if (dayDiff === -1) {
1330
+ return "刚刚";
1331
+ } else if (isNaN(dayDiff) || dayDiff < 0 || dayDiff >= 15) {
1332
+ return formatDate();
1327
1333
  }
1328
- return replacementDate(o, fmt);
1334
+ return dayDiff === 0 && (diff < 60 && "刚刚" || diff < 120 && "1分钟前" || diff < 3600 && Math.floor(diff / 60) + "分钟前" || diff < 7200 && "1小时前" || diff < 86400 && Math.floor(diff / 3600) + "小时前") || dayDiff < 16 && dayDiff + "天前";
1329
1335
  };
1330
- if (dayDiff === -1) {
1331
- return "\u521A\u521A";
1332
- } else if (isNaN(dayDiff) || dayDiff < 0 || dayDiff >= 15) {
1333
- return formatDate();
1334
- }
1335
- return dayDiff === 0 && (diff < 60 && "\u521A\u521A" || diff < 120 && "1\u5206\u949F\u524D" || diff < 3600 && Math.floor(diff / 60) + "\u5206\u949F\u524D" || diff < 7200 && "1\u5C0F\u65F6\u524D" || diff < 86400 && Math.floor(diff / 3600) + "\u5C0F\u65F6\u524D") || dayDiff < 16 && dayDiff + "\u5929\u524D";
1336
- };
1337
- return DateClass2;
1338
- }();
1339
- date$1.exports = new DateClass();
1340
- const date = /* @__PURE__ */ getDefaultExportFromCjs(date$1.exports);
1341
- var tools$1 = { exports: {} };
1336
+ return DateClass2;
1337
+ }()
1338
+ );
1339
+ date$2.exports = new DateClass();
1340
+ var dateExports = date$2.exports;
1341
+ const date$1 = /* @__PURE__ */ getDefaultExportFromCjs(dateExports);
1342
+ var tools$2 = { exports: {} };
1342
1343
  var _listCacheClear;
1343
1344
  var hasRequired_listCacheClear;
1344
1345
  function require_listCacheClear() {
@@ -2245,6 +2246,7 @@
2245
2246
  stubFalse_1 = stubFalse;
2246
2247
  return stubFalse_1;
2247
2248
  }
2249
+ isBuffer.exports;
2248
2250
  var hasRequiredIsBuffer;
2249
2251
  function requireIsBuffer() {
2250
2252
  if (hasRequiredIsBuffer)
@@ -2324,6 +2326,7 @@
2324
2326
  return _baseUnary;
2325
2327
  }
2326
2328
  var _nodeUtil = { exports: {} };
2329
+ _nodeUtil.exports;
2327
2330
  var hasRequired_nodeUtil;
2328
2331
  function require_nodeUtil() {
2329
2332
  if (hasRequired_nodeUtil)
@@ -2373,7 +2376,11 @@
2373
2376
  function arrayLikeKeys(value, inherited) {
2374
2377
  var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer2(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
2375
2378
  for (var key in value) {
2376
- if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
2379
+ if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
2380
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
2381
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
2382
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
2383
+ isIndex(key, length)))) {
2377
2384
  result.push(key);
2378
2385
  }
2379
2386
  }
@@ -2553,6 +2560,7 @@
2553
2560
  return _baseAssignIn;
2554
2561
  }
2555
2562
  var _cloneBuffer = { exports: {} };
2563
+ _cloneBuffer.exports;
2556
2564
  var hasRequired_cloneBuffer;
2557
2565
  function require_cloneBuffer() {
2558
2566
  if (hasRequired_cloneBuffer)
@@ -3166,13 +3174,13 @@
3166
3174
  return cloneDeep_1;
3167
3175
  }
3168
3176
  /*! clipboard-copy. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
3169
- var _clipboardCopy_4_0_1_clipboardCopy;
3170
- var hasRequired_clipboardCopy_4_0_1_clipboardCopy;
3171
- function require_clipboardCopy_4_0_1_clipboardCopy() {
3172
- if (hasRequired_clipboardCopy_4_0_1_clipboardCopy)
3173
- return _clipboardCopy_4_0_1_clipboardCopy;
3174
- hasRequired_clipboardCopy_4_0_1_clipboardCopy = 1;
3175
- _clipboardCopy_4_0_1_clipboardCopy = clipboardCopy;
3177
+ var clipboardCopy_1;
3178
+ var hasRequiredClipboardCopy;
3179
+ function requireClipboardCopy() {
3180
+ if (hasRequiredClipboardCopy)
3181
+ return clipboardCopy_1;
3182
+ hasRequiredClipboardCopy = 1;
3183
+ clipboardCopy_1 = clipboardCopy;
3176
3184
  function makeError() {
3177
3185
  return new DOMException("The request is not allowed", "NotAllowedError");
3178
3186
  }
@@ -3215,266 +3223,270 @@
3215
3223
  }
3216
3224
  }
3217
3225
  }
3218
- return _clipboardCopy_4_0_1_clipboardCopy;
3226
+ return clipboardCopy_1;
3219
3227
  }
3220
- Object.defineProperty(tools$1.exports, "__esModule", { value: true });
3228
+ var tools = tools$2.exports;
3229
+ Object.defineProperty(tools, "__esModule", { value: true });
3221
3230
  var previous = 0;
3222
3231
  var timeout = null;
3223
- var ToolsClass = function() {
3224
- function ToolsClass2() {
3225
- var _this = this;
3226
- this.stopScroll = function(className) {
3227
- if (!(window && window.document)) {
3228
- return new Error("\u4EC5\u652F\u6301\u6D4F\u89C8\u5668");
3229
- }
3230
- var html = document.documentElement;
3231
- html.style.overflow = "hidden";
3232
- html.style.height = "100%";
3233
- var body = document.body;
3234
- body.style.overflow = "hidden";
3235
- body.style.height = "100%";
3236
- if (className) {
3237
- var dom = document.querySelector(".".concat(className));
3238
- dom && dom.addEventListener("touchmove", _this.__setDefault__);
3232
+ var ToolsClass = (
3233
+ /** @class */
3234
+ function() {
3235
+ function ToolsClass2() {
3236
+ var _this = this;
3237
+ this.stopScroll = function(className) {
3238
+ if (!(window && window.document)) {
3239
+ return new Error("仅支持浏览器");
3240
+ }
3241
+ var html = document.documentElement;
3242
+ html.style.overflow = "hidden";
3243
+ html.style.height = "100%";
3244
+ var body = document.body;
3245
+ body.style.overflow = "hidden";
3246
+ body.style.height = "100%";
3247
+ if (className) {
3248
+ var dom = document.querySelector(".".concat(className));
3249
+ dom && dom.addEventListener("touchmove", _this.__setDefault__);
3250
+ }
3251
+ };
3252
+ this.startScroll = function(className) {
3253
+ if (!(window && window.document)) {
3254
+ return new Error("仅支持浏览器");
3255
+ }
3256
+ var html = document.documentElement;
3257
+ html.style.overflow = "visible";
3258
+ html.style.height = "auto";
3259
+ var body = document.body;
3260
+ body.style.overflow = "visible";
3261
+ body.style.height = "auto";
3262
+ if (className) {
3263
+ var dom = document.querySelector(".".concat(className));
3264
+ dom && dom.removeEventListener("touchmove", _this.__setDefault__);
3265
+ }
3266
+ };
3267
+ this.objectToArray = function(obj) {
3268
+ var arr = [];
3269
+ if (typeof obj === "object") {
3270
+ for (var key in obj) {
3271
+ if (obj.hasOwnProperty(key)) {
3272
+ arr.push([key, obj[key]].join("="));
3273
+ }
3274
+ }
3275
+ }
3276
+ return arr;
3277
+ };
3278
+ this.convertKeyValueEnum = function(obj) {
3279
+ var result = {};
3280
+ if (typeof obj === "object") {
3281
+ for (var key in obj) {
3282
+ if (obj.hasOwnProperty(key)) {
3283
+ result[obj[key]] = key;
3284
+ }
3285
+ }
3286
+ }
3287
+ return result;
3288
+ };
3289
+ this.isDefined = function(val) {
3290
+ return val !== void 0 && val !== null;
3291
+ };
3292
+ this.__loaded__ = {};
3293
+ this.__setDefault__ = function(e) {
3294
+ e && e.preventDefault();
3295
+ };
3296
+ }
3297
+ ToolsClass2.prototype.deepCopy = function(data) {
3298
+ return JSON.parse(JSON.stringify(data));
3299
+ };
3300
+ ToolsClass2.prototype.deepCopy2 = function(obj) {
3301
+ var _obj = Array.isArray(obj) ? [] : {};
3302
+ for (var i in obj) {
3303
+ _obj[i] = typeof obj[i] === "object" ? this.deepCopy2(obj[i]) : obj[i];
3239
3304
  }
3305
+ return _obj;
3306
+ };
3307
+ ToolsClass2.prototype.deepCopy3 = function(obj) {
3308
+ var deepcopy = requireCloneDeep();
3309
+ return deepcopy(obj);
3310
+ };
3311
+ ToolsClass2.prototype.debounce = function(func, wait) {
3312
+ var delay = function() {
3313
+ var args = arguments;
3314
+ if (timeout)
3315
+ clearTimeout(timeout);
3316
+ timeout = setTimeout(function() {
3317
+ func.apply(delay, args);
3318
+ }, wait);
3319
+ };
3320
+ return delay;
3240
3321
  };
3241
- this.startScroll = function(className) {
3322
+ ToolsClass2.prototype.throttle = function(func, wait) {
3323
+ var delay = function() {
3324
+ var now = Date.now();
3325
+ if (now - previous > wait) {
3326
+ func.apply(delay, arguments);
3327
+ previous = now;
3328
+ }
3329
+ };
3330
+ return delay;
3331
+ };
3332
+ ToolsClass2.prototype.getUrlName = function(url) {
3333
+ return url && url.split("?")[0].split("/").reverse()[0];
3334
+ };
3335
+ ToolsClass2.prototype.loadJs = function(url) {
3336
+ var _this = this;
3337
+ if (!(window && window.document)) {
3338
+ return new Error("仅支持浏览器");
3339
+ }
3340
+ var name = this.getUrlName(url);
3341
+ var id = "js_" + name;
3342
+ return new Promise(function(resolve, reject) {
3343
+ if (_this.__loaded__[id]) {
3344
+ return resolve();
3345
+ }
3346
+ var script = document.createElement("script");
3347
+ script.type = "text/javascript";
3348
+ script.async = true;
3349
+ script.src = url;
3350
+ script.id = id;
3351
+ script.onload = function() {
3352
+ _this.__loaded__[id] = true;
3353
+ resolve();
3354
+ };
3355
+ script.onerror = function(e) {
3356
+ reject(e);
3357
+ };
3358
+ document.body.appendChild(script);
3359
+ });
3360
+ };
3361
+ ToolsClass2.prototype.loadCss = function(url) {
3362
+ var _this = this;
3363
+ if (!(window && window.document)) {
3364
+ return new Error("仅支持浏览器");
3365
+ }
3366
+ var name = this.getUrlName(url);
3367
+ var id = "css_" + name;
3368
+ return new Promise(function(resolve, reject) {
3369
+ if (_this.__loaded__[id]) {
3370
+ return resolve();
3371
+ }
3372
+ var link = document.createElement("link");
3373
+ link.type = "text/css";
3374
+ link.rel = "stylesheet";
3375
+ link.href = url;
3376
+ link.id = id;
3377
+ link.onload = function() {
3378
+ _this.__loaded__[id] = true;
3379
+ resolve();
3380
+ };
3381
+ link.onerror = function(e) {
3382
+ reject(e);
3383
+ };
3384
+ document.head.appendChild(link);
3385
+ });
3386
+ };
3387
+ ToolsClass2.prototype.clipboard = function(str) {
3242
3388
  if (!(window && window.document)) {
3243
- return new Error("\u4EC5\u652F\u6301\u6D4F\u89C8\u5668");
3244
- }
3245
- var html = document.documentElement;
3246
- html.style.overflow = "visible";
3247
- html.style.height = "auto";
3248
- var body = document.body;
3249
- body.style.overflow = "visible";
3250
- body.style.height = "auto";
3251
- if (className) {
3252
- var dom = document.querySelector(".".concat(className));
3253
- dom && dom.removeEventListener("touchmove", _this.__setDefault__);
3389
+ return new Error("仅支持浏览器");
3254
3390
  }
3391
+ var copy = requireClipboardCopy();
3392
+ return copy(str);
3255
3393
  };
3256
- this.objectToArray = function(obj) {
3257
- var arr = [];
3258
- if (typeof obj === "object") {
3259
- for (var key in obj) {
3260
- if (obj.hasOwnProperty(key)) {
3261
- arr.push([key, obj[key]].join("="));
3262
- }
3263
- }
3394
+ ToolsClass2.prototype.firstUpperCase = function(str) {
3395
+ return str.charAt(0).toUpperCase() + str.toString().slice(1);
3396
+ };
3397
+ ToolsClass2.prototype.slice = function(target, length) {
3398
+ if (target === void 0) {
3399
+ target = "";
3400
+ }
3401
+ if (length === void 0) {
3402
+ length = 0;
3264
3403
  }
3265
- return arr;
3404
+ return target.slice(0, length);
3266
3405
  };
3267
- this.convertKeyValueEnum = function(obj) {
3268
- var result = {};
3269
- if (typeof obj === "object") {
3270
- for (var key in obj) {
3271
- if (obj.hasOwnProperty(key)) {
3272
- result[obj[key]] = key;
3273
- }
3274
- }
3406
+ ToolsClass2.prototype.guid = function() {
3407
+ function S4() {
3408
+ return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
3275
3409
  }
3276
- return result;
3410
+ return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
3277
3411
  };
3278
- this.isDefined = function(val) {
3279
- return val !== void 0 && val !== null;
3412
+ ToolsClass2.prototype.getBytesOfText = function(str) {
3413
+ if (str === void 0) {
3414
+ str = "";
3415
+ }
3416
+ return str.replace(/[^\u0000-\u00ff]/g, "aa").length;
3280
3417
  };
3281
- this.__loaded__ = {};
3282
- this.__setDefault__ = function(e) {
3283
- e && e.preventDefault();
3418
+ ToolsClass2.prototype.uniqueArr = function(arr) {
3419
+ return Array.from(new Set(arr));
3284
3420
  };
3285
- }
3286
- ToolsClass2.prototype.deepCopy = function(data) {
3287
- return JSON.parse(JSON.stringify(data));
3288
- };
3289
- ToolsClass2.prototype.deepCopy2 = function(obj) {
3290
- var _obj = Array.isArray(obj) ? [] : {};
3291
- for (var i in obj) {
3292
- _obj[i] = typeof obj[i] === "object" ? this.deepCopy2(obj[i]) : obj[i];
3293
- }
3294
- return _obj;
3295
- };
3296
- ToolsClass2.prototype.deepCopy3 = function(obj) {
3297
- var deepcopy = requireCloneDeep();
3298
- return deepcopy(obj);
3299
- };
3300
- ToolsClass2.prototype.debounce = function(func, wait) {
3301
- var delay = function() {
3302
- var args = arguments;
3303
- if (timeout)
3304
- clearTimeout(timeout);
3305
- timeout = setTimeout(function() {
3306
- func.apply(delay, args);
3307
- }, wait);
3421
+ ToolsClass2.prototype.swapArray = function(array, index1, index2) {
3422
+ var _a;
3423
+ _a = [array[index2], array[index1]], array[index1] = _a[0], array[index2] = _a[1];
3424
+ return array;
3308
3425
  };
3309
- return delay;
3310
- };
3311
- ToolsClass2.prototype.throttle = function(func, wait) {
3312
- var delay = function() {
3313
- var now = Date.now();
3314
- if (now - previous > wait) {
3315
- func.apply(delay, arguments);
3316
- previous = now;
3317
- }
3426
+ ToolsClass2.prototype.filterEmoji = function(str) {
3427
+ return str.replace(/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/mg, "");
3318
3428
  };
3319
- return delay;
3320
- };
3321
- ToolsClass2.prototype.getUrlName = function(url) {
3322
- return url && url.split("?")[0].split("/").reverse()[0];
3323
- };
3324
- ToolsClass2.prototype.loadJs = function(url) {
3325
- var _this = this;
3326
- if (!(window && window.document)) {
3327
- return new Error("\u4EC5\u652F\u6301\u6D4F\u89C8\u5668");
3328
- }
3329
- var name = this.getUrlName(url);
3330
- var id = "js_" + name;
3331
- return new Promise(function(resolve, reject) {
3332
- if (_this.__loaded__[id]) {
3333
- return resolve();
3334
- }
3335
- var script = document.createElement("script");
3336
- script.type = "text/javascript";
3337
- script.async = true;
3338
- script.src = url;
3339
- script.id = id;
3340
- script.onload = function() {
3341
- _this.__loaded__[id] = true;
3342
- resolve();
3343
- };
3344
- script.onerror = function(e) {
3345
- reject(e);
3346
- };
3347
- document.body.appendChild(script);
3348
- });
3349
- };
3350
- ToolsClass2.prototype.loadCss = function(url) {
3351
- var _this = this;
3352
- if (!(window && window.document)) {
3353
- return new Error("\u4EC5\u652F\u6301\u6D4F\u89C8\u5668");
3354
- }
3355
- var name = this.getUrlName(url);
3356
- var id = "css_" + name;
3357
- return new Promise(function(resolve, reject) {
3358
- if (_this.__loaded__[id]) {
3359
- return resolve();
3360
- }
3361
- var link = document.createElement("link");
3362
- link.type = "text/css";
3363
- link.rel = "stylesheet";
3364
- link.href = url;
3365
- link.id = id;
3366
- link.onload = function() {
3367
- _this.__loaded__[id] = true;
3368
- resolve();
3369
- };
3370
- link.onerror = function(e) {
3371
- reject(e);
3372
- };
3373
- document.head.appendChild(link);
3374
- });
3375
- };
3376
- ToolsClass2.prototype.clipboard = function(str) {
3377
- if (!(window && window.document)) {
3378
- return new Error("\u4EC5\u652F\u6301\u6D4F\u89C8\u5668");
3379
- }
3380
- var copy = require_clipboardCopy_4_0_1_clipboardCopy();
3381
- return copy(str);
3382
- };
3383
- ToolsClass2.prototype.firstUpperCase = function(str) {
3384
- return str.charAt(0).toUpperCase() + str.toString().slice(1);
3385
- };
3386
- ToolsClass2.prototype.slice = function(target, length) {
3387
- if (target === void 0) {
3388
- target = "";
3389
- }
3390
- if (length === void 0) {
3391
- length = 0;
3392
- }
3393
- return target.slice(0, length);
3394
- };
3395
- ToolsClass2.prototype.guid = function() {
3396
- function S4() {
3397
- return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
3398
- }
3399
- return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
3400
- };
3401
- ToolsClass2.prototype.getBytesOfText = function(str) {
3402
- if (str === void 0) {
3403
- str = "";
3404
- }
3405
- return str.replace(/[^\u0000-\u00ff]/g, "aa").length;
3406
- };
3407
- ToolsClass2.prototype.uniqueArr = function(arr) {
3408
- return Array.from(new Set(arr));
3409
- };
3410
- ToolsClass2.prototype.swapArray = function(array, index1, index2) {
3411
- var _a;
3412
- _a = [array[index2], array[index1]], array[index1] = _a[0], array[index2] = _a[1];
3413
- return array;
3414
- };
3415
- ToolsClass2.prototype.filterEmoji = function(str) {
3416
- return str.replace(/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/mg, "");
3417
- };
3418
- ToolsClass2.prototype.containsEmoji = function(str) {
3419
- var reg = /\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/mg;
3420
- return reg.test(str);
3421
- };
3422
- ToolsClass2.prototype.containsHanZi = function(str) {
3423
- var reg = /[\u4e00-\u9fa5]/mg;
3424
- return reg.test(str);
3425
- };
3426
- ToolsClass2.prototype.isEmpty = function(val) {
3427
- if (val == null)
3428
- return true;
3429
- if (typeof val === "boolean")
3429
+ ToolsClass2.prototype.containsEmoji = function(str) {
3430
+ var reg = /\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/mg;
3431
+ return reg.test(str);
3432
+ };
3433
+ ToolsClass2.prototype.containsHanZi = function(str) {
3434
+ var reg = /[\u4e00-\u9fa5]/mg;
3435
+ return reg.test(str);
3436
+ };
3437
+ ToolsClass2.prototype.isEmpty = function(val) {
3438
+ if (val == null)
3439
+ return true;
3440
+ if (typeof val === "boolean")
3441
+ return false;
3442
+ if (typeof val === "number")
3443
+ return !val;
3444
+ if (val instanceof Error)
3445
+ return val.message === "";
3446
+ switch (Object.prototype.toString.call(val)) {
3447
+ case "[object String]":
3448
+ case "[object Array]":
3449
+ return !val.length;
3450
+ case "[object File]":
3451
+ case "[object Map]":
3452
+ case "[object Set]": {
3453
+ return !val.size;
3454
+ }
3455
+ case "[object Object]": {
3456
+ return !Object.keys(val).length;
3457
+ }
3458
+ }
3430
3459
  return false;
3431
- if (typeof val === "number")
3432
- return !val;
3433
- if (val instanceof Error)
3434
- return val.message === "";
3435
- switch (Object.prototype.toString.call(val)) {
3436
- case "[object String]":
3437
- case "[object Array]":
3438
- return !val.length;
3439
- case "[object File]":
3440
- case "[object Map]":
3441
- case "[object Set]": {
3442
- return !val.size;
3443
- }
3444
- case "[object Object]": {
3445
- return !Object.keys(val).length;
3460
+ };
3461
+ ToolsClass2.prototype.sensitiveField = function(field, before, after) {
3462
+ if (before === void 0) {
3463
+ before = 3;
3446
3464
  }
3447
- }
3448
- return false;
3449
- };
3450
- ToolsClass2.prototype.sensitiveField = function(field, before, after) {
3451
- if (before === void 0) {
3452
- before = 3;
3453
- }
3454
- if (after === void 0) {
3455
- after = 4;
3456
- }
3457
- if (!field) {
3458
- return "";
3459
- }
3460
- field = String(field);
3461
- var sensitiveLen = field.length - before - after;
3462
- if (sensitiveLen < 0) {
3463
- sensitiveLen = 0;
3464
- }
3465
- var regItem = "[\u4E00-\u9FA5a-zA-Z0-9]";
3466
- var regExp = "(".concat(regItem, "{").concat(before, "})").concat(regItem, "*(").concat(regItem, "{").concat(after, "})");
3467
- var reg = new RegExp(regExp);
3468
- return field.replace(reg, "$1".concat("*".repeat(sensitiveLen), "$2"));
3469
- };
3470
- return ToolsClass2;
3471
- }();
3472
- tools$1.exports = new ToolsClass();
3473
- const tools = /* @__PURE__ */ getDefaultExportFromCjs(tools$1.exports);
3474
- const index_vue_vue_type_style_index_0_lang$3 = "";
3475
- const _hoisted_1$5 = { style: { "margin-left": "20px", "color": "#FF5A25" } };
3476
- const _hoisted_2$5 = { class: "insert-article" };
3477
- const _hoisted_3$5 = { class: "insert-article_input" };
3465
+ if (after === void 0) {
3466
+ after = 4;
3467
+ }
3468
+ if (!field) {
3469
+ return "";
3470
+ }
3471
+ field = String(field);
3472
+ var sensitiveLen = field.length - before - after;
3473
+ if (sensitiveLen < 0) {
3474
+ sensitiveLen = 0;
3475
+ }
3476
+ var regItem = "[一-龥a-zA-Z0-9]";
3477
+ var regExp = "(".concat(regItem, "{").concat(before, "})").concat(regItem, "*(").concat(regItem, "{").concat(after, "})");
3478
+ var reg = new RegExp(regExp);
3479
+ return field.replace(reg, "$1".concat("*".repeat(sensitiveLen), "$2"));
3480
+ };
3481
+ return ToolsClass2;
3482
+ }()
3483
+ );
3484
+ tools$2.exports = new ToolsClass();
3485
+ var toolsExports = tools$2.exports;
3486
+ const tools$1 = /* @__PURE__ */ getDefaultExportFromCjs(toolsExports);
3487
+ const _hoisted_1$6 = { style: { "margin-left": "20px", "color": "#FF5A25" } };
3488
+ const _hoisted_2$3 = { class: "insert-article" };
3489
+ const _hoisted_3$3 = { class: "insert-article_input" };
3478
3490
  const _hoisted_4$2 = {
3479
3491
  key: 0,
3480
3492
  class: "nodata"
@@ -3493,7 +3505,7 @@
3493
3505
  key: 1,
3494
3506
  style: { "display": "inline-flex", "flex-direction": "column" }
3495
3507
  };
3496
- const _sfc_main$5 = vue.defineComponent({
3508
+ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
3497
3509
  __name: "index",
3498
3510
  props: {
3499
3511
  visible: { type: Boolean, default: false },
@@ -3501,7 +3513,7 @@
3501
3513
  },
3502
3514
  emits: ["change", "submit", "update:visible"],
3503
3515
  setup(__props, { emit: __emit }) {
3504
- const { debounce } = tools;
3516
+ const { debounce } = tools$1;
3505
3517
  const vInfiniteScroll = elementPlus.ElInfiniteScroll;
3506
3518
  const Radio_Type = {
3507
3519
  MY_ARITICLE: "1",
@@ -3552,7 +3564,7 @@
3552
3564
  };
3553
3565
  const confirm = () => {
3554
3566
  if (!data.article) {
3555
- elementPlus.ElMessage.error(`\u8BF7\u9009\u62E9${isVideo ? "\u89C6\u9891" : "\u6587\u7AE0"}`);
3567
+ elementPlus.ElMessage.error(`请选择${isVideo ? "视频" : "文章"}`);
3556
3568
  return;
3557
3569
  }
3558
3570
  data.article.isVideo = isVideo;
@@ -3569,11 +3581,14 @@
3569
3581
  data.busy = true;
3570
3582
  const userInfo = JSON.parse(localStorage.getItem("user")) || JSON.parse(localStorage.getItem("userInfo"));
3571
3583
  const userId = userInfo.uid || userInfo.userid;
3584
+ if (!getList.value)
3585
+ return;
3572
3586
  const res = await getList.value({
3573
3587
  uid: data.params.radio !== Radio_Type.ALL_ARITICLE ? userId : "",
3574
3588
  autherid: data.params.radio !== Radio_Type.ALL_ARITICLE ? userId : "",
3575
3589
  limit: 20,
3576
3590
  allType: data.params.radio,
3591
+ // 只有4 是查视频 其他是文章
3577
3592
  title: data.params.title,
3578
3593
  page: ++data.page
3579
3594
  });
@@ -3587,27 +3602,27 @@
3587
3602
  data.busy = false;
3588
3603
  }, 1e3);
3589
3604
  return (_ctx, _cache) => {
3590
- return vue.openBlock(), vue.createBlock(_sfc_main$6, {
3605
+ return vue.openBlock(), vue.createBlock(_sfc_main$7, {
3591
3606
  visible: vue.unref(visible),
3592
3607
  onSubmit: confirm
3593
3608
  }, {
3594
3609
  title: vue.withCtx(() => [
3595
3610
  vue.createElementVNode("span", null, [
3596
- vue.createTextVNode("\u63D2\u5165\u6587\u7AE0/\u89C6\u9891"),
3597
- vue.createElementVNode("strong", _hoisted_1$5, "\u5E73\u53F0\u4EC5\u652F\u6301\u63D2\u5165" + vue.toDisplayString(`${isVideo.value ? "2\u5E74" : "18\u4E2A\u6708"}`) + "\u5185\u7684\u63A8\u8350\u5185\u5BB9", 1)
3611
+ _cache[8] || (_cache[8] = vue.createTextVNode("插入文章/视频")),
3612
+ vue.createElementVNode("strong", _hoisted_1$6, "平台仅支持插入" + vue.toDisplayString(`${isVideo.value ? "2" : "18个月"}`) + "内的推荐内容", 1)
3598
3613
  ])
3599
3614
  ]),
3600
3615
  default: vue.withCtx(() => [
3601
- vue.createElementVNode("div", _hoisted_2$5, [
3616
+ vue.createElementVNode("div", _hoisted_2$3, [
3602
3617
  vue.createElementVNode("div", null, [
3603
3618
  vue.createVNode(vue.unref(elementPlus.ElRadio), {
3604
3619
  modelValue: data.params.radio,
3605
3620
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => data.params.radio = $event),
3606
3621
  label: Radio_Type.MY_ARITICLE
3607
3622
  }, {
3608
- default: vue.withCtx(() => [
3609
- vue.createTextVNode("\u4ECE\u6211\u7684\u6587\u7AE0\u4E2D\u9009\u62E9")
3610
- ]),
3623
+ default: vue.withCtx(() => _cache[9] || (_cache[9] = [
3624
+ vue.createTextVNode("从我的文章中选择")
3625
+ ])),
3611
3626
  _: 1
3612
3627
  }, 8, ["modelValue", "label"]),
3613
3628
  vue.createVNode(vue.unref(elementPlus.ElRadio), {
@@ -3615,9 +3630,9 @@
3615
3630
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => data.params.radio = $event),
3616
3631
  label: Radio_Type.MY_VIDEO
3617
3632
  }, {
3618
- default: vue.withCtx(() => [
3619
- vue.createTextVNode("\u4ECE\u6211\u7684\u89C6\u9891\u4E2D\u9009\u62E9")
3620
- ]),
3633
+ default: vue.withCtx(() => _cache[10] || (_cache[10] = [
3634
+ vue.createTextVNode("从我的视频中选择")
3635
+ ])),
3621
3636
  _: 1
3622
3637
  }, 8, ["modelValue", "label"]),
3623
3638
  vue.createVNode(vue.unref(elementPlus.ElRadio), {
@@ -3625,17 +3640,17 @@
3625
3640
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => data.params.radio = $event),
3626
3641
  label: Radio_Type.ALL_ARITICLE
3627
3642
  }, {
3628
- default: vue.withCtx(() => [
3629
- vue.createTextVNode("\u4ECE\u6240\u6709\u6587\u7AE0\u4E2D\u9009\u62E9")
3630
- ]),
3643
+ default: vue.withCtx(() => _cache[11] || (_cache[11] = [
3644
+ vue.createTextVNode("从所有文章中选择")
3645
+ ])),
3631
3646
  _: 1
3632
3647
  }, 8, ["modelValue", "label"])
3633
3648
  ]),
3634
- vue.createElementVNode("div", _hoisted_3$5, [
3649
+ vue.createElementVNode("div", _hoisted_3$3, [
3635
3650
  vue.createVNode(vue.unref(elementPlus.ElInput), {
3636
3651
  modelValue: data.params.title,
3637
3652
  "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => data.params.title = $event),
3638
- placeholder: isVideo.value ? "\u8F93\u5165\u89C6\u9891\u63CF\u8FF0\u67E5\u627E\u5E73\u53F0\u53D1\u5E03\u8FC7\u7684\u89C6\u9891" : "\u8F93\u5165\u6807\u9898\u540D\u67E5\u627E\u5E73\u53F0\u53D1\u8FC7\u7684\u6587\u7AE0",
3653
+ placeholder: isVideo.value ? "输入视频描述查找平台发布过的视频" : "输入标题名查找平台发过的文章",
3639
3654
  onKeyup: _cache[5] || (_cache[5] = vue.withKeys(($event) => vue.unref(getArticleList)(true), ["enter", "native"])),
3640
3655
  onInput: _cache[6] || (_cache[6] = ($event) => vue.unref(getArticleList)(true))
3641
3656
  }, {
@@ -3649,7 +3664,7 @@
3649
3664
  _: 1
3650
3665
  }, 8, ["modelValue", "placeholder"])
3651
3666
  ]),
3652
- data.data.length === 0 && !data.busy ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, vue.toDisplayString(`\u6CA1\u6709\u7B26\u5408\u6761\u4EF6\u7684${isVideo.value ? "\u89C6\u9891" : "\u6587\u7AE0"}\u54E6\uFF0C\u4F60\u53EF\u4EE5\u8BD5\u8BD5\u641C\u7D22\u5176\u4ED6${isVideo.value ? "\u89C6\u9891" : "\u6587\u7AE0"}\uFF5E`), 1)) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
3667
+ data.data.length === 0 && !data.busy ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, vue.toDisplayString(`没有符合条件的${isVideo.value ? "视频" : "文章"}哦,你可以试试搜索其他${isVideo.value ? "视频" : "文章"}~`), 1)) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
3653
3668
  key: 1,
3654
3669
  "infinite-scroll-immediate": false,
3655
3670
  class: "insert-article_list",
@@ -3681,12 +3696,12 @@
3681
3696
  }, null, 8, _hoisted_9$1)
3682
3697
  ]),
3683
3698
  vue.createElementVNode("div", _hoisted_10$1, [
3684
- vue.createElementVNode("span", _hoisted_11$1, vue.toDisplayString(item.content || "[\u65E0\u6807\u9898]"), 1),
3685
- vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(date).format(item.createTime * 1e3, "YYYY-MM-DD hh-mm")), 1)
3699
+ vue.createElementVNode("span", _hoisted_11$1, vue.toDisplayString(item.content || "[无标题]"), 1),
3700
+ vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(date$1).format(item.createTime * 1e3, "YYYY-MM-DD hh-mm")), 1)
3686
3701
  ])
3687
3702
  ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$1, [
3688
- vue.createElementVNode("span", null, vue.toDisplayString(item.title || "[\u65E0\u6807\u9898]"), 1),
3689
- vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(date).format(item.createTime * 1e3, "YYYY-MM-DD")), 1)
3703
+ vue.createElementVNode("span", null, vue.toDisplayString(item.title || "[无标题]"), 1),
3704
+ vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(date$1).format(item.createTime * 1e3, "YYYY-MM-DD")), 1)
3690
3705
  ]))
3691
3706
  ];
3692
3707
  }),
@@ -3704,6 +3719,7 @@
3704
3719
  };
3705
3720
  }
3706
3721
  });
3722
+ const index_vue_vue_type_style_index_0_lang$4 = "";
3707
3723
  let getRandomValues;
3708
3724
  const rnds8 = new Uint8Array(16);
3709
3725
  function rng() {
@@ -3743,10 +3759,9 @@
3743
3759
  }
3744
3760
  return unsafeStringify(rnds);
3745
3761
  }
3746
- const index_vue_vue_type_style_index_0_lang$2 = "";
3747
- const _hoisted_1$4 = { class: "img-upload-content" };
3748
- const _hoisted_2$4 = { class: "title-box" };
3749
- const _hoisted_3$4 = ["onClick"];
3762
+ const _hoisted_1$5 = { class: "img-upload-content" };
3763
+ const _hoisted_2$2 = { class: "title-box" };
3764
+ const _hoisted_3$2 = ["onClick"];
3750
3765
  const _hoisted_4$1 = {
3751
3766
  key: 0,
3752
3767
  class: "line"
@@ -3775,41 +3790,38 @@
3775
3790
  key: 0,
3776
3791
  class: "upload-wrap"
3777
3792
  };
3778
- const _hoisted_14 = /* @__PURE__ */ vue.createElementVNode("span", null, "\u672C\u5730\u4E0A\u4F20", -1);
3779
- const _hoisted_15 = /* @__PURE__ */ vue.createElementVNode("span", { class: "remark" }, "\u652F\u6301jpg\u3001jpeg\u3001png\u7B49\u591A\u79CD\u683C\u5F0F\uFF0C\u5355\u5F20\u56FE\u7247\u6700\u5927\u652F\u630120MB", -1);
3780
- const _hoisted_16 = {
3793
+ const _hoisted_14 = {
3781
3794
  key: 1,
3782
3795
  class: "img-list"
3783
3796
  };
3784
- const _hoisted_17 = ["src"];
3785
- const _hoisted_18 = { class: "upload-btn" };
3786
- const _hoisted_19 = {
3797
+ const _hoisted_15 = ["src"];
3798
+ const _hoisted_16 = { class: "upload-btn" };
3799
+ const _hoisted_17 = {
3787
3800
  key: 2,
3788
3801
  class: "map-depot"
3789
3802
  };
3790
- const _hoisted_20 = { class: "screen" };
3791
- const _hoisted_21 = { key: 0 };
3792
- const _hoisted_22 = { class: "tab-box" };
3793
- const _hoisted_23 = ["onClick"];
3794
- const _hoisted_24 = {
3803
+ const _hoisted_18 = { class: "screen" };
3804
+ const _hoisted_19 = { key: 0 };
3805
+ const _hoisted_20 = { class: "tab-box" };
3806
+ const _hoisted_21 = ["onClick"];
3807
+ const _hoisted_22 = {
3795
3808
  key: 0,
3796
3809
  class: "line"
3797
3810
  };
3798
- const _hoisted_25 = { class: "image-list depot-image" };
3799
- const _hoisted_26 = ["onClick"];
3800
- const _hoisted_27 = ["src"];
3801
- const _hoisted_28 = {
3811
+ const _hoisted_23 = { class: "image-list depot-image" };
3812
+ const _hoisted_24 = ["onClick"];
3813
+ const _hoisted_25 = ["src"];
3814
+ const _hoisted_26 = {
3802
3815
  key: 0,
3803
3816
  class: "shade"
3804
3817
  };
3805
- const _hoisted_29 = { class: "num" };
3806
- const _hoisted_30 = {
3818
+ const _hoisted_27 = { class: "num" };
3819
+ const _hoisted_28 = {
3807
3820
  key: 1,
3808
3821
  class: "protocol-box"
3809
3822
  };
3810
- const _hoisted_31 = /* @__PURE__ */ vue.createElementVNode("div", null, " \u56FE\u5E93\u4E2D\u7684\u56FE\u7247\u4EC5\u9650\u4E0B\u8F7D\u6469\u6258\u8303\u4EE5\u7F16\u8F91\u53D1\u5E03\u6587\u7AE0\u4F7F\u7528,\u4E0D\u5F97\u7528\u4E8E\u5176\u4ED6\u4EFB\u4F55\u5E73\u53F0\u53CA\u7528\u9014 ", -1);
3811
- const _hoisted_32 = ["href"];
3812
- const _sfc_main$4 = vue.defineComponent({
3823
+ const _hoisted_29 = ["href"];
3824
+ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
3813
3825
  __name: "index",
3814
3826
  props: {
3815
3827
  visible: { type: Boolean, default: false },
@@ -3844,7 +3856,7 @@
3844
3856
  const tempImgs = [...props.imgList];
3845
3857
  Array.from(imgFile).forEach((file) => {
3846
3858
  if (file.size > 20 * 1024 * 1024) {
3847
- elementPlus.ElMessage.error("\u5355\u5F20\u56FE\u7247\u6700\u5927\u652F\u630120M");
3859
+ elementPlus.ElMessage.error("单张图片最大支持20M");
3848
3860
  return;
3849
3861
  }
3850
3862
  const id = v4();
@@ -3874,14 +3886,14 @@
3874
3886
  const list = [
3875
3887
  {
3876
3888
  id: 2,
3877
- value: "\u4E0A\u4F20\u56FE\u7247"
3889
+ value: "上传图片"
3878
3890
  }
3879
3891
  ];
3880
3892
  activeTitle.value = 2;
3881
3893
  if (props.imgNum < 20) {
3882
3894
  list.unshift({
3883
3895
  id: 1,
3884
- value: "\u6B63\u6587\u56FE\u7247"
3896
+ value: "正文图片"
3885
3897
  });
3886
3898
  activeTitle.value = 1;
3887
3899
  getContentImgList();
@@ -3889,7 +3901,7 @@
3889
3901
  if (props.chartGallery) {
3890
3902
  list.push({
3891
3903
  id: 3,
3892
- value: isEmotofine ? "\u7535\u6469\u8303\u56FE\u5E93" : "\u6469\u6258\u8303\u56FE\u5E93"
3904
+ value: isEmotofine ? "电摩范图库" : "摩托范图库"
3893
3905
  });
3894
3906
  }
3895
3907
  titleList.value = list;
@@ -4034,13 +4046,13 @@
4034
4046
  const tabList = vue.ref([]);
4035
4047
  const search = () => {
4036
4048
  if (!selectData.brandId) {
4037
- return elementPlus.ElMessage.error("\u8BF7\u9009\u62E9\u54C1\u724C");
4049
+ return elementPlus.ElMessage.error("请选择品牌");
4038
4050
  }
4039
4051
  if (!selectData.goodId) {
4040
- return elementPlus.ElMessage.error("\u8BF7\u9009\u62E9\u8F66\u578B");
4052
+ return elementPlus.ElMessage.error("请选择车型");
4041
4053
  }
4042
4054
  if (!selectData.carId) {
4043
- return elementPlus.ElMessage.error("\u8BF7\u9009\u62E9\u6B3E\u578B");
4055
+ return elementPlus.ElMessage.error("请选择款型");
4044
4056
  }
4045
4057
  tabList.value = [];
4046
4058
  emits("update:imgList", []);
@@ -4091,13 +4103,13 @@
4091
4103
  emits("update:imgList", list);
4092
4104
  };
4093
4105
  return (_ctx, _cache) => {
4094
- return vue.openBlock(), vue.createBlock(_sfc_main$6, {
4106
+ return vue.openBlock(), vue.createBlock(_sfc_main$7, {
4095
4107
  visible: props.visible,
4096
4108
  showTitle: false
4097
4109
  }, {
4098
4110
  default: vue.withCtx(() => [
4099
- vue.createElementVNode("div", _hoisted_1$4, [
4100
- vue.createElementVNode("div", _hoisted_2$4, [
4111
+ vue.createElementVNode("div", _hoisted_1$5, [
4112
+ vue.createElementVNode("div", _hoisted_2$2, [
4101
4113
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(titleList.value, (item, index) => {
4102
4114
  return vue.openBlock(), vue.createElementBlock("div", {
4103
4115
  key: index,
@@ -4106,10 +4118,10 @@
4106
4118
  }, [
4107
4119
  vue.createTextVNode(vue.toDisplayString(item.value) + " ", 1),
4108
4120
  item.id === activeTitle.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1)) : vue.createCommentVNode("", true)
4109
- ], 10, _hoisted_3$4);
4121
+ ], 10, _hoisted_3$2);
4110
4122
  }), 128)),
4111
- [1, 3].includes(activeTitle.value) && props.imgList.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$1, " \u6700\u591A\u53EF\u9009" + vue.toDisplayString(props.imgNum) + "\u5F20\u56FE\u7247\uFF0C\u5DF2\u9009" + vue.toDisplayString(props.imgList.length) + "\u5F20 ", 1)) : vue.createCommentVNode("", true),
4112
- activeTitle.value === 2 && props.imgList.length > 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, vue.toDisplayString(props.imgList.length) + "\u5F20\u4E0A\u4F20\u6210\u529F \u62D6\u52A8\u53EF\u8C03\u6574\u987A\u5E8F ", 1)) : vue.createCommentVNode("", true)
4123
+ [1, 3].includes(activeTitle.value) && props.imgList.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$1, " 最多可选" + vue.toDisplayString(props.imgNum) + "张图片,已选" + vue.toDisplayString(props.imgList.length) + " ", 1)) : vue.createCommentVNode("", true),
4124
+ activeTitle.value === 2 && props.imgList.length > 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, vue.toDisplayString(props.imgList.length) + "张上传成功 拖动可调整顺序 ", 1)) : vue.createCommentVNode("", true)
4113
4125
  ]),
4114
4126
  activeTitle.value === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
4115
4127
  vue.createElementVNode("div", _hoisted_8, [
@@ -4146,11 +4158,11 @@
4146
4158
  ]),
4147
4159
  _: 1
4148
4160
  }),
4149
- _hoisted_14
4161
+ _cache[7] || (_cache[7] = vue.createElementVNode("span", null, "本地上传", -1))
4150
4162
  ]),
4151
- _hoisted_15
4152
- ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_16, [
4153
- vue.createVNode(vue.unref(draggable__default.default), {
4163
+ _cache[8] || (_cache[8] = vue.createElementVNode("span", { class: "remark" }, "支持jpg、jpeg、png等多种格式,单张图片最大支持20MB", -1))
4164
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, [
4165
+ vue.createVNode(vue.unref(draggable), {
4154
4166
  modelValue: imgListTemp.value,
4155
4167
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => imgListTemp.value = $event),
4156
4168
  handle: ".img-item",
@@ -4170,7 +4182,7 @@
4170
4182
  style: { "object-fit": "contain" },
4171
4183
  width: "120",
4172
4184
  height: "120"
4173
- }, null, 8, _hoisted_17),
4185
+ }, null, 8, _hoisted_15),
4174
4186
  vue.createVNode(vue.unref(iconsVue.CircleCloseFilled), {
4175
4187
  class: "icon pointer",
4176
4188
  onClick: ($event) => deleteImg(element)
@@ -4193,7 +4205,7 @@
4193
4205
  _: 1
4194
4206
  }, 8, ["modelValue"])
4195
4207
  ])),
4196
- vue.createElementVNode("div", _hoisted_18, [
4208
+ vue.createElementVNode("div", _hoisted_16, [
4197
4209
  vue.createElementVNode("input", {
4198
4210
  type: "file",
4199
4211
  name: "file",
@@ -4204,13 +4216,13 @@
4204
4216
  }, null, 32)
4205
4217
  ])
4206
4218
  ], 2)) : vue.createCommentVNode("", true),
4207
- activeTitle.value === 3 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_19, [
4208
- vue.createElementVNode("div", _hoisted_20, [
4219
+ activeTitle.value === 3 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17, [
4220
+ vue.createElementVNode("div", _hoisted_18, [
4209
4221
  vue.createElementVNode("div", null, [
4210
4222
  vue.createVNode(vue.unref(elementPlus.ElSelect), {
4211
4223
  modelValue: selectData.brandId,
4212
4224
  "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => selectData.brandId = $event),
4213
- placeholder: "\u8BF7\u9009\u62E9\u54C1\u724C",
4225
+ placeholder: "请选择品牌",
4214
4226
  size: "large",
4215
4227
  class: "select_1",
4216
4228
  filterable: "",
@@ -4231,7 +4243,7 @@
4231
4243
  vue.createVNode(vue.unref(elementPlus.ElSelect), {
4232
4244
  modelValue: selectData.goodId,
4233
4245
  "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => selectData.goodId = $event),
4234
- placeholder: "\u8BF7\u9009\u62E9\u8F66\u578B",
4246
+ placeholder: "请选择车型",
4235
4247
  size: "large",
4236
4248
  class: "select_1",
4237
4249
  filterable: "",
@@ -4252,7 +4264,7 @@
4252
4264
  vue.createVNode(vue.unref(elementPlus.ElSelect), {
4253
4265
  modelValue: selectData.carId,
4254
4266
  "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => selectData.carId = $event),
4255
- placeholder: "\u8BF7\u9009\u62E9\u6B3E\u578B",
4267
+ placeholder: "请选择款型",
4256
4268
  size: "large",
4257
4269
  class: "select_2",
4258
4270
  filterable: "",
@@ -4276,14 +4288,14 @@
4276
4288
  style: { "width": "80px" },
4277
4289
  onClick: search
4278
4290
  }, {
4279
- default: vue.withCtx(() => [
4280
- vue.createTextVNode("\u641C\u7D22")
4281
- ]),
4291
+ default: vue.withCtx(() => _cache[9] || (_cache[9] = [
4292
+ vue.createTextVNode("搜索")
4293
+ ])),
4282
4294
  _: 1
4283
4295
  })
4284
4296
  ]),
4285
- tabList.value && tabList.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_21, [
4286
- vue.createElementVNode("div", _hoisted_22, [
4297
+ tabList.value && tabList.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_19, [
4298
+ vue.createElementVNode("div", _hoisted_20, [
4287
4299
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tabList.value, (item, index) => {
4288
4300
  return vue.openBlock(), vue.createElementBlock("div", {
4289
4301
  key: index,
@@ -4291,11 +4303,11 @@
4291
4303
  onClick: ($event) => activeTab.value = item.type
4292
4304
  }, [
4293
4305
  vue.createTextVNode(vue.toDisplayString(item.name) + " ", 1),
4294
- item.type === activeTab.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_24)) : vue.createCommentVNode("", true)
4295
- ], 10, _hoisted_23);
4306
+ item.type === activeTab.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_22)) : vue.createCommentVNode("", true)
4307
+ ], 10, _hoisted_21);
4296
4308
  }), 128))
4297
4309
  ]),
4298
- vue.createElementVNode("div", _hoisted_25, [
4310
+ vue.createElementVNode("div", _hoisted_23, [
4299
4311
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(imageList.value, (item, index) => {
4300
4312
  return vue.openBlock(), vue.createElementBlock("div", {
4301
4313
  key: index,
@@ -4306,25 +4318,25 @@
4306
4318
  src: item.imgOrgUrl,
4307
4319
  alt: "",
4308
4320
  class: "image"
4309
- }, null, 8, _hoisted_27),
4310
- item.num ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_28, [
4311
- vue.createElementVNode("div", _hoisted_29, vue.toDisplayString(item.num), 1)
4321
+ }, null, 8, _hoisted_25),
4322
+ item.num ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_26, [
4323
+ vue.createElementVNode("div", _hoisted_27, vue.toDisplayString(item.num), 1)
4312
4324
  ])) : vue.createCommentVNode("", true)
4313
- ], 8, _hoisted_26);
4325
+ ], 8, _hoisted_24);
4314
4326
  }), 128))
4315
4327
  ])
4316
- ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_30, [
4328
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_28, [
4317
4329
  vue.createElementVNode("div", null, [
4318
- _hoisted_31,
4330
+ _cache[12] || (_cache[12] = vue.createElementVNode("div", null, " 图库中的图片仅限下载摩托范以编辑发布文章使用,不得用于其他任何平台及用途 ", -1)),
4319
4331
  vue.createElementVNode("div", null, [
4320
- vue.createTextVNode(" \u8BF7\u9605\u8BFB"),
4332
+ _cache[10] || (_cache[10] = vue.createTextVNode(" 请阅读")),
4321
4333
  vue.createElementVNode("a", {
4322
4334
  href: `https://${vue.unref(hostName)}/about?type=imageLicenseAgreement`,
4323
4335
  target: "_blank",
4324
4336
  rel: "noopener noreferrer",
4325
4337
  class: "link"
4326
- }, "\u300A\u6469\u6258\u8303\u56FE\u7247\u8BB8\u53EF\u4F7F\u7528\u534F\u8BAE\u300B", 8, _hoisted_32),
4327
- vue.createTextVNode(",\u60A8\u7684\u884C\u4E3A\u89C6\u4E3A\u60A8\u5DF2\u540C\u610F\u8BE5\u534F\u8BAE\u3002 ")
4338
+ }, "《摩托范图片许可使用协议》", 8, _hoisted_29),
4339
+ _cache[11] || (_cache[11] = vue.createTextVNode(",您的行为视为您已同意该协议。 "))
4328
4340
  ])
4329
4341
  ])
4330
4342
  ]))
@@ -4336,11 +4348,9 @@
4336
4348
  };
4337
4349
  }
4338
4350
  });
4339
- const index_vue_vue_type_style_index_0_lang$1 = "";
4340
- const _hoisted_1$3 = /* @__PURE__ */ vue.createElementVNode("span", null, "\u63D2\u5165\u89C6\u9891", -1);
4341
- const _hoisted_2$3 = { class: "insert-video" };
4342
- const _hoisted_3$3 = /* @__PURE__ */ vue.createElementVNode("span", { class: "remark" }, "\u4E3A\u4E86\u83B7\u5F97\u66F4\u9AD8\u7684\u63A8\u8350\u91CF\u548C\u70B9\u51FB\u91CF\uFF0C\u5EFA\u8BAE\u4E0A\u4F20720p\uFF081280*720\uFF09\u6216\u66F4\u9AD8\u5206\u8FA8\u7387\u7684\u89C6\u9891\uFF0C\u89C6\u9891\u683C\u5F0F\u4E3A.mp4\u6216.mov\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC71G", -1);
4343
- const _sfc_main$3 = vue.defineComponent({
4351
+ const index_vue_vue_type_style_index_0_lang$3 = "";
4352
+ const _hoisted_1$4 = { class: "insert-video" };
4353
+ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
4344
4354
  __name: "index",
4345
4355
  props: {
4346
4356
  visible: { type: Boolean, default: false },
@@ -4362,29 +4372,29 @@
4362
4372
  ele[0].dispatchEvent(event);
4363
4373
  };
4364
4374
  return (_ctx, _cache) => {
4365
- return vue.openBlock(), vue.createBlock(_sfc_main$6, {
4375
+ return vue.openBlock(), vue.createBlock(_sfc_main$7, {
4366
4376
  "show-btn": false,
4367
4377
  visible: vue.unref(visible),
4368
4378
  width: "600px",
4369
4379
  height: "100px"
4370
4380
  }, {
4371
- title: vue.withCtx(() => [
4372
- _hoisted_1$3
4373
- ]),
4381
+ title: vue.withCtx(() => _cache[1] || (_cache[1] = [
4382
+ vue.createElementVNode("span", null, "插入视频", -1)
4383
+ ])),
4374
4384
  default: vue.withCtx(() => [
4375
- vue.createElementVNode("div", _hoisted_2$3, [
4385
+ vue.createElementVNode("div", _hoisted_1$4, [
4376
4386
  vue.createVNode(vue.unref(elementPlus.ElButton), {
4377
4387
  style: { "width": "120px" },
4378
4388
  round: "",
4379
4389
  type: "primary",
4380
4390
  onClick: emitEvent
4381
4391
  }, {
4382
- default: vue.withCtx(() => [
4383
- vue.createTextVNode("\u9009\u62E9\u89C6\u9891")
4384
- ]),
4392
+ default: vue.withCtx(() => _cache[2] || (_cache[2] = [
4393
+ vue.createTextVNode("选择视频")
4394
+ ])),
4385
4395
  _: 1
4386
4396
  }),
4387
- _hoisted_3$3,
4397
+ _cache[3] || (_cache[3] = vue.createElementVNode("span", { class: "remark" }, "为了获得更高的推荐量和点击量,建议上传720p(1280*720)或更高分辨率的视频,视频格式为.mp4或.mov,大小不超过1G", -1)),
4388
4398
  vue.createElementVNode("input", {
4389
4399
  type: "file",
4390
4400
  accept: "video/*",
@@ -4399,121 +4409,822 @@
4399
4409
  };
4400
4410
  }
4401
4411
  });
4402
- const index_vue_vue_type_style_index_0_lang = "";
4403
- const _sfc_main$2 = {
4404
- provide() {
4405
- return {
4406
- vm: this
4407
- };
4408
- },
4409
- components: {
4410
- ElInput: elementPlus.ElInput,
4411
- BasicDialog: _sfc_main$6,
4412
- draggable: draggable__default.default
4413
- },
4412
+ const index_vue_vue_type_style_index_0_lang$2 = "";
4413
+ const index_vue_vue_type_style_index_0_lang$1 = "";
4414
+ const _sfc_main$3 = {
4415
+ name: "TopicManager",
4414
4416
  props: {
4415
- visible: {
4416
- type: Boolean,
4417
- default: false
4418
- },
4419
- linkContent: {
4420
- type: String,
4421
- default: ""
4417
+ // 编辑器DOM引用
4418
+ editorDom: {
4419
+ type: Object,
4420
+ default: null
4422
4421
  },
4423
- fileSelected: {
4424
- type: Function,
4425
- default: () => {
4426
- }
4422
+ // 话题API请求方法
4423
+ request: {
4424
+ type: Object,
4425
+ default: null
4427
4426
  }
4428
4427
  },
4429
4428
  data() {
4430
- return {};
4431
- },
4432
- computed: {
4433
- input: {
4434
- get() {
4435
- return this.linkContent;
4436
- },
4437
- set(val) {
4438
- this.$emit("update:linkContent", val);
4429
+ return {
4430
+ // 话题弹框相关数据
4431
+ topicPopover: {
4432
+ visible: false,
4433
+ type: "hot",
4434
+ // 'hot' 热门话题, 'search' 搜索话题
4435
+ activeTab: "hot",
4436
+ // 'hot' 热门话题, 'recent' 最近使用
4437
+ position: { top: 0, left: 0 },
4438
+ searchKeyword: "",
4439
+ hotTopics: [],
4440
+ searchTopics: [],
4441
+ recentTopics: [],
4442
+ loading: false,
4443
+ page: 1,
4444
+ hasMore: true,
4445
+ searchPage: 1,
4446
+ searchHasMore: true,
4447
+ // 保存原始的selection和range信息
4448
+ originalRange: null,
4449
+ originalSelection: null,
4450
+ // 保存触发位置信息
4451
+ triggerInfo: {
4452
+ paragraph: null,
4453
+ hashIndex: -1,
4454
+ cursorPosition: 0
4455
+ },
4456
+ // 全局弹框DOM引用
4457
+ globalContainer: null,
4458
+ globalMask: null
4439
4459
  }
4440
- }
4441
- },
4442
- mounted() {
4460
+ };
4443
4461
  },
4444
4462
  methods: {
4445
- emitEvent() {
4446
- var event = new MouseEvent("click");
4447
- var ele = document.getElementsByClassName("video-input");
4448
- ele[0].dispatchEvent(event);
4463
+ // 初始化话题管理器
4464
+ init() {
4465
+ if (!this.editorDom) {
4466
+ console.warn("TopicManager: editorDom is required");
4467
+ return;
4468
+ }
4469
+ setTimeout(() => this.bindEditorEvents(), 0);
4449
4470
  },
4450
- setStatus(val) {
4451
- this.$emit("update:visible", val);
4452
- }
4453
- }
4454
- };
4455
- const _hoisted_1$2 = /* @__PURE__ */ vue.createElementVNode("div", null, [
4456
- /* @__PURE__ */ vue.createElementVNode("span", null, "\u91C7\u96C6\u6587\u7AE0"),
4457
- /* @__PURE__ */ vue.createElementVNode("span", { class: "collect-article_lable" }, "\u5982\u9700\u83B7\u5F97\u6B63\u5F0F\u4F7F\u7528\u6743\uFF0C\u8BF7\u81EA\u884C\u8054\u7CFB\u7248\u6743\u6240\u6709\u8005")
4458
- ], -1);
4459
- const _hoisted_2$2 = { class: "collect-article_content" };
4460
- const _hoisted_3$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "tip" }, "\u8BF7\u628A\u9700\u8981\u91C7\u96C6\u7684\u6587\u7AE0\u94FE\u63A5\u7C98\u8D34\u5728\u4E0B\u65B9\u7684\u8F93\u5165\u6846\uFF1A", -1);
4461
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
4462
- const _component_el_input = vue.resolveComponent("el-input");
4463
- const _component_BasicDialog = vue.resolveComponent("BasicDialog");
4464
- return vue.openBlock(), vue.createBlock(_component_BasicDialog, {
4465
- visible: $props.visible,
4466
- width: "600px",
4467
- height: "50px"
4468
- }, {
4469
- title: vue.withCtx(() => [
4470
- _hoisted_1$2
4471
- ]),
4472
- default: vue.withCtx(() => [
4473
- vue.createElementVNode("div", _hoisted_2$2, [
4474
- _hoisted_3$2,
4475
- vue.createVNode(_component_el_input, {
4476
- modelValue: $options.input,
4477
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.input = $event),
4478
- placeholder: "\u4EC5\u652F\u6301\u5FAE\u4FE1\u94FE\u63A5"
4479
- }, null, 8, ["modelValue"])
4480
- ])
4481
- ]),
4482
- _: 1
4483
- }, 8, ["visible"]);
4484
- }
4485
- const CollectArticle = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
4486
- const index_vue_vue_type_style_index_0_scoped_true_lang = "";
4487
- const _sfc_main$1 = {
4488
- components: {
4489
- ElIconError: iconsVue.CircleCloseFilled
4490
- },
4491
- props: {
4492
- article: {
4493
- type: Object,
4494
- default: () => ({})
4495
- }
4496
- },
4497
- methods: {
4498
- close(e) {
4499
- let child = e.target;
4500
- while (child) {
4501
- if (child.dataset.article) {
4502
- child.parentNode.removeChild(child);
4503
- break;
4471
+ // 绑定编辑器事件
4472
+ bindEditorEvents() {
4473
+ if (!this.editorDom)
4474
+ return;
4475
+ this.editorDom.addEventListener("keydown", this.handleTopicInput.bind(this));
4476
+ },
4477
+ // 解绑编辑器事件
4478
+ unbindEditorEvents() {
4479
+ if (!this.editorDom)
4480
+ return;
4481
+ this.editorDom.removeEventListener("keydown", this.handleTopicInput.bind(this));
4482
+ },
4483
+ // 话题输入处理
4484
+ handleTopicInput(event) {
4485
+ var _a;
4486
+ console.log("handleTopicInput", event.key);
4487
+ const activeElement = document.activeElement;
4488
+ if (activeElement && (activeElement.tagName === "INPUT" || activeElement.tagName === "TEXTAREA")) {
4489
+ return;
4490
+ }
4491
+ const selection = window.getSelection();
4492
+ if (selection.rangeCount === 0)
4493
+ return;
4494
+ const range = selection.getRangeAt(0);
4495
+ const container = range.startContainer;
4496
+ if (!this.editorDom.contains(container))
4497
+ return;
4498
+ let currentNode = container;
4499
+ while (currentNode && currentNode !== this.editorDom) {
4500
+ if (currentNode.nodeType === Node.ELEMENT_NODE && currentNode.tagName === "MDD-TOPIC") {
4501
+ return;
4504
4502
  }
4505
- child = child.parentNode;
4503
+ currentNode = currentNode.parentNode;
4506
4504
  }
4507
- this.$emit("delete");
4508
- }
4509
- }
4510
- };
4511
- const _hoisted_1$1 = {
4512
- class: "article-item",
4513
- contenteditable: "false"
4514
- };
4515
- const _hoisted_2$1 = ["src"];
4516
- const _hoisted_3$1 = { class: "article-item_right" };
4505
+ let paragraph = container;
4506
+ while (paragraph && paragraph.nodeType !== Node.ELEMENT_NODE) {
4507
+ paragraph = paragraph.parentNode;
4508
+ }
4509
+ while (paragraph && !((_a = paragraph.classList) == null ? void 0 : _a.contains("halo-paragraph"))) {
4510
+ paragraph = paragraph.parentNode;
4511
+ }
4512
+ if (!paragraph)
4513
+ return;
4514
+ const { textContent: paragraphText, cursorPosition } = this.getParagraphTextExcludingTopics(paragraph, range);
4515
+ if (event.key === "#") {
4516
+ const afterCursor = paragraphText.substring(cursorPosition);
4517
+ if (afterCursor.length > 0 && afterCursor[0] === " ") {
4518
+ return;
4519
+ }
4520
+ setTimeout(() => {
4521
+ const position = this.getCaretPosition();
4522
+ const triggerInfo = {
4523
+ paragraph,
4524
+ hashIndex: cursorPosition,
4525
+ // #号的位置
4526
+ cursorPosition: cursorPosition + 1
4527
+ // #号后的位置
4528
+ };
4529
+ this.showTopicPopover("hot", position, "", triggerInfo);
4530
+ }, 10);
4531
+ } else if (this.shouldTriggerSearch(event.key)) {
4532
+ setTimeout(() => {
4533
+ this.checkAndTriggerSearch(paragraph);
4534
+ }, 10);
4535
+ } else {
4536
+ this.hideTopicPopover();
4537
+ }
4538
+ },
4539
+ shouldTriggerSearch(key) {
4540
+ return key !== " " && key.length === 1 || key === "Backspace" || key === "Delete";
4541
+ },
4542
+ checkAndTriggerSearch(paragraph) {
4543
+ const selection = window.getSelection();
4544
+ if (selection.rangeCount === 0)
4545
+ return;
4546
+ const range = selection.getRangeAt(0);
4547
+ let currentNode = range.startContainer;
4548
+ while (currentNode && currentNode !== paragraph) {
4549
+ if (currentNode.nodeType === Node.ELEMENT_NODE && currentNode.tagName === "MDD-TOPIC") {
4550
+ this.hideTopicPopover();
4551
+ return;
4552
+ }
4553
+ currentNode = currentNode.parentNode;
4554
+ }
4555
+ const { textContent: paragraphText, cursorPosition } = this.getParagraphTextExcludingTopics(paragraph, range);
4556
+ const beforeCursor = paragraphText.substring(0, cursorPosition);
4557
+ const hashIndex = beforeCursor.lastIndexOf("#");
4558
+ if (hashIndex !== -1) {
4559
+ const afterHash = beforeCursor.substring(hashIndex + 1);
4560
+ if (afterHash.replace(/\u00A0/g, " ").indexOf(" ") === -1) {
4561
+ if (afterHash.length <= 15) {
4562
+ const position = this.getCaretPosition();
4563
+ const triggerInfo = {
4564
+ paragraph,
4565
+ hashIndex,
4566
+ cursorPosition
4567
+ };
4568
+ if (afterHash.length === 0) {
4569
+ this.showTopicPopover("hot", position, "", triggerInfo);
4570
+ } else {
4571
+ this.showTopicPopover("search", position, afterHash, triggerInfo);
4572
+ }
4573
+ } else if (afterHash.length > 15) {
4574
+ this.hideTopicPopover();
4575
+ }
4576
+ } else {
4577
+ this.hideTopicPopover();
4578
+ }
4579
+ } else {
4580
+ this.hideTopicPopover();
4581
+ }
4582
+ },
4583
+ getParagraphTextExcludingTopics(paragraph, range) {
4584
+ let textContent = "";
4585
+ let cursorPosition = 0;
4586
+ let foundCursor = false;
4587
+ const walker = document.createTreeWalker(
4588
+ paragraph,
4589
+ NodeFilter.SHOW_ALL,
4590
+ {
4591
+ acceptNode: function(node2) {
4592
+ if (node2.nodeType === Node.ELEMENT_NODE && node2.tagName === "MDD-TOPIC") {
4593
+ return NodeFilter.FILTER_REJECT;
4594
+ }
4595
+ return NodeFilter.FILTER_ACCEPT;
4596
+ }
4597
+ },
4598
+ false
4599
+ );
4600
+ let node;
4601
+ while (node = walker.nextNode()) {
4602
+ if (node.nodeType === Node.TEXT_NODE) {
4603
+ const nodeText = node.textContent;
4604
+ if (!foundCursor && node === range.startContainer) {
4605
+ cursorPosition = textContent.length + range.startOffset;
4606
+ foundCursor = true;
4607
+ }
4608
+ textContent += nodeText;
4609
+ }
4610
+ }
4611
+ return { textContent, cursorPosition };
4612
+ },
4613
+ getCaretPosition() {
4614
+ const selection = window.getSelection();
4615
+ if (selection.rangeCount === 0)
4616
+ return { top: 0, left: 0 };
4617
+ const range = selection.getRangeAt(0);
4618
+ const rect = range.getBoundingClientRect();
4619
+ return {
4620
+ top: rect.bottom + window.scrollY,
4621
+ left: rect.left + window.scrollX
4622
+ };
4623
+ },
4624
+ // 话题弹框相关方法
4625
+ showTopicPopover(type, position, searchKeyword = "", triggerInfo = null) {
4626
+ if (!this.request || !this.request.getTopic) {
4627
+ console.warn("话题功能需要提供 request.getTopic 方法");
4628
+ return;
4629
+ }
4630
+ const selection = window.getSelection();
4631
+ if (selection.rangeCount > 0) {
4632
+ this.topicPopover.originalRange = selection.getRangeAt(0).cloneRange();
4633
+ this.topicPopover.originalSelection = selection;
4634
+ }
4635
+ if (triggerInfo) {
4636
+ this.topicPopover.triggerInfo = triggerInfo;
4637
+ }
4638
+ this.topicPopover.visible = true;
4639
+ this.topicPopover.type = type;
4640
+ this.topicPopover.position = position;
4641
+ this.topicPopover.searchKeyword = searchKeyword;
4642
+ if (type === "hot") {
4643
+ this.topicPopover.activeTab = "hot";
4644
+ this.loadHotTopics();
4645
+ this.loadRecentTopics();
4646
+ } else if (type === "search") {
4647
+ this.searchTopics(searchKeyword);
4648
+ }
4649
+ this.createGlobalTopicPopover();
4650
+ },
4651
+ hideTopicPopover() {
4652
+ this.topicPopover.visible = false;
4653
+ this.topicPopover.hotTopics = [];
4654
+ this.topicPopover.searchTopics = [];
4655
+ this.topicPopover.page = 1;
4656
+ this.topicPopover.searchPage = 1;
4657
+ this.topicPopover.hasMore = true;
4658
+ this.topicPopover.searchHasMore = true;
4659
+ this.topicPopover.originalRange = null;
4660
+ this.topicPopover.originalSelection = null;
4661
+ this.topicPopover.triggerInfo = {
4662
+ paragraph: null,
4663
+ hashIndex: -1,
4664
+ cursorPosition: 0
4665
+ };
4666
+ this.removeGlobalTopicPopover();
4667
+ },
4668
+ switchTopicTab(tab) {
4669
+ this.topicPopover.activeTab = tab;
4670
+ this.updateGlobalTopicPopover();
4671
+ },
4672
+ async loadHotTopics() {
4673
+ if (this.topicPopover.loading || !this.topicPopover.hasMore)
4674
+ return;
4675
+ this.topicPopover.loading = true;
4676
+ try {
4677
+ const response = await this.request.getTopic({
4678
+ action: "201023",
4679
+ page: this.topicPopover.page,
4680
+ limit: 50,
4681
+ hoopId: 0,
4682
+ type: 0,
4683
+ orderBy: "view"
4684
+ });
4685
+ if (response && response.data && response.data.code === 0) {
4686
+ const topics = response.data.data || [];
4687
+ if (topics.length === 0) {
4688
+ this.topicPopover.hasMore = false;
4689
+ } else {
4690
+ const existingIds = new Set(this.topicPopover.hotTopics.map((t) => t.id));
4691
+ const newTopics = topics.filter((t) => !existingIds.has(t.id));
4692
+ this.topicPopover.hotTopics = [...this.topicPopover.hotTopics, ...newTopics];
4693
+ this.topicPopover.page++;
4694
+ if (newTopics.length === 0) {
4695
+ this.topicPopover.hasMore = false;
4696
+ }
4697
+ }
4698
+ } else {
4699
+ console.warn("加载热门话题失败:", response);
4700
+ this.topicPopover.hasMore = false;
4701
+ }
4702
+ } catch (error) {
4703
+ console.error("加载热门话题失败:", error);
4704
+ this.topicPopover.hasMore = false;
4705
+ } finally {
4706
+ this.topicPopover.loading = false;
4707
+ this.updateGlobalTopicPopover();
4708
+ }
4709
+ },
4710
+ async searchTopics(keyword) {
4711
+ this.topicPopover.searchKeyword = keyword;
4712
+ this.topicPopover.searchTopics = [];
4713
+ this.topicPopover.searchPage = 1;
4714
+ this.topicPopover.searchHasMore = true;
4715
+ if (this.topicPopover.loading) {
4716
+ this.topicPopover.loading = false;
4717
+ }
4718
+ this.topicPopover.loading = true;
4719
+ try {
4720
+ const response = await this.request.getTopic({
4721
+ action: "201023",
4722
+ title: keyword,
4723
+ highlightTitle: "title",
4724
+ page: this.topicPopover.searchPage,
4725
+ limit: 50
4726
+ });
4727
+ if (response && response.data && response.data.code === 0) {
4728
+ const topics = response.data.data || [];
4729
+ this.topicPopover.searchTopics = topics;
4730
+ this.topicPopover.searchPage++;
4731
+ if (topics.length === 0) {
4732
+ this.topicPopover.searchHasMore = false;
4733
+ } else {
4734
+ this.topicPopover.searchHasMore = topics.length >= 50;
4735
+ }
4736
+ } else {
4737
+ console.warn("搜索话题失败:", response);
4738
+ this.topicPopover.searchHasMore = false;
4739
+ }
4740
+ } catch (error) {
4741
+ console.error("搜索话题失败:", error);
4742
+ this.topicPopover.searchHasMore = false;
4743
+ } finally {
4744
+ this.topicPopover.loading = false;
4745
+ this.updateGlobalTopicPopover();
4746
+ }
4747
+ },
4748
+ loadRecentTopics() {
4749
+ try {
4750
+ const localTopics = JSON.parse(localStorage.getItem("localTopic") || "[]");
4751
+ this.topicPopover.recentTopics = localTopics;
4752
+ } catch (error) {
4753
+ console.error("加载最近使用话题失败:", error);
4754
+ this.topicPopover.recentTopics = [];
4755
+ }
4756
+ },
4757
+ selectTopic(topic) {
4758
+ this.saveToRecentTopics(topic);
4759
+ this.insertTopicToEditor(topic);
4760
+ this.hideTopicPopover();
4761
+ this.$emit("topic-inserted", topic);
4762
+ },
4763
+ saveToRecentTopics(topic) {
4764
+ try {
4765
+ let recentTopics = JSON.parse(localStorage.getItem("localTopic") || "[]");
4766
+ recentTopics = recentTopics.filter((item) => item.id !== topic.id);
4767
+ recentTopics.unshift(topic);
4768
+ if (recentTopics.length > 20) {
4769
+ recentTopics = recentTopics.slice(0, 20);
4770
+ }
4771
+ localStorage.setItem("localTopic", JSON.stringify(recentTopics));
4772
+ } catch (error) {
4773
+ console.error("保存最近使用话题失败:", error);
4774
+ }
4775
+ },
4776
+ // 创建全局话题弹框
4777
+ createGlobalTopicPopover() {
4778
+ this.removeGlobalTopicPopover();
4779
+ const mask = document.createElement("div");
4780
+ mask.className = "topic-popover-mask";
4781
+ mask.addEventListener("click", () => {
4782
+ this.hideTopicPopover();
4783
+ });
4784
+ const container = document.createElement("div");
4785
+ container.className = "topic-popover";
4786
+ container.style.position = "fixed";
4787
+ container.style.top = this.topicPopover.position.top + "px";
4788
+ container.style.left = this.topicPopover.position.left + "px";
4789
+ container.style.zIndex = "9999";
4790
+ container.addEventListener("click", (e) => {
4791
+ e.stopPropagation();
4792
+ });
4793
+ container.innerHTML = this.createTopicPopoverContent();
4794
+ document.body.appendChild(mask);
4795
+ document.body.appendChild(container);
4796
+ this.topicPopover.globalMask = mask;
4797
+ this.topicPopover.globalContainer = container;
4798
+ this.bindTopicPopoverEvents();
4799
+ },
4800
+ // 移除全局话题弹框
4801
+ removeGlobalTopicPopover() {
4802
+ if (this.topicPopover.globalMask) {
4803
+ document.body.removeChild(this.topicPopover.globalMask);
4804
+ this.topicPopover.globalMask = null;
4805
+ }
4806
+ if (this.topicPopover.globalContainer) {
4807
+ document.body.removeChild(this.topicPopover.globalContainer);
4808
+ this.topicPopover.globalContainer = null;
4809
+ }
4810
+ },
4811
+ // 更新全局话题弹框内容
4812
+ updateGlobalTopicPopover() {
4813
+ if (!this.topicPopover.globalContainer)
4814
+ return;
4815
+ this.topicPopover.globalContainer.innerHTML = this.createTopicPopoverContent();
4816
+ this.bindTopicPopoverEvents();
4817
+ },
4818
+ // 创建话题弹框内容
4819
+ createTopicPopoverContent() {
4820
+ if (this.topicPopover.type === "hot") {
4821
+ return this.getHotTopicPopoverHTML();
4822
+ } else if (this.topicPopover.type === "search") {
4823
+ return this.getSearchTopicPopoverHTML();
4824
+ }
4825
+ return "";
4826
+ },
4827
+ // 获取热门话题弹框HTML
4828
+ getHotTopicPopoverHTML() {
4829
+ const activeTab = this.topicPopover.activeTab;
4830
+ const hotTopics = this.topicPopover.hotTopics;
4831
+ const recentTopics = this.topicPopover.recentTopics;
4832
+ const loading = this.topicPopover.loading;
4833
+ const hasMore = this.topicPopover.hasMore;
4834
+ let topicListHTML = "";
4835
+ if (activeTab === "hot") {
4836
+ if (loading && hotTopics.length === 0) {
4837
+ topicListHTML = '<div class="topic-loading">加载中...</div>';
4838
+ } else if (hotTopics.length === 0) {
4839
+ topicListHTML = '<div class="topic-empty">暂无热门话题</div>';
4840
+ } else {
4841
+ topicListHTML = hotTopics.map(
4842
+ (topic) => `<div class="topic-item" data-topic-id="${topic.id}">#${topic.exactlyMatchTitle}</div>`
4843
+ ).join("");
4844
+ if (loading) {
4845
+ topicListHTML += '<div class="topic-loading">加载更多...</div>';
4846
+ } else if (!hasMore) {
4847
+ topicListHTML += '<div class="topic-empty">没有更多了</div>';
4848
+ }
4849
+ }
4850
+ } else {
4851
+ if (recentTopics.length === 0) {
4852
+ topicListHTML = '<div class="topic-empty">暂无最近使用记录</div>';
4853
+ } else {
4854
+ topicListHTML = recentTopics.map(
4855
+ (topic) => `<div class="topic-item" data-topic-id="${topic.id}">#${topic.exactlyMatchTitle}</div>`
4856
+ ).join("");
4857
+ }
4858
+ }
4859
+ return `
4860
+ <div class="topic-popover-content">
4861
+ <div class="topic-tabs">
4862
+ <div class="topic-tab ${activeTab === "hot" ? "active" : ""}" data-tab="hot">
4863
+ 热门话题
4864
+ </div>
4865
+ <div class="topic-tab ${activeTab === "recent" ? "active" : ""}" data-tab="recent">
4866
+ 最近使用
4867
+ </div>
4868
+ </div>
4869
+ <div class="topic-list-container">
4870
+ <div class="topic-list">
4871
+ ${topicListHTML}
4872
+ </div>
4873
+ </div>
4874
+ </div>
4875
+ `;
4876
+ },
4877
+ // 获取搜索话题弹框HTML
4878
+ getSearchTopicPopoverHTML() {
4879
+ const searchKeyword = this.topicPopover.searchKeyword;
4880
+ const searchTopics = this.topicPopover.searchTopics;
4881
+ const loading = this.topicPopover.loading;
4882
+ const searchHasMore = this.topicPopover.searchHasMore;
4883
+ let topicListHTML = "";
4884
+ if (loading && searchTopics.length === 0) {
4885
+ topicListHTML = '<div class="topic-loading">搜索中...</div>';
4886
+ } else if (searchTopics.length === 0) {
4887
+ topicListHTML = '<div class="topic-empty">没有匹配到话题,请重新输入</div>';
4888
+ } else {
4889
+ topicListHTML = searchTopics.map(
4890
+ (topic) => `<div class="topic-item" data-topic-id="${topic.id}">#${topic.exactlyMatchTitle}</div>`
4891
+ ).join("");
4892
+ if (loading) {
4893
+ topicListHTML += '<div class="topic-loading">加载更多...</div>';
4894
+ } else if (!searchHasMore) {
4895
+ topicListHTML += '<div class="topic-empty">没有更多了</div>';
4896
+ }
4897
+ }
4898
+ return `
4899
+ <div class="topic-popover-content">
4900
+ <div class="topic-search-header">
4901
+ <span class="topic-search-title">#${searchKeyword}</span>
4902
+ </div>
4903
+ <div class="topic-list-container">
4904
+ <div class="topic-list">
4905
+ ${topicListHTML}
4906
+ </div>
4907
+ </div>
4908
+ </div>
4909
+ `;
4910
+ },
4911
+ // 绑定话题弹框事件
4912
+ bindTopicPopoverEvents() {
4913
+ if (!this.topicPopover.globalContainer)
4914
+ return;
4915
+ const tabs = this.topicPopover.globalContainer.querySelectorAll(".topic-tab");
4916
+ tabs.forEach((tab) => {
4917
+ tab.addEventListener("click", (e) => {
4918
+ const tabType = e.target.getAttribute("data-tab");
4919
+ this.switchTopicTab(tabType);
4920
+ });
4921
+ });
4922
+ const topicItems = this.topicPopover.globalContainer.querySelectorAll(".topic-item");
4923
+ topicItems.forEach((item) => {
4924
+ item.addEventListener("click", (e) => {
4925
+ const topicId = parseInt(e.target.getAttribute("data-topic-id"));
4926
+ const topic = this.findTopicById(topicId);
4927
+ if (topic) {
4928
+ this.selectTopic(topic);
4929
+ }
4930
+ });
4931
+ });
4932
+ const listContainer = this.topicPopover.globalContainer.querySelector(".topic-list-container");
4933
+ if (listContainer) {
4934
+ listContainer.addEventListener("scroll", (e) => {
4935
+ if (this.topicPopover.type === "hot") {
4936
+ this.handleTopicScroll(e);
4937
+ } else if (this.topicPopover.type === "search") {
4938
+ this.handleSearchTopicScroll(e);
4939
+ }
4940
+ });
4941
+ }
4942
+ },
4943
+ // 根据ID查找话题
4944
+ findTopicById(topicId) {
4945
+ let topic = this.topicPopover.hotTopics.find((t) => t.id === topicId);
4946
+ if (topic)
4947
+ return topic;
4948
+ topic = this.topicPopover.searchTopics.find((t) => t.id === topicId);
4949
+ if (topic)
4950
+ return topic;
4951
+ topic = this.topicPopover.recentTopics.find((t) => t.id === topicId);
4952
+ if (topic)
4953
+ return topic;
4954
+ return null;
4955
+ },
4956
+ handleTopicScroll(event) {
4957
+ if (this.topicPopover.activeTab !== "hot")
4958
+ return;
4959
+ const container = event.target;
4960
+ const scrollTop = container.scrollTop;
4961
+ const scrollHeight = container.scrollHeight;
4962
+ const clientHeight = container.clientHeight;
4963
+ if (scrollTop + clientHeight >= scrollHeight - 10) {
4964
+ this.loadHotTopics();
4965
+ }
4966
+ },
4967
+ handleSearchTopicScroll(event) {
4968
+ const container = event.target;
4969
+ const scrollTop = container.scrollTop;
4970
+ const scrollHeight = container.scrollHeight;
4971
+ const clientHeight = container.clientHeight;
4972
+ if (scrollTop + clientHeight >= scrollHeight - 10) {
4973
+ this.searchTopics(this.topicPopover.searchKeyword);
4974
+ }
4975
+ },
4976
+ insertTopicToEditor(topic) {
4977
+ const originalRange = this.topicPopover.originalRange;
4978
+ const triggerInfo = this.topicPopover.triggerInfo;
4979
+ const popoverType = this.topicPopover.type;
4980
+ this.hideTopicPopover();
4981
+ let range = originalRange;
4982
+ if (!range) {
4983
+ const selection2 = window.getSelection();
4984
+ if (selection2.rangeCount === 0)
4985
+ return;
4986
+ range = selection2.getRangeAt(0);
4987
+ }
4988
+ const topicText = `#${topic.exactlyMatchTitle}`;
4989
+ if (popoverType === "search" && triggerInfo && triggerInfo.paragraph) {
4990
+ const paragraph = triggerInfo.paragraph;
4991
+ const hashIndex = triggerInfo.hashIndex;
4992
+ const deleteRange = document.createRange();
4993
+ const walker = document.createTreeWalker(
4994
+ paragraph,
4995
+ NodeFilter.SHOW_TEXT,
4996
+ {
4997
+ acceptNode: function(node2) {
4998
+ let parent = node2.parentNode;
4999
+ while (parent && parent !== paragraph) {
5000
+ if (parent.tagName === "MDD-TOPIC") {
5001
+ return NodeFilter.FILTER_REJECT;
5002
+ }
5003
+ parent = parent.parentNode;
5004
+ }
5005
+ return NodeFilter.FILTER_ACCEPT;
5006
+ }
5007
+ },
5008
+ false
5009
+ );
5010
+ let position = 0;
5011
+ let startNode = null;
5012
+ let startOffset = 0;
5013
+ let endNode = null;
5014
+ let endOffset = 0;
5015
+ let node;
5016
+ while (node = walker.nextNode()) {
5017
+ if (position + node.textContent.length > hashIndex) {
5018
+ startNode = node;
5019
+ startOffset = hashIndex - position;
5020
+ break;
5021
+ }
5022
+ position += node.textContent.length;
5023
+ }
5024
+ const currentCursorPosition = triggerInfo.cursorPosition;
5025
+ position = 0;
5026
+ walker.currentNode = paragraph;
5027
+ while (node = walker.nextNode()) {
5028
+ if (position + node.textContent.length >= currentCursorPosition) {
5029
+ endNode = node;
5030
+ endOffset = currentCursorPosition - position;
5031
+ break;
5032
+ }
5033
+ position += node.textContent.length;
5034
+ }
5035
+ if (startNode && endNode) {
5036
+ deleteRange.setStart(startNode, startOffset);
5037
+ deleteRange.setEnd(endNode, endOffset);
5038
+ deleteRange.deleteContents();
5039
+ range = document.createRange();
5040
+ range.setStart(startNode, startOffset);
5041
+ range.collapse(true);
5042
+ }
5043
+ } else if (popoverType === "hot") {
5044
+ const container = range.startContainer;
5045
+ if (container.nodeType === Node.TEXT_NODE && container.textContent) {
5046
+ const offset = range.startOffset;
5047
+ if (offset > 0 && container.textContent[offset - 1] === "#") {
5048
+ const deleteRange = document.createRange();
5049
+ deleteRange.setStart(container, offset - 1);
5050
+ deleteRange.setEnd(container, offset);
5051
+ deleteRange.deleteContents();
5052
+ range.setStart(container, offset - 1);
5053
+ range.collapse(true);
5054
+ }
5055
+ }
5056
+ }
5057
+ const topicElement = document.createElement("mdd-topic");
5058
+ topicElement.setAttribute("data-topic", JSON.stringify({
5059
+ topicId: topic.id,
5060
+ topicType: 0,
5061
+ startIndex: 0,
5062
+ // 会在updateTopicPosition中更新
5063
+ endIndex: 0
5064
+ // 会在updateTopicPosition中更新
5065
+ }));
5066
+ topicElement.textContent = topicText;
5067
+ topicElement.setAttribute("contenteditable", "false");
5068
+ range.deleteContents();
5069
+ range.insertNode(topicElement);
5070
+ const spaceNode = document.createTextNode(" ");
5071
+ range.setStartAfter(topicElement);
5072
+ range.insertNode(spaceNode);
5073
+ const newRange = document.createRange();
5074
+ newRange.setStartAfter(spaceNode);
5075
+ newRange.collapse(true);
5076
+ const selection = window.getSelection();
5077
+ selection.removeAllRanges();
5078
+ selection.addRange(newRange);
5079
+ setTimeout(() => {
5080
+ const currentSelection = window.getSelection();
5081
+ if (currentSelection.rangeCount > 0) {
5082
+ const currentRange = currentSelection.getRangeAt(0);
5083
+ if (currentRange.startContainer !== spaceNode.nextSibling) {
5084
+ const correctRange = document.createRange();
5085
+ correctRange.setStartAfter(spaceNode);
5086
+ correctRange.collapse(true);
5087
+ currentSelection.removeAllRanges();
5088
+ currentSelection.addRange(correctRange);
5089
+ }
5090
+ }
5091
+ }, 0);
5092
+ this.$emit("update-topic-position");
5093
+ },
5094
+ // 销毁话题管理器
5095
+ destroy() {
5096
+ this.unbindEditorEvents();
5097
+ this.hideTopicPopover();
5098
+ }
5099
+ },
5100
+ mounted() {
5101
+ this.init();
5102
+ },
5103
+ beforeUnmount() {
5104
+ this.destroy();
5105
+ }
5106
+ };
5107
+ const _hoisted_1$3 = { class: "topic-manager" };
5108
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
5109
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3);
5110
+ }
5111
+ const TopicManager = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
5112
+ const index_vue_vue_type_style_index_0_lang = "";
5113
+ const _sfc_main$2 = {
5114
+ provide() {
5115
+ return {
5116
+ vm: this
5117
+ };
5118
+ },
5119
+ components: {
5120
+ ElInput: elementPlus.ElInput,
5121
+ BasicDialog: _sfc_main$7,
5122
+ draggable
5123
+ },
5124
+ props: {
5125
+ visible: {
5126
+ type: Boolean,
5127
+ default: false
5128
+ },
5129
+ linkContent: {
5130
+ type: String,
5131
+ default: ""
5132
+ },
5133
+ fileSelected: {
5134
+ type: Function,
5135
+ default: () => {
5136
+ }
5137
+ }
5138
+ },
5139
+ data() {
5140
+ return {};
5141
+ },
5142
+ computed: {
5143
+ input: {
5144
+ get() {
5145
+ return this.linkContent;
5146
+ },
5147
+ set(val) {
5148
+ this.$emit("update:linkContent", val);
5149
+ }
5150
+ }
5151
+ },
5152
+ mounted() {
5153
+ },
5154
+ methods: {
5155
+ emitEvent() {
5156
+ var event = new MouseEvent("click");
5157
+ var ele = document.getElementsByClassName("video-input");
5158
+ ele[0].dispatchEvent(event);
5159
+ },
5160
+ setStatus(val) {
5161
+ this.$emit("update:visible", val);
5162
+ }
5163
+ // submit() {
5164
+ // this.$emit('submit')
5165
+ // }
5166
+ }
5167
+ };
5168
+ const _hoisted_1$2 = { class: "collect-article_content" };
5169
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
5170
+ const _component_el_input = vue.resolveComponent("el-input");
5171
+ const _component_BasicDialog = vue.resolveComponent("BasicDialog");
5172
+ return vue.openBlock(), vue.createBlock(_component_BasicDialog, {
5173
+ visible: $props.visible,
5174
+ width: "600px",
5175
+ height: "50px"
5176
+ }, {
5177
+ title: vue.withCtx(() => _cache[1] || (_cache[1] = [
5178
+ vue.createElementVNode("div", null, [
5179
+ vue.createElementVNode("span", null, "采集文章"),
5180
+ vue.createElementVNode("span", { class: "collect-article_lable" }, "如需获得正式使用权,请自行联系版权所有者")
5181
+ ], -1)
5182
+ ])),
5183
+ default: vue.withCtx(() => [
5184
+ vue.createElementVNode("div", _hoisted_1$2, [
5185
+ _cache[2] || (_cache[2] = vue.createElementVNode("div", { class: "tip" }, "请把需要采集的文章链接粘贴在下方的输入框:", -1)),
5186
+ vue.createVNode(_component_el_input, {
5187
+ modelValue: $options.input,
5188
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.input = $event),
5189
+ placeholder: "仅支持微信链接"
5190
+ }, null, 8, ["modelValue"])
5191
+ ])
5192
+ ]),
5193
+ _: 1
5194
+ }, 8, ["visible"]);
5195
+ }
5196
+ const CollectArticle = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
5197
+ const index_vue_vue_type_style_index_0_scoped_4ebe06df_lang = "";
5198
+ const _sfc_main$1 = {
5199
+ components: {
5200
+ ElIconError: iconsVue.CircleCloseFilled
5201
+ },
5202
+ props: {
5203
+ article: {
5204
+ type: Object,
5205
+ default: () => ({})
5206
+ }
5207
+ },
5208
+ methods: {
5209
+ close(e) {
5210
+ let child = e.target;
5211
+ while (child) {
5212
+ if (child.dataset.article) {
5213
+ child.parentNode.removeChild(child);
5214
+ break;
5215
+ }
5216
+ child = child.parentNode;
5217
+ }
5218
+ this.$emit("delete");
5219
+ }
5220
+ }
5221
+ };
5222
+ const _hoisted_1$1 = {
5223
+ class: "article-item",
5224
+ contenteditable: "false"
5225
+ };
5226
+ const _hoisted_2$1 = ["src"];
5227
+ const _hoisted_3$1 = { class: "article-item_right" };
4517
5228
  const _hoisted_4 = { class: "name" };
4518
5229
  const _hoisted_5 = { class: "score" };
4519
5230
  function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
@@ -4528,8 +5239,8 @@
4528
5239
  vue.createElementVNode("div", _hoisted_4, vue.toDisplayString($props.article.title), 1),
4529
5240
  vue.createElementVNode("div", _hoisted_5, [
4530
5241
  vue.createElementVNode("span", null, vue.toDisplayString($props.article.author), 1),
4531
- vue.createElementVNode("span", null, vue.toDisplayString($props.article.viewNum) + "\u6D4F\u89C8", 1),
4532
- vue.createElementVNode("span", null, vue.toDisplayString($props.article.replycnt) + "\u8BC4\u8BBA", 1)
5242
+ vue.createElementVNode("span", null, vue.toDisplayString($props.article.viewNum) + "浏览", 1),
5243
+ vue.createElementVNode("span", null, vue.toDisplayString($props.article.replycnt) + "评论", 1)
4533
5244
  ])
4534
5245
  ]),
4535
5246
  vue.createVNode(_component_el_icon_error, {
@@ -4541,10 +5252,10 @@
4541
5252
  class: vue.normalizeClass([{
4542
5253
  "article-bg-height": $props.article.img || $props.article.mediaInfo && $props.article.mediaInfo.length
4543
5254
  }, "article-bg"])
4544
- }, " \u5E73\u53F0\u4EC5\u652F\u6301\u5C55\u793A18\u4E2A\u6708\u7684\u63A8\u8350\u5185\u5BB9 ", 2)) : vue.createCommentVNode("", true)
5255
+ }, " 平台仅支持展示18个月的推荐内容 ", 2)) : vue.createCommentVNode("", true)
4545
5256
  ]);
4546
5257
  }
4547
- const Item = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-1c406a11"]]);
5258
+ const Item = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-4ebe06df"]]);
4548
5259
  const mountArticleDom = (props, del) => {
4549
5260
  const className = "article-wrap";
4550
5261
  const article = props.article;
@@ -4578,14 +5289,15 @@
4578
5289
  name: "Edit",
4579
5290
  components: {
4580
5291
  ElInput: elementPlus.ElInput,
4581
- InsertArticle: _sfc_main$5,
4582
- ImgUpload: _sfc_main$4,
4583
- VideoUpload: _sfc_main$3,
5292
+ InsertArticle: _sfc_main$6,
5293
+ ImgUpload: _sfc_main$5,
5294
+ VideoUpload: _sfc_main$4,
4584
5295
  CollectArticle,
4585
5296
  ElFormItem: elementPlus.ElFormItem,
4586
5297
  ElForm: elementPlus.ElForm,
4587
5298
  ElDialog: elementPlus.ElDialog,
4588
- ElButton: elementPlus.ElButton
5299
+ ElButton: elementPlus.ElButton,
5300
+ TopicManager
4589
5301
  },
4590
5302
  props: [
4591
5303
  "disabled",
@@ -4595,13 +5307,15 @@
4595
5307
  "importEssay",
4596
5308
  "uploadImageByOther",
4597
5309
  "chartGallery",
4598
- "request"
5310
+ "request",
5311
+ "placeholder"
4599
5312
  ],
4600
5313
  data() {
4601
5314
  return {
4602
5315
  hasArticleCard: false,
4603
5316
  cursorStyle: "auto",
4604
5317
  titleCount: 0,
5318
+ // 标题数量
4605
5319
  viewLinkDialog: false,
4606
5320
  linkForm: {
4607
5321
  linkAddress: "",
@@ -4609,39 +5323,54 @@
4609
5323
  },
4610
5324
  setAlignFlag: true,
4611
5325
  article: {},
5326
+ // 插入的文章
4612
5327
  imgList: [],
4613
5328
  imgNum: 20,
4614
5329
  videoList: [],
4615
5330
  visibleVideo: false,
4616
5331
  visibleCollectArticle: false,
4617
5332
  visibleArticle: false,
5333
+ // 插入文章
4618
5334
  visibleImg: false,
5335
+ // 插入图片
4619
5336
  imgType: "normal",
5337
+ //
4620
5338
  typeEnum: {
4621
- \u6587\u5B57: "1",
4622
- \u56FE\u7247: "2",
4623
- \u56FE\u6587: "3",
4624
- \u6BB5\u843D\u6807\u9898: "4",
4625
- \u5173\u8054: "5",
4626
- \u5355\u89C6\u9891: "6",
4627
- \u89C6\u9891\u6587\u5B57: "7",
5339
+ 文字: "1",
5340
+ 图片: "2",
5341
+ 图文: "3",
5342
+ 段落标题: "4",
5343
+ 关联: "5",
5344
+ // 关联车辆、轨迹、活动、商家、话题
5345
+ 单视频: "6",
5346
+ 视频文字: "7",
4628
5347
  URL: "8",
4629
- \u6587\u7AE0\u5361\u7247: "11"
5348
+ 文章卡片: "11"
4630
5349
  },
4631
5350
  fontInfo: {
4632
5351
  size: ""
4633
5352
  },
4634
5353
  user: {},
5354
+ // 用户
4635
5355
  editor: {},
5356
+ // 编辑器实例对象
4636
5357
  editorDom: {},
5358
+ // 编辑器Dom
4637
5359
  uploadStore: {},
5360
+ // 待上传的图片池
4638
5361
  linkContent: "",
5362
+ // 插入链接的地址
4639
5363
  loadingText: "",
5364
+ // loaing的提示文字
4640
5365
  progressPercent: "",
5366
+ // 上传进度
4641
5367
  currentIndex: 0,
4642
5368
  loading: false,
5369
+ // 是否提交中
4643
5370
  viewStatus: false,
5371
+ // todo: 改名
4644
5372
  linkStatus: false,
5373
+ // todo: 改名
4645
5374
  styleStatus: {
4646
5375
  bold: false,
4647
5376
  italic: false,
@@ -4665,6 +5394,7 @@
4665
5394
  targetMove: "",
4666
5395
  moverClasses: ["halo-img-content", "halo-video-content"],
4667
5396
  selectDom: null
5397
+ //选中的dom
4668
5398
  };
4669
5399
  },
4670
5400
  computed: {
@@ -4681,12 +5411,12 @@
4681
5411
  watch: {
4682
5412
  progressPercent(val) {
4683
5413
  const inner = document.querySelector(".video-progress .inner");
4684
- console.log(val, "\u89C6\u9891\u4E0A\u4F20\u8FDB\u5EA6");
5414
+ console.log(val, "视频上传进度");
4685
5415
  if (inner) {
4686
5416
  inner.style.width = val + "%";
4687
5417
  if (val === 100) {
4688
5418
  document.querySelector(".video-progress").innerHTML = `
4689
- <div class="no-calc" style="text-align:center;color:#999999;font-size:18px;">\u6B63\u5728\u83B7\u53D6\u89C6\u9891\u5C01\u9762</div>
5419
+ <div class="no-calc" style="text-align:center;color:#999999;font-size:18px;">正在获取视频封面</div>
4690
5420
  `;
4691
5421
  }
4692
5422
  }
@@ -4705,7 +5435,7 @@
4705
5435
  me2.user = JSON.parse(
4706
5436
  window.localStorage.getItem("user") || window.localStorage.getItem("userInfo") || "{}"
4707
5437
  );
4708
- me2.guid = me2.user.uid + "|" + util__default.default.tools.guid();
5438
+ me2.guid = me2.user.uid + "|" + util.tools.guid();
4709
5439
  },
4710
5440
  beforeDestroy() {
4711
5441
  this.editorDom && this.editorDom.removeEventListener("blur", this.canSetAlign);
@@ -4738,7 +5468,6 @@
4738
5468
  },
4739
5469
  setCursor() {
4740
5470
  this.cursorStyle = this.cursorStyle === cursorImg ? "auto" : cursorImg;
4741
- console.log(this.styleStatus, 999);
4742
5471
  this.curStyle = { ...this.styleStatus };
4743
5472
  this.editorDom.addEventListener("mouseup", this.handleCopyFormatUp);
4744
5473
  },
@@ -4776,10 +5505,10 @@
4776
5505
  this.visibleVideo = false;
4777
5506
  const fileName = (files[0] && files[0].name || "").toLowerCase();
4778
5507
  if (files[0].size > 1 * 1024 * 1024 * 1024) {
4779
- return me2.setToast("\u89C6\u9891\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC71GB");
5508
+ return me2.setToast("视频大小不能超过1GB");
4780
5509
  }
4781
5510
  if (fileName.indexOf(".mp4") === -1 && fileName.indexOf(".mov") === -1) {
4782
- return me2.setToast("\u89C6\u9891\u683C\u5F0F\u4E0D\u662Fmp4\u6216mov");
5511
+ return me2.setToast("视频格式不是mp4或mov");
4783
5512
  }
4784
5513
  const me2 = this;
4785
5514
  if (me2.loading)
@@ -4799,7 +5528,9 @@
4799
5528
  id: result.videoId,
4800
5529
  desc: "",
4801
5530
  vodSize: result.vodSize || "",
5531
+ // 视频大小
4802
5532
  vodType: result.vodType || ""
5533
+ // 图片尺寸
4803
5534
  };
4804
5535
  me2.$emit("updateAddVideo", true);
4805
5536
  me2.editor["insertVideo"](result.videoUrl, video);
@@ -4853,11 +5584,11 @@
4853
5584
  },
4854
5585
  insertLink() {
4855
5586
  if (!this.linkForm.linkAddress)
4856
- return elementPlus.ElMessage.error("\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740");
5587
+ return elementPlus.ElMessage.error("请输入链接地址");
4857
5588
  if (!this.linkForm.linkWriting)
4858
- return elementPlus.ElMessage.error("\u8BF7\u8F93\u5165\u94FE\u63A5\u6587\u6848");
5589
+ return elementPlus.ElMessage.error("请输入链接文案");
4859
5590
  if (!this.validUrl(this.linkForm.linkAddress)) {
4860
- return this.setToast("URL\u65E0\u6548");
5591
+ return this.setToast("URL无效");
4861
5592
  }
4862
5593
  this.editor.insertLink(
4863
5594
  this.linkForm.linkAddress,
@@ -4886,6 +5617,10 @@
4886
5617
  });
4887
5618
  });
4888
5619
  },
5620
+ // TopicManager事件处理
5621
+ onTopicInserted(topic) {
5622
+ this.updateData(true);
5623
+ },
4889
5624
  getHtml(type) {
4890
5625
  this.updateTopicPosition();
4891
5626
  const html = this.editor.getHTML();
@@ -4987,6 +5722,8 @@
4987
5722
  const frag = document.createDocumentFragment();
4988
5723
  frag.appendChild(this.editor.empty(div));
4989
5724
  const nodes = [...frag.childNodes];
5725
+ const mddTopics = frag.querySelectorAll("mdd-topic");
5726
+ mddTopics.forEach((topic) => topic.setAttribute("contenteditable", "false"));
4990
5727
  for (let i = 0; i < nodes.length; i++) {
4991
5728
  const node = nodes[i];
4992
5729
  if (node.nodeType === 1) {
@@ -5080,6 +5817,8 @@
5080
5817
  },
5081
5818
  async parseArticle(node) {
5082
5819
  const data = JSON.parse(node.dataset.article);
5820
+ if (!this.getEassyDetail)
5821
+ return;
5083
5822
  await this.getEassyDetail(data.id, (info) => {
5084
5823
  const el = mountArticleDom(
5085
5824
  {
@@ -5336,7 +6075,7 @@
5336
6075
  }
5337
6076
  this.updateData(true);
5338
6077
  } else {
5339
- this.setToast(rst.origin.name + "\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
6078
+ this.setToast(rst.origin.name + "上传失败,请重试");
5340
6079
  }
5341
6080
  },
5342
6081
  insertVideoBtns(editor, node) {
@@ -5351,7 +6090,7 @@
5351
6090
  me2.currentVideo = node;
5352
6091
  e.stopPropagation();
5353
6092
  };
5354
- replaceBtn.innerText = "\u66F4\u6362\u5C01\u9762";
6093
+ replaceBtn.innerText = "更换封面";
5355
6094
  return replaceBtn;
5356
6095
  },
5357
6096
  insertImgOperateBtns(editor, data) {
@@ -5372,13 +6111,12 @@
5372
6111
  }
5373
6112
  });
5374
6113
  var descInputWrap;
5375
- console.log(data.seamlessFlag, "count<<<<<<");
5376
6114
  var descInput = editor.createElement("textarea", {
5377
6115
  class: "desc-input",
5378
6116
  maxlength: "50",
5379
6117
  rows: "2",
5380
6118
  cols: "50",
5381
- placeholder: "\u8BF7\u8F93\u5165\u56FE\u7247\u63CF\u8FF0(\u6700\u591A50\u5B57)",
6119
+ placeholder: "请输入图片描述(最多50字)",
5382
6120
  contenteditable: "false"
5383
6121
  });
5384
6122
  descInput.disabled = me2.disabled;
@@ -5387,7 +6125,7 @@
5387
6125
  const img = parent.querySelector(".halo-picture-area");
5388
6126
  img.dataset.desc = e.target.value;
5389
6127
  if (e.target.value.length > 49) {
5390
- return me2.setToast("\u9650\u523650\u4E2A\u5B57\u7B26");
6128
+ return me2.setToast("限制50个字符");
5391
6129
  }
5392
6130
  };
5393
6131
  descInput.value = data.content || "";
@@ -5437,7 +6175,7 @@
5437
6175
  me2.removeParentByClass(e.target, "halo-img-content");
5438
6176
  me2.updateData(true);
5439
6177
  };
5440
- replaceBtn.innerHTML = "\u66FF\u6362";
6178
+ replaceBtn.innerHTML = "替换";
5441
6179
  return [replaceBtn, delBtn, descInputWrap];
5442
6180
  },
5443
6181
  removeSeamlessLaster(e) {
@@ -5461,6 +6199,7 @@
5461
6199
  }
5462
6200
  }
5463
6201
  },
6202
+ // 初始化编辑器数据,数据是 html 格式(displayData)
5464
6203
  initData(data = "", essayPicRelVOList) {
5465
6204
  this.parseHtml(data, essayPicRelVOList).then((res) => {
5466
6205
  this.editorDom.innerHTML = "";
@@ -5468,6 +6207,13 @@
5468
6207
  this.updateData();
5469
6208
  });
5470
6209
  },
6210
+ // TODO jsonToHtml、htmlToJson 实现这 2 个方法里面的逻辑,数据结构参考方法里面的注释,出参入参都为字符串,注意:mdd-topic 里面的属性数据 和 json 中的topicPosition数据是一一对应的,startIndex、endIndex为mdd-topic的起止位置 从 content 里面进行分割处理
6211
+ // json、html 数据格式互转,暂时只支持文字、短话题
6212
+ jsonToHtml(json) {
6213
+ },
6214
+ htmlToJson(html) {
6215
+ },
6216
+ // 设置富文本组件
5471
6217
  initSquire() {
5472
6218
  const me2 = this;
5473
6219
  const editorDom = me2.editorDom;
@@ -5555,7 +6301,8 @@
5555
6301
  event.preventDefault();
5556
6302
  });
5557
6303
  me2.editor.addEventListener("keydown", function(event) {
5558
- if (event.keyCode === 8 || event.keyCode === 46) {
6304
+ var _a, _b, _c;
6305
+ if (["Backspace", "Delete"].includes(event.key)) {
5559
6306
  try {
5560
6307
  const selection2 = getSelection();
5561
6308
  if (me2.selectDom && me2.moverClasses.includes(me2.selectDom.className)) {
@@ -5589,32 +6336,10 @@
5589
6336
  } catch (error) {
5590
6337
  console.log(error);
5591
6338
  }
5592
- }
5593
- const selection = window.getSelection();
5594
- if (selection.rangeCount > 0) {
5595
- const range = selection.getRangeAt(0);
5596
- const startContainer = range.startContainer;
5597
- let isInMddTopic = false;
5598
- if (startContainer.nodeType === Node.ELEMENT_NODE && startContainer.tagName === "MDD-TOPIC") {
5599
- isInMddTopic = true;
5600
- } else if (startContainer.nodeType === Node.TEXT_NODE) {
5601
- const parent = startContainer.parentNode;
5602
- if (parent.tagName === "MDD-TOPIC") {
5603
- isInMddTopic = true;
5604
- }
5605
- }
5606
- if (isInMddTopic) {
5607
- if (event.key === "Enter") {
5608
- event.preventDefault();
5609
- return;
5610
- }
5611
- const isPrintableKey = event.key.length === 1;
5612
- if (isPrintableKey) {
5613
- event.preventDefault();
5614
- return;
5615
- }
5616
- }
5617
- if ((event.key === "Backspace" || event.key === "Delete") && isInMddTopic) {
6339
+ const selection = window.getSelection();
6340
+ if (selection.rangeCount > 0) {
6341
+ const range = selection.getRangeAt(0);
6342
+ const startContainer = range.startContainer;
5618
6343
  if (startContainer.nodeType === Node.ELEMENT_NODE && startContainer.tagName === "MDD-TOPIC") {
5619
6344
  startContainer.remove();
5620
6345
  event.preventDefault();
@@ -5627,6 +6352,228 @@
5627
6352
  return;
5628
6353
  }
5629
6354
  }
6355
+ let currentParagraph = startContainer;
6356
+ while (currentParagraph && currentParagraph.nodeType !== Node.ELEMENT_NODE) {
6357
+ currentParagraph = currentParagraph.parentNode;
6358
+ }
6359
+ while (currentParagraph && !((_a = currentParagraph.classList) == null ? void 0 : _a.contains("halo-paragraph"))) {
6360
+ currentParagraph = currentParagraph.parentNode;
6361
+ }
6362
+ if (currentParagraph && event.key === "Backspace") {
6363
+ const container = range.startContainer;
6364
+ const offset = range.startOffset;
6365
+ let isAtParagraphStart = false;
6366
+ let cursorBeforeContent = null;
6367
+ if (container === currentParagraph && offset === 0) {
6368
+ isAtParagraphStart = true;
6369
+ cursorBeforeContent = currentParagraph.firstChild;
6370
+ } else if (container.nodeType === Node.TEXT_NODE && offset === 0) {
6371
+ let isFirstContent = true;
6372
+ let currentNode = currentParagraph.firstChild;
6373
+ while (currentNode && currentNode !== container) {
6374
+ if (currentNode.nodeType === Node.TEXT_NODE && currentNode.textContent.trim() !== "") {
6375
+ isFirstContent = false;
6376
+ break;
6377
+ } else if (currentNode.nodeType === Node.ELEMENT_NODE) {
6378
+ isFirstContent = false;
6379
+ break;
6380
+ }
6381
+ currentNode = currentNode.nextSibling;
6382
+ }
6383
+ if (isFirstContent) {
6384
+ isAtParagraphStart = true;
6385
+ cursorBeforeContent = container;
6386
+ }
6387
+ } else if (container === currentParagraph && offset > 0) {
6388
+ let hasContentBefore = false;
6389
+ for (let i = 0; i < offset; i++) {
6390
+ const node = currentParagraph.childNodes[i];
6391
+ if (node.nodeType === Node.TEXT_NODE && node.textContent.trim() !== "") {
6392
+ hasContentBefore = true;
6393
+ break;
6394
+ } else if (node.nodeType === Node.ELEMENT_NODE) {
6395
+ hasContentBefore = true;
6396
+ break;
6397
+ }
6398
+ }
6399
+ if (!hasContentBefore && offset < currentParagraph.childNodes.length) {
6400
+ isAtParagraphStart = true;
6401
+ cursorBeforeContent = currentParagraph.childNodes[offset];
6402
+ }
6403
+ }
6404
+ if (isAtParagraphStart) {
6405
+ const prevParagraph = currentParagraph.previousElementSibling;
6406
+ if (prevParagraph && prevParagraph.classList.contains("halo-paragraph")) {
6407
+ const prevContent = prevParagraph.innerHTML.trim();
6408
+ if (prevContent === "<br>" || prevContent === "") {
6409
+ prevParagraph.remove();
6410
+ event.preventDefault();
6411
+ me2.updateData(true);
6412
+ return;
6413
+ } else {
6414
+ const mergePoint = prevParagraph.childNodes.length;
6415
+ if (prevParagraph.lastChild && prevParagraph.lastChild.tagName === "BR") {
6416
+ prevParagraph.removeChild(prevParagraph.lastChild);
6417
+ }
6418
+ const nodesToMove = Array.from(currentParagraph.childNodes);
6419
+ nodesToMove.forEach((node) => {
6420
+ prevParagraph.appendChild(node);
6421
+ });
6422
+ currentParagraph.remove();
6423
+ const newRange = document.createRange();
6424
+ if (cursorBeforeContent && prevParagraph.contains(cursorBeforeContent)) {
6425
+ newRange.setStartBefore(cursorBeforeContent);
6426
+ } else {
6427
+ if (mergePoint < prevParagraph.childNodes.length) {
6428
+ newRange.setStartBefore(prevParagraph.childNodes[mergePoint]);
6429
+ } else {
6430
+ newRange.setStart(prevParagraph, prevParagraph.childNodes.length);
6431
+ }
6432
+ }
6433
+ newRange.collapse(true);
6434
+ const selection2 = window.getSelection();
6435
+ selection2.removeAllRanges();
6436
+ selection2.addRange(newRange);
6437
+ event.preventDefault();
6438
+ me2.updateData(true);
6439
+ return;
6440
+ }
6441
+ }
6442
+ }
6443
+ }
6444
+ }
6445
+ }
6446
+ if (event.key === "Enter") {
6447
+ const selection = window.getSelection();
6448
+ if (selection.rangeCount > 0) {
6449
+ const range = selection.getRangeAt(0);
6450
+ const startContainer = range.startContainer;
6451
+ let currentParagraph = startContainer;
6452
+ while (currentParagraph && currentParagraph.nodeType !== Node.ELEMENT_NODE) {
6453
+ currentParagraph = currentParagraph.parentNode;
6454
+ }
6455
+ while (currentParagraph && !((_b = currentParagraph.classList) == null ? void 0 : _b.contains("halo-paragraph"))) {
6456
+ currentParagraph = currentParagraph.parentNode;
6457
+ }
6458
+ if (!(currentParagraph == null ? void 0 : currentParagraph.querySelector("mdd-topic"))) {
6459
+ return;
6460
+ }
6461
+ if (me2.isBetweenTwoTopics(range)) {
6462
+ event.preventDefault();
6463
+ me2.handleEnterBetweenTopics(range);
6464
+ return;
6465
+ }
6466
+ if (me2.wouldCreateNestedParagraph(range)) {
6467
+ event.preventDefault();
6468
+ me2.handleEnterKeyInParagraphWithTopic(range);
6469
+ return;
6470
+ }
6471
+ if (currentParagraph && currentParagraph.querySelector("mdd-topic")) {
6472
+ event.preventDefault();
6473
+ me2.handleEnterKeyInParagraphWithTopic(range);
6474
+ return;
6475
+ }
6476
+ }
6477
+ }
6478
+ if ((event.metaKey || event.ctrlKey) && event.key === "ArrowLeft") {
6479
+ const selection = window.getSelection();
6480
+ if (selection.rangeCount > 0) {
6481
+ const range = selection.getRangeAt(0);
6482
+ const container = range.startContainer;
6483
+ let currentParagraph = container;
6484
+ while (currentParagraph && currentParagraph.nodeType !== Node.ELEMENT_NODE) {
6485
+ currentParagraph = currentParagraph.parentNode;
6486
+ }
6487
+ while (currentParagraph && !((_c = currentParagraph.classList) == null ? void 0 : _c.contains("halo-paragraph"))) {
6488
+ currentParagraph = currentParagraph.parentNode;
6489
+ }
6490
+ if (currentParagraph) {
6491
+ const firstTopic = currentParagraph.querySelector("mdd-topic");
6492
+ if (firstTopic) {
6493
+ let hasTextBeforeTopic = false;
6494
+ let currentNode = currentParagraph.firstChild;
6495
+ while (currentNode && currentNode !== firstTopic) {
6496
+ if (currentNode.nodeType === Node.TEXT_NODE && currentNode.textContent.trim() !== "") {
6497
+ hasTextBeforeTopic = true;
6498
+ break;
6499
+ }
6500
+ currentNode = currentNode.nextSibling;
6501
+ }
6502
+ if (hasTextBeforeTopic) {
6503
+ if (container === currentParagraph && range.startOffset === 0) {
6504
+ return;
6505
+ }
6506
+ let shouldMoveToStart = false;
6507
+ const offset2 = range.startOffset;
6508
+ if (container.nodeType === Node.TEXT_NODE && container.parentNode === firstTopic) {
6509
+ shouldMoveToStart = true;
6510
+ } else if (container === firstTopic) {
6511
+ shouldMoveToStart = true;
6512
+ } else if (container.nodeType === Node.TEXT_NODE) {
6513
+ let prevSibling = container.previousSibling;
6514
+ while (prevSibling) {
6515
+ if (prevSibling === firstTopic) {
6516
+ shouldMoveToStart = true;
6517
+ break;
6518
+ }
6519
+ prevSibling = prevSibling.previousSibling;
6520
+ }
6521
+ } else if (container === currentParagraph) {
6522
+ const topicRange = document.createRange();
6523
+ topicRange.selectNode(firstTopic);
6524
+ const cursorRange = document.createRange();
6525
+ cursorRange.setStart(container, offset2);
6526
+ cursorRange.collapse(true);
6527
+ if (cursorRange.compareBoundaryPoints(Range.START_TO_END, topicRange) > 0) {
6528
+ shouldMoveToStart = true;
6529
+ }
6530
+ }
6531
+ if (shouldMoveToStart) {
6532
+ event.preventDefault();
6533
+ event.stopPropagation();
6534
+ const newRange = document.createRange();
6535
+ newRange.setStart(currentParagraph, 0);
6536
+ newRange.collapse(true);
6537
+ const selection2 = window.getSelection();
6538
+ selection2.removeAllRanges();
6539
+ selection2.addRange(newRange);
6540
+ return false;
6541
+ }
6542
+ return;
6543
+ }
6544
+ let shouldMoveToTopicStart = false;
6545
+ const offset = range.startOffset;
6546
+ if (container.nodeType === Node.TEXT_NODE && container.parentNode === firstTopic) {
6547
+ shouldMoveToTopicStart = true;
6548
+ } else if (container === firstTopic) {
6549
+ shouldMoveToTopicStart = true;
6550
+ } else if (container.nodeType === Node.TEXT_NODE) {
6551
+ let prevSibling = container.previousSibling;
6552
+ while (prevSibling) {
6553
+ if (prevSibling === firstTopic) {
6554
+ shouldMoveToTopicStart = true;
6555
+ break;
6556
+ }
6557
+ prevSibling = prevSibling.previousSibling;
6558
+ }
6559
+ } else if (container === currentParagraph) {
6560
+ const topicRange = document.createRange();
6561
+ topicRange.selectNode(firstTopic);
6562
+ const cursorRange = document.createRange();
6563
+ cursorRange.setStart(container, offset);
6564
+ cursorRange.collapse(true);
6565
+ if (cursorRange.compareBoundaryPoints(Range.START_TO_END, topicRange) > 0) {
6566
+ shouldMoveToTopicStart = true;
6567
+ }
6568
+ }
6569
+ if (shouldMoveToTopicStart) {
6570
+ event.preventDefault();
6571
+ event.stopPropagation();
6572
+ me2.setCursorBeforeElement(firstTopic);
6573
+ return false;
6574
+ }
6575
+ }
6576
+ }
5630
6577
  }
5631
6578
  }
5632
6579
  });
@@ -5689,7 +6636,6 @@
5689
6636
  this.insertElement(p);
5690
6637
  };
5691
6638
  window.Squire.prototype.makeHeader = function(content, config = { makeHeader: {} }) {
5692
- console.log(content);
5693
6639
  if (content) {
5694
6640
  const h2 = this.createElement("h2", {
5695
6641
  class: "halo-paragraph-title"
@@ -5715,6 +6661,7 @@
5715
6661
  window.Squire.empty(block)
5716
6662
  ]);
5717
6663
  output.appendChild(
6664
+ // 段落才能添加标题
5718
6665
  Array.from(block.classList).indexOf("halo-img-content") > -1 ? block : container
5719
6666
  );
5720
6667
  }
@@ -5722,7 +6669,6 @@
5722
6669
  });
5723
6670
  const selection = window.getSelection();
5724
6671
  const range = document.createRange();
5725
- console.log(container);
5726
6672
  range.setStart(container, 1);
5727
6673
  range.collapse(true);
5728
6674
  selection.removeAllRanges();
@@ -5738,18 +6684,18 @@
5738
6684
  });
5739
6685
  loading.innerHTML = `
5740
6686
  <img class="img-loading-icon" src="/img/upload-image-loading.png"/>
5741
- <span class="img-loading-tip">\u4E0A\u4F20\u4E2D...</span>
6687
+ <span class="img-loading-tip">上传中...</span>
5742
6688
  `;
5743
6689
  var fail = this.createElement("div", {
5744
6690
  class: "img-fail hide",
5745
6691
  contenteditable: "false"
5746
6692
  });
5747
- fail.innerHTML = "\u4E0A\u4F20\u5931\u8D25<br>\u8BF7\u4E0B\u8F7D\u56FE\u7247\u81F3\u672C\u5730\u540E\u91CD\u65B0\u4E0A\u4F20";
6693
+ fail.innerHTML = "上传失败<br>请下载图片至本地后重新上传";
5748
6694
  var again = this.createElement("button", {
5749
6695
  class: "img-again hide",
5750
6696
  contenteditable: "false"
5751
6697
  });
5752
- again.innerHTML = "\u91CD\u65B0\u4E0A\u4F20";
6698
+ again.innerHTML = "重新上传";
5753
6699
  const isGif = src && src.indexOf(".gif") > -1;
5754
6700
  if (isGif) {
5755
6701
  src = src.replace(".gif", ".gif!nowater");
@@ -5804,7 +6750,7 @@
5804
6750
  });
5805
6751
  div.innerHTML = `
5806
6752
  <div class="video-progress">
5807
- <div class="label">\u4E0A\u4F20\u4E2D...</div>
6753
+ <div class="label">上传中...</div>
5808
6754
  <div class="box">
5809
6755
  <div class="inner" style="width:20%"></div>
5810
6756
  </div>
@@ -5827,6 +6773,7 @@
5827
6773
  data: JSON.stringify(data),
5828
6774
  "data-content": data.content || "",
5829
6775
  poster: data.img || ""
6776
+ // 'contenteditable': 'true',
5830
6777
  });
5831
6778
  var delBtn = me2.genIconDom({
5832
6779
  class: "pointer video-delete icon",
@@ -5836,7 +6783,6 @@
5836
6783
  e.stopPropagation();
5837
6784
  }
5838
6785
  });
5839
- console.log(delBtn);
5840
6786
  const posterBtn = me2.insertVideoBtns(this, video);
5841
6787
  var p = this.createElement(
5842
6788
  "DIV",
@@ -5885,6 +6831,7 @@
5885
6831
  }
5886
6832
  };
5887
6833
  },
6834
+ // 撤销重做 会把 所有的监听全都移除,所以需要重新绑定
5888
6835
  setListener(dom) {
5889
6836
  const me2 = this;
5890
6837
  const doms = dom ? [dom] : Array.from(this.editorDom.children);
@@ -5895,7 +6842,7 @@
5895
6842
  p.onclick = function(e) {
5896
6843
  var _a;
5897
6844
  if (area.nodeName === "VIDEO" && ((_a = me2.selectDom) == null ? void 0 : _a.className) === "halo-video-content") {
5898
- me2.setToast("\u4E0D\u652F\u6301\u64AD\u653E");
6845
+ me2.setToast("不支持播放");
5899
6846
  }
5900
6847
  if (e.target.className.includes("desc-input")) {
5901
6848
  return;
@@ -5959,6 +6906,7 @@
5959
6906
  };
5960
6907
  return del;
5961
6908
  },
6909
+ // 转换数据,返回给业务
5962
6910
  getEditorData() {
5963
6911
  const me2 = this;
5964
6912
  const children = Array.from(me2.editorDom.children);
@@ -6016,9 +6964,11 @@
6016
6964
  videoIds
6017
6965
  };
6018
6966
  },
6967
+ // 是否是摩托范的图片
6019
6968
  isHaloImage(url = "") {
6020
6969
  return url.indexOf("jddmoto") > -1 || url.indexOf("58moto") > -1 || url.indexOf("emotofine") > -1 || url.indexOf("dronefine") > -1;
6021
6970
  },
6971
+ // 获取待上传图片列表
6022
6972
  updateUploads() {
6023
6973
  const me2 = this;
6024
6974
  setTimeout(() => {
@@ -6065,8 +7015,8 @@
6065
7015
  const currentImg = me2.uploadStore[key];
6066
7016
  const imageUrl = key.split("|")[1] || "";
6067
7017
  if (!currentImg) {
6068
- console.log("\u56FE\u7247\u4E0D\u5B58\u5728", key);
6069
- return Promise.reject("\u56FE\u7247\u4E0D\u5B58\u5728");
7018
+ console.log("图片不存在", key);
7019
+ return Promise.reject("图片不存在");
6070
7020
  }
6071
7021
  const parent = currentImg.parentNode || "";
6072
7022
  const uploadFailHandler = (currentImg2) => {
@@ -6110,6 +7060,7 @@
6110
7060
  parent && uploadFailHandler(currentImg);
6111
7061
  });
6112
7062
  },
7063
+ // 更新上传的图片
6113
7064
  updateImage(img, currentImg = {}) {
6114
7065
  const data = JSON.parse(currentImg.getAttribute("data") || "{}");
6115
7066
  data.img = img;
@@ -6132,6 +7083,7 @@
6132
7083
  parent.appendChild(arr[2]);
6133
7084
  }
6134
7085
  },
7086
+ // 获取ctrl + v 后内容
6135
7087
  getSticker(type, handler) {
6136
7088
  this.setSticker(type.fragment.children);
6137
7089
  },
@@ -6149,6 +7101,7 @@
6149
7101
  });
6150
7102
  this.updateData(true);
6151
7103
  },
7104
+ // 粘贴
6152
7105
  setSticker(data) {
6153
7106
  const me2 = this;
6154
7107
  data = Array.from(data);
@@ -6187,6 +7140,7 @@
6187
7140
  const me2 = this;
6188
7141
  me2.updateData();
6189
7142
  },
7143
+ // 监测 添加、撤回、恢复、删除
6190
7144
  setBack(e, type) {
6191
7145
  const me2 = this;
6192
7146
  me2.refreshImg();
@@ -6219,6 +7173,7 @@
6219
7173
  }
6220
7174
  });
6221
7175
  },
7176
+ // 设置scoll
6222
7177
  sticky() {
6223
7178
  const me2 = this;
6224
7179
  me2.$nextTick(function() {
@@ -6238,6 +7193,8 @@
6238
7193
  document.addEventListener("scroll", onScroll);
6239
7194
  });
6240
7195
  },
7196
+ // ==========toolbox==========
7197
+ // 撤回、恢复、段落标题
6241
7198
  setContent(e, obj) {
6242
7199
  const me2 = this;
6243
7200
  const id = e.target.id || e.target.dataset.editorId;
@@ -6279,10 +7236,11 @@
6279
7236
  this.fontInfo = this.editor.getFontInfo();
6280
7237
  this.updateData(true);
6281
7238
  },
7239
+ // 增加link
6282
7240
  addLink(type) {
6283
7241
  const me2 = this;
6284
- me2.linkTitleName = type === "link" ? "\u6DFB\u52A0\u94FE\u63A5" : "\u6DFB\u52A0\u5BFC\u5165\u94FE\u63A5\u5730\u5740";
6285
- me2.linkPlaceholder = type === "link" ? "\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740" : "\u4EC5\u652F\u6301\u8F93\u5165\u5FAE\u4FE1\u94FE\u63A5";
7242
+ me2.linkTitleName = type === "link" ? "添加链接" : "添加导入链接地址";
7243
+ me2.linkPlaceholder = type === "link" ? "请输入链接地址" : "仅支持输入微信链接";
6286
7244
  me2.viewStatus = true;
6287
7245
  me2.linkStatus = true;
6288
7246
  },
@@ -6290,29 +7248,31 @@
6290
7248
  const objExp = /^(((ht|f)tp(s?)):\/\/)?(www.|[a-zA-Z].)[a-zA-Z0-9-.]+.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk|cn|im)(:[0-9]+)*(\/($|[a-zA-Z0-9.,;?'&%$#=~_-]+))*$/;
6291
7249
  return objExp.test(url);
6292
7250
  },
7251
+ // 确认增加link
6293
7252
  confirmLink() {
6294
7253
  const me2 = this;
6295
7254
  if (!me2.linkContent) {
6296
- return elementPlus.ElMessage.error("\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740\uFF01");
7255
+ return elementPlus.ElMessage.error("请输入链接地址!");
6297
7256
  }
6298
- if (me2.linkTitleName === "\u6DFB\u52A0\u5BFC\u5165\u94FE\u63A5\u5730\u5740" || this.visibleCollectArticle) {
7257
+ if (me2.linkTitleName === "添加导入链接地址" || this.visibleCollectArticle) {
6299
7258
  this.visibleCollectArticle = false;
6300
7259
  return me2.importLinkData();
6301
7260
  }
6302
7261
  if (!this.validUrl(me2.linkContent)) {
6303
- return me2.setToast("URL\u65E0\u6548");
7262
+ return me2.setToast("URL无效");
6304
7263
  }
6305
7264
  if (!me2.isHaloImage(me2.linkContent)) {
6306
- return me2.setToast("\u8BF7\u8F93\u5165\u6469\u6258\u8303\u5185\u90E8\u7F51\u5740");
7265
+ return me2.setToast("请输入摩托范内部网址");
6307
7266
  }
6308
7267
  me2.editor["insertLink"](me2.linkContent);
6309
7268
  me2.linkContent = "";
6310
7269
  me2.closeDialog();
6311
7270
  },
7271
+ // 增加link导入数据
6312
7272
  importLinkData() {
6313
7273
  const me2 = this;
6314
7274
  if (me2.loading) {
6315
- return elementPlus.ElMessage("\u6B63\u5728\u83B7\u53D6\u4FE1\u606F\uFF0C\u8BF7\u7A0D\u540E...");
7275
+ return elementPlus.ElMessage("正在获取信息,请稍后...");
6316
7276
  }
6317
7277
  me2.loading = true;
6318
7278
  const params = {
@@ -6334,38 +7294,444 @@
6334
7294
  me2.linkContent = "";
6335
7295
  return;
6336
7296
  } else {
6337
- me2.setToast("\u5BFC\u5165\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
7297
+ me2.setToast("导入失败,请重试");
6338
7298
  }
6339
7299
  }).catch((err) => {
6340
7300
  console.log(err.message);
6341
- me2.setToast("\u5BFC\u5165\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5");
7301
+ me2.setToast("导入异常,请重试");
6342
7302
  }).finally((_) => {
6343
7303
  me2.loading = false;
6344
7304
  });
6345
7305
  },
7306
+ // 打开 图片、视频、一键导入 弹框
6346
7307
  openDialog(name) {
6347
7308
  const me2 = this;
6348
- me2.viewName = name === "img" ? "\u6DFB\u52A0\u56FE\u7247" : "\u6DFB\u52A0\u89C6\u9891";
6349
- me2.viewButton = name === "img" ? "\u9009\u62E9\u56FE\u7247" : "\u9009\u62E9\u89C6\u9891";
6350
- me2.viewTip = name === "img" ? "" : "\u4E3A\u4E86\u83B7\u5F97\u66F4\u9AD8\u7684\u63A8\u8350\u548C\u70B9\u51FB\u91CF\uFF0C\u5EFA\u8BAE\u4E0A\u4F20720p(1280*720)\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC7500MB(\u89C6\u9891\u4E0A\u4F20\u9700\u8981\u65F6\u95F4\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85)";
7309
+ me2.viewName = name === "img" ? "添加图片" : "添加视频";
7310
+ me2.viewButton = name === "img" ? "选择图片" : "选择视频";
7311
+ me2.viewTip = name === "img" ? "" : "为了获得更高的推荐和点击量,建议上传720p(1280*720),大小不超过500MB(视频上传需要时间,请耐心等待)";
6351
7312
  me2.viewStatus = true;
6352
7313
  },
7314
+ // 关闭弹框
6353
7315
  closeDialog() {
6354
7316
  this.viewStatus = false;
6355
7317
  this.linkStatus = false;
6356
7318
  this.linkContent = "";
6357
7319
  },
7320
+ // ==========toolbox end==========
7321
+ // 弹框提示
6358
7322
  setToast(content) {
6359
7323
  elementPlus.ElMessage.error(content);
6360
7324
  },
6361
7325
  setMessageBoxNoCancel(content) {
6362
7326
  elementPlus.ElMessageBox.confirm(content, "", {
6363
- confirmButtonText: "\u786E\u5B9A",
6364
- cancelButtonText: "\u53D6\u6D88",
7327
+ confirmButtonText: "确定",
7328
+ cancelButtonText: "取消",
6365
7329
  type: "warning"
6366
7330
  }).then(() => {
6367
7331
  }).catch(() => {
6368
7332
  });
7333
+ },
7334
+ // 检查是否会创建嵌套的halo-paragraph
7335
+ wouldCreateNestedParagraph(range) {
7336
+ let container = range.startContainer;
7337
+ while (container && container !== this.editorDom) {
7338
+ if (container.nodeType === Node.ELEMENT_NODE && container.classList && container.classList.contains("halo-paragraph")) {
7339
+ return true;
7340
+ }
7341
+ container = container.parentNode;
7342
+ }
7343
+ return false;
7344
+ },
7345
+ // 检查光标是否在两个连续的mdd-topic之间
7346
+ isBetweenTwoTopics(range) {
7347
+ const container = range.startContainer;
7348
+ const offset = range.startOffset;
7349
+ if (container.nodeType === Node.ELEMENT_NODE) {
7350
+ const prevElement = container.childNodes[offset - 1];
7351
+ const nextElement = container.childNodes[offset];
7352
+ return prevElement && prevElement.tagName === "MDD-TOPIC" && (nextElement && nextElement.tagName === "MDD-TOPIC");
7353
+ }
7354
+ if (container.nodeType === Node.TEXT_NODE && container.textContent.trim() === "") {
7355
+ const prevSibling = container.previousSibling;
7356
+ const nextSibling = container.nextSibling;
7357
+ return prevSibling && prevSibling.tagName === "MDD-TOPIC" && (nextSibling && nextSibling.tagName === "MDD-TOPIC");
7358
+ }
7359
+ return false;
7360
+ },
7361
+ // 处理两个话题之间的回车或话题前面的回车
7362
+ handleEnterBetweenTopics(range) {
7363
+ var _a;
7364
+ const me2 = this;
7365
+ let currentParagraph = range.startContainer;
7366
+ while (currentParagraph && currentParagraph.nodeType !== Node.ELEMENT_NODE) {
7367
+ currentParagraph = currentParagraph.parentNode;
7368
+ }
7369
+ while (currentParagraph && !((_a = currentParagraph.classList) == null ? void 0 : _a.contains("halo-paragraph"))) {
7370
+ currentParagraph = currentParagraph.parentNode;
7371
+ }
7372
+ if (!currentParagraph)
7373
+ return;
7374
+ const newParagraph = document.createElement("p");
7375
+ newParagraph.className = "halo-paragraph";
7376
+ const afterContent = me2.extractContentAfterCursorPrecise(range, currentParagraph);
7377
+ if (afterContent && afterContent.childNodes.length > 0) {
7378
+ while (afterContent.firstChild) {
7379
+ newParagraph.appendChild(afterContent.firstChild);
7380
+ }
7381
+ } else {
7382
+ newParagraph.innerHTML = "<br>";
7383
+ }
7384
+ currentParagraph.parentNode.insertBefore(newParagraph, currentParagraph.nextSibling);
7385
+ const newRange = document.createRange();
7386
+ if (newParagraph.firstChild && newParagraph.firstChild.nodeType === Node.TEXT_NODE) {
7387
+ newRange.setStart(newParagraph.firstChild, 0);
7388
+ } else if (newParagraph.firstChild && newParagraph.firstChild.nodeType === Node.ELEMENT_NODE) {
7389
+ newRange.setStart(newParagraph, 0);
7390
+ } else {
7391
+ newRange.setStart(newParagraph, 0);
7392
+ }
7393
+ newRange.collapse(true);
7394
+ const selection = window.getSelection();
7395
+ selection.removeAllRanges();
7396
+ selection.addRange(newRange);
7397
+ me2.updateData(true);
7398
+ },
7399
+ // 更精确地提取光标后的内容(专门用于话题分割)
7400
+ extractContentAfterCursorPrecise(range, paragraph) {
7401
+ const fragment = document.createDocumentFragment();
7402
+ const container = range.startContainer;
7403
+ const offset = range.startOffset;
7404
+ if (container.nodeType === Node.ELEMENT_NODE) {
7405
+ const childNodes = Array.from(container.childNodes);
7406
+ for (let i = offset; i < childNodes.length; i++) {
7407
+ fragment.appendChild(childNodes[i]);
7408
+ }
7409
+ } else if (container.nodeType === Node.TEXT_NODE) {
7410
+ if (offset < container.textContent.length) {
7411
+ const afterText = container.textContent.slice(offset);
7412
+ container.textContent = container.textContent.slice(0, offset);
7413
+ const textNode = document.createTextNode(afterText);
7414
+ fragment.appendChild(textNode);
7415
+ }
7416
+ let nextSibling = container.nextSibling;
7417
+ while (nextSibling) {
7418
+ const nodeToMove = nextSibling;
7419
+ nextSibling = nextSibling.nextSibling;
7420
+ fragment.appendChild(nodeToMove);
7421
+ }
7422
+ }
7423
+ return fragment;
7424
+ },
7425
+ // 处理包含话题的段落中的回车键
7426
+ handleEnterKeyInParagraphWithTopic(range) {
7427
+ var _a;
7428
+ const me2 = this;
7429
+ let currentParagraph = range.startContainer;
7430
+ while (currentParagraph && currentParagraph.nodeType !== Node.ELEMENT_NODE) {
7431
+ currentParagraph = currentParagraph.parentNode;
7432
+ }
7433
+ while (currentParagraph && !((_a = currentParagraph.classList) == null ? void 0 : _a.contains("halo-paragraph"))) {
7434
+ currentParagraph = currentParagraph.parentNode;
7435
+ }
7436
+ if (!currentParagraph)
7437
+ return;
7438
+ const newParagraph = document.createElement("p");
7439
+ newParagraph.className = "halo-paragraph";
7440
+ const isAtTopicStart = me2.isCursorBeforeFirstTopic(range, currentParagraph);
7441
+ const isAtEnd = me2.isCursorAtEndOfParagraph(range, currentParagraph);
7442
+ if (isAtTopicStart) {
7443
+ const afterContent = me2.extractContentAfterCursor(range, currentParagraph);
7444
+ if (afterContent && afterContent.childNodes.length > 0) {
7445
+ while (afterContent.firstChild) {
7446
+ newParagraph.appendChild(afterContent.firstChild);
7447
+ }
7448
+ } else {
7449
+ newParagraph.innerHTML = "<br>";
7450
+ }
7451
+ if (currentParagraph.innerHTML.trim() === "" || currentParagraph.childNodes.length === 0) {
7452
+ currentParagraph.innerHTML = "<br>";
7453
+ }
7454
+ currentParagraph.parentNode.insertBefore(newParagraph, currentParagraph.nextSibling);
7455
+ } else if (isAtEnd) {
7456
+ newParagraph.innerHTML = "<br>";
7457
+ currentParagraph.parentNode.insertBefore(newParagraph, currentParagraph.nextSibling);
7458
+ } else {
7459
+ const afterContent = me2.extractContentAfterCursor(range, currentParagraph);
7460
+ if (afterContent && afterContent.childNodes.length > 0) {
7461
+ let hasValidContent = false;
7462
+ for (let i = 0; i < afterContent.childNodes.length; i++) {
7463
+ const node = afterContent.childNodes[i];
7464
+ if (node.nodeType === Node.TEXT_NODE) {
7465
+ if (node.textContent.trim() !== "") {
7466
+ hasValidContent = true;
7467
+ break;
7468
+ }
7469
+ } else {
7470
+ hasValidContent = true;
7471
+ break;
7472
+ }
7473
+ }
7474
+ if (hasValidContent) {
7475
+ while (afterContent.firstChild) {
7476
+ newParagraph.appendChild(afterContent.firstChild);
7477
+ }
7478
+ } else {
7479
+ newParagraph.innerHTML = "<br>";
7480
+ }
7481
+ } else {
7482
+ newParagraph.innerHTML = "<br>";
7483
+ }
7484
+ currentParagraph.parentNode.insertBefore(newParagraph, currentParagraph.nextSibling);
7485
+ }
7486
+ const newRange = document.createRange();
7487
+ if (newParagraph.firstChild && newParagraph.firstChild.nodeType === Node.TEXT_NODE) {
7488
+ newRange.setStart(newParagraph.firstChild, 0);
7489
+ } else if (newParagraph.firstChild) {
7490
+ newRange.setStart(newParagraph, 0);
7491
+ } else {
7492
+ newRange.setStart(newParagraph, 0);
7493
+ }
7494
+ newRange.collapse(true);
7495
+ const selection = window.getSelection();
7496
+ selection.removeAllRanges();
7497
+ selection.addRange(newRange);
7498
+ me2.updateData(true);
7499
+ },
7500
+ // 检查光标是否在第一个话题前面
7501
+ isCursorBeforeFirstTopic(range, paragraph) {
7502
+ const container = range.startContainer;
7503
+ const offset = range.startOffset;
7504
+ const firstTopic = paragraph.querySelector("mdd-topic");
7505
+ if (!firstTopic) {
7506
+ return false;
7507
+ }
7508
+ if (container === paragraph && offset === 0) {
7509
+ return true;
7510
+ }
7511
+ if (container === paragraph && offset > 0 && offset <= paragraph.childNodes.length) {
7512
+ if (offset < paragraph.childNodes.length) {
7513
+ const nodeAtOffset = paragraph.childNodes[offset];
7514
+ if (nodeAtOffset === firstTopic) {
7515
+ return true;
7516
+ }
7517
+ }
7518
+ let nextNonEmptyNode = null;
7519
+ for (let i = offset; i < paragraph.childNodes.length; i++) {
7520
+ const node = paragraph.childNodes[i];
7521
+ if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "MDD-TOPIC") {
7522
+ nextNonEmptyNode = node;
7523
+ break;
7524
+ } else if (node.nodeType === Node.TEXT_NODE && node.textContent.trim() !== "") {
7525
+ break;
7526
+ }
7527
+ }
7528
+ if (nextNonEmptyNode === firstTopic) {
7529
+ return true;
7530
+ }
7531
+ }
7532
+ try {
7533
+ const topicRange = document.createRange();
7534
+ topicRange.setStartBefore(firstTopic);
7535
+ const comparison = topicRange.comparePoint(container, offset);
7536
+ if (comparison < 0) {
7537
+ return true;
7538
+ }
7539
+ } catch (e) {
7540
+ if (container.nodeType === Node.TEXT_NODE) {
7541
+ const tempRange = document.createRange();
7542
+ tempRange.setStart(container, offset);
7543
+ tempRange.collapse(true);
7544
+ const topicRange = document.createRange();
7545
+ topicRange.setStartBefore(firstTopic);
7546
+ if (tempRange.compareBoundaryPoints(Range.START_TO_START, topicRange) < 0) {
7547
+ return true;
7548
+ }
7549
+ }
7550
+ if (container === paragraph) {
7551
+ const testRange = document.createRange();
7552
+ testRange.setStart(paragraph, 0);
7553
+ testRange.setEnd(paragraph, offset);
7554
+ const containsTopic = testRange.intersectsNode(firstTopic);
7555
+ if (!containsTopic) {
7556
+ return true;
7557
+ }
7558
+ }
7559
+ }
7560
+ return false;
7561
+ },
7562
+ // 获取不包含mdd-topic内部文本的段落文本
7563
+ getParagraphTextExcludingTopics(paragraph, range) {
7564
+ let textContent = "";
7565
+ let cursorPosition = 0;
7566
+ let foundCursor = false;
7567
+ const walker = document.createTreeWalker(
7568
+ paragraph,
7569
+ NodeFilter.SHOW_ALL,
7570
+ {
7571
+ acceptNode: function(node2) {
7572
+ if (node2.nodeType === Node.ELEMENT_NODE && node2.tagName === "MDD-TOPIC") {
7573
+ return NodeFilter.FILTER_REJECT;
7574
+ }
7575
+ return NodeFilter.FILTER_ACCEPT;
7576
+ }
7577
+ },
7578
+ false
7579
+ );
7580
+ let node;
7581
+ while (node = walker.nextNode()) {
7582
+ if (node.nodeType === Node.TEXT_NODE) {
7583
+ const nodeText = node.textContent;
7584
+ if (!foundCursor && node === range.startContainer) {
7585
+ cursorPosition = textContent.length + range.startOffset;
7586
+ foundCursor = true;
7587
+ }
7588
+ textContent += nodeText;
7589
+ }
7590
+ }
7591
+ return { textContent, cursorPosition };
7592
+ },
7593
+ // 检查光标是否在段落开头
7594
+ isCursorAtStartOfParagraph(range, paragraph) {
7595
+ const { cursorPosition } = this.getParagraphTextExcludingTopics(paragraph, range);
7596
+ return cursorPosition === 0;
7597
+ },
7598
+ // 检查光标是否在段落末尾
7599
+ isCursorAtEndOfParagraph(range, paragraph) {
7600
+ const walker = document.createTreeWalker(
7601
+ paragraph,
7602
+ NodeFilter.SHOW_TEXT,
7603
+ {
7604
+ acceptNode: function(node2) {
7605
+ let parent = node2.parentNode;
7606
+ while (parent && parent !== paragraph) {
7607
+ if (parent.tagName === "MDD-TOPIC") {
7608
+ return NodeFilter.FILTER_REJECT;
7609
+ }
7610
+ parent = parent.parentNode;
7611
+ }
7612
+ return NodeFilter.FILTER_ACCEPT;
7613
+ }
7614
+ },
7615
+ false
7616
+ );
7617
+ let totalLength = 0;
7618
+ let node;
7619
+ while (node = walker.nextNode()) {
7620
+ totalLength += node.textContent.length;
7621
+ }
7622
+ const { cursorPosition } = this.getParagraphTextExcludingTopics(paragraph, range);
7623
+ return cursorPosition >= totalLength;
7624
+ },
7625
+ // 获取当前段落
7626
+ getCurrentParagraph(range) {
7627
+ let container = range.startContainer;
7628
+ while (container && container !== this.editorDom) {
7629
+ if (container.nodeType === Node.ELEMENT_NODE && container.classList && container.classList.contains("halo-paragraph")) {
7630
+ return container;
7631
+ }
7632
+ container = container.parentNode;
7633
+ }
7634
+ return null;
7635
+ },
7636
+ // 提取光标后的内容
7637
+ extractContentAfterCursor(range, paragraph) {
7638
+ const fragment = document.createDocumentFragment();
7639
+ const container = range.startContainer;
7640
+ const offset = range.startOffset;
7641
+ let topicSpaceNode = null;
7642
+ if (container.nodeType === Node.TEXT_NODE && container.textContent === " " && container.previousSibling && container.previousSibling.tagName === "MDD-TOPIC") {
7643
+ topicSpaceNode = container;
7644
+ }
7645
+ const extractRange = document.createRange();
7646
+ let startNode = null;
7647
+ let hasContentToExtract = false;
7648
+ if (topicSpaceNode) {
7649
+ if (topicSpaceNode.nextSibling) {
7650
+ startNode = topicSpaceNode.nextSibling;
7651
+ hasContentToExtract = true;
7652
+ }
7653
+ } else if (container.nodeType === Node.TEXT_NODE) {
7654
+ if (container.textContent === "" && offset === 0) {
7655
+ if (container.nextSibling) {
7656
+ startNode = container.nextSibling;
7657
+ hasContentToExtract = true;
7658
+ }
7659
+ } else if (offset < container.textContent.length) {
7660
+ const afterText = container.textContent.slice(offset);
7661
+ container.textContent = container.textContent.slice(0, offset);
7662
+ if (afterText.trim()) {
7663
+ const newTextNode = document.createTextNode(afterText);
7664
+ container.parentNode.insertBefore(newTextNode, container.nextSibling);
7665
+ startNode = newTextNode;
7666
+ hasContentToExtract = true;
7667
+ } else if (container.nextSibling) {
7668
+ startNode = container.nextSibling;
7669
+ hasContentToExtract = true;
7670
+ }
7671
+ } else {
7672
+ if (container.nextSibling) {
7673
+ startNode = container.nextSibling;
7674
+ hasContentToExtract = true;
7675
+ }
7676
+ }
7677
+ } else if (container.nodeType === Node.ELEMENT_NODE) {
7678
+ if (offset < container.childNodes.length) {
7679
+ startNode = container.childNodes[offset];
7680
+ hasContentToExtract = true;
7681
+ } else if (offset === 0 && container === paragraph) {
7682
+ if (paragraph.firstChild) {
7683
+ startNode = paragraph.firstChild;
7684
+ hasContentToExtract = true;
7685
+ }
7686
+ }
7687
+ }
7688
+ if (!hasContentToExtract || !startNode) {
7689
+ return fragment;
7690
+ }
7691
+ if (!paragraph.contains(startNode)) {
7692
+ return fragment;
7693
+ }
7694
+ try {
7695
+ extractRange.setStartBefore(startNode);
7696
+ let lastNode = paragraph.lastChild;
7697
+ while (lastNode && lastNode.nodeType === Node.TEXT_NODE && lastNode.textContent === "" && // 只跳过完全空的文本节点
7698
+ lastNode !== startNode) {
7699
+ lastNode = lastNode.previousSibling;
7700
+ }
7701
+ if (lastNode) {
7702
+ extractRange.setEndAfter(lastNode);
7703
+ } else {
7704
+ extractRange.setEnd(paragraph, paragraph.childNodes.length);
7705
+ }
7706
+ const extractedContent = extractRange.extractContents();
7707
+ fragment.appendChild(extractedContent);
7708
+ } catch (e) {
7709
+ let currentNode = startNode;
7710
+ while (currentNode && currentNode.parentNode === paragraph) {
7711
+ const nextNode = currentNode.nextSibling;
7712
+ fragment.appendChild(currentNode);
7713
+ currentNode = nextNode;
7714
+ }
7715
+ }
7716
+ return fragment;
7717
+ },
7718
+ // 统一的光标设置方法 - 设置光标到元素后面
7719
+ setCursorAfterElement(element) {
7720
+ const newRange = document.createRange();
7721
+ newRange.setStartAfter(element);
7722
+ newRange.collapse(true);
7723
+ const selection = window.getSelection();
7724
+ selection.removeAllRanges();
7725
+ selection.addRange(newRange);
7726
+ },
7727
+ // 统一的光标设置方法 - 设置光标到元素前面
7728
+ setCursorBeforeElement(element) {
7729
+ const newRange = document.createRange();
7730
+ newRange.setStartBefore(element);
7731
+ newRange.collapse(true);
7732
+ const selection = window.getSelection();
7733
+ selection.removeAllRanges();
7734
+ selection.addRange(newRange);
6369
7735
  }
6370
7736
  },
6371
7737
  beforeRouteLeave(to, from, next) {
@@ -6388,11 +7754,12 @@
6388
7754
  const _component_ImgUpload = vue.resolveComponent("ImgUpload");
6389
7755
  const _component_VideoUpload = vue.resolveComponent("VideoUpload");
6390
7756
  const _component_CollectArticle = vue.resolveComponent("CollectArticle");
7757
+ const _component_TopicManager = vue.resolveComponent("TopicManager");
6391
7758
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
6392
7759
  vue.withDirectives(vue.createElementVNode("div", {
6393
7760
  style: vue.normalizeStyle({ textAlign: $options.align }),
6394
7761
  class: "placeholder"
6395
- }, " \u8BF7\u8F93\u5165\u6B63\u6587 ", 4), [
7762
+ }, vue.toDisplayString($props.placeholder || "请输入正文"), 5), [
6396
7763
  [vue.vShow, !$options.isInputing && !$data.titleCount && !$data.hasArticleCard]
6397
7764
  ]),
6398
7765
  $data.overLine ? (vue.openBlock(), vue.createElementBlock("div", {
@@ -6417,26 +7784,26 @@
6417
7784
  vue.createVNode(_component_el_form, { model: $data.linkForm }, {
6418
7785
  default: vue.withCtx(() => [
6419
7786
  vue.createVNode(_component_el_form_item, {
6420
- label: "\u6DFB\u52A0\u94FE\u63A5",
7787
+ label: "添加链接",
6421
7788
  class: "link-title"
6422
7789
  }, {
6423
7790
  default: vue.withCtx(() => [
6424
7791
  vue.createVNode(_component_el_input, {
6425
7792
  modelValue: $data.linkForm.linkAddress,
6426
7793
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.linkForm.linkAddress = $event),
6427
- placeholder: "\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"
7794
+ placeholder: "请输入链接地址"
6428
7795
  }, null, 8, ["modelValue"])
6429
7796
  ]),
6430
7797
  _: 1
6431
7798
  }),
6432
- vue.createVNode(_component_el_form_item, { label: "\u94FE\u63A5\u6587\u6848" }, {
7799
+ vue.createVNode(_component_el_form_item, { label: "链接文案" }, {
6433
7800
  default: vue.withCtx(() => [
6434
7801
  vue.createVNode(_component_el_input, {
6435
7802
  modelValue: $data.linkForm.linkWriting,
6436
7803
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.linkForm.linkWriting = $event),
6437
7804
  type: "textarea",
6438
7805
  autosize: "",
6439
- placeholder: "\u8BF7\u8F93\u5165\u94FE\u63A5\u6587\u6848"
7806
+ placeholder: "请输入链接文案"
6440
7807
  }, null, 8, ["modelValue"])
6441
7808
  ]),
6442
7809
  _: 1
@@ -6449,18 +7816,18 @@
6449
7816
  vue.createVNode(_component_el_button, {
6450
7817
  onClick: _cache[3] || (_cache[3] = ($event) => $data.viewLinkDialog = false)
6451
7818
  }, {
6452
- default: vue.withCtx(() => [
6453
- vue.createTextVNode("\u53D6 \u6D88")
6454
- ]),
7819
+ default: vue.withCtx(() => _cache[14] || (_cache[14] = [
7820
+ vue.createTextVNode(" ")
7821
+ ])),
6455
7822
  _: 1
6456
7823
  }),
6457
7824
  vue.createVNode(_component_el_button, {
6458
7825
  type: "primary",
6459
7826
  onClick: $options.insertLink
6460
7827
  }, {
6461
- default: vue.withCtx(() => [
6462
- vue.createTextVNode("\u786E \u5B9A")
6463
- ]),
7828
+ default: vue.withCtx(() => _cache[15] || (_cache[15] = [
7829
+ vue.createTextVNode(" ")
7830
+ ])),
6464
7831
  _: 1
6465
7832
  }, 8, ["onClick"])
6466
7833
  ])
@@ -6518,7 +7885,14 @@
6518
7885
  class: "replace-poster hide",
6519
7886
  accept: "image/*",
6520
7887
  onChange: _cache[13] || (_cache[13] = (...args) => $options.replacePoster && $options.replacePoster(...args))
6521
- }, null, 32)
7888
+ }, null, 32),
7889
+ vue.createVNode(_component_TopicManager, {
7890
+ ref: "topicManager",
7891
+ "editor-dom": $data.editorDom,
7892
+ request: $props.request,
7893
+ onTopicInserted: $options.onTopicInserted,
7894
+ onUpdateTopicPosition: $options.updateTopicPosition
7895
+ }, null, 8, ["editor-dom", "request", "onTopicInserted", "onUpdateTopicPosition"])
6522
7896
  ]);
6523
7897
  }
6524
7898
  const Editor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
@@ -6538,7 +7912,7 @@
6538
7912
  var COLOUR_CLASS = "colour";
6539
7913
  var FONT_FAMILY_CLASS = "font";
6540
7914
  var FONT_SIZE_CLASS = "size";
6541
- var ZWS = "\u200B";
7915
+ var ZWS = "";
6542
7916
  var win = doc.defaultView;
6543
7917
  var ua = navigator.userAgent;
6544
7918
  var isAndroid = /Android/.test(ua);
@@ -6568,11 +7942,17 @@
6568
7942
  };
6569
7943
  }
6570
7944
  var typeToBitArray = {
7945
+ // ELEMENT_NODE
6571
7946
  1: 1,
7947
+ // ATTRIBUTE_NODE
6572
7948
  2: 2,
7949
+ // TEXT_NODE
6573
7950
  3: 4,
7951
+ // COMMENT_NODE
6574
7952
  8: 128,
7953
+ // DOCUMENT_NODE
6575
7954
  9: 256,
7955
+ // DOCUMENT_FRAGMENT_NODE
6576
7956
  11: 1024
6577
7957
  };
6578
7958
  function TreeWalker(root, nodeType, filter) {
@@ -6906,7 +8286,7 @@
6906
8286
  node.appendChild(fixer);
6907
8287
  } catch (error) {
6908
8288
  self2.didError({
6909
- name: "Squire: fixCursor \u2013\xA0" + error,
8289
+ name: "Squire: fixCursor – " + error,
6910
8290
  message: "Parent: " + node.nodeName + "/" + node.innerHTML + " appendChild: " + fixer.nodeName
6911
8291
  });
6912
8292
  }
@@ -6923,17 +8303,6 @@
6923
8303
  child = children[i];
6924
8304
  isBR = child.nodeName === "BR";
6925
8305
  if (!isBR && isInline(child)) {
6926
- if (child.classList && child.classList.contains("halo-picture-area")) {
6927
- return;
6928
- }
6929
- if (!wrapper) {
6930
- wrapper = createElement(
6931
- doc2,
6932
- config.blockTag,
6933
- config.blockAttributes
6934
- );
6935
- }
6936
- wrapper.appendChild(child);
6937
8306
  i -= 1;
6938
8307
  l -= 1;
6939
8308
  } else if (isBR || wrapper) {
@@ -7252,7 +8621,8 @@
7252
8621
  block = getStartBlockOfRange(range, root);
7253
8622
  firstBlockInFrag = getNextBlock(frag, frag);
7254
8623
  replaceBlock = !!block && isEmptyBlock(block);
7255
- if (block && firstBlockInFrag && !replaceBlock && !getNearest(firstBlockInFrag, frag, "PRE") && !getNearest(firstBlockInFrag, frag, "TABLE")) {
8624
+ if (block && firstBlockInFrag && !replaceBlock && // Don't merge table cells or PRE elements into block
8625
+ !getNearest(firstBlockInFrag, frag, "PRE") && !getNearest(firstBlockInFrag, frag, "TABLE")) {
7256
8626
  moveRangeBoundariesUpTree(range, block, block, root);
7257
8627
  range.collapse(true);
7258
8628
  container = range.endContainer;
@@ -7268,7 +8638,10 @@
7268
8638
  container = nodeAfterSplit.parentNode;
7269
8639
  offset = indexOf.call(container.childNodes, nodeAfterSplit);
7270
8640
  }
7271
- if (offset !== getLength(container)) {
8641
+ if (
8642
+ /* isBlock( container ) && */
8643
+ offset !== getLength(container)
8644
+ ) {
7272
8645
  blockContentsAfterSplit = root.ownerDocument.createDocumentFragment();
7273
8646
  while (node = container.childNodes[offset]) {
7274
8647
  blockContentsAfterSplit.appendChild(node);
@@ -8317,9 +9690,11 @@
8317
9690
  if (hasImage) {
8318
9691
  this.fireEvent("dragover", {
8319
9692
  dataTransfer: clipboardData,
9693
+ /* jshint loopfunc: true */
8320
9694
  preventDefault: function() {
8321
9695
  fireDrop = true;
8322
9696
  }
9697
+ /* jshint loopfunc: false */
8323
9698
  });
8324
9699
  if (fireDrop) {
8325
9700
  this.fireEvent("drop", {
@@ -8526,7 +9901,9 @@
8526
9901
  leafNodeNames,
8527
9902
  undo: {
8528
9903
  documentSizeThreshold: -1,
9904
+ // -1 means no threshold
8529
9905
  undoLimit: -1
9906
+ // -1 means no limit
8530
9907
  },
8531
9908
  isInsertedHTMLSanitized: true,
8532
9909
  isSetHTMLSanitized: true,
@@ -10168,5 +11545,5 @@
10168
11545
  exports2.Editor = Editor;
10169
11546
  exports2.ToolBar = ToolBar;
10170
11547
  exports2.ToolsEnum = ToolsEnum;
10171
- Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
11548
+ Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
10172
11549
  });