@haluo/biz 2.0.40 → 2.0.41-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,13 +519,13 @@ 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$4 = ["src"];
526
+ const _hoisted_2$5 = { class: "tools-content" };
527
+ const _hoisted_3$5 = ["src"];
528
+ const _hoisted_4$3 = ["src"];
529
529
  const _hoisted_5$3 = ["src"];
530
530
  const _hoisted_6$2 = { class: "box" };
531
531
  const _hoisted_7$2 = ["src"];
@@ -566,9 +566,9 @@ 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"];
569
+ const _hoisted_30 = { class: "box" };
570
+ const _hoisted_31 = ["src"];
571
+ const _hoisted_32 = ["src"];
572
572
  const _hoisted_33 = ["src"];
573
573
  const _hoisted_34 = ["src"];
574
574
  const _hoisted_35 = { class: "tools-title" };
@@ -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$4)
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(() => [
@@ -655,7 +655,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
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(() => [
@@ -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(() => [
@@ -736,7 +736,7 @@ 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(() => [
@@ -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(() => [
@@ -957,7 +957,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
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,17 +1105,15 @@ 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-52e48332"]]);
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$3 = {
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 _sfc_main$6 = defineComponent({
1116
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1119
1117
  __name: "index",
1120
1118
  props: {
1121
1119
  visible: { type: Boolean, default: false },
@@ -1156,24 +1154,24 @@ const _sfc_main$6 = defineComponent({
1156
1154
  class: normalizeClass(["basic-dialog", { "hide-title": !_ctx.showTitle }])
1157
1155
  }, {
1158
1156
  header: withCtx(() => [
1159
- _ctx.showTitle ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
1160
- createElementVNode("div", _hoisted_2$6, [
1161
- _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)),
1162
1160
  renderSlot(_ctx.$slots, "title")
1163
1161
  ])
1164
1162
  ])) : createCommentVNode("", true)
1165
1163
  ]),
1166
1164
  footer: withCtx(() => [
1167
- _ctx.showBtn ? (openBlock(), createElementBlock("span", _hoisted_4$3, [
1165
+ _ctx.showBtn ? (openBlock(), createElementBlock("span", _hoisted_3$4, [
1168
1166
  createVNode(unref(ElButton), {
1169
1167
  style: { "width": "120px", "border-color": "#cccccc", "color": "#333333" },
1170
1168
  plain: "",
1171
1169
  round: "",
1172
1170
  onClick: handleClose
1173
1171
  }, {
1174
- default: withCtx(() => [
1175
- createTextVNode("\u53D6\u6D88")
1176
- ]),
1172
+ default: withCtx(() => _cache[2] || (_cache[2] = [
1173
+ createTextVNode("取消")
1174
+ ])),
1177
1175
  _: 1
1178
1176
  }),
1179
1177
  createVNode(unref(ElButton), {
@@ -1182,9 +1180,9 @@ const _sfc_main$6 = defineComponent({
1182
1180
  type: "primary",
1183
1181
  onClick: confirm
1184
1182
  }, {
1185
- default: withCtx(() => [
1186
- createTextVNode("\u786E\u8BA4")
1187
- ]),
1183
+ default: withCtx(() => _cache[3] || (_cache[3] = [
1184
+ createTextVNode("确认")
1185
+ ])),
1188
1186
  _: 1
1189
1187
  })
1190
1188
  ])) : createCommentVNode("", true)
@@ -1197,12 +1195,14 @@ const _sfc_main$6 = defineComponent({
1197
1195
  };
1198
1196
  }
1199
1197
  });
1198
+ const index_vue_vue_type_style_index_0_lang$5 = "";
1200
1199
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
1201
1200
  function getDefaultExportFromCjs(x) {
1202
1201
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
1203
1202
  }
1204
- var date$1 = { exports: {} };
1205
- 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 });
1206
1206
  function replacementDate(data, fmt) {
1207
1207
  for (var k in data) {
1208
1208
  if (new RegExp("(" + k + ")").test(fmt)) {
@@ -1217,126 +1217,130 @@ function replacementYear(date2, fmt) {
1217
1217
  }
1218
1218
  return fmt;
1219
1219
  }
1220
- var DateClass = function() {
1221
- function DateClass2() {
1222
- }
1223
- DateClass2.prototype.format = function(date2, fmt) {
1224
- if (fmt === void 0) {
1225
- fmt = "YYYY-MM-DD HH:mm:ss";
1220
+ var DateClass = (
1221
+ /** @class */
1222
+ function() {
1223
+ function DateClass2() {
1226
1224
  }
1227
- if (!date2)
1228
- return "";
1229
- var timeData = typeof date2 === "string" ? new Date(date2.replace(/-/g, "/")) : date2;
1230
- timeData = typeof date2 === "number" ? new Date(date2) : timeData;
1231
- var o = {
1232
- "M+": timeData.getMonth() + 1,
1233
- "D+": timeData.getDate(),
1234
- "h+": timeData.getHours() % 12 === 0 ? 12 : timeData.getHours() % 12,
1235
- "H+": timeData.getHours(),
1236
- "m+": timeData.getMinutes(),
1237
- "s+": timeData.getSeconds(),
1238
- "q+": Math.floor((timeData.getMonth() + 3) / 3),
1239
- "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);
1240
1257
  };
1241
- var week = {
1242
- "0": "\u65E5",
1243
- "1": "\u4E00",
1244
- "2": "\u4E8C",
1245
- "3": "\u4E09",
1246
- "4": "\u56DB",
1247
- "5": "\u4E94",
1248
- "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];
1249
1262
  };
1250
- fmt = replacementYear(timeData, fmt);
1251
- if (/(E+)/.test(fmt)) {
1252
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length > 1 ? RegExp.$1.length > 2 ? "\u661F\u671F" : "\u5468" : "") + week["".concat(timeData.getDay(), " ")]);
1253
- }
1254
- return replacementDate(o, fmt);
1255
- };
1256
- DateClass2.prototype.addDaysToDate = function(date2, days) {
1257
- var d = typeof date2 === "object" ? date2 : new Date(date2);
1258
- d.setDate(d.getDate() + days);
1259
- return d.toISOString().split("T")[0];
1260
- };
1261
- DateClass2.prototype.remainTime = function(endTime, startTime) {
1262
- if (startTime === void 0) {
1263
- startTime = new Date();
1264
- }
1265
- var ts = Number(endTime) - Number(startTime);
1266
- var dd = Math.floor(ts / 1e3 / 60 / 60 / 24);
1267
- var hh = Math.floor(ts / 1e3 / 60 / 60 % 24);
1268
- var mm = Math.floor(ts / 1e3 / 60 % 60);
1269
- var ss = Math.floor(ts / 1e3 % 60);
1270
- if (ts <= 0)
1271
- return false;
1272
- return {
1273
- dd: dd < 10 ? "0".concat(dd) : dd,
1274
- hh: hh < 10 ? "0".concat(hh) : hh,
1275
- mm: mm < 10 ? "0".concat(mm) : mm,
1276
- ss: ss < 10 ? "0".concat(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
+ };
1277
1280
  };
1278
- };
1279
- DateClass2.prototype.formatPassTime = function(startTime) {
1280
- var currentTime = new Date();
1281
- var time = currentTime - startTime;
1282
- var year = Math.floor(time / (1e3 * 60 * 60 * 24) / 30 / 12);
1283
- if (year)
1284
- return "".concat(year, "\u5E74\u524D");
1285
- var month = Math.floor(time / (1e3 * 60 * 60 * 24) / 30);
1286
- if (month)
1287
- return "".concat(month, "\u4E2A\u6708\u524D");
1288
- var day = Math.floor(time / (1e3 * 60 * 60 * 24));
1289
- if (day)
1290
- return "".concat(day, "\u5929\u524D");
1291
- var hour = Math.floor(time / (1e3 * 60 * 60));
1292
- if (hour)
1293
- return "".concat(hour, "\u5C0F\u65F6\u524D");
1294
- var min = Math.floor(time / (1e3 * 60));
1295
- if (min)
1296
- return "".concat(min, "\u5206\u949F\u524D");
1297
- else
1298
- return "\u521A\u521A";
1299
- };
1300
- DateClass2.prototype.formatPassTimeForList = function(time) {
1301
- return DateClass2.prototype.formatPassTimeForDetail(time, "YYYY\u5E74MM\u6708DD\u65E5", true);
1302
- };
1303
- DateClass2.prototype.formatPassTimeForDetail = function(time, fmt, noYear) {
1304
- if (fmt === void 0) {
1305
- fmt = "YYYY-MM-DD";
1306
- }
1307
- var date2 = typeof time === "number" ? new Date(time) : new Date((time || "").replace(/-/g, "/"));
1308
- var diff = (new Date().getTime() - date2.getTime()) / 1e3;
1309
- var dayDiff = Math.floor(diff / 86400);
1310
- var isValidDate = Object.prototype.toString.call(date2) === "[object Date]" && !isNaN(date2.getTime());
1311
- if (!isValidDate)
1312
- return "";
1313
- var formatDate = function() {
1314
- var today = new Date(date2);
1315
- var o = {
1316
- "Y+": today.getFullYear(),
1317
- "M+": ("0" + (today.getMonth() + 1)).slice(-2),
1318
- "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);
1319
1329
  };
1320
- fmt = replacementYear(date2, fmt);
1321
- var year = today.getFullYear();
1322
- if (!(new Date().getFullYear() > year) && noYear) {
1323
- var backData = replacementDate(o, fmt);
1324
- return backData.split("\u5E74")[1];
1330
+ if (dayDiff === -1) {
1331
+ return "刚刚";
1332
+ } else if (isNaN(dayDiff) || dayDiff < 0 || dayDiff >= 15) {
1333
+ return formatDate();
1325
1334
  }
1326
- 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 + "天前";
1327
1336
  };
1328
- if (dayDiff === -1) {
1329
- return "\u521A\u521A";
1330
- } else if (isNaN(dayDiff) || dayDiff < 0 || dayDiff >= 15) {
1331
- return formatDate();
1332
- }
1333
- 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";
1334
- };
1335
- return DateClass2;
1336
- }();
1337
- date$1.exports = new DateClass();
1338
- const date = /* @__PURE__ */ getDefaultExportFromCjs(date$1.exports);
1339
- 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: {} };
1340
1344
  var _listCacheClear;
1341
1345
  var hasRequired_listCacheClear;
1342
1346
  function require_listCacheClear() {
@@ -2243,6 +2247,7 @@ function requireStubFalse() {
2243
2247
  stubFalse_1 = stubFalse;
2244
2248
  return stubFalse_1;
2245
2249
  }
2250
+ isBuffer.exports;
2246
2251
  var hasRequiredIsBuffer;
2247
2252
  function requireIsBuffer() {
2248
2253
  if (hasRequiredIsBuffer)
@@ -2322,6 +2327,7 @@ function require_baseUnary() {
2322
2327
  return _baseUnary;
2323
2328
  }
2324
2329
  var _nodeUtil = { exports: {} };
2330
+ _nodeUtil.exports;
2325
2331
  var hasRequired_nodeUtil;
2326
2332
  function require_nodeUtil() {
2327
2333
  if (hasRequired_nodeUtil)
@@ -2371,7 +2377,11 @@ function require_arrayLikeKeys() {
2371
2377
  function arrayLikeKeys(value, inherited) {
2372
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;
2373
2379
  for (var key in value) {
2374
- 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)))) {
2375
2385
  result.push(key);
2376
2386
  }
2377
2387
  }
@@ -2551,6 +2561,7 @@ function require_baseAssignIn() {
2551
2561
  return _baseAssignIn;
2552
2562
  }
2553
2563
  var _cloneBuffer = { exports: {} };
2564
+ _cloneBuffer.exports;
2554
2565
  var hasRequired_cloneBuffer;
2555
2566
  function require_cloneBuffer() {
2556
2567
  if (hasRequired_cloneBuffer)
@@ -3164,13 +3175,13 @@ function requireCloneDeep() {
3164
3175
  return cloneDeep_1;
3165
3176
  }
3166
3177
  /*! clipboard-copy. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
3167
- var _clipboardCopy_4_0_1_clipboardCopy;
3168
- var hasRequired_clipboardCopy_4_0_1_clipboardCopy;
3169
- function require_clipboardCopy_4_0_1_clipboardCopy() {
3170
- if (hasRequired_clipboardCopy_4_0_1_clipboardCopy)
3171
- return _clipboardCopy_4_0_1_clipboardCopy;
3172
- hasRequired_clipboardCopy_4_0_1_clipboardCopy = 1;
3173
- _clipboardCopy_4_0_1_clipboardCopy = clipboardCopy;
3178
+ var clipboardCopy_1;
3179
+ var hasRequiredClipboardCopy;
3180
+ function requireClipboardCopy() {
3181
+ if (hasRequiredClipboardCopy)
3182
+ return clipboardCopy_1;
3183
+ hasRequiredClipboardCopy = 1;
3184
+ clipboardCopy_1 = clipboardCopy;
3174
3185
  function makeError() {
3175
3186
  return new DOMException("The request is not allowed", "NotAllowedError");
3176
3187
  }
@@ -3213,266 +3224,270 @@ function require_clipboardCopy_4_0_1_clipboardCopy() {
3213
3224
  }
3214
3225
  }
3215
3226
  }
3216
- return _clipboardCopy_4_0_1_clipboardCopy;
3227
+ return clipboardCopy_1;
3217
3228
  }
3218
- Object.defineProperty(tools$1.exports, "__esModule", { value: true });
3229
+ var tools = tools$2.exports;
3230
+ Object.defineProperty(tools, "__esModule", { value: true });
3219
3231
  var previous = 0;
3220
3232
  var timeout = null;
3221
- var ToolsClass = function() {
3222
- function ToolsClass2() {
3223
- var _this = this;
3224
- this.stopScroll = function(className) {
3225
- if (!(window && window.document)) {
3226
- return new Error("\u4EC5\u652F\u6301\u6D4F\u89C8\u5668");
3227
- }
3228
- var html = document.documentElement;
3229
- html.style.overflow = "hidden";
3230
- html.style.height = "100%";
3231
- var body = document.body;
3232
- body.style.overflow = "hidden";
3233
- body.style.height = "100%";
3234
- if (className) {
3235
- var dom = document.querySelector(".".concat(className));
3236
- dom && dom.addEventListener("touchmove", _this.__setDefault__);
3237
- }
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));
3238
3300
  };
3239
- this.startScroll = function(className) {
3240
- if (!(window && window.document)) {
3241
- return new Error("\u4EC5\u652F\u6301\u6D4F\u89C8\u5668");
3242
- }
3243
- var html = document.documentElement;
3244
- html.style.overflow = "visible";
3245
- html.style.height = "auto";
3246
- var body = document.body;
3247
- body.style.overflow = "visible";
3248
- body.style.height = "auto";
3249
- if (className) {
3250
- var dom = document.querySelector(".".concat(className));
3251
- 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];
3252
3305
  }
3306
+ return _obj;
3253
3307
  };
3254
- this.objectToArray = function(obj) {
3255
- var arr = [];
3256
- if (typeof obj === "object") {
3257
- for (var key in obj) {
3258
- if (obj.hasOwnProperty(key)) {
3259
- arr.push([key, obj[key]].join("="));
3260
- }
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;
3261
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("仅支持浏览器");
3262
3340
  }
3263
- 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
+ });
3264
3361
  };
3265
- this.convertKeyValueEnum = function(obj) {
3266
- var result = {};
3267
- if (typeof obj === "object") {
3268
- for (var key in obj) {
3269
- if (obj.hasOwnProperty(key)) {
3270
- result[obj[key]] = key;
3271
- }
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();
3272
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("仅支持浏览器");
3273
3391
  }
3274
- return result;
3392
+ var copy = requireClipboardCopy();
3393
+ return copy(str);
3275
3394
  };
3276
- this.isDefined = function(val) {
3277
- return val !== void 0 && val !== null;
3395
+ ToolsClass2.prototype.firstUpperCase = function(str) {
3396
+ return str.charAt(0).toUpperCase() + str.toString().slice(1);
3278
3397
  };
3279
- this.__loaded__ = {};
3280
- this.__setDefault__ = function(e) {
3281
- 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);
3282
3406
  };
3283
- }
3284
- ToolsClass2.prototype.deepCopy = function(data) {
3285
- return JSON.parse(JSON.stringify(data));
3286
- };
3287
- ToolsClass2.prototype.deepCopy2 = function(obj) {
3288
- var _obj = Array.isArray(obj) ? [] : {};
3289
- for (var i in obj) {
3290
- _obj[i] = typeof obj[i] === "object" ? this.deepCopy2(obj[i]) : obj[i];
3291
- }
3292
- return _obj;
3293
- };
3294
- ToolsClass2.prototype.deepCopy3 = function(obj) {
3295
- var deepcopy = requireCloneDeep();
3296
- return deepcopy(obj);
3297
- };
3298
- ToolsClass2.prototype.debounce = function(func, wait) {
3299
- var delay = function() {
3300
- var args = arguments;
3301
- if (timeout)
3302
- clearTimeout(timeout);
3303
- timeout = setTimeout(function() {
3304
- func.apply(delay, args);
3305
- }, 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();
3306
3412
  };
3307
- return delay;
3308
- };
3309
- ToolsClass2.prototype.throttle = function(func, wait) {
3310
- var delay = function() {
3311
- var now = Date.now();
3312
- if (now - previous > wait) {
3313
- func.apply(delay, arguments);
3314
- previous = now;
3413
+ ToolsClass2.prototype.getBytesOfText = function(str) {
3414
+ if (str === void 0) {
3415
+ str = "";
3315
3416
  }
3417
+ return str.replace(/[^\u0000-\u00ff]/g, "aa").length;
3316
3418
  };
3317
- return delay;
3318
- };
3319
- ToolsClass2.prototype.getUrlName = function(url) {
3320
- return url && url.split("?")[0].split("/").reverse()[0];
3321
- };
3322
- ToolsClass2.prototype.loadJs = function(url) {
3323
- var _this = this;
3324
- if (!(window && window.document)) {
3325
- return new Error("\u4EC5\u652F\u6301\u6D4F\u89C8\u5668");
3326
- }
3327
- var name = this.getUrlName(url);
3328
- var id = "js_" + name;
3329
- return new Promise(function(resolve, reject) {
3330
- if (_this.__loaded__[id]) {
3331
- return resolve();
3332
- }
3333
- var script = document.createElement("script");
3334
- script.type = "text/javascript";
3335
- script.async = true;
3336
- script.src = url;
3337
- script.id = id;
3338
- script.onload = function() {
3339
- _this.__loaded__[id] = true;
3340
- resolve();
3341
- };
3342
- script.onerror = function(e) {
3343
- reject(e);
3344
- };
3345
- document.body.appendChild(script);
3346
- });
3347
- };
3348
- ToolsClass2.prototype.loadCss = function(url) {
3349
- var _this = this;
3350
- if (!(window && window.document)) {
3351
- return new Error("\u4EC5\u652F\u6301\u6D4F\u89C8\u5668");
3352
- }
3353
- var name = this.getUrlName(url);
3354
- var id = "css_" + name;
3355
- return new Promise(function(resolve, reject) {
3356
- if (_this.__loaded__[id]) {
3357
- return resolve();
3358
- }
3359
- var link = document.createElement("link");
3360
- link.type = "text/css";
3361
- link.rel = "stylesheet";
3362
- link.href = url;
3363
- link.id = id;
3364
- link.onload = function() {
3365
- _this.__loaded__[id] = true;
3366
- resolve();
3367
- };
3368
- link.onerror = function(e) {
3369
- reject(e);
3370
- };
3371
- document.head.appendChild(link);
3372
- });
3373
- };
3374
- ToolsClass2.prototype.clipboard = function(str) {
3375
- if (!(window && window.document)) {
3376
- return new Error("\u4EC5\u652F\u6301\u6D4F\u89C8\u5668");
3377
- }
3378
- var copy = require_clipboardCopy_4_0_1_clipboardCopy();
3379
- return copy(str);
3380
- };
3381
- ToolsClass2.prototype.firstUpperCase = function(str) {
3382
- return str.charAt(0).toUpperCase() + str.toString().slice(1);
3383
- };
3384
- ToolsClass2.prototype.slice = function(target, length) {
3385
- if (target === void 0) {
3386
- target = "";
3387
- }
3388
- if (length === void 0) {
3389
- length = 0;
3390
- }
3391
- return target.slice(0, length);
3392
- };
3393
- ToolsClass2.prototype.guid = function() {
3394
- function S4() {
3395
- return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
3396
- }
3397
- return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
3398
- };
3399
- ToolsClass2.prototype.getBytesOfText = function(str) {
3400
- if (str === void 0) {
3401
- str = "";
3402
- }
3403
- return str.replace(/[^\u0000-\u00ff]/g, "aa").length;
3404
- };
3405
- ToolsClass2.prototype.uniqueArr = function(arr) {
3406
- return Array.from(new Set(arr));
3407
- };
3408
- ToolsClass2.prototype.swapArray = function(array, index1, index2) {
3409
- var _a;
3410
- _a = [array[index2], array[index1]], array[index1] = _a[0], array[index2] = _a[1];
3411
- return array;
3412
- };
3413
- ToolsClass2.prototype.filterEmoji = function(str) {
3414
- return str.replace(/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/mg, "");
3415
- };
3416
- ToolsClass2.prototype.containsEmoji = function(str) {
3417
- var reg = /\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/mg;
3418
- return reg.test(str);
3419
- };
3420
- ToolsClass2.prototype.containsHanZi = function(str) {
3421
- var reg = /[\u4e00-\u9fa5]/mg;
3422
- return reg.test(str);
3423
- };
3424
- ToolsClass2.prototype.isEmpty = function(val) {
3425
- if (val == null)
3426
- return true;
3427
- 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
+ }
3428
3460
  return false;
3429
- if (typeof val === "number")
3430
- return !val;
3431
- if (val instanceof Error)
3432
- return val.message === "";
3433
- switch (Object.prototype.toString.call(val)) {
3434
- case "[object String]":
3435
- case "[object Array]":
3436
- return !val.length;
3437
- case "[object File]":
3438
- case "[object Map]":
3439
- case "[object Set]": {
3440
- return !val.size;
3441
- }
3442
- case "[object Object]": {
3443
- return !Object.keys(val).length;
3461
+ };
3462
+ ToolsClass2.prototype.sensitiveField = function(field, before, after) {
3463
+ if (before === void 0) {
3464
+ before = 3;
3444
3465
  }
3445
- }
3446
- return false;
3447
- };
3448
- ToolsClass2.prototype.sensitiveField = function(field, before, after) {
3449
- if (before === void 0) {
3450
- before = 3;
3451
- }
3452
- if (after === void 0) {
3453
- after = 4;
3454
- }
3455
- if (!field) {
3456
- return "";
3457
- }
3458
- field = String(field);
3459
- var sensitiveLen = field.length - before - after;
3460
- if (sensitiveLen < 0) {
3461
- sensitiveLen = 0;
3462
- }
3463
- var regItem = "[\u4E00-\u9FA5a-zA-Z0-9]";
3464
- var regExp = "(".concat(regItem, "{").concat(before, "})").concat(regItem, "*(").concat(regItem, "{").concat(after, "})");
3465
- var reg = new RegExp(regExp);
3466
- return field.replace(reg, "$1".concat("*".repeat(sensitiveLen), "$2"));
3467
- };
3468
- return ToolsClass2;
3469
- }();
3470
- tools$1.exports = new ToolsClass();
3471
- const tools = /* @__PURE__ */ getDefaultExportFromCjs(tools$1.exports);
3472
- const index_vue_vue_type_style_index_0_lang$3 = "";
3473
- const _hoisted_1$5 = { style: { "margin-left": "20px", "color": "#FF5A25" } };
3474
- const _hoisted_2$5 = { class: "insert-article" };
3475
- const _hoisted_3$5 = { class: "insert-article_input" };
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" };
3476
3491
  const _hoisted_4$2 = {
3477
3492
  key: 0,
3478
3493
  class: "nodata"
@@ -3491,7 +3506,7 @@ const _hoisted_12$1 = {
3491
3506
  key: 1,
3492
3507
  style: { "display": "inline-flex", "flex-direction": "column" }
3493
3508
  };
3494
- const _sfc_main$5 = defineComponent({
3509
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3495
3510
  __name: "index",
3496
3511
  props: {
3497
3512
  visible: { type: Boolean, default: false },
@@ -3499,7 +3514,7 @@ const _sfc_main$5 = defineComponent({
3499
3514
  },
3500
3515
  emits: ["change", "submit", "update:visible"],
3501
3516
  setup(__props, { emit: __emit }) {
3502
- const { debounce } = tools;
3517
+ const { debounce } = tools$1;
3503
3518
  const vInfiniteScroll = ElInfiniteScroll;
3504
3519
  const Radio_Type = {
3505
3520
  MY_ARITICLE: "1",
@@ -3550,7 +3565,7 @@ const _sfc_main$5 = defineComponent({
3550
3565
  };
3551
3566
  const confirm = () => {
3552
3567
  if (!data.article) {
3553
- ElMessage.error(`\u8BF7\u9009\u62E9${isVideo ? "\u89C6\u9891" : "\u6587\u7AE0"}`);
3568
+ ElMessage.error(`请选择${isVideo ? "视频" : "文章"}`);
3554
3569
  return;
3555
3570
  }
3556
3571
  data.article.isVideo = isVideo;
@@ -3567,11 +3582,14 @@ const _sfc_main$5 = defineComponent({
3567
3582
  data.busy = true;
3568
3583
  const userInfo = JSON.parse(localStorage.getItem("user")) || JSON.parse(localStorage.getItem("userInfo"));
3569
3584
  const userId = userInfo.uid || userInfo.userid;
3585
+ if (!getList.value)
3586
+ return;
3570
3587
  const res = await getList.value({
3571
3588
  uid: data.params.radio !== Radio_Type.ALL_ARITICLE ? userId : "",
3572
3589
  autherid: data.params.radio !== Radio_Type.ALL_ARITICLE ? userId : "",
3573
3590
  limit: 20,
3574
3591
  allType: data.params.radio,
3592
+ // 只有4 是查视频 其他是文章
3575
3593
  title: data.params.title,
3576
3594
  page: ++data.page
3577
3595
  });
@@ -3585,27 +3603,27 @@ const _sfc_main$5 = defineComponent({
3585
3603
  data.busy = false;
3586
3604
  }, 1e3);
3587
3605
  return (_ctx, _cache) => {
3588
- return openBlock(), createBlock(_sfc_main$6, {
3606
+ return openBlock(), createBlock(_sfc_main$7, {
3589
3607
  visible: unref(visible),
3590
3608
  onSubmit: confirm
3591
3609
  }, {
3592
3610
  title: withCtx(() => [
3593
3611
  createElementVNode("span", null, [
3594
- createTextVNode("\u63D2\u5165\u6587\u7AE0/\u89C6\u9891"),
3595
- createElementVNode("strong", _hoisted_1$5, "\u5E73\u53F0\u4EC5\u652F\u6301\u63D2\u5165" + toDisplayString(`${isVideo.value ? "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)
3596
3614
  ])
3597
3615
  ]),
3598
3616
  default: withCtx(() => [
3599
- createElementVNode("div", _hoisted_2$5, [
3617
+ createElementVNode("div", _hoisted_2$3, [
3600
3618
  createElementVNode("div", null, [
3601
3619
  createVNode(unref(ElRadio), {
3602
3620
  modelValue: data.params.radio,
3603
3621
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => data.params.radio = $event),
3604
3622
  label: Radio_Type.MY_ARITICLE
3605
3623
  }, {
3606
- default: withCtx(() => [
3607
- createTextVNode("\u4ECE\u6211\u7684\u6587\u7AE0\u4E2D\u9009\u62E9")
3608
- ]),
3624
+ default: withCtx(() => _cache[9] || (_cache[9] = [
3625
+ createTextVNode("从我的文章中选择")
3626
+ ])),
3609
3627
  _: 1
3610
3628
  }, 8, ["modelValue", "label"]),
3611
3629
  createVNode(unref(ElRadio), {
@@ -3613,9 +3631,9 @@ const _sfc_main$5 = defineComponent({
3613
3631
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => data.params.radio = $event),
3614
3632
  label: Radio_Type.MY_VIDEO
3615
3633
  }, {
3616
- default: withCtx(() => [
3617
- createTextVNode("\u4ECE\u6211\u7684\u89C6\u9891\u4E2D\u9009\u62E9")
3618
- ]),
3634
+ default: withCtx(() => _cache[10] || (_cache[10] = [
3635
+ createTextVNode("从我的视频中选择")
3636
+ ])),
3619
3637
  _: 1
3620
3638
  }, 8, ["modelValue", "label"]),
3621
3639
  createVNode(unref(ElRadio), {
@@ -3623,17 +3641,17 @@ const _sfc_main$5 = defineComponent({
3623
3641
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => data.params.radio = $event),
3624
3642
  label: Radio_Type.ALL_ARITICLE
3625
3643
  }, {
3626
- default: withCtx(() => [
3627
- createTextVNode("\u4ECE\u6240\u6709\u6587\u7AE0\u4E2D\u9009\u62E9")
3628
- ]),
3644
+ default: withCtx(() => _cache[11] || (_cache[11] = [
3645
+ createTextVNode("从所有文章中选择")
3646
+ ])),
3629
3647
  _: 1
3630
3648
  }, 8, ["modelValue", "label"])
3631
3649
  ]),
3632
- createElementVNode("div", _hoisted_3$5, [
3650
+ createElementVNode("div", _hoisted_3$3, [
3633
3651
  createVNode(unref(ElInput), {
3634
3652
  modelValue: data.params.title,
3635
3653
  "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => data.params.title = $event),
3636
- placeholder: isVideo.value ? "\u8F93\u5165\u89C6\u9891\u63CF\u8FF0\u67E5\u627E\u5E73\u53F0\u53D1\u5E03\u8FC7\u7684\u89C6\u9891" : "\u8F93\u5165\u6807\u9898\u540D\u67E5\u627E\u5E73\u53F0\u53D1\u8FC7\u7684\u6587\u7AE0",
3654
+ placeholder: isVideo.value ? "输入视频描述查找平台发布过的视频" : "输入标题名查找平台发过的文章",
3637
3655
  onKeyup: _cache[5] || (_cache[5] = withKeys(($event) => unref(getArticleList)(true), ["enter", "native"])),
3638
3656
  onInput: _cache[6] || (_cache[6] = ($event) => unref(getArticleList)(true))
3639
3657
  }, {
@@ -3647,7 +3665,7 @@ const _sfc_main$5 = defineComponent({
3647
3665
  _: 1
3648
3666
  }, 8, ["modelValue", "placeholder"])
3649
3667
  ]),
3650
- data.data.length === 0 && !data.busy ? (openBlock(), createElementBlock("div", _hoisted_4$2, toDisplayString(`\u6CA1\u6709\u7B26\u5408\u6761\u4EF6\u7684${isVideo.value ? "\u89C6\u9891" : "\u6587\u7AE0"}\u54E6\uFF0C\u4F60\u53EF\u4EE5\u8BD5\u8BD5\u641C\u7D22\u5176\u4ED6${isVideo.value ? "\u89C6\u9891" : "\u6587\u7AE0"}\uFF5E`), 1)) : 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", {
3651
3669
  key: 1,
3652
3670
  "infinite-scroll-immediate": false,
3653
3671
  class: "insert-article_list",
@@ -3679,12 +3697,12 @@ const _sfc_main$5 = defineComponent({
3679
3697
  }, null, 8, _hoisted_9$1)
3680
3698
  ]),
3681
3699
  createElementVNode("div", _hoisted_10$1, [
3682
- createElementVNode("span", _hoisted_11$1, toDisplayString(item.content || "[\u65E0\u6807\u9898]"), 1),
3683
- createElementVNode("span", null, toDisplayString(unref(date).format(item.createTime * 1e3, "YYYY-MM-DD hh-mm")), 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)
3684
3702
  ])
3685
3703
  ])) : (openBlock(), createElementBlock("div", _hoisted_12$1, [
3686
- createElementVNode("span", null, toDisplayString(item.title || "[\u65E0\u6807\u9898]"), 1),
3687
- createElementVNode("span", null, toDisplayString(unref(date).format(item.createTime * 1e3, "YYYY-MM-DD")), 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)
3688
3706
  ]))
3689
3707
  ];
3690
3708
  }),
@@ -3702,6 +3720,7 @@ const _sfc_main$5 = defineComponent({
3702
3720
  };
3703
3721
  }
3704
3722
  });
3723
+ const index_vue_vue_type_style_index_0_lang$4 = "";
3705
3724
  let getRandomValues;
3706
3725
  const rnds8 = new Uint8Array(16);
3707
3726
  function rng() {
@@ -3741,10 +3760,9 @@ function v4(options, buf, offset) {
3741
3760
  }
3742
3761
  return unsafeStringify(rnds);
3743
3762
  }
3744
- const index_vue_vue_type_style_index_0_lang$2 = "";
3745
- const _hoisted_1$4 = { class: "img-upload-content" };
3746
- const _hoisted_2$4 = { class: "title-box" };
3747
- const _hoisted_3$4 = ["onClick"];
3763
+ const _hoisted_1$5 = { class: "img-upload-content" };
3764
+ const _hoisted_2$2 = { class: "title-box" };
3765
+ const _hoisted_3$2 = ["onClick"];
3748
3766
  const _hoisted_4$1 = {
3749
3767
  key: 0,
3750
3768
  class: "line"
@@ -3773,41 +3791,38 @@ const _hoisted_13 = {
3773
3791
  key: 0,
3774
3792
  class: "upload-wrap"
3775
3793
  };
3776
- const _hoisted_14 = /* @__PURE__ */ createElementVNode("span", null, "\u672C\u5730\u4E0A\u4F20", -1);
3777
- 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);
3778
- const _hoisted_16 = {
3794
+ const _hoisted_14 = {
3779
3795
  key: 1,
3780
3796
  class: "img-list"
3781
3797
  };
3782
- const _hoisted_17 = ["src"];
3783
- const _hoisted_18 = { class: "upload-btn" };
3784
- const _hoisted_19 = {
3798
+ const _hoisted_15 = ["src"];
3799
+ const _hoisted_16 = { class: "upload-btn" };
3800
+ const _hoisted_17 = {
3785
3801
  key: 2,
3786
3802
  class: "map-depot"
3787
3803
  };
3788
- const _hoisted_20 = { class: "screen" };
3789
- const _hoisted_21 = { key: 0 };
3790
- const _hoisted_22 = { class: "tab-box" };
3791
- const _hoisted_23 = ["onClick"];
3792
- const _hoisted_24 = {
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 = {
3793
3809
  key: 0,
3794
3810
  class: "line"
3795
3811
  };
3796
- const _hoisted_25 = { class: "image-list depot-image" };
3797
- const _hoisted_26 = ["onClick"];
3798
- const _hoisted_27 = ["src"];
3799
- const _hoisted_28 = {
3812
+ const _hoisted_23 = { class: "image-list depot-image" };
3813
+ const _hoisted_24 = ["onClick"];
3814
+ const _hoisted_25 = ["src"];
3815
+ const _hoisted_26 = {
3800
3816
  key: 0,
3801
3817
  class: "shade"
3802
3818
  };
3803
- const _hoisted_29 = { class: "num" };
3804
- const _hoisted_30 = {
3819
+ const _hoisted_27 = { class: "num" };
3820
+ const _hoisted_28 = {
3805
3821
  key: 1,
3806
3822
  class: "protocol-box"
3807
3823
  };
3808
- const _hoisted_31 = /* @__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);
3809
- const _hoisted_32 = ["href"];
3810
- const _sfc_main$4 = defineComponent({
3824
+ const _hoisted_29 = ["href"];
3825
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
3811
3826
  __name: "index",
3812
3827
  props: {
3813
3828
  visible: { type: Boolean, default: false },
@@ -3842,7 +3857,7 @@ const _sfc_main$4 = defineComponent({
3842
3857
  const tempImgs = [...props.imgList];
3843
3858
  Array.from(imgFile).forEach((file) => {
3844
3859
  if (file.size > 20 * 1024 * 1024) {
3845
- ElMessage.error("\u5355\u5F20\u56FE\u7247\u6700\u5927\u652F\u630120M");
3860
+ ElMessage.error("单张图片最大支持20M");
3846
3861
  return;
3847
3862
  }
3848
3863
  const id = v4();
@@ -3872,14 +3887,14 @@ const _sfc_main$4 = defineComponent({
3872
3887
  const list = [
3873
3888
  {
3874
3889
  id: 2,
3875
- value: "\u4E0A\u4F20\u56FE\u7247"
3890
+ value: "上传图片"
3876
3891
  }
3877
3892
  ];
3878
3893
  activeTitle.value = 2;
3879
3894
  if (props.imgNum < 20) {
3880
3895
  list.unshift({
3881
3896
  id: 1,
3882
- value: "\u6B63\u6587\u56FE\u7247"
3897
+ value: "正文图片"
3883
3898
  });
3884
3899
  activeTitle.value = 1;
3885
3900
  getContentImgList();
@@ -3887,7 +3902,7 @@ const _sfc_main$4 = defineComponent({
3887
3902
  if (props.chartGallery) {
3888
3903
  list.push({
3889
3904
  id: 3,
3890
- value: isEmotofine ? "\u7535\u6469\u8303\u56FE\u5E93" : "\u6469\u6258\u8303\u56FE\u5E93"
3905
+ value: isEmotofine ? "电摩范图库" : "摩托范图库"
3891
3906
  });
3892
3907
  }
3893
3908
  titleList.value = list;
@@ -4032,13 +4047,13 @@ const _sfc_main$4 = defineComponent({
4032
4047
  const tabList = ref([]);
4033
4048
  const search = () => {
4034
4049
  if (!selectData.brandId) {
4035
- return ElMessage.error("\u8BF7\u9009\u62E9\u54C1\u724C");
4050
+ return ElMessage.error("请选择品牌");
4036
4051
  }
4037
4052
  if (!selectData.goodId) {
4038
- return ElMessage.error("\u8BF7\u9009\u62E9\u8F66\u578B");
4053
+ return ElMessage.error("请选择车型");
4039
4054
  }
4040
4055
  if (!selectData.carId) {
4041
- return ElMessage.error("\u8BF7\u9009\u62E9\u6B3E\u578B");
4056
+ return ElMessage.error("请选择款型");
4042
4057
  }
4043
4058
  tabList.value = [];
4044
4059
  emits("update:imgList", []);
@@ -4089,13 +4104,13 @@ const _sfc_main$4 = defineComponent({
4089
4104
  emits("update:imgList", list);
4090
4105
  };
4091
4106
  return (_ctx, _cache) => {
4092
- return openBlock(), createBlock(_sfc_main$6, {
4107
+ return openBlock(), createBlock(_sfc_main$7, {
4093
4108
  visible: props.visible,
4094
4109
  showTitle: false
4095
4110
  }, {
4096
4111
  default: withCtx(() => [
4097
- createElementVNode("div", _hoisted_1$4, [
4098
- createElementVNode("div", _hoisted_2$4, [
4112
+ createElementVNode("div", _hoisted_1$5, [
4113
+ createElementVNode("div", _hoisted_2$2, [
4099
4114
  (openBlock(true), createElementBlock(Fragment, null, renderList(titleList.value, (item, index) => {
4100
4115
  return openBlock(), createElementBlock("div", {
4101
4116
  key: index,
@@ -4104,10 +4119,10 @@ const _sfc_main$4 = defineComponent({
4104
4119
  }, [
4105
4120
  createTextVNode(toDisplayString(item.value) + " ", 1),
4106
4121
  item.id === activeTitle.value ? (openBlock(), createElementBlock("div", _hoisted_4$1)) : createCommentVNode("", true)
4107
- ], 10, _hoisted_3$4);
4122
+ ], 10, _hoisted_3$2);
4108
4123
  }), 128)),
4109
- [1, 3].includes(activeTitle.value) && props.imgList.length ? (openBlock(), createElementBlock("div", _hoisted_5$1, " \u6700\u591A\u53EF\u9009" + toDisplayString(props.imgNum) + "\u5F20\u56FE\u7247\uFF0C\u5DF2\u9009" + toDisplayString(props.imgList.length) + "\u5F20 ", 1)) : createCommentVNode("", true),
4110
- 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)
4111
4126
  ]),
4112
4127
  activeTitle.value === 1 ? (openBlock(), createElementBlock("div", _hoisted_7, [
4113
4128
  createElementVNode("div", _hoisted_8, [
@@ -4144,10 +4159,10 @@ const _sfc_main$4 = defineComponent({
4144
4159
  ]),
4145
4160
  _: 1
4146
4161
  }),
4147
- _hoisted_14
4162
+ _cache[7] || (_cache[7] = createElementVNode("span", null, "本地上传", -1))
4148
4163
  ]),
4149
- _hoisted_15
4150
- ])) : (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, [
4151
4166
  createVNode(unref(draggable), {
4152
4167
  modelValue: imgListTemp.value,
4153
4168
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => imgListTemp.value = $event),
@@ -4168,7 +4183,7 @@ const _sfc_main$4 = defineComponent({
4168
4183
  style: { "object-fit": "contain" },
4169
4184
  width: "120",
4170
4185
  height: "120"
4171
- }, null, 8, _hoisted_17),
4186
+ }, null, 8, _hoisted_15),
4172
4187
  createVNode(unref(CircleCloseFilled), {
4173
4188
  class: "icon pointer",
4174
4189
  onClick: ($event) => deleteImg(element)
@@ -4191,7 +4206,7 @@ const _sfc_main$4 = defineComponent({
4191
4206
  _: 1
4192
4207
  }, 8, ["modelValue"])
4193
4208
  ])),
4194
- createElementVNode("div", _hoisted_18, [
4209
+ createElementVNode("div", _hoisted_16, [
4195
4210
  createElementVNode("input", {
4196
4211
  type: "file",
4197
4212
  name: "file",
@@ -4202,13 +4217,13 @@ const _sfc_main$4 = defineComponent({
4202
4217
  }, null, 32)
4203
4218
  ])
4204
4219
  ], 2)) : createCommentVNode("", true),
4205
- activeTitle.value === 3 ? (openBlock(), createElementBlock("div", _hoisted_19, [
4206
- createElementVNode("div", _hoisted_20, [
4220
+ activeTitle.value === 3 ? (openBlock(), createElementBlock("div", _hoisted_17, [
4221
+ createElementVNode("div", _hoisted_18, [
4207
4222
  createElementVNode("div", null, [
4208
4223
  createVNode(unref(ElSelect), {
4209
4224
  modelValue: selectData.brandId,
4210
4225
  "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => selectData.brandId = $event),
4211
- placeholder: "\u8BF7\u9009\u62E9\u54C1\u724C",
4226
+ placeholder: "请选择品牌",
4212
4227
  size: "large",
4213
4228
  class: "select_1",
4214
4229
  filterable: "",
@@ -4229,7 +4244,7 @@ const _sfc_main$4 = defineComponent({
4229
4244
  createVNode(unref(ElSelect), {
4230
4245
  modelValue: selectData.goodId,
4231
4246
  "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => selectData.goodId = $event),
4232
- placeholder: "\u8BF7\u9009\u62E9\u8F66\u578B",
4247
+ placeholder: "请选择车型",
4233
4248
  size: "large",
4234
4249
  class: "select_1",
4235
4250
  filterable: "",
@@ -4250,7 +4265,7 @@ const _sfc_main$4 = defineComponent({
4250
4265
  createVNode(unref(ElSelect), {
4251
4266
  modelValue: selectData.carId,
4252
4267
  "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => selectData.carId = $event),
4253
- placeholder: "\u8BF7\u9009\u62E9\u6B3E\u578B",
4268
+ placeholder: "请选择款型",
4254
4269
  size: "large",
4255
4270
  class: "select_2",
4256
4271
  filterable: "",
@@ -4274,14 +4289,14 @@ const _sfc_main$4 = defineComponent({
4274
4289
  style: { "width": "80px" },
4275
4290
  onClick: search
4276
4291
  }, {
4277
- default: withCtx(() => [
4278
- createTextVNode("\u641C\u7D22")
4279
- ]),
4292
+ default: withCtx(() => _cache[9] || (_cache[9] = [
4293
+ createTextVNode("搜索")
4294
+ ])),
4280
4295
  _: 1
4281
4296
  })
4282
4297
  ]),
4283
- tabList.value && tabList.value.length ? (openBlock(), createElementBlock("div", _hoisted_21, [
4284
- createElementVNode("div", _hoisted_22, [
4298
+ tabList.value && tabList.value.length ? (openBlock(), createElementBlock("div", _hoisted_19, [
4299
+ createElementVNode("div", _hoisted_20, [
4285
4300
  (openBlock(true), createElementBlock(Fragment, null, renderList(tabList.value, (item, index) => {
4286
4301
  return openBlock(), createElementBlock("div", {
4287
4302
  key: index,
@@ -4289,11 +4304,11 @@ const _sfc_main$4 = defineComponent({
4289
4304
  onClick: ($event) => activeTab.value = item.type
4290
4305
  }, [
4291
4306
  createTextVNode(toDisplayString(item.name) + " ", 1),
4292
- item.type === activeTab.value ? (openBlock(), createElementBlock("div", _hoisted_24)) : createCommentVNode("", true)
4293
- ], 10, _hoisted_23);
4307
+ item.type === activeTab.value ? (openBlock(), createElementBlock("div", _hoisted_22)) : createCommentVNode("", true)
4308
+ ], 10, _hoisted_21);
4294
4309
  }), 128))
4295
4310
  ]),
4296
- createElementVNode("div", _hoisted_25, [
4311
+ createElementVNode("div", _hoisted_23, [
4297
4312
  (openBlock(true), createElementBlock(Fragment, null, renderList(imageList.value, (item, index) => {
4298
4313
  return openBlock(), createElementBlock("div", {
4299
4314
  key: index,
@@ -4304,25 +4319,25 @@ const _sfc_main$4 = defineComponent({
4304
4319
  src: item.imgOrgUrl,
4305
4320
  alt: "",
4306
4321
  class: "image"
4307
- }, null, 8, _hoisted_27),
4308
- item.num ? (openBlock(), createElementBlock("div", _hoisted_28, [
4309
- createElementVNode("div", _hoisted_29, 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)
4310
4325
  ])) : createCommentVNode("", true)
4311
- ], 8, _hoisted_26);
4326
+ ], 8, _hoisted_24);
4312
4327
  }), 128))
4313
4328
  ])
4314
- ])) : (openBlock(), createElementBlock("div", _hoisted_30, [
4329
+ ])) : (openBlock(), createElementBlock("div", _hoisted_28, [
4315
4330
  createElementVNode("div", null, [
4316
- _hoisted_31,
4331
+ _cache[12] || (_cache[12] = createElementVNode("div", null, " 图库中的图片仅限下载摩托范以编辑发布文章使用,不得用于其他任何平台及用途 ", -1)),
4317
4332
  createElementVNode("div", null, [
4318
- createTextVNode(" \u8BF7\u9605\u8BFB"),
4333
+ _cache[10] || (_cache[10] = createTextVNode(" 请阅读")),
4319
4334
  createElementVNode("a", {
4320
4335
  href: `https://${unref(hostName)}/about?type=imageLicenseAgreement`,
4321
4336
  target: "_blank",
4322
4337
  rel: "noopener noreferrer",
4323
4338
  class: "link"
4324
- }, "\u300A\u6469\u6258\u8303\u56FE\u7247\u8BB8\u53EF\u4F7F\u7528\u534F\u8BAE\u300B", 8, _hoisted_32),
4325
- createTextVNode(",\u60A8\u7684\u884C\u4E3A\u89C6\u4E3A\u60A8\u5DF2\u540C\u610F\u8BE5\u534F\u8BAE\u3002 ")
4339
+ }, "《摩托范图片许可使用协议》", 8, _hoisted_29),
4340
+ _cache[11] || (_cache[11] = createTextVNode(",您的行为视为您已同意该协议。 "))
4326
4341
  ])
4327
4342
  ])
4328
4343
  ]))
@@ -4334,11 +4349,9 @@ const _sfc_main$4 = defineComponent({
4334
4349
  };
4335
4350
  }
4336
4351
  });
4337
- const index_vue_vue_type_style_index_0_lang$1 = "";
4338
- const _hoisted_1$3 = /* @__PURE__ */ createElementVNode("span", null, "\u63D2\u5165\u89C6\u9891", -1);
4339
- const _hoisted_2$3 = { class: "insert-video" };
4340
- const _hoisted_3$3 = /* @__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);
4341
- const _sfc_main$3 = defineComponent({
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({
4342
4355
  __name: "index",
4343
4356
  props: {
4344
4357
  visible: { type: Boolean, default: false },
@@ -4360,29 +4373,29 @@ const _sfc_main$3 = defineComponent({
4360
4373
  ele[0].dispatchEvent(event);
4361
4374
  };
4362
4375
  return (_ctx, _cache) => {
4363
- return openBlock(), createBlock(_sfc_main$6, {
4376
+ return openBlock(), createBlock(_sfc_main$7, {
4364
4377
  "show-btn": false,
4365
4378
  visible: unref(visible),
4366
4379
  width: "600px",
4367
4380
  height: "100px"
4368
4381
  }, {
4369
- title: withCtx(() => [
4370
- _hoisted_1$3
4371
- ]),
4382
+ title: withCtx(() => _cache[1] || (_cache[1] = [
4383
+ createElementVNode("span", null, "插入视频", -1)
4384
+ ])),
4372
4385
  default: withCtx(() => [
4373
- createElementVNode("div", _hoisted_2$3, [
4386
+ createElementVNode("div", _hoisted_1$4, [
4374
4387
  createVNode(unref(ElButton), {
4375
4388
  style: { "width": "120px" },
4376
4389
  round: "",
4377
4390
  type: "primary",
4378
4391
  onClick: emitEvent
4379
4392
  }, {
4380
- default: withCtx(() => [
4381
- createTextVNode("\u9009\u62E9\u89C6\u9891")
4382
- ]),
4393
+ default: withCtx(() => _cache[2] || (_cache[2] = [
4394
+ createTextVNode("选择视频")
4395
+ ])),
4383
4396
  _: 1
4384
4397
  }),
4385
- _hoisted_3$3,
4398
+ _cache[3] || (_cache[3] = createElementVNode("span", { class: "remark" }, "为了获得更高的推荐量和点击量,建议上传720p(1280*720)或更高分辨率的视频,视频格式为.mp4或.mov,大小不超过1G", -1)),
4386
4399
  createElementVNode("input", {
4387
4400
  type: "file",
4388
4401
  accept: "video/*",
@@ -4397,112 +4410,813 @@ const _sfc_main$3 = defineComponent({
4397
4410
  };
4398
4411
  }
4399
4412
  });
4400
- const index_vue_vue_type_style_index_0_lang = "";
4401
- const _sfc_main$2 = {
4402
- provide() {
4403
- return {
4404
- vm: this
4405
- };
4406
- },
4407
- components: {
4408
- ElInput,
4409
- BasicDialog: _sfc_main$6,
4410
- draggable
4411
- },
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",
4412
4417
  props: {
4413
- visible: {
4414
- type: Boolean,
4415
- default: false
4416
- },
4417
- linkContent: {
4418
- type: String,
4419
- default: ""
4418
+ // 编辑器DOM引用
4419
+ editorDom: {
4420
+ type: Object,
4421
+ default: null
4420
4422
  },
4421
- fileSelected: {
4422
- type: Function,
4423
- default: () => {
4424
- }
4423
+ // 话题API请求方法
4424
+ request: {
4425
+ type: Object,
4426
+ default: null
4425
4427
  }
4426
4428
  },
4427
4429
  data() {
4428
- return {};
4429
- },
4430
- computed: {
4431
- input: {
4432
- get() {
4433
- return this.linkContent;
4434
- },
4435
- set(val) {
4436
- 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
4437
4460
  }
4438
- }
4439
- },
4440
- mounted() {
4441
- },
4442
- methods: {
4443
- emitEvent() {
4444
- var event = new MouseEvent("click");
4445
- var ele = document.getElementsByClassName("video-input");
4446
- ele[0].dispatchEvent(event);
4447
- },
4448
- setStatus(val) {
4449
- this.$emit("update:visible", val);
4450
- }
4451
- }
4452
- };
4453
- const _hoisted_1$2 = /* @__PURE__ */ createElementVNode("div", null, [
4454
- /* @__PURE__ */ createElementVNode("span", null, "\u91C7\u96C6\u6587\u7AE0"),
4455
- /* @__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")
4456
- ], -1);
4457
- const _hoisted_2$2 = { class: "collect-article_content" };
4458
- 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);
4459
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
4460
- const _component_el_input = resolveComponent("el-input");
4461
- const _component_BasicDialog = resolveComponent("BasicDialog");
4462
- return openBlock(), createBlock(_component_BasicDialog, {
4463
- visible: $props.visible,
4464
- width: "600px",
4465
- height: "50px"
4466
- }, {
4467
- title: withCtx(() => [
4468
- _hoisted_1$2
4469
- ]),
4470
- default: withCtx(() => [
4471
- createElementVNode("div", _hoisted_2$2, [
4472
- _hoisted_3$2,
4473
- createVNode(_component_el_input, {
4474
- modelValue: $options.input,
4475
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.input = $event),
4476
- placeholder: "\u4EC5\u652F\u6301\u5FAE\u4FE1\u94FE\u63A5"
4477
- }, null, 8, ["modelValue"])
4478
- ])
4479
- ]),
4480
- _: 1
4481
- }, 8, ["visible"]);
4482
- }
4483
- const CollectArticle = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
4484
- const index_vue_vue_type_style_index_0_scoped_true_lang = "";
4485
- const _sfc_main$1 = {
4486
- components: {
4487
- ElIconError: CircleCloseFilled
4488
- },
4489
- props: {
4490
- article: {
4491
- type: Object,
4492
- default: () => ({})
4493
- }
4461
+ };
4494
4462
  },
4495
4463
  methods: {
4496
- close(e) {
4497
- let child = e.target;
4498
- while (child) {
4499
- if (child.dataset.article) {
4500
- child.parentNode.removeChild(child);
4501
- break;
4502
- }
4503
- child = child.parentNode;
4464
+ // 初始化话题管理器
4465
+ init() {
4466
+ if (!this.editorDom) {
4467
+ console.warn("TopicManager: editorDom is required");
4468
+ return;
4504
4469
  }
4505
- this.$emit("delete");
4470
+ setTimeout(() => this.bindEditorEvents(), 0);
4471
+ },
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
+ console.log("handleTopicInput", event.key);
4488
+ const activeElement = document.activeElement;
4489
+ if (activeElement && (activeElement.tagName === "INPUT" || activeElement.tagName === "TEXTAREA")) {
4490
+ return;
4491
+ }
4492
+ const selection = window.getSelection();
4493
+ if (selection.rangeCount === 0)
4494
+ return;
4495
+ const range = selection.getRangeAt(0);
4496
+ const container = range.startContainer;
4497
+ if (!this.editorDom.contains(container))
4498
+ return;
4499
+ let currentNode = container;
4500
+ while (currentNode && currentNode !== this.editorDom) {
4501
+ if (currentNode.nodeType === Node.ELEMENT_NODE && currentNode.tagName === "MDD-TOPIC") {
4502
+ return;
4503
+ }
4504
+ currentNode = currentNode.parentNode;
4505
+ }
4506
+ let paragraph = container;
4507
+ while (paragraph && paragraph.nodeType !== Node.ELEMENT_NODE) {
4508
+ paragraph = paragraph.parentNode;
4509
+ }
4510
+ while (paragraph && !((_a = paragraph.classList) == null ? void 0 : _a.contains("halo-paragraph"))) {
4511
+ paragraph = paragraph.parentNode;
4512
+ }
4513
+ if (!paragraph)
4514
+ return;
4515
+ const { textContent: paragraphText, cursorPosition } = this.getParagraphTextExcludingTopics(paragraph, range);
4516
+ if (event.key === "#") {
4517
+ const afterCursor = paragraphText.substring(cursorPosition);
4518
+ if (afterCursor.length > 0 && afterCursor[0] === " ") {
4519
+ return;
4520
+ }
4521
+ setTimeout(() => {
4522
+ const position = this.getCaretPosition();
4523
+ const triggerInfo = {
4524
+ paragraph,
4525
+ hashIndex: cursorPosition,
4526
+ // #号的位置
4527
+ cursorPosition: cursorPosition + 1
4528
+ // #号后的位置
4529
+ };
4530
+ this.showTopicPopover("hot", position, "", triggerInfo);
4531
+ }, 10);
4532
+ } else if (this.shouldTriggerSearch(event.key)) {
4533
+ setTimeout(() => {
4534
+ this.checkAndTriggerSearch(paragraph);
4535
+ }, 10);
4536
+ } else {
4537
+ this.hideTopicPopover();
4538
+ }
4539
+ },
4540
+ shouldTriggerSearch(key) {
4541
+ return key !== " " && key.length === 1 || key === "Backspace" || key === "Delete";
4542
+ },
4543
+ checkAndTriggerSearch(paragraph) {
4544
+ const selection = window.getSelection();
4545
+ if (selection.rangeCount === 0)
4546
+ return;
4547
+ const range = selection.getRangeAt(0);
4548
+ let currentNode = range.startContainer;
4549
+ while (currentNode && currentNode !== paragraph) {
4550
+ if (currentNode.nodeType === Node.ELEMENT_NODE && currentNode.tagName === "MDD-TOPIC") {
4551
+ this.hideTopicPopover();
4552
+ return;
4553
+ }
4554
+ currentNode = currentNode.parentNode;
4555
+ }
4556
+ const { textContent: paragraphText, cursorPosition } = this.getParagraphTextExcludingTopics(paragraph, range);
4557
+ const beforeCursor = paragraphText.substring(0, cursorPosition);
4558
+ const hashIndex = beforeCursor.lastIndexOf("#");
4559
+ if (hashIndex !== -1) {
4560
+ const afterHash = beforeCursor.substring(hashIndex + 1);
4561
+ if (afterHash.replace(/\u00A0/g, " ").indexOf(" ") === -1) {
4562
+ if (afterHash.length <= 15) {
4563
+ const position = this.getCaretPosition();
4564
+ const triggerInfo = {
4565
+ paragraph,
4566
+ hashIndex,
4567
+ cursorPosition
4568
+ };
4569
+ if (afterHash.length === 0) {
4570
+ this.showTopicPopover("hot", position, "", triggerInfo);
4571
+ } else {
4572
+ this.showTopicPopover("search", position, afterHash, triggerInfo);
4573
+ }
4574
+ } else if (afterHash.length > 15) {
4575
+ this.hideTopicPopover();
4576
+ }
4577
+ } else {
4578
+ this.hideTopicPopover();
4579
+ }
4580
+ } else {
4581
+ this.hideTopicPopover();
4582
+ }
4583
+ },
4584
+ getParagraphTextExcludingTopics(paragraph, range) {
4585
+ let textContent = "";
4586
+ let cursorPosition = 0;
4587
+ let foundCursor = false;
4588
+ const walker = document.createTreeWalker(
4589
+ paragraph,
4590
+ NodeFilter.SHOW_ALL,
4591
+ {
4592
+ acceptNode: function(node2) {
4593
+ if (node2.nodeType === Node.ELEMENT_NODE && node2.tagName === "MDD-TOPIC") {
4594
+ return NodeFilter.FILTER_REJECT;
4595
+ }
4596
+ return NodeFilter.FILTER_ACCEPT;
4597
+ }
4598
+ },
4599
+ false
4600
+ );
4601
+ let node;
4602
+ while (node = walker.nextNode()) {
4603
+ if (node.nodeType === Node.TEXT_NODE) {
4604
+ const nodeText = node.textContent;
4605
+ if (!foundCursor && node === range.startContainer) {
4606
+ cursorPosition = textContent.length + range.startOffset;
4607
+ foundCursor = true;
4608
+ }
4609
+ textContent += nodeText;
4610
+ }
4611
+ }
4612
+ return { textContent, cursorPosition };
4613
+ },
4614
+ getCaretPosition() {
4615
+ const selection = window.getSelection();
4616
+ if (selection.rangeCount === 0)
4617
+ return { top: 0, left: 0 };
4618
+ const range = selection.getRangeAt(0);
4619
+ const rect = range.getBoundingClientRect();
4620
+ return {
4621
+ top: rect.bottom + window.scrollY,
4622
+ left: rect.left + window.scrollX
4623
+ };
4624
+ },
4625
+ // 话题弹框相关方法
4626
+ showTopicPopover(type, position, searchKeyword = "", triggerInfo = null) {
4627
+ if (!this.request || !this.request.getTopic) {
4628
+ console.warn("话题功能需要提供 request.getTopic 方法");
4629
+ return;
4630
+ }
4631
+ const selection = window.getSelection();
4632
+ if (selection.rangeCount > 0) {
4633
+ this.topicPopover.originalRange = selection.getRangeAt(0).cloneRange();
4634
+ this.topicPopover.originalSelection = selection;
4635
+ }
4636
+ if (triggerInfo) {
4637
+ this.topicPopover.triggerInfo = triggerInfo;
4638
+ }
4639
+ this.topicPopover.visible = true;
4640
+ this.topicPopover.type = type;
4641
+ this.topicPopover.position = position;
4642
+ this.topicPopover.searchKeyword = searchKeyword;
4643
+ if (type === "hot") {
4644
+ this.topicPopover.activeTab = "hot";
4645
+ this.loadHotTopics();
4646
+ this.loadRecentTopics();
4647
+ } else if (type === "search") {
4648
+ this.searchTopics(searchKeyword);
4649
+ }
4650
+ this.createGlobalTopicPopover();
4651
+ },
4652
+ hideTopicPopover() {
4653
+ this.topicPopover.visible = false;
4654
+ this.topicPopover.hotTopics = [];
4655
+ this.topicPopover.searchTopics = [];
4656
+ this.topicPopover.page = 1;
4657
+ this.topicPopover.searchPage = 1;
4658
+ this.topicPopover.hasMore = true;
4659
+ this.topicPopover.searchHasMore = true;
4660
+ this.topicPopover.originalRange = null;
4661
+ this.topicPopover.originalSelection = null;
4662
+ this.topicPopover.triggerInfo = {
4663
+ paragraph: null,
4664
+ hashIndex: -1,
4665
+ cursorPosition: 0
4666
+ };
4667
+ this.removeGlobalTopicPopover();
4668
+ },
4669
+ switchTopicTab(tab) {
4670
+ this.topicPopover.activeTab = tab;
4671
+ this.updateGlobalTopicPopover();
4672
+ },
4673
+ async loadHotTopics() {
4674
+ if (this.topicPopover.loading || !this.topicPopover.hasMore)
4675
+ return;
4676
+ this.topicPopover.loading = true;
4677
+ try {
4678
+ const response = await this.request.getTopic({
4679
+ action: "201023",
4680
+ page: this.topicPopover.page,
4681
+ limit: 50,
4682
+ hoopId: 0,
4683
+ type: 0,
4684
+ orderBy: "view"
4685
+ });
4686
+ if (response && response.data && response.data.code === 0) {
4687
+ const topics = response.data.data || [];
4688
+ if (topics.length === 0) {
4689
+ this.topicPopover.hasMore = false;
4690
+ } else {
4691
+ const existingIds = new Set(this.topicPopover.hotTopics.map((t) => t.id));
4692
+ const newTopics = topics.filter((t) => !existingIds.has(t.id));
4693
+ this.topicPopover.hotTopics = [...this.topicPopover.hotTopics, ...newTopics];
4694
+ this.topicPopover.page++;
4695
+ if (newTopics.length === 0) {
4696
+ this.topicPopover.hasMore = false;
4697
+ }
4698
+ }
4699
+ } else {
4700
+ console.warn("加载热门话题失败:", response);
4701
+ this.topicPopover.hasMore = false;
4702
+ }
4703
+ } catch (error) {
4704
+ console.error("加载热门话题失败:", error);
4705
+ this.topicPopover.hasMore = false;
4706
+ } finally {
4707
+ this.topicPopover.loading = false;
4708
+ this.updateGlobalTopicPopover();
4709
+ }
4710
+ },
4711
+ async searchTopics(keyword) {
4712
+ this.topicPopover.searchKeyword = keyword;
4713
+ this.topicPopover.searchTopics = [];
4714
+ this.topicPopover.searchPage = 1;
4715
+ this.topicPopover.searchHasMore = true;
4716
+ if (this.topicPopover.loading) {
4717
+ this.topicPopover.loading = false;
4718
+ }
4719
+ this.topicPopover.loading = true;
4720
+ try {
4721
+ const response = await this.request.getTopic({
4722
+ action: "201023",
4723
+ title: keyword,
4724
+ highlightTitle: "title",
4725
+ page: this.topicPopover.searchPage,
4726
+ limit: 50
4727
+ });
4728
+ if (response && response.data && response.data.code === 0) {
4729
+ const topics = response.data.data || [];
4730
+ this.topicPopover.searchTopics = topics;
4731
+ this.topicPopover.searchPage++;
4732
+ if (topics.length === 0) {
4733
+ this.topicPopover.searchHasMore = false;
4734
+ } else {
4735
+ this.topicPopover.searchHasMore = topics.length >= 50;
4736
+ }
4737
+ } else {
4738
+ console.warn("搜索话题失败:", response);
4739
+ this.topicPopover.searchHasMore = false;
4740
+ }
4741
+ } catch (error) {
4742
+ console.error("搜索话题失败:", error);
4743
+ this.topicPopover.searchHasMore = false;
4744
+ } finally {
4745
+ this.topicPopover.loading = false;
4746
+ this.updateGlobalTopicPopover();
4747
+ }
4748
+ },
4749
+ loadRecentTopics() {
4750
+ try {
4751
+ const localTopics = JSON.parse(localStorage.getItem("localTopic") || "[]");
4752
+ this.topicPopover.recentTopics = localTopics;
4753
+ } catch (error) {
4754
+ console.error("加载最近使用话题失败:", error);
4755
+ this.topicPopover.recentTopics = [];
4756
+ }
4757
+ },
4758
+ selectTopic(topic) {
4759
+ this.saveToRecentTopics(topic);
4760
+ this.insertTopicToEditor(topic);
4761
+ this.hideTopicPopover();
4762
+ this.$emit("topic-inserted", topic);
4763
+ },
4764
+ saveToRecentTopics(topic) {
4765
+ try {
4766
+ let recentTopics = JSON.parse(localStorage.getItem("localTopic") || "[]");
4767
+ recentTopics = recentTopics.filter((item) => item.id !== topic.id);
4768
+ recentTopics.unshift(topic);
4769
+ if (recentTopics.length > 20) {
4770
+ recentTopics = recentTopics.slice(0, 20);
4771
+ }
4772
+ localStorage.setItem("localTopic", JSON.stringify(recentTopics));
4773
+ } catch (error) {
4774
+ console.error("保存最近使用话题失败:", error);
4775
+ }
4776
+ },
4777
+ // 创建全局话题弹框
4778
+ createGlobalTopicPopover() {
4779
+ this.removeGlobalTopicPopover();
4780
+ const mask = document.createElement("div");
4781
+ mask.className = "topic-popover-mask";
4782
+ mask.addEventListener("click", () => {
4783
+ this.hideTopicPopover();
4784
+ });
4785
+ const container = document.createElement("div");
4786
+ container.className = "topic-popover";
4787
+ container.style.position = "fixed";
4788
+ container.style.top = this.topicPopover.position.top + "px";
4789
+ container.style.left = this.topicPopover.position.left + "px";
4790
+ container.style.zIndex = "9999";
4791
+ container.addEventListener("click", (e) => {
4792
+ e.stopPropagation();
4793
+ });
4794
+ container.innerHTML = this.createTopicPopoverContent();
4795
+ document.body.appendChild(mask);
4796
+ document.body.appendChild(container);
4797
+ this.topicPopover.globalMask = mask;
4798
+ this.topicPopover.globalContainer = container;
4799
+ this.bindTopicPopoverEvents();
4800
+ },
4801
+ // 移除全局话题弹框
4802
+ removeGlobalTopicPopover() {
4803
+ if (this.topicPopover.globalMask) {
4804
+ document.body.removeChild(this.topicPopover.globalMask);
4805
+ this.topicPopover.globalMask = null;
4806
+ }
4807
+ if (this.topicPopover.globalContainer) {
4808
+ document.body.removeChild(this.topicPopover.globalContainer);
4809
+ this.topicPopover.globalContainer = null;
4810
+ }
4811
+ },
4812
+ // 更新全局话题弹框内容
4813
+ updateGlobalTopicPopover() {
4814
+ if (!this.topicPopover.globalContainer)
4815
+ return;
4816
+ this.topicPopover.globalContainer.innerHTML = this.createTopicPopoverContent();
4817
+ this.bindTopicPopoverEvents();
4818
+ },
4819
+ // 创建话题弹框内容
4820
+ createTopicPopoverContent() {
4821
+ if (this.topicPopover.type === "hot") {
4822
+ return this.getHotTopicPopoverHTML();
4823
+ } else if (this.topicPopover.type === "search") {
4824
+ return this.getSearchTopicPopoverHTML();
4825
+ }
4826
+ return "";
4827
+ },
4828
+ // 获取热门话题弹框HTML
4829
+ getHotTopicPopoverHTML() {
4830
+ const activeTab = this.topicPopover.activeTab;
4831
+ const hotTopics = this.topicPopover.hotTopics;
4832
+ const recentTopics = this.topicPopover.recentTopics;
4833
+ const loading = this.topicPopover.loading;
4834
+ const hasMore = this.topicPopover.hasMore;
4835
+ let topicListHTML = "";
4836
+ if (activeTab === "hot") {
4837
+ if (loading && hotTopics.length === 0) {
4838
+ topicListHTML = '<div class="topic-loading">加载中...</div>';
4839
+ } else if (hotTopics.length === 0) {
4840
+ topicListHTML = '<div class="topic-empty">暂无热门话题</div>';
4841
+ } else {
4842
+ topicListHTML = hotTopics.map(
4843
+ (topic) => `<div class="topic-item" data-topic-id="${topic.id}">#${topic.exactlyMatchTitle}</div>`
4844
+ ).join("");
4845
+ if (loading) {
4846
+ topicListHTML += '<div class="topic-loading">加载更多...</div>';
4847
+ } else if (!hasMore) {
4848
+ topicListHTML += '<div class="topic-empty">没有更多了</div>';
4849
+ }
4850
+ }
4851
+ } else {
4852
+ if (recentTopics.length === 0) {
4853
+ topicListHTML = '<div class="topic-empty">暂无最近使用记录</div>';
4854
+ } else {
4855
+ topicListHTML = recentTopics.map(
4856
+ (topic) => `<div class="topic-item" data-topic-id="${topic.id}">#${topic.exactlyMatchTitle}</div>`
4857
+ ).join("");
4858
+ }
4859
+ }
4860
+ return `
4861
+ <div class="topic-popover-content">
4862
+ <div class="topic-tabs">
4863
+ <div class="topic-tab ${activeTab === "hot" ? "active" : ""}" data-tab="hot">
4864
+ 热门话题
4865
+ </div>
4866
+ <div class="topic-tab ${activeTab === "recent" ? "active" : ""}" data-tab="recent">
4867
+ 最近使用
4868
+ </div>
4869
+ </div>
4870
+ <div class="topic-list-container">
4871
+ <div class="topic-list">
4872
+ ${topicListHTML}
4873
+ </div>
4874
+ </div>
4875
+ </div>
4876
+ `;
4877
+ },
4878
+ // 获取搜索话题弹框HTML
4879
+ getSearchTopicPopoverHTML() {
4880
+ const searchKeyword = this.topicPopover.searchKeyword;
4881
+ const searchTopics = this.topicPopover.searchTopics;
4882
+ const loading = this.topicPopover.loading;
4883
+ const searchHasMore = this.topicPopover.searchHasMore;
4884
+ let topicListHTML = "";
4885
+ if (loading && searchTopics.length === 0) {
4886
+ topicListHTML = '<div class="topic-loading">搜索中...</div>';
4887
+ } else if (searchTopics.length === 0) {
4888
+ topicListHTML = '<div class="topic-empty">没有匹配到话题,请重新输入</div>';
4889
+ } else {
4890
+ topicListHTML = searchTopics.map(
4891
+ (topic) => `<div class="topic-item" data-topic-id="${topic.id}">#${topic.exactlyMatchTitle}</div>`
4892
+ ).join("");
4893
+ if (loading) {
4894
+ topicListHTML += '<div class="topic-loading">加载更多...</div>';
4895
+ } else if (!searchHasMore) {
4896
+ topicListHTML += '<div class="topic-empty">没有更多了</div>';
4897
+ }
4898
+ }
4899
+ return `
4900
+ <div class="topic-popover-content">
4901
+ <div class="topic-search-header">
4902
+ <span class="topic-search-title">#${searchKeyword}</span>
4903
+ </div>
4904
+ <div class="topic-list-container">
4905
+ <div class="topic-list">
4906
+ ${topicListHTML}
4907
+ </div>
4908
+ </div>
4909
+ </div>
4910
+ `;
4911
+ },
4912
+ // 绑定话题弹框事件
4913
+ bindTopicPopoverEvents() {
4914
+ if (!this.topicPopover.globalContainer)
4915
+ return;
4916
+ const tabs = this.topicPopover.globalContainer.querySelectorAll(".topic-tab");
4917
+ tabs.forEach((tab) => {
4918
+ tab.addEventListener("click", (e) => {
4919
+ const tabType = e.target.getAttribute("data-tab");
4920
+ this.switchTopicTab(tabType);
4921
+ });
4922
+ });
4923
+ const topicItems = this.topicPopover.globalContainer.querySelectorAll(".topic-item");
4924
+ topicItems.forEach((item) => {
4925
+ item.addEventListener("click", (e) => {
4926
+ const topicId = parseInt(e.target.getAttribute("data-topic-id"));
4927
+ const topic = this.findTopicById(topicId);
4928
+ if (topic) {
4929
+ this.selectTopic(topic);
4930
+ }
4931
+ });
4932
+ });
4933
+ const listContainer = this.topicPopover.globalContainer.querySelector(".topic-list-container");
4934
+ if (listContainer) {
4935
+ listContainer.addEventListener("scroll", (e) => {
4936
+ if (this.topicPopover.type === "hot") {
4937
+ this.handleTopicScroll(e);
4938
+ } else if (this.topicPopover.type === "search") {
4939
+ this.handleSearchTopicScroll(e);
4940
+ }
4941
+ });
4942
+ }
4943
+ },
4944
+ // 根据ID查找话题
4945
+ findTopicById(topicId) {
4946
+ let topic = this.topicPopover.hotTopics.find((t) => t.id === topicId);
4947
+ if (topic)
4948
+ return topic;
4949
+ topic = this.topicPopover.searchTopics.find((t) => t.id === topicId);
4950
+ if (topic)
4951
+ return topic;
4952
+ topic = this.topicPopover.recentTopics.find((t) => t.id === topicId);
4953
+ if (topic)
4954
+ return topic;
4955
+ return null;
4956
+ },
4957
+ handleTopicScroll(event) {
4958
+ if (this.topicPopover.activeTab !== "hot")
4959
+ return;
4960
+ const container = event.target;
4961
+ const scrollTop = container.scrollTop;
4962
+ const scrollHeight = container.scrollHeight;
4963
+ const clientHeight = container.clientHeight;
4964
+ if (scrollTop + clientHeight >= scrollHeight - 10) {
4965
+ this.loadHotTopics();
4966
+ }
4967
+ },
4968
+ handleSearchTopicScroll(event) {
4969
+ const container = event.target;
4970
+ const scrollTop = container.scrollTop;
4971
+ const scrollHeight = container.scrollHeight;
4972
+ const clientHeight = container.clientHeight;
4973
+ if (scrollTop + clientHeight >= scrollHeight - 10) {
4974
+ this.searchTopics(this.topicPopover.searchKeyword);
4975
+ }
4976
+ },
4977
+ insertTopicToEditor(topic) {
4978
+ const originalRange = this.topicPopover.originalRange;
4979
+ const triggerInfo = this.topicPopover.triggerInfo;
4980
+ const popoverType = this.topicPopover.type;
4981
+ this.hideTopicPopover();
4982
+ let range = originalRange;
4983
+ if (!range) {
4984
+ const selection2 = window.getSelection();
4985
+ if (selection2.rangeCount === 0)
4986
+ return;
4987
+ range = selection2.getRangeAt(0);
4988
+ }
4989
+ const topicText = `#${topic.exactlyMatchTitle}`;
4990
+ if (popoverType === "search" && triggerInfo && triggerInfo.paragraph) {
4991
+ const paragraph = triggerInfo.paragraph;
4992
+ const hashIndex = triggerInfo.hashIndex;
4993
+ const deleteRange = document.createRange();
4994
+ const walker = document.createTreeWalker(
4995
+ paragraph,
4996
+ NodeFilter.SHOW_TEXT,
4997
+ {
4998
+ acceptNode: function(node2) {
4999
+ let parent = node2.parentNode;
5000
+ while (parent && parent !== paragraph) {
5001
+ if (parent.tagName === "MDD-TOPIC") {
5002
+ return NodeFilter.FILTER_REJECT;
5003
+ }
5004
+ parent = parent.parentNode;
5005
+ }
5006
+ return NodeFilter.FILTER_ACCEPT;
5007
+ }
5008
+ },
5009
+ false
5010
+ );
5011
+ let position = 0;
5012
+ let startNode = null;
5013
+ let startOffset = 0;
5014
+ let endNode = null;
5015
+ let endOffset = 0;
5016
+ let node;
5017
+ while (node = walker.nextNode()) {
5018
+ if (position + node.textContent.length > hashIndex) {
5019
+ startNode = node;
5020
+ startOffset = hashIndex - position;
5021
+ break;
5022
+ }
5023
+ position += node.textContent.length;
5024
+ }
5025
+ const currentCursorPosition = triggerInfo.cursorPosition;
5026
+ position = 0;
5027
+ walker.currentNode = paragraph;
5028
+ while (node = walker.nextNode()) {
5029
+ if (position + node.textContent.length >= currentCursorPosition) {
5030
+ endNode = node;
5031
+ endOffset = currentCursorPosition - position;
5032
+ break;
5033
+ }
5034
+ position += node.textContent.length;
5035
+ }
5036
+ if (startNode && endNode) {
5037
+ deleteRange.setStart(startNode, startOffset);
5038
+ deleteRange.setEnd(endNode, endOffset);
5039
+ deleteRange.deleteContents();
5040
+ range = document.createRange();
5041
+ range.setStart(startNode, startOffset);
5042
+ range.collapse(true);
5043
+ }
5044
+ } else if (popoverType === "hot") {
5045
+ const container = range.startContainer;
5046
+ if (container.nodeType === Node.TEXT_NODE && container.textContent) {
5047
+ const offset = range.startOffset;
5048
+ if (offset > 0 && container.textContent[offset - 1] === "#") {
5049
+ const deleteRange = document.createRange();
5050
+ deleteRange.setStart(container, offset - 1);
5051
+ deleteRange.setEnd(container, offset);
5052
+ deleteRange.deleteContents();
5053
+ range.setStart(container, offset - 1);
5054
+ range.collapse(true);
5055
+ }
5056
+ }
5057
+ }
5058
+ const topicElement = document.createElement("mdd-topic");
5059
+ topicElement.setAttribute("data-topic", JSON.stringify({
5060
+ topicId: topic.id,
5061
+ topicType: 0,
5062
+ startIndex: 0,
5063
+ // 会在updateTopicPosition中更新
5064
+ endIndex: 0
5065
+ // 会在updateTopicPosition中更新
5066
+ }));
5067
+ topicElement.textContent = topicText;
5068
+ topicElement.setAttribute("contenteditable", "false");
5069
+ range.deleteContents();
5070
+ range.insertNode(topicElement);
5071
+ const spaceNode = document.createTextNode(" ");
5072
+ range.setStartAfter(topicElement);
5073
+ range.insertNode(spaceNode);
5074
+ const newRange = document.createRange();
5075
+ newRange.setStartAfter(spaceNode);
5076
+ newRange.collapse(true);
5077
+ const selection = window.getSelection();
5078
+ selection.removeAllRanges();
5079
+ selection.addRange(newRange);
5080
+ setTimeout(() => {
5081
+ const currentSelection = window.getSelection();
5082
+ if (currentSelection.rangeCount > 0) {
5083
+ const currentRange = currentSelection.getRangeAt(0);
5084
+ if (currentRange.startContainer !== spaceNode.nextSibling) {
5085
+ const correctRange = document.createRange();
5086
+ correctRange.setStartAfter(spaceNode);
5087
+ correctRange.collapse(true);
5088
+ currentSelection.removeAllRanges();
5089
+ currentSelection.addRange(correctRange);
5090
+ }
5091
+ }
5092
+ }, 0);
5093
+ this.$emit("update-topic-position");
5094
+ },
5095
+ // 销毁话题管理器
5096
+ destroy() {
5097
+ this.unbindEditorEvents();
5098
+ this.hideTopicPopover();
5099
+ }
5100
+ },
5101
+ mounted() {
5102
+ this.init();
5103
+ },
5104
+ beforeUnmount() {
5105
+ this.destroy();
5106
+ }
5107
+ };
5108
+ const _hoisted_1$3 = { class: "topic-manager" };
5109
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
5110
+ return openBlock(), createElementBlock("div", _hoisted_1$3);
5111
+ }
5112
+ const TopicManager = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
5113
+ const index_vue_vue_type_style_index_0_lang = "";
5114
+ const _sfc_main$2 = {
5115
+ provide() {
5116
+ return {
5117
+ vm: this
5118
+ };
5119
+ },
5120
+ components: {
5121
+ ElInput,
5122
+ BasicDialog: _sfc_main$7,
5123
+ draggable
5124
+ },
5125
+ props: {
5126
+ visible: {
5127
+ type: Boolean,
5128
+ default: false
5129
+ },
5130
+ linkContent: {
5131
+ type: String,
5132
+ default: ""
5133
+ },
5134
+ fileSelected: {
5135
+ type: Function,
5136
+ default: () => {
5137
+ }
5138
+ }
5139
+ },
5140
+ data() {
5141
+ return {};
5142
+ },
5143
+ computed: {
5144
+ input: {
5145
+ get() {
5146
+ return this.linkContent;
5147
+ },
5148
+ set(val) {
5149
+ this.$emit("update:linkContent", val);
5150
+ }
5151
+ }
5152
+ },
5153
+ mounted() {
5154
+ },
5155
+ methods: {
5156
+ emitEvent() {
5157
+ var event = new MouseEvent("click");
5158
+ var ele = document.getElementsByClassName("video-input");
5159
+ ele[0].dispatchEvent(event);
5160
+ },
5161
+ setStatus(val) {
5162
+ this.$emit("update:visible", val);
5163
+ }
5164
+ // submit() {
5165
+ // this.$emit('submit')
5166
+ // }
5167
+ }
5168
+ };
5169
+ const _hoisted_1$2 = { class: "collect-article_content" };
5170
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
5171
+ const _component_el_input = resolveComponent("el-input");
5172
+ const _component_BasicDialog = resolveComponent("BasicDialog");
5173
+ return openBlock(), createBlock(_component_BasicDialog, {
5174
+ visible: $props.visible,
5175
+ width: "600px",
5176
+ height: "50px"
5177
+ }, {
5178
+ title: withCtx(() => _cache[1] || (_cache[1] = [
5179
+ createElementVNode("div", null, [
5180
+ createElementVNode("span", null, "采集文章"),
5181
+ createElementVNode("span", { class: "collect-article_lable" }, "如需获得正式使用权,请自行联系版权所有者")
5182
+ ], -1)
5183
+ ])),
5184
+ default: withCtx(() => [
5185
+ createElementVNode("div", _hoisted_1$2, [
5186
+ _cache[2] || (_cache[2] = createElementVNode("div", { class: "tip" }, "请把需要采集的文章链接粘贴在下方的输入框:", -1)),
5187
+ createVNode(_component_el_input, {
5188
+ modelValue: $options.input,
5189
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.input = $event),
5190
+ placeholder: "仅支持微信链接"
5191
+ }, null, 8, ["modelValue"])
5192
+ ])
5193
+ ]),
5194
+ _: 1
5195
+ }, 8, ["visible"]);
5196
+ }
5197
+ const CollectArticle = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
5198
+ const index_vue_vue_type_style_index_0_scoped_4ebe06df_lang = "";
5199
+ const _sfc_main$1 = {
5200
+ components: {
5201
+ ElIconError: CircleCloseFilled
5202
+ },
5203
+ props: {
5204
+ article: {
5205
+ type: Object,
5206
+ default: () => ({})
5207
+ }
5208
+ },
5209
+ methods: {
5210
+ close(e) {
5211
+ let child = e.target;
5212
+ while (child) {
5213
+ if (child.dataset.article) {
5214
+ child.parentNode.removeChild(child);
5215
+ break;
5216
+ }
5217
+ child = child.parentNode;
5218
+ }
5219
+ this.$emit("delete");
4506
5220
  }
4507
5221
  }
4508
5222
  };
@@ -4526,8 +5240,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
4526
5240
  createElementVNode("div", _hoisted_4, toDisplayString($props.article.title), 1),
4527
5241
  createElementVNode("div", _hoisted_5, [
4528
5242
  createElementVNode("span", null, toDisplayString($props.article.author), 1),
4529
- createElementVNode("span", null, toDisplayString($props.article.viewNum) + "\u6D4F\u89C8", 1),
4530
- createElementVNode("span", null, toDisplayString($props.article.replycnt) + "\u8BC4\u8BBA", 1)
5243
+ createElementVNode("span", null, toDisplayString($props.article.viewNum) + "浏览", 1),
5244
+ createElementVNode("span", null, toDisplayString($props.article.replycnt) + "评论", 1)
4531
5245
  ])
4532
5246
  ]),
4533
5247
  createVNode(_component_el_icon_error, {
@@ -4539,10 +5253,10 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
4539
5253
  class: normalizeClass([{
4540
5254
  "article-bg-height": $props.article.img || $props.article.mediaInfo && $props.article.mediaInfo.length
4541
5255
  }, "article-bg"])
4542
- }, " \u5E73\u53F0\u4EC5\u652F\u6301\u5C55\u793A18\u4E2A\u6708\u7684\u63A8\u8350\u5185\u5BB9 ", 2)) : createCommentVNode("", true)
5256
+ }, " 平台仅支持展示18个月的推荐内容 ", 2)) : createCommentVNode("", true)
4543
5257
  ]);
4544
5258
  }
4545
- const Item = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-1c406a11"]]);
5259
+ const Item = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-4ebe06df"]]);
4546
5260
  const mountArticleDom = (props, del) => {
4547
5261
  const className = "article-wrap";
4548
5262
  const article = props.article;
@@ -4576,14 +5290,15 @@ const _sfc_main = {
4576
5290
  name: "Edit",
4577
5291
  components: {
4578
5292
  ElInput,
4579
- InsertArticle: _sfc_main$5,
4580
- ImgUpload: _sfc_main$4,
4581
- VideoUpload: _sfc_main$3,
5293
+ InsertArticle: _sfc_main$6,
5294
+ ImgUpload: _sfc_main$5,
5295
+ VideoUpload: _sfc_main$4,
4582
5296
  CollectArticle,
4583
5297
  ElFormItem,
4584
5298
  ElForm,
4585
5299
  ElDialog,
4586
- ElButton
5300
+ ElButton,
5301
+ TopicManager
4587
5302
  },
4588
5303
  props: [
4589
5304
  "disabled",
@@ -4593,13 +5308,15 @@ const _sfc_main = {
4593
5308
  "importEssay",
4594
5309
  "uploadImageByOther",
4595
5310
  "chartGallery",
4596
- "request"
5311
+ "request",
5312
+ "placeholder"
4597
5313
  ],
4598
5314
  data() {
4599
5315
  return {
4600
5316
  hasArticleCard: false,
4601
5317
  cursorStyle: "auto",
4602
5318
  titleCount: 0,
5319
+ // 标题数量
4603
5320
  viewLinkDialog: false,
4604
5321
  linkForm: {
4605
5322
  linkAddress: "",
@@ -4607,39 +5324,54 @@ const _sfc_main = {
4607
5324
  },
4608
5325
  setAlignFlag: true,
4609
5326
  article: {},
5327
+ // 插入的文章
4610
5328
  imgList: [],
4611
5329
  imgNum: 20,
4612
5330
  videoList: [],
4613
5331
  visibleVideo: false,
4614
5332
  visibleCollectArticle: false,
4615
5333
  visibleArticle: false,
5334
+ // 插入文章
4616
5335
  visibleImg: false,
5336
+ // 插入图片
4617
5337
  imgType: "normal",
5338
+ //
4618
5339
  typeEnum: {
4619
- \u6587\u5B57: "1",
4620
- \u56FE\u7247: "2",
4621
- \u56FE\u6587: "3",
4622
- \u6BB5\u843D\u6807\u9898: "4",
4623
- \u5173\u8054: "5",
4624
- \u5355\u89C6\u9891: "6",
4625
- \u89C6\u9891\u6587\u5B57: "7",
5340
+ 文字: "1",
5341
+ 图片: "2",
5342
+ 图文: "3",
5343
+ 段落标题: "4",
5344
+ 关联: "5",
5345
+ // 关联车辆、轨迹、活动、商家、话题
5346
+ 单视频: "6",
5347
+ 视频文字: "7",
4626
5348
  URL: "8",
4627
- \u6587\u7AE0\u5361\u7247: "11"
5349
+ 文章卡片: "11"
4628
5350
  },
4629
5351
  fontInfo: {
4630
5352
  size: ""
4631
5353
  },
4632
5354
  user: {},
5355
+ // 用户
4633
5356
  editor: {},
5357
+ // 编辑器实例对象
4634
5358
  editorDom: {},
5359
+ // 编辑器Dom
4635
5360
  uploadStore: {},
5361
+ // 待上传的图片池
4636
5362
  linkContent: "",
5363
+ // 插入链接的地址
4637
5364
  loadingText: "",
5365
+ // loaing的提示文字
4638
5366
  progressPercent: "",
5367
+ // 上传进度
4639
5368
  currentIndex: 0,
4640
5369
  loading: false,
5370
+ // 是否提交中
4641
5371
  viewStatus: false,
5372
+ // todo: 改名
4642
5373
  linkStatus: false,
5374
+ // todo: 改名
4643
5375
  styleStatus: {
4644
5376
  bold: false,
4645
5377
  italic: false,
@@ -4663,6 +5395,7 @@ const _sfc_main = {
4663
5395
  targetMove: "",
4664
5396
  moverClasses: ["halo-img-content", "halo-video-content"],
4665
5397
  selectDom: null
5398
+ //选中的dom
4666
5399
  };
4667
5400
  },
4668
5401
  computed: {
@@ -4679,12 +5412,12 @@ const _sfc_main = {
4679
5412
  watch: {
4680
5413
  progressPercent(val) {
4681
5414
  const inner = document.querySelector(".video-progress .inner");
4682
- console.log(val, "\u89C6\u9891\u4E0A\u4F20\u8FDB\u5EA6");
5415
+ console.log(val, "视频上传进度");
4683
5416
  if (inner) {
4684
5417
  inner.style.width = val + "%";
4685
5418
  if (val === 100) {
4686
5419
  document.querySelector(".video-progress").innerHTML = `
4687
- <div class="no-calc" style="text-align:center;color:#999999;font-size:18px;">\u6B63\u5728\u83B7\u53D6\u89C6\u9891\u5C01\u9762</div>
5420
+ <div class="no-calc" style="text-align:center;color:#999999;font-size:18px;">正在获取视频封面</div>
4688
5421
  `;
4689
5422
  }
4690
5423
  }
@@ -4713,7 +5446,7 @@ const _sfc_main = {
4713
5446
  me2.editorDom = document.getElementById("editor-content");
4714
5447
  me2.editorDom.addEventListener("blur", this.canSetAlign);
4715
5448
  if (!window.Squire) {
4716
- import("./squire-raw.9f05be24.js").then(function() {
5449
+ import("./squire-raw-1aaeff0b.js").then(function() {
4717
5450
  me2.initSquire();
4718
5451
  });
4719
5452
  } else {
@@ -4736,7 +5469,6 @@ const _sfc_main = {
4736
5469
  },
4737
5470
  setCursor() {
4738
5471
  this.cursorStyle = this.cursorStyle === cursorImg ? "auto" : cursorImg;
4739
- console.log(this.styleStatus, 999);
4740
5472
  this.curStyle = { ...this.styleStatus };
4741
5473
  this.editorDom.addEventListener("mouseup", this.handleCopyFormatUp);
4742
5474
  },
@@ -4774,10 +5506,10 @@ const _sfc_main = {
4774
5506
  this.visibleVideo = false;
4775
5507
  const fileName = (files[0] && files[0].name || "").toLowerCase();
4776
5508
  if (files[0].size > 1 * 1024 * 1024 * 1024) {
4777
- return me2.setToast("\u89C6\u9891\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC71GB");
5509
+ return me2.setToast("视频大小不能超过1GB");
4778
5510
  }
4779
5511
  if (fileName.indexOf(".mp4") === -1 && fileName.indexOf(".mov") === -1) {
4780
- return me2.setToast("\u89C6\u9891\u683C\u5F0F\u4E0D\u662Fmp4\u6216mov");
5512
+ return me2.setToast("视频格式不是mp4或mov");
4781
5513
  }
4782
5514
  const me2 = this;
4783
5515
  if (me2.loading)
@@ -4797,7 +5529,9 @@ const _sfc_main = {
4797
5529
  id: result.videoId,
4798
5530
  desc: "",
4799
5531
  vodSize: result.vodSize || "",
5532
+ // 视频大小
4800
5533
  vodType: result.vodType || ""
5534
+ // 图片尺寸
4801
5535
  };
4802
5536
  me2.$emit("updateAddVideo", true);
4803
5537
  me2.editor["insertVideo"](result.videoUrl, video);
@@ -4851,11 +5585,11 @@ const _sfc_main = {
4851
5585
  },
4852
5586
  insertLink() {
4853
5587
  if (!this.linkForm.linkAddress)
4854
- return ElMessage.error("\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740");
5588
+ return ElMessage.error("请输入链接地址");
4855
5589
  if (!this.linkForm.linkWriting)
4856
- return ElMessage.error("\u8BF7\u8F93\u5165\u94FE\u63A5\u6587\u6848");
5590
+ return ElMessage.error("请输入链接文案");
4857
5591
  if (!this.validUrl(this.linkForm.linkAddress)) {
4858
- return this.setToast("URL\u65E0\u6548");
5592
+ return this.setToast("URL无效");
4859
5593
  }
4860
5594
  this.editor.insertLink(
4861
5595
  this.linkForm.linkAddress,
@@ -4884,6 +5618,10 @@ const _sfc_main = {
4884
5618
  });
4885
5619
  });
4886
5620
  },
5621
+ // TopicManager事件处理
5622
+ onTopicInserted(topic) {
5623
+ this.updateData(true);
5624
+ },
4887
5625
  getHtml(type) {
4888
5626
  this.updateTopicPosition();
4889
5627
  const html = this.editor.getHTML();
@@ -4985,6 +5723,8 @@ const _sfc_main = {
4985
5723
  const frag = document.createDocumentFragment();
4986
5724
  frag.appendChild(this.editor.empty(div));
4987
5725
  const nodes = [...frag.childNodes];
5726
+ const mddTopics = frag.querySelectorAll("mdd-topic");
5727
+ mddTopics.forEach((topic) => topic.setAttribute("contenteditable", "false"));
4988
5728
  for (let i = 0; i < nodes.length; i++) {
4989
5729
  const node = nodes[i];
4990
5730
  if (node.nodeType === 1) {
@@ -5078,6 +5818,8 @@ const _sfc_main = {
5078
5818
  },
5079
5819
  async parseArticle(node) {
5080
5820
  const data = JSON.parse(node.dataset.article);
5821
+ if (!this.getEassyDetail)
5822
+ return;
5081
5823
  await this.getEassyDetail(data.id, (info) => {
5082
5824
  const el = mountArticleDom(
5083
5825
  {
@@ -5334,7 +6076,7 @@ const _sfc_main = {
5334
6076
  }
5335
6077
  this.updateData(true);
5336
6078
  } else {
5337
- this.setToast(rst.origin.name + "\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
6079
+ this.setToast(rst.origin.name + "上传失败,请重试");
5338
6080
  }
5339
6081
  },
5340
6082
  insertVideoBtns(editor, node) {
@@ -5349,7 +6091,7 @@ const _sfc_main = {
5349
6091
  me2.currentVideo = node;
5350
6092
  e.stopPropagation();
5351
6093
  };
5352
- replaceBtn.innerText = "\u66F4\u6362\u5C01\u9762";
6094
+ replaceBtn.innerText = "更换封面";
5353
6095
  return replaceBtn;
5354
6096
  },
5355
6097
  insertImgOperateBtns(editor, data) {
@@ -5370,13 +6112,12 @@ const _sfc_main = {
5370
6112
  }
5371
6113
  });
5372
6114
  var descInputWrap;
5373
- console.log(data.seamlessFlag, "count<<<<<<");
5374
6115
  var descInput = editor.createElement("textarea", {
5375
6116
  class: "desc-input",
5376
6117
  maxlength: "50",
5377
6118
  rows: "2",
5378
6119
  cols: "50",
5379
- placeholder: "\u8BF7\u8F93\u5165\u56FE\u7247\u63CF\u8FF0(\u6700\u591A50\u5B57)",
6120
+ placeholder: "请输入图片描述(最多50字)",
5380
6121
  contenteditable: "false"
5381
6122
  });
5382
6123
  descInput.disabled = me2.disabled;
@@ -5385,7 +6126,7 @@ const _sfc_main = {
5385
6126
  const img = parent.querySelector(".halo-picture-area");
5386
6127
  img.dataset.desc = e.target.value;
5387
6128
  if (e.target.value.length > 49) {
5388
- return me2.setToast("\u9650\u523650\u4E2A\u5B57\u7B26");
6129
+ return me2.setToast("限制50个字符");
5389
6130
  }
5390
6131
  };
5391
6132
  descInput.value = data.content || "";
@@ -5435,7 +6176,7 @@ const _sfc_main = {
5435
6176
  me2.removeParentByClass(e.target, "halo-img-content");
5436
6177
  me2.updateData(true);
5437
6178
  };
5438
- replaceBtn.innerHTML = "\u66FF\u6362";
6179
+ replaceBtn.innerHTML = "替换";
5439
6180
  return [replaceBtn, delBtn, descInputWrap];
5440
6181
  },
5441
6182
  removeSeamlessLaster(e) {
@@ -5459,6 +6200,7 @@ const _sfc_main = {
5459
6200
  }
5460
6201
  }
5461
6202
  },
6203
+ // 初始化编辑器数据,数据是 html 格式(displayData)
5462
6204
  initData(data = "", essayPicRelVOList) {
5463
6205
  this.parseHtml(data, essayPicRelVOList).then((res) => {
5464
6206
  this.editorDom.innerHTML = "";
@@ -5466,6 +6208,13 @@ const _sfc_main = {
5466
6208
  this.updateData();
5467
6209
  });
5468
6210
  },
6211
+ // TODO jsonToHtml、htmlToJson 实现这 2 个方法里面的逻辑,数据结构参考方法里面的注释,出参入参都为字符串,注意:mdd-topic 里面的属性数据 和 json 中的topicPosition数据是一一对应的,startIndex、endIndex为mdd-topic的起止位置 从 content 里面进行分割处理
6212
+ // json、html 数据格式互转,暂时只支持文字、短话题
6213
+ jsonToHtml(json) {
6214
+ },
6215
+ htmlToJson(html) {
6216
+ },
6217
+ // 设置富文本组件
5469
6218
  initSquire() {
5470
6219
  const me2 = this;
5471
6220
  const editorDom = me2.editorDom;
@@ -5553,7 +6302,8 @@ const _sfc_main = {
5553
6302
  event.preventDefault();
5554
6303
  });
5555
6304
  me2.editor.addEventListener("keydown", function(event) {
5556
- if (event.keyCode === 8 || event.keyCode === 46) {
6305
+ var _a, _b, _c;
6306
+ if (["Backspace", "Delete"].includes(event.key)) {
5557
6307
  try {
5558
6308
  const selection2 = getSelection();
5559
6309
  if (me2.selectDom && me2.moverClasses.includes(me2.selectDom.className)) {
@@ -5587,32 +6337,10 @@ const _sfc_main = {
5587
6337
  } catch (error) {
5588
6338
  console.log(error);
5589
6339
  }
5590
- }
5591
- const selection = window.getSelection();
5592
- if (selection.rangeCount > 0) {
5593
- const range = selection.getRangeAt(0);
5594
- const startContainer = range.startContainer;
5595
- let isInMddTopic = false;
5596
- if (startContainer.nodeType === Node.ELEMENT_NODE && startContainer.tagName === "MDD-TOPIC") {
5597
- isInMddTopic = true;
5598
- } else if (startContainer.nodeType === Node.TEXT_NODE) {
5599
- const parent = startContainer.parentNode;
5600
- if (parent.tagName === "MDD-TOPIC") {
5601
- isInMddTopic = true;
5602
- }
5603
- }
5604
- if (isInMddTopic) {
5605
- if (event.key === "Enter") {
5606
- event.preventDefault();
5607
- return;
5608
- }
5609
- const isPrintableKey = event.key.length === 1;
5610
- if (isPrintableKey) {
5611
- event.preventDefault();
5612
- return;
5613
- }
5614
- }
5615
- if ((event.key === "Backspace" || event.key === "Delete") && isInMddTopic) {
6340
+ const selection = window.getSelection();
6341
+ if (selection.rangeCount > 0) {
6342
+ const range = selection.getRangeAt(0);
6343
+ const startContainer = range.startContainer;
5616
6344
  if (startContainer.nodeType === Node.ELEMENT_NODE && startContainer.tagName === "MDD-TOPIC") {
5617
6345
  startContainer.remove();
5618
6346
  event.preventDefault();
@@ -5625,6 +6353,228 @@ const _sfc_main = {
5625
6353
  return;
5626
6354
  }
5627
6355
  }
6356
+ let currentParagraph = startContainer;
6357
+ while (currentParagraph && currentParagraph.nodeType !== Node.ELEMENT_NODE) {
6358
+ currentParagraph = currentParagraph.parentNode;
6359
+ }
6360
+ while (currentParagraph && !((_a = currentParagraph.classList) == null ? void 0 : _a.contains("halo-paragraph"))) {
6361
+ currentParagraph = currentParagraph.parentNode;
6362
+ }
6363
+ if (currentParagraph && event.key === "Backspace") {
6364
+ const container = range.startContainer;
6365
+ const offset = range.startOffset;
6366
+ let isAtParagraphStart = false;
6367
+ let cursorBeforeContent = null;
6368
+ if (container === currentParagraph && offset === 0) {
6369
+ isAtParagraphStart = true;
6370
+ cursorBeforeContent = currentParagraph.firstChild;
6371
+ } else if (container.nodeType === Node.TEXT_NODE && offset === 0) {
6372
+ let isFirstContent = true;
6373
+ let currentNode = currentParagraph.firstChild;
6374
+ while (currentNode && currentNode !== container) {
6375
+ if (currentNode.nodeType === Node.TEXT_NODE && currentNode.textContent.trim() !== "") {
6376
+ isFirstContent = false;
6377
+ break;
6378
+ } else if (currentNode.nodeType === Node.ELEMENT_NODE) {
6379
+ isFirstContent = false;
6380
+ break;
6381
+ }
6382
+ currentNode = currentNode.nextSibling;
6383
+ }
6384
+ if (isFirstContent) {
6385
+ isAtParagraphStart = true;
6386
+ cursorBeforeContent = container;
6387
+ }
6388
+ } else if (container === currentParagraph && offset > 0) {
6389
+ let hasContentBefore = false;
6390
+ for (let i = 0; i < offset; i++) {
6391
+ const node = currentParagraph.childNodes[i];
6392
+ if (node.nodeType === Node.TEXT_NODE && node.textContent.trim() !== "") {
6393
+ hasContentBefore = true;
6394
+ break;
6395
+ } else if (node.nodeType === Node.ELEMENT_NODE) {
6396
+ hasContentBefore = true;
6397
+ break;
6398
+ }
6399
+ }
6400
+ if (!hasContentBefore && offset < currentParagraph.childNodes.length) {
6401
+ isAtParagraphStart = true;
6402
+ cursorBeforeContent = currentParagraph.childNodes[offset];
6403
+ }
6404
+ }
6405
+ if (isAtParagraphStart) {
6406
+ const prevParagraph = currentParagraph.previousElementSibling;
6407
+ if (prevParagraph && prevParagraph.classList.contains("halo-paragraph")) {
6408
+ const prevContent = prevParagraph.innerHTML.trim();
6409
+ if (prevContent === "<br>" || prevContent === "") {
6410
+ prevParagraph.remove();
6411
+ event.preventDefault();
6412
+ me2.updateData(true);
6413
+ return;
6414
+ } else {
6415
+ const mergePoint = prevParagraph.childNodes.length;
6416
+ if (prevParagraph.lastChild && prevParagraph.lastChild.tagName === "BR") {
6417
+ prevParagraph.removeChild(prevParagraph.lastChild);
6418
+ }
6419
+ const nodesToMove = Array.from(currentParagraph.childNodes);
6420
+ nodesToMove.forEach((node) => {
6421
+ prevParagraph.appendChild(node);
6422
+ });
6423
+ currentParagraph.remove();
6424
+ const newRange = document.createRange();
6425
+ if (cursorBeforeContent && prevParagraph.contains(cursorBeforeContent)) {
6426
+ newRange.setStartBefore(cursorBeforeContent);
6427
+ } else {
6428
+ if (mergePoint < prevParagraph.childNodes.length) {
6429
+ newRange.setStartBefore(prevParagraph.childNodes[mergePoint]);
6430
+ } else {
6431
+ newRange.setStart(prevParagraph, prevParagraph.childNodes.length);
6432
+ }
6433
+ }
6434
+ newRange.collapse(true);
6435
+ const selection2 = window.getSelection();
6436
+ selection2.removeAllRanges();
6437
+ selection2.addRange(newRange);
6438
+ event.preventDefault();
6439
+ me2.updateData(true);
6440
+ return;
6441
+ }
6442
+ }
6443
+ }
6444
+ }
6445
+ }
6446
+ }
6447
+ if (event.key === "Enter") {
6448
+ const selection = window.getSelection();
6449
+ if (selection.rangeCount > 0) {
6450
+ const range = selection.getRangeAt(0);
6451
+ const startContainer = range.startContainer;
6452
+ let currentParagraph = startContainer;
6453
+ while (currentParagraph && currentParagraph.nodeType !== Node.ELEMENT_NODE) {
6454
+ currentParagraph = currentParagraph.parentNode;
6455
+ }
6456
+ while (currentParagraph && !((_b = currentParagraph.classList) == null ? void 0 : _b.contains("halo-paragraph"))) {
6457
+ currentParagraph = currentParagraph.parentNode;
6458
+ }
6459
+ if (!(currentParagraph == null ? void 0 : currentParagraph.querySelector("mdd-topic"))) {
6460
+ return;
6461
+ }
6462
+ if (me2.isBetweenTwoTopics(range)) {
6463
+ event.preventDefault();
6464
+ me2.handleEnterBetweenTopics(range);
6465
+ return;
6466
+ }
6467
+ if (me2.wouldCreateNestedParagraph(range)) {
6468
+ event.preventDefault();
6469
+ me2.handleEnterKeyInParagraphWithTopic(range);
6470
+ return;
6471
+ }
6472
+ if (currentParagraph && currentParagraph.querySelector("mdd-topic")) {
6473
+ event.preventDefault();
6474
+ me2.handleEnterKeyInParagraphWithTopic(range);
6475
+ return;
6476
+ }
6477
+ }
6478
+ }
6479
+ if ((event.metaKey || event.ctrlKey) && event.key === "ArrowLeft") {
6480
+ const selection = window.getSelection();
6481
+ if (selection.rangeCount > 0) {
6482
+ const range = selection.getRangeAt(0);
6483
+ const container = range.startContainer;
6484
+ let currentParagraph = container;
6485
+ while (currentParagraph && currentParagraph.nodeType !== Node.ELEMENT_NODE) {
6486
+ currentParagraph = currentParagraph.parentNode;
6487
+ }
6488
+ while (currentParagraph && !((_c = currentParagraph.classList) == null ? void 0 : _c.contains("halo-paragraph"))) {
6489
+ currentParagraph = currentParagraph.parentNode;
6490
+ }
6491
+ if (currentParagraph) {
6492
+ const firstTopic = currentParagraph.querySelector("mdd-topic");
6493
+ if (firstTopic) {
6494
+ let hasTextBeforeTopic = false;
6495
+ let currentNode = currentParagraph.firstChild;
6496
+ while (currentNode && currentNode !== firstTopic) {
6497
+ if (currentNode.nodeType === Node.TEXT_NODE && currentNode.textContent.trim() !== "") {
6498
+ hasTextBeforeTopic = true;
6499
+ break;
6500
+ }
6501
+ currentNode = currentNode.nextSibling;
6502
+ }
6503
+ if (hasTextBeforeTopic) {
6504
+ if (container === currentParagraph && range.startOffset === 0) {
6505
+ return;
6506
+ }
6507
+ let shouldMoveToStart = false;
6508
+ const offset2 = range.startOffset;
6509
+ if (container.nodeType === Node.TEXT_NODE && container.parentNode === firstTopic) {
6510
+ shouldMoveToStart = true;
6511
+ } else if (container === firstTopic) {
6512
+ shouldMoveToStart = true;
6513
+ } else if (container.nodeType === Node.TEXT_NODE) {
6514
+ let prevSibling = container.previousSibling;
6515
+ while (prevSibling) {
6516
+ if (prevSibling === firstTopic) {
6517
+ shouldMoveToStart = true;
6518
+ break;
6519
+ }
6520
+ prevSibling = prevSibling.previousSibling;
6521
+ }
6522
+ } else if (container === currentParagraph) {
6523
+ const topicRange = document.createRange();
6524
+ topicRange.selectNode(firstTopic);
6525
+ const cursorRange = document.createRange();
6526
+ cursorRange.setStart(container, offset2);
6527
+ cursorRange.collapse(true);
6528
+ if (cursorRange.compareBoundaryPoints(Range.START_TO_END, topicRange) > 0) {
6529
+ shouldMoveToStart = true;
6530
+ }
6531
+ }
6532
+ if (shouldMoveToStart) {
6533
+ event.preventDefault();
6534
+ event.stopPropagation();
6535
+ const newRange = document.createRange();
6536
+ newRange.setStart(currentParagraph, 0);
6537
+ newRange.collapse(true);
6538
+ const selection2 = window.getSelection();
6539
+ selection2.removeAllRanges();
6540
+ selection2.addRange(newRange);
6541
+ return false;
6542
+ }
6543
+ return;
6544
+ }
6545
+ let shouldMoveToTopicStart = false;
6546
+ const offset = range.startOffset;
6547
+ if (container.nodeType === Node.TEXT_NODE && container.parentNode === firstTopic) {
6548
+ shouldMoveToTopicStart = true;
6549
+ } else if (container === firstTopic) {
6550
+ shouldMoveToTopicStart = true;
6551
+ } else if (container.nodeType === Node.TEXT_NODE) {
6552
+ let prevSibling = container.previousSibling;
6553
+ while (prevSibling) {
6554
+ if (prevSibling === firstTopic) {
6555
+ shouldMoveToTopicStart = true;
6556
+ break;
6557
+ }
6558
+ prevSibling = prevSibling.previousSibling;
6559
+ }
6560
+ } else if (container === currentParagraph) {
6561
+ const topicRange = document.createRange();
6562
+ topicRange.selectNode(firstTopic);
6563
+ const cursorRange = document.createRange();
6564
+ cursorRange.setStart(container, offset);
6565
+ cursorRange.collapse(true);
6566
+ if (cursorRange.compareBoundaryPoints(Range.START_TO_END, topicRange) > 0) {
6567
+ shouldMoveToTopicStart = true;
6568
+ }
6569
+ }
6570
+ if (shouldMoveToTopicStart) {
6571
+ event.preventDefault();
6572
+ event.stopPropagation();
6573
+ me2.setCursorBeforeElement(firstTopic);
6574
+ return false;
6575
+ }
6576
+ }
6577
+ }
5628
6578
  }
5629
6579
  }
5630
6580
  });
@@ -5687,7 +6637,6 @@ const _sfc_main = {
5687
6637
  this.insertElement(p);
5688
6638
  };
5689
6639
  window.Squire.prototype.makeHeader = function(content, config = { makeHeader: {} }) {
5690
- console.log(content);
5691
6640
  if (content) {
5692
6641
  const h2 = this.createElement("h2", {
5693
6642
  class: "halo-paragraph-title"
@@ -5713,6 +6662,7 @@ const _sfc_main = {
5713
6662
  window.Squire.empty(block)
5714
6663
  ]);
5715
6664
  output.appendChild(
6665
+ // 段落才能添加标题
5716
6666
  Array.from(block.classList).indexOf("halo-img-content") > -1 ? block : container
5717
6667
  );
5718
6668
  }
@@ -5720,7 +6670,6 @@ const _sfc_main = {
5720
6670
  });
5721
6671
  const selection = window.getSelection();
5722
6672
  const range = document.createRange();
5723
- console.log(container);
5724
6673
  range.setStart(container, 1);
5725
6674
  range.collapse(true);
5726
6675
  selection.removeAllRanges();
@@ -5736,18 +6685,18 @@ const _sfc_main = {
5736
6685
  });
5737
6686
  loading.innerHTML = `
5738
6687
  <img class="img-loading-icon" src="/img/upload-image-loading.png"/>
5739
- <span class="img-loading-tip">\u4E0A\u4F20\u4E2D...</span>
6688
+ <span class="img-loading-tip">上传中...</span>
5740
6689
  `;
5741
6690
  var fail = this.createElement("div", {
5742
6691
  class: "img-fail hide",
5743
6692
  contenteditable: "false"
5744
6693
  });
5745
- fail.innerHTML = "\u4E0A\u4F20\u5931\u8D25<br>\u8BF7\u4E0B\u8F7D\u56FE\u7247\u81F3\u672C\u5730\u540E\u91CD\u65B0\u4E0A\u4F20";
6694
+ fail.innerHTML = "上传失败<br>请下载图片至本地后重新上传";
5746
6695
  var again = this.createElement("button", {
5747
6696
  class: "img-again hide",
5748
6697
  contenteditable: "false"
5749
6698
  });
5750
- again.innerHTML = "\u91CD\u65B0\u4E0A\u4F20";
6699
+ again.innerHTML = "重新上传";
5751
6700
  const isGif = src && src.indexOf(".gif") > -1;
5752
6701
  if (isGif) {
5753
6702
  src = src.replace(".gif", ".gif!nowater");
@@ -5802,7 +6751,7 @@ const _sfc_main = {
5802
6751
  });
5803
6752
  div.innerHTML = `
5804
6753
  <div class="video-progress">
5805
- <div class="label">\u4E0A\u4F20\u4E2D...</div>
6754
+ <div class="label">上传中...</div>
5806
6755
  <div class="box">
5807
6756
  <div class="inner" style="width:20%"></div>
5808
6757
  </div>
@@ -5825,6 +6774,7 @@ const _sfc_main = {
5825
6774
  data: JSON.stringify(data),
5826
6775
  "data-content": data.content || "",
5827
6776
  poster: data.img || ""
6777
+ // 'contenteditable': 'true',
5828
6778
  });
5829
6779
  var delBtn = me2.genIconDom({
5830
6780
  class: "pointer video-delete icon",
@@ -5834,7 +6784,6 @@ const _sfc_main = {
5834
6784
  e.stopPropagation();
5835
6785
  }
5836
6786
  });
5837
- console.log(delBtn);
5838
6787
  const posterBtn = me2.insertVideoBtns(this, video);
5839
6788
  var p = this.createElement(
5840
6789
  "DIV",
@@ -5883,6 +6832,7 @@ const _sfc_main = {
5883
6832
  }
5884
6833
  };
5885
6834
  },
6835
+ // 撤销重做 会把 所有的监听全都移除,所以需要重新绑定
5886
6836
  setListener(dom) {
5887
6837
  const me2 = this;
5888
6838
  const doms = dom ? [dom] : Array.from(this.editorDom.children);
@@ -5893,7 +6843,7 @@ const _sfc_main = {
5893
6843
  p.onclick = function(e) {
5894
6844
  var _a;
5895
6845
  if (area.nodeName === "VIDEO" && ((_a = me2.selectDom) == null ? void 0 : _a.className) === "halo-video-content") {
5896
- me2.setToast("\u4E0D\u652F\u6301\u64AD\u653E");
6846
+ me2.setToast("不支持播放");
5897
6847
  }
5898
6848
  if (e.target.className.includes("desc-input")) {
5899
6849
  return;
@@ -5957,6 +6907,7 @@ const _sfc_main = {
5957
6907
  };
5958
6908
  return del;
5959
6909
  },
6910
+ // 转换数据,返回给业务
5960
6911
  getEditorData() {
5961
6912
  const me2 = this;
5962
6913
  const children = Array.from(me2.editorDom.children);
@@ -6014,9 +6965,11 @@ const _sfc_main = {
6014
6965
  videoIds
6015
6966
  };
6016
6967
  },
6968
+ // 是否是摩托范的图片
6017
6969
  isHaloImage(url = "") {
6018
6970
  return url.indexOf("jddmoto") > -1 || url.indexOf("58moto") > -1 || url.indexOf("emotofine") > -1 || url.indexOf("dronefine") > -1;
6019
6971
  },
6972
+ // 获取待上传图片列表
6020
6973
  updateUploads() {
6021
6974
  const me2 = this;
6022
6975
  setTimeout(() => {
@@ -6063,8 +7016,8 @@ const _sfc_main = {
6063
7016
  const currentImg = me2.uploadStore[key];
6064
7017
  const imageUrl = key.split("|")[1] || "";
6065
7018
  if (!currentImg) {
6066
- console.log("\u56FE\u7247\u4E0D\u5B58\u5728", key);
6067
- return Promise.reject("\u56FE\u7247\u4E0D\u5B58\u5728");
7019
+ console.log("图片不存在", key);
7020
+ return Promise.reject("图片不存在");
6068
7021
  }
6069
7022
  const parent = currentImg.parentNode || "";
6070
7023
  const uploadFailHandler = (currentImg2) => {
@@ -6108,6 +7061,7 @@ const _sfc_main = {
6108
7061
  parent && uploadFailHandler(currentImg);
6109
7062
  });
6110
7063
  },
7064
+ // 更新上传的图片
6111
7065
  updateImage(img, currentImg = {}) {
6112
7066
  const data = JSON.parse(currentImg.getAttribute("data") || "{}");
6113
7067
  data.img = img;
@@ -6130,6 +7084,7 @@ const _sfc_main = {
6130
7084
  parent.appendChild(arr[2]);
6131
7085
  }
6132
7086
  },
7087
+ // 获取ctrl + v 后内容
6133
7088
  getSticker(type, handler) {
6134
7089
  this.setSticker(type.fragment.children);
6135
7090
  },
@@ -6147,6 +7102,7 @@ const _sfc_main = {
6147
7102
  });
6148
7103
  this.updateData(true);
6149
7104
  },
7105
+ // 粘贴
6150
7106
  setSticker(data) {
6151
7107
  const me2 = this;
6152
7108
  data = Array.from(data);
@@ -6185,6 +7141,7 @@ const _sfc_main = {
6185
7141
  const me2 = this;
6186
7142
  me2.updateData();
6187
7143
  },
7144
+ // 监测 添加、撤回、恢复、删除
6188
7145
  setBack(e, type) {
6189
7146
  const me2 = this;
6190
7147
  me2.refreshImg();
@@ -6217,6 +7174,7 @@ const _sfc_main = {
6217
7174
  }
6218
7175
  });
6219
7176
  },
7177
+ // 设置scoll
6220
7178
  sticky() {
6221
7179
  const me2 = this;
6222
7180
  me2.$nextTick(function() {
@@ -6236,6 +7194,8 @@ const _sfc_main = {
6236
7194
  document.addEventListener("scroll", onScroll);
6237
7195
  });
6238
7196
  },
7197
+ // ==========toolbox==========
7198
+ // 撤回、恢复、段落标题
6239
7199
  setContent(e, obj) {
6240
7200
  const me2 = this;
6241
7201
  const id = e.target.id || e.target.dataset.editorId;
@@ -6277,10 +7237,11 @@ const _sfc_main = {
6277
7237
  this.fontInfo = this.editor.getFontInfo();
6278
7238
  this.updateData(true);
6279
7239
  },
7240
+ // 增加link
6280
7241
  addLink(type) {
6281
7242
  const me2 = this;
6282
- me2.linkTitleName = type === "link" ? "\u6DFB\u52A0\u94FE\u63A5" : "\u6DFB\u52A0\u5BFC\u5165\u94FE\u63A5\u5730\u5740";
6283
- me2.linkPlaceholder = type === "link" ? "\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740" : "\u4EC5\u652F\u6301\u8F93\u5165\u5FAE\u4FE1\u94FE\u63A5";
7243
+ me2.linkTitleName = type === "link" ? "添加链接" : "添加导入链接地址";
7244
+ me2.linkPlaceholder = type === "link" ? "请输入链接地址" : "仅支持输入微信链接";
6284
7245
  me2.viewStatus = true;
6285
7246
  me2.linkStatus = true;
6286
7247
  },
@@ -6288,29 +7249,31 @@ const _sfc_main = {
6288
7249
  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.,;?'&%$#=~_-]+))*$/;
6289
7250
  return objExp.test(url);
6290
7251
  },
7252
+ // 确认增加link
6291
7253
  confirmLink() {
6292
7254
  const me2 = this;
6293
7255
  if (!me2.linkContent) {
6294
- return ElMessage.error("\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740\uFF01");
7256
+ return ElMessage.error("请输入链接地址!");
6295
7257
  }
6296
- if (me2.linkTitleName === "\u6DFB\u52A0\u5BFC\u5165\u94FE\u63A5\u5730\u5740" || this.visibleCollectArticle) {
7258
+ if (me2.linkTitleName === "添加导入链接地址" || this.visibleCollectArticle) {
6297
7259
  this.visibleCollectArticle = false;
6298
7260
  return me2.importLinkData();
6299
7261
  }
6300
7262
  if (!this.validUrl(me2.linkContent)) {
6301
- return me2.setToast("URL\u65E0\u6548");
7263
+ return me2.setToast("URL无效");
6302
7264
  }
6303
7265
  if (!me2.isHaloImage(me2.linkContent)) {
6304
- return me2.setToast("\u8BF7\u8F93\u5165\u6469\u6258\u8303\u5185\u90E8\u7F51\u5740");
7266
+ return me2.setToast("请输入摩托范内部网址");
6305
7267
  }
6306
7268
  me2.editor["insertLink"](me2.linkContent);
6307
7269
  me2.linkContent = "";
6308
7270
  me2.closeDialog();
6309
7271
  },
7272
+ // 增加link导入数据
6310
7273
  importLinkData() {
6311
7274
  const me2 = this;
6312
7275
  if (me2.loading) {
6313
- return ElMessage("\u6B63\u5728\u83B7\u53D6\u4FE1\u606F\uFF0C\u8BF7\u7A0D\u540E...");
7276
+ return ElMessage("正在获取信息,请稍后...");
6314
7277
  }
6315
7278
  me2.loading = true;
6316
7279
  const params = {
@@ -6332,38 +7295,444 @@ const _sfc_main = {
6332
7295
  me2.linkContent = "";
6333
7296
  return;
6334
7297
  } else {
6335
- me2.setToast("\u5BFC\u5165\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
7298
+ me2.setToast("导入失败,请重试");
6336
7299
  }
6337
7300
  }).catch((err) => {
6338
7301
  console.log(err.message);
6339
- me2.setToast("\u5BFC\u5165\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5");
7302
+ me2.setToast("导入异常,请重试");
6340
7303
  }).finally((_) => {
6341
7304
  me2.loading = false;
6342
7305
  });
6343
7306
  },
7307
+ // 打开 图片、视频、一键导入 弹框
6344
7308
  openDialog(name) {
6345
7309
  const me2 = this;
6346
- me2.viewName = name === "img" ? "\u6DFB\u52A0\u56FE\u7247" : "\u6DFB\u52A0\u89C6\u9891";
6347
- me2.viewButton = name === "img" ? "\u9009\u62E9\u56FE\u7247" : "\u9009\u62E9\u89C6\u9891";
6348
- 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)";
7310
+ me2.viewName = name === "img" ? "添加图片" : "添加视频";
7311
+ me2.viewButton = name === "img" ? "选择图片" : "选择视频";
7312
+ me2.viewTip = name === "img" ? "" : "为了获得更高的推荐和点击量,建议上传720p(1280*720),大小不超过500MB(视频上传需要时间,请耐心等待)";
6349
7313
  me2.viewStatus = true;
6350
7314
  },
7315
+ // 关闭弹框
6351
7316
  closeDialog() {
6352
7317
  this.viewStatus = false;
6353
7318
  this.linkStatus = false;
6354
7319
  this.linkContent = "";
6355
7320
  },
7321
+ // ==========toolbox end==========
7322
+ // 弹框提示
6356
7323
  setToast(content) {
6357
7324
  ElMessage.error(content);
6358
7325
  },
6359
7326
  setMessageBoxNoCancel(content) {
6360
7327
  ElMessageBox.confirm(content, "", {
6361
- confirmButtonText: "\u786E\u5B9A",
6362
- cancelButtonText: "\u53D6\u6D88",
7328
+ confirmButtonText: "确定",
7329
+ cancelButtonText: "取消",
6363
7330
  type: "warning"
6364
7331
  }).then(() => {
6365
7332
  }).catch(() => {
6366
7333
  });
7334
+ },
7335
+ // 检查是否会创建嵌套的halo-paragraph
7336
+ wouldCreateNestedParagraph(range) {
7337
+ let container = range.startContainer;
7338
+ while (container && container !== this.editorDom) {
7339
+ if (container.nodeType === Node.ELEMENT_NODE && container.classList && container.classList.contains("halo-paragraph")) {
7340
+ return true;
7341
+ }
7342
+ container = container.parentNode;
7343
+ }
7344
+ return false;
7345
+ },
7346
+ // 检查光标是否在两个连续的mdd-topic之间
7347
+ isBetweenTwoTopics(range) {
7348
+ const container = range.startContainer;
7349
+ const offset = range.startOffset;
7350
+ if (container.nodeType === Node.ELEMENT_NODE) {
7351
+ const prevElement = container.childNodes[offset - 1];
7352
+ const nextElement = container.childNodes[offset];
7353
+ return prevElement && prevElement.tagName === "MDD-TOPIC" && (nextElement && nextElement.tagName === "MDD-TOPIC");
7354
+ }
7355
+ if (container.nodeType === Node.TEXT_NODE && container.textContent.trim() === "") {
7356
+ const prevSibling = container.previousSibling;
7357
+ const nextSibling = container.nextSibling;
7358
+ return prevSibling && prevSibling.tagName === "MDD-TOPIC" && (nextSibling && nextSibling.tagName === "MDD-TOPIC");
7359
+ }
7360
+ return false;
7361
+ },
7362
+ // 处理两个话题之间的回车或话题前面的回车
7363
+ handleEnterBetweenTopics(range) {
7364
+ var _a;
7365
+ const me2 = this;
7366
+ let currentParagraph = range.startContainer;
7367
+ while (currentParagraph && currentParagraph.nodeType !== Node.ELEMENT_NODE) {
7368
+ currentParagraph = currentParagraph.parentNode;
7369
+ }
7370
+ while (currentParagraph && !((_a = currentParagraph.classList) == null ? void 0 : _a.contains("halo-paragraph"))) {
7371
+ currentParagraph = currentParagraph.parentNode;
7372
+ }
7373
+ if (!currentParagraph)
7374
+ return;
7375
+ const newParagraph = document.createElement("p");
7376
+ newParagraph.className = "halo-paragraph";
7377
+ const afterContent = me2.extractContentAfterCursorPrecise(range, currentParagraph);
7378
+ if (afterContent && afterContent.childNodes.length > 0) {
7379
+ while (afterContent.firstChild) {
7380
+ newParagraph.appendChild(afterContent.firstChild);
7381
+ }
7382
+ } else {
7383
+ newParagraph.innerHTML = "<br>";
7384
+ }
7385
+ currentParagraph.parentNode.insertBefore(newParagraph, currentParagraph.nextSibling);
7386
+ const newRange = document.createRange();
7387
+ if (newParagraph.firstChild && newParagraph.firstChild.nodeType === Node.TEXT_NODE) {
7388
+ newRange.setStart(newParagraph.firstChild, 0);
7389
+ } else if (newParagraph.firstChild && newParagraph.firstChild.nodeType === Node.ELEMENT_NODE) {
7390
+ newRange.setStart(newParagraph, 0);
7391
+ } else {
7392
+ newRange.setStart(newParagraph, 0);
7393
+ }
7394
+ newRange.collapse(true);
7395
+ const selection = window.getSelection();
7396
+ selection.removeAllRanges();
7397
+ selection.addRange(newRange);
7398
+ me2.updateData(true);
7399
+ },
7400
+ // 更精确地提取光标后的内容(专门用于话题分割)
7401
+ extractContentAfterCursorPrecise(range, paragraph) {
7402
+ const fragment = document.createDocumentFragment();
7403
+ const container = range.startContainer;
7404
+ const offset = range.startOffset;
7405
+ if (container.nodeType === Node.ELEMENT_NODE) {
7406
+ const childNodes = Array.from(container.childNodes);
7407
+ for (let i = offset; i < childNodes.length; i++) {
7408
+ fragment.appendChild(childNodes[i]);
7409
+ }
7410
+ } else if (container.nodeType === Node.TEXT_NODE) {
7411
+ if (offset < container.textContent.length) {
7412
+ const afterText = container.textContent.slice(offset);
7413
+ container.textContent = container.textContent.slice(0, offset);
7414
+ const textNode = document.createTextNode(afterText);
7415
+ fragment.appendChild(textNode);
7416
+ }
7417
+ let nextSibling = container.nextSibling;
7418
+ while (nextSibling) {
7419
+ const nodeToMove = nextSibling;
7420
+ nextSibling = nextSibling.nextSibling;
7421
+ fragment.appendChild(nodeToMove);
7422
+ }
7423
+ }
7424
+ return fragment;
7425
+ },
7426
+ // 处理包含话题的段落中的回车键
7427
+ handleEnterKeyInParagraphWithTopic(range) {
7428
+ var _a;
7429
+ const me2 = this;
7430
+ let currentParagraph = range.startContainer;
7431
+ while (currentParagraph && currentParagraph.nodeType !== Node.ELEMENT_NODE) {
7432
+ currentParagraph = currentParagraph.parentNode;
7433
+ }
7434
+ while (currentParagraph && !((_a = currentParagraph.classList) == null ? void 0 : _a.contains("halo-paragraph"))) {
7435
+ currentParagraph = currentParagraph.parentNode;
7436
+ }
7437
+ if (!currentParagraph)
7438
+ return;
7439
+ const newParagraph = document.createElement("p");
7440
+ newParagraph.className = "halo-paragraph";
7441
+ const isAtTopicStart = me2.isCursorBeforeFirstTopic(range, currentParagraph);
7442
+ const isAtEnd = me2.isCursorAtEndOfParagraph(range, currentParagraph);
7443
+ if (isAtTopicStart) {
7444
+ const afterContent = me2.extractContentAfterCursor(range, currentParagraph);
7445
+ if (afterContent && afterContent.childNodes.length > 0) {
7446
+ while (afterContent.firstChild) {
7447
+ newParagraph.appendChild(afterContent.firstChild);
7448
+ }
7449
+ } else {
7450
+ newParagraph.innerHTML = "<br>";
7451
+ }
7452
+ if (currentParagraph.innerHTML.trim() === "" || currentParagraph.childNodes.length === 0) {
7453
+ currentParagraph.innerHTML = "<br>";
7454
+ }
7455
+ currentParagraph.parentNode.insertBefore(newParagraph, currentParagraph.nextSibling);
7456
+ } else if (isAtEnd) {
7457
+ newParagraph.innerHTML = "<br>";
7458
+ currentParagraph.parentNode.insertBefore(newParagraph, currentParagraph.nextSibling);
7459
+ } else {
7460
+ const afterContent = me2.extractContentAfterCursor(range, currentParagraph);
7461
+ if (afterContent && afterContent.childNodes.length > 0) {
7462
+ let hasValidContent = false;
7463
+ for (let i = 0; i < afterContent.childNodes.length; i++) {
7464
+ const node = afterContent.childNodes[i];
7465
+ if (node.nodeType === Node.TEXT_NODE) {
7466
+ if (node.textContent.trim() !== "") {
7467
+ hasValidContent = true;
7468
+ break;
7469
+ }
7470
+ } else {
7471
+ hasValidContent = true;
7472
+ break;
7473
+ }
7474
+ }
7475
+ if (hasValidContent) {
7476
+ while (afterContent.firstChild) {
7477
+ newParagraph.appendChild(afterContent.firstChild);
7478
+ }
7479
+ } else {
7480
+ newParagraph.innerHTML = "<br>";
7481
+ }
7482
+ } else {
7483
+ newParagraph.innerHTML = "<br>";
7484
+ }
7485
+ currentParagraph.parentNode.insertBefore(newParagraph, currentParagraph.nextSibling);
7486
+ }
7487
+ const newRange = document.createRange();
7488
+ if (newParagraph.firstChild && newParagraph.firstChild.nodeType === Node.TEXT_NODE) {
7489
+ newRange.setStart(newParagraph.firstChild, 0);
7490
+ } else if (newParagraph.firstChild) {
7491
+ newRange.setStart(newParagraph, 0);
7492
+ } else {
7493
+ newRange.setStart(newParagraph, 0);
7494
+ }
7495
+ newRange.collapse(true);
7496
+ const selection = window.getSelection();
7497
+ selection.removeAllRanges();
7498
+ selection.addRange(newRange);
7499
+ me2.updateData(true);
7500
+ },
7501
+ // 检查光标是否在第一个话题前面
7502
+ isCursorBeforeFirstTopic(range, paragraph) {
7503
+ const container = range.startContainer;
7504
+ const offset = range.startOffset;
7505
+ const firstTopic = paragraph.querySelector("mdd-topic");
7506
+ if (!firstTopic) {
7507
+ return false;
7508
+ }
7509
+ if (container === paragraph && offset === 0) {
7510
+ return true;
7511
+ }
7512
+ if (container === paragraph && offset > 0 && offset <= paragraph.childNodes.length) {
7513
+ if (offset < paragraph.childNodes.length) {
7514
+ const nodeAtOffset = paragraph.childNodes[offset];
7515
+ if (nodeAtOffset === firstTopic) {
7516
+ return true;
7517
+ }
7518
+ }
7519
+ let nextNonEmptyNode = null;
7520
+ for (let i = offset; i < paragraph.childNodes.length; i++) {
7521
+ const node = paragraph.childNodes[i];
7522
+ if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "MDD-TOPIC") {
7523
+ nextNonEmptyNode = node;
7524
+ break;
7525
+ } else if (node.nodeType === Node.TEXT_NODE && node.textContent.trim() !== "") {
7526
+ break;
7527
+ }
7528
+ }
7529
+ if (nextNonEmptyNode === firstTopic) {
7530
+ return true;
7531
+ }
7532
+ }
7533
+ try {
7534
+ const topicRange = document.createRange();
7535
+ topicRange.setStartBefore(firstTopic);
7536
+ const comparison = topicRange.comparePoint(container, offset);
7537
+ if (comparison < 0) {
7538
+ return true;
7539
+ }
7540
+ } catch (e) {
7541
+ if (container.nodeType === Node.TEXT_NODE) {
7542
+ const tempRange = document.createRange();
7543
+ tempRange.setStart(container, offset);
7544
+ tempRange.collapse(true);
7545
+ const topicRange = document.createRange();
7546
+ topicRange.setStartBefore(firstTopic);
7547
+ if (tempRange.compareBoundaryPoints(Range.START_TO_START, topicRange) < 0) {
7548
+ return true;
7549
+ }
7550
+ }
7551
+ if (container === paragraph) {
7552
+ const testRange = document.createRange();
7553
+ testRange.setStart(paragraph, 0);
7554
+ testRange.setEnd(paragraph, offset);
7555
+ const containsTopic = testRange.intersectsNode(firstTopic);
7556
+ if (!containsTopic) {
7557
+ return true;
7558
+ }
7559
+ }
7560
+ }
7561
+ return false;
7562
+ },
7563
+ // 获取不包含mdd-topic内部文本的段落文本
7564
+ getParagraphTextExcludingTopics(paragraph, range) {
7565
+ let textContent = "";
7566
+ let cursorPosition = 0;
7567
+ let foundCursor = false;
7568
+ const walker = document.createTreeWalker(
7569
+ paragraph,
7570
+ NodeFilter.SHOW_ALL,
7571
+ {
7572
+ acceptNode: function(node2) {
7573
+ if (node2.nodeType === Node.ELEMENT_NODE && node2.tagName === "MDD-TOPIC") {
7574
+ return NodeFilter.FILTER_REJECT;
7575
+ }
7576
+ return NodeFilter.FILTER_ACCEPT;
7577
+ }
7578
+ },
7579
+ false
7580
+ );
7581
+ let node;
7582
+ while (node = walker.nextNode()) {
7583
+ if (node.nodeType === Node.TEXT_NODE) {
7584
+ const nodeText = node.textContent;
7585
+ if (!foundCursor && node === range.startContainer) {
7586
+ cursorPosition = textContent.length + range.startOffset;
7587
+ foundCursor = true;
7588
+ }
7589
+ textContent += nodeText;
7590
+ }
7591
+ }
7592
+ return { textContent, cursorPosition };
7593
+ },
7594
+ // 检查光标是否在段落开头
7595
+ isCursorAtStartOfParagraph(range, paragraph) {
7596
+ const { cursorPosition } = this.getParagraphTextExcludingTopics(paragraph, range);
7597
+ return cursorPosition === 0;
7598
+ },
7599
+ // 检查光标是否在段落末尾
7600
+ isCursorAtEndOfParagraph(range, paragraph) {
7601
+ const walker = document.createTreeWalker(
7602
+ paragraph,
7603
+ NodeFilter.SHOW_TEXT,
7604
+ {
7605
+ acceptNode: function(node2) {
7606
+ let parent = node2.parentNode;
7607
+ while (parent && parent !== paragraph) {
7608
+ if (parent.tagName === "MDD-TOPIC") {
7609
+ return NodeFilter.FILTER_REJECT;
7610
+ }
7611
+ parent = parent.parentNode;
7612
+ }
7613
+ return NodeFilter.FILTER_ACCEPT;
7614
+ }
7615
+ },
7616
+ false
7617
+ );
7618
+ let totalLength = 0;
7619
+ let node;
7620
+ while (node = walker.nextNode()) {
7621
+ totalLength += node.textContent.length;
7622
+ }
7623
+ const { cursorPosition } = this.getParagraphTextExcludingTopics(paragraph, range);
7624
+ return cursorPosition >= totalLength;
7625
+ },
7626
+ // 获取当前段落
7627
+ getCurrentParagraph(range) {
7628
+ let container = range.startContainer;
7629
+ while (container && container !== this.editorDom) {
7630
+ if (container.nodeType === Node.ELEMENT_NODE && container.classList && container.classList.contains("halo-paragraph")) {
7631
+ return container;
7632
+ }
7633
+ container = container.parentNode;
7634
+ }
7635
+ return null;
7636
+ },
7637
+ // 提取光标后的内容
7638
+ extractContentAfterCursor(range, paragraph) {
7639
+ const fragment = document.createDocumentFragment();
7640
+ const container = range.startContainer;
7641
+ const offset = range.startOffset;
7642
+ let topicSpaceNode = null;
7643
+ if (container.nodeType === Node.TEXT_NODE && container.textContent === " " && container.previousSibling && container.previousSibling.tagName === "MDD-TOPIC") {
7644
+ topicSpaceNode = container;
7645
+ }
7646
+ const extractRange = document.createRange();
7647
+ let startNode = null;
7648
+ let hasContentToExtract = false;
7649
+ if (topicSpaceNode) {
7650
+ if (topicSpaceNode.nextSibling) {
7651
+ startNode = topicSpaceNode.nextSibling;
7652
+ hasContentToExtract = true;
7653
+ }
7654
+ } else if (container.nodeType === Node.TEXT_NODE) {
7655
+ if (container.textContent === "" && offset === 0) {
7656
+ if (container.nextSibling) {
7657
+ startNode = container.nextSibling;
7658
+ hasContentToExtract = true;
7659
+ }
7660
+ } else if (offset < container.textContent.length) {
7661
+ const afterText = container.textContent.slice(offset);
7662
+ container.textContent = container.textContent.slice(0, offset);
7663
+ if (afterText.trim()) {
7664
+ const newTextNode = document.createTextNode(afterText);
7665
+ container.parentNode.insertBefore(newTextNode, container.nextSibling);
7666
+ startNode = newTextNode;
7667
+ hasContentToExtract = true;
7668
+ } else if (container.nextSibling) {
7669
+ startNode = container.nextSibling;
7670
+ hasContentToExtract = true;
7671
+ }
7672
+ } else {
7673
+ if (container.nextSibling) {
7674
+ startNode = container.nextSibling;
7675
+ hasContentToExtract = true;
7676
+ }
7677
+ }
7678
+ } else if (container.nodeType === Node.ELEMENT_NODE) {
7679
+ if (offset < container.childNodes.length) {
7680
+ startNode = container.childNodes[offset];
7681
+ hasContentToExtract = true;
7682
+ } else if (offset === 0 && container === paragraph) {
7683
+ if (paragraph.firstChild) {
7684
+ startNode = paragraph.firstChild;
7685
+ hasContentToExtract = true;
7686
+ }
7687
+ }
7688
+ }
7689
+ if (!hasContentToExtract || !startNode) {
7690
+ return fragment;
7691
+ }
7692
+ if (!paragraph.contains(startNode)) {
7693
+ return fragment;
7694
+ }
7695
+ try {
7696
+ extractRange.setStartBefore(startNode);
7697
+ let lastNode = paragraph.lastChild;
7698
+ while (lastNode && lastNode.nodeType === Node.TEXT_NODE && lastNode.textContent === "" && // 只跳过完全空的文本节点
7699
+ lastNode !== startNode) {
7700
+ lastNode = lastNode.previousSibling;
7701
+ }
7702
+ if (lastNode) {
7703
+ extractRange.setEndAfter(lastNode);
7704
+ } else {
7705
+ extractRange.setEnd(paragraph, paragraph.childNodes.length);
7706
+ }
7707
+ const extractedContent = extractRange.extractContents();
7708
+ fragment.appendChild(extractedContent);
7709
+ } catch (e) {
7710
+ let currentNode = startNode;
7711
+ while (currentNode && currentNode.parentNode === paragraph) {
7712
+ const nextNode = currentNode.nextSibling;
7713
+ fragment.appendChild(currentNode);
7714
+ currentNode = nextNode;
7715
+ }
7716
+ }
7717
+ return fragment;
7718
+ },
7719
+ // 统一的光标设置方法 - 设置光标到元素后面
7720
+ setCursorAfterElement(element) {
7721
+ const newRange = document.createRange();
7722
+ newRange.setStartAfter(element);
7723
+ newRange.collapse(true);
7724
+ const selection = window.getSelection();
7725
+ selection.removeAllRanges();
7726
+ selection.addRange(newRange);
7727
+ },
7728
+ // 统一的光标设置方法 - 设置光标到元素前面
7729
+ setCursorBeforeElement(element) {
7730
+ const newRange = document.createRange();
7731
+ newRange.setStartBefore(element);
7732
+ newRange.collapse(true);
7733
+ const selection = window.getSelection();
7734
+ selection.removeAllRanges();
7735
+ selection.addRange(newRange);
6367
7736
  }
6368
7737
  },
6369
7738
  beforeRouteLeave(to, from, next) {
@@ -6386,11 +7755,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
6386
7755
  const _component_ImgUpload = resolveComponent("ImgUpload");
6387
7756
  const _component_VideoUpload = resolveComponent("VideoUpload");
6388
7757
  const _component_CollectArticle = resolveComponent("CollectArticle");
7758
+ const _component_TopicManager = resolveComponent("TopicManager");
6389
7759
  return openBlock(), createElementBlock("div", _hoisted_1, [
6390
7760
  withDirectives(createElementVNode("div", {
6391
7761
  style: normalizeStyle({ textAlign: $options.align }),
6392
7762
  class: "placeholder"
6393
- }, " \u8BF7\u8F93\u5165\u6B63\u6587 ", 4), [
7763
+ }, toDisplayString($props.placeholder || "请输入正文"), 5), [
6394
7764
  [vShow, !$options.isInputing && !$data.titleCount && !$data.hasArticleCard]
6395
7765
  ]),
6396
7766
  $data.overLine ? (openBlock(), createElementBlock("div", {
@@ -6415,26 +7785,26 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
6415
7785
  createVNode(_component_el_form, { model: $data.linkForm }, {
6416
7786
  default: withCtx(() => [
6417
7787
  createVNode(_component_el_form_item, {
6418
- label: "\u6DFB\u52A0\u94FE\u63A5",
7788
+ label: "添加链接",
6419
7789
  class: "link-title"
6420
7790
  }, {
6421
7791
  default: withCtx(() => [
6422
7792
  createVNode(_component_el_input, {
6423
7793
  modelValue: $data.linkForm.linkAddress,
6424
7794
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.linkForm.linkAddress = $event),
6425
- placeholder: "\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"
7795
+ placeholder: "请输入链接地址"
6426
7796
  }, null, 8, ["modelValue"])
6427
7797
  ]),
6428
7798
  _: 1
6429
7799
  }),
6430
- createVNode(_component_el_form_item, { label: "\u94FE\u63A5\u6587\u6848" }, {
7800
+ createVNode(_component_el_form_item, { label: "链接文案" }, {
6431
7801
  default: withCtx(() => [
6432
7802
  createVNode(_component_el_input, {
6433
7803
  modelValue: $data.linkForm.linkWriting,
6434
7804
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.linkForm.linkWriting = $event),
6435
7805
  type: "textarea",
6436
7806
  autosize: "",
6437
- placeholder: "\u8BF7\u8F93\u5165\u94FE\u63A5\u6587\u6848"
7807
+ placeholder: "请输入链接文案"
6438
7808
  }, null, 8, ["modelValue"])
6439
7809
  ]),
6440
7810
  _: 1
@@ -6447,18 +7817,18 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
6447
7817
  createVNode(_component_el_button, {
6448
7818
  onClick: _cache[3] || (_cache[3] = ($event) => $data.viewLinkDialog = false)
6449
7819
  }, {
6450
- default: withCtx(() => [
6451
- createTextVNode("\u53D6 \u6D88")
6452
- ]),
7820
+ default: withCtx(() => _cache[14] || (_cache[14] = [
7821
+ createTextVNode(" ")
7822
+ ])),
6453
7823
  _: 1
6454
7824
  }),
6455
7825
  createVNode(_component_el_button, {
6456
7826
  type: "primary",
6457
7827
  onClick: $options.insertLink
6458
7828
  }, {
6459
- default: withCtx(() => [
6460
- createTextVNode("\u786E \u5B9A")
6461
- ]),
7829
+ default: withCtx(() => _cache[15] || (_cache[15] = [
7830
+ createTextVNode(" ")
7831
+ ])),
6462
7832
  _: 1
6463
7833
  }, 8, ["onClick"])
6464
7834
  ])
@@ -6516,7 +7886,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
6516
7886
  class: "replace-poster hide",
6517
7887
  accept: "image/*",
6518
7888
  onChange: _cache[13] || (_cache[13] = (...args) => $options.replacePoster && $options.replacePoster(...args))
6519
- }, null, 32)
7889
+ }, null, 32),
7890
+ createVNode(_component_TopicManager, {
7891
+ ref: "topicManager",
7892
+ "editor-dom": $data.editorDom,
7893
+ request: $props.request,
7894
+ onTopicInserted: $options.onTopicInserted,
7895
+ onUpdateTopicPosition: $options.updateTopicPosition
7896
+ }, null, 8, ["editor-dom", "request", "onTopicInserted", "onUpdateTopicPosition"])
6520
7897
  ]);
6521
7898
  }
6522
7899
  const Editor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);