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 @@
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-B6j0X2Lr.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;
@@ -4,7 +4,7 @@ var r = (a, u, c) => L(a, typeof u != "symbol" ? u + "" : u, c);
4
4
  import { defineComponent as A, shallowRef as R, ref as p, computed as F, inject as y, watch as C, nextTick as b, onBeforeUnmount as q, createElementBlock as J, openBlock as G, createVNode as I, unref as H, normalizeStyle as P } from "vue";
5
5
  import { Toolbar as Q, Editor as W } from "@wangeditor/editor-for-vue";
6
6
  import { Boot as z } from "@wangeditor/editor";
7
- import { _ as X } from "./index-Chue7s0-.mjs";
7
+ import { _ as X } from "./index-mXDfSi-N.mjs";
8
8
  const Y = { class: "rich-text-editor" }, Z = /* @__PURE__ */ A({
9
9
  __name: "index",
10
10
  props: {
@@ -0,0 +1,542 @@
1
+ import { defineComponent as ne, defineAsyncComponent as oe, computed as E, ref as S, watch as se, nextTick as W, resolveComponent as y, createBlock as j, openBlock as k, withCtx as p, createElementVNode as a, createVNode as n, createElementBlock as g, createCommentVNode as L, createTextVNode as _, unref as X, mergeProps as Y, toDisplayString as A, withModifiers as Z, Transition as ee, withDirectives as te, vShow as le, Fragment as F, normalizeClass as re, normalizeStyle as ue, renderList as ae } from "vue";
2
+ import { r as o, _ as ie, i as me, O as ce } from "./index-mXDfSi-N.mjs";
3
+ const pe = { class: "seting-box" }, ke = { class: "setting-header flex items-center" }, ve = { key: 0 }, fe = { class: "setting-header items-center" }, we = { class: "draggable_box" }, ge = { class: "drag_top_box" }, he = ["onClick"], ye = { key: 0 }, _e = { class: "draggable_link_box" }, Ce = { class: "drag_link_top_box" }, Ve = ["onClick"], be = /* @__PURE__ */ ne({
4
+ __name: "setting",
5
+ props: {
6
+ show: {
7
+ type: Boolean,
8
+ default: !1
9
+ },
10
+ data: {
11
+ type: Object,
12
+ default: () => {
13
+ }
14
+ }
15
+ },
16
+ emits: ["update:show"],
17
+ setup(m, { emit: O }) {
18
+ const w = oe(() => import("vuedraggable")), V = E(() => ({
19
+ animation: 200,
20
+ group: "gridLinks",
21
+ // 列表专用分组
22
+ disabled: !1,
23
+ ghostClass: "ghost",
24
+ handle: ".drag-handle, .icon_drag",
25
+ // 拖拽手柄和图标都能触发拖拽
26
+ filter: ".arco-input, .arco-select, .arco-checkbox",
27
+ // 排除这些元素的拖拽
28
+ preventOnFilter: !1
29
+ // 允许在被过滤的元素上进行正常交互
30
+ })), H = E(() => ({
31
+ animation: 200,
32
+ group: "gridLinkItems",
33
+ // 链接项专用分组
34
+ disabled: !1,
35
+ ghostClass: "ghost",
36
+ handle: ".drag-handle, .icon_drag",
37
+ // 拖拽手柄和图标都能触发拖拽
38
+ filter: ".arco-input, .arco-select, .arco-checkbox",
39
+ // 排除这些元素的拖拽
40
+ preventOnFilter: !1
41
+ // 允许在被过滤的元素上进行正常交互
42
+ })), P = S(!1), U = S(!1), s = m, v = S(/* @__PURE__ */ new Set()), h = S(/* @__PURE__ */ new Set()), M = () => {
43
+ var t, e;
44
+ (e = (t = s.data) == null ? void 0 : t.data) != null && e.list && Array.isArray(s.data.data.list) && (v.value.clear(), h.value.clear(), s.data.data.list.forEach((l) => {
45
+ l.id && v.value.add(l.id), l.links && Array.isArray(l.links) && l.links.length > 0 && l.links.forEach((d) => {
46
+ d.id && h.value.add(d.id);
47
+ });
48
+ }));
49
+ }, I = S(!1);
50
+ se(
51
+ () => s.show,
52
+ (t) => {
53
+ t && !I.value ? (I.value = !0, W(() => {
54
+ M();
55
+ })) : t || (I.value = !1);
56
+ },
57
+ { immediate: !0 }
58
+ );
59
+ const T = (t) => {
60
+ var e, l;
61
+ v.value.has(t.id) ? (v.value.clear(), (l = (e = s.data) == null ? void 0 : e.data) != null && l.list && s.data.data.list.forEach((d) => {
62
+ d.id !== t.id && v.value.add(d.id);
63
+ })) : v.value.add(t.id);
64
+ }, u = (t) => v.value.has(t.id), r = (t) => {
65
+ s.data.data.list = s.data.data.list.filter(
66
+ (e) => e.id !== t
67
+ );
68
+ }, b = () => {
69
+ var l, d;
70
+ const t = s.data.data, e = o();
71
+ t.list.push({
72
+ id: e,
73
+ title: "这里是标题",
74
+ links: []
75
+ }), v.value.clear(), (d = (l = s.data) == null ? void 0 : l.data) != null && d.list && s.data.data.list.forEach((C) => {
76
+ C.id !== e && v.value.add(C.id);
77
+ }), W(() => {
78
+ if (typeof document < "u") {
79
+ const C = document.querySelector(".arco-drawer-body");
80
+ C && (C.scrollTop = C.scrollHeight);
81
+ }
82
+ });
83
+ }, x = (t) => {
84
+ h.value.has(t.id) ? h.value.delete(t.id) : h.value.add(t.id);
85
+ }, f = (t) => h.value.has(t.id), B = (t) => {
86
+ const e = s.data.data.list.find((l) => l.id === t);
87
+ if (e) {
88
+ const l = o();
89
+ e.links.push({
90
+ id: l,
91
+ name: "这里是名称",
92
+ link: ""
93
+ }), e.links && Array.isArray(e.links) && e.links.forEach((d) => {
94
+ d.id !== l ? h.value.add(d.id) : h.value.delete(d.id);
95
+ });
96
+ }
97
+ }, $ = (t, e) => {
98
+ const l = s.data.data.list.find((d) => d.id === t);
99
+ l && l.links && (l.links = l.links.filter((d) => d.id !== e));
100
+ }, N = O, G = () => {
101
+ N("update:show", !1);
102
+ };
103
+ return (t, e) => {
104
+ const l = y("a-switch"), d = y("a-option"), C = y("a-select"), q = y("icon-drag-dot"), J = y("icon-drag-arrow"), K = y("icon-delete"), z = y("a-input"), Q = y("icon-plus"), R = y("a-button"), de = y("a-drawer");
105
+ return k(), j(de, {
106
+ width: 500,
107
+ visible: m.show,
108
+ footer: !1,
109
+ onCancel: G,
110
+ unmountOnClose: ""
111
+ }, {
112
+ title: p(() => {
113
+ var i;
114
+ return [
115
+ _(A((i = m.data) == null ? void 0 : i.type) + "组件编辑 ", 1)
116
+ ];
117
+ }),
118
+ default: p(() => [
119
+ a("div", pe, [
120
+ a("div", ke, [
121
+ e[7] || (e[7] = a("span", { class: "header-title" }, "仅显示PC端", -1)),
122
+ n(l, {
123
+ modelValue: m.data.onlyShowPc,
124
+ "onUpdate:modelValue": e[0] || (e[0] = (i) => m.data.onlyShowPc = i)
125
+ }, null, 8, ["modelValue"])
126
+ ]),
127
+ e[19] || (e[19] = a("p", { class: "item-title" }, "组件宽度", -1)),
128
+ n(C, {
129
+ modelValue: m.data.data.width,
130
+ "onUpdate:modelValue": e[1] || (e[1] = (i) => m.data.data.width = i),
131
+ placeholder: "请选择",
132
+ "allow-clear": ""
133
+ }, {
134
+ default: p(() => [
135
+ n(d, { value: "default" }, {
136
+ default: p(() => [...e[8] || (e[8] = [
137
+ _("默认", -1)
138
+ ])]),
139
+ _: 1
140
+ }),
141
+ n(d, { value: "small" }, {
142
+ default: p(() => [...e[9] || (e[9] = [
143
+ _("小", -1)
144
+ ])]),
145
+ _: 1
146
+ }),
147
+ n(d, { value: "middle" }, {
148
+ default: p(() => [...e[10] || (e[10] = [
149
+ _("中", -1)
150
+ ])]),
151
+ _: 1
152
+ }),
153
+ n(d, { value: "max" }, {
154
+ default: p(() => [...e[11] || (e[11] = [
155
+ _("大", -1)
156
+ ])]),
157
+ _: 1
158
+ })
159
+ ]),
160
+ _: 1
161
+ }, 8, ["modelValue"]),
162
+ e[20] || (e[20] = a("div", {
163
+ class: "part_title",
164
+ style: { "margin-top": "20px" }
165
+ }, "链接列表", -1)),
166
+ m.data.data.list.length ? L("", !0) : (k(), g("div", ve, "暂无数据")),
167
+ a("div", fe, [
168
+ n(X(w), Y({
169
+ modelValue: m.data.data.list,
170
+ "onUpdate:modelValue": e[4] || (e[4] = (i) => m.data.data.list = i),
171
+ "component-data": {
172
+ tag: "div",
173
+ type: "transition-group",
174
+ name: P.value ? null : "flip-list"
175
+ }
176
+ }, V.value, {
177
+ disabled: !1,
178
+ onStart: e[5] || (e[5] = (i) => P.value = !0),
179
+ onEnd: e[6] || (e[6] = (i) => P.value = !1),
180
+ "item-key": "id"
181
+ }), {
182
+ item: p(({ element: i }) => [
183
+ a("div", we, [
184
+ a("div", ge, [
185
+ a("div", {
186
+ class: "drag-handle",
187
+ onClick: (c) => T(i)
188
+ }, [
189
+ n(q, { style: { "margin-right": "10px" } }),
190
+ _(A(i.title), 1)
191
+ ], 8, he),
192
+ a("div", null, [
193
+ n(J, { class: "icon_drag" }),
194
+ n(K, {
195
+ class: "btn-delete",
196
+ onClick: Z((c) => r(i.id), ["stop"])
197
+ }, null, 8, ["onClick"])
198
+ ])
199
+ ]),
200
+ n(ee, { name: "collapse" }, {
201
+ default: p(() => [
202
+ te(a("div", null, [
203
+ e[16] || (e[16] = a("p", {
204
+ class: "item-title",
205
+ style: { "margin-top": "20px" }
206
+ }, "标题", -1)),
207
+ n(z, {
208
+ modelValue: i.title,
209
+ "onUpdate:modelValue": (c) => i.title = c,
210
+ placeholder: "请输入标题",
211
+ "allow-clear": ""
212
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
213
+ e[17] || (e[17] = a("p", {
214
+ class: "item-title",
215
+ style: { "margin-top": "20px" }
216
+ }, "链接", -1)),
217
+ i.links.length ? L("", !0) : (k(), g("div", ye, "暂无数据")),
218
+ n(X(w), Y({
219
+ modelValue: i.links,
220
+ "onUpdate:modelValue": (c) => i.links = c,
221
+ "component-data": {
222
+ tag: "div",
223
+ type: "transition-group",
224
+ name: U.value ? null : "flip-list"
225
+ }
226
+ }, H.value, {
227
+ disabled: !1,
228
+ onStart: e[2] || (e[2] = (c) => U.value = !0),
229
+ onEnd: e[3] || (e[3] = (c) => U.value = !1),
230
+ "item-key": "id"
231
+ }), {
232
+ item: p(({ element: c }) => [
233
+ a("div", _e, [
234
+ a("div", Ce, [
235
+ a("div", {
236
+ class: "drag-handle",
237
+ onClick: (D) => x(c)
238
+ }, [
239
+ n(q, { style: { "margin-right": "10px" } }),
240
+ e[12] || (e[12] = _("链接 ", -1))
241
+ ], 8, Ve),
242
+ a("div", null, [
243
+ n(J, { class: "icon_drag" }),
244
+ n(K, {
245
+ class: "btn-delete",
246
+ onClick: Z((D) => $(i.id, c.id), ["stop"])
247
+ }, null, 8, ["onClick"])
248
+ ])
249
+ ]),
250
+ n(ee, { name: "collapse" }, {
251
+ default: p(() => [
252
+ te(a("div", null, [
253
+ e[13] || (e[13] = a("p", {
254
+ class: "link-title",
255
+ style: { "margin-top": "20px" }
256
+ }, " 名称 ", -1)),
257
+ n(z, {
258
+ modelValue: c.name,
259
+ "onUpdate:modelValue": (D) => c.name = D,
260
+ placeholder: "请输入名称",
261
+ "allow-clear": ""
262
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
263
+ e[14] || (e[14] = a("p", {
264
+ class: "link-title",
265
+ style: { "margin-top": "20px" }
266
+ }, " 链接地址 ", -1)),
267
+ n(z, {
268
+ modelValue: c.link,
269
+ "onUpdate:modelValue": (D) => c.link = D,
270
+ placeholder: "请输入链接地址",
271
+ "allow-clear": ""
272
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
273
+ ], 512), [
274
+ [le, !f(c)]
275
+ ])
276
+ ]),
277
+ _: 2
278
+ }, 1024)
279
+ ])
280
+ ]),
281
+ _: 2
282
+ }, 1040, ["modelValue", "onUpdate:modelValue", "component-data"]),
283
+ n(R, {
284
+ style: { "margin-top": "20px" },
285
+ size: "mini",
286
+ type: "primary",
287
+ onClick: (c) => B(i.id)
288
+ }, {
289
+ icon: p(() => [
290
+ n(Q)
291
+ ]),
292
+ default: p(() => [
293
+ e[15] || (e[15] = _(" 链接 ", -1))
294
+ ]),
295
+ _: 1
296
+ }, 8, ["onClick"])
297
+ ], 512), [
298
+ [le, !u(i)]
299
+ ])
300
+ ]),
301
+ _: 2
302
+ }, 1024)
303
+ ])
304
+ ]),
305
+ _: 1
306
+ }, 16, ["modelValue", "component-data"])
307
+ ]),
308
+ n(R, {
309
+ type: "primary",
310
+ onClick: b,
311
+ style: { "margin-top": "20px" }
312
+ }, {
313
+ icon: p(() => [
314
+ n(Q)
315
+ ]),
316
+ default: p(() => [
317
+ e[18] || (e[18] = _(" 新增 ", -1))
318
+ ]),
319
+ _: 1
320
+ })
321
+ ])
322
+ ]),
323
+ _: 1
324
+ }, 8, ["visible"]);
325
+ };
326
+ }
327
+ }), xe = /* @__PURE__ */ ie(be, [["__scopeId", "data-v-cec126b9"]]), $e = ["innerHTML"], Se = {
328
+ key: 0,
329
+ class: "grid-links__sublist"
330
+ }, Le = ["onClick"], Pe = {
331
+ key: 1,
332
+ class: "grid-links__subitem__link"
333
+ }, Ue = /* @__PURE__ */ ne({
334
+ name: "GridLinks",
335
+ __name: "index",
336
+ props: {
337
+ modelValue: {
338
+ type: Object,
339
+ default: () => {
340
+ }
341
+ },
342
+ // 是否预览
343
+ isPreview: {
344
+ type: Boolean,
345
+ default: !0
346
+ }
347
+ },
348
+ emits: [
349
+ "update:modelValue",
350
+ "handleDelete",
351
+ "handleCopy",
352
+ "handlePaste",
353
+ "handleClick"
354
+ ],
355
+ setup(m, { emit: O }) {
356
+ const w = m, V = O, H = (u) => {
357
+ V("handleClick", u);
358
+ }, P = E(() => {
359
+ var u;
360
+ return w.isPreview ? !((u = w.modelValue) != null && u.onlyShowPc) || !me() : !0;
361
+ }), U = () => {
362
+ var r;
363
+ if (w.modelValue && w.modelValue.data) return;
364
+ const u = {
365
+ id: ((r = w.modelValue) == null ? void 0 : r.id) || o(),
366
+ type: "GridLinks",
367
+ onlyShowPc: !1,
368
+ data: {
369
+ width: "default",
370
+ bgColor: "white",
371
+ list: [
372
+ {
373
+ id: o(),
374
+ title: "这里是标题",
375
+ links: [
376
+ {
377
+ id: o(),
378
+ name: "这里是名称",
379
+ link: ""
380
+ },
381
+ {
382
+ id: o(),
383
+ name: "这里是名称",
384
+ link: "https://www.baidu.com"
385
+ },
386
+ {
387
+ id: o(),
388
+ name: "这里是名称",
389
+ link: "https://www.baidu.com"
390
+ }
391
+ ]
392
+ },
393
+ {
394
+ id: o(),
395
+ title: "这里是标题",
396
+ links: [
397
+ {
398
+ id: o(),
399
+ name: "这里是名称",
400
+ link: "https://www.baidu.com"
401
+ },
402
+ {
403
+ id: o(),
404
+ name: "这里是名称",
405
+ link: "https://www.baidu.com"
406
+ },
407
+ {
408
+ id: o(),
409
+ name: "这里是名称",
410
+ link: "https://www.baidu.com"
411
+ }
412
+ ]
413
+ },
414
+ {
415
+ id: o(),
416
+ title: "这里是标题",
417
+ links: [
418
+ {
419
+ id: o(),
420
+ name: "这里是名称",
421
+ link: "https://www.baidu.com"
422
+ },
423
+ {
424
+ id: o(),
425
+ name: "这里是名称",
426
+ link: "https://www.baidu.com"
427
+ },
428
+ {
429
+ id: o(),
430
+ name: "这里是名称",
431
+ link: "https://www.baidu.com"
432
+ }
433
+ ]
434
+ },
435
+ {
436
+ id: o(),
437
+ title: "这里是标题",
438
+ links: [
439
+ {
440
+ id: o(),
441
+ name: "这里是名称",
442
+ link: "https://www.baidu.com"
443
+ },
444
+ {
445
+ id: o(),
446
+ name: "这里是名称",
447
+ link: "https://www.baidu.com"
448
+ },
449
+ {
450
+ id: o(),
451
+ name: "这里是名称",
452
+ link: "https://www.baidu.com"
453
+ }
454
+ ]
455
+ }
456
+ ]
457
+ }
458
+ };
459
+ V("update:modelValue", u);
460
+ }, s = S(!1), v = S(!1), h = E(() => {
461
+ var b, x;
462
+ const u = (x = (b = w.modelValue) == null ? void 0 : b.data) == null ? void 0 : x.width;
463
+ return !u || u === "default" ? "container-content" : {
464
+ small: "container-content-small",
465
+ middle: "container-content-middle",
466
+ max: "container-content-max"
467
+ }[u] || "container-content";
468
+ }), M = () => {
469
+ V("handleDelete", w.modelValue.id);
470
+ }, I = () => {
471
+ V("handleCopy", w.modelValue);
472
+ }, T = (u) => {
473
+ V("handlePaste", u);
474
+ };
475
+ return U(), (u, r) => {
476
+ var b, x;
477
+ return k(), g(F, null, [
478
+ P.value ? (k(), g("div", {
479
+ key: 0,
480
+ class: "gridLinks_wrap",
481
+ onMouseenter: r[2] || (r[2] = (f) => s.value = !0),
482
+ onMouseleave: r[3] || (r[3] = (f) => s.value = !1)
483
+ }, [
484
+ a("div", {
485
+ class: re(h.value)
486
+ }, [
487
+ a("div", {
488
+ class: "grid-links__row",
489
+ style: ue({
490
+ "--grid-columns-mobile": u.mobileCol,
491
+ "--grid-columns-desktop": u.desktopCol
492
+ })
493
+ }, [
494
+ (k(!0), g(F, null, ae((x = (b = m.modelValue) == null ? void 0 : b.data) == null ? void 0 : x.list, (f, B) => (k(), g("div", {
495
+ class: "grid-links__item",
496
+ key: `${f.title}-${B}`
497
+ }, [
498
+ a("h6", {
499
+ class: "grid-links__item__title",
500
+ innerHTML: f.title
501
+ }, null, 8, $e),
502
+ f.links ? (k(), g("ul", Se, [
503
+ (k(!0), g(F, null, ae(f.links, ($, N) => (k(), g("li", {
504
+ key: `${$.name}-${N}`,
505
+ class: "grid-links__subitem"
506
+ }, [
507
+ $.link ? (k(), g("div", {
508
+ key: 0,
509
+ onClick: (G) => H($.link),
510
+ class: "link_text"
511
+ }, [
512
+ _(A($.name) + " ", 1),
513
+ r[5] || (r[5] = a("span", { class: "link_text__underline" }, null, -1))
514
+ ], 8, Le)) : (k(), g("div", Pe, A($.name), 1))
515
+ ]))), 128))
516
+ ])) : L("", !0)
517
+ ]))), 128))
518
+ ], 4)
519
+ ], 2),
520
+ m.isPreview ? L("", !0) : (k(), j(ce, {
521
+ key: 0,
522
+ show: s.value,
523
+ "onUpdate:show": r[0] || (r[0] = (f) => s.value = f),
524
+ onHandleEdit: r[1] || (r[1] = (f) => v.value = !0),
525
+ onHandleDelete: M,
526
+ onHandleCopy: I,
527
+ onHandlePaste: T
528
+ }, null, 8, ["show"]))
529
+ ], 32)) : L("", !0),
530
+ m.isPreview ? L("", !0) : (k(), j(xe, {
531
+ key: 1,
532
+ show: v.value,
533
+ "onUpdate:show": r[4] || (r[4] = (f) => v.value = f),
534
+ data: m.modelValue
535
+ }, null, 8, ["show", "data"]))
536
+ ], 64);
537
+ };
538
+ }
539
+ }), Ee = /* @__PURE__ */ ie(Ue, [["__scopeId", "data-v-ed90ae1e"]]);
540
+ export {
541
+ Ee as default
542
+ };