@haluo/biz 2.0.39 → 2.0.40

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