officialblock 2.1.2 → 2.1.4

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.
@@ -0,0 +1,642 @@
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-mXDfSi-N.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
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),V=require("./index-B6j0X2Lr.js"),N=["onClick"],I={__name:"VrTourTab",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(k,{emit:w}){const{proxy:x}=e.getCurrentInstance(),{$_vsWidth:y}=x,B=k,i=w,c=e.ref(0),l=e.ref(0),a=e.ref(0),f=e.ref(0),u=e.ref(null),m=e.ref(null),d=e.ref([]),b=e.computed(()=>c.value>40),h=e.computed(()=>a.value+f.value<l.value+40),s=e.computed({get(){return B.currentIdx??0},set(r){i("updateIdx",r)}});e.watch(y,()=>{v()});const v=()=>{if(B.list.length<=0)return;m.value&&(c.value=m.value.scrollLeft),u.value&&(a.value=u.value.getBoundingClientRect().left,f.value=u.value.getBoundingClientRect().width);let r=null;d.value.length>0&&(r=Array.isArray(d.value)?d.value[d.value.length-1]:d.value),r&&r.getBoundingClientRect&&(l.value=r.getBoundingClientRect().left)},n=r=>{m.value&&(r==="next"?m.value.scrollLeft+=200:m.value.scrollLeft-=200)},t=()=>{v()};return e.onMounted(()=>{e.nextTick(()=>{t()})}),(r,p)=>(e.openBlock(),e.createElementBlock("div",{class:"tab-tag",ref_key:"VrtourWrapper",ref:u},[e.createElementVNode("ul",{class:"tab-tag__list",ref_key:"VrtourList",ref:m,onScroll:t},[e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__prev",onClick:p[0]||(p[0]=o=>n("prev"))},null,512),[[e.vShow,b.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.list,(o,_)=>(e.openBlock(),e.createElementBlock("li",{key:_},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tab-tag__btn",{"is-active":s.value==_}]),ref_for:!0,ref_key:"VrtourBtn",ref:d,onClick:g=>s.value=_},e.toDisplayString(o.name),11,N)]))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__next",onClick:p[1]||(p[1]=o=>n("next"))},null,512),[[e.vShow,h.value]])],544)],512))}},L=V._(I,[["__scopeId","data-v-efdafd78"]]),$=["onClick"],S={__name:"VrTourCat",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(k,{emit:w}){const{proxy:x}=e.getCurrentInstance(),y=k,B=w,i=e.ref(null),c=e.ref(null),l=e.ref(null),a=e.ref(0),f=e.ref(0),u=e.ref(0),m=e.ref(0),d=e.ref(0),b=e.computed(()=>a.value>40),h=e.computed(()=>u.value+m.value<f.value+40),s=e.computed({get(){return y.currentIdx??0},set(p){B("updateIdx",p),e.nextTick(r)}}),v=()=>{if(y.list.length<=0)return;c.value&&(a.value=c.value.scrollLeft),i.value&&(u.value=i.value.getBoundingClientRect().left,m.value=i.value.getBoundingClientRect().width);let p=null;l.value&&(p=Array.isArray(l.value)?l.value[l.value.length-1]:l.value),p&&p.getBoundingClientRect&&(f.value=p.getBoundingClientRect().left)},n=p=>{p=="next"?c.value.scrollLeft+=200:c.value.scrollLeft-=200},t=()=>{c.value&&(a.value=c.value.scrollLeft),v()},r=async()=>{if(await e.nextTick(),!l.value||!l.value[s.value])return;const p=l.value[s.value],o=p.clientWidth/2,_=x.$_vsWidth/2;d.value=p.getBoundingClientRect().right-o,c.value.scrollLeft-=_-d.value};return e.watch(()=>x.$_vsWidth,()=>{v()}),e.watch(()=>y.list,()=>{e.nextTick(v),c.value&&c.value.scrollLeft&&(c.value.scrollLeft=0)},{deep:!0}),e.onMounted(()=>{e.nextTick(t)}),(p,o)=>(e.openBlock(),e.createElementBlock("div",{class:"tab-tag",ref_key:"wrapper",ref:i},[e.createElementVNode("ul",{class:"tab-tag__list",ref_key:"list",ref:c,onScroll:t},[e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__prev",onClick:o[0]||(o[0]=_=>n("prev"))},null,512),[[e.vShow,b.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(_,g)=>(e.openBlock(),e.createElementBlock("li",{key:g,class:"tab-tag__item"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tab-tag__btn",{"is-active":s.value==g}]),ref_for:!0,ref_key:"btnRef",ref:l,onClick:C=>s.value=g},e.toDisplayString(_.name),11,$)]))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__next",onClick:o[1]||(o[1]=_=>n("next"))},null,512),[[e.vShow,h.value]])],544)],512))}},E=V._(S,[["__scopeId","data-v-6dd36752"]]),T={class:"tab-tag__nav__prev"},R=["onClick"],D=["src","alt"],O={class:"tab-tag__btn__title"},P={class:"tab-tag__nav__next"},W={__name:"VrTourChoose",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(k,{emit:w}){const{proxy:x}=e.getCurrentInstance(),{$_vsWidth:y}=x,B=k,i=w,c=e.ref(null),l=e.ref(null),a=e.ref(null),f=e.ref(0),u=e.ref(0),m=e.ref(0),d=e.ref(0),b=e.ref(0),h=e.computed(()=>f.value>0),s=e.computed(()=>u.value-40>d.value),v=e.computed({get(){return B.currentIdx??0},set(o){i("updateIdx",o),e.nextTick(r)}}),n=()=>{var _,g,C;if(B.list.length<=0)return;f.value=(_=l.value)==null?void 0:_.scrollLeft,m.value=(g=c.value)==null?void 0:g.getBoundingClientRect().left,d.value=(C=c.value)==null?void 0:C.getBoundingClientRect().right;let o=null;a.value&&(o=Array.isArray(a.value)?a.value[a.value.length-1]:a.value),u.value=o==null?void 0:o.getBoundingClientRect().right},t=o=>{o==="next"?l.value.scrollLeft+=200:l.value.scrollLeft-=200},r=()=>{const o=a.value[v.value];if(!o)return;const _=o.clientWidth/2,g=y.value/2;b.value=o.getBoundingClientRect().right-_,l.value.scrollLeft-=g-b.value},p=()=>{n()};return e.watch(()=>y.value,()=>{n()}),e.watch(()=>B.list,()=>{e.nextTick(n),l.value&&l.value.scrollLeft&&(l.value.scrollLeft=0)}),e.onMounted(()=>{e.nextTick(p)}),(o,_)=>(e.openBlock(),e.createElementBlock("div",{class:"vr-tour-choose tab-tag",ref_key:"wrapper",ref:c},[e.createElementVNode("ul",{class:"tab-tag__list",ref_key:"list",ref:l,onScroll:p},[e.withDirectives(e.createElementVNode("div",T,[e.createElementVNode("button",{type:"button",class:"nav__btn",onClick:_[0]||(_[0]=g=>t("prev"))})],512),[[e.vShow,h.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(g,C)=>(e.openBlock(),e.createElementBlock("li",{key:C,class:"tab-tag__item"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tab-tag__btn",{"is-active":v.value===C}]),ref_for:!0,ref_key:"btn",ref:a,onClick:ue=>v.value=C},[e.createElementVNode("img",{src:g.url,alt:g.name},null,8,D),e.createElementVNode("div",O,e.toDisplayString(g.name),1)],10,R)]))),128)),e.withDirectives(e.createElementVNode("div",P,[e.createElementVNode("button",{type:"button",class:"nav__btn",onClick:_[1]||(_[1]=g=>t("next"))})],512),[[e.vShow,s.value]])],544)],512))}},A=V._(W,[["__scopeId","data-v-ebb85a22"]]),q={class:"vr-tour-scene"},z=["src"],F={key:1,class:"vr-tour-scene__img"},H=["src","alt"],M={__name:"VrTourScene",props:{scene:{type:Object,default:()=>({})}},setup(k){const w=k,x=e.computed(()=>{var i;return(i=w.scene)==null?void 0:i.embed}),y=e.computed(()=>{var i;return(i=w.scene)==null?void 0:i.url}),B=e.computed(()=>{var i;return(i=w.scene)==null?void 0:i.name});return(i,c)=>(e.openBlock(),e.createElementBlock("div",q,[x.value?(e.openBlock(),e.createElementBlock("iframe",{key:0,src:x.value,frameborder:"0"},null,8,z)):(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("img",{src:y.value,alt:B.value},null,8,H)]))]))}},U=V._(M,[["__scopeId","data-v-c07507d5"]]),Y={class:"vr-tour-select"},G={class:"select-btn__focus-name line-clamp-1"},J={class:"select-list"},K=["onClick"],Q={__name:"VrTourSelect",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(k,{emit:w}){const{proxy:x}=e.getCurrentInstance(),{$_vsWidth:y}=x,B={mounted(s,v){s.clickOutsideEvent=n=>{s===n.target||s.contains(n.target)||v.value(n)},document.body.addEventListener("click",s.clickOutsideEvent)},unmounted(s){document.body.removeEventListener("click",s.clickOutsideEvent)}},i=k,c=w,l=e.ref(!1),a=e.ref(-8),f=e.ref(null),u=e.computed({get(){return i.currentIdx??0},set(s){c("updateIdx",s)}}),m=e.computed(()=>{var s;return((s=i.list[u.value])==null?void 0:s.name)||""});e.watch(l,()=>{b()}),e.onMounted(()=>{window.addEventListener("resize",()=>{y.value=window.innerWidth,l.value&&b()})});const d=()=>{l.value=!1},b=()=>{const s=f.value;if(!s)return;const v=V.$(s).x+s.clientWidth;v>y.value&&(a.value=a.value-v+y.value-4)},h=s=>{u.value=s,d()};return(s,v)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",Y,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["select-btn",{"is-open":l.value}]),onClick:v[0]||(v[0]=n=>l.value=!l.value)},[e.createElementVNode("div",G,e.toDisplayString(m.value),1),v[1]||(v[1]=e.createElementVNode("div",{class:"select-btn__arrow"},null,-1))],2),e.createElementVNode("div",{class:e.normalizeClass(["select-block",{"is-open":l.value}]),style:e.normalizeStyle({"--left":`${a.value}px`}),ref_key:"blockRef",ref:f},[e.createElementVNode("ul",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.list,(n,t)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["select-item line-clamp-1",{"is-active":u.value===t}]),key:t,onClick:r=>h(t)},e.toDisplayString(n.name),11,K))),128))])],6)])),[[B,d]])}},j=V._(Q,[["__scopeId","data-v-536804a2"]]),X={class:"vr-tour__wrapper"},Z={key:0,class:"vr-tour__tabs"},ee={class:"container-content-middle"},te={key:1,class:"vr-tour__selects"},le={class:"container-content"},ne={class:"vr-tour__selects__list"},se={class:"vr-tour__scene"},re={key:2,class:"vr-tour__cats"},oe={class:"pt-2"},ce={key:3,class:"vr-tour__chooses"},ae={__name:"index",props:{modelValue:{type:Object,default:()=>({})}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(k,{emit:w}){const{proxy:x}=e.getCurrentInstance(),{$_vsWidth:y,$_vsScrollY:B,$vsScreenAddListener:i,$vsScreenDestroyListener:c}=x,l=w,a=k,f=e.ref(0),u=e.ref(0),m=e.ref(0),d=e.computed(()=>{var n;return((n=a.modelValue)==null?void 0:n.data)??null}),b=e.computed(()=>{var n,t;return(t=(n=d.value)==null?void 0:n[f.value])==null?void 0:t.categoriesList}),h=e.computed(()=>{var n,t;return(t=(n=b.value)==null?void 0:n[u.value])==null?void 0:t.facilitiesList}),s=e.computed(()=>{var n;return(n=h.value)==null?void 0:n[m.value]}),v=()=>{var t;if(a.modelValue&&a.modelValue.data)return;const n={id:((t=a.modelValue)==null?void 0:t.id)||V.r(),type:"VrTour",onlyShowPc:!1,containerWidth:"",bgColor:"",classes:"custom-class another-class",style:{},width:"",data:[{key:"secondary-school",name:"Secondary School",categoriesList:[{key:"facilities",name:"Facilities",facilitiesList:[{key:"ece-learning-communities",name:"ECE Learning Communities",url:"https://osswebsite.ycyw.com/ycis-qd/res/qd/vt/multi_floor_plans/853_floorplan.png",scene:null,embed:"https://osswebsite.ycyw.com/ycis-qd/res/qd/vt-2026/en/index.html"},{key:"primary-learning-communities",name:"Primary Learning Communities",url:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/y3-5.jpg",scene:null,embed:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/y3-5/tour.html"},{key:"our-libraries",name:"Our Libraries",url:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/libraries.jpg",scene:null,embed:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/libraries/tour.html"},{key:"our-facilities",name:"Our Facilities",url:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/facilities.jpg",scene:null,embed:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/facilities2/tour.html"},{key:"honglingjin-park",name:"Honglingjin Park",url:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/park.jpg",scene:null,embed:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/park2/tour.html"},{key:"other-public-areas",name:"Other Public Areas",url:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/our-campus.jpg",scene:null,embed:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/our-campus/tour.html"}]}]},{key:"secondary-school",name:"Secondary School",categoriesList:[{key:"facilities",name:"Facilities",facilitiesList:[{key:"ece-learning-communities",name:"ECE Learning Communities",url:"https://osswebsite.ycyw.com/ycis-qd/res/qd/vt/multi_floor_plans/853_floorplan.png",scene:null,embed:"https://osswebsite.ycyw.com/ycis-qd/res/qd/vt-2026/en/index.html"},{key:"primary-learning-communities",name:"Primary Learning Communities",url:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/y3-5.jpg",scene:null,embed:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/y3-5/tour.html"},{key:"our-libraries",name:"Our Libraries",url:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/libraries.jpg",scene:null,embed:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/libraries/tour.html"},{key:"our-facilities",name:"Our Facilities",url:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/facilities.jpg",scene:null,embed:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/facilities2/tour.html"},{key:"honglingjin-park",name:"Honglingjin Park",url:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/park.jpg",scene:null,embed:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/park2/tour.html"},{key:"other-public-areas",name:"Other Public Areas",url:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/our-campus.jpg",scene:null,embed:"https://osswebsite.ycyw.com/ycis-bj/res/bj/vt/our-campus/tour.html"}]}]}]};l("update:modelValue",n),f.value=0};return e.watch(f,()=>{u.value=0}),e.watch(u,()=>{m.value=0}),v(),(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vr-tour bg-neutral-lightest",{"pb-0":h.value&&h.value.length<=1}])},[e.createElementVNode("div",X,[d.value&&d.value.length>1&&e.unref(y)>=768?(e.openBlock(),e.createElementBlock("div",Z,[e.createElementVNode("div",ee,[e.createVNode(L,{list:d.value,onUpdateIdx:t[0]||(t[0]=r=>f.value=r),currentIdx:f.value},null,8,["list","currentIdx"])])])):e.createCommentVNode("",!0),e.unref(y)<768?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",le,[e.createElementVNode("div",ne,[d.value.length>1?(e.openBlock(),e.createBlock(j,{key:0,list:d.value,onUpdateIdx:t[1]||(t[1]=r=>f.value=r),currentIdx:f.value},null,8,["list","currentIdx"])):e.createCommentVNode("",!0),b.value.length>1?(e.openBlock(),e.createBlock(j,{key:1,list:b.value,onUpdateIdx:t[2]||(t[2]=r=>u.value=r),currentIdx:u.value},null,8,["list","currentIdx"])):e.createCommentVNode("",!0)])]),h.value.length>1?(e.openBlock(),e.createBlock(E,{key:0,list:h.value,onUpdateIdx:t[3]||(t[3]=r=>m.value=r),currentIdx:m.value},null,8,["list","currentIdx"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",se,[e.createVNode(U,{scene:s.value},null,8,["scene"])]),b.value&&e.unref(y)>=768?(e.openBlock(),e.createElementBlock("div",re,[e.withDirectives(e.createElementVNode("div",oe,null,512),[[e.vShow,b.value.length<=1&&h.value.length>1]]),e.withDirectives(e.createVNode(E,{list:b.value,onUpdateIdx:t[4]||(t[4]=r=>u.value=r),currentIdx:u.value},null,8,["list","currentIdx"]),[[e.vShow,b.value.length>1]])])):e.createCommentVNode("",!0),h.value&&h.value.length>1&&e.unref(y)>=768?(e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(A,{list:h.value,onUpdateIdx:t[5]||(t[5]=r=>m.value=r),currentIdx:m.value},null,8,["list","currentIdx"])])):e.createCommentVNode("",!0)])],2))}},ie=V._(ae,[["__scopeId","data-v-f386fe24"]]);exports.default=ie;