@haluo/biz 2.0.50 → 2.0.51-beta.2
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/README.md +41 -39
- package/dist/haluo-biz.js +870 -622
- package/dist/haluo-biz.umd.cjs +893 -634
- package/dist/{squire-raw.85a430e7.js → squire-raw-1aaeff0b.js} +18 -4
- package/dist/style.css +28 -28
- package/package.json +48 -48
package/dist/haluo-biz.umd.cjs
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("element-plus"), require("vue"), require("@element-plus/icons-vue"), require("@haluo/util"), require("vuedraggable")) : typeof define === "function" && define.amd ? define(["exports", "element-plus", "vue", "@element-plus/icons-vue", "@haluo/util", "vuedraggable"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["haluo-biz"] = {}, global2["element-plus"], global2.Vue, global2["@element-plus/icons-vue"], global2.hUtil, global2.vuedraggable));
|
|
3
3
|
})(this, function(exports2, elementPlus, vue, iconsVue, util, draggable) {
|
|
4
4
|
"use strict";
|
|
5
|
-
const _interopDefaultLegacy = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
6
|
-
const util__default = /* @__PURE__ */ _interopDefaultLegacy(util);
|
|
7
|
-
const draggable__default = /* @__PURE__ */ _interopDefaultLegacy(draggable);
|
|
8
5
|
const __vite_glob_0_1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLBAMAAADKYGfZAAAAG1BMVEUAAAAAAABHcExSUlLz8/P////IyMifn5/k5OQx49C2AAAACXRSTlMzZgB/7//CpN1ci7LLAAABHUlEQVR4AY3TgUbAUBjF8e0NmiiAY28QIYCkXqB9GUBIT7AHCHvvss3l73Y4g3vx87ft3m8Yp+C5GZSxecyYMuZzZMqYz5EpYz5Hpoz5HJkS1uceP67N7TeYyF7r59xs9XmxlgNbj/W+6hmMua86c9vfCsbcXdV6xpYHsj53xF4msj7XYmB97oqB9bmlxcC6XIuBdbkWI2Nur3qfyFouqc0K3g05/6XI+f+GnD8F5NyZMmdvCHP2vjFX7vYyt7tZYO7p7f/JYs7NKXMZk2fMZUyeMZcxecZcxuQZcxmTZ8xlTJ4xlzF5xlzG5BlzGZNnzGVMnjGXMXnGXMbkGXMZk2fMZUyeMZcxecZcxuQZcxmTZ8xlTJ4xlzFlbB5+AVncQI3j46OFAAAAAElFTkSuQmCC";
|
|
9
6
|
const __vite_glob_0_2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkU2MThGQUEzOUM3QTExRThBMkI0RDI5RUQ4MzE1NUMwIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkU2MThGQUE0OUM3QTExRThBMkI0RDI5RUQ4MzE1NUMwIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RTYxOEZBQTE5QzdBMTFFOEEyQjREMjlFRDgzMTU1QzAiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RTYxOEZBQTI5QzdBMTFFOEEyQjREMjlFRDgzMTU1QzAiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6cZvOcAAABiklEQVR42uyXu0rEQBRAs3GxtlHEIqDFioWIkA+wUBCsFKwUGxdRrHSx8Ed8gIWlIKyICKIigu0uYmFjIbIfIFqJyhrPwC3CEIvNZEKEGThMHpAcJvcxKUVR5BV5+F7BhxN0gk7QCTpBSyMMw37oLqQgYgNMt1A3lfQtyd3AMMyYSvoW5dTcMpX0LcrNw5SpZCntdouXxU974U6Te5V7FbiCAM5hrtFofOW9gj3wJnILsAhdcu8JLuR4GiY6eXDZUKxPVu8RNuAZdmFWVnMd9mEF2lBl9S7zElQxdy2fchOacCRy6tpBgtxhLkkSS4gR+IQXTW4SVk3lUgkmZKuKuT1N7htGZU4t13EW/yG3o8n9wAOMq8xF7tQkyMuGde4dPrTPOgbLcC94uQgytkVOFd61WJ1bgkHYisXckGR2rruZmhTaQApvRa63NbkqnGXVoTqNQdWq6tK6WtLKallka2atLkEysCWXuhdrktbkTDcLSvIYTmzJGQm6nyYn6ASdoBN0gv9D8FeAAQD7bZlccR+RLgAAAABJRU5ErkJggg==";
|
|
10
7
|
const __vite_glob_0_3 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAA8CAYAAAAOhRhuAAAAAXNSR0IArs4c6QAAALZJREFUaEPtlLENwCAMBGEilmAOhmNMmkTp0h1BLqzoIlGdYqzzm7rWukqir9oQTENDFFcNaYgMEDdDGiIDxM2QhsgAcTMUYmjOSXWOeGutPOf9bY2s9350If00xijP+dwQFY7kW4YiL6RaNqQhMkB8K0Pp1j7dw0iaI/nWyCIvpFo29E9D6bYs3TtEc4/kbhnZ1NA/DaVb+3QPI809krtlZFNDGiIDxM2QhsgAcTOkITJAPF2GbhF2A9gQfAOGAAAAAElFTkSuQmCC";
|
|
@@ -113,7 +110,6 @@
|
|
|
113
110
|
}
|
|
114
111
|
const D = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, R = "__vueuse_ssr_handlers__";
|
|
115
112
|
D[R] = D[R] || {};
|
|
116
|
-
D[R];
|
|
117
113
|
var q;
|
|
118
114
|
(function(e) {
|
|
119
115
|
e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
|
|
@@ -155,7 +151,7 @@
|
|
|
155
151
|
ke({
|
|
156
152
|
linear: me
|
|
157
153
|
}, he);
|
|
158
|
-
const J = (e) => (vue.pushScopeId("data-v-b46fc003"), e = e(), vue.popScopeId(), e), we = { class: "hd" }, Oe = { class: "bd" }, Ie = /* @__PURE__ */ J(() => /* @__PURE__ */ vue.createElementVNode("h3", null, "
|
|
154
|
+
const J = (e) => (vue.pushScopeId("data-v-b46fc003"), e = e(), vue.popScopeId(), e), we = { class: "hd" }, Oe = { class: "bd" }, Ie = /* @__PURE__ */ J(() => /* @__PURE__ */ vue.createElementVNode("h3", null, "主题颜色", -1)), Ee = { class: "tColor" }, Pe = ["onMouseover", "onClick"], Me = { class: "bColor" }, Ae = ["onMouseover", "onClick"], $e = /* @__PURE__ */ J(() => /* @__PURE__ */ vue.createElementVNode("h3", null, "标准颜色", -1)), Te = { class: "tColor" }, Be = ["onMouseover", "onClick"], Ve = {
|
|
159
155
|
name: "colorPicker"
|
|
160
156
|
}, Ne = /* @__PURE__ */ vue.defineComponent({
|
|
161
157
|
...Ve,
|
|
@@ -220,13 +216,13 @@
|
|
|
220
216
|
l.stopPropagation();
|
|
221
217
|
})
|
|
222
218
|
}, [
|
|
223
|
-
vue.createCommentVNode("
|
|
219
|
+
vue.createCommentVNode(" 颜色显示小方块 "),
|
|
224
220
|
vue.createElementVNode("div", {
|
|
225
221
|
class: vue.normalizeClass(["colorBtn", { disabled: e.disabled }]),
|
|
226
222
|
style: vue.normalizeStyle(`background-color: ${vue.unref(a)}`),
|
|
227
223
|
onClick: p
|
|
228
224
|
}, null, 6),
|
|
229
|
-
vue.createCommentVNode("
|
|
225
|
+
vue.createCommentVNode(" 颜色色盘 "),
|
|
230
226
|
vue.createElementVNode("div", {
|
|
231
227
|
class: vue.normalizeClass(["box", { open: s.value }])
|
|
232
228
|
}, [
|
|
@@ -240,7 +236,7 @@
|
|
|
240
236
|
onClick: Y,
|
|
241
237
|
onMouseover: r[0] || (r[0] = (l) => d(e.defaultColor)),
|
|
242
238
|
onMouseout: r[1] || (r[1] = (l) => d(""))
|
|
243
|
-
}, "
|
|
239
|
+
}, "默认颜色", 32)
|
|
244
240
|
]),
|
|
245
241
|
vue.createElementVNode("div", Oe, [
|
|
246
242
|
Ie,
|
|
@@ -276,8 +272,8 @@
|
|
|
276
272
|
onClick: (f) => E(l)
|
|
277
273
|
}, null, 44, Be)), 64))
|
|
278
274
|
]),
|
|
279
|
-
vue.createElementVNode("h3", { onClick: X }, "
|
|
280
|
-
vue.createCommentVNode("
|
|
275
|
+
vue.createElementVNode("h3", { onClick: X }, "更多颜色..."),
|
|
276
|
+
vue.createCommentVNode(" 用以激活HTML5颜色面板 "),
|
|
281
277
|
vue.withDirectives(vue.createElementVNode("input", {
|
|
282
278
|
type: "color",
|
|
283
279
|
ref_key: "html5ColorEl",
|
|
@@ -311,7 +307,7 @@
|
|
|
311
307
|
colorPicker: O
|
|
312
308
|
};
|
|
313
309
|
const style = "";
|
|
314
|
-
const
|
|
310
|
+
const ToolBar_vue_vue_type_style_index_0_scoped_50235bb8_lang = "";
|
|
315
311
|
const ToolBar_vue_vue_type_style_index_1_lang = "";
|
|
316
312
|
const _export_sfc = (sfc, props) => {
|
|
317
313
|
const target = sfc.__vccOpts || sfc;
|
|
@@ -341,15 +337,15 @@
|
|
|
341
337
|
activeImgType: false,
|
|
342
338
|
activeAlign: "",
|
|
343
339
|
alignMethods: [
|
|
344
|
-
{ value: "left", name: "
|
|
345
|
-
{ value: "right", name: "
|
|
346
|
-
{ value: "center", name: "
|
|
347
|
-
{ value: "justify", name: "
|
|
340
|
+
{ value: "left", name: "左对齐" },
|
|
341
|
+
{ value: "right", name: "右对齐" },
|
|
342
|
+
{ value: "center", name: "居中对齐" },
|
|
343
|
+
{ value: "justify", name: "两端对齐" }
|
|
348
344
|
],
|
|
349
345
|
activeFontsize: "17",
|
|
350
346
|
fontsizes: [
|
|
351
|
-
{ value: "17px", name: "17", desc: "
|
|
352
|
-
{ value: "18px", name: "18", desc: "
|
|
347
|
+
{ value: "17px", name: "17", desc: "默认正文字号" },
|
|
348
|
+
{ value: "18px", name: "18", desc: "默认标题字号" },
|
|
353
349
|
{ value: "19px", name: "19" },
|
|
354
350
|
{ value: "20px", name: "20" },
|
|
355
351
|
{ value: "24px", name: "24" },
|
|
@@ -430,7 +426,7 @@
|
|
|
430
426
|
this.editor.clearFormat();
|
|
431
427
|
},
|
|
432
428
|
setColor(val) {
|
|
433
|
-
console.log("
|
|
429
|
+
console.log("文字颜色");
|
|
434
430
|
this.updatePosition(() => {
|
|
435
431
|
this.editor.setColor(val);
|
|
436
432
|
});
|
|
@@ -489,6 +485,7 @@
|
|
|
489
485
|
this.popoverVisibleList = false;
|
|
490
486
|
this.popoverVisibleImg = false;
|
|
491
487
|
},
|
|
488
|
+
// todo 富文本设置样式位置会回到顶部
|
|
492
489
|
updatePosition(fn) {
|
|
493
490
|
const scrollTop = document.documentElement.scrollTop;
|
|
494
491
|
fn && fn();
|
|
@@ -525,9 +522,9 @@
|
|
|
525
522
|
key: 0,
|
|
526
523
|
class: "tools"
|
|
527
524
|
};
|
|
528
|
-
const _hoisted_2$
|
|
529
|
-
const _hoisted_3$
|
|
530
|
-
const _hoisted_4$
|
|
525
|
+
const _hoisted_2$5 = { class: "tools-content" };
|
|
526
|
+
const _hoisted_3$5 = ["src"];
|
|
527
|
+
const _hoisted_4$3 = ["src"];
|
|
531
528
|
const _hoisted_5$3 = ["src"];
|
|
532
529
|
const _hoisted_6$2 = { class: "box" };
|
|
533
530
|
const _hoisted_7$2 = ["src"];
|
|
@@ -568,9 +565,9 @@
|
|
|
568
565
|
key: 0,
|
|
569
566
|
class: "box-mask"
|
|
570
567
|
};
|
|
571
|
-
const _hoisted_30
|
|
572
|
-
const _hoisted_31
|
|
573
|
-
const _hoisted_32
|
|
568
|
+
const _hoisted_30 = { class: "box" };
|
|
569
|
+
const _hoisted_31 = ["src"];
|
|
570
|
+
const _hoisted_32 = ["src"];
|
|
574
571
|
const _hoisted_33 = ["src"];
|
|
575
572
|
const _hoisted_34 = ["src"];
|
|
576
573
|
const _hoisted_35 = { class: "tools-title" };
|
|
@@ -594,11 +591,11 @@
|
|
|
594
591
|
const _component_colorPicker = vue.resolveComponent("colorPicker");
|
|
595
592
|
const _directive_click_outside = vue.resolveDirective("click-outside");
|
|
596
593
|
return $props.editor.fontInfo ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
|
|
597
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
594
|
+
vue.createElementVNode("div", _hoisted_2$5, [
|
|
598
595
|
vue.createVNode(_component_el_tooltip, {
|
|
599
596
|
class: "item",
|
|
600
597
|
effect: "dark",
|
|
601
|
-
content: "
|
|
598
|
+
content: "撤回",
|
|
602
599
|
placement: "top"
|
|
603
600
|
}, {
|
|
604
601
|
default: vue.withCtx(() => [
|
|
@@ -610,14 +607,14 @@
|
|
|
610
607
|
height: "40",
|
|
611
608
|
alt: "",
|
|
612
609
|
onClick: _cache[0] || (_cache[0] = ($event) => $options.back($event))
|
|
613
|
-
}, null, 12, _hoisted_3$
|
|
610
|
+
}, null, 12, _hoisted_3$5)
|
|
614
611
|
]),
|
|
615
612
|
_: 1
|
|
616
613
|
}),
|
|
617
614
|
vue.createVNode(_component_el_tooltip, {
|
|
618
615
|
class: "item",
|
|
619
616
|
effect: "dark",
|
|
620
|
-
content: "
|
|
617
|
+
content: "反撤回",
|
|
621
618
|
placement: "top"
|
|
622
619
|
}, {
|
|
623
620
|
default: vue.withCtx(() => [
|
|
@@ -629,7 +626,7 @@
|
|
|
629
626
|
height: "40",
|
|
630
627
|
alt: "",
|
|
631
628
|
onClick: _cache[1] || (_cache[1] = ($event) => $options.forward($event))
|
|
632
|
-
}, null, 12, _hoisted_4$
|
|
629
|
+
}, null, 12, _hoisted_4$3)
|
|
633
630
|
]),
|
|
634
631
|
_: 1
|
|
635
632
|
}),
|
|
@@ -640,7 +637,7 @@
|
|
|
640
637
|
vue.createVNode(_component_el_tooltip, {
|
|
641
638
|
class: "item",
|
|
642
639
|
effect: "dark",
|
|
643
|
-
content: "
|
|
640
|
+
content: "清除格式",
|
|
644
641
|
placement: "top"
|
|
645
642
|
}, {
|
|
646
643
|
default: vue.withCtx(() => [
|
|
@@ -657,7 +654,7 @@
|
|
|
657
654
|
vue.createVNode(_component_el_tooltip, {
|
|
658
655
|
class: "item",
|
|
659
656
|
effect: "dark",
|
|
660
|
-
content: "
|
|
657
|
+
content: "格式刷",
|
|
661
658
|
placement: "top"
|
|
662
659
|
}, {
|
|
663
660
|
default: vue.withCtx(() => [
|
|
@@ -688,7 +685,7 @@
|
|
|
688
685
|
vue.createVNode(_component_el_tooltip, {
|
|
689
686
|
class: "item",
|
|
690
687
|
effect: "dark",
|
|
691
|
-
content: "
|
|
688
|
+
content: "字号",
|
|
692
689
|
placement: "top"
|
|
693
690
|
}, {
|
|
694
691
|
default: vue.withCtx(() => [
|
|
@@ -738,7 +735,7 @@
|
|
|
738
735
|
vue.createVNode(_component_el_tooltip, {
|
|
739
736
|
class: "item",
|
|
740
737
|
effect: "dark",
|
|
741
|
-
content: "
|
|
738
|
+
content: "标题",
|
|
742
739
|
placement: "top"
|
|
743
740
|
}, {
|
|
744
741
|
default: vue.withCtx(() => [
|
|
@@ -759,7 +756,7 @@
|
|
|
759
756
|
vue.createVNode(_component_el_tooltip, {
|
|
760
757
|
class: "item",
|
|
761
758
|
effect: "dark",
|
|
762
|
-
content: "
|
|
759
|
+
content: "加粗",
|
|
763
760
|
placement: "top"
|
|
764
761
|
}, {
|
|
765
762
|
default: vue.withCtx(() => [
|
|
@@ -787,7 +784,7 @@
|
|
|
787
784
|
vue.createVNode(_component_el_tooltip, {
|
|
788
785
|
class: "item",
|
|
789
786
|
effect: "dark",
|
|
790
|
-
content: "
|
|
787
|
+
content: "列表",
|
|
791
788
|
placement: "top"
|
|
792
789
|
}, {
|
|
793
790
|
default: vue.withCtx(() => [
|
|
@@ -821,13 +818,13 @@
|
|
|
821
818
|
onClick: _cache[8] || (_cache[8] = ($event) => $options.updatePosition(() => {
|
|
822
819
|
$options.setStyle("makeUnorderedList");
|
|
823
820
|
}))
|
|
824
|
-
}, "
|
|
821
|
+
}, "无序列表"),
|
|
825
822
|
vue.createElementVNode("li", {
|
|
826
823
|
"data-editor-id": "makeHeader",
|
|
827
824
|
onClick: _cache[9] || (_cache[9] = ($event) => $options.updatePosition(() => {
|
|
828
825
|
$options.setStyle("makeOrderedList");
|
|
829
826
|
}))
|
|
830
|
-
}, "
|
|
827
|
+
}, "有序列表")
|
|
831
828
|
])), [
|
|
832
829
|
[_directive_click_outside, $options.handlePopover]
|
|
833
830
|
])
|
|
@@ -838,7 +835,7 @@
|
|
|
838
835
|
vue.createVNode(_component_el_tooltip, {
|
|
839
836
|
class: "item",
|
|
840
837
|
effect: "dark",
|
|
841
|
-
content: "
|
|
838
|
+
content: "倾斜",
|
|
842
839
|
placement: "top"
|
|
843
840
|
}, {
|
|
844
841
|
default: vue.withCtx(() => [
|
|
@@ -858,7 +855,7 @@
|
|
|
858
855
|
vue.createVNode(_component_el_tooltip, {
|
|
859
856
|
class: "item",
|
|
860
857
|
effect: "dark",
|
|
861
|
-
content: "
|
|
858
|
+
content: "下划线",
|
|
862
859
|
placement: "top"
|
|
863
860
|
}, {
|
|
864
861
|
default: vue.withCtx(() => [
|
|
@@ -879,18 +876,18 @@
|
|
|
879
876
|
key: 0,
|
|
880
877
|
class: "item",
|
|
881
878
|
effect: "dark",
|
|
882
|
-
content: "
|
|
879
|
+
content: "链接",
|
|
883
880
|
placement: "top"
|
|
884
881
|
}, {
|
|
885
882
|
default: vue.withCtx(() => [
|
|
886
|
-
vue.createElementVNode("div", _hoisted_30
|
|
883
|
+
vue.createElementVNode("div", _hoisted_30, [
|
|
887
884
|
vue.createElementVNode("img", {
|
|
888
885
|
src: $options.getImageUrl("icon_web_link@2x.png"),
|
|
889
886
|
width: "40",
|
|
890
887
|
height: "40",
|
|
891
888
|
alt: "",
|
|
892
889
|
onClick: _cache[12] || (_cache[12] = (...args) => $options.insertLink && $options.insertLink(...args))
|
|
893
|
-
}, null, 8, _hoisted_31
|
|
890
|
+
}, null, 8, _hoisted_31)
|
|
894
891
|
])
|
|
895
892
|
]),
|
|
896
893
|
_: 1
|
|
@@ -898,7 +895,7 @@
|
|
|
898
895
|
vue.createVNode(_component_el_tooltip, {
|
|
899
896
|
class: "item",
|
|
900
897
|
effect: "dark",
|
|
901
|
-
content: "
|
|
898
|
+
content: "首行缩进",
|
|
902
899
|
placement: "top"
|
|
903
900
|
}, {
|
|
904
901
|
default: vue.withCtx(() => [
|
|
@@ -908,14 +905,14 @@
|
|
|
908
905
|
height: "40",
|
|
909
906
|
alt: "",
|
|
910
907
|
onClick: _cache[13] || (_cache[13] = ($event) => $options.setStyle("setIndent"))
|
|
911
|
-
}, null, 8, _hoisted_32
|
|
908
|
+
}, null, 8, _hoisted_32)
|
|
912
909
|
]),
|
|
913
910
|
_: 1
|
|
914
911
|
}),
|
|
915
912
|
vue.createVNode(_component_el_tooltip, {
|
|
916
913
|
class: "item",
|
|
917
914
|
effect: "dark",
|
|
918
|
-
content: "
|
|
915
|
+
content: "文字颜色",
|
|
919
916
|
placement: "top"
|
|
920
917
|
}, {
|
|
921
918
|
default: vue.withCtx(() => [
|
|
@@ -959,7 +956,7 @@
|
|
|
959
956
|
vue.createVNode(_component_el_tooltip, {
|
|
960
957
|
class: "item",
|
|
961
958
|
effect: "dark",
|
|
962
|
-
content: "
|
|
959
|
+
content: "对齐方式",
|
|
963
960
|
placement: "top"
|
|
964
961
|
}, {
|
|
965
962
|
default: vue.withCtx(() => [
|
|
@@ -1017,7 +1014,7 @@
|
|
|
1017
1014
|
vue.createVNode(_component_el_tooltip, {
|
|
1018
1015
|
class: "item",
|
|
1019
1016
|
effect: "dark",
|
|
1020
|
-
content: "
|
|
1017
|
+
content: "插入图片",
|
|
1021
1018
|
placement: "top"
|
|
1022
1019
|
}, {
|
|
1023
1020
|
default: vue.withCtx(() => [
|
|
@@ -1039,11 +1036,11 @@
|
|
|
1039
1036
|
vue.createElementVNode("li", {
|
|
1040
1037
|
class: vue.normalizeClass([$data.activeImgType === "normal" ? "active" : ""]),
|
|
1041
1038
|
onClick: _cache[18] || (_cache[18] = ($event) => $options.insertImg("normal"))
|
|
1042
|
-
}, vue.toDisplayString("
|
|
1039
|
+
}, vue.toDisplayString("上传图片"), 2),
|
|
1043
1040
|
vue.createElementVNode("li", {
|
|
1044
1041
|
class: vue.normalizeClass([$data.activeImgType === "seamless" ? "active" : ""]),
|
|
1045
1042
|
onClick: _cache[19] || (_cache[19] = ($event) => $options.insertImg("seamless"))
|
|
1046
|
-
}, vue.toDisplayString("
|
|
1043
|
+
}, vue.toDisplayString("上传无缝拼接图片"), 2)
|
|
1047
1044
|
])), [
|
|
1048
1045
|
[_directive_click_outside, $options.handlePopover]
|
|
1049
1046
|
])
|
|
@@ -1054,7 +1051,7 @@
|
|
|
1054
1051
|
key: 2,
|
|
1055
1052
|
class: "item",
|
|
1056
1053
|
effect: "dark",
|
|
1057
|
-
content: "
|
|
1054
|
+
content: "插入视频",
|
|
1058
1055
|
placement: "top"
|
|
1059
1056
|
}, {
|
|
1060
1057
|
default: vue.withCtx(() => [
|
|
@@ -1072,7 +1069,7 @@
|
|
|
1072
1069
|
key: 3,
|
|
1073
1070
|
class: "item",
|
|
1074
1071
|
effect: "dark",
|
|
1075
|
-
content: "
|
|
1072
|
+
content: "插入文章/视频",
|
|
1076
1073
|
placement: "top"
|
|
1077
1074
|
}, {
|
|
1078
1075
|
default: vue.withCtx(() => [
|
|
@@ -1090,7 +1087,7 @@
|
|
|
1090
1087
|
key: 4,
|
|
1091
1088
|
class: "item",
|
|
1092
1089
|
effect: "dark",
|
|
1093
|
-
content: "
|
|
1090
|
+
content: "采集文章",
|
|
1094
1091
|
placement: "top"
|
|
1095
1092
|
}, {
|
|
1096
1093
|
default: vue.withCtx(() => [
|
|
@@ -1107,17 +1104,15 @@
|
|
|
1107
1104
|
])
|
|
1108
1105
|
])) : vue.createCommentVNode("", true);
|
|
1109
1106
|
}
|
|
1110
|
-
const ToolBar = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$4], ["__scopeId", "data-v-
|
|
1107
|
+
const ToolBar = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$4], ["__scopeId", "data-v-50235bb8"]]);
|
|
1111
1108
|
const __vite_glob_0_0 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAmCAYAAAClI5npAAAA0UlEQVR42uWYwQnDMAxFfckAXkFDmGzgS1foDpnFS3gTb+IFtIDyA4UeBKUtNR8qwTvlkAdyfmSletySmRUwgIIJOijXs9VcLxegwNVDRFYLdHtdCg6wrRKY9l4NUFYIqH1WDeTfCXxXE9w5Ar4tQhBwh7SBjSDg2lJJAj47SAI+OwgC7pDuJAGfHQQBnx0kAZ8dBAF3SOtTgCchybjV2QLKFpihW6BAQn6GA0i4KG4g037H4QaSDiTWUMocyweQcFezBjLrer5TFxR/uaKhL6lOdeUQ8G6X1pQAAAAASUVORK5CYII=";
|
|
1112
|
-
const index_vue_vue_type_style_index_0_lang$5 = "";
|
|
1113
1109
|
const _hoisted_1$7 = { key: 0 };
|
|
1114
|
-
const _hoisted_2$
|
|
1115
|
-
const _hoisted_3$
|
|
1116
|
-
const _hoisted_4$3 = {
|
|
1110
|
+
const _hoisted_2$4 = { class: "basic-dialog_title" };
|
|
1111
|
+
const _hoisted_3$4 = {
|
|
1117
1112
|
key: 0,
|
|
1118
1113
|
class: "dialog-footer"
|
|
1119
1114
|
};
|
|
1120
|
-
const _sfc_main$7 = vue.defineComponent({
|
|
1115
|
+
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
1121
1116
|
__name: "index",
|
|
1122
1117
|
props: {
|
|
1123
1118
|
visible: { type: Boolean, default: false },
|
|
@@ -1154,28 +1149,28 @@
|
|
|
1154
1149
|
modelValue: dialogVisible.value,
|
|
1155
1150
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dialogVisible.value = $event),
|
|
1156
1151
|
"before-close": handleClose,
|
|
1157
|
-
width:
|
|
1158
|
-
class: vue.normalizeClass(["basic-dialog", { "hide-title": !
|
|
1152
|
+
width: __props.width,
|
|
1153
|
+
class: vue.normalizeClass(["basic-dialog", { "hide-title": !__props.showTitle }])
|
|
1159
1154
|
}, {
|
|
1160
1155
|
header: vue.withCtx(() => [
|
|
1161
|
-
|
|
1162
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
1163
|
-
|
|
1156
|
+
__props.showTitle ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
|
|
1157
|
+
vue.createElementVNode("div", _hoisted_2$4, [
|
|
1158
|
+
_cache[1] || (_cache[1] = vue.createElementVNode("span", { class: "basic-dialog_divider" }, null, -1)),
|
|
1164
1159
|
vue.renderSlot(_ctx.$slots, "title")
|
|
1165
1160
|
])
|
|
1166
1161
|
])) : vue.createCommentVNode("", true)
|
|
1167
1162
|
]),
|
|
1168
1163
|
footer: vue.withCtx(() => [
|
|
1169
|
-
|
|
1164
|
+
__props.showBtn ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$4, [
|
|
1170
1165
|
vue.createVNode(vue.unref(elementPlus.ElButton), {
|
|
1171
1166
|
style: { "width": "120px", "border-color": "#cccccc", "color": "#333333" },
|
|
1172
1167
|
plain: "",
|
|
1173
1168
|
round: "",
|
|
1174
1169
|
onClick: handleClose
|
|
1175
1170
|
}, {
|
|
1176
|
-
default: vue.withCtx(() => [
|
|
1177
|
-
vue.createTextVNode("
|
|
1178
|
-
]),
|
|
1171
|
+
default: vue.withCtx(() => [..._cache[2] || (_cache[2] = [
|
|
1172
|
+
vue.createTextVNode("取消", -1)
|
|
1173
|
+
])]),
|
|
1179
1174
|
_: 1
|
|
1180
1175
|
}),
|
|
1181
1176
|
vue.createVNode(vue.unref(elementPlus.ElButton), {
|
|
@@ -1184,9 +1179,9 @@
|
|
|
1184
1179
|
type: "primary",
|
|
1185
1180
|
onClick: confirm
|
|
1186
1181
|
}, {
|
|
1187
|
-
default: vue.withCtx(() => [
|
|
1188
|
-
vue.createTextVNode("
|
|
1189
|
-
]),
|
|
1182
|
+
default: vue.withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
1183
|
+
vue.createTextVNode("确认", -1)
|
|
1184
|
+
])]),
|
|
1190
1185
|
_: 1
|
|
1191
1186
|
})
|
|
1192
1187
|
])) : vue.createCommentVNode("", true)
|
|
@@ -1199,12 +1194,14 @@
|
|
|
1199
1194
|
};
|
|
1200
1195
|
}
|
|
1201
1196
|
});
|
|
1197
|
+
const index_vue_vue_type_style_index_0_lang$5 = "";
|
|
1202
1198
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
1203
1199
|
function getDefaultExportFromCjs(x) {
|
|
1204
1200
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
1205
1201
|
}
|
|
1206
|
-
var date$
|
|
1207
|
-
|
|
1202
|
+
var date$2 = { exports: {} };
|
|
1203
|
+
var date = date$2.exports;
|
|
1204
|
+
Object.defineProperty(date, "__esModule", { value: true });
|
|
1208
1205
|
function replacementDate(data, fmt) {
|
|
1209
1206
|
for (var k in data) {
|
|
1210
1207
|
if (new RegExp("(" + k + ")").test(fmt)) {
|
|
@@ -1219,126 +1216,130 @@
|
|
|
1219
1216
|
}
|
|
1220
1217
|
return fmt;
|
|
1221
1218
|
}
|
|
1222
|
-
var DateClass =
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
"
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1219
|
+
var DateClass = (
|
|
1220
|
+
/** @class */
|
|
1221
|
+
function() {
|
|
1222
|
+
function DateClass2() {
|
|
1223
|
+
}
|
|
1224
|
+
DateClass2.prototype.format = function(date2, fmt) {
|
|
1225
|
+
if (fmt === void 0) {
|
|
1226
|
+
fmt = "YYYY-MM-DD HH:mm:ss";
|
|
1227
|
+
}
|
|
1228
|
+
if (!date2)
|
|
1229
|
+
return "";
|
|
1230
|
+
var timeData = typeof date2 === "string" ? new Date(date2.replace(/-/g, "/")) : date2;
|
|
1231
|
+
timeData = typeof date2 === "number" ? new Date(date2) : timeData;
|
|
1232
|
+
var o = {
|
|
1233
|
+
"M+": timeData.getMonth() + 1,
|
|
1234
|
+
"D+": timeData.getDate(),
|
|
1235
|
+
"h+": timeData.getHours() % 12 === 0 ? 12 : timeData.getHours() % 12,
|
|
1236
|
+
"H+": timeData.getHours(),
|
|
1237
|
+
"m+": timeData.getMinutes(),
|
|
1238
|
+
"s+": timeData.getSeconds(),
|
|
1239
|
+
"q+": Math.floor((timeData.getMonth() + 3) / 3),
|
|
1240
|
+
"S": timeData.getMilliseconds()
|
|
1241
|
+
};
|
|
1242
|
+
var week = {
|
|
1243
|
+
"0": "日",
|
|
1244
|
+
"1": "一",
|
|
1245
|
+
"2": "二",
|
|
1246
|
+
"3": "三",
|
|
1247
|
+
"4": "四",
|
|
1248
|
+
"5": "五",
|
|
1249
|
+
"6": "六"
|
|
1250
|
+
};
|
|
1251
|
+
fmt = replacementYear(timeData, fmt);
|
|
1252
|
+
if (/(E+)/.test(fmt)) {
|
|
1253
|
+
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length > 1 ? RegExp.$1.length > 2 ? "星期" : "周" : "") + week["".concat(timeData.getDay(), " ")]);
|
|
1254
|
+
}
|
|
1255
|
+
return replacementDate(o, fmt);
|
|
1242
1256
|
};
|
|
1243
|
-
|
|
1244
|
-
"
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
"3": "\u4E09",
|
|
1248
|
-
"4": "\u56DB",
|
|
1249
|
-
"5": "\u4E94",
|
|
1250
|
-
"6": "\u516D"
|
|
1257
|
+
DateClass2.prototype.addDaysToDate = function(date2, days) {
|
|
1258
|
+
var d = typeof date2 === "object" ? date2 : new Date(date2);
|
|
1259
|
+
d.setDate(d.getDate() + days);
|
|
1260
|
+
return d.toISOString().split("T")[0];
|
|
1251
1261
|
};
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
var hh = Math.floor(ts / 1e3 / 60 / 60 % 24);
|
|
1270
|
-
var mm = Math.floor(ts / 1e3 / 60 % 60);
|
|
1271
|
-
var ss = Math.floor(ts / 1e3 % 60);
|
|
1272
|
-
if (ts <= 0)
|
|
1273
|
-
return false;
|
|
1274
|
-
return {
|
|
1275
|
-
dd: dd < 10 ? "0".concat(dd) : dd,
|
|
1276
|
-
hh: hh < 10 ? "0".concat(hh) : hh,
|
|
1277
|
-
mm: mm < 10 ? "0".concat(mm) : mm,
|
|
1278
|
-
ss: ss < 10 ? "0".concat(ss) : ss
|
|
1262
|
+
DateClass2.prototype.remainTime = function(endTime, startTime) {
|
|
1263
|
+
if (startTime === void 0) {
|
|
1264
|
+
startTime = /* @__PURE__ */ new Date();
|
|
1265
|
+
}
|
|
1266
|
+
var ts = Number(endTime) - Number(startTime);
|
|
1267
|
+
var dd = Math.floor(ts / 1e3 / 60 / 60 / 24);
|
|
1268
|
+
var hh = Math.floor(ts / 1e3 / 60 / 60 % 24);
|
|
1269
|
+
var mm = Math.floor(ts / 1e3 / 60 % 60);
|
|
1270
|
+
var ss = Math.floor(ts / 1e3 % 60);
|
|
1271
|
+
if (ts <= 0)
|
|
1272
|
+
return false;
|
|
1273
|
+
return {
|
|
1274
|
+
dd: dd < 10 ? "0".concat(dd) : dd,
|
|
1275
|
+
hh: hh < 10 ? "0".concat(hh) : hh,
|
|
1276
|
+
mm: mm < 10 ? "0".concat(mm) : mm,
|
|
1277
|
+
ss: ss < 10 ? "0".concat(ss) : ss
|
|
1278
|
+
};
|
|
1279
1279
|
};
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1280
|
+
DateClass2.prototype.formatPassTime = function(startTime) {
|
|
1281
|
+
var currentTime = /* @__PURE__ */ new Date();
|
|
1282
|
+
var time = currentTime - startTime;
|
|
1283
|
+
var year = Math.floor(time / (1e3 * 60 * 60 * 24) / 30 / 12);
|
|
1284
|
+
if (year)
|
|
1285
|
+
return "".concat(year, "年前");
|
|
1286
|
+
var month = Math.floor(time / (1e3 * 60 * 60 * 24) / 30);
|
|
1287
|
+
if (month)
|
|
1288
|
+
return "".concat(month, "个月前");
|
|
1289
|
+
var day = Math.floor(time / (1e3 * 60 * 60 * 24));
|
|
1290
|
+
if (day)
|
|
1291
|
+
return "".concat(day, "天前");
|
|
1292
|
+
var hour = Math.floor(time / (1e3 * 60 * 60));
|
|
1293
|
+
if (hour)
|
|
1294
|
+
return "".concat(hour, "小时前");
|
|
1295
|
+
var min = Math.floor(time / (1e3 * 60));
|
|
1296
|
+
if (min)
|
|
1297
|
+
return "".concat(min, "分钟前");
|
|
1298
|
+
else
|
|
1299
|
+
return "刚刚";
|
|
1300
|
+
};
|
|
1301
|
+
DateClass2.prototype.formatPassTimeForList = function(time) {
|
|
1302
|
+
return DateClass2.prototype.formatPassTimeForDetail(time, "YYYY年MM月DD日", true);
|
|
1303
|
+
};
|
|
1304
|
+
DateClass2.prototype.formatPassTimeForDetail = function(time, fmt, noYear) {
|
|
1305
|
+
if (fmt === void 0) {
|
|
1306
|
+
fmt = "YYYY-MM-DD";
|
|
1307
|
+
}
|
|
1308
|
+
var date2 = typeof time === "number" ? new Date(time) : new Date((time || "").replace(/-/g, "/"));
|
|
1309
|
+
var diff = ((/* @__PURE__ */ new Date()).getTime() - date2.getTime()) / 1e3;
|
|
1310
|
+
var dayDiff = Math.floor(diff / 86400);
|
|
1311
|
+
var isValidDate = Object.prototype.toString.call(date2) === "[object Date]" && !isNaN(date2.getTime());
|
|
1312
|
+
if (!isValidDate)
|
|
1313
|
+
return "";
|
|
1314
|
+
var formatDate = function() {
|
|
1315
|
+
var today = new Date(date2);
|
|
1316
|
+
var o = {
|
|
1317
|
+
"Y+": today.getFullYear(),
|
|
1318
|
+
"M+": ("0" + (today.getMonth() + 1)).slice(-2),
|
|
1319
|
+
"D+": ("0" + today.getDate()).slice(-2)
|
|
1320
|
+
};
|
|
1321
|
+
fmt = replacementYear(date2, fmt);
|
|
1322
|
+
var year = today.getFullYear();
|
|
1323
|
+
if (!((/* @__PURE__ */ new Date()).getFullYear() > year) && noYear) {
|
|
1324
|
+
var backData = replacementDate(o, fmt);
|
|
1325
|
+
return backData.split("年")[1];
|
|
1326
|
+
}
|
|
1327
|
+
return replacementDate(o, fmt);
|
|
1321
1328
|
};
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
if (
|
|
1325
|
-
|
|
1326
|
-
return backData.split("\u5E74")[1];
|
|
1329
|
+
if (dayDiff === -1) {
|
|
1330
|
+
return "刚刚";
|
|
1331
|
+
} else if (isNaN(dayDiff) || dayDiff < 0 || dayDiff >= 15) {
|
|
1332
|
+
return formatDate();
|
|
1327
1333
|
}
|
|
1328
|
-
return
|
|
1334
|
+
return dayDiff === 0 && (diff < 60 && "刚刚" || diff < 120 && "1分钟前" || diff < 3600 && Math.floor(diff / 60) + "分钟前" || diff < 7200 && "1小时前" || diff < 86400 && Math.floor(diff / 3600) + "小时前") || dayDiff < 16 && dayDiff + "天前";
|
|
1329
1335
|
};
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
return DateClass2;
|
|
1338
|
-
}();
|
|
1339
|
-
date$1.exports = new DateClass();
|
|
1340
|
-
const date = /* @__PURE__ */ getDefaultExportFromCjs(date$1.exports);
|
|
1341
|
-
var tools$1 = { exports: {} };
|
|
1336
|
+
return DateClass2;
|
|
1337
|
+
}()
|
|
1338
|
+
);
|
|
1339
|
+
date$2.exports = new DateClass();
|
|
1340
|
+
var dateExports = date$2.exports;
|
|
1341
|
+
const date$1 = /* @__PURE__ */ getDefaultExportFromCjs(dateExports);
|
|
1342
|
+
var tools$2 = { exports: {} };
|
|
1342
1343
|
var _listCacheClear;
|
|
1343
1344
|
var hasRequired_listCacheClear;
|
|
1344
1345
|
function require_listCacheClear() {
|
|
@@ -2245,6 +2246,7 @@
|
|
|
2245
2246
|
stubFalse_1 = stubFalse;
|
|
2246
2247
|
return stubFalse_1;
|
|
2247
2248
|
}
|
|
2249
|
+
isBuffer.exports;
|
|
2248
2250
|
var hasRequiredIsBuffer;
|
|
2249
2251
|
function requireIsBuffer() {
|
|
2250
2252
|
if (hasRequiredIsBuffer)
|
|
@@ -2324,6 +2326,7 @@
|
|
|
2324
2326
|
return _baseUnary;
|
|
2325
2327
|
}
|
|
2326
2328
|
var _nodeUtil = { exports: {} };
|
|
2329
|
+
_nodeUtil.exports;
|
|
2327
2330
|
var hasRequired_nodeUtil;
|
|
2328
2331
|
function require_nodeUtil() {
|
|
2329
2332
|
if (hasRequired_nodeUtil)
|
|
@@ -2373,7 +2376,11 @@
|
|
|
2373
2376
|
function arrayLikeKeys(value, inherited) {
|
|
2374
2377
|
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer2(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
2375
2378
|
for (var key in value) {
|
|
2376
|
-
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes &&
|
|
2379
|
+
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
2380
|
+
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
2381
|
+
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
2382
|
+
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
2383
|
+
isIndex(key, length)))) {
|
|
2377
2384
|
result.push(key);
|
|
2378
2385
|
}
|
|
2379
2386
|
}
|
|
@@ -2553,6 +2560,7 @@
|
|
|
2553
2560
|
return _baseAssignIn;
|
|
2554
2561
|
}
|
|
2555
2562
|
var _cloneBuffer = { exports: {} };
|
|
2563
|
+
_cloneBuffer.exports;
|
|
2556
2564
|
var hasRequired_cloneBuffer;
|
|
2557
2565
|
function require_cloneBuffer() {
|
|
2558
2566
|
if (hasRequired_cloneBuffer)
|
|
@@ -3166,13 +3174,13 @@
|
|
|
3166
3174
|
return cloneDeep_1;
|
|
3167
3175
|
}
|
|
3168
3176
|
/*! clipboard-copy. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
3169
|
-
var
|
|
3170
|
-
var
|
|
3171
|
-
function
|
|
3172
|
-
if (
|
|
3173
|
-
return
|
|
3174
|
-
|
|
3175
|
-
|
|
3177
|
+
var clipboardCopy_1;
|
|
3178
|
+
var hasRequiredClipboardCopy;
|
|
3179
|
+
function requireClipboardCopy() {
|
|
3180
|
+
if (hasRequiredClipboardCopy)
|
|
3181
|
+
return clipboardCopy_1;
|
|
3182
|
+
hasRequiredClipboardCopy = 1;
|
|
3183
|
+
clipboardCopy_1 = clipboardCopy;
|
|
3176
3184
|
function makeError() {
|
|
3177
3185
|
return new DOMException("The request is not allowed", "NotAllowedError");
|
|
3178
3186
|
}
|
|
@@ -3215,266 +3223,270 @@
|
|
|
3215
3223
|
}
|
|
3216
3224
|
}
|
|
3217
3225
|
}
|
|
3218
|
-
return
|
|
3226
|
+
return clipboardCopy_1;
|
|
3219
3227
|
}
|
|
3220
|
-
|
|
3228
|
+
var tools = tools$2.exports;
|
|
3229
|
+
Object.defineProperty(tools, "__esModule", { value: true });
|
|
3221
3230
|
var previous = 0;
|
|
3222
3231
|
var timeout = null;
|
|
3223
|
-
var ToolsClass =
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3232
|
+
var ToolsClass = (
|
|
3233
|
+
/** @class */
|
|
3234
|
+
function() {
|
|
3235
|
+
function ToolsClass2() {
|
|
3236
|
+
var _this = this;
|
|
3237
|
+
this.stopScroll = function(className) {
|
|
3238
|
+
if (!(window && window.document)) {
|
|
3239
|
+
return new Error("仅支持浏览器");
|
|
3240
|
+
}
|
|
3241
|
+
var html = document.documentElement;
|
|
3242
|
+
html.style.overflow = "hidden";
|
|
3243
|
+
html.style.height = "100%";
|
|
3244
|
+
var body = document.body;
|
|
3245
|
+
body.style.overflow = "hidden";
|
|
3246
|
+
body.style.height = "100%";
|
|
3247
|
+
if (className) {
|
|
3248
|
+
var dom = document.querySelector(".".concat(className));
|
|
3249
|
+
dom && dom.addEventListener("touchmove", _this.__setDefault__);
|
|
3250
|
+
}
|
|
3251
|
+
};
|
|
3252
|
+
this.startScroll = function(className) {
|
|
3253
|
+
if (!(window && window.document)) {
|
|
3254
|
+
return new Error("仅支持浏览器");
|
|
3255
|
+
}
|
|
3256
|
+
var html = document.documentElement;
|
|
3257
|
+
html.style.overflow = "visible";
|
|
3258
|
+
html.style.height = "auto";
|
|
3259
|
+
var body = document.body;
|
|
3260
|
+
body.style.overflow = "visible";
|
|
3261
|
+
body.style.height = "auto";
|
|
3262
|
+
if (className) {
|
|
3263
|
+
var dom = document.querySelector(".".concat(className));
|
|
3264
|
+
dom && dom.removeEventListener("touchmove", _this.__setDefault__);
|
|
3265
|
+
}
|
|
3266
|
+
};
|
|
3267
|
+
this.objectToArray = function(obj) {
|
|
3268
|
+
var arr = [];
|
|
3269
|
+
if (typeof obj === "object") {
|
|
3270
|
+
for (var key in obj) {
|
|
3271
|
+
if (obj.hasOwnProperty(key)) {
|
|
3272
|
+
arr.push([key, obj[key]].join("="));
|
|
3273
|
+
}
|
|
3274
|
+
}
|
|
3275
|
+
}
|
|
3276
|
+
return arr;
|
|
3277
|
+
};
|
|
3278
|
+
this.convertKeyValueEnum = function(obj) {
|
|
3279
|
+
var result = {};
|
|
3280
|
+
if (typeof obj === "object") {
|
|
3281
|
+
for (var key in obj) {
|
|
3282
|
+
if (obj.hasOwnProperty(key)) {
|
|
3283
|
+
result[obj[key]] = key;
|
|
3284
|
+
}
|
|
3285
|
+
}
|
|
3286
|
+
}
|
|
3287
|
+
return result;
|
|
3288
|
+
};
|
|
3289
|
+
this.isDefined = function(val) {
|
|
3290
|
+
return val !== void 0 && val !== null;
|
|
3291
|
+
};
|
|
3292
|
+
this.__loaded__ = {};
|
|
3293
|
+
this.__setDefault__ = function(e) {
|
|
3294
|
+
e && e.preventDefault();
|
|
3295
|
+
};
|
|
3296
|
+
}
|
|
3297
|
+
ToolsClass2.prototype.deepCopy = function(data) {
|
|
3298
|
+
return JSON.parse(JSON.stringify(data));
|
|
3299
|
+
};
|
|
3300
|
+
ToolsClass2.prototype.deepCopy2 = function(obj) {
|
|
3301
|
+
var _obj = Array.isArray(obj) ? [] : {};
|
|
3302
|
+
for (var i in obj) {
|
|
3303
|
+
_obj[i] = typeof obj[i] === "object" ? this.deepCopy2(obj[i]) : obj[i];
|
|
3239
3304
|
}
|
|
3305
|
+
return _obj;
|
|
3306
|
+
};
|
|
3307
|
+
ToolsClass2.prototype.deepCopy3 = function(obj) {
|
|
3308
|
+
var deepcopy = requireCloneDeep();
|
|
3309
|
+
return deepcopy(obj);
|
|
3240
3310
|
};
|
|
3241
|
-
|
|
3311
|
+
ToolsClass2.prototype.debounce = function(func, wait) {
|
|
3312
|
+
var delay = function() {
|
|
3313
|
+
var args = arguments;
|
|
3314
|
+
if (timeout)
|
|
3315
|
+
clearTimeout(timeout);
|
|
3316
|
+
timeout = setTimeout(function() {
|
|
3317
|
+
func.apply(delay, args);
|
|
3318
|
+
}, wait);
|
|
3319
|
+
};
|
|
3320
|
+
return delay;
|
|
3321
|
+
};
|
|
3322
|
+
ToolsClass2.prototype.throttle = function(func, wait) {
|
|
3323
|
+
var delay = function() {
|
|
3324
|
+
var now = Date.now();
|
|
3325
|
+
if (now - previous > wait) {
|
|
3326
|
+
func.apply(delay, arguments);
|
|
3327
|
+
previous = now;
|
|
3328
|
+
}
|
|
3329
|
+
};
|
|
3330
|
+
return delay;
|
|
3331
|
+
};
|
|
3332
|
+
ToolsClass2.prototype.getUrlName = function(url) {
|
|
3333
|
+
return url && url.split("?")[0].split("/").reverse()[0];
|
|
3334
|
+
};
|
|
3335
|
+
ToolsClass2.prototype.loadJs = function(url) {
|
|
3336
|
+
var _this = this;
|
|
3242
3337
|
if (!(window && window.document)) {
|
|
3243
|
-
return new Error("
|
|
3244
|
-
}
|
|
3245
|
-
var
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3338
|
+
return new Error("仅支持浏览器");
|
|
3339
|
+
}
|
|
3340
|
+
var name = this.getUrlName(url);
|
|
3341
|
+
var id = "js_" + name;
|
|
3342
|
+
return new Promise(function(resolve, reject) {
|
|
3343
|
+
if (_this.__loaded__[id]) {
|
|
3344
|
+
return resolve();
|
|
3345
|
+
}
|
|
3346
|
+
var script = document.createElement("script");
|
|
3347
|
+
script.type = "text/javascript";
|
|
3348
|
+
script.async = true;
|
|
3349
|
+
script.src = url;
|
|
3350
|
+
script.id = id;
|
|
3351
|
+
script.onload = function() {
|
|
3352
|
+
_this.__loaded__[id] = true;
|
|
3353
|
+
resolve();
|
|
3354
|
+
};
|
|
3355
|
+
script.onerror = function(e) {
|
|
3356
|
+
reject(e);
|
|
3357
|
+
};
|
|
3358
|
+
document.body.appendChild(script);
|
|
3359
|
+
});
|
|
3360
|
+
};
|
|
3361
|
+
ToolsClass2.prototype.loadCss = function(url) {
|
|
3362
|
+
var _this = this;
|
|
3363
|
+
if (!(window && window.document)) {
|
|
3364
|
+
return new Error("仅支持浏览器");
|
|
3365
|
+
}
|
|
3366
|
+
var name = this.getUrlName(url);
|
|
3367
|
+
var id = "css_" + name;
|
|
3368
|
+
return new Promise(function(resolve, reject) {
|
|
3369
|
+
if (_this.__loaded__[id]) {
|
|
3370
|
+
return resolve();
|
|
3371
|
+
}
|
|
3372
|
+
var link = document.createElement("link");
|
|
3373
|
+
link.type = "text/css";
|
|
3374
|
+
link.rel = "stylesheet";
|
|
3375
|
+
link.href = url;
|
|
3376
|
+
link.id = id;
|
|
3377
|
+
link.onload = function() {
|
|
3378
|
+
_this.__loaded__[id] = true;
|
|
3379
|
+
resolve();
|
|
3380
|
+
};
|
|
3381
|
+
link.onerror = function(e) {
|
|
3382
|
+
reject(e);
|
|
3383
|
+
};
|
|
3384
|
+
document.head.appendChild(link);
|
|
3385
|
+
});
|
|
3386
|
+
};
|
|
3387
|
+
ToolsClass2.prototype.clipboard = function(str) {
|
|
3388
|
+
if (!(window && window.document)) {
|
|
3389
|
+
return new Error("仅支持浏览器");
|
|
3254
3390
|
}
|
|
3391
|
+
var copy = requireClipboardCopy();
|
|
3392
|
+
return copy(str);
|
|
3255
3393
|
};
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3394
|
+
ToolsClass2.prototype.firstUpperCase = function(str) {
|
|
3395
|
+
return str.charAt(0).toUpperCase() + str.toString().slice(1);
|
|
3396
|
+
};
|
|
3397
|
+
ToolsClass2.prototype.slice = function(target, length) {
|
|
3398
|
+
if (target === void 0) {
|
|
3399
|
+
target = "";
|
|
3400
|
+
}
|
|
3401
|
+
if (length === void 0) {
|
|
3402
|
+
length = 0;
|
|
3264
3403
|
}
|
|
3265
|
-
return
|
|
3404
|
+
return target.slice(0, length);
|
|
3266
3405
|
};
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
for (var key in obj) {
|
|
3271
|
-
if (obj.hasOwnProperty(key)) {
|
|
3272
|
-
result[obj[key]] = key;
|
|
3273
|
-
}
|
|
3274
|
-
}
|
|
3406
|
+
ToolsClass2.prototype.guid = function() {
|
|
3407
|
+
function S4() {
|
|
3408
|
+
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
3275
3409
|
}
|
|
3276
|
-
return
|
|
3410
|
+
return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
|
|
3277
3411
|
};
|
|
3278
|
-
|
|
3279
|
-
|
|
3412
|
+
ToolsClass2.prototype.getBytesOfText = function(str) {
|
|
3413
|
+
if (str === void 0) {
|
|
3414
|
+
str = "";
|
|
3415
|
+
}
|
|
3416
|
+
return str.replace(/[^\u0000-\u00ff]/g, "aa").length;
|
|
3280
3417
|
};
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
e && e.preventDefault();
|
|
3418
|
+
ToolsClass2.prototype.uniqueArr = function(arr) {
|
|
3419
|
+
return Array.from(new Set(arr));
|
|
3284
3420
|
};
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
ToolsClass2.prototype.deepCopy2 = function(obj) {
|
|
3290
|
-
var _obj = Array.isArray(obj) ? [] : {};
|
|
3291
|
-
for (var i in obj) {
|
|
3292
|
-
_obj[i] = typeof obj[i] === "object" ? this.deepCopy2(obj[i]) : obj[i];
|
|
3293
|
-
}
|
|
3294
|
-
return _obj;
|
|
3295
|
-
};
|
|
3296
|
-
ToolsClass2.prototype.deepCopy3 = function(obj) {
|
|
3297
|
-
var deepcopy = requireCloneDeep();
|
|
3298
|
-
return deepcopy(obj);
|
|
3299
|
-
};
|
|
3300
|
-
ToolsClass2.prototype.debounce = function(func, wait) {
|
|
3301
|
-
var delay = function() {
|
|
3302
|
-
var args = arguments;
|
|
3303
|
-
if (timeout)
|
|
3304
|
-
clearTimeout(timeout);
|
|
3305
|
-
timeout = setTimeout(function() {
|
|
3306
|
-
func.apply(delay, args);
|
|
3307
|
-
}, wait);
|
|
3421
|
+
ToolsClass2.prototype.swapArray = function(array, index1, index2) {
|
|
3422
|
+
var _a;
|
|
3423
|
+
_a = [array[index2], array[index1]], array[index1] = _a[0], array[index2] = _a[1];
|
|
3424
|
+
return array;
|
|
3308
3425
|
};
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
ToolsClass2.prototype.throttle = function(func, wait) {
|
|
3312
|
-
var delay = function() {
|
|
3313
|
-
var now = Date.now();
|
|
3314
|
-
if (now - previous > wait) {
|
|
3315
|
-
func.apply(delay, arguments);
|
|
3316
|
-
previous = now;
|
|
3317
|
-
}
|
|
3426
|
+
ToolsClass2.prototype.filterEmoji = function(str) {
|
|
3427
|
+
return str.replace(/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/mg, "");
|
|
3318
3428
|
};
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
if (
|
|
3333
|
-
return
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
};
|
|
3350
|
-
ToolsClass2.prototype.loadCss = function(url) {
|
|
3351
|
-
var _this = this;
|
|
3352
|
-
if (!(window && window.document)) {
|
|
3353
|
-
return new Error("\u4EC5\u652F\u6301\u6D4F\u89C8\u5668");
|
|
3354
|
-
}
|
|
3355
|
-
var name = this.getUrlName(url);
|
|
3356
|
-
var id = "css_" + name;
|
|
3357
|
-
return new Promise(function(resolve, reject) {
|
|
3358
|
-
if (_this.__loaded__[id]) {
|
|
3359
|
-
return resolve();
|
|
3360
|
-
}
|
|
3361
|
-
var link = document.createElement("link");
|
|
3362
|
-
link.type = "text/css";
|
|
3363
|
-
link.rel = "stylesheet";
|
|
3364
|
-
link.href = url;
|
|
3365
|
-
link.id = id;
|
|
3366
|
-
link.onload = function() {
|
|
3367
|
-
_this.__loaded__[id] = true;
|
|
3368
|
-
resolve();
|
|
3369
|
-
};
|
|
3370
|
-
link.onerror = function(e) {
|
|
3371
|
-
reject(e);
|
|
3372
|
-
};
|
|
3373
|
-
document.head.appendChild(link);
|
|
3374
|
-
});
|
|
3375
|
-
};
|
|
3376
|
-
ToolsClass2.prototype.clipboard = function(str) {
|
|
3377
|
-
if (!(window && window.document)) {
|
|
3378
|
-
return new Error("\u4EC5\u652F\u6301\u6D4F\u89C8\u5668");
|
|
3379
|
-
}
|
|
3380
|
-
var copy = require_clipboardCopy_4_0_1_clipboardCopy();
|
|
3381
|
-
return copy(str);
|
|
3382
|
-
};
|
|
3383
|
-
ToolsClass2.prototype.firstUpperCase = function(str) {
|
|
3384
|
-
return str.charAt(0).toUpperCase() + str.toString().slice(1);
|
|
3385
|
-
};
|
|
3386
|
-
ToolsClass2.prototype.slice = function(target, length) {
|
|
3387
|
-
if (target === void 0) {
|
|
3388
|
-
target = "";
|
|
3389
|
-
}
|
|
3390
|
-
if (length === void 0) {
|
|
3391
|
-
length = 0;
|
|
3392
|
-
}
|
|
3393
|
-
return target.slice(0, length);
|
|
3394
|
-
};
|
|
3395
|
-
ToolsClass2.prototype.guid = function() {
|
|
3396
|
-
function S4() {
|
|
3397
|
-
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
3398
|
-
}
|
|
3399
|
-
return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
|
|
3400
|
-
};
|
|
3401
|
-
ToolsClass2.prototype.getBytesOfText = function(str) {
|
|
3402
|
-
if (str === void 0) {
|
|
3403
|
-
str = "";
|
|
3404
|
-
}
|
|
3405
|
-
return str.replace(/[^\u0000-\u00ff]/g, "aa").length;
|
|
3406
|
-
};
|
|
3407
|
-
ToolsClass2.prototype.uniqueArr = function(arr) {
|
|
3408
|
-
return Array.from(new Set(arr));
|
|
3409
|
-
};
|
|
3410
|
-
ToolsClass2.prototype.swapArray = function(array, index1, index2) {
|
|
3411
|
-
var _a;
|
|
3412
|
-
_a = [array[index2], array[index1]], array[index1] = _a[0], array[index2] = _a[1];
|
|
3413
|
-
return array;
|
|
3414
|
-
};
|
|
3415
|
-
ToolsClass2.prototype.filterEmoji = function(str) {
|
|
3416
|
-
return str.replace(/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/mg, "");
|
|
3417
|
-
};
|
|
3418
|
-
ToolsClass2.prototype.containsEmoji = function(str) {
|
|
3419
|
-
var reg = /\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/mg;
|
|
3420
|
-
return reg.test(str);
|
|
3421
|
-
};
|
|
3422
|
-
ToolsClass2.prototype.containsHanZi = function(str) {
|
|
3423
|
-
var reg = /[\u4e00-\u9fa5]/mg;
|
|
3424
|
-
return reg.test(str);
|
|
3425
|
-
};
|
|
3426
|
-
ToolsClass2.prototype.isEmpty = function(val) {
|
|
3427
|
-
if (val == null)
|
|
3428
|
-
return true;
|
|
3429
|
-
if (typeof val === "boolean")
|
|
3429
|
+
ToolsClass2.prototype.containsEmoji = function(str) {
|
|
3430
|
+
var reg = /\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/mg;
|
|
3431
|
+
return reg.test(str);
|
|
3432
|
+
};
|
|
3433
|
+
ToolsClass2.prototype.containsHanZi = function(str) {
|
|
3434
|
+
var reg = /[\u4e00-\u9fa5]/mg;
|
|
3435
|
+
return reg.test(str);
|
|
3436
|
+
};
|
|
3437
|
+
ToolsClass2.prototype.isEmpty = function(val) {
|
|
3438
|
+
if (val == null)
|
|
3439
|
+
return true;
|
|
3440
|
+
if (typeof val === "boolean")
|
|
3441
|
+
return false;
|
|
3442
|
+
if (typeof val === "number")
|
|
3443
|
+
return !val;
|
|
3444
|
+
if (val instanceof Error)
|
|
3445
|
+
return val.message === "";
|
|
3446
|
+
switch (Object.prototype.toString.call(val)) {
|
|
3447
|
+
case "[object String]":
|
|
3448
|
+
case "[object Array]":
|
|
3449
|
+
return !val.length;
|
|
3450
|
+
case "[object File]":
|
|
3451
|
+
case "[object Map]":
|
|
3452
|
+
case "[object Set]": {
|
|
3453
|
+
return !val.size;
|
|
3454
|
+
}
|
|
3455
|
+
case "[object Object]": {
|
|
3456
|
+
return !Object.keys(val).length;
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3430
3459
|
return false;
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
switch (Object.prototype.toString.call(val)) {
|
|
3436
|
-
case "[object String]":
|
|
3437
|
-
case "[object Array]":
|
|
3438
|
-
return !val.length;
|
|
3439
|
-
case "[object File]":
|
|
3440
|
-
case "[object Map]":
|
|
3441
|
-
case "[object Set]": {
|
|
3442
|
-
return !val.size;
|
|
3443
|
-
}
|
|
3444
|
-
case "[object Object]": {
|
|
3445
|
-
return !Object.keys(val).length;
|
|
3460
|
+
};
|
|
3461
|
+
ToolsClass2.prototype.sensitiveField = function(field, before, after) {
|
|
3462
|
+
if (before === void 0) {
|
|
3463
|
+
before = 3;
|
|
3446
3464
|
}
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
};
|
|
3470
|
-
return ToolsClass2;
|
|
3471
|
-
}();
|
|
3472
|
-
tools$1.exports = new ToolsClass();
|
|
3473
|
-
const tools = /* @__PURE__ */ getDefaultExportFromCjs(tools$1.exports);
|
|
3474
|
-
const index_vue_vue_type_style_index_0_lang$4 = "";
|
|
3465
|
+
if (after === void 0) {
|
|
3466
|
+
after = 4;
|
|
3467
|
+
}
|
|
3468
|
+
if (!field) {
|
|
3469
|
+
return "";
|
|
3470
|
+
}
|
|
3471
|
+
field = String(field);
|
|
3472
|
+
var sensitiveLen = field.length - before - after;
|
|
3473
|
+
if (sensitiveLen < 0) {
|
|
3474
|
+
sensitiveLen = 0;
|
|
3475
|
+
}
|
|
3476
|
+
var regItem = "[一-龥a-zA-Z0-9]";
|
|
3477
|
+
var regExp = "(".concat(regItem, "{").concat(before, "})").concat(regItem, "*(").concat(regItem, "{").concat(after, "})");
|
|
3478
|
+
var reg = new RegExp(regExp);
|
|
3479
|
+
return field.replace(reg, "$1".concat("*".repeat(sensitiveLen), "$2"));
|
|
3480
|
+
};
|
|
3481
|
+
return ToolsClass2;
|
|
3482
|
+
}()
|
|
3483
|
+
);
|
|
3484
|
+
tools$2.exports = new ToolsClass();
|
|
3485
|
+
var toolsExports = tools$2.exports;
|
|
3486
|
+
const tools$1 = /* @__PURE__ */ getDefaultExportFromCjs(toolsExports);
|
|
3475
3487
|
const _hoisted_1$6 = { style: { "margin-left": "20px", "color": "#FF5A25" } };
|
|
3476
|
-
const _hoisted_2$
|
|
3477
|
-
const _hoisted_3$
|
|
3488
|
+
const _hoisted_2$3 = { class: "insert-article" };
|
|
3489
|
+
const _hoisted_3$3 = { class: "insert-article_input" };
|
|
3478
3490
|
const _hoisted_4$2 = {
|
|
3479
3491
|
key: 0,
|
|
3480
3492
|
class: "nodata"
|
|
@@ -3493,7 +3505,7 @@
|
|
|
3493
3505
|
key: 1,
|
|
3494
3506
|
style: { "display": "inline-flex", "flex-direction": "column" }
|
|
3495
3507
|
};
|
|
3496
|
-
const _sfc_main$6 = vue.defineComponent({
|
|
3508
|
+
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
3497
3509
|
__name: "index",
|
|
3498
3510
|
props: {
|
|
3499
3511
|
visible: { type: Boolean, default: false },
|
|
@@ -3501,7 +3513,7 @@
|
|
|
3501
3513
|
},
|
|
3502
3514
|
emits: ["change", "submit", "update:visible"],
|
|
3503
3515
|
setup(__props, { emit: __emit }) {
|
|
3504
|
-
const { debounce } = tools;
|
|
3516
|
+
const { debounce } = tools$1;
|
|
3505
3517
|
const vInfiniteScroll = elementPlus.ElInfiniteScroll;
|
|
3506
3518
|
const Radio_Type = {
|
|
3507
3519
|
MY_ARITICLE: "1",
|
|
@@ -3552,7 +3564,7 @@
|
|
|
3552
3564
|
};
|
|
3553
3565
|
const confirm = () => {
|
|
3554
3566
|
if (!data.article) {
|
|
3555
|
-
elementPlus.ElMessage.error(
|
|
3567
|
+
elementPlus.ElMessage.error(`请选择${isVideo ? "视频" : "文章"}`);
|
|
3556
3568
|
return;
|
|
3557
3569
|
}
|
|
3558
3570
|
data.article.isVideo = isVideo;
|
|
@@ -3576,6 +3588,7 @@
|
|
|
3576
3588
|
autherid: data.params.radio !== Radio_Type.ALL_ARITICLE ? userId : "",
|
|
3577
3589
|
limit: 20,
|
|
3578
3590
|
allType: data.params.radio,
|
|
3591
|
+
// 只有4 是查视频 其他是文章
|
|
3579
3592
|
title: data.params.title,
|
|
3580
3593
|
page: ++data.page
|
|
3581
3594
|
});
|
|
@@ -3595,21 +3608,21 @@
|
|
|
3595
3608
|
}, {
|
|
3596
3609
|
title: vue.withCtx(() => [
|
|
3597
3610
|
vue.createElementVNode("span", null, [
|
|
3598
|
-
vue.createTextVNode("
|
|
3599
|
-
vue.createElementVNode("strong", _hoisted_1$6, "
|
|
3611
|
+
_cache[8] || (_cache[8] = vue.createTextVNode("插入文章/视频", -1)),
|
|
3612
|
+
vue.createElementVNode("strong", _hoisted_1$6, "平台仅支持插入" + vue.toDisplayString(`${isVideo.value ? "2年" : "18个月"}`) + "内的推荐内容", 1)
|
|
3600
3613
|
])
|
|
3601
3614
|
]),
|
|
3602
3615
|
default: vue.withCtx(() => [
|
|
3603
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
3616
|
+
vue.createElementVNode("div", _hoisted_2$3, [
|
|
3604
3617
|
vue.createElementVNode("div", null, [
|
|
3605
3618
|
vue.createVNode(vue.unref(elementPlus.ElRadio), {
|
|
3606
3619
|
modelValue: data.params.radio,
|
|
3607
3620
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => data.params.radio = $event),
|
|
3608
3621
|
label: Radio_Type.MY_ARITICLE
|
|
3609
3622
|
}, {
|
|
3610
|
-
default: vue.withCtx(() => [
|
|
3611
|
-
vue.createTextVNode("
|
|
3612
|
-
]),
|
|
3623
|
+
default: vue.withCtx(() => [..._cache[9] || (_cache[9] = [
|
|
3624
|
+
vue.createTextVNode("从我的文章中选择", -1)
|
|
3625
|
+
])]),
|
|
3613
3626
|
_: 1
|
|
3614
3627
|
}, 8, ["modelValue", "label"]),
|
|
3615
3628
|
vue.createVNode(vue.unref(elementPlus.ElRadio), {
|
|
@@ -3617,9 +3630,9 @@
|
|
|
3617
3630
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => data.params.radio = $event),
|
|
3618
3631
|
label: Radio_Type.MY_VIDEO
|
|
3619
3632
|
}, {
|
|
3620
|
-
default: vue.withCtx(() => [
|
|
3621
|
-
vue.createTextVNode("
|
|
3622
|
-
]),
|
|
3633
|
+
default: vue.withCtx(() => [..._cache[10] || (_cache[10] = [
|
|
3634
|
+
vue.createTextVNode("从我的视频中选择", -1)
|
|
3635
|
+
])]),
|
|
3623
3636
|
_: 1
|
|
3624
3637
|
}, 8, ["modelValue", "label"]),
|
|
3625
3638
|
vue.createVNode(vue.unref(elementPlus.ElRadio), {
|
|
@@ -3627,17 +3640,17 @@
|
|
|
3627
3640
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => data.params.radio = $event),
|
|
3628
3641
|
label: Radio_Type.ALL_ARITICLE
|
|
3629
3642
|
}, {
|
|
3630
|
-
default: vue.withCtx(() => [
|
|
3631
|
-
vue.createTextVNode("
|
|
3632
|
-
]),
|
|
3643
|
+
default: vue.withCtx(() => [..._cache[11] || (_cache[11] = [
|
|
3644
|
+
vue.createTextVNode("从所有文章中选择", -1)
|
|
3645
|
+
])]),
|
|
3633
3646
|
_: 1
|
|
3634
3647
|
}, 8, ["modelValue", "label"])
|
|
3635
3648
|
]),
|
|
3636
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
3649
|
+
vue.createElementVNode("div", _hoisted_3$3, [
|
|
3637
3650
|
vue.createVNode(vue.unref(elementPlus.ElInput), {
|
|
3638
3651
|
modelValue: data.params.title,
|
|
3639
3652
|
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => data.params.title = $event),
|
|
3640
|
-
placeholder: isVideo.value ? "
|
|
3653
|
+
placeholder: isVideo.value ? "输入视频描述查找平台发布过的视频" : "输入标题名查找平台发过的文章",
|
|
3641
3654
|
onKeyup: _cache[5] || (_cache[5] = vue.withKeys(($event) => vue.unref(getArticleList)(true), ["enter", "native"])),
|
|
3642
3655
|
onInput: _cache[6] || (_cache[6] = ($event) => vue.unref(getArticleList)(true))
|
|
3643
3656
|
}, {
|
|
@@ -3651,7 +3664,7 @@
|
|
|
3651
3664
|
_: 1
|
|
3652
3665
|
}, 8, ["modelValue", "placeholder"])
|
|
3653
3666
|
]),
|
|
3654
|
-
data.data.length === 0 && !data.busy ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, vue.toDisplayString(
|
|
3667
|
+
data.data.length === 0 && !data.busy ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, vue.toDisplayString(`没有符合条件的${isVideo.value ? "视频" : "文章"}哦,你可以试试搜索其他${isVideo.value ? "视频" : "文章"}~`), 1)) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
3655
3668
|
key: 1,
|
|
3656
3669
|
"infinite-scroll-immediate": false,
|
|
3657
3670
|
class: "insert-article_list",
|
|
@@ -3683,12 +3696,12 @@
|
|
|
3683
3696
|
}, null, 8, _hoisted_9$1)
|
|
3684
3697
|
]),
|
|
3685
3698
|
vue.createElementVNode("div", _hoisted_10$1, [
|
|
3686
|
-
vue.createElementVNode("span", _hoisted_11$1, vue.toDisplayString(item.content || "[
|
|
3687
|
-
vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(date).format(item.createTime * 1e3, "YYYY-MM-DD hh-mm")), 1)
|
|
3699
|
+
vue.createElementVNode("span", _hoisted_11$1, vue.toDisplayString(item.content || "[无标题]"), 1),
|
|
3700
|
+
vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(date$1).format(item.createTime * 1e3, "YYYY-MM-DD hh-mm")), 1)
|
|
3688
3701
|
])
|
|
3689
3702
|
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$1, [
|
|
3690
|
-
vue.createElementVNode("span", null, vue.toDisplayString(item.title || "[
|
|
3691
|
-
vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(date).format(item.createTime * 1e3, "YYYY-MM-DD")), 1)
|
|
3703
|
+
vue.createElementVNode("span", null, vue.toDisplayString(item.title || "[无标题]"), 1),
|
|
3704
|
+
vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(date$1).format(item.createTime * 1e3, "YYYY-MM-DD")), 1)
|
|
3692
3705
|
]))
|
|
3693
3706
|
];
|
|
3694
3707
|
}),
|
|
@@ -3706,6 +3719,7 @@
|
|
|
3706
3719
|
};
|
|
3707
3720
|
}
|
|
3708
3721
|
});
|
|
3722
|
+
const index_vue_vue_type_style_index_0_lang$4 = "";
|
|
3709
3723
|
let getRandomValues;
|
|
3710
3724
|
const rnds8 = new Uint8Array(16);
|
|
3711
3725
|
function rng() {
|
|
@@ -3745,10 +3759,9 @@
|
|
|
3745
3759
|
}
|
|
3746
3760
|
return unsafeStringify(rnds);
|
|
3747
3761
|
}
|
|
3748
|
-
const index_vue_vue_type_style_index_0_lang$3 = "";
|
|
3749
3762
|
const _hoisted_1$5 = { class: "img-upload-content" };
|
|
3750
|
-
const _hoisted_2$
|
|
3751
|
-
const _hoisted_3$
|
|
3763
|
+
const _hoisted_2$2 = { class: "title-box" };
|
|
3764
|
+
const _hoisted_3$2 = ["onClick"];
|
|
3752
3765
|
const _hoisted_4$1 = {
|
|
3753
3766
|
key: 0,
|
|
3754
3767
|
class: "line"
|
|
@@ -3777,41 +3790,38 @@
|
|
|
3777
3790
|
key: 0,
|
|
3778
3791
|
class: "upload-wrap"
|
|
3779
3792
|
};
|
|
3780
|
-
const _hoisted_14 =
|
|
3781
|
-
const _hoisted_15 = /* @__PURE__ */ vue.createElementVNode("span", { class: "remark" }, "\u652F\u6301jpg\u3001jpeg\u3001png\u7B49\u591A\u79CD\u683C\u5F0F\uFF0C\u5355\u5F20\u56FE\u7247\u6700\u5927\u652F\u630120MB", -1);
|
|
3782
|
-
const _hoisted_16 = {
|
|
3793
|
+
const _hoisted_14 = {
|
|
3783
3794
|
key: 1,
|
|
3784
3795
|
class: "img-list"
|
|
3785
3796
|
};
|
|
3786
|
-
const
|
|
3787
|
-
const
|
|
3788
|
-
const
|
|
3797
|
+
const _hoisted_15 = ["src"];
|
|
3798
|
+
const _hoisted_16 = { class: "upload-btn" };
|
|
3799
|
+
const _hoisted_17 = {
|
|
3789
3800
|
key: 2,
|
|
3790
3801
|
class: "map-depot"
|
|
3791
3802
|
};
|
|
3792
|
-
const
|
|
3793
|
-
const
|
|
3794
|
-
const
|
|
3795
|
-
const
|
|
3796
|
-
const
|
|
3803
|
+
const _hoisted_18 = { class: "screen" };
|
|
3804
|
+
const _hoisted_19 = { key: 0 };
|
|
3805
|
+
const _hoisted_20 = { class: "tab-box" };
|
|
3806
|
+
const _hoisted_21 = ["onClick"];
|
|
3807
|
+
const _hoisted_22 = {
|
|
3797
3808
|
key: 0,
|
|
3798
3809
|
class: "line"
|
|
3799
3810
|
};
|
|
3800
|
-
const
|
|
3801
|
-
const
|
|
3802
|
-
const
|
|
3803
|
-
const
|
|
3811
|
+
const _hoisted_23 = { class: "image-list depot-image" };
|
|
3812
|
+
const _hoisted_24 = ["onClick"];
|
|
3813
|
+
const _hoisted_25 = ["src"];
|
|
3814
|
+
const _hoisted_26 = {
|
|
3804
3815
|
key: 0,
|
|
3805
3816
|
class: "shade"
|
|
3806
3817
|
};
|
|
3807
|
-
const
|
|
3808
|
-
const
|
|
3818
|
+
const _hoisted_27 = { class: "num" };
|
|
3819
|
+
const _hoisted_28 = {
|
|
3809
3820
|
key: 1,
|
|
3810
3821
|
class: "protocol-box"
|
|
3811
3822
|
};
|
|
3812
|
-
const
|
|
3813
|
-
const
|
|
3814
|
-
const _sfc_main$5 = vue.defineComponent({
|
|
3823
|
+
const _hoisted_29 = ["href"];
|
|
3824
|
+
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
3815
3825
|
__name: "index",
|
|
3816
3826
|
props: {
|
|
3817
3827
|
visible: { type: Boolean, default: false },
|
|
@@ -3846,7 +3856,7 @@
|
|
|
3846
3856
|
const tempImgs = [...props.imgList];
|
|
3847
3857
|
Array.from(imgFile).forEach((file) => {
|
|
3848
3858
|
if (file.size > 20 * 1024 * 1024) {
|
|
3849
|
-
elementPlus.ElMessage.error("
|
|
3859
|
+
elementPlus.ElMessage.error("单张图片最大支持20M");
|
|
3850
3860
|
return;
|
|
3851
3861
|
}
|
|
3852
3862
|
const id = v4();
|
|
@@ -3876,14 +3886,14 @@
|
|
|
3876
3886
|
const list = [
|
|
3877
3887
|
{
|
|
3878
3888
|
id: 2,
|
|
3879
|
-
value: "
|
|
3889
|
+
value: "上传图片"
|
|
3880
3890
|
}
|
|
3881
3891
|
];
|
|
3882
3892
|
activeTitle.value = 2;
|
|
3883
3893
|
if (props.imgNum < 20) {
|
|
3884
3894
|
list.unshift({
|
|
3885
3895
|
id: 1,
|
|
3886
|
-
value: "
|
|
3896
|
+
value: "正文图片"
|
|
3887
3897
|
});
|
|
3888
3898
|
activeTitle.value = 1;
|
|
3889
3899
|
getContentImgList();
|
|
@@ -3891,7 +3901,7 @@
|
|
|
3891
3901
|
if (props.chartGallery) {
|
|
3892
3902
|
list.push({
|
|
3893
3903
|
id: 3,
|
|
3894
|
-
value: isEmotofine ? "
|
|
3904
|
+
value: isEmotofine ? "电摩范图库" : "摩托范图库"
|
|
3895
3905
|
});
|
|
3896
3906
|
}
|
|
3897
3907
|
titleList.value = list;
|
|
@@ -4036,13 +4046,13 @@
|
|
|
4036
4046
|
const tabList = vue.ref([]);
|
|
4037
4047
|
const search = () => {
|
|
4038
4048
|
if (!selectData.brandId) {
|
|
4039
|
-
return elementPlus.ElMessage.error("
|
|
4049
|
+
return elementPlus.ElMessage.error("请选择品牌");
|
|
4040
4050
|
}
|
|
4041
4051
|
if (!selectData.goodId) {
|
|
4042
|
-
return elementPlus.ElMessage.error("
|
|
4052
|
+
return elementPlus.ElMessage.error("请选择车型");
|
|
4043
4053
|
}
|
|
4044
4054
|
if (!selectData.carId) {
|
|
4045
|
-
return elementPlus.ElMessage.error("
|
|
4055
|
+
return elementPlus.ElMessage.error("请选择款型");
|
|
4046
4056
|
}
|
|
4047
4057
|
tabList.value = [];
|
|
4048
4058
|
emits("update:imgList", []);
|
|
@@ -4099,7 +4109,7 @@
|
|
|
4099
4109
|
}, {
|
|
4100
4110
|
default: vue.withCtx(() => [
|
|
4101
4111
|
vue.createElementVNode("div", _hoisted_1$5, [
|
|
4102
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
4112
|
+
vue.createElementVNode("div", _hoisted_2$2, [
|
|
4103
4113
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(titleList.value, (item, index) => {
|
|
4104
4114
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4105
4115
|
key: index,
|
|
@@ -4108,10 +4118,10 @@
|
|
|
4108
4118
|
}, [
|
|
4109
4119
|
vue.createTextVNode(vue.toDisplayString(item.value) + " ", 1),
|
|
4110
4120
|
item.id === activeTitle.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1)) : vue.createCommentVNode("", true)
|
|
4111
|
-
], 10, _hoisted_3$
|
|
4121
|
+
], 10, _hoisted_3$2);
|
|
4112
4122
|
}), 128)),
|
|
4113
|
-
[1, 3].includes(activeTitle.value) && props.imgList.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$1, "
|
|
4114
|
-
activeTitle.value === 2 && props.imgList.length > 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, vue.toDisplayString(props.imgList.length) + "
|
|
4123
|
+
[1, 3].includes(activeTitle.value) && props.imgList.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$1, " 最多可选" + vue.toDisplayString(props.imgNum) + "张图片,已选" + vue.toDisplayString(props.imgList.length) + "张 ", 1)) : vue.createCommentVNode("", true),
|
|
4124
|
+
activeTitle.value === 2 && props.imgList.length > 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, vue.toDisplayString(props.imgList.length) + "张上传成功 拖动可调整顺序 ", 1)) : vue.createCommentVNode("", true)
|
|
4115
4125
|
]),
|
|
4116
4126
|
activeTitle.value === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
|
|
4117
4127
|
vue.createElementVNode("div", _hoisted_8, [
|
|
@@ -4148,11 +4158,11 @@
|
|
|
4148
4158
|
]),
|
|
4149
4159
|
_: 1
|
|
4150
4160
|
}),
|
|
4151
|
-
|
|
4161
|
+
_cache[7] || (_cache[7] = vue.createElementVNode("span", null, "本地上传", -1))
|
|
4152
4162
|
]),
|
|
4153
|
-
|
|
4154
|
-
])) : (vue.openBlock(), vue.createElementBlock("div",
|
|
4155
|
-
vue.createVNode(vue.unref(
|
|
4163
|
+
_cache[8] || (_cache[8] = vue.createElementVNode("span", { class: "remark" }, "支持jpg、jpeg、png等多种格式,单张图片最大支持20MB", -1))
|
|
4164
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, [
|
|
4165
|
+
vue.createVNode(vue.unref(draggable), {
|
|
4156
4166
|
modelValue: imgListTemp.value,
|
|
4157
4167
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => imgListTemp.value = $event),
|
|
4158
4168
|
handle: ".img-item",
|
|
@@ -4172,7 +4182,7 @@
|
|
|
4172
4182
|
style: { "object-fit": "contain" },
|
|
4173
4183
|
width: "120",
|
|
4174
4184
|
height: "120"
|
|
4175
|
-
}, null, 8,
|
|
4185
|
+
}, null, 8, _hoisted_15),
|
|
4176
4186
|
vue.createVNode(vue.unref(iconsVue.CircleCloseFilled), {
|
|
4177
4187
|
class: "icon pointer",
|
|
4178
4188
|
onClick: ($event) => deleteImg(element)
|
|
@@ -4195,7 +4205,7 @@
|
|
|
4195
4205
|
_: 1
|
|
4196
4206
|
}, 8, ["modelValue"])
|
|
4197
4207
|
])),
|
|
4198
|
-
vue.createElementVNode("div",
|
|
4208
|
+
vue.createElementVNode("div", _hoisted_16, [
|
|
4199
4209
|
vue.createElementVNode("input", {
|
|
4200
4210
|
type: "file",
|
|
4201
4211
|
name: "file",
|
|
@@ -4206,13 +4216,13 @@
|
|
|
4206
4216
|
}, null, 32)
|
|
4207
4217
|
])
|
|
4208
4218
|
], 2)) : vue.createCommentVNode("", true),
|
|
4209
|
-
activeTitle.value === 3 ? (vue.openBlock(), vue.createElementBlock("div",
|
|
4210
|
-
vue.createElementVNode("div",
|
|
4219
|
+
activeTitle.value === 3 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17, [
|
|
4220
|
+
vue.createElementVNode("div", _hoisted_18, [
|
|
4211
4221
|
vue.createElementVNode("div", null, [
|
|
4212
4222
|
vue.createVNode(vue.unref(elementPlus.ElSelect), {
|
|
4213
4223
|
modelValue: selectData.brandId,
|
|
4214
4224
|
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => selectData.brandId = $event),
|
|
4215
|
-
placeholder: "
|
|
4225
|
+
placeholder: "请选择品牌",
|
|
4216
4226
|
size: "large",
|
|
4217
4227
|
class: "select_1",
|
|
4218
4228
|
filterable: "",
|
|
@@ -4233,7 +4243,7 @@
|
|
|
4233
4243
|
vue.createVNode(vue.unref(elementPlus.ElSelect), {
|
|
4234
4244
|
modelValue: selectData.goodId,
|
|
4235
4245
|
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => selectData.goodId = $event),
|
|
4236
|
-
placeholder: "
|
|
4246
|
+
placeholder: "请选择车型",
|
|
4237
4247
|
size: "large",
|
|
4238
4248
|
class: "select_1",
|
|
4239
4249
|
filterable: "",
|
|
@@ -4254,7 +4264,7 @@
|
|
|
4254
4264
|
vue.createVNode(vue.unref(elementPlus.ElSelect), {
|
|
4255
4265
|
modelValue: selectData.carId,
|
|
4256
4266
|
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => selectData.carId = $event),
|
|
4257
|
-
placeholder: "
|
|
4267
|
+
placeholder: "请选择款型",
|
|
4258
4268
|
size: "large",
|
|
4259
4269
|
class: "select_2",
|
|
4260
4270
|
filterable: "",
|
|
@@ -4278,14 +4288,14 @@
|
|
|
4278
4288
|
style: { "width": "80px" },
|
|
4279
4289
|
onClick: search
|
|
4280
4290
|
}, {
|
|
4281
|
-
default: vue.withCtx(() => [
|
|
4282
|
-
vue.createTextVNode("
|
|
4283
|
-
]),
|
|
4291
|
+
default: vue.withCtx(() => [..._cache[9] || (_cache[9] = [
|
|
4292
|
+
vue.createTextVNode("搜索", -1)
|
|
4293
|
+
])]),
|
|
4284
4294
|
_: 1
|
|
4285
4295
|
})
|
|
4286
4296
|
]),
|
|
4287
|
-
tabList.value && tabList.value.length ? (vue.openBlock(), vue.createElementBlock("div",
|
|
4288
|
-
vue.createElementVNode("div",
|
|
4297
|
+
tabList.value && tabList.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_19, [
|
|
4298
|
+
vue.createElementVNode("div", _hoisted_20, [
|
|
4289
4299
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tabList.value, (item, index) => {
|
|
4290
4300
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4291
4301
|
key: index,
|
|
@@ -4293,11 +4303,11 @@
|
|
|
4293
4303
|
onClick: ($event) => activeTab.value = item.type
|
|
4294
4304
|
}, [
|
|
4295
4305
|
vue.createTextVNode(vue.toDisplayString(item.name) + " ", 1),
|
|
4296
|
-
item.type === activeTab.value ? (vue.openBlock(), vue.createElementBlock("div",
|
|
4297
|
-
], 10,
|
|
4306
|
+
item.type === activeTab.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_22)) : vue.createCommentVNode("", true)
|
|
4307
|
+
], 10, _hoisted_21);
|
|
4298
4308
|
}), 128))
|
|
4299
4309
|
]),
|
|
4300
|
-
vue.createElementVNode("div",
|
|
4310
|
+
vue.createElementVNode("div", _hoisted_23, [
|
|
4301
4311
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(imageList.value, (item, index) => {
|
|
4302
4312
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4303
4313
|
key: index,
|
|
@@ -4308,25 +4318,25 @@
|
|
|
4308
4318
|
src: item.imgOrgUrl,
|
|
4309
4319
|
alt: "",
|
|
4310
4320
|
class: "image"
|
|
4311
|
-
}, null, 8,
|
|
4312
|
-
item.num ? (vue.openBlock(), vue.createElementBlock("div",
|
|
4313
|
-
vue.createElementVNode("div",
|
|
4321
|
+
}, null, 8, _hoisted_25),
|
|
4322
|
+
item.num ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_26, [
|
|
4323
|
+
vue.createElementVNode("div", _hoisted_27, vue.toDisplayString(item.num), 1)
|
|
4314
4324
|
])) : vue.createCommentVNode("", true)
|
|
4315
|
-
], 8,
|
|
4325
|
+
], 8, _hoisted_24);
|
|
4316
4326
|
}), 128))
|
|
4317
4327
|
])
|
|
4318
|
-
])) : (vue.openBlock(), vue.createElementBlock("div",
|
|
4328
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_28, [
|
|
4319
4329
|
vue.createElementVNode("div", null, [
|
|
4320
|
-
|
|
4330
|
+
_cache[12] || (_cache[12] = vue.createElementVNode("div", null, " 图库中的图片仅限下载摩托范以编辑发布文章使用,不得用于其他任何平台及用途 ", -1)),
|
|
4321
4331
|
vue.createElementVNode("div", null, [
|
|
4322
|
-
vue.createTextVNode("
|
|
4332
|
+
_cache[10] || (_cache[10] = vue.createTextVNode(" 请阅读", -1)),
|
|
4323
4333
|
vue.createElementVNode("a", {
|
|
4324
4334
|
href: `https://${vue.unref(hostName)}/about?type=imageLicenseAgreement`,
|
|
4325
4335
|
target: "_blank",
|
|
4326
4336
|
rel: "noopener noreferrer",
|
|
4327
4337
|
class: "link"
|
|
4328
|
-
}, "
|
|
4329
|
-
vue.createTextVNode("
|
|
4338
|
+
}, "《摩托范图片许可使用协议》", 8, _hoisted_29),
|
|
4339
|
+
_cache[11] || (_cache[11] = vue.createTextVNode(",您的行为视为您已同意该协议。 ", -1))
|
|
4330
4340
|
])
|
|
4331
4341
|
])
|
|
4332
4342
|
]))
|
|
@@ -4338,11 +4348,9 @@
|
|
|
4338
4348
|
};
|
|
4339
4349
|
}
|
|
4340
4350
|
});
|
|
4341
|
-
const index_vue_vue_type_style_index_0_lang$
|
|
4342
|
-
const _hoisted_1$4 =
|
|
4343
|
-
const
|
|
4344
|
-
const _hoisted_3$3 = /* @__PURE__ */ vue.createElementVNode("span", { class: "remark" }, "\u4E3A\u4E86\u83B7\u5F97\u66F4\u9AD8\u7684\u63A8\u8350\u91CF\u548C\u70B9\u51FB\u91CF\uFF0C\u5EFA\u8BAE\u4E0A\u4F20720p\uFF081280*720\uFF09\u6216\u66F4\u9AD8\u5206\u8FA8\u7387\u7684\u89C6\u9891\uFF0C\u89C6\u9891\u683C\u5F0F\u4E3A.mp4\u6216.mov\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC71G", -1);
|
|
4345
|
-
const _sfc_main$4 = vue.defineComponent({
|
|
4351
|
+
const index_vue_vue_type_style_index_0_lang$3 = "";
|
|
4352
|
+
const _hoisted_1$4 = { class: "insert-video" };
|
|
4353
|
+
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
4346
4354
|
__name: "index",
|
|
4347
4355
|
props: {
|
|
4348
4356
|
visible: { type: Boolean, default: false },
|
|
@@ -4370,23 +4378,23 @@
|
|
|
4370
4378
|
width: "600px",
|
|
4371
4379
|
height: "100px"
|
|
4372
4380
|
}, {
|
|
4373
|
-
title: vue.withCtx(() => [
|
|
4374
|
-
|
|
4375
|
-
]),
|
|
4381
|
+
title: vue.withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
4382
|
+
vue.createElementVNode("span", null, "插入视频", -1)
|
|
4383
|
+
])]),
|
|
4376
4384
|
default: vue.withCtx(() => [
|
|
4377
|
-
vue.createElementVNode("div",
|
|
4385
|
+
vue.createElementVNode("div", _hoisted_1$4, [
|
|
4378
4386
|
vue.createVNode(vue.unref(elementPlus.ElButton), {
|
|
4379
4387
|
style: { "width": "120px" },
|
|
4380
4388
|
round: "",
|
|
4381
4389
|
type: "primary",
|
|
4382
4390
|
onClick: emitEvent
|
|
4383
4391
|
}, {
|
|
4384
|
-
default: vue.withCtx(() => [
|
|
4385
|
-
vue.createTextVNode("
|
|
4386
|
-
]),
|
|
4392
|
+
default: vue.withCtx(() => [..._cache[2] || (_cache[2] = [
|
|
4393
|
+
vue.createTextVNode("选择视频", -1)
|
|
4394
|
+
])]),
|
|
4387
4395
|
_: 1
|
|
4388
4396
|
}),
|
|
4389
|
-
|
|
4397
|
+
_cache[3] || (_cache[3] = vue.createElementVNode("span", { class: "remark" }, "为了获得更高的推荐量和点击量,建议上传720p(1280*720)或更高分辨率的视频,视频格式为.mp4或.mov,大小不超过1G", -1)),
|
|
4390
4398
|
vue.createElementVNode("input", {
|
|
4391
4399
|
type: "file",
|
|
4392
4400
|
accept: "video/*",
|
|
@@ -4401,14 +4409,17 @@
|
|
|
4401
4409
|
};
|
|
4402
4410
|
}
|
|
4403
4411
|
});
|
|
4412
|
+
const index_vue_vue_type_style_index_0_lang$2 = "";
|
|
4404
4413
|
const index_vue_vue_type_style_index_0_lang$1 = "";
|
|
4405
4414
|
const _sfc_main$3 = {
|
|
4406
4415
|
name: "TopicManager",
|
|
4407
4416
|
props: {
|
|
4417
|
+
// 编辑器DOM引用
|
|
4408
4418
|
editorDom: {
|
|
4409
4419
|
type: Object,
|
|
4410
4420
|
default: null
|
|
4411
4421
|
},
|
|
4422
|
+
// 话题API请求方法
|
|
4412
4423
|
request: {
|
|
4413
4424
|
type: Object,
|
|
4414
4425
|
default: null
|
|
@@ -4416,10 +4427,13 @@
|
|
|
4416
4427
|
},
|
|
4417
4428
|
data() {
|
|
4418
4429
|
return {
|
|
4430
|
+
// 话题弹框相关数据
|
|
4419
4431
|
topicPopover: {
|
|
4420
4432
|
visible: false,
|
|
4421
4433
|
type: "hot",
|
|
4434
|
+
// 'hot' 热门话题, 'search' 搜索话题
|
|
4422
4435
|
activeTab: "hot",
|
|
4436
|
+
// 'hot' 热门话题, 'recent' 最近使用
|
|
4423
4437
|
position: { top: 0, left: 0 },
|
|
4424
4438
|
searchKeyword: "",
|
|
4425
4439
|
hotTopics: [],
|
|
@@ -4430,22 +4444,30 @@
|
|
|
4430
4444
|
hasMore: true,
|
|
4431
4445
|
searchPage: 1,
|
|
4432
4446
|
searchHasMore: true,
|
|
4447
|
+
// 用于增量更新的计数器
|
|
4433
4448
|
newHotTopicsCount: 0,
|
|
4434
4449
|
newSearchTopicsCount: 0,
|
|
4450
|
+
// 保存原始的selection和range信息
|
|
4435
4451
|
originalRange: null,
|
|
4436
4452
|
originalSelection: null,
|
|
4453
|
+
// 保存触发位置信息
|
|
4437
4454
|
triggerInfo: {
|
|
4438
4455
|
paragraph: null,
|
|
4439
4456
|
hashIndex: -1,
|
|
4440
4457
|
cursorPosition: 0
|
|
4441
4458
|
},
|
|
4459
|
+
// 全局弹框DOM引用
|
|
4442
4460
|
globalContainer: null,
|
|
4443
4461
|
globalMask: null
|
|
4444
4462
|
},
|
|
4445
|
-
|
|
4463
|
+
// 中文输入法状态
|
|
4464
|
+
isComposing: false,
|
|
4465
|
+
// 保存的光标位置(外部调用insertHotTopic时使用)
|
|
4466
|
+
savedRange: null
|
|
4446
4467
|
};
|
|
4447
4468
|
},
|
|
4448
4469
|
methods: {
|
|
4470
|
+
// 初始化话题管理器
|
|
4449
4471
|
init() {
|
|
4450
4472
|
if (!this.editorDom) {
|
|
4451
4473
|
console.warn("TopicManager: editorDom is required");
|
|
@@ -4453,6 +4475,7 @@
|
|
|
4453
4475
|
}
|
|
4454
4476
|
setTimeout(() => this.bindEditorEvents(), 0);
|
|
4455
4477
|
},
|
|
4478
|
+
// 绑定编辑器事件
|
|
4456
4479
|
bindEditorEvents() {
|
|
4457
4480
|
if (!this.editorDom)
|
|
4458
4481
|
return;
|
|
@@ -4460,7 +4483,9 @@
|
|
|
4460
4483
|
this.editorDom.addEventListener("compositionstart", this.handleCompositionStart.bind(this));
|
|
4461
4484
|
this.editorDom.addEventListener("compositionend", this.handleCompositionEnd.bind(this));
|
|
4462
4485
|
this.editorDom.addEventListener("input", this.handleInput.bind(this));
|
|
4486
|
+
document.addEventListener("mousedown", this.handleExternalMouseDown.bind(this));
|
|
4463
4487
|
},
|
|
4488
|
+
// 解绑编辑器事件
|
|
4464
4489
|
unbindEditorEvents() {
|
|
4465
4490
|
if (!this.editorDom)
|
|
4466
4491
|
return;
|
|
@@ -4468,16 +4493,34 @@
|
|
|
4468
4493
|
this.editorDom.removeEventListener("compositionstart", this.handleCompositionStart.bind(this));
|
|
4469
4494
|
this.editorDom.removeEventListener("compositionend", this.handleCompositionEnd.bind(this));
|
|
4470
4495
|
this.editorDom.removeEventListener("input", this.handleInput.bind(this));
|
|
4496
|
+
document.removeEventListener("mousedown", this.handleExternalMouseDown.bind(this));
|
|
4497
|
+
},
|
|
4498
|
+
// 处理外部鼠标按下事件,保存编辑器光标位置
|
|
4499
|
+
handleExternalMouseDown(event) {
|
|
4500
|
+
console.log(929);
|
|
4501
|
+
const hotTopicBtn = event.target.closest(".add-hot-topic");
|
|
4502
|
+
if (hotTopicBtn) {
|
|
4503
|
+
const selection = window.getSelection();
|
|
4504
|
+
if (selection.rangeCount > 0) {
|
|
4505
|
+
const range = selection.getRangeAt(0);
|
|
4506
|
+
if (this.editorDom.contains(range.startContainer)) {
|
|
4507
|
+
this.savedRange = range.cloneRange();
|
|
4508
|
+
}
|
|
4509
|
+
}
|
|
4510
|
+
}
|
|
4471
4511
|
},
|
|
4512
|
+
// 中文输入法开始事件
|
|
4472
4513
|
handleCompositionStart() {
|
|
4473
4514
|
this.isComposing = true;
|
|
4474
4515
|
},
|
|
4516
|
+
// 中文输入法结束事件(中文)
|
|
4475
4517
|
handleCompositionEnd() {
|
|
4476
4518
|
this.isComposing = false;
|
|
4477
4519
|
setTimeout(() => {
|
|
4478
4520
|
this.handleInputChange();
|
|
4479
4521
|
}, 10);
|
|
4480
4522
|
},
|
|
4523
|
+
// input事件处理(英文)
|
|
4481
4524
|
handleInput() {
|
|
4482
4525
|
if (!this.isComposing) {
|
|
4483
4526
|
setTimeout(() => {
|
|
@@ -4485,6 +4528,7 @@
|
|
|
4485
4528
|
}, 10);
|
|
4486
4529
|
}
|
|
4487
4530
|
},
|
|
4531
|
+
// 处理输入变化
|
|
4488
4532
|
handleInputChange() {
|
|
4489
4533
|
var _a;
|
|
4490
4534
|
const selection = window.getSelection();
|
|
@@ -4512,6 +4556,7 @@
|
|
|
4512
4556
|
return;
|
|
4513
4557
|
this.checkAndTriggerSearch(paragraph);
|
|
4514
4558
|
},
|
|
4559
|
+
// 话题输入处理
|
|
4515
4560
|
handleTopicInput(event) {
|
|
4516
4561
|
var _a;
|
|
4517
4562
|
const activeElement = document.activeElement;
|
|
@@ -4552,7 +4597,9 @@
|
|
|
4552
4597
|
const triggerInfo = {
|
|
4553
4598
|
paragraph,
|
|
4554
4599
|
hashIndex: cursorPosition,
|
|
4600
|
+
// #号的位置
|
|
4555
4601
|
cursorPosition: cursorPosition + 1
|
|
4602
|
+
// #号后的位置
|
|
4556
4603
|
};
|
|
4557
4604
|
this.showTopicPopover("hot", position, "", triggerInfo);
|
|
4558
4605
|
}, 10);
|
|
@@ -4648,6 +4695,7 @@
|
|
|
4648
4695
|
tempElement.remove();
|
|
4649
4696
|
const position = {
|
|
4650
4697
|
top: rect.bottom,
|
|
4698
|
+
// 弹框显示在光标下方
|
|
4651
4699
|
left: rect.left
|
|
4652
4700
|
};
|
|
4653
4701
|
const viewportWidth = window.innerWidth;
|
|
@@ -4665,7 +4713,7 @@
|
|
|
4665
4713
|
}
|
|
4666
4714
|
return position;
|
|
4667
4715
|
} catch (error) {
|
|
4668
|
-
console.warn("
|
|
4716
|
+
console.warn("获取光标位置失败,使用fallback方法:", error);
|
|
4669
4717
|
const rect = range.getBoundingClientRect();
|
|
4670
4718
|
return {
|
|
4671
4719
|
top: rect.bottom,
|
|
@@ -4673,9 +4721,10 @@
|
|
|
4673
4721
|
};
|
|
4674
4722
|
}
|
|
4675
4723
|
},
|
|
4724
|
+
// 话题弹框相关方法
|
|
4676
4725
|
showTopicPopover(type, position, searchKeyword = "", triggerInfo = null) {
|
|
4677
4726
|
if (!this.request || !this.request.getTopic) {
|
|
4678
|
-
console.warn("
|
|
4727
|
+
console.warn("话题功能需要提供 request.getTopic 方法");
|
|
4679
4728
|
return;
|
|
4680
4729
|
}
|
|
4681
4730
|
const selection = window.getSelection();
|
|
@@ -4748,11 +4797,11 @@
|
|
|
4748
4797
|
}
|
|
4749
4798
|
}
|
|
4750
4799
|
} else {
|
|
4751
|
-
console.warn("
|
|
4800
|
+
console.warn("加载热门话题失败:", response);
|
|
4752
4801
|
this.topicPopover.hasMore = false;
|
|
4753
4802
|
}
|
|
4754
4803
|
} catch (error) {
|
|
4755
|
-
console.error("
|
|
4804
|
+
console.error("加载热门话题失败:", error);
|
|
4756
4805
|
this.topicPopover.hasMore = false;
|
|
4757
4806
|
} finally {
|
|
4758
4807
|
this.topicPopover.loading = false;
|
|
@@ -4786,17 +4835,18 @@
|
|
|
4786
4835
|
this.topicPopover.searchHasMore = topics.length >= 50;
|
|
4787
4836
|
}
|
|
4788
4837
|
} else {
|
|
4789
|
-
console.warn("
|
|
4838
|
+
console.warn("搜索话题失败:", response);
|
|
4790
4839
|
this.topicPopover.searchHasMore = false;
|
|
4791
4840
|
}
|
|
4792
4841
|
} catch (error) {
|
|
4793
|
-
console.error("
|
|
4842
|
+
console.error("搜索话题失败:", error);
|
|
4794
4843
|
this.topicPopover.searchHasMore = false;
|
|
4795
4844
|
} finally {
|
|
4796
4845
|
this.topicPopover.loading = false;
|
|
4797
4846
|
this.updateGlobalTopicPopover();
|
|
4798
4847
|
}
|
|
4799
4848
|
},
|
|
4849
|
+
// 加载更多搜索话题
|
|
4800
4850
|
async loadSearchTopics() {
|
|
4801
4851
|
if (this.topicPopover.loading || !this.topicPopover.searchHasMore)
|
|
4802
4852
|
return;
|
|
@@ -4824,11 +4874,11 @@
|
|
|
4824
4874
|
}
|
|
4825
4875
|
}
|
|
4826
4876
|
} else {
|
|
4827
|
-
console.warn("
|
|
4877
|
+
console.warn("加载更多搜索话题失败:", response);
|
|
4828
4878
|
this.topicPopover.searchHasMore = false;
|
|
4829
4879
|
}
|
|
4830
4880
|
} catch (error) {
|
|
4831
|
-
console.error("
|
|
4881
|
+
console.error("加载更多搜索话题失败:", error);
|
|
4832
4882
|
this.topicPopover.searchHasMore = false;
|
|
4833
4883
|
} finally {
|
|
4834
4884
|
this.topicPopover.loading = false;
|
|
@@ -4840,7 +4890,7 @@
|
|
|
4840
4890
|
const localTopics = JSON.parse(localStorage.getItem("localTopic") || "[]");
|
|
4841
4891
|
this.topicPopover.recentTopics = localTopics;
|
|
4842
4892
|
} catch (error) {
|
|
4843
|
-
console.error("
|
|
4893
|
+
console.error("加载最近使用话题失败:", error);
|
|
4844
4894
|
this.topicPopover.recentTopics = [];
|
|
4845
4895
|
}
|
|
4846
4896
|
},
|
|
@@ -4860,9 +4910,10 @@
|
|
|
4860
4910
|
}
|
|
4861
4911
|
localStorage.setItem("localTopic", JSON.stringify(recentTopics));
|
|
4862
4912
|
} catch (error) {
|
|
4863
|
-
console.error("
|
|
4913
|
+
console.error("保存最近使用话题失败:", error);
|
|
4864
4914
|
}
|
|
4865
4915
|
},
|
|
4916
|
+
// 创建全局话题弹框
|
|
4866
4917
|
createGlobalTopicPopover() {
|
|
4867
4918
|
this.removeGlobalTopicPopover();
|
|
4868
4919
|
const mask = document.createElement("div");
|
|
@@ -4886,6 +4937,7 @@
|
|
|
4886
4937
|
this.topicPopover.globalContainer = container;
|
|
4887
4938
|
this.bindTopicPopoverEvents();
|
|
4888
4939
|
},
|
|
4940
|
+
// 移除全局话题弹框
|
|
4889
4941
|
removeGlobalTopicPopover() {
|
|
4890
4942
|
if (this.topicPopover.globalMask) {
|
|
4891
4943
|
document.body.removeChild(this.topicPopover.globalMask);
|
|
@@ -4896,12 +4948,14 @@
|
|
|
4896
4948
|
this.topicPopover.globalContainer = null;
|
|
4897
4949
|
}
|
|
4898
4950
|
},
|
|
4951
|
+
// 更新全局话题弹框内容
|
|
4899
4952
|
updateGlobalTopicPopover() {
|
|
4900
4953
|
if (!this.topicPopover.globalContainer)
|
|
4901
4954
|
return;
|
|
4902
4955
|
this.topicPopover.globalContainer.innerHTML = this.createTopicPopoverContent();
|
|
4903
4956
|
this.bindTopicPopoverEvents();
|
|
4904
4957
|
},
|
|
4958
|
+
// 增量添加热门话题到DOM,避免重绘
|
|
4905
4959
|
appendHotTopicsToDOM() {
|
|
4906
4960
|
if (!this.topicPopover.globalContainer || this.topicPopover.newHotTopicsCount === 0)
|
|
4907
4961
|
return;
|
|
@@ -4925,6 +4979,7 @@
|
|
|
4925
4979
|
this.updateLoadingState(topicList, this.topicPopover.loading, this.topicPopover.hasMore);
|
|
4926
4980
|
this.topicPopover.newHotTopicsCount = 0;
|
|
4927
4981
|
},
|
|
4982
|
+
// 增量添加搜索话题到DOM,避免重绘
|
|
4928
4983
|
appendSearchTopicsToDOM() {
|
|
4929
4984
|
if (!this.topicPopover.globalContainer || this.topicPopover.newSearchTopicsCount === 0)
|
|
4930
4985
|
return;
|
|
@@ -4948,6 +5003,7 @@
|
|
|
4948
5003
|
this.updateLoadingState(topicList, this.topicPopover.loading, this.topicPopover.searchHasMore);
|
|
4949
5004
|
this.topicPopover.newSearchTopicsCount = 0;
|
|
4950
5005
|
},
|
|
5006
|
+
// 更新加载状态显示
|
|
4951
5007
|
updateLoadingState(topicList, loading, hasMore) {
|
|
4952
5008
|
const existingLoading = topicList.querySelector(".topic-loading");
|
|
4953
5009
|
const existingEmpty = topicList.querySelector(".topic-empty");
|
|
@@ -4958,15 +5014,16 @@
|
|
|
4958
5014
|
if (loading) {
|
|
4959
5015
|
const loadingElement = document.createElement("div");
|
|
4960
5016
|
loadingElement.className = "topic-loading";
|
|
4961
|
-
loadingElement.textContent = "
|
|
5017
|
+
loadingElement.textContent = "加载更多...";
|
|
4962
5018
|
topicList.appendChild(loadingElement);
|
|
4963
5019
|
} else if (!hasMore) {
|
|
4964
5020
|
const emptyElement = document.createElement("div");
|
|
4965
5021
|
emptyElement.className = "topic-empty";
|
|
4966
|
-
emptyElement.textContent = "
|
|
5022
|
+
emptyElement.textContent = "没有更多了";
|
|
4967
5023
|
topicList.appendChild(emptyElement);
|
|
4968
5024
|
}
|
|
4969
5025
|
},
|
|
5026
|
+
// 创建话题弹框内容
|
|
4970
5027
|
createTopicPopoverContent() {
|
|
4971
5028
|
if (this.topicPopover.type === "hot") {
|
|
4972
5029
|
return this.getHotTopicPopoverHTML();
|
|
@@ -4975,6 +5032,7 @@
|
|
|
4975
5032
|
}
|
|
4976
5033
|
return "";
|
|
4977
5034
|
},
|
|
5035
|
+
// 获取热门话题弹框HTML
|
|
4978
5036
|
getHotTopicPopoverHTML() {
|
|
4979
5037
|
const activeTab = this.topicPopover.activeTab;
|
|
4980
5038
|
const hotTopics = this.topicPopover.hotTopics;
|
|
@@ -4984,22 +5042,22 @@
|
|
|
4984
5042
|
let topicListHTML = "";
|
|
4985
5043
|
if (activeTab === "hot") {
|
|
4986
5044
|
if (loading && hotTopics.length === 0) {
|
|
4987
|
-
topicListHTML = '<div class="topic-loading"
|
|
5045
|
+
topicListHTML = '<div class="topic-loading">加载中...</div>';
|
|
4988
5046
|
} else if (hotTopics.length === 0) {
|
|
4989
|
-
topicListHTML = '<div class="topic-empty"
|
|
5047
|
+
topicListHTML = '<div class="topic-empty">暂无热门话题</div>';
|
|
4990
5048
|
} else {
|
|
4991
5049
|
topicListHTML = hotTopics.map(
|
|
4992
5050
|
(topic) => `<div class="topic-item" data-topic-id="${topic.id}" data-topic-type="${topic.type}">#${topic.exactlyMatchTitle}</div>`
|
|
4993
5051
|
).join("");
|
|
4994
5052
|
if (loading) {
|
|
4995
|
-
topicListHTML += '<div class="topic-loading"
|
|
5053
|
+
topicListHTML += '<div class="topic-loading">加载更多...</div>';
|
|
4996
5054
|
} else if (!hasMore) {
|
|
4997
|
-
topicListHTML += '<div class="topic-empty"
|
|
5055
|
+
topicListHTML += '<div class="topic-empty">没有更多了</div>';
|
|
4998
5056
|
}
|
|
4999
5057
|
}
|
|
5000
5058
|
} else {
|
|
5001
5059
|
if (recentTopics.length === 0) {
|
|
5002
|
-
topicListHTML = '<div class="topic-empty"
|
|
5060
|
+
topicListHTML = '<div class="topic-empty">暂无最近使用记录</div>';
|
|
5003
5061
|
} else {
|
|
5004
5062
|
topicListHTML = recentTopics.map(
|
|
5005
5063
|
(topic) => `<div class="topic-item" data-topic-id="${topic.id}" data-topic-type="${topic.type}">#${topic.exactlyMatchTitle}</div>`
|
|
@@ -5010,10 +5068,10 @@
|
|
|
5010
5068
|
<div class="topic-popover-content">
|
|
5011
5069
|
<div class="topic-tabs">
|
|
5012
5070
|
<div class="topic-tab ${activeTab === "hot" ? "active" : ""}" data-tab="hot">
|
|
5013
|
-
|
|
5071
|
+
热门话题
|
|
5014
5072
|
</div>
|
|
5015
5073
|
<div class="topic-tab ${activeTab === "recent" ? "active" : ""}" data-tab="recent">
|
|
5016
|
-
|
|
5074
|
+
最近使用
|
|
5017
5075
|
</div>
|
|
5018
5076
|
</div>
|
|
5019
5077
|
<div class="topic-list-container">
|
|
@@ -5024,6 +5082,7 @@
|
|
|
5024
5082
|
</div>
|
|
5025
5083
|
`;
|
|
5026
5084
|
},
|
|
5085
|
+
// 获取搜索话题弹框HTML
|
|
5027
5086
|
getSearchTopicPopoverHTML() {
|
|
5028
5087
|
const searchKeyword = this.topicPopover.searchKeyword;
|
|
5029
5088
|
const searchTopics = this.topicPopover.searchTopics;
|
|
@@ -5031,17 +5090,17 @@
|
|
|
5031
5090
|
const searchHasMore = this.topicPopover.searchHasMore;
|
|
5032
5091
|
let topicListHTML = "";
|
|
5033
5092
|
if (loading && searchTopics.length === 0) {
|
|
5034
|
-
topicListHTML = '<div class="topic-loading"
|
|
5093
|
+
topicListHTML = '<div class="topic-loading">搜索中...</div>';
|
|
5035
5094
|
} else if (searchTopics.length === 0) {
|
|
5036
|
-
topicListHTML = '<div class="topic-empty"
|
|
5095
|
+
topicListHTML = '<div class="topic-empty">没有匹配到话题,请重新输入</div>';
|
|
5037
5096
|
} else {
|
|
5038
5097
|
topicListHTML = searchTopics.map(
|
|
5039
5098
|
(topic) => `<div class="topic-item" data-topic-id="${topic.id}" data-topic-type="${topic.type}">#${topic.exactlyMatchTitle}</div>`
|
|
5040
5099
|
).join("");
|
|
5041
5100
|
if (loading) {
|
|
5042
|
-
topicListHTML += '<div class="topic-loading"
|
|
5101
|
+
topicListHTML += '<div class="topic-loading">加载更多...</div>';
|
|
5043
5102
|
} else if (!searchHasMore) {
|
|
5044
|
-
topicListHTML += '<div class="topic-empty"
|
|
5103
|
+
topicListHTML += '<div class="topic-empty">没有更多了</div>';
|
|
5045
5104
|
}
|
|
5046
5105
|
}
|
|
5047
5106
|
return `
|
|
@@ -5057,6 +5116,7 @@
|
|
|
5057
5116
|
</div>
|
|
5058
5117
|
`;
|
|
5059
5118
|
},
|
|
5119
|
+
// 绑定话题弹框事件
|
|
5060
5120
|
bindTopicPopoverEvents() {
|
|
5061
5121
|
if (!this.topicPopover.globalContainer)
|
|
5062
5122
|
return;
|
|
@@ -5088,6 +5148,7 @@
|
|
|
5088
5148
|
});
|
|
5089
5149
|
}
|
|
5090
5150
|
},
|
|
5151
|
+
// 根据ID查找话题
|
|
5091
5152
|
findTopicById(topicId) {
|
|
5092
5153
|
let topic = this.topicPopover.hotTopics.find((t) => t.id === topicId);
|
|
5093
5154
|
if (topic)
|
|
@@ -5206,13 +5267,15 @@
|
|
|
5206
5267
|
topicId: topic.id,
|
|
5207
5268
|
topicType: topic.type || 0,
|
|
5208
5269
|
startIndex: 0,
|
|
5270
|
+
// 会在updateTopicPosition中更新
|
|
5209
5271
|
endIndex: 0
|
|
5272
|
+
// 会在updateTopicPosition中更新
|
|
5210
5273
|
}));
|
|
5211
5274
|
topicElement.textContent = topicText;
|
|
5212
5275
|
topicElement.setAttribute("contenteditable", "false");
|
|
5213
5276
|
range.deleteContents();
|
|
5214
5277
|
range.insertNode(topicElement);
|
|
5215
|
-
const spaceNode = document.createTextNode("
|
|
5278
|
+
const spaceNode = document.createTextNode(" ");
|
|
5216
5279
|
range.setStartAfter(topicElement);
|
|
5217
5280
|
range.insertNode(spaceNode);
|
|
5218
5281
|
const newRange = document.createRange();
|
|
@@ -5236,6 +5299,83 @@
|
|
|
5236
5299
|
}, 0);
|
|
5237
5300
|
this.$emit("update-topic-position");
|
|
5238
5301
|
},
|
|
5302
|
+
moveCursor(spaceNode) {
|
|
5303
|
+
setTimeout(() => {
|
|
5304
|
+
const currentSelection = window.getSelection();
|
|
5305
|
+
if (currentSelection.rangeCount > 0) {
|
|
5306
|
+
const currentRange = currentSelection.getRangeAt(0);
|
|
5307
|
+
if (currentRange.startContainer !== spaceNode.nextSibling) {
|
|
5308
|
+
const correctRange = document.createRange();
|
|
5309
|
+
correctRange.setStartAfter(spaceNode);
|
|
5310
|
+
correctRange.collapse(true);
|
|
5311
|
+
currentSelection.removeAllRanges();
|
|
5312
|
+
currentSelection.addRange(correctRange);
|
|
5313
|
+
}
|
|
5314
|
+
}
|
|
5315
|
+
}, 0);
|
|
5316
|
+
},
|
|
5317
|
+
// 供外部项目调用:插入热门话题
|
|
5318
|
+
// 组件内部会自动监听外部点击并保存光标位置
|
|
5319
|
+
// topic: { id, type, title, exactlyMatchTitle }
|
|
5320
|
+
insertHotTopic(topic) {
|
|
5321
|
+
if (!this.editorDom) {
|
|
5322
|
+
console.warn("TopicManager: editorDom is required");
|
|
5323
|
+
return;
|
|
5324
|
+
}
|
|
5325
|
+
if (!topic || !topic.id) {
|
|
5326
|
+
console.warn("TopicManager: topic is required");
|
|
5327
|
+
return;
|
|
5328
|
+
}
|
|
5329
|
+
const topicText = topic.exactlyMatchTitle ? `#${topic.exactlyMatchTitle}` : `#${topic.title || topic.name || ""}`;
|
|
5330
|
+
const editorContent = this.editorDom.querySelector(".editor-content") || this.editorDom.querySelector(".editor") || this.editorDom;
|
|
5331
|
+
let range = this.savedRange;
|
|
5332
|
+
const selection = window.getSelection();
|
|
5333
|
+
this.savedRange = null;
|
|
5334
|
+
const topicElement = document.createElement("mdd-topic");
|
|
5335
|
+
topicElement.setAttribute("data-topic", JSON.stringify({
|
|
5336
|
+
topicId: topic.id,
|
|
5337
|
+
topicType: topic.type || 0,
|
|
5338
|
+
startIndex: 0,
|
|
5339
|
+
endIndex: 0
|
|
5340
|
+
}));
|
|
5341
|
+
topicElement.textContent = topicText;
|
|
5342
|
+
topicElement.setAttribute("contenteditable", "false");
|
|
5343
|
+
if (range) {
|
|
5344
|
+
range.deleteContents();
|
|
5345
|
+
range.insertNode(topicElement);
|
|
5346
|
+
const spaceNode = document.createTextNode(" ");
|
|
5347
|
+
range.setStartAfter(topicElement);
|
|
5348
|
+
range.insertNode(spaceNode);
|
|
5349
|
+
const newRange = document.createRange();
|
|
5350
|
+
newRange.setStartAfter(spaceNode);
|
|
5351
|
+
newRange.collapse(true);
|
|
5352
|
+
selection.removeAllRanges();
|
|
5353
|
+
selection.addRange(newRange);
|
|
5354
|
+
this.moveCursor(spaceNode);
|
|
5355
|
+
} else {
|
|
5356
|
+
let lastParagraph = editorContent.lastElementChild;
|
|
5357
|
+
if (!lastParagraph || lastParagraph.nodeName !== "P" && !lastParagraph.classList.contains("halo-paragraph") && !lastParagraph.classList.contains("halo-paragraph-title")) {
|
|
5358
|
+
lastParagraph = document.createElement("p");
|
|
5359
|
+
lastParagraph.className = "halo-paragraph";
|
|
5360
|
+
editorContent.appendChild(lastParagraph);
|
|
5361
|
+
}
|
|
5362
|
+
if (lastParagraph) {
|
|
5363
|
+
lastParagraph.appendChild(topicElement);
|
|
5364
|
+
const spaceNode = document.createTextNode(" ");
|
|
5365
|
+
lastParagraph.appendChild(spaceNode);
|
|
5366
|
+
const newRange = document.createRange();
|
|
5367
|
+
newRange.setStartAfter(spaceNode);
|
|
5368
|
+
newRange.collapse(true);
|
|
5369
|
+
selection.removeAllRanges();
|
|
5370
|
+
selection.addRange(newRange);
|
|
5371
|
+
this.moveCursor(spaceNode);
|
|
5372
|
+
} else {
|
|
5373
|
+
editorContent.appendChild(topicElement);
|
|
5374
|
+
}
|
|
5375
|
+
}
|
|
5376
|
+
this.$emit("update-topic-position");
|
|
5377
|
+
},
|
|
5378
|
+
// 销毁话题管理器
|
|
5239
5379
|
destroy() {
|
|
5240
5380
|
this.unbindEditorEvents();
|
|
5241
5381
|
this.hideTopicPopover();
|
|
@@ -5263,7 +5403,7 @@
|
|
|
5263
5403
|
components: {
|
|
5264
5404
|
ElInput: elementPlus.ElInput,
|
|
5265
5405
|
BasicDialog: _sfc_main$7,
|
|
5266
|
-
draggable
|
|
5406
|
+
draggable
|
|
5267
5407
|
},
|
|
5268
5408
|
props: {
|
|
5269
5409
|
visible: {
|
|
@@ -5304,14 +5444,12 @@
|
|
|
5304
5444
|
setStatus(val) {
|
|
5305
5445
|
this.$emit("update:visible", val);
|
|
5306
5446
|
}
|
|
5447
|
+
// submit() {
|
|
5448
|
+
// this.$emit('submit')
|
|
5449
|
+
// }
|
|
5307
5450
|
}
|
|
5308
5451
|
};
|
|
5309
|
-
const _hoisted_1$2 =
|
|
5310
|
-
/* @__PURE__ */ vue.createElementVNode("span", null, "\u91C7\u96C6\u6587\u7AE0"),
|
|
5311
|
-
/* @__PURE__ */ vue.createElementVNode("span", { class: "collect-article_lable" }, "\u5982\u9700\u83B7\u5F97\u6B63\u5F0F\u4F7F\u7528\u6743\uFF0C\u8BF7\u81EA\u884C\u8054\u7CFB\u7248\u6743\u6240\u6709\u8005")
|
|
5312
|
-
], -1);
|
|
5313
|
-
const _hoisted_2$2 = { class: "collect-article_content" };
|
|
5314
|
-
const _hoisted_3$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "tip" }, "\u8BF7\u628A\u9700\u8981\u91C7\u96C6\u7684\u6587\u7AE0\u94FE\u63A5\u7C98\u8D34\u5728\u4E0B\u65B9\u7684\u8F93\u5165\u6846\uFF1A", -1);
|
|
5452
|
+
const _hoisted_1$2 = { class: "collect-article_content" };
|
|
5315
5453
|
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5316
5454
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
5317
5455
|
const _component_BasicDialog = vue.resolveComponent("BasicDialog");
|
|
@@ -5320,16 +5458,19 @@
|
|
|
5320
5458
|
width: "600px",
|
|
5321
5459
|
height: "50px"
|
|
5322
5460
|
}, {
|
|
5323
|
-
title: vue.withCtx(() => [
|
|
5324
|
-
|
|
5325
|
-
|
|
5461
|
+
title: vue.withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
5462
|
+
vue.createElementVNode("div", null, [
|
|
5463
|
+
vue.createElementVNode("span", null, "采集文章"),
|
|
5464
|
+
vue.createElementVNode("span", { class: "collect-article_lable" }, "如需获得正式使用权,请自行联系版权所有者")
|
|
5465
|
+
], -1)
|
|
5466
|
+
])]),
|
|
5326
5467
|
default: vue.withCtx(() => [
|
|
5327
|
-
vue.createElementVNode("div",
|
|
5328
|
-
|
|
5468
|
+
vue.createElementVNode("div", _hoisted_1$2, [
|
|
5469
|
+
_cache[2] || (_cache[2] = vue.createElementVNode("div", { class: "tip" }, "请把需要采集的文章链接粘贴在下方的输入框:", -1)),
|
|
5329
5470
|
vue.createVNode(_component_el_input, {
|
|
5330
5471
|
modelValue: $options.input,
|
|
5331
5472
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.input = $event),
|
|
5332
|
-
placeholder: "
|
|
5473
|
+
placeholder: "仅支持微信链接"
|
|
5333
5474
|
}, null, 8, ["modelValue"])
|
|
5334
5475
|
])
|
|
5335
5476
|
]),
|
|
@@ -5337,7 +5478,7 @@
|
|
|
5337
5478
|
}, 8, ["visible"]);
|
|
5338
5479
|
}
|
|
5339
5480
|
const CollectArticle = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
|
|
5340
|
-
const
|
|
5481
|
+
const index_vue_vue_type_style_index_0_scoped_4ebe06df_lang = "";
|
|
5341
5482
|
const _sfc_main$1 = {
|
|
5342
5483
|
components: {
|
|
5343
5484
|
ElIconError: iconsVue.CircleCloseFilled
|
|
@@ -5382,8 +5523,8 @@
|
|
|
5382
5523
|
vue.createElementVNode("div", _hoisted_4, vue.toDisplayString($props.article.title), 1),
|
|
5383
5524
|
vue.createElementVNode("div", _hoisted_5, [
|
|
5384
5525
|
vue.createElementVNode("span", null, vue.toDisplayString($props.article.author), 1),
|
|
5385
|
-
vue.createElementVNode("span", null, vue.toDisplayString($props.article.viewNum) + "
|
|
5386
|
-
vue.createElementVNode("span", null, vue.toDisplayString($props.article.replycnt) + "
|
|
5526
|
+
vue.createElementVNode("span", null, vue.toDisplayString($props.article.viewNum) + "浏览", 1),
|
|
5527
|
+
vue.createElementVNode("span", null, vue.toDisplayString($props.article.replycnt) + "评论", 1)
|
|
5387
5528
|
])
|
|
5388
5529
|
]),
|
|
5389
5530
|
vue.createVNode(_component_el_icon_error, {
|
|
@@ -5395,10 +5536,10 @@
|
|
|
5395
5536
|
class: vue.normalizeClass([{
|
|
5396
5537
|
"article-bg-height": $props.article.img || $props.article.mediaInfo && $props.article.mediaInfo.length
|
|
5397
5538
|
}, "article-bg"])
|
|
5398
|
-
}, "
|
|
5539
|
+
}, " 平台仅支持展示18个月的推荐内容 ", 2)) : vue.createCommentVNode("", true)
|
|
5399
5540
|
]);
|
|
5400
5541
|
}
|
|
5401
|
-
const Item = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-
|
|
5542
|
+
const Item = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-4ebe06df"]]);
|
|
5402
5543
|
const mountArticleDom = (props, del) => {
|
|
5403
5544
|
const className = "article-wrap";
|
|
5404
5545
|
const article = props.article;
|
|
@@ -5458,6 +5599,7 @@
|
|
|
5458
5599
|
hasArticleCard: false,
|
|
5459
5600
|
cursorStyle: "auto",
|
|
5460
5601
|
titleCount: 0,
|
|
5602
|
+
// 标题数量
|
|
5461
5603
|
viewLinkDialog: false,
|
|
5462
5604
|
linkForm: {
|
|
5463
5605
|
linkAddress: "",
|
|
@@ -5465,39 +5607,56 @@
|
|
|
5465
5607
|
},
|
|
5466
5608
|
setAlignFlag: true,
|
|
5467
5609
|
article: {},
|
|
5610
|
+
// 插入的文章
|
|
5468
5611
|
imgList: [],
|
|
5469
5612
|
imgNum: 20,
|
|
5470
5613
|
videoList: [],
|
|
5471
5614
|
visibleVideo: false,
|
|
5472
5615
|
visibleCollectArticle: false,
|
|
5473
5616
|
visibleArticle: false,
|
|
5617
|
+
// 插入文章
|
|
5474
5618
|
visibleImg: false,
|
|
5619
|
+
// 插入图片
|
|
5475
5620
|
imgType: "normal",
|
|
5621
|
+
//
|
|
5476
5622
|
typeEnum: {
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5623
|
+
文字: "1",
|
|
5624
|
+
图片: "2",
|
|
5625
|
+
图文: "3",
|
|
5626
|
+
段落标题: "4",
|
|
5627
|
+
关联: "5",
|
|
5628
|
+
// 关联车辆、轨迹、活动、商家、话题
|
|
5629
|
+
单视频: "6",
|
|
5630
|
+
视频文字: "7",
|
|
5484
5631
|
URL: "8",
|
|
5485
|
-
|
|
5632
|
+
文章卡片: "11"
|
|
5486
5633
|
},
|
|
5487
5634
|
fontInfo: {
|
|
5488
5635
|
size: ""
|
|
5489
5636
|
},
|
|
5490
5637
|
user: {},
|
|
5638
|
+
// 用户
|
|
5491
5639
|
editor: {},
|
|
5640
|
+
// 编辑器实例对象
|
|
5492
5641
|
editorDom: {},
|
|
5642
|
+
// 编辑器Dom
|
|
5493
5643
|
uploadStore: {},
|
|
5644
|
+
// 待上传的图片池
|
|
5645
|
+
failedUploads: [],
|
|
5646
|
+
// 失败图片列表,用于外部项目定位
|
|
5494
5647
|
linkContent: "",
|
|
5648
|
+
// 插入链接的地址
|
|
5495
5649
|
loadingText: "",
|
|
5650
|
+
// loaing的提示文字
|
|
5496
5651
|
progressPercent: "",
|
|
5652
|
+
// 上传进度
|
|
5497
5653
|
currentIndex: 0,
|
|
5498
5654
|
loading: false,
|
|
5655
|
+
// 是否提交中
|
|
5499
5656
|
viewStatus: false,
|
|
5657
|
+
// todo: 改名
|
|
5500
5658
|
linkStatus: false,
|
|
5659
|
+
// todo: 改名
|
|
5501
5660
|
styleStatus: {
|
|
5502
5661
|
bold: false,
|
|
5503
5662
|
italic: false,
|
|
@@ -5521,6 +5680,7 @@
|
|
|
5521
5680
|
targetMove: "",
|
|
5522
5681
|
moverClasses: ["halo-img-content", "halo-video-content"],
|
|
5523
5682
|
selectDom: null
|
|
5683
|
+
//选中的dom
|
|
5524
5684
|
};
|
|
5525
5685
|
},
|
|
5526
5686
|
computed: {
|
|
@@ -5537,12 +5697,12 @@
|
|
|
5537
5697
|
watch: {
|
|
5538
5698
|
progressPercent(val) {
|
|
5539
5699
|
const inner = document.querySelector(".video-progress .inner");
|
|
5540
|
-
console.log(val, "
|
|
5700
|
+
console.log(val, "视频上传进度");
|
|
5541
5701
|
if (inner) {
|
|
5542
5702
|
inner.style.width = val + "%";
|
|
5543
5703
|
if (val === 100) {
|
|
5544
5704
|
document.querySelector(".video-progress").innerHTML = `
|
|
5545
|
-
<div class="no-calc" style="text-align:center;color:#999999;font-size:18px;"
|
|
5705
|
+
<div class="no-calc" style="text-align:center;color:#999999;font-size:18px;">正在获取视频封面</div>
|
|
5546
5706
|
`;
|
|
5547
5707
|
}
|
|
5548
5708
|
}
|
|
@@ -5561,7 +5721,7 @@
|
|
|
5561
5721
|
me2.user = JSON.parse(
|
|
5562
5722
|
window.localStorage.getItem("user") || window.localStorage.getItem("userInfo") || "{}"
|
|
5563
5723
|
);
|
|
5564
|
-
me2.guid = me2.user.uid + "|" +
|
|
5724
|
+
me2.guid = me2.user.uid + "|" + util.tools.guid();
|
|
5565
5725
|
},
|
|
5566
5726
|
beforeDestroy() {
|
|
5567
5727
|
this.editorDom && this.editorDom.removeEventListener("blur", this.canSetAlign);
|
|
@@ -5631,10 +5791,10 @@
|
|
|
5631
5791
|
this.visibleVideo = false;
|
|
5632
5792
|
const fileName = (files[0] && files[0].name || "").toLowerCase();
|
|
5633
5793
|
if (files[0].size > 1 * 1024 * 1024 * 1024) {
|
|
5634
|
-
return me2.setToast("
|
|
5794
|
+
return me2.setToast("视频大小不能超过1GB");
|
|
5635
5795
|
}
|
|
5636
5796
|
if (fileName.indexOf(".mp4") === -1 && fileName.indexOf(".mov") === -1) {
|
|
5637
|
-
return me2.setToast("
|
|
5797
|
+
return me2.setToast("视频格式不是mp4或mov");
|
|
5638
5798
|
}
|
|
5639
5799
|
const me2 = this;
|
|
5640
5800
|
if (me2.loading)
|
|
@@ -5654,7 +5814,9 @@
|
|
|
5654
5814
|
id: result.videoId,
|
|
5655
5815
|
desc: "",
|
|
5656
5816
|
vodSize: result.vodSize || "",
|
|
5817
|
+
// 视频大小
|
|
5657
5818
|
vodType: result.vodType || ""
|
|
5819
|
+
// 图片尺寸
|
|
5658
5820
|
};
|
|
5659
5821
|
me2.$emit("updateAddVideo", true);
|
|
5660
5822
|
me2.editor["insertVideo"](result.videoUrl, video);
|
|
@@ -5708,11 +5870,11 @@
|
|
|
5708
5870
|
},
|
|
5709
5871
|
insertLink() {
|
|
5710
5872
|
if (!this.linkForm.linkAddress)
|
|
5711
|
-
return elementPlus.ElMessage.error("
|
|
5873
|
+
return elementPlus.ElMessage.error("请输入链接地址");
|
|
5712
5874
|
if (!this.linkForm.linkWriting)
|
|
5713
|
-
return elementPlus.ElMessage.error("
|
|
5875
|
+
return elementPlus.ElMessage.error("请输入链接文案");
|
|
5714
5876
|
if (!this.validUrl(this.linkForm.linkAddress)) {
|
|
5715
|
-
return this.setToast("URL
|
|
5877
|
+
return this.setToast("URL无效");
|
|
5716
5878
|
}
|
|
5717
5879
|
this.editor.insertLink(
|
|
5718
5880
|
this.linkForm.linkAddress,
|
|
@@ -5741,9 +5903,19 @@
|
|
|
5741
5903
|
});
|
|
5742
5904
|
});
|
|
5743
5905
|
},
|
|
5906
|
+
// TopicManager事件处理
|
|
5744
5907
|
onTopicInserted(topic) {
|
|
5745
5908
|
this.updateData(true);
|
|
5746
5909
|
},
|
|
5910
|
+
// 供外部项目调用:插入热门话题
|
|
5911
|
+
// 如果编辑器有光标则插入光标位置,否则插入文档末尾
|
|
5912
|
+
// topic: { id, type, title, exactlyMatchTitle }
|
|
5913
|
+
insertHotTopic(topic) {
|
|
5914
|
+
if (this.$refs.topicManager) {
|
|
5915
|
+
this.$refs.topicManager.insertHotTopic(topic);
|
|
5916
|
+
this.updateData(true);
|
|
5917
|
+
}
|
|
5918
|
+
},
|
|
5747
5919
|
getHtml(type) {
|
|
5748
5920
|
this.updateTopicPosition();
|
|
5749
5921
|
const html = this.editor.getHTML();
|
|
@@ -6211,7 +6383,7 @@
|
|
|
6211
6383
|
me2.currentVideo = node;
|
|
6212
6384
|
e.stopPropagation();
|
|
6213
6385
|
};
|
|
6214
|
-
replaceBtn.innerText = "
|
|
6386
|
+
replaceBtn.innerText = "更换封面";
|
|
6215
6387
|
return replaceBtn;
|
|
6216
6388
|
},
|
|
6217
6389
|
insertImgOperateBtns(editor, data) {
|
|
@@ -6236,7 +6408,7 @@
|
|
|
6236
6408
|
class: "desc-input",
|
|
6237
6409
|
maxlength: "100",
|
|
6238
6410
|
cols: "50",
|
|
6239
|
-
placeholder: "
|
|
6411
|
+
placeholder: "请输入图片描述(最多100字)",
|
|
6240
6412
|
contenteditable: "false"
|
|
6241
6413
|
});
|
|
6242
6414
|
descInput.disabled = me2.disabled;
|
|
@@ -6248,7 +6420,7 @@
|
|
|
6248
6420
|
const img = parent.querySelector(".halo-picture-area");
|
|
6249
6421
|
img.dataset.desc = e.target.value;
|
|
6250
6422
|
if (e.target.value.length > 99) {
|
|
6251
|
-
return me2.setToast("
|
|
6423
|
+
return me2.setToast("限制100个字符");
|
|
6252
6424
|
}
|
|
6253
6425
|
};
|
|
6254
6426
|
descInput.value = data.content || "";
|
|
@@ -6298,7 +6470,7 @@
|
|
|
6298
6470
|
me2.removeParentByClass(e.target, "halo-img-content");
|
|
6299
6471
|
me2.updateData(true);
|
|
6300
6472
|
};
|
|
6301
|
-
replaceBtn.innerHTML = "
|
|
6473
|
+
replaceBtn.innerHTML = "替换";
|
|
6302
6474
|
return [replaceBtn, delBtn, descInputWrap];
|
|
6303
6475
|
},
|
|
6304
6476
|
removeSeamlessLaster(e) {
|
|
@@ -6322,6 +6494,7 @@
|
|
|
6322
6494
|
}
|
|
6323
6495
|
}
|
|
6324
6496
|
},
|
|
6497
|
+
// 初始化编辑器数据,数据是 html 格式(displayData)
|
|
6325
6498
|
initData(data = "", essayPicRelVOList) {
|
|
6326
6499
|
this.parseHtml(data, essayPicRelVOList).then((res) => {
|
|
6327
6500
|
this.editorDom.innerHTML = "";
|
|
@@ -6329,10 +6502,13 @@
|
|
|
6329
6502
|
this.updateData();
|
|
6330
6503
|
});
|
|
6331
6504
|
},
|
|
6505
|
+
// TODO jsonToHtml、htmlToJson 实现这 2 个方法里面的逻辑,数据结构参考方法里面的注释,出参入参都为字符串,注意:mdd-topic 里面的属性数据 和 json 中的topicPosition数据是一一对应的,startIndex、endIndex为mdd-topic的起止位置 从 content 里面进行分割处理
|
|
6506
|
+
// json、html 数据格式互转,暂时只支持文字、短话题
|
|
6332
6507
|
jsonToHtml(json) {
|
|
6333
6508
|
},
|
|
6334
6509
|
htmlToJson(html) {
|
|
6335
6510
|
},
|
|
6511
|
+
// 设置富文本组件
|
|
6336
6512
|
initSquire() {
|
|
6337
6513
|
const me2 = this;
|
|
6338
6514
|
const editorDom = me2.editorDom;
|
|
@@ -6782,6 +6958,7 @@
|
|
|
6782
6958
|
window.Squire.empty(block)
|
|
6783
6959
|
]);
|
|
6784
6960
|
output.appendChild(
|
|
6961
|
+
// 段落才能添加标题
|
|
6785
6962
|
Array.from(block.classList).indexOf("halo-img-content") > -1 ? block : container
|
|
6786
6963
|
);
|
|
6787
6964
|
}
|
|
@@ -6804,18 +6981,18 @@
|
|
|
6804
6981
|
});
|
|
6805
6982
|
loading.innerHTML = `
|
|
6806
6983
|
<img class="img-loading-icon" src="/img/upload-image-loading.png"/>
|
|
6807
|
-
<span class="img-loading-tip"
|
|
6984
|
+
<span class="img-loading-tip">上传中...</span>
|
|
6808
6985
|
`;
|
|
6809
6986
|
var fail = this.createElement("div", {
|
|
6810
6987
|
class: "img-fail hide",
|
|
6811
6988
|
contenteditable: "false"
|
|
6812
6989
|
});
|
|
6813
|
-
fail.innerHTML = "
|
|
6990
|
+
fail.innerHTML = "上传失败<br>请下载图片至本地后重新上传";
|
|
6814
6991
|
var again = this.createElement("button", {
|
|
6815
6992
|
class: "img-again hide",
|
|
6816
6993
|
contenteditable: "false"
|
|
6817
6994
|
});
|
|
6818
|
-
again.innerHTML = "
|
|
6995
|
+
again.innerHTML = "重新上传";
|
|
6819
6996
|
const isGif = src && src.indexOf(".gif") > -1;
|
|
6820
6997
|
const isGifNowater = src && src.indexOf(".gif!nowater") > -1;
|
|
6821
6998
|
if (isGif && !isGifNowater) {
|
|
@@ -6871,7 +7048,7 @@
|
|
|
6871
7048
|
});
|
|
6872
7049
|
div.innerHTML = `
|
|
6873
7050
|
<div class="video-progress">
|
|
6874
|
-
<div class="label"
|
|
7051
|
+
<div class="label">上传中...</div>
|
|
6875
7052
|
<div class="box">
|
|
6876
7053
|
<div class="inner" style="width:20%"></div>
|
|
6877
7054
|
</div>
|
|
@@ -6894,6 +7071,7 @@
|
|
|
6894
7071
|
data: JSON.stringify(data),
|
|
6895
7072
|
"data-content": data.content || "",
|
|
6896
7073
|
poster: data.img || ""
|
|
7074
|
+
// 'contenteditable': 'true',
|
|
6897
7075
|
});
|
|
6898
7076
|
var delBtn = me2.genIconDom({
|
|
6899
7077
|
class: "pointer video-delete icon",
|
|
@@ -6951,6 +7129,7 @@
|
|
|
6951
7129
|
}
|
|
6952
7130
|
};
|
|
6953
7131
|
},
|
|
7132
|
+
// 撤销重做 会把 所有的监听全都移除,所以需要重新绑定
|
|
6954
7133
|
setListener(dom) {
|
|
6955
7134
|
const me2 = this;
|
|
6956
7135
|
const doms = dom ? [dom] : Array.from(this.editorDom.children);
|
|
@@ -6961,7 +7140,7 @@
|
|
|
6961
7140
|
p.onclick = function(e) {
|
|
6962
7141
|
var _a;
|
|
6963
7142
|
if (area.nodeName === "VIDEO" && ((_a = me2.selectDom) == null ? void 0 : _a.className) === "halo-video-content") {
|
|
6964
|
-
me2.setToast("
|
|
7143
|
+
me2.setToast("不支持播放");
|
|
6965
7144
|
}
|
|
6966
7145
|
if (e.target.className.includes("desc-input")) {
|
|
6967
7146
|
return;
|
|
@@ -7025,6 +7204,7 @@
|
|
|
7025
7204
|
};
|
|
7026
7205
|
return del;
|
|
7027
7206
|
},
|
|
7207
|
+
// 转换数据,返回给业务
|
|
7028
7208
|
getEditorData() {
|
|
7029
7209
|
const me2 = this;
|
|
7030
7210
|
const children = Array.from(me2.editorDom.children);
|
|
@@ -7082,15 +7262,18 @@
|
|
|
7082
7262
|
videoIds
|
|
7083
7263
|
};
|
|
7084
7264
|
},
|
|
7265
|
+
// 是否是摩托范的图片
|
|
7085
7266
|
isHaloImage(url = "") {
|
|
7086
7267
|
return url.indexOf("jddmoto") > -1 || url.indexOf("58moto") > -1 || url.indexOf("emotofine") > -1 || url.indexOf("dronefine") > -1 || url.indexOf("evtolfine") > -1 || url.indexOf("biaofine") > -1 || url.indexOf("robotbaodian") > -1;
|
|
7087
7268
|
},
|
|
7269
|
+
// 获取待上传图片列表
|
|
7088
7270
|
updateUploads() {
|
|
7089
7271
|
const me2 = this;
|
|
7090
7272
|
setTimeout(() => {
|
|
7091
7273
|
const uploads = document.querySelectorAll(".no-upload") || [];
|
|
7092
7274
|
me2.uploadStore = {};
|
|
7093
7275
|
me2.currentIndex = 0;
|
|
7276
|
+
me2.failedUploads = [];
|
|
7094
7277
|
Array.from(uploads).map((_, index) => {
|
|
7095
7278
|
const id = _.getAttribute("id");
|
|
7096
7279
|
const key = index + "|" + id;
|
|
@@ -7131,8 +7314,8 @@
|
|
|
7131
7314
|
const currentImg = me2.uploadStore[key];
|
|
7132
7315
|
const imageUrl = key.split("|")[1] || "";
|
|
7133
7316
|
if (!currentImg) {
|
|
7134
|
-
console.log("
|
|
7135
|
-
return Promise.reject("
|
|
7317
|
+
console.log("图片不存在", key);
|
|
7318
|
+
return Promise.reject("图片不存在");
|
|
7136
7319
|
}
|
|
7137
7320
|
const parent = currentImg.parentNode || "";
|
|
7138
7321
|
const uploadFailHandler = (currentImg2) => {
|
|
@@ -7154,6 +7337,12 @@
|
|
|
7154
7337
|
upload && upload.click();
|
|
7155
7338
|
};
|
|
7156
7339
|
}
|
|
7340
|
+
const imgId = currentImg2.getAttribute("id") || "";
|
|
7341
|
+
const imgSrc = currentImg2.getAttribute("src") || "";
|
|
7342
|
+
const failedInfo = { id: imgId, src: imgSrc, element: currentImg2 };
|
|
7343
|
+
if (!me2.failedUploads.find((item) => item.id === imgId)) {
|
|
7344
|
+
me2.failedUploads.push(failedInfo);
|
|
7345
|
+
}
|
|
7157
7346
|
};
|
|
7158
7347
|
return this.uploadImageByOther({
|
|
7159
7348
|
itemId,
|
|
@@ -7176,6 +7365,7 @@
|
|
|
7176
7365
|
parent && uploadFailHandler(currentImg);
|
|
7177
7366
|
});
|
|
7178
7367
|
},
|
|
7368
|
+
// 更新上传的图片
|
|
7179
7369
|
updateImage(img, currentImg = {}) {
|
|
7180
7370
|
const data = JSON.parse(currentImg.getAttribute("data") || "{}");
|
|
7181
7371
|
data.img = img;
|
|
@@ -7197,10 +7387,39 @@
|
|
|
7197
7387
|
parent.appendChild(arr[0]);
|
|
7198
7388
|
parent.appendChild(arr[2]);
|
|
7199
7389
|
}
|
|
7390
|
+
const imgId = currentImg.getAttribute("id") || "";
|
|
7391
|
+
this.failedUploads = this.failedUploads.filter((item) => item.id !== imgId);
|
|
7392
|
+
},
|
|
7393
|
+
// 滚动到第一个失败图片的位置,供外部项目调用
|
|
7394
|
+
scrollToFirstFailedImage() {
|
|
7395
|
+
this.failedUploads = this.failedUploads.filter((item) => {
|
|
7396
|
+
return item.element && document.body.contains(item.element);
|
|
7397
|
+
});
|
|
7398
|
+
if (this.failedUploads.length === 0) {
|
|
7399
|
+
return false;
|
|
7400
|
+
}
|
|
7401
|
+
let firstFailed = null;
|
|
7402
|
+
let minPosition = Infinity;
|
|
7403
|
+
for (const item of this.failedUploads) {
|
|
7404
|
+
if (item.element) {
|
|
7405
|
+
const position = item.element.getBoundingClientRect().top;
|
|
7406
|
+
if (position < minPosition) {
|
|
7407
|
+
minPosition = position;
|
|
7408
|
+
firstFailed = item;
|
|
7409
|
+
}
|
|
7410
|
+
}
|
|
7411
|
+
}
|
|
7412
|
+
if (firstFailed && firstFailed.element) {
|
|
7413
|
+
firstFailed.element.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
7414
|
+
return true;
|
|
7415
|
+
}
|
|
7416
|
+
return false;
|
|
7200
7417
|
},
|
|
7418
|
+
// 获取ctrl + v 后内容
|
|
7201
7419
|
getSticker(type, handler) {
|
|
7202
7420
|
this.setSticker(type.fragment.children);
|
|
7203
7421
|
},
|
|
7422
|
+
// 粘贴表格内容,tr换行形成段落
|
|
7204
7423
|
setStickerTableContent(data) {
|
|
7205
7424
|
const me2 = this;
|
|
7206
7425
|
const rows = data.querySelectorAll("tr") || [];
|
|
@@ -7229,6 +7448,7 @@
|
|
|
7229
7448
|
});
|
|
7230
7449
|
this.updateData(true);
|
|
7231
7450
|
},
|
|
7451
|
+
// 粘贴
|
|
7232
7452
|
setSticker(data) {
|
|
7233
7453
|
const me2 = this;
|
|
7234
7454
|
data = Array.from(data);
|
|
@@ -7267,6 +7487,7 @@
|
|
|
7267
7487
|
const me2 = this;
|
|
7268
7488
|
me2.updateData();
|
|
7269
7489
|
},
|
|
7490
|
+
// 监测 添加、撤回、恢复、删除
|
|
7270
7491
|
setBack(e, type) {
|
|
7271
7492
|
const me2 = this;
|
|
7272
7493
|
me2.refreshImg();
|
|
@@ -7299,6 +7520,7 @@
|
|
|
7299
7520
|
}
|
|
7300
7521
|
});
|
|
7301
7522
|
},
|
|
7523
|
+
// 设置scoll
|
|
7302
7524
|
sticky() {
|
|
7303
7525
|
const me2 = this;
|
|
7304
7526
|
me2.$nextTick(function() {
|
|
@@ -7318,6 +7540,8 @@
|
|
|
7318
7540
|
document.addEventListener("scroll", onScroll);
|
|
7319
7541
|
});
|
|
7320
7542
|
},
|
|
7543
|
+
// ==========toolbox==========
|
|
7544
|
+
// 撤回、恢复、段落标题
|
|
7321
7545
|
setContent(e, obj) {
|
|
7322
7546
|
const me2 = this;
|
|
7323
7547
|
const id = e.target.id || e.target.dataset.editorId;
|
|
@@ -7359,10 +7583,11 @@
|
|
|
7359
7583
|
this.fontInfo = this.editor.getFontInfo();
|
|
7360
7584
|
this.updateData(true);
|
|
7361
7585
|
},
|
|
7586
|
+
// 增加link
|
|
7362
7587
|
addLink(type) {
|
|
7363
7588
|
const me2 = this;
|
|
7364
|
-
me2.linkTitleName = type === "link" ? "
|
|
7365
|
-
me2.linkPlaceholder = type === "link" ? "
|
|
7589
|
+
me2.linkTitleName = type === "link" ? "添加链接" : "添加导入链接地址";
|
|
7590
|
+
me2.linkPlaceholder = type === "link" ? "请输入链接地址" : "仅支持输入微信链接";
|
|
7366
7591
|
me2.viewStatus = true;
|
|
7367
7592
|
me2.linkStatus = true;
|
|
7368
7593
|
},
|
|
@@ -7370,29 +7595,31 @@
|
|
|
7370
7595
|
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.,;?'&%$#=~_-]+))*$/;
|
|
7371
7596
|
return objExp.test(url);
|
|
7372
7597
|
},
|
|
7598
|
+
// 确认增加link
|
|
7373
7599
|
confirmLink() {
|
|
7374
7600
|
const me2 = this;
|
|
7375
7601
|
if (!me2.linkContent) {
|
|
7376
|
-
return elementPlus.ElMessage.error("
|
|
7602
|
+
return elementPlus.ElMessage.error("请输入链接地址!");
|
|
7377
7603
|
}
|
|
7378
|
-
if (me2.linkTitleName === "
|
|
7604
|
+
if (me2.linkTitleName === "添加导入链接地址" || this.visibleCollectArticle) {
|
|
7379
7605
|
this.visibleCollectArticle = false;
|
|
7380
7606
|
return me2.importLinkData();
|
|
7381
7607
|
}
|
|
7382
7608
|
if (!this.validUrl(me2.linkContent)) {
|
|
7383
|
-
return me2.setToast("URL
|
|
7609
|
+
return me2.setToast("URL无效");
|
|
7384
7610
|
}
|
|
7385
7611
|
if (!me2.isHaloImage(me2.linkContent)) {
|
|
7386
|
-
return me2.setToast("
|
|
7612
|
+
return me2.setToast("请输入摩托范内部网址");
|
|
7387
7613
|
}
|
|
7388
7614
|
me2.editor["insertLink"](me2.linkContent);
|
|
7389
7615
|
me2.linkContent = "";
|
|
7390
7616
|
me2.closeDialog();
|
|
7391
7617
|
},
|
|
7618
|
+
// 增加link导入数据
|
|
7392
7619
|
importLinkData() {
|
|
7393
7620
|
const me2 = this;
|
|
7394
7621
|
if (me2.loading) {
|
|
7395
|
-
return elementPlus.ElMessage("
|
|
7622
|
+
return elementPlus.ElMessage("正在获取信息,请稍后...");
|
|
7396
7623
|
}
|
|
7397
7624
|
me2.loading = true;
|
|
7398
7625
|
const params = {
|
|
@@ -7414,39 +7641,44 @@
|
|
|
7414
7641
|
me2.linkContent = "";
|
|
7415
7642
|
return;
|
|
7416
7643
|
} else {
|
|
7417
|
-
me2.setToast("
|
|
7644
|
+
me2.setToast("导入失败,请重试");
|
|
7418
7645
|
}
|
|
7419
7646
|
}).catch((err) => {
|
|
7420
7647
|
console.log(err.message);
|
|
7421
|
-
me2.setToast("
|
|
7648
|
+
me2.setToast("导入异常,请重试");
|
|
7422
7649
|
}).finally((_) => {
|
|
7423
7650
|
me2.loading = false;
|
|
7424
7651
|
});
|
|
7425
7652
|
},
|
|
7653
|
+
// 打开 图片、视频、一键导入 弹框
|
|
7426
7654
|
openDialog(name) {
|
|
7427
7655
|
const me2 = this;
|
|
7428
|
-
me2.viewName = name === "img" ? "
|
|
7429
|
-
me2.viewButton = name === "img" ? "
|
|
7430
|
-
me2.viewTip = name === "img" ? "" : "
|
|
7656
|
+
me2.viewName = name === "img" ? "添加图片" : "添加视频";
|
|
7657
|
+
me2.viewButton = name === "img" ? "选择图片" : "选择视频";
|
|
7658
|
+
me2.viewTip = name === "img" ? "" : "为了获得更高的推荐和点击量,建议上传720p(1280*720),大小不超过500MB(视频上传需要时间,请耐心等待)";
|
|
7431
7659
|
me2.viewStatus = true;
|
|
7432
7660
|
},
|
|
7661
|
+
// 关闭弹框
|
|
7433
7662
|
closeDialog() {
|
|
7434
7663
|
this.viewStatus = false;
|
|
7435
7664
|
this.linkStatus = false;
|
|
7436
7665
|
this.linkContent = "";
|
|
7437
7666
|
},
|
|
7667
|
+
// ==========toolbox end==========
|
|
7668
|
+
// 弹框提示
|
|
7438
7669
|
setToast(content) {
|
|
7439
7670
|
elementPlus.ElMessage.error(content);
|
|
7440
7671
|
},
|
|
7441
7672
|
setMessageBoxNoCancel(content) {
|
|
7442
7673
|
elementPlus.ElMessageBox.confirm(content, "", {
|
|
7443
|
-
confirmButtonText: "
|
|
7444
|
-
cancelButtonText: "
|
|
7674
|
+
confirmButtonText: "确定",
|
|
7675
|
+
cancelButtonText: "取消",
|
|
7445
7676
|
type: "warning"
|
|
7446
7677
|
}).then(() => {
|
|
7447
7678
|
}).catch(() => {
|
|
7448
7679
|
});
|
|
7449
7680
|
},
|
|
7681
|
+
// 检查是否会创建嵌套的halo-paragraph
|
|
7450
7682
|
wouldCreateNestedParagraph(range) {
|
|
7451
7683
|
let container = range.startContainer;
|
|
7452
7684
|
while (container && container !== this.editorDom) {
|
|
@@ -7457,6 +7689,7 @@
|
|
|
7457
7689
|
}
|
|
7458
7690
|
return false;
|
|
7459
7691
|
},
|
|
7692
|
+
// 检查光标是否在两个连续的mdd-topic之间
|
|
7460
7693
|
isBetweenTwoTopics(range) {
|
|
7461
7694
|
const container = range.startContainer;
|
|
7462
7695
|
const offset = range.startOffset;
|
|
@@ -7472,6 +7705,7 @@
|
|
|
7472
7705
|
}
|
|
7473
7706
|
return false;
|
|
7474
7707
|
},
|
|
7708
|
+
// 处理两个话题之间的回车或话题前面的回车
|
|
7475
7709
|
handleEnterBetweenTopics(range) {
|
|
7476
7710
|
var _a;
|
|
7477
7711
|
const me2 = this;
|
|
@@ -7509,6 +7743,7 @@
|
|
|
7509
7743
|
selection.addRange(newRange);
|
|
7510
7744
|
me2.updateData(true);
|
|
7511
7745
|
},
|
|
7746
|
+
// 更精确地提取光标后的内容(专门用于话题分割)
|
|
7512
7747
|
extractContentAfterCursorPrecise(range, paragraph) {
|
|
7513
7748
|
const fragment = document.createDocumentFragment();
|
|
7514
7749
|
const container = range.startContainer;
|
|
@@ -7534,6 +7769,7 @@
|
|
|
7534
7769
|
}
|
|
7535
7770
|
return fragment;
|
|
7536
7771
|
},
|
|
7772
|
+
// 处理包含话题的段落中的回车键
|
|
7537
7773
|
handleEnterKeyInParagraphWithTopic(range) {
|
|
7538
7774
|
var _a;
|
|
7539
7775
|
const me2 = this;
|
|
@@ -7608,6 +7844,7 @@
|
|
|
7608
7844
|
selection.addRange(newRange);
|
|
7609
7845
|
me2.updateData(true);
|
|
7610
7846
|
},
|
|
7847
|
+
// 检查光标是否在第一个话题前面
|
|
7611
7848
|
isCursorBeforeFirstTopic(range, paragraph) {
|
|
7612
7849
|
const container = range.startContainer;
|
|
7613
7850
|
const offset = range.startOffset;
|
|
@@ -7669,6 +7906,7 @@
|
|
|
7669
7906
|
}
|
|
7670
7907
|
return false;
|
|
7671
7908
|
},
|
|
7909
|
+
// 获取不包含mdd-topic内部文本的段落文本
|
|
7672
7910
|
getParagraphTextExcludingTopics(paragraph, range) {
|
|
7673
7911
|
let textContent = "";
|
|
7674
7912
|
let cursorPosition = 0;
|
|
@@ -7699,10 +7937,12 @@
|
|
|
7699
7937
|
}
|
|
7700
7938
|
return { textContent, cursorPosition };
|
|
7701
7939
|
},
|
|
7940
|
+
// 检查光标是否在段落开头
|
|
7702
7941
|
isCursorAtStartOfParagraph(range, paragraph) {
|
|
7703
7942
|
const { cursorPosition } = this.getParagraphTextExcludingTopics(paragraph, range);
|
|
7704
7943
|
return cursorPosition === 0;
|
|
7705
7944
|
},
|
|
7945
|
+
// 检查光标是否在段落末尾
|
|
7706
7946
|
isCursorAtEndOfParagraph(range, paragraph) {
|
|
7707
7947
|
const walker = document.createTreeWalker(
|
|
7708
7948
|
paragraph,
|
|
@@ -7729,6 +7969,7 @@
|
|
|
7729
7969
|
const { cursorPosition } = this.getParagraphTextExcludingTopics(paragraph, range);
|
|
7730
7970
|
return cursorPosition >= totalLength;
|
|
7731
7971
|
},
|
|
7972
|
+
// 获取当前段落
|
|
7732
7973
|
getCurrentParagraph(range) {
|
|
7733
7974
|
let container = range.startContainer;
|
|
7734
7975
|
while (container && container !== this.editorDom) {
|
|
@@ -7739,12 +7980,13 @@
|
|
|
7739
7980
|
}
|
|
7740
7981
|
return null;
|
|
7741
7982
|
},
|
|
7983
|
+
// 提取光标后的内容
|
|
7742
7984
|
extractContentAfterCursor(range, paragraph) {
|
|
7743
7985
|
const fragment = document.createDocumentFragment();
|
|
7744
7986
|
const container = range.startContainer;
|
|
7745
7987
|
const offset = range.startOffset;
|
|
7746
7988
|
let topicSpaceNode = null;
|
|
7747
|
-
if (container.nodeType === Node.TEXT_NODE && container.textContent === "
|
|
7989
|
+
if (container.nodeType === Node.TEXT_NODE && container.textContent === " " && container.previousSibling && container.previousSibling.tagName === "MDD-TOPIC") {
|
|
7748
7990
|
topicSpaceNode = container;
|
|
7749
7991
|
}
|
|
7750
7992
|
const extractRange = document.createRange();
|
|
@@ -7799,7 +8041,8 @@
|
|
|
7799
8041
|
try {
|
|
7800
8042
|
extractRange.setStartBefore(startNode);
|
|
7801
8043
|
let lastNode = paragraph.lastChild;
|
|
7802
|
-
while (lastNode && lastNode.nodeType === Node.TEXT_NODE && lastNode.textContent === "" &&
|
|
8044
|
+
while (lastNode && lastNode.nodeType === Node.TEXT_NODE && lastNode.textContent === "" && // 只跳过完全空的文本节点
|
|
8045
|
+
lastNode !== startNode) {
|
|
7803
8046
|
lastNode = lastNode.previousSibling;
|
|
7804
8047
|
}
|
|
7805
8048
|
if (lastNode) {
|
|
@@ -7819,6 +8062,7 @@
|
|
|
7819
8062
|
}
|
|
7820
8063
|
return fragment;
|
|
7821
8064
|
},
|
|
8065
|
+
// 统一的光标设置方法 - 设置光标到元素后面
|
|
7822
8066
|
setCursorAfterElement(element) {
|
|
7823
8067
|
const newRange = document.createRange();
|
|
7824
8068
|
newRange.setStartAfter(element);
|
|
@@ -7827,6 +8071,7 @@
|
|
|
7827
8071
|
selection.removeAllRanges();
|
|
7828
8072
|
selection.addRange(newRange);
|
|
7829
8073
|
},
|
|
8074
|
+
// 统一的光标设置方法 - 设置光标到元素前面
|
|
7830
8075
|
setCursorBeforeElement(element) {
|
|
7831
8076
|
const newRange = document.createRange();
|
|
7832
8077
|
newRange.setStartBefore(element);
|
|
@@ -7861,7 +8106,7 @@
|
|
|
7861
8106
|
vue.withDirectives(vue.createElementVNode("div", {
|
|
7862
8107
|
style: vue.normalizeStyle({ textAlign: $options.align }),
|
|
7863
8108
|
class: "placeholder"
|
|
7864
|
-
}, vue.toDisplayString($props.placeholder || "
|
|
8109
|
+
}, vue.toDisplayString($props.placeholder || "请输入正文"), 5), [
|
|
7865
8110
|
[vue.vShow, !$options.isInputing && !$data.titleCount && !$data.hasArticleCard]
|
|
7866
8111
|
]),
|
|
7867
8112
|
$data.overLine ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -7886,26 +8131,26 @@
|
|
|
7886
8131
|
vue.createVNode(_component_el_form, { model: $data.linkForm }, {
|
|
7887
8132
|
default: vue.withCtx(() => [
|
|
7888
8133
|
vue.createVNode(_component_el_form_item, {
|
|
7889
|
-
label: "
|
|
8134
|
+
label: "添加链接",
|
|
7890
8135
|
class: "link-title"
|
|
7891
8136
|
}, {
|
|
7892
8137
|
default: vue.withCtx(() => [
|
|
7893
8138
|
vue.createVNode(_component_el_input, {
|
|
7894
8139
|
modelValue: $data.linkForm.linkAddress,
|
|
7895
8140
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.linkForm.linkAddress = $event),
|
|
7896
|
-
placeholder: "
|
|
8141
|
+
placeholder: "请输入链接地址"
|
|
7897
8142
|
}, null, 8, ["modelValue"])
|
|
7898
8143
|
]),
|
|
7899
8144
|
_: 1
|
|
7900
8145
|
}),
|
|
7901
|
-
vue.createVNode(_component_el_form_item, { label: "
|
|
8146
|
+
vue.createVNode(_component_el_form_item, { label: "链接文案" }, {
|
|
7902
8147
|
default: vue.withCtx(() => [
|
|
7903
8148
|
vue.createVNode(_component_el_input, {
|
|
7904
8149
|
modelValue: $data.linkForm.linkWriting,
|
|
7905
8150
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.linkForm.linkWriting = $event),
|
|
7906
8151
|
type: "textarea",
|
|
7907
8152
|
autosize: "",
|
|
7908
|
-
placeholder: "
|
|
8153
|
+
placeholder: "请输入链接文案"
|
|
7909
8154
|
}, null, 8, ["modelValue"])
|
|
7910
8155
|
]),
|
|
7911
8156
|
_: 1
|
|
@@ -7918,18 +8163,18 @@
|
|
|
7918
8163
|
vue.createVNode(_component_el_button, {
|
|
7919
8164
|
onClick: _cache[3] || (_cache[3] = ($event) => $data.viewLinkDialog = false)
|
|
7920
8165
|
}, {
|
|
7921
|
-
default: vue.withCtx(() => [
|
|
7922
|
-
vue.createTextVNode("
|
|
7923
|
-
]),
|
|
8166
|
+
default: vue.withCtx(() => [..._cache[14] || (_cache[14] = [
|
|
8167
|
+
vue.createTextVNode("取 消", -1)
|
|
8168
|
+
])]),
|
|
7924
8169
|
_: 1
|
|
7925
8170
|
}),
|
|
7926
8171
|
vue.createVNode(_component_el_button, {
|
|
7927
8172
|
type: "primary",
|
|
7928
8173
|
onClick: $options.insertLink
|
|
7929
8174
|
}, {
|
|
7930
|
-
default: vue.withCtx(() => [
|
|
7931
|
-
vue.createTextVNode("
|
|
7932
|
-
]),
|
|
8175
|
+
default: vue.withCtx(() => [..._cache[15] || (_cache[15] = [
|
|
8176
|
+
vue.createTextVNode("确 定", -1)
|
|
8177
|
+
])]),
|
|
7933
8178
|
_: 1
|
|
7934
8179
|
}, 8, ["onClick"])
|
|
7935
8180
|
])
|
|
@@ -8014,7 +8259,7 @@
|
|
|
8014
8259
|
var COLOUR_CLASS = "colour";
|
|
8015
8260
|
var FONT_FAMILY_CLASS = "font";
|
|
8016
8261
|
var FONT_SIZE_CLASS = "size";
|
|
8017
|
-
var ZWS = "
|
|
8262
|
+
var ZWS = "";
|
|
8018
8263
|
var win = doc.defaultView;
|
|
8019
8264
|
var ua = navigator.userAgent;
|
|
8020
8265
|
var isAndroid = /Android/.test(ua);
|
|
@@ -8044,11 +8289,17 @@
|
|
|
8044
8289
|
};
|
|
8045
8290
|
}
|
|
8046
8291
|
var typeToBitArray = {
|
|
8292
|
+
// ELEMENT_NODE
|
|
8047
8293
|
1: 1,
|
|
8294
|
+
// ATTRIBUTE_NODE
|
|
8048
8295
|
2: 2,
|
|
8296
|
+
// TEXT_NODE
|
|
8049
8297
|
3: 4,
|
|
8298
|
+
// COMMENT_NODE
|
|
8050
8299
|
8: 128,
|
|
8300
|
+
// DOCUMENT_NODE
|
|
8051
8301
|
9: 256,
|
|
8302
|
+
// DOCUMENT_FRAGMENT_NODE
|
|
8052
8303
|
11: 1024
|
|
8053
8304
|
};
|
|
8054
8305
|
function TreeWalker(root, nodeType, filter) {
|
|
@@ -8382,7 +8633,7 @@
|
|
|
8382
8633
|
node.appendChild(fixer);
|
|
8383
8634
|
} catch (error) {
|
|
8384
8635
|
self2.didError({
|
|
8385
|
-
name: "Squire: fixCursor
|
|
8636
|
+
name: "Squire: fixCursor – " + error,
|
|
8386
8637
|
message: "Parent: " + node.nodeName + "/" + node.innerHTML + " appendChild: " + fixer.nodeName
|
|
8387
8638
|
});
|
|
8388
8639
|
}
|
|
@@ -8717,7 +8968,8 @@
|
|
|
8717
8968
|
block = getStartBlockOfRange(range, root);
|
|
8718
8969
|
firstBlockInFrag = getNextBlock(frag, frag);
|
|
8719
8970
|
replaceBlock = !!block && isEmptyBlock(block);
|
|
8720
|
-
if (block && firstBlockInFrag && !replaceBlock &&
|
|
8971
|
+
if (block && firstBlockInFrag && !replaceBlock && // Don't merge table cells or PRE elements into block
|
|
8972
|
+
!getNearest(firstBlockInFrag, frag, "PRE") && !getNearest(firstBlockInFrag, frag, "TABLE")) {
|
|
8721
8973
|
moveRangeBoundariesUpTree(range, block, block, root);
|
|
8722
8974
|
range.collapse(true);
|
|
8723
8975
|
container = range.endContainer;
|
|
@@ -8733,7 +8985,10 @@
|
|
|
8733
8985
|
container = nodeAfterSplit.parentNode;
|
|
8734
8986
|
offset = indexOf.call(container.childNodes, nodeAfterSplit);
|
|
8735
8987
|
}
|
|
8736
|
-
if (
|
|
8988
|
+
if (
|
|
8989
|
+
/* isBlock( container ) && */
|
|
8990
|
+
offset !== getLength(container)
|
|
8991
|
+
) {
|
|
8737
8992
|
blockContentsAfterSplit = root.ownerDocument.createDocumentFragment();
|
|
8738
8993
|
while (node = container.childNodes[offset]) {
|
|
8739
8994
|
blockContentsAfterSplit.appendChild(node);
|
|
@@ -9782,9 +10037,11 @@
|
|
|
9782
10037
|
if (hasImage) {
|
|
9783
10038
|
this.fireEvent("dragover", {
|
|
9784
10039
|
dataTransfer: clipboardData,
|
|
10040
|
+
/* jshint loopfunc: true */
|
|
9785
10041
|
preventDefault: function() {
|
|
9786
10042
|
fireDrop = true;
|
|
9787
10043
|
}
|
|
10044
|
+
/* jshint loopfunc: false */
|
|
9788
10045
|
});
|
|
9789
10046
|
if (fireDrop) {
|
|
9790
10047
|
this.fireEvent("drop", {
|
|
@@ -9991,7 +10248,9 @@
|
|
|
9991
10248
|
leafNodeNames,
|
|
9992
10249
|
undo: {
|
|
9993
10250
|
documentSizeThreshold: -1,
|
|
10251
|
+
// -1 means no threshold
|
|
9994
10252
|
undoLimit: -1
|
|
10253
|
+
// -1 means no limit
|
|
9995
10254
|
},
|
|
9996
10255
|
isInsertedHTMLSanitized: true,
|
|
9997
10256
|
isSetHTMLSanitized: true,
|
|
@@ -11633,5 +11892,5 @@
|
|
|
11633
11892
|
exports2.Editor = Editor;
|
|
11634
11893
|
exports2.ToolBar = ToolBar;
|
|
11635
11894
|
exports2.ToolsEnum = ToolsEnum;
|
|
11636
|
-
Object.
|
|
11895
|
+
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
11637
11896
|
});
|