2 lines
8.5 KiB
JavaScript
2 lines
8.5 KiB
JavaScript
import{d as K,r as y,n as I,v as Q,D as Z,a1 as S,h as u,c as f,y as P,I as B,w as s,a as r,x as N,F as D,G as T,u as n,R as ee,e as l,B as H,t as d,N as a,i as _,z as te,af as R,a2 as le,V as oe,X as ae,W as se,E as ne,aD as re,az as ie,aA as de,cE as me,aE as pe,Y as ce,$ as ue,a0 as _e,_ as xe}from"./index-4dcc0234.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{_ as fe}from"./index.vue_vue_type_script_setup_true_lang-a631d3b2.js";import"./el-form-item-4ed993c7.js";import{_ as ve}from"./index-742b412a.js";/* empty css *//* empty css *//* empty css */import{p as be,s as ge}from"./diy-aa30030c.js";import{S as ye}from"./sortable.esm-be94e56d.js";/* empty css */import{r as Ve}from"./range-72f9cbd3.js";/* empty css *//* empty css */import"./index.vue_vue_type_style_index_0_lang-5c6c00d9.js";import"./attachment-c69dd9fd.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_script_setup_true_lang-9285296e.js";import"./sys-8ead7f22.js";const Ce={class:"main-container"},he={class:"flex"},ke={class:"w-[360px] h-[400px] absolute mr-[30px] border-[1px] border-gray-300"},we={class:"image-slot flex justify-center items-center mt-1"},Ee={class:"flex-1 ml-[430px]"},Fe={class:"flex items-center border-l-[3px] border-primary pl-[5px] leading-[1.1] mt-[10px]"},Ue={class:"text-[14px]"},$e={class:"text-[12px] ml-[8px] text-gray-500"},Ie=["data-id"],Se={class:"flex align-center"},Pe={class:"flex flex-col justify-center items-center"},Be={class:"mr-[10px] text-sm"},Ne={class:"flex flex-col justify-center items-center"},De={class:"mr-[10px] text-sm"},Te={class:"flex align-center"},He={class:"flex align-center"},Re={class:"flex align-center"},je={class:"fixed-footer-wrap"},ze={class:"fixed-footer"},Le=K({__name:"tabbar",setup(Oe){const k=y("navPicture"),p=y(!1),t=I({backgroundColor:"#FFFFFF",textColor:"#333333",textHoverColor:"#333333",type:"1",list:[]}),j=I({text:"",link:{name:"",title:"",parent:"",url:""},iconSelectPath:"",iconPath:""}),w=()=>{t.list.length>=5||t.list.push({...j})};w();const z=i=>{t.list.splice(i,1)},E=y();((i=1)=>{p.value=!0,be({}).then(e=>{p.value=!1,Object.keys(t).forEach((m,v)=>{t[m]=e.data[m]})}).catch(()=>{p.value=!1})})();const L=async i=>{if(O())return!1;p.value||!i||await i.validate(async e=>{e&&(p.value=!0,ge({menu:t}).then(m=>{p.value=!1}).catch(()=>{p.value=!1}))})},O=()=>{if(t.list.length<2)return R({type:"error",message:a("leastTwoNav")}),!0;try{const i=y("");t.list.forEach((e,m)=>{if(e.iconPath||(i.value=`${a("pleaseUpload")}${m+1}${a("navIcon")}`),e.iconSelectPath||(i.value=`${a("pleaseUpload")}${m+1}${a("navSelectIcon")}`),e.text||(i.value=`${a("pleaseEnter")}[${m+1}${a("navTitle")}`),e.link.url||(i.value=`${a("pleaseChoose")}${m+1}${a("navLink")}`),i.value)throw R({type:"error",message:i.value}),Error()})}catch{return!0}return!1},F=y();return Q(()=>{const i=ye.create(F.value,{group:"item-wrap",animation:200,onEnd:e=>{const m=t.list[e.oldIndex];t.list.splice(e.oldIndex,1),t.list.splice(e.newIndex,0,m),Z(()=>{i.sort(Ve(t.list.length).map(v=>v.toString()))})}})}),(i,e)=>{const m=S("Picture"),v=le,G=oe,U=ve,x=ae,V=se,A=fe,M=S("CircleCloseFilled"),b=ne,$=re,C=ie,W=de,h=me,X=pe,Y=ce,q=ue,J=_e;return u(),f("div",Ce,[P((u(),B(q,{class:"box-card !border-none",shadow:"never"},{default:s(()=>[r("div",he,[r("div",ke,[r("div",{class:"flex items-center justify-between absolute h-[60px] left-[0px] right-[0px] bottom-[0px] bg-white border-[1px] border-primary",style:N({backgroundColor:t.backgroundColor})},[(u(!0),f(D,null,T(t.list,(o,g)=>(u(),f("div",{class:"flex flex-1 flex-col items-center justify-center",key:"b"+g},[["1","2"].includes(t.type.toString())?(u(),B(G,{key:0,class:"w-[22px] h-[22px] mb-[5px] leading-1",src:n(ee)(o.iconPath),fit:i.contain},{error:s(()=>[r("div",we,[l(v,null,{default:s(()=>[l(m,{class:"text-3xl text-gray-500"})]),_:1})])]),_:2},1032,["src","fit"])):H("",!0),["1","3"].includes(t.type.toString())?(u(),f("span",{key:1,class:"text-[12px]",style:N({color:t.textColor})},d(o.text),5)):H("",!0)]))),128))],4)]),r("div",Ee,[r("div",Fe,[r("span",Ue,d(n(a)("bottomNav")),1),r("span",$e,d(n(a)("bottomNavHint")),1)]),l(Y,{model:t,"label-width":"100px",ref_key:"formRef",ref:E},{default:s(()=>[l(X,{modelValue:k.value,"onUpdate:modelValue":e[10]||(e[10]=o=>k.value=o),class:"demo-tabs mt-[15px]"},{default:s(()=>[l($,{label:n(a)("navImage"),name:"navPicture"},{default:s(()=>[r("div",{ref_key:"navItemRef",ref:F},[(u(!0),f(D,null,T(t.list,(o,g)=>(u(),f("div",{key:"a"+g,"data-id":g,class:"item-wrap !cursor-move border-2 border-dashed pt-[18px] m-[10px] mb-[15px] relative list-item"},[l(x,{label:n(a)("navIconOne")},{default:s(()=>[r("div",Se,[r("div",Pe,[l(U,{modelValue:o.iconPath,"onUpdate:modelValue":c=>o.iconPath=c,width:"60px",height:"60px",limit:1},null,8,["modelValue","onUpdate:modelValue"]),r("span",Be,d(n(a)("uploadImgUnselected")),1)]),r("div",Ne,[l(U,{modelValue:o.iconSelectPath,"onUpdate:modelValue":c=>o.iconSelectPath=c,width:"60px",height:"60px",limit:1},null,8,["modelValue","onUpdate:modelValue"]),r("span",De,d(n(a)("uploadImgSelected")),1)])])]),_:2},1032,["label"]),l(x,{label:n(a)("navTitleOne")},{default:s(()=>[l(V,{class:"w-[215px]",modelValue:o.text,"onUpdate:modelValue":c=>o.text=c,placeholder:n(a)("titleContent"),maxlength:"5","show-word-limit":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["label"]),l(x,{label:n(a)("navLinkOne")},{default:s(()=>[l(A,{modelValue:o.link,"onUpdate:modelValue":c=>o.link=c},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label"]),l(v,{class:"close-icon cursor-pointer -top-[11px] -right-[8px]",onClick:c=>z(g)},{default:s(()=>[l(M)]),_:2},1032,["onClick"])],8,Ie))),128))],512),P(l(b,{type:"primary",class:"mt-[15px]",onClick:w},{default:s(()=>[_(d(n(a)("addnav")),1)]),_:1},512),[[te,t.list.length<5]])]),_:1},8,["label"]),l($,{label:n(a)("styleSet"),name:"setStyle"},{default:s(()=>[l(x,{label:n(a)("navType")},{default:s(()=>[l(W,{modelValue:t.type,"onUpdate:modelValue":e[0]||(e[0]=o=>t.type=o),class:"ml-4"},{default:s(()=>[l(C,{label:"1",size:"large"},{default:s(()=>[_(d(n(a)("imageText")),1)]),_:1}),l(C,{label:"2",size:"large"},{default:s(()=>[_(d(n(a)("image")),1)]),_:1}),l(C,{label:"3",size:"large"},{default:s(()=>[_(d(n(a)("text")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),l(x,{label:n(a)("textColor")},{default:s(()=>[r("div",Te,[l(h,{modelValue:t.textColor,"onUpdate:modelValue":e[1]||(e[1]=o=>t.textColor=o)},null,8,["modelValue"]),l(V,{class:"ml-[10px]",modelValue:t.textColor,"onUpdate:modelValue":e[2]||(e[2]=o=>t.textColor=o),disabled:""},null,8,["modelValue"]),l(b,{class:"ml-[10px]",type:"primary",onClick:e[3]||(e[3]=o=>t.textColor="#333333")},{default:s(()=>[_(d(n(a)("reset")),1)]),_:1})])]),_:1},8,["label"]),l(x,{label:n(a)("textSelectColor")},{default:s(()=>[r("div",He,[l(h,{modelValue:t.textHoverColor,"onUpdate:modelValue":e[4]||(e[4]=o=>t.textHoverColor=o)},null,8,["modelValue"]),l(V,{class:"ml-[10px]",modelValue:t.textHoverColor,"onUpdate:modelValue":e[5]||(e[5]=o=>t.textHoverColor=o),disabled:""},null,8,["modelValue"]),l(b,{class:"ml-[10px]",type:"primary",onClick:e[6]||(e[6]=o=>t.textHoverColor="#333333")},{default:s(()=>[_(d(n(a)("reset")),1)]),_:1})])]),_:1},8,["label"]),l(x,{label:n(a)("backgroundColor")},{default:s(()=>[r("div",Re,[l(h,{modelValue:t.backgroundColor,"onUpdate:modelValue":e[7]||(e[7]=o=>t.backgroundColor=o)},null,8,["modelValue"]),l(V,{class:"ml-[10px]",modelValue:t.backgroundColor,"onUpdate:modelValue":e[8]||(e[8]=o=>t.backgroundColor=o),disabled:""},null,8,["modelValue"]),l(b,{class:"ml-[10px]",type:"primary",onClick:e[9]||(e[9]=o=>t.backgroundColor="#FFFFFF")},{default:s(()=>[_(d(n(a)("reset")),1)]),_:1})])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["model"])])])]),_:1})),[[J,p.value]]),r("div",je,[r("div",ze,[l(b,{type:"primary",onClick:e[11]||(e[11]=o=>L(E.value))},{default:s(()=>[_(d(n(a)("save")),1)]),_:1})])])])}}});const Ft=xe(Le,[["__scopeId","data-v-9b744207"]]);export{Ft as default};
|