2 lines
5.5 KiB
JavaScript
2 lines
5.5 KiB
JavaScript
import{w as A,a as T,E as P}from"./element-plus.e43a9281.js";import{d as z,r as U,b,o as i,P as k,Q as s,c as f,W as l,U as W,T as C,a as c,F as j,a9 as J,K as V,J as K,S as L,u,a4 as B}from"./@vue.340249d8.js";import{e as O}from"./index.deb2a98b.js";import{v as Q,h as q,S as G,T as H}from"./@element-plus.558a564d.js";import{d as R}from"./index.191d3c47.js";import"./lodash-es.edba6135.js";import"./@vueuse.e3650918.js";import"./@popperjs.36402333.js";import"./@ctrl.b082b0c1.js";import"./dayjs.5d871bc3.js";import"./axios.7bd66c25.js";import"./async-validator.fb49d0f5.js";import"./memoize-one.4ee5c96d.js";import"./normalize-wheel-es.8aeb3683.js";import"./@floating-ui.0f9ce7c3.js";import"./attr.938b34b1.js";import"./index.1e733008.js";import"./picker.ddd16269.js";import"./index.vue_vue_type_script_setup_true_lang.4e4b54d4.js";import"./usePaging.fff444fa.js";import"./article.3db58c69.js";import"./index.0321c0f3.js";import"./picker.d01f1b0c.js";import"./index.748aaa8d.js";import"./index.d983ee81.js";import"./index.vue_vue_type_script_setup_true_lang.efe6fcf6.js";import"./vue3-video-play.fb56db8a.js";import"./vuedraggable.77a75095.js";import"./vue.a889dc59.js";import"./sortablejs.9f315f39.js";import"./lodash.e1b6d49d.js";import"./vue-router.9ddb0e92.js";import"./pinia.97fe9b12.js";import"./css-color-function.92cf4b29.js";import"./color.10cd7b9e.js";import"./clone.3a905afa.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.95290f48.js";import"./vue-clipboard3.d7f6d60e.js";import"./clipboard.07d173e7.js";import"./echarts.8535e5a6.js";import"./zrender.3eba8991.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.309a94da.js";import"./content.vue_vue_type_script_setup_true_lang.24284dcd.js";import"./decoration-img.b6172db0.js";import"./attr.vue_vue_type_script_setup_true_lang.c4bc0881.js";import"./content.0d09b8a5.js";import"./attr.vue_vue_type_script_setup_true_lang.ec9d6f26.js";import"./content.vue_vue_type_script_setup_true_lang.f3e13b5c.js";import"./attr.vue_vue_type_script_setup_true_lang.2ef6c7d6.js";import"./add-nav.vue_vue_type_script_setup_true_lang.c074b986.js";import"./content.b3723ee9.js";import"./attr.vue_vue_type_script_setup_true_lang.90c83ae2.js";import"./content.vue_vue_type_script_setup_true_lang.41c360e0.js";import"./attr.vue_vue_type_script_setup_true_lang.cd68c626.js";import"./content.bab88d0d.js";import"./decoration.8108b6dd.js";import"./attr.vue_vue_type_script_setup_true_lang.7cdc1048.js";import"./index.vue_vue_type_script_setup_true_lang.87bb859f.js";import"./content.92630e7f.js";import"./attr.00738b09.js";import"./content.vue_vue_type_script_setup_true_lang.5939c52a.js";import"./attr.vue_vue_type_script_setup_true_lang.14dc4336.js";import"./content.ba44b652.js";import"./attr.vue_vue_type_script_setup_true_lang.7a259c01.js";import"./content.vue_vue_type_script_setup_true_lang.cb6fb3a5.js";import"./attr.vue_vue_type_script_setup_true_lang.784c60ef.js";import"./content.468ac53b.js";const X={class:"shadow mx-[30px] pages-preview"},Y=["onClick"],Z={key:0,class:"widget-btns py-[5px]"},g=z({__name:"preview",props:{pageMeta:{type:Object,default:()=>null},pageData:{type:Array,default:()=>[]},modelValue:{type:Number,default:0}},emits:["update:modelValue"],setup(m,{emit:E}){const a=m,d=E,y=U(-1),D=()=>{a.modelValue===-1?d("update:modelValue",y.value):(y.value=a.modelValue,d("update:modelValue",-1))},M=(e,o)=>{e.disabled||d("update:modelValue",o)},F=b(()=>e=>e===0),S=b(()=>e=>{var o;return((o=a.pageData)==null?void 0:o.length)===e+1}),_=b(()=>e=>(e==null?void 0:e.enabled)==0),N=e=>{e.enabled!==void 0&&(e.enabled=e.enabled?0:1)},h=(e,o)=>{if(e<0||e>=a.pageData.length||o<0||o>=a.pageData.length)return;const p=a.pageData.splice(e,1)[0];a.pageData.splice(o,0,p),d("update:modelValue",o)};return(e,o)=>{const p=A,v=T,$=P;return i(),k($,{class:"pages-preview-container"},{default:s(()=>[m.pageMeta!==null?(i(),f("div",{key:0,class:"absolute right-4 top-4",onClick:D},[l(p,null,{default:s(()=>[W("\u9875\u9762\u8BBE\u7F6E")]),_:1})])):C("",!0),c("div",X,[(i(!0),f(j,null,J(m.pageData,(t,r)=>(i(),f("div",{key:t.id,class:V(["relative",{"cursor-pointer":!(t!=null&&t.disabled)}]),onClick:n=>M(t,r)},[c("div",{class:V(["absolute w-full h-full z-[100] border-dashed",{select:r==m.modelValue,hide:_.value(t.content),"border-[#dcdfe6] border-2":!(t!=null&&t.disabled)}])},null,2),K(e.$slots,"default",{},()=>{var n;return[(i(),k(L((n=u(O)[t==null?void 0:t.name])==null?void 0:n.content),{content:t.content,styles:t.styles,key:t.id},null,8,["content","styles"]))]},!0),r==m.modelValue?(i(),f("div",Z,[c("div",null,[l(v,{effect:"dark",content:_.value(t.content)?"\u663E\u793A":"\u9690\u85CF",placement:"right"},{default:s(()=>[l(p,{class:"py-[5px]",type:"primary",icon:_.value(t.content)?u(Q):u(q),onClick:n=>N(t.content)},null,8,["icon","onClick"])]),_:2},1032,["content"])]),c("div",null,[l(v,{effect:"dark",content:"\u4E0A\u79FB",placement:"right"},{default:s(()=>[l(p,{class:"py-[5px]",type:"primary",icon:u(G),disabled:F.value(r),onClick:B(n=>h(r,r-1),["stop"])},null,8,["icon","disabled","onClick"])]),_:2},1024)]),c("div",null,[l(v,{effect:"dark",content:"\u4E0B\u79FB",placement:"right"},{default:s(()=>[l(p,{class:"py-[5px]",type:"primary",icon:u(H),disabled:S.value(r),onClick:B(n=>h(r,r+1),["stop"])},null,8,["icon","disabled","onClick"])]),_:2},1024)])])):C("",!0)],10,Y))),128))])]),_:3})}}});const bt=R(g,[["__scopeId","data-v-6fe9720f"]]);export{bt as default};
|