@haluo/biz 2.0.37 → 2.0.39

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