officialblock 2.1.6 → 2.1.8

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.
@@ -1,642 +0,0 @@
1
- import { getCurrentInstance as ce, ref as d, computed as r, watch as I, nextTick as b, onMounted as pe, createElementBlock as k, openBlock as g, normalizeClass as O, createElementVNode as a, withDirectives as ue, vShow as de, Fragment as X, renderList as ae, createBlock as K, resolveDynamicComponent as ve, withCtx as L, normalizeStyle as me, defineComponent as fe, defineAsyncComponent as ge, resolveComponent as E, createVNode as h, createTextVNode as Y, unref as he, mergeProps as ye, toDisplayString as oe, createCommentVNode as j, Transition as be } from "vue";
2
- import { _ as se, U as we, P as xe, r as A, u as ke, d as Ve, a as Ce, O as _e } from "./index-DcjvupYq.mjs";
3
- const Te = { class: "tab-logo__btn__img flex-center" }, Se = ["src", "alt"], $e = {
4
- __name: "TabLogo",
5
- props: {
6
- tabList: {
7
- type: Array,
8
- default: () => []
9
- },
10
- currentIdx: {
11
- type: [String, Number],
12
- default: 0
13
- },
14
- isFixed: {
15
- type: Boolean,
16
- default: !1
17
- },
18
- fullWidth: {
19
- type: Boolean,
20
- default: !1
21
- }
22
- },
23
- emits: ["updateCurrentIdx"],
24
- setup(u, { emit: F }) {
25
- const { proxy: J } = ce(), { $_vsWidth: x, $_vsScrollY: G, $vsScreenAddListener: H, $vsScreenDestroyListener: M } = J, V = u, m = F, f = d(0), W = d(0.5 * x.value), c = d(0), t = d(!0), w = d(!0), P = d(0), C = d(!1), _ = d(0), T = d(0), S = d(0), $ = d(null), n = d(null), s = d([]), q = (l) => l || "", Q = r(() => f.value - W.value), Z = r(() => [
26
- { "--strip-width": `${Q.value}px` },
27
- { "--strip-left": `${W.value}px` },
28
- { "--fix-left": `${c.value}px` },
29
- {
30
- transition: w.value ? "left 0.2s ease-in-out, width 0.2s ease-in-out" : ""
31
- }
32
- ]), ee = r(() => _.value > 0), te = r(() => T.value - _.value + U.value > S.value), U = r(() => {
33
- if (!C.value) return 24;
34
- const l = $.value;
35
- if (!l) return 24;
36
- const i = window.getComputedStyle(l, null).getPropertyValue("padding-right").split("px")[0];
37
- return Number(i) * 2;
38
- }), le = r(() => !1);
39
- I(x, () => {
40
- D(), N();
41
- }), I(
42
- () => V.currentIdx,
43
- (l, i) => {
44
- t.value = l > i, b(() => B()), b(() => o());
45
- }
46
- ), I(
47
- () => V.isFixed,
48
- () => {
49
- x.value > 1200 && D(), b(() => N());
50
- }
51
- ), I(
52
- () => V.tabList,
53
- (l, i) => {
54
- N(), b(() => {
55
- B(0);
56
- });
57
- },
58
- { deep: !0 }
59
- );
60
- const B = (l) => {
61
- const i = l ?? 250;
62
- t.value ? (z(), setTimeout(R, i)) : (R(), setTimeout(z, i)), setTimeout(() => {
63
- w.value = !0;
64
- }, i);
65
- }, z = () => {
66
- const l = s.value[V.currentIdx];
67
- l && l.getBoundingClientRect && (f.value = l.getBoundingClientRect().right);
68
- }, R = () => {
69
- const l = s.value[V.currentIdx];
70
- l && l.getBoundingClientRect && (W.value = l.getBoundingClientRect().left);
71
- }, D = () => {
72
- w.value = !1, b(() => B(0)), b(() => ne());
73
- }, N = () => {
74
- const l = $.value;
75
- if (l) {
76
- let i = l.getBoundingClientRect().left;
77
- c.value = (l.offsetWidth - l.getBoundingClientRect().width) / 2 - i;
78
- }
79
- }, ne = () => {
80
- V.tabList.length <= 0 || (n.value && (_.value = n.value.scrollLeft, T.value = n.value.scrollWidth), $.value && (S.value = $.value.getBoundingClientRect().width));
81
- }, e = (l) => {
82
- n.value && (l == "next" ? n.value.scrollLeft += 9999 : n.value.scrollLeft -= 9999);
83
- }, o = () => {
84
- const l = s.value[V.currentIdx];
85
- if (!l) return;
86
- const i = l.clientWidth / 2, y = x.value / 2;
87
- P.value = l.getBoundingClientRect().right - i, n.value && (n.value.scrollLeft -= y - P.value);
88
- }, p = (l) => {
89
- m("updateCurrentIdx", l);
90
- };
91
- return pe(() => {
92
- C.value = !0, b(() => {
93
- B(0), setTimeout(D, 300), N(), b(() => {
94
- setTimeout(o, 300);
95
- });
96
- }), window.addEventListener("resize", () => {
97
- x.value = window.innerWidth;
98
- });
99
- }), (l, i) => (g(), k("div", {
100
- class: O(["tab-logo", [{ "is-fixed": u.isFixed }, { "is-campus": !le.value }, { "is-full-width": u.fullWidth }]]),
101
- ref_key: "wrapper",
102
- ref: $
103
- }, [
104
- a("ul", {
105
- class: "tab-logo__list",
106
- ref_key: "list",
107
- ref: n,
108
- onScroll: D
109
- }, [
110
- ue(a("div", {
111
- class: "tab-logo__nav__prev",
112
- onClick: i[0] || (i[0] = (y) => e("prev"))
113
- }, null, 512), [
114
- [de, ee.value]
115
- ]),
116
- (g(!0), k(X, null, ae(u.tabList, (y, v) => (g(), k("li", {
117
- key: v,
118
- class: O(["tab-logo__item", [{ "tab-logo__item--img": !!y.img }]])
119
- }, [
120
- a("div", {
121
- ref_for: !0,
122
- ref_key: "btn",
123
- ref: s,
124
- class: "flex-center"
125
- }, [
126
- (g(), K(ve(y.link ? "nuxt-link" : "button"), {
127
- type: y.link ? null : "button",
128
- to: q(y.link),
129
- class: O(["tab-logo__btn", [{ "is-active": u.currentIdx == v }]]),
130
- onClick: (ie) => p(v)
131
- }, {
132
- default: L(() => [
133
- a("div", Te, [
134
- a("img", {
135
- src: y.img,
136
- alt: y.alt
137
- }, null, 8, Se)
138
- ])
139
- ]),
140
- _: 2
141
- }, 1032, ["type", "to", "class", "onClick"]))
142
- ], 512)
143
- ], 2))), 128)),
144
- ue(a("div", {
145
- class: "tab-logo__nav__next",
146
- onClick: i[1] || (i[1] = (y) => e("next"))
147
- }, null, 512), [
148
- [de, te.value]
149
- ])
150
- ], 544),
151
- a("span", {
152
- class: "tab-logo__strip",
153
- style: me(Z.value)
154
- }, null, 4)
155
- ], 2));
156
- }
157
- }, Le = /* @__PURE__ */ se($e, [["__scopeId", "data-v-95fa5f31"]]), Ie = { class: "setting-content" }, Pe = { class: "setting-header flex items-center" }, Be = { class: "setting-body" }, De = { class: "setting-toolbar" }, We = { class: "tools" }, Ue = { class: "setting-item" }, Re = { class: "item-header" }, Ee = { class: "btn-group" }, Ae = {
158
- key: 0,
159
- class: "drag-handle"
160
- }, He = ["src"], Ne = { class: "item-uplaod flex items-center" }, Oe = { class: "components-content" }, Fe = /* @__PURE__ */ fe({
161
- __name: "setting",
162
- props: {
163
- show: {
164
- type: Boolean,
165
- default: !1
166
- },
167
- data: {
168
- type: Object,
169
- default: () => {
170
- }
171
- }
172
- },
173
- emits: ["update:show"],
174
- setup(u, { emit: F }) {
175
- const J = ge(() => import("vuedraggable")), x = d(!1), G = r(() => ({
176
- animation: 200,
177
- group: "gallerys",
178
- disabled: !1,
179
- ghostClass: "ghost",
180
- handle: ".drag-handle",
181
- filter: ".arco-input, .arco-select, .arco-checkbox",
182
- preventOnFilter: !1
183
- }));
184
- r(() => ({
185
- animation: 200,
186
- group: "gallerys-above",
187
- disabled: !1,
188
- ghostClass: "ghost",
189
- handle: ".drag-handle",
190
- filter: ".arco-input, .arco-select, .arco-checkbox",
191
- preventOnFilter: !1
192
- }));
193
- const H = (c) => c && c.length > 1, M = u, V = F, m = () => {
194
- V("update:show", !1);
195
- }, f = (c) => {
196
- debugger;
197
- M.data.data.push({
198
- id: A(),
199
- key: A(),
200
- name: "New Tab",
201
- img: "https://osswebsite-test.cedim.cn/media-library/shared/24-25%E5%BC%80%E5%AD%A6/640-5.jpg",
202
- alt: "yew-chung-international-school",
203
- componentsDataJson: []
204
- });
205
- }, W = (c, t) => {
206
- M.data.data = M.data.data.filter((w) => w.id !== c);
207
- };
208
- return (c, t) => {
209
- const w = E("a-switch"), P = E("icon-plus"), C = E("a-button"), _ = E("icon-drag-arrow"), T = E("icon-delete"), S = E("a-input"), $ = E("a-drawer");
210
- return g(), K($, {
211
- width: "60%",
212
- visible: u.show,
213
- footer: !1,
214
- onCancel: m,
215
- unmountOnClose: ""
216
- }, {
217
- title: L(() => [
218
- Y(oe(u.data.type) + "组件编辑 ", 1)
219
- ]),
220
- default: L(() => [
221
- a("div", Ie, [
222
- a("div", Pe, [
223
- t[7] || (t[7] = a("span", { class: "header-title" }, "仅显示PC端", -1)),
224
- h(w, {
225
- modelValue: u.data.onlyShowPc,
226
- "onUpdate:modelValue": t[0] || (t[0] = (n) => u.data.onlyShowPc = n)
227
- }, null, 8, ["modelValue"])
228
- ]),
229
- a("div", Be, [
230
- a("div", De, [
231
- t[10] || (t[10] = a("h1", null, "List", -1)),
232
- a("div", We, [
233
- h(C, {
234
- type: "primary",
235
- onClick: t[1] || (t[1] = (n) => f())
236
- }, {
237
- icon: L(() => [
238
- h(P)
239
- ]),
240
- default: L(() => [
241
- t[8] || (t[8] = Y(" 添加 List ", -1))
242
- ]),
243
- _: 1
244
- }),
245
- h(C, {
246
- type: "primary",
247
- onClick: t[2] || (t[2] = (n) => f())
248
- }, {
249
- default: L(() => [...t[9] || (t[9] = [
250
- Y("粘贴 Tab", -1)
251
- ])]),
252
- _: 1
253
- })
254
- ])
255
- ]),
256
- a("div", Ue, [
257
- h(he(J), ye({
258
- modelValue: u.data.data,
259
- "onUpdate:modelValue": t[4] || (t[4] = (n) => u.data.data = n),
260
- "component-data": {
261
- tag: "div",
262
- type: "transition-group",
263
- name: x.value ? null : "flip-list"
264
- }
265
- }, G.value, {
266
- disabled: !H(u.data.data),
267
- onStart: t[5] || (t[5] = (n) => x.value = !0),
268
- onEnd: t[6] || (t[6] = (n) => x.value = !1),
269
- "item-key": "id"
270
- }), {
271
- item: L(({ element: n }) => [
272
- (g(), k("div", {
273
- class: O(["item-button draggable-item", {
274
- "sortable-disabled": !H(u.data.data)
275
- }]),
276
- key: n.id
277
- }, [
278
- a("div", Re, [
279
- a("div", null, [
280
- a("h5", null, oe(n.name), 1),
281
- a("span", null, oe(n.key), 1)
282
- ]),
283
- a("div", Ee, [
284
- H(u.data.data) ? (g(), k("div", Ae, [
285
- h(_, { class: "drag-icon" })
286
- ])) : j("", !0),
287
- h(T, {
288
- class: "btn-delete",
289
- onClick: (s) => W(n.id)
290
- }, null, 8, ["onClick"]),
291
- h(C, {
292
- size: "mini",
293
- type: "primary",
294
- onClick: t[3] || (t[3] = (s) => f())
295
- }, {
296
- default: L(() => [...t[11] || (t[11] = [
297
- Y("复制 Tab", -1)
298
- ])]),
299
- _: 1
300
- })
301
- ])
302
- ]),
303
- t[12] || (t[12] = a("p", { class: "item-title" }, "Alt", -1)),
304
- h(S, {
305
- modelValue: n.alt,
306
- "onUpdate:modelValue": (s) => n.alt = s,
307
- placeholder: "请输入alt",
308
- "allow-clear": ""
309
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
310
- t[13] || (t[13] = a("p", { class: "item-title" }, "Key", -1)),
311
- h(S, {
312
- modelValue: n.key,
313
- "onUpdate:modelValue": (s) => n.key = s,
314
- placeholder: "请输入key",
315
- "allow-clear": ""
316
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
317
- t[14] || (t[14] = a("p", { class: "item-title" }, "图片", -1)),
318
- a("img", {
319
- class: "item-img",
320
- src: n.img
321
- }, null, 8, He),
322
- a("div", Ne, [
323
- h(S, {
324
- modelValue: n.img,
325
- "onUpdate:modelValue": (s) => n.img = s,
326
- placeholder: "请输入图片链接",
327
- "allow-clear": ""
328
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
329
- h(we, {
330
- modelValue: n.img,
331
- "onUpdate:modelValue": (s) => n.img = s,
332
- name: n.key
333
- }, null, 8, ["modelValue", "onUpdate:modelValue", "name"])
334
- ]),
335
- t[15] || (t[15] = a("p", null, "components", -1)),
336
- a("div", Oe, [
337
- h(xe, {
338
- data: n.componentsDataJson,
339
- onUpdate: (s) => n.componentsDataJson = s
340
- }, null, 8, ["data", "onUpdate"])
341
- ])
342
- ], 2))
343
- ]),
344
- _: 1
345
- }, 16, ["modelValue", "component-data", "disabled"])
346
- ])
347
- ])
348
- ])
349
- ]),
350
- _: 1
351
- }, 8, ["visible"]);
352
- };
353
- }
354
- }), Je = /* @__PURE__ */ se(Fe, [["__scopeId", "data-v-c52189f2"]]), Me = { class: "tab-page__content" }, je = { key: 0 }, re = "", Ke = {
355
- __name: "index",
356
- props: {
357
- modelValue: {
358
- type: Object,
359
- default: () => ({})
360
- },
361
- // 是否预览
362
- isPreview: {
363
- type: Boolean,
364
- default: !0
365
- }
366
- },
367
- emits: ["update:modelValue", "handleDelete", "handleCopy", "handlePaste"],
368
- setup(u, { emit: F }) {
369
- const J = F, { proxy: x } = ce(), { $_vsWidth: G, $_vsScrollY: H, $vsScreenAddListener: M, $vsScreenDestroyListener: V } = x, m = u, f = ke(), W = Ve(), c = d(0), t = d(!1), w = d(!0), P = d(null), C = d(null), _ = d(!1), T = d(!1), S = (e) => {
370
- if (!e) return { top: 0, left: 0 };
371
- const o = e.getBoundingClientRect(), p = window.pageYOffset || document.documentElement.scrollTop, l = window.pageXOffset || document.documentElement.scrollLeft;
372
- return {
373
- top: o.top + p,
374
- left: o.left + l
375
- };
376
- }, $ = r(() => {
377
- var e;
378
- return ((e = m.modelValue) == null ? void 0 : e.classes) ?? null;
379
- }), n = r(() => {
380
- var e;
381
- return ((e = m.modelValue) == null ? void 0 : e.style) ?? null;
382
- });
383
- r(() => {
384
- var e;
385
- return ((e = m.modelValue) == null ? void 0 : e.type) ?? "TabPrimary";
386
- });
387
- const s = r(() => {
388
- var e;
389
- return ((e = m.modelValue) == null ? void 0 : e.data) ?? [];
390
- }), q = r(() => {
391
- var e;
392
- return ((e = m.modelValue) == null ? void 0 : e.fixed) ?? !0;
393
- }), Q = r(() => {
394
- var e;
395
- return ((e = m.modelValue) == null ? void 0 : e.resetToTop) ?? !0;
396
- }), Z = r(() => {
397
- var e;
398
- return ((e = m.modelValue) == null ? void 0 : e.scrollToTop) ?? !0;
399
- }), ee = r(() => {
400
- var e;
401
- return ((e = m.modelValue) == null ? void 0 : e.fullWidth) ?? !1;
402
- });
403
- r(() => 0), r(() => !1);
404
- const te = r(() => s.value.some((e) => e.img)), U = r(() => {
405
- var e;
406
- return ((e = s.value[c.value]) == null ? void 0 : e.key) ?? null;
407
- });
408
- r(() => {
409
- var o;
410
- if (!((o = m.modelValue) != null && o.data) || !Array.isArray(m.modelValue.data))
411
- return [];
412
- const e = m.modelValue.data[c.value];
413
- return e ? e.componentsDataJson || [] : [];
414
- });
415
- const le = () => {
416
- var o;
417
- if (m.modelValue && m.modelValue.data)
418
- return;
419
- const e = {
420
- id: ((o = m.modelValue) == null ? void 0 : o.id) || A(),
421
- //componentKey
422
- type: "TabLogo",
423
- onlyShowPc: !1,
424
- containerWidth: "",
425
- bgColor: "",
426
- classes: "custom-class another-class",
427
- style: {},
428
- width: "",
429
- resetToTop: !1,
430
- fullWidth: !0,
431
- fixed: !1,
432
- scrollToTop: !1,
433
- data: [
434
- //list
435
- {
436
- id: A(),
437
- key: A(),
438
- img: "https://osswebsite-test.cedim.cn/media-library/shared/24-25%E5%BC%80%E5%AD%A6/640-5.jpg",
439
- alt: "yew-chung-international-school",
440
- name: "New Tab1",
441
- componentsDataJson: [
442
- // {
443
- // id: props.modelValue?.id || randomString(),
444
- // type: "BannerImage",
445
- // onlyShowPc: false,
446
- // data: {
447
- // title: "这里是标题",
448
- // imgSrc: "https://osswebsite-test.cedim.cn/ywies-tx/static-images/about-ywies/01_About_YWIES_1_Header.jpg",
449
- // },
450
- // },
451
- ]
452
- },
453
- {
454
- id: A(),
455
- key: A(),
456
- img: "https://osswebsite-test.cedim.cn/media-library/shared/24-25%E5%BC%80%E5%AD%A6/640-5.jpg",
457
- alt: "yew-chung-international-school",
458
- name: "New Tab2",
459
- componentsDataJson: [
460
- // {
461
- // id: props.modelValue?.id || randomString(),
462
- // type: "ArticleList",
463
- // onlyShowPc: false,
464
- // width: "",
465
- // bgColor: "",
466
- // data: [
467
- // {
468
- // id: randomString(),
469
- // type: "Article",
470
- // title: "这里是标题",
471
- // content: "这里是内容",
472
- // buttonList: [],
473
- // linkList: [
474
- // {
475
- // id: randomString(),
476
- // text: "链接名称",
477
- // url: "",
478
- // isExternal: false,
479
- // },
480
- // ],
481
- // },
482
- // {
483
- // id: randomString(),
484
- // type: "Image",
485
- // imgSrc: "https://osswebsite.ycyw.com/media-library/ywies-bj/images/home/ywies-tx.jpg",
486
- // caption: "",
487
- // alt: "",
488
- // isRound: false,
489
- // },
490
- // ],
491
- // },
492
- ]
493
- }
494
- ]
495
- };
496
- J("update:modelValue", e), c.value = 0;
497
- }, B = () => {
498
- const e = C.value;
499
- if (!e) return;
500
- const o = e.getBoundingClientRect().top, p = P.value;
501
- if (!p) return;
502
- const l = p.getBoundingClientRect().top, i = +window.getComputedStyle(document.body).getPropertyValue("--header-height-calc").split("px")[0];
503
- if (l > i) {
504
- t.value = !1;
505
- return;
506
- }
507
- o <= i && (t.value = !0);
508
- }, z = () => {
509
- if (f.hash) {
510
- b(() => {
511
- setTimeout(R, 500);
512
- });
513
- return;
514
- }
515
- if (!Z.value) return;
516
- let e = 0;
517
- Q.value || (e = S(P.value).top - 170), window.scroll({ top: e, left: 0, behavior: "smooth" });
518
- }, R = () => {
519
- if (!f.hash) return;
520
- const e = document.querySelector(f.hash);
521
- if (!e) return;
522
- const o = S(e).top;
523
- window.scroll({
524
- top: o - 170,
525
- left: 0,
526
- behavior: "smooth"
527
- });
528
- }, D = () => {
529
- const e = f.params.subpage;
530
- let o = s.value.findIndex((v) => v.key == e);
531
- const p = ne(), l = s.value.findIndex((v) => v.key == p), i = f.query.category, y = s.value.findIndex((v) => v.key == i);
532
- if (o >= 0)
533
- c.value = o;
534
- else if (y > -1)
535
- w.value = !1, c.value = y;
536
- else if (l > -1)
537
- w.value = !1, c.value = l;
538
- else if (s.value[0] && s.value[0].link) {
539
- console.log(s.value[0].link);
540
- let v = f.path;
541
- v.endsWith("/") && (v = v.split("/"), v.pop(), v = v.join("/"));
542
- const ie = `${v}/${s.value[0].key}`;
543
- W.replace(ie);
544
- }
545
- b(R);
546
- }, N = (e) => {
547
- sessionStorage.setItem(re, e);
548
- }, ne = () => sessionStorage.getItem(re);
549
- return I(
550
- () => H.value,
551
- () => {
552
- B();
553
- }
554
- ), I(
555
- () => f.params.subpage,
556
- () => {
557
- D();
558
- }
559
- ), I(
560
- () => f.query,
561
- () => {
562
- D();
563
- },
564
- { deep: !0 }
565
- ), I(c, () => {
566
- N(U.value), w.value && z(), w.value = !0;
567
- }), I(U, (e) => {
568
- e || (c.value = 0);
569
- }), pe(() => {
570
- ["article"].includes(f.params.section) || (le(), R(), D(), b(B), setTimeout(() => {
571
- b(B);
572
- }, 200), setTimeout(() => {
573
- b(R);
574
- }, 1e3));
575
- }), (e, o) => (g(), k("div", {
576
- class: O(["tab-page", $.value]),
577
- style: me(n.value),
578
- onMouseover: o[4] || (o[4] = (p) => T.value = !0),
579
- onMouseout: o[5] || (o[5] = (p) => T.value = !1)
580
- }, [
581
- a("div", {
582
- class: O(["tab-page__hold", [{ "is-fixed": t.value && q.value }, { "is-thick": te.value }]]),
583
- ref_key: "hold",
584
- ref: P
585
- }, [
586
- a("div", {
587
- class: "tab-page__nav",
588
- ref_key: "tab",
589
- ref: C
590
- }, [
591
- h(Le, {
592
- tabList: s.value,
593
- currentIdx: c.value,
594
- isFixed: t.value && q.value,
595
- fullWidth: ee.value,
596
- onUpdateCurrentIdx: o[0] || (o[0] = (p) => c.value = p)
597
- }, null, 8, ["tabList", "currentIdx", "isFixed", "fullWidth"])
598
- ], 512)
599
- ], 2),
600
- a("div", Me, [
601
- h(be, {
602
- name: "fade",
603
- mode: "out-in"
604
- }, {
605
- default: L(() => [
606
- U.value ? (g(), k("div", { key: U.value }, [
607
- (g(!0), k(X, null, ae(s.value, (p) => (g(), k(X, null, [
608
- U.value == p.key ? (g(), k("div", je, [
609
- (g(!0), k(X, null, ae(p.componentsDataJson, (l, i) => (g(), K(Ce, {
610
- key: l.id,
611
- type: l.type,
612
- "props-data": { modelValue: l, isPreview: !1 }
613
- }, null, 8, ["type", "props-data"]))), 128))
614
- ])) : j("", !0)
615
- ], 64))), 256))
616
- ])) : j("", !0)
617
- ]),
618
- _: 1
619
- })
620
- ]),
621
- u.isPreview ? j("", !0) : (g(), K(_e, {
622
- key: 0,
623
- show: T.value,
624
- "onUpdate:show": o[1] || (o[1] = (p) => T.value = p),
625
- onHandleEdit: o[2] || (o[2] = (p) => _.value = !0),
626
- onHandleDelete: e.handleDelete,
627
- onHandleCopy: e.handleCopy,
628
- onHandlePaste: e.handlePaste,
629
- style: { top: "-32px" }
630
- }, null, 8, ["show", "onHandleDelete", "onHandleCopy", "onHandlePaste"])),
631
- u.isPreview ? j("", !0) : (g(), K(Je, {
632
- key: 1,
633
- show: _.value,
634
- "onUpdate:show": o[3] || (o[3] = (p) => _.value = p),
635
- data: u.modelValue
636
- }, null, 8, ["show", "data"]))
637
- ], 38));
638
- }
639
- }, Ye = /* @__PURE__ */ se(Ke, [["__scopeId", "data-v-7ea78236"]]);
640
- export {
641
- Ye as default
642
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-CU8BeqSQ.js"),h={class:"setting-content"},C={class:"setting-header flex items-center"},E={class:"setting-header flex items-center"},N={class:"setting-header flex items-center"},x={class:"setting-header flex items-center"},P={class:"setting-header flex items-center"},B={class:"setting-header flex items-center"},S={class:"preview-container"},z=["src"],I={key:1,class:"no-preview"},$={class:"setting-body"},H={class:"setting-item"},U={class:"components-content"},D=e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(o,{emit:g}){const n=o,u=e.ref([{id:"preset-1",name:"YCCECE Background 1",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-01.svg",size:"cover",position:"center center"},{id:"preset-2",name:"YCCECE Background 2",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-02.svg",size:"",position:""},{id:"preset-3",name:"YCCECE Background 3",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-03.svg",size:"cover",position:""},{id:"preset-4",name:"YCCECE Background 4",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-04.svg",size:"cover",position:""}]),c=e.ref(),r=u.value.find(s=>s.image===n.data.backgroundImage);c.value=r?r.id:"";const m=()=>{const s=u.value.find(a=>a.id===c.value);s&&(n.data.backgroundImage=`${s.image}`,n.data.backgroundSize=s.size,n.data.backgroundPosition=s.position)},v=g,k=()=>{v("update:show",!1)};return(s,a)=>{const V=e.resolveComponent("a-switch"),y=e.resolveComponent("a-option"),b=e.resolveComponent("a-select"),w=e.resolveComponent("a-button"),p=e.resolveComponent("a-input"),f=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(f,{width:"60%",visible:o.show,footer:!1,onCancel:k,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.data.type)+"组件编辑 ",1)]),default:e.withCtx(()=>[e.createElementVNode("div",h,[e.createElementVNode("div",C,[a[6]||(a[6]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(V,{modelValue:o.data.onlyShowPc,"onUpdate:modelValue":a[0]||(a[0]=t=>o.data.onlyShowPc=t)},null,8,["modelValue"])]),e.createElementVNode("div",E,[a[8]||(a[8]=e.createElementVNode("span",{class:"header-title"},"Background Preset",-1)),e.createVNode(b,{modelValue:c.value,"onUpdate:modelValue":a[1]||(a[1]=t=>c.value=t),style:{width:"300px","margin-right":"8px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,t=>(e.openBlock(),e.createBlock(y,{value:t.id,key:t.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(w,{type:"primary",onClick:m},{default:e.withCtx(()=>[...a[7]||(a[7]=[e.createTextVNode("Apply",-1)])]),_:1})]),e.createElementVNode("div",N,[a[9]||(a[9]=e.createElementVNode("span",{class:"header-title"},"Image",-1)),e.createVNode(p,{modelValue:o.data.backgroundImage,"onUpdate:modelValue":a[2]||(a[2]=t=>o.data.backgroundImage=t),disabled:!0,placeholder:"图片路径",style:{width:"300px"}},null,8,["modelValue"])]),e.createElementVNode("div",x,[a[10]||(a[10]=e.createElementVNode("span",{class:"header-title"},"Size",-1)),e.createVNode(p,{modelValue:o.data.backgroundSize,"onUpdate:modelValue":a[3]||(a[3]=t=>o.data.backgroundSize=t),disabled:!0,placeholder:"尺寸",style:{width:"300px"}},null,8,["modelValue"])]),e.createElementVNode("div",P,[a[11]||(a[11]=e.createElementVNode("span",{class:"header-title"},"Position",-1)),e.createVNode(p,{modelValue:o.data.backgroundPosition,"onUpdate:modelValue":a[4]||(a[4]=t=>o.data.backgroundPosition=t),disabled:!0,placeholder:"位置",style:{width:"300px"}},null,8,["modelValue"])]),e.createElementVNode("div",B,[a[13]||(a[13]=e.createElementVNode("span",{class:"header-title"},"Preview",-1)),e.createElementVNode("div",S,[o.data.backgroundImage?(e.openBlock(),e.createElementBlock("img",{key:0,src:o.data.backgroundImage,style:e.normalizeStyle({"object-fit":o.data.backgroundSize||"cover","background-position":o.data.backgroundPosition||"center center",width:"100%",height:"100px",border:"1px solid #ddd"}),alt:"Background Preview"},null,12,z)):(e.openBlock(),e.createElementBlock("div",I,"No preview available")),a[12]||(a[12]=e.createElementVNode("p",{class:"preview-note"}," A light grey background has been applied for previewing and will not be reflected on website. ",-1))])]),e.createElementVNode("div",$,[a[14]||(a[14]=e.createElementVNode("div",{class:"setting-toolbar"},[e.createElementVNode("h4",null,"组件")],-1)),e.createElementVNode("div",H,[e.createElementVNode("div",U,[e.createVNode(i.P,{data:o.data.data,onUpdate:a[5]||(a[5]=t=>o.data.data=t)},null,8,["data"])])])])])]),_:1},8,["visible"])}}}),O=i._(D,[["__scopeId","data-v-f43efd7b"]]),T={class:"component-wrapper"},j={__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(o,{emit:g}){const n=o,u=g,c=e.computed(()=>{var t,l;return!((t=n.modelValue)!=null&&t.data)||!Array.isArray(n.modelValue.data)?[]:(l=n.modelValue)==null?void 0:l.data}),r=e.ref(!1),m=e.ref(!1),v=()=>{var l,d;if(n.modelValue&&n.modelValue.data)return;const t={id:((l=n.modelValue)==null?void 0:l.id)||i.r(),type:"BackgroundWrapper",onlyShowPc:!1,backgroundImage:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-01.svg",backgroundSize:"cover",backgroundPosition:"center center",data:[{id:((d=n.modelValue)==null?void 0:d.id)||i.r(),type:"CustomText",onlyShowPc:!1,data:{width:1920,backgroundColor:"#ffffff",title:"这是标题",description:"这是描述"}}]};u("update:modelValue",t)},k=e.computed(()=>{var t;return n.isPreview?!((t=n.modelValue)!=null&&t.onlyShowPc)||!i.i():!0}),s=e.computed(()=>{var t;return((t=n.modelValue)==null?void 0:t.classes)??null}),a=e.computed(()=>{var t;return((t=n.modelValue)==null?void 0:t.style)??null}),V=e.computed(()=>{var t;return((t=n.modelValue)==null?void 0:t.width)??null}),y=e.computed(()=>{var t;return((t=n.modelValue)==null?void 0:t.backgroundImage)??""}),b=e.computed(()=>{var t;return((t=n.modelValue)==null?void 0:t.backgroundColor)??"transparent"}),w=e.computed(()=>{var t;return((t=n.modelValue)==null?void 0:t.backgroundSize)??"contain"}),p=e.computed(()=>{var t;return((t=n.modelValue)==null?void 0:t.backgroundPosition)??"center"}),f=e.computed(()=>{var t;return((t=n.modelValue)==null?void 0:t.backgroundRepeat)??"no-repeat"});return v(),(t,l)=>k.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["background-wrapper",s.value]),style:e.normalizeStyle(a.value)},[e.createElementVNode("div",{class:e.normalizeClass(V.value),style:{position:"relative"},onMouseover:l[2]||(l[2]=d=>r.value=!0),onMouseout:l[3]||(l[3]=d=>r.value=!1)},[e.createElementVNode("div",{class:"background-wrapper__bg",style:e.normalizeStyle({"background-image":`url('${y.value}')`,"background-color":`${b.value}`,"background-size":`${w.value}`,"background-position":`${p.value}`,"background-repeat":`${f.value}`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(d,Y)=>(e.openBlock(),e.createElementBlock("div",{key:d.id,class:"page-item"},[e.createElementVNode("div",T,[e.createVNode(i.a,{type:d.type,"props-data":{modelValue:d}},null,8,["type","props-data"])])]))),128))],4),o.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(i.O,{key:0,show:r.value,"onUpdate:show":l[0]||(l[0]=d=>r.value=d),onHandleEdit:l[1]||(l[1]=d=>m.value=!0),onHandleDelete:t.handleDelete,onHandleCopy:t.handleCopy,onHandlePaste:t.handlePaste},null,8,["show","onHandleDelete","onHandleCopy","onHandlePaste"]))],34),o.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(O,{key:0,show:m.value,"onUpdate:show":l[4]||(l[4]=d=>m.value=d),data:o.modelValue},null,8,["show","data"]))],6)):e.createCommentVNode("",!0)}},A=i._(j,[["__scopeId","data-v-e3f5b699"]]);exports.default=A;
@@ -1,4 +0,0 @@
1
- import { b as f } from "./index-DcjvupYq.mjs";
2
- export {
3
- f as default
4
- };