officialblock 2.1.2 → 2.1.3

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 @@
1
+ "use strict";var M=Object.create;var O=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var G=(l,v,c,w)=>{if(v&&typeof v=="object"||typeof v=="function")for(let f of j(v))!z.call(l,f)&&f!==c&&O(l,f,{get:()=>v[f],enumerable:!(w=F(v,f))||w.enumerable});return l};var J=(l,v,c)=>(c=l!=null?M(q(l)):{},G(v||!l||!l.__esModule?O(c,"default",{value:l,enumerable:!0}):c,l));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-0C0pBmhT.js"),K={class:"seting-box"},Q={class:"setting-header flex items-center"},R={key:0},W={class:"setting-header items-center"},X={class:"draggable_box"},Y={class:"drag_top_box"},Z=["onClick"],ee={key:0},te={class:"draggable_link_box"},le={class:"drag_link_top_box"},ae=["onClick"],ne=e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(l,{emit:v}){const c=e.defineAsyncComponent(()=>import("vuedraggable")),w=e.computed(()=>({animation:200,group:"gridLinks",disabled:!1,ghostClass:"ghost",handle:".drag-handle, .icon_drag",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),f=e.computed(()=>({animation:200,group:"gridLinkItems",disabled:!1,ghostClass:"ghost",handle:".drag-handle, .icon_drag",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),y=e.ref(!1),x=e.ref(!1),s=l,p=e.ref(new Set),V=e.ref(new Set),b=()=>{var a,t;(t=(a=s.data)==null?void 0:a.data)!=null&&t.list&&Array.isArray(s.data.data.list)&&(p.value.clear(),V.value.clear(),s.data.data.list.forEach(n=>{n.id&&p.value.add(n.id),n.links&&Array.isArray(n.links)&&n.links.length>0&&n.links.forEach(i=>{i.id&&V.value.add(i.id)})}))},_=e.ref(!1);e.watch(()=>s.show,a=>{a&&!_.value?(_.value=!0,e.nextTick(()=>{b()})):a||(_.value=!1)},{immediate:!0});const B=a=>{var t,n;p.value.has(a.id)?(p.value.clear(),(n=(t=s.data)==null?void 0:t.data)!=null&&n.list&&s.data.data.list.forEach(i=>{i.id!==a.id&&p.value.add(i.id)})):p.value.add(a.id)},m=a=>p.value.has(a.id),r=a=>{s.data.data.list=s.data.data.list.filter(t=>t.id!==a)},h=()=>{var n,i;const a=s.data.data,t=o.r();a.list.push({id:t,title:"这里是标题",links:[]}),p.value.clear(),(i=(n=s.data)==null?void 0:n.data)!=null&&i.list&&s.data.data.list.forEach(g=>{g.id!==t&&p.value.add(g.id)}),e.nextTick(()=>{if(typeof document<"u"){const g=document.querySelector(".arco-drawer-body");g&&(g.scrollTop=g.scrollHeight)}})},C=a=>{V.value.has(a.id)?V.value.delete(a.id):V.value.add(a.id)},k=a=>V.value.has(a.id),$=a=>{const t=s.data.data.list.find(n=>n.id===a);if(t){const n=o.r();t.links.push({id:n,name:"这里是名称",link:""}),t.links&&Array.isArray(t.links)&&t.links.forEach(i=>{i.id!==n?V.value.add(i.id):V.value.delete(i.id)})}},N=(a,t)=>{const n=s.data.data.list.find(i=>i.id===a);n&&n.links&&(n.links=n.links.filter(i=>i.id!==t))},S=v,L=()=>{S("update:show",!1)};return(a,t)=>{const n=e.resolveComponent("a-switch"),i=e.resolveComponent("a-option"),g=e.resolveComponent("a-select"),P=e.resolveComponent("icon-drag-dot"),D=e.resolveComponent("icon-drag-arrow"),U=e.resolveComponent("icon-delete"),T=e.resolveComponent("a-input"),I=e.resolveComponent("icon-plus"),A=e.resolveComponent("a-button"),H=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(H,{width:500,visible:l.show,footer:!1,onCancel:L,unmountOnClose:""},{title:e.withCtx(()=>{var d;return[e.createTextVNode(e.toDisplayString((d=l.data)==null?void 0:d.type)+"组件编辑 ",1)]}),default:e.withCtx(()=>[e.createElementVNode("div",K,[e.createElementVNode("div",Q,[t[7]||(t[7]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(n,{modelValue:l.data.onlyShowPc,"onUpdate:modelValue":t[0]||(t[0]=d=>l.data.onlyShowPc=d)},null,8,["modelValue"])]),t[19]||(t[19]=e.createElementVNode("p",{class:"item-title"},"组件宽度",-1)),e.createVNode(g,{modelValue:l.data.data.width,"onUpdate:modelValue":t[1]||(t[1]=d=>l.data.data.width=d),placeholder:"请选择","allow-clear":""},{default:e.withCtx(()=>[e.createVNode(i,{value:"default"},{default:e.withCtx(()=>[...t[8]||(t[8]=[e.createTextVNode("默认",-1)])]),_:1}),e.createVNode(i,{value:"small"},{default:e.withCtx(()=>[...t[9]||(t[9]=[e.createTextVNode("小",-1)])]),_:1}),e.createVNode(i,{value:"middle"},{default:e.withCtx(()=>[...t[10]||(t[10]=[e.createTextVNode("中",-1)])]),_:1}),e.createVNode(i,{value:"max"},{default:e.withCtx(()=>[...t[11]||(t[11]=[e.createTextVNode("大",-1)])]),_:1})]),_:1},8,["modelValue"]),t[20]||(t[20]=e.createElementVNode("div",{class:"part_title",style:{"margin-top":"20px"}},"链接列表",-1)),l.data.data.list.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",R,"暂无数据")),e.createElementVNode("div",W,[e.createVNode(e.unref(c),e.mergeProps({modelValue:l.data.data.list,"onUpdate:modelValue":t[4]||(t[4]=d=>l.data.data.list=d),"component-data":{tag:"div",type:"transition-group",name:y.value?null:"flip-list"}},w.value,{disabled:!1,onStart:t[5]||(t[5]=d=>y.value=!0),onEnd:t[6]||(t[6]=d=>y.value=!1),"item-key":"id"}),{item:e.withCtx(({element:d})=>[e.createElementVNode("div",X,[e.createElementVNode("div",Y,[e.createElementVNode("div",{class:"drag-handle",onClick:u=>B(d)},[e.createVNode(P,{style:{"margin-right":"10px"}}),e.createTextVNode(e.toDisplayString(d.title),1)],8,Z),e.createElementVNode("div",null,[e.createVNode(D,{class:"icon_drag"}),e.createVNode(U,{class:"btn-delete",onClick:e.withModifiers(u=>r(d.id),["stop"])},null,8,["onClick"])])]),e.createVNode(e.Transition,{name:"collapse"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",null,[t[16]||(t[16]=e.createElementVNode("p",{class:"item-title",style:{"margin-top":"20px"}},"标题",-1)),e.createVNode(T,{modelValue:d.title,"onUpdate:modelValue":u=>d.title=u,placeholder:"请输入标题","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),t[17]||(t[17]=e.createElementVNode("p",{class:"item-title",style:{"margin-top":"20px"}},"链接",-1)),d.links.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ee,"暂无数据")),e.createVNode(e.unref(c),e.mergeProps({modelValue:d.links,"onUpdate:modelValue":u=>d.links=u,"component-data":{tag:"div",type:"transition-group",name:x.value?null:"flip-list"}},f.value,{disabled:!1,onStart:t[2]||(t[2]=u=>x.value=!0),onEnd:t[3]||(t[3]=u=>x.value=!1),"item-key":"id"}),{item:e.withCtx(({element:u})=>[e.createElementVNode("div",te,[e.createElementVNode("div",le,[e.createElementVNode("div",{class:"drag-handle",onClick:E=>C(u)},[e.createVNode(P,{style:{"margin-right":"10px"}}),t[12]||(t[12]=e.createTextVNode("链接 ",-1))],8,ae),e.createElementVNode("div",null,[e.createVNode(D,{class:"icon_drag"}),e.createVNode(U,{class:"btn-delete",onClick:e.withModifiers(E=>N(d.id,u.id),["stop"])},null,8,["onClick"])])]),e.createVNode(e.Transition,{name:"collapse"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",null,[t[13]||(t[13]=e.createElementVNode("p",{class:"link-title",style:{"margin-top":"20px"}}," 名称 ",-1)),e.createVNode(T,{modelValue:u.name,"onUpdate:modelValue":E=>u.name=E,placeholder:"请输入名称","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),t[14]||(t[14]=e.createElementVNode("p",{class:"link-title",style:{"margin-top":"20px"}}," 链接地址 ",-1)),e.createVNode(T,{modelValue:u.link,"onUpdate:modelValue":E=>u.link=E,placeholder:"请输入链接地址","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"])],512),[[e.vShow,!k(u)]])]),_:2},1024)])]),_:2},1040,["modelValue","onUpdate:modelValue","component-data"]),e.createVNode(A,{style:{"margin-top":"20px"},size:"mini",type:"primary",onClick:u=>$(d.id)},{icon:e.withCtx(()=>[e.createVNode(I)]),default:e.withCtx(()=>[t[15]||(t[15]=e.createTextVNode(" 链接 ",-1))]),_:1},8,["onClick"])],512),[[e.vShow,!m(d)]])]),_:2},1024)])]),_:1},16,["modelValue","component-data"])]),e.createVNode(A,{type:"primary",onClick:h,style:{"margin-top":"20px"}},{icon:e.withCtx(()=>[e.createVNode(I)]),default:e.withCtx(()=>[t[18]||(t[18]=e.createTextVNode(" 新增 ",-1))]),_:1})])]),_:1},8,["visible"])}}}),oe=o._(ne,[["__scopeId","data-v-cec126b9"]]),de=["innerHTML"],ie={key:0,class:"grid-links__sublist"},se=["onClick"],re={key:1,class:"grid-links__subitem__link"},ce=e.defineComponent({name:"GridLinks",__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(l,{emit:v}){const c=l,w=v,f=m=>{w("handleClick",m)},y=e.computed(()=>{var m;return c.isPreview?!((m=c.modelValue)!=null&&m.onlyShowPc)||!o.i():!0}),x=()=>{var r;if(c.modelValue&&c.modelValue.data)return;const m={id:((r=c.modelValue)==null?void 0:r.id)||o.r(),type:"GridLinks",onlyShowPc:!1,data:{width:"default",bgColor:"white",list:[{id:o.r(),title:"这里是标题",links:[{id:o.r(),name:"这里是名称",link:""},{id:o.r(),name:"这里是名称",link:"https://www.baidu.com"},{id:o.r(),name:"这里是名称",link:"https://www.baidu.com"}]},{id:o.r(),title:"这里是标题",links:[{id:o.r(),name:"这里是名称",link:"https://www.baidu.com"},{id:o.r(),name:"这里是名称",link:"https://www.baidu.com"},{id:o.r(),name:"这里是名称",link:"https://www.baidu.com"}]},{id:o.r(),title:"这里是标题",links:[{id:o.r(),name:"这里是名称",link:"https://www.baidu.com"},{id:o.r(),name:"这里是名称",link:"https://www.baidu.com"},{id:o.r(),name:"这里是名称",link:"https://www.baidu.com"}]},{id:o.r(),title:"这里是标题",links:[{id:o.r(),name:"这里是名称",link:"https://www.baidu.com"},{id:o.r(),name:"这里是名称",link:"https://www.baidu.com"},{id:o.r(),name:"这里是名称",link:"https://www.baidu.com"}]}]}};w("update:modelValue",m)},s=e.ref(!1),p=e.ref(!1),V=e.computed(()=>{var h,C;const m=(C=(h=c.modelValue)==null?void 0:h.data)==null?void 0:C.width;return!m||m==="default"?"container-content":{small:"container-content-small",middle:"container-content-middle",max:"container-content-max"}[m]||"container-content"}),b=()=>{w("handleDelete",c.modelValue.id)},_=()=>{w("handleCopy",c.modelValue)},B=m=>{w("handlePaste",m)};return x(),(m,r)=>{var h,C;return e.openBlock(),e.createElementBlock(e.Fragment,null,[y.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"gridLinks_wrap",onMouseenter:r[2]||(r[2]=k=>s.value=!0),onMouseleave:r[3]||(r[3]=k=>s.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(V.value)},[e.createElementVNode("div",{class:"grid-links__row",style:e.normalizeStyle({"--grid-columns-mobile":m.mobileCol,"--grid-columns-desktop":m.desktopCol})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((C=(h=l.modelValue)==null?void 0:h.data)==null?void 0:C.list,(k,$)=>(e.openBlock(),e.createElementBlock("div",{class:"grid-links__item",key:`${k.title}-${$}`},[e.createElementVNode("h6",{class:"grid-links__item__title",innerHTML:k.title},null,8,de),k.links?(e.openBlock(),e.createElementBlock("ul",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.links,(N,S)=>(e.openBlock(),e.createElementBlock("li",{key:`${N.name}-${S}`,class:"grid-links__subitem"},[N.link?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:L=>f(N.link),class:"link_text"},[e.createTextVNode(e.toDisplayString(N.name)+" ",1),r[5]||(r[5]=e.createElementVNode("span",{class:"link_text__underline"},null,-1))],8,se)):(e.openBlock(),e.createElementBlock("div",re,e.toDisplayString(N.name),1))]))),128))])):e.createCommentVNode("",!0)]))),128))],4)],2),l.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(o.O,{key:0,show:s.value,"onUpdate:show":r[0]||(r[0]=k=>s.value=k),onHandleEdit:r[1]||(r[1]=k=>p.value=!0),onHandleDelete:b,onHandleCopy:_,onHandlePaste:B},null,8,["show"]))],32)):e.createCommentVNode("",!0),l.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(oe,{key:1,show:p.value,"onUpdate:show":r[4]||(r[4]=k=>p.value=k),data:l.modelValue},null,8,["show","data"]))],64)}}}),me=o._(ce,[["__scopeId","data-v-ed90ae1e"]]);exports.default=me;
@@ -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-CPFXI7lC.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,5 +1,5 @@
1
1
  import { defineComponent as A, ref as w, resolveComponent as g, createBlock as f, openBlock as i, withCtx as k, createElementVNode as a, createVNode as u, createElementBlock as p, Fragment as D, renderList as N, createTextVNode as B, toDisplayString as H, normalizeStyle as E, computed as d, createCommentVNode as $, normalizeClass as U } from "vue";
2
- import { P as Y, _ as O, i as j, a as M, O as R, r as F } from "./index-Chue7s0-.mjs";
2
+ import { P as Y, _ as O, i as j, a as M, O as R, r as F } from "./index-CPFXI7lC.mjs";
3
3
  const J = { class: "setting-content" }, L = { class: "setting-header flex items-center" }, T = { class: "setting-header flex items-center" }, W = { class: "setting-header flex items-center" }, q = { class: "setting-header flex items-center" }, G = { class: "setting-header flex items-center" }, K = { class: "setting-header flex items-center" }, Q = { class: "preview-container" }, X = ["src"], Z = {
4
4
  key: 1,
5
5
  class: "no-preview"
@@ -0,0 +1,4 @@
1
+ import { b as f } from "./index-CPFXI7lC.mjs";
2
+ export {
3
+ f as default
4
+ };