niucloud-admin/niucloud/public/admin/assets/edit-active-cube-55f1dd01.js
全栈小学生 560569ecf2 up
2024-09-28 09:39:20 +08:00

2 lines
14 KiB
JavaScript

import{d as X,k as n,r as P,l as B,an as Y,aG as Z,N as ee,h as b,c as C,J as _,a9 as x,u as e,a as d,t as p,e as t,w as i,i as v,F,O as z,n as R,z as $,m as le,B as te,b as oe,T as ae,G as ne,D as ie,H as se,E as de,V as re,b2 as ue,aa as pe,ab as me}from"./index-49a7c6d3.js";/* empty css *//* empty css */import{_ as ce}from"./index.vue_vue_type_script_setup_true_lang-108fa369.js";/* empty css *//* empty css *//* empty css */import be from"./index-a7528986.js";/* empty css *//* empty css *//* empty css */import{_ as fe}from"./index.vue_vue_type_style_index_0_lang-bfa586c1.js";import{u as Ce}from"./diy-1c0bfd2e.js";import{S as _e}from"./sortable.esm-be94e56d.js";import{r as xe}from"./range-606015d8.js";const ve={class:"content-wrap"},ye={class:"edit-attr-item-wrap"},he={class:"mb-[10px]"},Ve={class:"flex flex-wrap"},ge=["onClick"],ke=["src"],Te={class:"dialog-footer"},we={class:"edit-attr-item-wrap"},Se={class:"mb-[10px]"},Ue={class:"flex flex-wrap"},Be=["onClick"],Fe=["src"],Ee={class:"dialog-footer"},Pe={class:"text-sm text-gray-400 mb-[10px]"},ze=["onClick"],De={class:"style-wrap"},Ie={class:"edit-attr-item-wrap"},Me={class:"mb-[10px]"},Re={class:"edit-attr-item-wrap"},$e={class:"mb-[10px]"},Le={class:"edit-attr-item-wrap"},Ae={class:"mb-[10px]"},Ne=X({__name:"edit-active-cube",setup(Oe,{expose:L}){const l=Ce();l.editComponent.ignore=[],l.editComponent.verify=u=>{const a={code:!0,message:""};return l.value[u].text==""?(a.code=!1,a.message=n("activeCubeTitlePlaceholder"),a):(l.value[u].list.forEach(c=>{if(c.imageUrl==="")return a.code=!1,a.message=n("imageUrlTip"),a;if(c.title.text==="")return a.code=!1,a.message=n("activeCubeTitlePlaceholder"),a;if(["style-1","style-2","style-4"].indexOf(l.value[u].blockStyle.value)!=-1&&c.subTitle.text==="")return a.code=!1,a.message=n("activeCubeSubTitlePlaceholder"),a;if(["style-1","style-2"].indexOf(l.value[u].blockStyle.value)!=-1&&c.moreTitle.text==="")return a.code=!1,a.message=n("activeCubeButtonPlaceholder"),a}),a)},l.editComponent.list.forEach(u=>{u.id||(u.id=l.generateRandom())});const y=P(!1),A=()=>{f.title=l.editComponent.titleStyle.title,f.value=l.editComponent.titleStyle.value,y.value=!0},N=B([{url:"static/resource/images/diy/active_cube/title_style1.png",title:"风格1",value:"style-1"},{url:"static/resource/images/diy/active_cube/title_style2.png",title:"风格2",value:"style-2"},{url:"static/resource/images/diy/active_cube/title_style3.png",title:"风格3",value:"style-3"},{url:"static/resource/images/diy/active_cube/title_style5.png",title:"风格4",value:"style-4"}]),f=B({title:l.editComponent.titleStyle.title,value:l.editComponent.titleStyle.value}),O=u=>{f.title=u.title,f.value=u.value},j=()=>{l.editComponent.titleStyle.title=f.title,l.editComponent.titleStyle.value=f.value,y.value=!1},h=P(!1),W=()=>{h.value=!0},G=B([{url:"static/resource/images/diy/active_cube/block_style1.png",title:"风格1",value:"style-1"},{url:"static/resource/images/diy/active_cube/block_style2.png",title:"风格2",value:"style-2"},{url:"static/resource/images/diy/active_cube/block_style3.png",title:"风格3",value:"style-3"},{url:"static/resource/images/diy/active_cube/block_style4.png",title:"风格4",value:"style-4"}]),V=B({title:l.editComponent.blockStyle.title,value:l.editComponent.blockStyle.value}),H=u=>{V.title=u.title,V.value=u.value},J=()=>{l.editComponent.blockStyle.title=V.title,l.editComponent.blockStyle.value=V.value,h.value=!1},q=()=>{l.editComponent.list.push({id:l.generateRandom(),title:{title:"标题",textColor:"#000000"},subTitle:{text:"副标题",textColor:"#999999",startColor:"",endColor:""},listFrame:{startColor:"#4AC1FF",endColor:"#1D7CFF"},moreTitle:{text:"去看看",startColor:"#FEA715",endColor:"#FE1E00"},imageUrl:"",link:{name:""}})},D=P();return Y(()=>{Z(()=>{const u=_e.create(D.value,{group:"item-wrap",animation:200,onEnd:a=>{const c=l.editComponent.list[a.oldIndex];l.editComponent.list.splice(a.oldIndex,1),l.editComponent.list.splice(a.newIndex,0,c),u.sort(xe(l.editComponent.list.length).map(U=>U.toString()))}})})}),L({}),(u,a)=>{const c=ee("ArrowRight"),U=ae,r=ne,g=ie,E=fe,k=se,T=de,I=re,K=be,m=ue,w=ce,M=pe,Q=me;return b(),C(F,null,[_(d("div",ve,[d("div",ye,[d("h3",he,p(e(n)("titleContent")),1),t(k,{"label-width":"80px",class:"px-[10px]"},{default:i(()=>[t(r,{label:e(n)("selectStyle"),class:"flex"},{default:i(()=>[d("span",{class:"text-primary flex-1 cursor-pointer",onClick:A},p(e(l).editComponent.titleStyle.title),1),t(U,null,{default:i(()=>[t(c)]),_:1})]),_:1},8,["label"]),t(r,{label:e(n)("title")},{default:i(()=>[t(g,{modelValue:e(l).editComponent.text,"onUpdate:modelValue":a[0]||(a[0]=o=>e(l).editComponent.text=o),modelModifiers:{trim:!0},placeholder:e(n)("titlePlaceholder"),clearable:"",maxlength:"10","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(r,{label:e(n)("link")},{default:i(()=>[t(E,{modelValue:e(l).editComponent.textLink,"onUpdate:modelValue":a[1]||(a[1]=o=>e(l).editComponent.textLink=o)},null,8,["modelValue"])]),_:1},8,["label"]),t(r,{label:e(n)("subTitle")},{default:i(()=>[t(g,{modelValue:e(l).editComponent.subTitle.text,"onUpdate:modelValue":a[2]||(a[2]=o=>e(l).editComponent.subTitle.text=o),modelModifiers:{trim:!0},placeholder:e(n)("subTitlePlaceholder"),clearable:"",maxlength:"8","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(r,{label:e(n)("link")},{default:i(()=>[t(E,{modelValue:e(l).editComponent.subTitle.link,"onUpdate:modelValue":a[3]||(a[3]=o=>e(l).editComponent.subTitle.link=o)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),t(I,{modelValue:y.value,"onUpdate:modelValue":a[5]||(a[5]=o=>y.value=o),title:e(n)("selectStyle"),width:"500px"},{footer:i(()=>[d("span",Te,[t(T,{onClick:a[4]||(a[4]=o=>y.value=!1)},{default:i(()=>[v(p(e(n)("cancel")),1)]),_:1}),t(T,{type:"primary",onClick:j},{default:i(()=>[v(p(e(n)("confirm")),1)]),_:1})])]),default:i(()=>[d("div",Ve,[(b(!0),C(F,null,z(N,(o,S)=>(b(),C("div",{key:S,class:R([{"border-primary":f.value==o.value},"flex items-center justify-center overflow-hidden w-[200px] h-[100px] mr-[12px] mb-[12px] cursor-pointer border bg-[#eee]"]),onClick:s=>O(o)},[d("img",{src:e($)(o.url)},null,8,ke)],10,ge))),128))])]),_:1},8,["modelValue","title"])]),d("div",we,[d("h3",Se,p(e(n)("activeCubeBlockContent")),1),t(k,{"label-width":"90px",class:"px-[10px]"},{default:i(()=>[t(r,{label:e(n)("selectStyle"),class:"flex"},{default:i(()=>[d("span",{class:"text-primary flex-1 cursor-pointer",onClick:W},p(e(l).editComponent.blockStyle.title),1),t(U,null,{default:i(()=>[t(c)]),_:1})]),_:1},8,["label"]),t(I,{modelValue:h.value,"onUpdate:modelValue":a[7]||(a[7]=o=>h.value=o),title:e(n)("selectStyle"),width:"600px"},{footer:i(()=>[d("span",Ee,[t(T,{onClick:a[6]||(a[6]=o=>h.value=!1)},{default:i(()=>[v(p(e(n)("cancel")),1)]),_:1}),t(T,{type:"primary",onClick:J},{default:i(()=>[v(p(e(n)("confirm")),1)]),_:1})])]),default:i(()=>[d("div",Ue,[(b(!0),C(F,null,z(G,(o,S)=>(b(),C("div",{key:S,class:R([{"border-primary":V.value==o.value},"flex items-center justify-center overflow-hidden w-[250px] h-[150px] mr-[12px] mb-[12px] cursor-pointer border bg-[#eee]"]),onClick:s=>H(o)},[d("img",{src:e($)(o.url)},null,8,Fe)],10,Be))),128))])]),_:1},8,["modelValue","title"]),d("p",Pe,p(e(n)("dragMouseAdjustOrder")),1),d("div",{ref_key:"blockBoxRef",ref:D},[(b(!0),C(F,null,z(e(l).editComponent.list,(o,S)=>(b(),C("div",{key:o.id,class:"item-wrap p-[10px] pb-0 relative border border-dashed border-gray-300 mb-[16px]"},[t(r,{label:e(n)("image")},{default:i(()=>[t(K,{modelValue:o.imageUrl,"onUpdate:modelValue":s=>o.imageUrl=s,limit:1},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label"]),t(r,{label:e(n)("activeCubeTitle")},{default:i(()=>[t(g,{modelValue:o.title.text,"onUpdate:modelValue":s=>o.title.text=s,modelModifiers:{trim:!0},placeholder:e(n)("activeCubeTitlePlaceholder"),clearable:"",maxlength:"4","show-word-limit":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["label"]),_(t(r,{label:e(n)("activeCubeSubTitleTextColor")},{default:i(()=>[t(m,{modelValue:o.title.textColor,"onUpdate:modelValue":s=>o.title.textColor=s,"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","onUpdate:modelValue","predefine"])]),_:2},1032,["label"]),[[x,e(l).editComponent.blockStyle.value=="style-3"]]),e(l).editComponent.blockStyle.value!="style-3"?(b(),le(r,{key:0,label:e(n)("activeCubeSubTitle")},{default:i(()=>[t(g,{modelValue:o.subTitle.text,"onUpdate:modelValue":s=>o.subTitle.text=s,modelModifiers:{trim:!0},placeholder:e(n)("activeCubeSubTitlePlaceholder"),clearable:"",maxlength:e(l).editComponent.blockStyle.value!="style-4"?"6":"4","show-word-limit":""},null,8,["modelValue","onUpdate:modelValue","placeholder","maxlength"])]),_:2},1032,["label"])):te("",!0),_(d("div",null,[t(r,{label:e(n)("activeCubeSubTitleTextColor")},{default:i(()=>[t(m,{modelValue:o.subTitle.textColor,"onUpdate:modelValue":s=>o.subTitle.textColor=s,"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","onUpdate:modelValue","predefine"])]),_:2},1032,["label"]),t(r,{label:e(n)("activeCubeSubTitleBgColor")},{default:i(()=>[t(m,{modelValue:o.subTitle.startColor,"onUpdate:modelValue":s=>o.subTitle.startColor=s,"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","onUpdate:modelValue","predefine"]),t(w,{name:"iconfont iconmap-connect",size:"20px",class:"block !text-gray-400 mx-[5px]"}),t(m,{modelValue:o.subTitle.endColor,"onUpdate:modelValue":s=>o.subTitle.endColor=s,"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","onUpdate:modelValue","predefine"])]),_:2},1032,["label"]),t(r,{label:e(n)("activeListFrameColor")},{default:i(()=>[t(m,{modelValue:o.listFrame.startColor,"onUpdate:modelValue":s=>o.listFrame.startColor=s,"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","onUpdate:modelValue","predefine"]),t(w,{name:"iconfont iconmap-connect",size:"20px",class:"block !text-gray-400 mx-[5px]"}),t(m,{modelValue:o.listFrame.endColor,"onUpdate:modelValue":s=>o.listFrame.endColor=s,"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","onUpdate:modelValue","predefine"])]),_:2},1032,["label"])],512),[[x,e(l).editComponent.blockStyle.value=="style-4"]]),_(d("div",null,[t(r,{label:e(n)("activeCubeButton")},{default:i(()=>[t(g,{modelValue:o.moreTitle.text,"onUpdate:modelValue":s=>o.moreTitle.text=s,modelModifiers:{trim:!0},placeholder:e(n)("activeCubeButtonPlaceholder"),clearable:"",maxlength:"3","show-word-limit":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["label"]),t(r,{label:e(n)("activeCubeButtonColor")},{default:i(()=>[t(m,{modelValue:o.moreTitle.startColor,"onUpdate:modelValue":s=>o.moreTitle.startColor=s,"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","onUpdate:modelValue","predefine"]),t(w,{name:"iconfont iconmap-connect",size:"20px",class:"block !text-gray-400 mx-[5px]"}),t(m,{modelValue:o.moreTitle.endColor,"onUpdate:modelValue":s=>o.moreTitle.endColor=s,"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","onUpdate:modelValue","predefine"])]),_:2},1032,["label"])],512),[[x,e(l).editComponent.blockStyle.value!="style-4"&&e(l).editComponent.blockStyle.value!="style-3"]]),t(r,{label:e(n)("link")},{default:i(()=>[t(E,{modelValue:o.link,"onUpdate:modelValue":s=>o.link=s},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label"]),_(d("div",{class:"del absolute cursor-pointer z-[2] top-[-8px] right-[-8px]",onClick:s=>e(l).editComponent.list.splice(S,1)},[t(w,{name:"element CircleCloseFilled",color:"#bbb",size:"20px"})],8,ze),[[x,e(l).editComponent.list.length>1]])]))),128))],512),_(t(T,{class:"w-full",onClick:q},{default:i(()=>[v(p(e(n)("activeCubeAddItem")),1)]),_:1},512),[[x,e(l).editComponent.list.length<10]])]),_:1})])],512),[[x,e(l).editTab=="content"]]),_(d("div",De,[d("div",Ie,[d("h3",Me,p(e(n)("titleStyle")),1),t(k,{"label-width":"90px",class:"px-[10px]"},{default:i(()=>[t(r,{label:e(n)("textColor")},{default:i(()=>[t(m,{modelValue:e(l).editComponent.titleColor,"onUpdate:modelValue":a[8]||(a[8]=o=>e(l).editComponent.titleColor=o),"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"])]),_:1})]),d("div",Re,[d("h3",$e,p(e(n)("subTitleStyle")),1),t(k,{"label-width":"90px",class:"px-[10px]"},{default:i(()=>[t(r,{label:e(n)("textColor")},{default:i(()=>[t(m,{modelValue:e(l).editComponent.subTitle.textColor,"onUpdate:modelValue":a[9]||(a[9]=o=>e(l).editComponent.subTitle.textColor=o),"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),t(r,{label:e(n)("subTextBgColor")},{default:i(()=>[t(m,{modelValue:e(l).editComponent.subTitle.startColor,"onUpdate:modelValue":a[10]||(a[10]=o=>e(l).editComponent.subTitle.startColor=o),"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","predefine"]),t(w,{name:"iconfont iconmap-connect",size:"20px",class:"block !text-gray-400 mx-[5px]"}),t(m,{modelValue:e(l).editComponent.subTitle.endColor,"onUpdate:modelValue":a[11]||(a[11]=o=>e(l).editComponent.subTitle.endColor=o),"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"])]),_:1})]),d("div",Le,[d("h3",Ae,p(e(n)("activeCubeBlockStyle")),1),t(k,{"label-width":"80px",class:"px-[10px]"},{default:i(()=>[t(r,{label:e(n)("activeCubeBlockTextFontWeight")},{default:i(()=>[t(Q,{modelValue:e(l).editComponent.blockStyle.fontWeight,"onUpdate:modelValue":a[12]||(a[12]=o=>e(l).editComponent.blockStyle.fontWeight=o)},{default:i(()=>[t(M,{label:"normal"},{default:i(()=>[v(p(e(n)("fontWeightNormal")),1)]),_:1}),t(M,{label:"bold"},{default:i(()=>[v(p(e(n)("fontWeightBold")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1})]),oe(u.$slots,"style")],512),[[x,e(l).editTab=="style"]])],64)}}}),al=Object.freeze(Object.defineProperty({__proto__:null,default:Ne},Symbol.toStringTag,{value:"Module"}));export{al as _};