@haluo/biz 2.0.13-beta → 2.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/haluo-biz.js +408 -210
- package/dist/haluo-biz.umd.cjs +409 -211
- package/dist/style.css +16 -32
- package/package.json +3 -2
package/dist/haluo-biz.umd.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(
|
|
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) : (
|
|
1
|
+
(function(global2, factory) {
|
|
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
5
|
const _interopDefaultLegacy = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
@@ -40,6 +40,268 @@
|
|
|
40
40
|
INSERT_ARTICLE: "insertArticle",
|
|
41
41
|
COLLECT_ARTICLE: "collectArticle"
|
|
42
42
|
};
|
|
43
|
+
var j;
|
|
44
|
+
const $ = typeof window < "u", fe = (e) => typeof e == "string", pe = () => {
|
|
45
|
+
};
|
|
46
|
+
$ && ((j = window == null ? void 0 : window.navigator) == null ? void 0 : j.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
47
|
+
function ve(e) {
|
|
48
|
+
return typeof e == "function" ? e() : vue.unref(e);
|
|
49
|
+
}
|
|
50
|
+
function me(e) {
|
|
51
|
+
return e;
|
|
52
|
+
}
|
|
53
|
+
function Ce(e) {
|
|
54
|
+
return vue.getCurrentScope() ? (vue.onScopeDispose(e), true) : false;
|
|
55
|
+
}
|
|
56
|
+
function A(e) {
|
|
57
|
+
var t;
|
|
58
|
+
const o = ve(e);
|
|
59
|
+
return (t = o == null ? void 0 : o.$el) != null ? t : o;
|
|
60
|
+
}
|
|
61
|
+
const K = $ ? window : void 0;
|
|
62
|
+
function Q(...e) {
|
|
63
|
+
let t, o, s, p;
|
|
64
|
+
if (fe(e[0]) || Array.isArray(e[0]) ? ([o, s, p] = e, t = K) : [t, o, s, p] = e, !t)
|
|
65
|
+
return pe;
|
|
66
|
+
Array.isArray(o) || (o = [o]), Array.isArray(s) || (s = [s]);
|
|
67
|
+
const _ = [], I = () => {
|
|
68
|
+
_.forEach((v) => v()), _.length = 0;
|
|
69
|
+
}, C = (v, g, m) => (v.addEventListener(g, m, p), () => v.removeEventListener(g, m, p)), d = vue.watch(() => A(t), (v) => {
|
|
70
|
+
I(), v && _.push(...o.flatMap((g) => s.map((m) => C(v, g, m))));
|
|
71
|
+
}, { immediate: true, flush: "post" }), y = () => {
|
|
72
|
+
d(), I();
|
|
73
|
+
};
|
|
74
|
+
return Ce(y), y;
|
|
75
|
+
}
|
|
76
|
+
function _e(e, t, o = {}) {
|
|
77
|
+
const { window: s = K, ignore: p, capture: _ = true, detectIframe: I = false } = o;
|
|
78
|
+
if (!s)
|
|
79
|
+
return;
|
|
80
|
+
let C = true, d;
|
|
81
|
+
const y = (u) => {
|
|
82
|
+
s.clearTimeout(d);
|
|
83
|
+
const a = A(e);
|
|
84
|
+
if (!(!a || a === u.target || u.composedPath().includes(a))) {
|
|
85
|
+
if (!C) {
|
|
86
|
+
C = true;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
t(u);
|
|
90
|
+
}
|
|
91
|
+
}, v = (u) => p && p.some((a) => {
|
|
92
|
+
const b = A(a);
|
|
93
|
+
return b && (u.target === b || u.composedPath().includes(b));
|
|
94
|
+
}), g = [
|
|
95
|
+
Q(s, "click", y, { passive: true, capture: _ }),
|
|
96
|
+
Q(s, "pointerdown", (u) => {
|
|
97
|
+
const a = A(e);
|
|
98
|
+
a && (C = !u.composedPath().includes(a) && !v(u));
|
|
99
|
+
}, { passive: true }),
|
|
100
|
+
Q(s, "pointerup", (u) => {
|
|
101
|
+
if (u.button === 0) {
|
|
102
|
+
const a = u.composedPath();
|
|
103
|
+
u.composedPath = () => a, d = s.setTimeout(() => y(u), 50);
|
|
104
|
+
}
|
|
105
|
+
}, { passive: true }),
|
|
106
|
+
I && Q(s, "blur", (u) => {
|
|
107
|
+
var a;
|
|
108
|
+
const b = A(e);
|
|
109
|
+
((a = s.document.activeElement) == null ? void 0 : a.tagName) === "IFRAME" && !(b != null && b.contains(s.document.activeElement)) && t(u);
|
|
110
|
+
})
|
|
111
|
+
].filter(Boolean);
|
|
112
|
+
return () => g.forEach((u) => u());
|
|
113
|
+
}
|
|
114
|
+
const D = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, R = "__vueuse_ssr_handlers__";
|
|
115
|
+
D[R] = D[R] || {};
|
|
116
|
+
D[R];
|
|
117
|
+
var q;
|
|
118
|
+
(function(e) {
|
|
119
|
+
e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
|
|
120
|
+
})(q || (q = {}));
|
|
121
|
+
var ge = Object.defineProperty, z = Object.getOwnPropertySymbols, be = Object.prototype.hasOwnProperty, ye = Object.prototype.propertyIsEnumerable, G = (e, t, o) => t in e ? ge(e, t, { enumerable: true, configurable: true, writable: true, value: o }) : e[t] = o, ke = (e, t) => {
|
|
122
|
+
for (var o in t || (t = {}))
|
|
123
|
+
be.call(t, o) && G(e, o, t[o]);
|
|
124
|
+
if (z)
|
|
125
|
+
for (var o of z(t))
|
|
126
|
+
ye.call(t, o) && G(e, o, t[o]);
|
|
127
|
+
return e;
|
|
128
|
+
};
|
|
129
|
+
const he = {
|
|
130
|
+
easeInSine: [0.12, 0, 0.39, 0],
|
|
131
|
+
easeOutSine: [0.61, 1, 0.88, 1],
|
|
132
|
+
easeInOutSine: [0.37, 0, 0.63, 1],
|
|
133
|
+
easeInQuad: [0.11, 0, 0.5, 0],
|
|
134
|
+
easeOutQuad: [0.5, 1, 0.89, 1],
|
|
135
|
+
easeInOutQuad: [0.45, 0, 0.55, 1],
|
|
136
|
+
easeInCubic: [0.32, 0, 0.67, 0],
|
|
137
|
+
easeOutCubic: [0.33, 1, 0.68, 1],
|
|
138
|
+
easeInOutCubic: [0.65, 0, 0.35, 1],
|
|
139
|
+
easeInQuart: [0.5, 0, 0.75, 0],
|
|
140
|
+
easeOutQuart: [0.25, 1, 0.5, 1],
|
|
141
|
+
easeInOutQuart: [0.76, 0, 0.24, 1],
|
|
142
|
+
easeInQuint: [0.64, 0, 0.78, 0],
|
|
143
|
+
easeOutQuint: [0.22, 1, 0.36, 1],
|
|
144
|
+
easeInOutQuint: [0.83, 0, 0.17, 1],
|
|
145
|
+
easeInExpo: [0.7, 0, 0.84, 0],
|
|
146
|
+
easeOutExpo: [0.16, 1, 0.3, 1],
|
|
147
|
+
easeInOutExpo: [0.87, 0, 0.13, 1],
|
|
148
|
+
easeInCirc: [0.55, 0, 1, 0.45],
|
|
149
|
+
easeOutCirc: [0, 0.55, 0.45, 1],
|
|
150
|
+
easeInOutCirc: [0.85, 0, 0.15, 1],
|
|
151
|
+
easeInBack: [0.36, 0, 0.66, -0.56],
|
|
152
|
+
easeOutBack: [0.34, 1.56, 0.64, 1],
|
|
153
|
+
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
|
|
154
|
+
};
|
|
155
|
+
ke({
|
|
156
|
+
linear: me
|
|
157
|
+
}, he);
|
|
158
|
+
const J = (e) => (vue.pushScopeId("data-v-b46fc003"), e = e(), vue.popScopeId(), e), we = { class: "hd" }, Oe = { class: "bd" }, Ie = /* @__PURE__ */ J(() => /* @__PURE__ */ vue.createElementVNode("h3", null, "\u4E3B\u9898\u989C\u8272", -1)), Ee = { class: "tColor" }, Pe = ["onMouseover", "onClick"], Me = { class: "bColor" }, Ae = ["onMouseover", "onClick"], $e = /* @__PURE__ */ J(() => /* @__PURE__ */ vue.createElementVNode("h3", null, "\u6807\u51C6\u989C\u8272", -1)), Te = { class: "tColor" }, Be = ["onMouseover", "onClick"], Ve = {
|
|
159
|
+
name: "colorPicker"
|
|
160
|
+
}, Ne = /* @__PURE__ */ vue.defineComponent({
|
|
161
|
+
...Ve,
|
|
162
|
+
props: {
|
|
163
|
+
modelValue: { type: String, required: true },
|
|
164
|
+
defaultColor: { type: String, required: false, default: "#000000" },
|
|
165
|
+
disabled: { type: Boolean, required: false }
|
|
166
|
+
},
|
|
167
|
+
emits: ["update:modelValue", "change"],
|
|
168
|
+
setup(e, { emit: t }) {
|
|
169
|
+
const o = e, s = vue.ref(false), p = () => {
|
|
170
|
+
s.value = !o.disabled;
|
|
171
|
+
}, _ = vue.ref(null);
|
|
172
|
+
_e(_, () => {
|
|
173
|
+
s.value = false;
|
|
174
|
+
});
|
|
175
|
+
const C = vue.ref(""), d = (n) => {
|
|
176
|
+
C.value = n;
|
|
177
|
+
}, y = ["#000000", "#ffffff", "#eeece1", "#1e497b", "#4e81bb", "#e2534d", "#9aba60", "#8165a0", "#47acc5", "#f9974c"], v = [
|
|
178
|
+
["#7f7f7f", "#f2f2f2"],
|
|
179
|
+
["#0d0d0d", "#808080"],
|
|
180
|
+
["#1c1a10", "#ddd8c3"],
|
|
181
|
+
["#0e243d", "#c6d9f0"],
|
|
182
|
+
["#233f5e", "#dae5f0"],
|
|
183
|
+
["#632623", "#f2dbdb"],
|
|
184
|
+
["#4d602c", "#eaf1de"],
|
|
185
|
+
["#3f3150", "#e6e0ec"],
|
|
186
|
+
["#1e5867", "#d9eef3"],
|
|
187
|
+
["#99490f", "#fee9da"]
|
|
188
|
+
], g = ["#c21401", "#ff1e02", "#ffc12a", "#ffff3a", "#90cf5b", "#00af57", "#00afee", "#0071be", "#00215f", "#72349d"], m = o.modelValue, u = vue.computed(() => C.value ? C : a), a = vue.computed(() => o.modelValue ? o.modelValue : o.defaultColor), b = vue.computed(() => {
|
|
189
|
+
let n = [];
|
|
190
|
+
for (let r of v)
|
|
191
|
+
n.push(oe(r[1], r[0], 5));
|
|
192
|
+
return n;
|
|
193
|
+
}), x = vue.ref(null), X = () => {
|
|
194
|
+
var n;
|
|
195
|
+
(n = x.value) == null || n.click();
|
|
196
|
+
}, E = (n) => {
|
|
197
|
+
t("update:modelValue", n), t("change", n), s.value = false;
|
|
198
|
+
}, Y = () => {
|
|
199
|
+
E(o.defaultColor);
|
|
200
|
+
}, Z = (n) => n.length === 4 ? n = "#" + n[1] + n[1] + n[2] + n[2] + n[3] + n[3] : n, ee = (n, r, l) => {
|
|
201
|
+
const c = (n << 16 | r << 8 | l).toString(16);
|
|
202
|
+
return "#" + new Array(Math.abs(c.length - 7)).join("0") + c;
|
|
203
|
+
}, H = (n) => {
|
|
204
|
+
n = Z(n);
|
|
205
|
+
let r = [];
|
|
206
|
+
for (let l = 1; l < 7; l += 2)
|
|
207
|
+
r.push(parseInt("0x" + n.slice(l, l + 2)));
|
|
208
|
+
return r;
|
|
209
|
+
}, oe = (n, r, l) => {
|
|
210
|
+
let c = H(n), f = H(r), S = (f[0] - c[0]) / l, T = (f[1] - c[1]) / l, te = (f[2] - c[2]) / l, U = [];
|
|
211
|
+
for (let P = 0; P < l; P++)
|
|
212
|
+
U.push(ee(S * P + c[0], T * P + c[1], te * P + c[2]));
|
|
213
|
+
return U;
|
|
214
|
+
};
|
|
215
|
+
return (n, r) => (vue.openBlock(), vue.createElementBlock("div", {
|
|
216
|
+
class: "m-colorPicker",
|
|
217
|
+
ref_key: "colorPicker",
|
|
218
|
+
ref: _,
|
|
219
|
+
onClick: r[7] || (r[7] = (l) => {
|
|
220
|
+
l.stopPropagation();
|
|
221
|
+
})
|
|
222
|
+
}, [
|
|
223
|
+
vue.createCommentVNode(" \u989C\u8272\u663E\u793A\u5C0F\u65B9\u5757 "),
|
|
224
|
+
vue.createElementVNode("div", {
|
|
225
|
+
class: vue.normalizeClass(["colorBtn", { disabled: e.disabled }]),
|
|
226
|
+
style: vue.normalizeStyle(`background-color: ${vue.unref(a)}`),
|
|
227
|
+
onClick: p
|
|
228
|
+
}, null, 6),
|
|
229
|
+
vue.createCommentVNode(" \u989C\u8272\u8272\u76D8 "),
|
|
230
|
+
vue.createElementVNode("div", {
|
|
231
|
+
class: vue.normalizeClass(["box", { open: s.value }])
|
|
232
|
+
}, [
|
|
233
|
+
vue.createElementVNode("div", we, [
|
|
234
|
+
vue.createElementVNode("div", {
|
|
235
|
+
class: "colorView",
|
|
236
|
+
style: vue.normalizeStyle({ "background-color": vue.unref(u).value })
|
|
237
|
+
}, null, 4),
|
|
238
|
+
vue.createElementVNode("div", {
|
|
239
|
+
class: "defaultColor",
|
|
240
|
+
onClick: Y,
|
|
241
|
+
onMouseover: r[0] || (r[0] = (l) => d(e.defaultColor)),
|
|
242
|
+
onMouseout: r[1] || (r[1] = (l) => d(""))
|
|
243
|
+
}, "\u9ED8\u8BA4\u989C\u8272", 32)
|
|
244
|
+
]),
|
|
245
|
+
vue.createElementVNode("div", Oe, [
|
|
246
|
+
Ie,
|
|
247
|
+
vue.createElementVNode("ul", Ee, [
|
|
248
|
+
(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(y, (l, c) => vue.createElementVNode("li", {
|
|
249
|
+
key: c,
|
|
250
|
+
style: vue.normalizeStyle({ backgroundColor: l }),
|
|
251
|
+
onMouseover: (f) => d(l),
|
|
252
|
+
onMouseout: r[2] || (r[2] = (f) => d("")),
|
|
253
|
+
onClick: (f) => E(l)
|
|
254
|
+
}, null, 44, Pe)), 64))
|
|
255
|
+
]),
|
|
256
|
+
vue.createElementVNode("ul", Me, [
|
|
257
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(b), (l, c) => (vue.openBlock(), vue.createElementBlock("li", { key: c }, [
|
|
258
|
+
vue.createElementVNode("ul", null, [
|
|
259
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(l, (f, S) => (vue.openBlock(), vue.createElementBlock("li", {
|
|
260
|
+
key: S,
|
|
261
|
+
style: vue.normalizeStyle({ backgroundColor: f }),
|
|
262
|
+
onMouseover: (T) => d(f),
|
|
263
|
+
onMouseout: r[3] || (r[3] = (T) => d("")),
|
|
264
|
+
onClick: (T) => E(f)
|
|
265
|
+
}, null, 44, Ae))), 128))
|
|
266
|
+
])
|
|
267
|
+
]))), 128))
|
|
268
|
+
]),
|
|
269
|
+
$e,
|
|
270
|
+
vue.createElementVNode("ul", Te, [
|
|
271
|
+
(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(g, (l, c) => vue.createElementVNode("li", {
|
|
272
|
+
key: c,
|
|
273
|
+
style: vue.normalizeStyle({ backgroundColor: l }),
|
|
274
|
+
onMouseover: (f) => d(l),
|
|
275
|
+
onMouseout: r[4] || (r[4] = (f) => d("")),
|
|
276
|
+
onClick: (f) => E(l)
|
|
277
|
+
}, null, 44, Be)), 64))
|
|
278
|
+
]),
|
|
279
|
+
vue.createElementVNode("h3", { onClick: X }, "\u66F4\u591A\u989C\u8272..."),
|
|
280
|
+
vue.createCommentVNode(" \u7528\u4EE5\u6FC0\u6D3BHTML5\u989C\u8272\u9762\u677F "),
|
|
281
|
+
vue.withDirectives(vue.createElementVNode("input", {
|
|
282
|
+
type: "color",
|
|
283
|
+
ref_key: "html5ColorEl",
|
|
284
|
+
ref: x,
|
|
285
|
+
"onUpdate:modelValue": r[5] || (r[5] = (l) => vue.isRef(m) ? m.value = l : null),
|
|
286
|
+
onChange: r[6] || (r[6] = (l) => E(vue.unref(m)))
|
|
287
|
+
}, null, 544), [
|
|
288
|
+
[vue.vModelText, vue.unref(m)]
|
|
289
|
+
])
|
|
290
|
+
])
|
|
291
|
+
], 2)
|
|
292
|
+
], 512));
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
const Qe = (e, t) => {
|
|
296
|
+
const o = e.__vccOpts || e;
|
|
297
|
+
for (const [s, p] of t)
|
|
298
|
+
o[s] = p;
|
|
299
|
+
return o;
|
|
300
|
+
}, O = /* @__PURE__ */ Qe(Ne, [["__scopeId", "data-v-b46fc003"], ["__file", "/Users/zhuleyi/WORK/github/vue-color-picker/packages/color-picker/src/index.vue"]]);
|
|
301
|
+
O.install = function(e, t) {
|
|
302
|
+
e.component(O.name, O);
|
|
303
|
+
};
|
|
304
|
+
console.log("name", O.name);
|
|
43
305
|
const ToolBar_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
44
306
|
const ToolBar_vue_vue_type_style_index_1_lang = "";
|
|
45
307
|
const _export_sfc = (sfc, props) => {
|
|
@@ -835,7 +1097,7 @@
|
|
|
835
1097
|
])
|
|
836
1098
|
])) : vue.createCommentVNode("", true);
|
|
837
1099
|
}
|
|
838
|
-
const ToolBar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$3], ["__scopeId", "data-v-
|
|
1100
|
+
const ToolBar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$3], ["__scopeId", "data-v-dd9e6bac"]]);
|
|
839
1101
|
const __vite_glob_0_0 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAmCAYAAAClI5npAAAA0UlEQVR42uWYwQnDMAxFfckAXkFDmGzgS1foDpnFS3gTb+IFtIDyA4UeBKUtNR8qwTvlkAdyfmSletySmRUwgIIJOijXs9VcLxegwNVDRFYLdHtdCg6wrRKY9l4NUFYIqH1WDeTfCXxXE9w5Ar4tQhBwh7SBjSDg2lJJAj47SAI+OwgC7pDuJAGfHQQBnx0kAZ8dBAF3SOtTgCchybjV2QLKFpihW6BAQn6GA0i4KG4g037H4QaSDiTWUMocyweQcFezBjLrer5TFxR/uaKhL6lOdeUQ8G6X1pQAAAAASUVORK5CYII=";
|
|
840
1102
|
const index_vue_vue_type_style_index_0_lang$4 = "";
|
|
841
1103
|
const _hoisted_1$6 = { class: "basic-dialog_title" };
|
|
@@ -1806,9 +2068,7 @@
|
|
|
1806
2068
|
},
|
|
1807
2069
|
countList: [],
|
|
1808
2070
|
replaceSeamless: 0,
|
|
1809
|
-
seamlessCount: 0
|
|
1810
|
-
overLine: "",
|
|
1811
|
-
currentVideo: null
|
|
2071
|
+
seamlessCount: 0
|
|
1812
2072
|
};
|
|
1813
2073
|
},
|
|
1814
2074
|
computed: {
|
|
@@ -1845,23 +2105,23 @@
|
|
|
1845
2105
|
}
|
|
1846
2106
|
},
|
|
1847
2107
|
created() {
|
|
1848
|
-
const
|
|
1849
|
-
|
|
1850
|
-
|
|
2108
|
+
const me2 = this;
|
|
2109
|
+
me2.user = JSON.parse(window.localStorage.getItem("user") || window.localStorage.getItem("userInfo") || "{}");
|
|
2110
|
+
me2.guid = me2.user.uid + "|" + util__default.default.tools.guid();
|
|
1851
2111
|
},
|
|
1852
2112
|
beforeDestroy() {
|
|
1853
2113
|
this.editorDom && this.editorDom.removeEventListener("blur", this.canSetAlign);
|
|
1854
2114
|
},
|
|
1855
2115
|
mounted() {
|
|
1856
|
-
const
|
|
1857
|
-
|
|
1858
|
-
|
|
2116
|
+
const me2 = this;
|
|
2117
|
+
me2.editorDom = document.getElementById("editor-content");
|
|
2118
|
+
me2.editorDom.addEventListener("blur", this.canSetAlign);
|
|
1859
2119
|
if (!window.Squire) {
|
|
1860
2120
|
Promise.resolve().then(() => squireRaw).then(function() {
|
|
1861
|
-
|
|
2121
|
+
me2.initSquire();
|
|
1862
2122
|
});
|
|
1863
2123
|
} else {
|
|
1864
|
-
|
|
2124
|
+
me2.initSquire();
|
|
1865
2125
|
}
|
|
1866
2126
|
},
|
|
1867
2127
|
methods: {
|
|
@@ -1920,36 +2180,36 @@
|
|
|
1920
2180
|
this.visibleVideo = false;
|
|
1921
2181
|
const fileName = (files[0] && files[0].name || "").toLowerCase();
|
|
1922
2182
|
if (files[0].size > 1 * 1024 * 1024 * 1024) {
|
|
1923
|
-
return
|
|
2183
|
+
return me2.setToast("\u89C6\u9891\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC71GB");
|
|
1924
2184
|
}
|
|
1925
2185
|
if (fileName.indexOf(".mp4") === -1 && fileName.indexOf(".mov") === -1) {
|
|
1926
|
-
return
|
|
2186
|
+
return me2.setToast("\u89C6\u9891\u683C\u5F0F\u4E0D\u662Fmp4\u6216mov");
|
|
1927
2187
|
}
|
|
1928
|
-
const
|
|
1929
|
-
if (
|
|
2188
|
+
const me2 = this;
|
|
2189
|
+
if (me2.loading)
|
|
1930
2190
|
return;
|
|
1931
|
-
|
|
1932
|
-
|
|
2191
|
+
me2.closeDialog();
|
|
2192
|
+
me2.loading = true;
|
|
1933
2193
|
this.editor["insertVideoProgress"]();
|
|
1934
2194
|
this.$emit("insertVideo", this, files, (result) => {
|
|
1935
2195
|
const video = {
|
|
1936
2196
|
duration: result.duration || "",
|
|
1937
2197
|
link: result.videoUrl || "",
|
|
1938
|
-
img:
|
|
2198
|
+
img: me2.coverUrl || result.coverUrl || result.customCover || "",
|
|
1939
2199
|
id: result.videoId,
|
|
1940
2200
|
desc: "",
|
|
1941
2201
|
vodSize: result.vodSize || "",
|
|
1942
2202
|
vodType: result.vodType || ""
|
|
1943
2203
|
};
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
2204
|
+
me2.$emit("updateAddVideo", true);
|
|
2205
|
+
me2.editor["insertVideo"](result.videoUrl, video);
|
|
2206
|
+
me2.updateData(true);
|
|
1947
2207
|
}, (_) => {
|
|
1948
|
-
|
|
2208
|
+
me2.setMessageBoxNoCancel(_);
|
|
1949
2209
|
}, () => {
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
2210
|
+
me2.loading = false;
|
|
2211
|
+
me2.loadingText = "";
|
|
2212
|
+
me2.removeProgress();
|
|
1953
2213
|
});
|
|
1954
2214
|
},
|
|
1955
2215
|
replaceImg(e) {
|
|
@@ -1958,12 +2218,6 @@
|
|
|
1958
2218
|
this.imgUploadHandler(type, src);
|
|
1959
2219
|
});
|
|
1960
2220
|
},
|
|
1961
|
-
replacePoster(e) {
|
|
1962
|
-
this.$emit("insertImgs", e.target.files, "replace-poster", (type, src) => {
|
|
1963
|
-
this.visibleImg = false;
|
|
1964
|
-
this.imgUploadHandler(type, src);
|
|
1965
|
-
});
|
|
1966
|
-
},
|
|
1967
2221
|
againImg(e) {
|
|
1968
2222
|
this.$emit("insertImgs", e.target.files, "uploadAgainImages", (type, src) => {
|
|
1969
2223
|
this.visibleImg = false;
|
|
@@ -2128,7 +2382,7 @@
|
|
|
2128
2382
|
node.appendChild(del);
|
|
2129
2383
|
},
|
|
2130
2384
|
parseVideo(node, essayPicRelVOList) {
|
|
2131
|
-
const
|
|
2385
|
+
const me2 = this;
|
|
2132
2386
|
const videoData = JSON.parse(node.dataset.video);
|
|
2133
2387
|
const video = node.querySelector(".halo-video-area");
|
|
2134
2388
|
const videoId = video.src;
|
|
@@ -2146,16 +2400,14 @@
|
|
|
2146
2400
|
"class": "pointer video-delete icon",
|
|
2147
2401
|
"contenteditable": "false",
|
|
2148
2402
|
onClick(e) {
|
|
2149
|
-
|
|
2403
|
+
me2.removeParentByClass(e.target, "halo-video-content");
|
|
2150
2404
|
e.stopPropagation();
|
|
2151
2405
|
}
|
|
2152
2406
|
});
|
|
2153
2407
|
node.onclick = function() {
|
|
2154
|
-
|
|
2408
|
+
me2.setToast("\u4E0D\u652F\u6301\u64AD\u653E");
|
|
2155
2409
|
};
|
|
2156
|
-
const replaceBtn = me.insertVideoBtns(this, video);
|
|
2157
2410
|
node.appendChild(delBtn);
|
|
2158
|
-
node.appendChild(replaceBtn);
|
|
2159
2411
|
},
|
|
2160
2412
|
async parseArticle(node) {
|
|
2161
2413
|
const data = JSON.parse(node.dataset.article);
|
|
@@ -2272,7 +2524,7 @@
|
|
|
2272
2524
|
});
|
|
2273
2525
|
},
|
|
2274
2526
|
imgUploadHandler(type, imgSrc) {
|
|
2275
|
-
const
|
|
2527
|
+
const me2 = this;
|
|
2276
2528
|
if (type && imgSrc) {
|
|
2277
2529
|
if (type === "uploadAgainImages") {
|
|
2278
2530
|
this.updateImage(imgSrc, this.currentImg);
|
|
@@ -2284,14 +2536,9 @@
|
|
|
2284
2536
|
src: imgSrc,
|
|
2285
2537
|
img: imgSrc,
|
|
2286
2538
|
selected: false,
|
|
2287
|
-
seamlessFlag:
|
|
2539
|
+
seamlessFlag: me2.replaceSeamless,
|
|
2288
2540
|
type: "2"
|
|
2289
2541
|
}, this.range);
|
|
2290
|
-
} else if (type === "replace-poster") {
|
|
2291
|
-
if (this.currentVideo) {
|
|
2292
|
-
this.currentVideo.poster = imgSrc;
|
|
2293
|
-
this.currentVideo = null;
|
|
2294
|
-
}
|
|
2295
2542
|
} else {
|
|
2296
2543
|
this.seamlessCount++;
|
|
2297
2544
|
const isLast = this.seamlessCount === this.imgList.length;
|
|
@@ -2310,23 +2557,8 @@
|
|
|
2310
2557
|
this.setToast(rst.origin.name + "\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
|
|
2311
2558
|
}
|
|
2312
2559
|
},
|
|
2313
|
-
insertVideoBtns(editor, node) {
|
|
2314
|
-
const me = this;
|
|
2315
|
-
var replaceBtn = editor.createElement("div", {
|
|
2316
|
-
"class": "video-cover-replace pointer",
|
|
2317
|
-
"contenteditable": "false"
|
|
2318
|
-
});
|
|
2319
|
-
replaceBtn.onclick = function(e) {
|
|
2320
|
-
const posterBtn = document.querySelector(".replace-poster");
|
|
2321
|
-
posterBtn.click();
|
|
2322
|
-
me.currentVideo = node;
|
|
2323
|
-
e.stopPropagation();
|
|
2324
|
-
};
|
|
2325
|
-
replaceBtn.innerText = "\u66F4\u6362\u5C01\u9762";
|
|
2326
|
-
return replaceBtn;
|
|
2327
|
-
},
|
|
2328
2560
|
insertImgOperateBtns(editor, data) {
|
|
2329
|
-
const
|
|
2561
|
+
const me2 = this;
|
|
2330
2562
|
var replaceBtn = editor.createElement("div", {
|
|
2331
2563
|
"class": "img-replace pointer",
|
|
2332
2564
|
"contenteditable": "false"
|
|
@@ -2335,11 +2567,11 @@
|
|
|
2335
2567
|
"class": "img-delete pointer icon",
|
|
2336
2568
|
"contenteditable": "false",
|
|
2337
2569
|
onClick(e) {
|
|
2338
|
-
if (
|
|
2570
|
+
if (me2.disabled)
|
|
2339
2571
|
return;
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2572
|
+
me2.removeSeamlessLaster(e);
|
|
2573
|
+
me2.removeParentByClass(e.target, "halo-img-content");
|
|
2574
|
+
me2.updateData(true);
|
|
2343
2575
|
}
|
|
2344
2576
|
});
|
|
2345
2577
|
var descInputWrap;
|
|
@@ -2352,13 +2584,13 @@
|
|
|
2352
2584
|
placeholder: "\u8BF7\u8F93\u5165\u56FE\u7247\u63CF\u8FF0(\u6700\u591A50\u5B57)",
|
|
2353
2585
|
"contenteditable": "false"
|
|
2354
2586
|
});
|
|
2355
|
-
descInput.disabled =
|
|
2587
|
+
descInput.disabled = me2.disabled;
|
|
2356
2588
|
descInput.oninput = function(e) {
|
|
2357
|
-
const parent =
|
|
2589
|
+
const parent = me2.findParentByClass(e.target, "halo-img-content");
|
|
2358
2590
|
const img = parent.querySelector(".halo-picture-area");
|
|
2359
2591
|
img.dataset.desc = e.target.value;
|
|
2360
2592
|
if (e.target.value.length > 49) {
|
|
2361
|
-
return
|
|
2593
|
+
return me2.setToast("\u9650\u523650\u4E2A\u5B57\u7B26");
|
|
2362
2594
|
}
|
|
2363
2595
|
};
|
|
2364
2596
|
descInput.value = data.content || "";
|
|
@@ -2368,22 +2600,22 @@
|
|
|
2368
2600
|
"style": `${data.seamlessFlag === "1" && "display: none"}`
|
|
2369
2601
|
}, [descInput]);
|
|
2370
2602
|
replaceBtn.onclick = function(e) {
|
|
2371
|
-
if (
|
|
2603
|
+
if (me2.disabled)
|
|
2372
2604
|
return;
|
|
2373
|
-
const current =
|
|
2605
|
+
const current = me2.findParentByClass(e.target, "halo-img-content");
|
|
2374
2606
|
const range = document.createRange();
|
|
2375
2607
|
range.setEnd(current.previousElementSibling, 1);
|
|
2376
2608
|
range.collapse(false);
|
|
2377
|
-
|
|
2378
|
-
|
|
2609
|
+
me2.range = range;
|
|
2610
|
+
me2.replaceSeamless = data.seamlessFlag || "0";
|
|
2379
2611
|
const replaceInput = document.querySelector(".replace-input");
|
|
2380
|
-
|
|
2612
|
+
me2.removePreviousImg = () => me2.removeParentByClass(e.target, "halo-img-content");
|
|
2381
2613
|
replaceInput.click();
|
|
2382
2614
|
};
|
|
2383
2615
|
delBtn.onclick = function(e) {
|
|
2384
|
-
if (
|
|
2616
|
+
if (me2.disabled)
|
|
2385
2617
|
return;
|
|
2386
|
-
const cur =
|
|
2618
|
+
const cur = me2.findParentByClass(e.target, "halo-img-content");
|
|
2387
2619
|
const currentImg = cur.getElementsByClassName("halo-picture-area")[0];
|
|
2388
2620
|
const currentData = JSON.parse(currentImg.getAttribute("data"));
|
|
2389
2621
|
if (currentData.seamlessFlag === "0") {
|
|
@@ -2401,15 +2633,15 @@
|
|
|
2401
2633
|
console.log(e2);
|
|
2402
2634
|
}
|
|
2403
2635
|
}
|
|
2404
|
-
|
|
2405
|
-
|
|
2636
|
+
me2.removeParentByClass(e.target, "halo-img-content");
|
|
2637
|
+
me2.updateData(true);
|
|
2406
2638
|
};
|
|
2407
2639
|
replaceBtn.innerHTML = "\u66FF\u6362";
|
|
2408
2640
|
return [replaceBtn, delBtn, descInputWrap];
|
|
2409
2641
|
},
|
|
2410
2642
|
removeSeamlessLaster(e) {
|
|
2411
|
-
const
|
|
2412
|
-
const cur =
|
|
2643
|
+
const me2 = this;
|
|
2644
|
+
const cur = me2.findParentByClass(e.target, "halo-img-content");
|
|
2413
2645
|
const currentImg = cur.getElementsByClassName("halo-picture-area")[0];
|
|
2414
2646
|
const currentData = JSON.parse(currentImg.getAttribute("data"));
|
|
2415
2647
|
if (currentData.seamlessFlag === "0") {
|
|
@@ -2436,9 +2668,9 @@
|
|
|
2436
2668
|
});
|
|
2437
2669
|
},
|
|
2438
2670
|
initSquire() {
|
|
2439
|
-
const
|
|
2440
|
-
|
|
2441
|
-
|
|
2671
|
+
const me2 = this;
|
|
2672
|
+
me2.editorDom;
|
|
2673
|
+
me2.editor = new window.Squire(me2.editorDom, {
|
|
2442
2674
|
blockTag: "p",
|
|
2443
2675
|
blockAttributes: {
|
|
2444
2676
|
"class": "halo-paragraph"
|
|
@@ -2453,7 +2685,7 @@
|
|
|
2453
2685
|
this.styleStatus.size = parseInt(this.fontInfo.size) === 100 ? 17 : this.fontInfo.size;
|
|
2454
2686
|
this.styleStatus.color = this.fontInfo.color;
|
|
2455
2687
|
});
|
|
2456
|
-
|
|
2688
|
+
me2.editor.addEventListener("willPaste", function(type, handler) {
|
|
2457
2689
|
function validateDom() {
|
|
2458
2690
|
const fragment = type && type.fragment || {};
|
|
2459
2691
|
let tmpNode = document.createElement("div");
|
|
@@ -2464,7 +2696,7 @@
|
|
|
2464
2696
|
}
|
|
2465
2697
|
validateDom();
|
|
2466
2698
|
if (type.defaultPrevented) {
|
|
2467
|
-
|
|
2699
|
+
me2.getSticker(type, handler);
|
|
2468
2700
|
}
|
|
2469
2701
|
});
|
|
2470
2702
|
window.Squire.prototype.makeParagraph = function(content, position, textAlign) {
|
|
@@ -2524,7 +2756,7 @@
|
|
|
2524
2756
|
selection.addRange(range);
|
|
2525
2757
|
};
|
|
2526
2758
|
window.Squire.prototype.insertImages = function(src, data = {}, range) {
|
|
2527
|
-
var isHaloImage =
|
|
2759
|
+
var isHaloImage = me2.isHaloImage(src);
|
|
2528
2760
|
var scrollTop = document.documentElement.scrollTop;
|
|
2529
2761
|
const isSeameless = data.seamlessFlag === "1";
|
|
2530
2762
|
var loading = this.createElement("div", {
|
|
@@ -2556,10 +2788,9 @@
|
|
|
2556
2788
|
"data": JSON.stringify(data),
|
|
2557
2789
|
"style": isSeameless ? "margin: 0" : "margin-top: 0",
|
|
2558
2790
|
"data-content": data.content || "",
|
|
2559
|
-
"contenteditable": "false"
|
|
2560
|
-
"draggable": "false"
|
|
2791
|
+
"contenteditable": "false"
|
|
2561
2792
|
});
|
|
2562
|
-
const btns =
|
|
2793
|
+
const btns = me2.insertImgOperateBtns(this, data);
|
|
2563
2794
|
var childList = [];
|
|
2564
2795
|
childList.push(img);
|
|
2565
2796
|
childList.push(...btns);
|
|
@@ -2568,19 +2799,12 @@
|
|
|
2568
2799
|
!isHaloImage && childList.push(again);
|
|
2569
2800
|
var p = this.createElement("div", {
|
|
2570
2801
|
"class": "halo-img-content",
|
|
2571
|
-
"contenteditable": "false"
|
|
2572
|
-
"draggable": "false"
|
|
2802
|
+
"contenteditable": "false"
|
|
2573
2803
|
}, [...childList]);
|
|
2574
|
-
p.onfocus = function() {
|
|
2575
|
-
img.style["outline"] = "1px solid #1a74ff";
|
|
2576
|
-
};
|
|
2577
|
-
p.onblur = function() {
|
|
2578
|
-
img.style["outline"] = "none";
|
|
2579
|
-
};
|
|
2580
2804
|
this.insertElement(p, range);
|
|
2581
2805
|
if (isSeameless) {
|
|
2582
|
-
|
|
2583
|
-
|
|
2806
|
+
me2.removeDefault(p, "nextElementSibling");
|
|
2807
|
+
me2.removeDefault(p, "previousElementSibling");
|
|
2584
2808
|
}
|
|
2585
2809
|
setTimeout(() => {
|
|
2586
2810
|
document.documentElement.scrollTop = scrollTop;
|
|
@@ -2616,41 +2840,22 @@
|
|
|
2616
2840
|
"data-content": data.content || "",
|
|
2617
2841
|
"poster": data.img || ""
|
|
2618
2842
|
});
|
|
2619
|
-
var delBtn =
|
|
2843
|
+
var delBtn = me2.genIconDom({
|
|
2620
2844
|
"class": "pointer video-delete icon",
|
|
2621
2845
|
"contenteditable": "false",
|
|
2622
2846
|
onClick(e) {
|
|
2623
|
-
|
|
2847
|
+
me2.removeParentByClass(e.target, "halo-video-content");
|
|
2624
2848
|
e.stopPropagation();
|
|
2625
2849
|
}
|
|
2626
2850
|
});
|
|
2627
2851
|
console.log(delBtn);
|
|
2628
|
-
const posterBtn = me.insertVideoBtns(this, video);
|
|
2629
2852
|
var p = this.createElement("DIV", {
|
|
2630
2853
|
"class": "halo-video-content",
|
|
2631
|
-
"contenteditable": "
|
|
2632
|
-
"data-video": JSON.stringify(data)
|
|
2633
|
-
|
|
2634
|
-
}, [video, delBtn, posterBtn]);
|
|
2854
|
+
"contenteditable": "true",
|
|
2855
|
+
"data-video": JSON.stringify(data)
|
|
2856
|
+
}, [video, delBtn]);
|
|
2635
2857
|
p.onclick = function() {
|
|
2636
|
-
|
|
2637
|
-
};
|
|
2638
|
-
let targetMove = null;
|
|
2639
|
-
p.ondragstart = function(e) {
|
|
2640
|
-
e.dataTransfer.setData("text/html", e.target);
|
|
2641
|
-
e.dataTransfer.effectAllowed = "move";
|
|
2642
|
-
e.dataTransfer.dropEffect = "move";
|
|
2643
|
-
targetMove = e.target;
|
|
2644
|
-
console.log(e, "drag");
|
|
2645
|
-
};
|
|
2646
|
-
editorDom.ondragover = function(e) {
|
|
2647
|
-
console.log(e, "over", me);
|
|
2648
|
-
e.preventDefault();
|
|
2649
|
-
};
|
|
2650
|
-
editorDom.ondrop = function(e) {
|
|
2651
|
-
console.log(e, "ondrop");
|
|
2652
|
-
e.target.after(targetMove);
|
|
2653
|
-
e.preventDefault();
|
|
2858
|
+
me2.setToast("\u4E0D\u652F\u6301\u64AD\u653E");
|
|
2654
2859
|
};
|
|
2655
2860
|
this.insertElement(p);
|
|
2656
2861
|
setTimeout(() => {
|
|
@@ -2661,7 +2866,7 @@
|
|
|
2661
2866
|
var scrollTop = document.documentElement.scrollTop;
|
|
2662
2867
|
var img = `<img class="link-img" src='/static/img/icon_link@3x.png'></img>`;
|
|
2663
2868
|
var a = `<a class="halo-link-mes" data-url="${link}" target="_blank">${text}</a>`;
|
|
2664
|
-
const del =
|
|
2869
|
+
const del = me2.generateDelLinkIcon();
|
|
2665
2870
|
var p = this.createElement("DIV", {
|
|
2666
2871
|
"class": "halo-link",
|
|
2667
2872
|
"contenteditable": "false"
|
|
@@ -2673,10 +2878,10 @@
|
|
|
2673
2878
|
document.documentElement.scrollTop = scrollTop;
|
|
2674
2879
|
}, 50);
|
|
2675
2880
|
};
|
|
2676
|
-
|
|
2881
|
+
me2.sticky();
|
|
2677
2882
|
},
|
|
2678
2883
|
removeDefault(next, key) {
|
|
2679
|
-
const
|
|
2884
|
+
const me2 = this;
|
|
2680
2885
|
const cur = next[key];
|
|
2681
2886
|
if (!cur || cur.innerText !== "\n")
|
|
2682
2887
|
return;
|
|
@@ -2684,30 +2889,30 @@
|
|
|
2684
2889
|
const isLasterBlock = next.classList.contains("halo-paragraph") || false;
|
|
2685
2890
|
if (blockDefault && isLasterBlock) {
|
|
2686
2891
|
cur.remove();
|
|
2687
|
-
|
|
2892
|
+
me2.removeDefault(cur, key);
|
|
2688
2893
|
} else {
|
|
2689
2894
|
if (blockDefault) {
|
|
2690
2895
|
cur.style.display = "none";
|
|
2691
|
-
|
|
2896
|
+
me2.removeDefault(cur, key);
|
|
2692
2897
|
}
|
|
2693
2898
|
}
|
|
2694
2899
|
},
|
|
2695
2900
|
generateDelLinkIcon() {
|
|
2696
|
-
const
|
|
2901
|
+
const me2 = this;
|
|
2697
2902
|
const del = this.editor.createElement("img", {
|
|
2698
2903
|
"class": "img-delete",
|
|
2699
2904
|
"contenteditable": "false",
|
|
2700
2905
|
"src": car_ciose
|
|
2701
2906
|
});
|
|
2702
2907
|
del.onclick = function(e) {
|
|
2703
|
-
const parent =
|
|
2908
|
+
const parent = me2.findParentByClass(e.target, "halo-link");
|
|
2704
2909
|
parent.remove();
|
|
2705
2910
|
};
|
|
2706
2911
|
return del;
|
|
2707
2912
|
},
|
|
2708
2913
|
getEditorData() {
|
|
2709
|
-
const
|
|
2710
|
-
const children = Array.from(
|
|
2914
|
+
const me2 = this;
|
|
2915
|
+
const children = Array.from(me2.editorDom.children);
|
|
2711
2916
|
let isNotParagraph = true;
|
|
2712
2917
|
let count = 0;
|
|
2713
2918
|
let imgCount = 0;
|
|
@@ -2723,7 +2928,7 @@
|
|
|
2723
2928
|
} else if (value.className.includes("article-wrap")) {
|
|
2724
2929
|
const article = JSON.parse(value.dataset.article);
|
|
2725
2930
|
cardEassyFlagStatus = !!article.cardEassyFlag;
|
|
2726
|
-
|
|
2931
|
+
me2.hasArticleCard = true;
|
|
2727
2932
|
} else if (value.className.includes("halo-paragraph") || value.tagName === "OL" || value.tagName === "UL") {
|
|
2728
2933
|
const text = value.innerText && value.innerText.trim();
|
|
2729
2934
|
if (text.length < 1) {
|
|
@@ -2766,43 +2971,43 @@
|
|
|
2766
2971
|
return url.indexOf("jddmoto.com") > -1 || url.indexOf("58moto.com") > -1;
|
|
2767
2972
|
},
|
|
2768
2973
|
updateUploads() {
|
|
2769
|
-
const
|
|
2974
|
+
const me2 = this;
|
|
2770
2975
|
setTimeout(() => {
|
|
2771
2976
|
const uploads = document.querySelectorAll(".no-upload") || [];
|
|
2772
|
-
|
|
2773
|
-
|
|
2977
|
+
me2.uploadStore = {};
|
|
2978
|
+
me2.currentIndex = 0;
|
|
2774
2979
|
Array.from(uploads).map((_, index) => {
|
|
2775
2980
|
const id = _.getAttribute("id");
|
|
2776
2981
|
const key = index + "|" + id;
|
|
2777
|
-
|
|
2982
|
+
me2.uploadStore[key] = _;
|
|
2778
2983
|
});
|
|
2779
|
-
|
|
2984
|
+
me2.uploadImageHandler();
|
|
2780
2985
|
}, 500);
|
|
2781
2986
|
},
|
|
2782
2987
|
uploadImageHandler(key = "") {
|
|
2783
|
-
const
|
|
2784
|
-
const list = Object.keys(
|
|
2785
|
-
if (!list.length ||
|
|
2988
|
+
const me2 = this;
|
|
2989
|
+
const list = Object.keys(me2.uploadStore);
|
|
2990
|
+
if (!list.length || me2.currentIndex > list.length)
|
|
2786
2991
|
return;
|
|
2787
2992
|
const one = 1;
|
|
2788
2993
|
const two = 2;
|
|
2789
2994
|
const three = 3;
|
|
2790
2995
|
const moreImage = list.length > three;
|
|
2791
|
-
if (
|
|
2996
|
+
if (me2.currentIndex) {
|
|
2792
2997
|
if (moreImage) {
|
|
2793
|
-
|
|
2998
|
+
me2.uploadImage(key).then((_) => me2.uploadImageHandler(list[me2.currentIndex++]));
|
|
2794
2999
|
}
|
|
2795
3000
|
} else {
|
|
2796
|
-
|
|
2797
|
-
list.length > one &&
|
|
2798
|
-
list.length > two &&
|
|
2799
|
-
|
|
3001
|
+
me2.uploadImage(list[0]).then((_) => me2.uploadImageHandler(list[me2.currentIndex++]));
|
|
3002
|
+
list.length > one && me2.uploadImage(list[one]).then((_) => me2.uploadImageHandler(list[me2.currentIndex++]));
|
|
3003
|
+
list.length > two && me2.uploadImage(list[two]).then((_) => moreImage && me2.uploadImageHandler(list[me2.currentIndex++]));
|
|
3004
|
+
me2.currentIndex = three;
|
|
2800
3005
|
}
|
|
2801
3006
|
},
|
|
2802
3007
|
uploadImage(key = "") {
|
|
2803
|
-
const
|
|
2804
|
-
const itemId =
|
|
2805
|
-
const currentImg =
|
|
3008
|
+
const me2 = this;
|
|
3009
|
+
const itemId = me2.guid || "";
|
|
3010
|
+
const currentImg = me2.uploadStore[key];
|
|
2806
3011
|
const imageUrl = key.split("|")[1] || "";
|
|
2807
3012
|
if (!currentImg) {
|
|
2808
3013
|
console.log("\u56FE\u7247\u4E0D\u5B58\u5728", key);
|
|
@@ -2823,7 +3028,7 @@
|
|
|
2823
3028
|
if (imgAgain) {
|
|
2824
3029
|
imgAgain.className = "img-again";
|
|
2825
3030
|
imgAgain.onclick = function(e) {
|
|
2826
|
-
|
|
3031
|
+
me2.currentImg = currentImg2;
|
|
2827
3032
|
const upload = document.querySelector(".upload-again-input");
|
|
2828
3033
|
upload && upload.click();
|
|
2829
3034
|
};
|
|
@@ -2836,13 +3041,13 @@
|
|
|
2836
3041
|
}).then((_) => {
|
|
2837
3042
|
if (_.data.code === 0 && _.data.data) {
|
|
2838
3043
|
const img = _.data.data.thirdPartyImageUrl;
|
|
2839
|
-
|
|
3044
|
+
me2.updateImage(img, currentImg);
|
|
2840
3045
|
} else {
|
|
2841
3046
|
parent && uploadFailHandler(currentImg);
|
|
2842
3047
|
}
|
|
2843
|
-
if (Object.keys(
|
|
3048
|
+
if (Object.keys(me2.uploadStore).length === Number(key.split("|")[0] || "") + 1) {
|
|
2844
3049
|
setTimeout(() => {
|
|
2845
|
-
|
|
3050
|
+
me2.updateData(true);
|
|
2846
3051
|
}, 100);
|
|
2847
3052
|
}
|
|
2848
3053
|
}).catch((e) => {
|
|
@@ -2876,7 +3081,7 @@
|
|
|
2876
3081
|
this.setSticker(type.fragment.children);
|
|
2877
3082
|
},
|
|
2878
3083
|
setSticker(data) {
|
|
2879
|
-
const
|
|
3084
|
+
const me2 = this;
|
|
2880
3085
|
data = Array.from(data);
|
|
2881
3086
|
data.map(function(value, index) {
|
|
2882
3087
|
const htmlArr = (value.innerHTML || value.outerHTML).replace(/<img(.*?)src="(.*?)"(.*?)>/g, "(delimiter)[img src=$2](delimiter)").replace(/<img(.*?)src='(.*?)'(.*?)>/g, "(delimiter)[img src=$2](delimiter)").replace(/<a href="(.*?)"(.*?)>(.*?)<\/a>/g, "(delimiter)$3(delimiter)").replace(/<p (.*?)>(.*?)<\/p>/g, "(delimiter)$2(delimiter)").replace(/<\/?.+?>/g, "").split("(delimiter)");
|
|
@@ -2886,28 +3091,28 @@
|
|
|
2886
3091
|
}
|
|
2887
3092
|
if (nValue.indexOf("[img") > -1) {
|
|
2888
3093
|
const src = nValue.replace(/\[img src=(.*?)\]/g, "$1").replace(/amp;/g, "");
|
|
2889
|
-
|
|
3094
|
+
me2.editor.insertImages(src, {
|
|
2890
3095
|
src,
|
|
2891
3096
|
img: src,
|
|
2892
3097
|
selected: false,
|
|
2893
3098
|
type: "2"
|
|
2894
3099
|
});
|
|
2895
3100
|
} else {
|
|
2896
|
-
|
|
3101
|
+
me2.editor.makeParagraph(nValue);
|
|
2897
3102
|
}
|
|
2898
3103
|
});
|
|
2899
3104
|
});
|
|
2900
|
-
|
|
3105
|
+
me2.updateUploads();
|
|
2901
3106
|
this.updateData(true);
|
|
2902
3107
|
},
|
|
2903
3108
|
mouseLeave() {
|
|
2904
|
-
const
|
|
2905
|
-
|
|
3109
|
+
const me2 = this;
|
|
3110
|
+
me2.updateData();
|
|
2906
3111
|
},
|
|
2907
3112
|
setBack(e, type) {
|
|
2908
|
-
const
|
|
2909
|
-
|
|
2910
|
-
|
|
3113
|
+
const me2 = this;
|
|
3114
|
+
me2.refreshImg();
|
|
3115
|
+
me2.updateData(true);
|
|
2911
3116
|
},
|
|
2912
3117
|
refreshImg() {
|
|
2913
3118
|
Array.from(document.querySelectorAll(".halo-img-content")).map((_ = {}) => {
|
|
@@ -2934,8 +3139,8 @@
|
|
|
2934
3139
|
});
|
|
2935
3140
|
},
|
|
2936
3141
|
sticky() {
|
|
2937
|
-
const
|
|
2938
|
-
|
|
3142
|
+
const me2 = this;
|
|
3143
|
+
me2.$nextTick(function() {
|
|
2939
3144
|
const sticky = document.querySelector(".tool-box");
|
|
2940
3145
|
if (!sticky) {
|
|
2941
3146
|
return;
|
|
@@ -2953,12 +3158,12 @@
|
|
|
2953
3158
|
});
|
|
2954
3159
|
},
|
|
2955
3160
|
setContent(e, obj) {
|
|
2956
|
-
const
|
|
3161
|
+
const me2 = this;
|
|
2957
3162
|
const id = e.target.id || e.target.dataset.editorId;
|
|
2958
3163
|
const value = "";
|
|
2959
|
-
if (id &&
|
|
2960
|
-
|
|
2961
|
-
|
|
3164
|
+
if (id && me2.editor && me2.editor[id]) {
|
|
3165
|
+
me2.editor[id](value, obj);
|
|
3166
|
+
me2.updateData(true);
|
|
2962
3167
|
}
|
|
2963
3168
|
},
|
|
2964
3169
|
canSetAlign() {
|
|
@@ -2994,47 +3199,47 @@
|
|
|
2994
3199
|
this.updateData(true);
|
|
2995
3200
|
},
|
|
2996
3201
|
addLink(type) {
|
|
2997
|
-
const
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3202
|
+
const me2 = this;
|
|
3203
|
+
me2.linkTitleName = type === "link" ? "\u6DFB\u52A0\u94FE\u63A5" : "\u6DFB\u52A0\u5BFC\u5165\u94FE\u63A5\u5730\u5740";
|
|
3204
|
+
me2.linkPlaceholder = type === "link" ? "\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740" : "\u4EC5\u652F\u6301\u8F93\u5165\u5FAE\u4FE1\u94FE\u63A5";
|
|
3205
|
+
me2.viewStatus = true;
|
|
3206
|
+
me2.linkStatus = true;
|
|
3002
3207
|
},
|
|
3003
3208
|
validUrl(url) {
|
|
3004
3209
|
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.,;?'&%$#=~_-]+))*$/;
|
|
3005
3210
|
return objExp.test(url);
|
|
3006
3211
|
},
|
|
3007
3212
|
confirmLink() {
|
|
3008
|
-
const
|
|
3009
|
-
if (!
|
|
3213
|
+
const me2 = this;
|
|
3214
|
+
if (!me2.linkContent) {
|
|
3010
3215
|
return elementPlus.ElMessage.error("\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740\uFF01");
|
|
3011
3216
|
}
|
|
3012
|
-
if (
|
|
3217
|
+
if (me2.linkTitleName === "\u6DFB\u52A0\u5BFC\u5165\u94FE\u63A5\u5730\u5740" || this.visibleCollectArticle) {
|
|
3013
3218
|
this.visibleCollectArticle = false;
|
|
3014
|
-
return
|
|
3219
|
+
return me2.importLinkData();
|
|
3015
3220
|
}
|
|
3016
|
-
if (!this.validUrl(
|
|
3017
|
-
return
|
|
3221
|
+
if (!this.validUrl(me2.linkContent)) {
|
|
3222
|
+
return me2.setToast("URL\u65E0\u6548");
|
|
3018
3223
|
}
|
|
3019
|
-
if (
|
|
3020
|
-
return
|
|
3224
|
+
if (me2.linkContent.indexOf("jddmoto.com") === -1 && me2.linkContent.indexOf("58moto.com") === -1) {
|
|
3225
|
+
return me2.setToast("\u8BF7\u8F93\u5165\u54C8\u7F57\u6469\u6258\u5185\u90E8\u7F51\u5740");
|
|
3021
3226
|
}
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3227
|
+
me2.editor["insertLink"](me2.linkContent);
|
|
3228
|
+
me2.linkContent = "";
|
|
3229
|
+
me2.closeDialog();
|
|
3025
3230
|
},
|
|
3026
3231
|
importLinkData() {
|
|
3027
|
-
const
|
|
3028
|
-
if (
|
|
3232
|
+
const me2 = this;
|
|
3233
|
+
if (me2.loading) {
|
|
3029
3234
|
return elementPlus.ElMessage("\u6B63\u5728\u83B7\u53D6\u4FE1\u606F\uFF0C\u8BF7\u7A0D\u540E...");
|
|
3030
3235
|
}
|
|
3031
|
-
|
|
3236
|
+
me2.loading = true;
|
|
3032
3237
|
const params = {
|
|
3033
|
-
action:
|
|
3034
|
-
url:
|
|
3238
|
+
action: me2.isOss ? "30008OSS" : 30008,
|
|
3239
|
+
url: me2.linkContent
|
|
3035
3240
|
};
|
|
3036
|
-
if (!
|
|
3037
|
-
params.autherid =
|
|
3241
|
+
if (!me2.isOss) {
|
|
3242
|
+
params.autherid = me2.user.uid;
|
|
3038
3243
|
}
|
|
3039
3244
|
this.importEssay(params).then((response) => {
|
|
3040
3245
|
console.log(response);
|
|
@@ -3043,26 +3248,26 @@
|
|
|
3043
3248
|
data.data.content = data.data.content.replace(/<a href="(.*?)"(.*?)>/g, "").replace(/<\/a>/g, "").replace(/<iframe([^<>]*)>([^<>]*)<\/iframe>/g, "").replace(/<video([^<>]*)>([^<>]*)<\/video>/g, "");
|
|
3044
3249
|
const importContent = document.createElement("div");
|
|
3045
3250
|
importContent.innerHTML = data.data.content;
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3251
|
+
me2.setSticker(importContent.children);
|
|
3252
|
+
me2.closeDialog();
|
|
3253
|
+
me2.linkContent = "";
|
|
3049
3254
|
return;
|
|
3050
3255
|
} else {
|
|
3051
|
-
|
|
3256
|
+
me2.setToast("\u5BFC\u5165\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
|
|
3052
3257
|
}
|
|
3053
3258
|
}).catch((err) => {
|
|
3054
3259
|
console.log(err.message);
|
|
3055
|
-
|
|
3260
|
+
me2.setToast("\u5BFC\u5165\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5");
|
|
3056
3261
|
}).finally((_) => {
|
|
3057
|
-
|
|
3262
|
+
me2.loading = false;
|
|
3058
3263
|
});
|
|
3059
3264
|
},
|
|
3060
3265
|
openDialog(name) {
|
|
3061
|
-
const
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3266
|
+
const me2 = this;
|
|
3267
|
+
me2.viewName = name === "img" ? "\u6DFB\u52A0\u56FE\u7247" : "\u6DFB\u52A0\u89C6\u9891";
|
|
3268
|
+
me2.viewButton = name === "img" ? "\u9009\u62E9\u56FE\u7247" : "\u9009\u62E9\u89C6\u9891";
|
|
3269
|
+
me2.viewTip = name === "img" ? "" : "\u4E3A\u4E86\u83B7\u5F97\u66F4\u9AD8\u7684\u63A8\u8350\u548C\u70B9\u51FB\u91CF\uFF0C\u5EFA\u8BAE\u4E0A\u4F20720p(1280*720)\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC7500MB(\u89C6\u9891\u4E0A\u4F20\u9700\u8981\u65F6\u95F4\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85)";
|
|
3270
|
+
me2.viewStatus = true;
|
|
3066
3271
|
},
|
|
3067
3272
|
closeDialog() {
|
|
3068
3273
|
this.viewStatus = false;
|
|
@@ -3219,13 +3424,6 @@
|
|
|
3219
3424
|
class: "replace-input hide",
|
|
3220
3425
|
accept: "image/*",
|
|
3221
3426
|
onChange: _cache[12] || (_cache[12] = (...args) => $options.replaceImg && $options.replaceImg(...args))
|
|
3222
|
-
}, null, 32),
|
|
3223
|
-
vue.createElementVNode("input", {
|
|
3224
|
-
type: "file",
|
|
3225
|
-
name: "file",
|
|
3226
|
-
class: "replace-poster hide",
|
|
3227
|
-
accept: "image/*",
|
|
3228
|
-
onChange: _cache[13] || (_cache[13] = (...args) => $options.replacePoster && $options.replacePoster(...args))
|
|
3229
3427
|
}, null, 32)
|
|
3230
3428
|
]);
|
|
3231
3429
|
}
|