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