mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-01-04 20:31:10 +00:00
2 lines
7.6 KiB
JavaScript
2 lines
7.6 KiB
JavaScript
import{g as W,a4 as F,r as P,w as L,m as c,n as y,q as s,I as E,J as I,v as M,L as m,a1 as _,u as n,F as i,E as p,K as f,T as N,D as U}from"./base-d2ce4248.js";import{E as X}from"./el-overlay-7451f13b.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index-057b5f2c.js";import"./el-tooltip-58212670.js";/* empty css */import{v}from"./event-f83e96f5.js";import{t as r}from"./index-578c83eb.js";import{d as Y,a as q}from"./storage-e62e496d.js";import{a as Z}from"./vue-router-d3dc2686.js";import{b as ee,c as te,d as le}from"./diy-5772e48d.js";import{a as S}from"./index-3118dac6.js";import{E as ae}from"./index-9997ff5d.js";import{E as oe}from"./index-953c712f.js";import{a as se,E as ie}from"./index-f579a83b.js";import{a as pe,E as re}from"./index-83fe4dc1.js";import{_ as ne}from"./_plugin-vue_export-helper-c27b6911.js";import"./index-28969730.js";import"./focus-trap-b41dd321.js";import"./el-radio-b620ac73.js";import"./index-758a5fe7.js";import"./index-92c8bc76.js";import"./el-avatar-4397f45a.js";import"./common-dd6d00bb.js";import"./common-2cf17469.js";import"./_Uint8Array-6ca580e8.js";import"./_initCloneObject-5fe9c070.js";import"./index-0ba64799.js";import"./strings-986fee93.js";import"./isEqual-51ec1a47.js";const me={class:"flex flex-wrap"},de={class:"absolute top-[46px] left-[50%] translate-x-[-50%] text-[14px] truncate w-[130px] text-center"},ue={class:"w-[282px] h-[500px] mx-auto"},ce=["src","onLoad"],fe={class:"w-[282px] h-[500px] mx-auto bg-body pt-[20px] px-[20px]"},_e={class:"font-bold text-xl mb-[40px]"},ve={class:"mb-[20px] flex flex-col"},xe={class:"mb-[10px]"},ge={class:"overflow-hidden w-[282px] h-[500px] mx-auto"},we=["src"],ye={class:"text-[12px] text-[#999] mt-[10px] mx-auto truncate text-center w-[250px]"},be={class:"item-btn-box absolute top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] flex flex-col flex-wrap"},he={class:"text-primary px-[5px]"},De={class:"mt-[10px]"},Ve={class:"dialog-footer"},Pe=W({__name:"index",setup(Ee){const l=F({}),b=P(!1),C=Z(),u=P("template"),h=P(""),a=F({type:"",mode:"",template:"",id:""}),$=()=>{a.type="",a.mode="",a.template="",a.id="",ee({}).then(t=>{for(let e in t.data)l[e]=t.data[e];for(let e in l)l[e].use_template.url&&(l[e].loadingIframe=!1,l[e].loadingDev=!1,l[e].isDisabledPop=!1,h.value=l[e].domain_url.wap_domain,l[e].wapUrl=l[e].domain_url.wap_url,B(e),l[e].timeFrame=new Date().getTime())})};$();const O=t=>{if(!q.get("wap_domain")&&l[t].use_template.wapPreview){var e=new Date().getTime(),d=e-l[t].timeFrame;d<1e3?(l[t].loadingDev=!0,l[t].isDisabledPop=!0,l[t].loadingIframe=!1):(l[t].loadingDev=!1,l[t].isDisabledPop=!1,l[t].loadingIframe=!0)}},R=()=>{let t=h.value+"/wap";q.set({key:"wap_domain",data:t});for(let e in l)l[e].use_template.url&&(l[e].wapUrl=t,B(e));setTimeout(()=>{for(let e in l)l[e].use_template.url&&(l[e].loadingIframe=!0,l[e].loadingDev=!1,l[e].isDisabledPop=!1)},100*3)},B=t=>{l[t].use_template.wapPreview=l[t].wapUrl+l[t].use_template.url},j=(t,e)=>{b.value=!0,u.value=e.use_template.hope,a.type=t,a.mode=e.use_template.mode,u.value=="template"?a.template=e.use_template.template:u.value=="diy"&&(a.id=e.use_template.id)},z=t=>{let e={back:"/diy/index"};t.id?e.id=t.id:t.name&&(e.name=t.name);let d=C.resolve({path:"/decorate/edit",query:e});window.open(d.href)},A=t=>{let e={};t.id?e.id=t.id:t.name&&(e.name=t.name);let d=C.resolve({path:"/decorate/preview",query:e});window.open(d.href)},J=t=>{let e=C.resolve({path:"/site/diy/list"});window.open(e.href)},K=()=>{te({type:a.type,mode:"diy"}).then(t=>{let e=!0;for(let d=0;d<t.data.length;d++)if(a.id==t.data[d].id){e=!1;break}e&&(a.id=""),l[a.type].my_page={},Object.assign(l[a.type].my_page,t.data)})};L(()=>u.value,(t,e)=>{t=="template"?a.id="":t=="diy"&&(a.mode="diy",a.template="")}),L(()=>a.template,(t,e)=>{t&&(a.mode=l[a.type].template[t].mode)});const T=P(!1),G=()=>{if(u.value=="template"){if(a.template==""){S({type:"warning",message:`${r("placeholderTemplate")}`});return}}else if(u.value=="diy"&&a.id==""){S({type:"warning",message:`${r("placeholderMyPage")}`});return}T.value||(T.value=!0,le({...a}).then(t=>{T.value=!1,b.value=!1,$()}))};return(t,e)=>{const d=ae,x=oe,D=se,V=pe,k=re,H=ie,Q=X;return c(),y(E,null,[s("div",me,[(c(!0),y(E,null,I(l,(o,g)=>(c(),y("div",{class:M(["page-item relative bg-no-repeat mr-[40px] mt-[20px] bg-[#f7f7f7] w-[300px] pt-[80px] pb-[20px]",{"cursor-pointer":!o.isDisabledPop}]),key:g},[s("p",de,m(o.use_template.title),1),_(s("div",ue,[_(s("iframe",{class:"w-[282px] h-[500px] mx-auto",src:o.use_template.wapPreview,frameborder:"0",onLoad:w=>O(g)},null,40,ce),[[v,o.loadingIframe]]),_(s("div",fe,[s("div",_e,m(n(r)("developTitle")),1),s("div",ve,[s("text",xe,m(n(r)("wapDomain")),1),i(d,{modelValue:h.value,"onUpdate:modelValue":e[0]||(e[0]=w=>h.value=w),placeholder:n(r)("wapDomainPlaceholder"),clearable:""},null,8,["modelValue","placeholder"])]),i(x,{type:"primary",onClick:e[1]||(e[1]=w=>R())},{default:p(()=>[f(m(n(r)("confirm")),1)]),_:1})],512),[[v,o.loadingDev]])],512),[[v,o.use_template.url]]),_(s("div",ge,[o.use_template.cover?(c(),y("img",{key:0,class:"max-w-full",src:n(Y)(o.use_template.cover)},null,8,we)):N("",!0)],512),[[v,!o.use_template.wapPreview]]),s("p",ye,m(o.use_template.desc),1),s("div",{class:M(["item-hide absolute inset-x-0 inset-y-0 bg-black bg-opacity-50 text-center rounded-[40px]",{disabled:o.isDisabledPop}])},[s("div",be,[i(x,{onClick:w=>j(g,o)},{default:p(()=>[f("切换")]),_:2},1032,["onClick"]),_(i(x,{onClick:w=>z(o.use_template)},{default:p(()=>[f("装修 ")]),_:2},1032,["onClick"]),[[v,o.use_template.mode=="diy"]]),i(x,{onClick:w=>A(o.use_template)},{default:p(()=>[f("预览")]),_:2},1032,["onClick"])])],2)],2))),128))]),i(Q,{modelValue:b.value,"onUpdate:modelValue":e[6]||(e[6]=o=>b.value=o),title:n(r)("changeTemplate"),width:"400px","close-on-press-escape":!1,"destroy-on-close":!0,"close-on-click-modal":!1},{footer:p(()=>[s("span",Ve,[i(x,{onClick:e[5]||(e[5]=o=>b.value=!1)},{default:p(()=>[f(m(n(r)("cancel")),1)]),_:1}),i(x,{type:"primary",onClick:G},{default:p(()=>[f(m(n(r)("confirm")),1)]),_:1})])]),default:p(()=>[a.type?(c(),U(H,{key:0,model:t.form,"label-width":"0px"},{default:p(()=>[i(D,{label:""},{default:p(()=>[s("div",null,[f(m(n(r)("hopeBeforeTip")),1),s("span",he,m(l[a.type].title),1),f(m(n(r)("hopeAfterTip")),1)])]),_:1}),i(D,{label:""},{default:p(()=>[i(k,{modelValue:u.value,"onUpdate:modelValue":e[2]||(e[2]=o=>u.value=o),class:"w-full"},{default:p(()=>[i(V,{label:n(r)("changeTemplateTip")+" "+l[a.type].title+" "+n(r)("template"),value:"template"},null,8,["label"]),i(V,{label:n(r)("changeMyPageTip")+" "+l[a.type].title,value:"diy"},null,8,["label"])]),_:1},8,["modelValue"])]),_:1}),_(i(D,{label:""},{default:p(()=>[i(k,{modelValue:a.template,"onUpdate:modelValue":e[3]||(e[3]=o=>a.template=o),class:"w-full"},{default:p(()=>[(c(!0),y(E,null,I(l[a.type].template,(o,g)=>(c(),U(V,{label:o.title,value:g},null,8,["label","value"]))),256))]),_:1},8,["modelValue"])]),_:1},512),[[v,u.value=="template"]]),_(i(D,{label:""},{default:p(()=>[i(k,{modelValue:a.id,"onUpdate:modelValue":e[4]||(e[4]=o=>a.id=o),class:"w-full"},{default:p(()=>[(c(!0),y(E,null,I(l[a.type].my_page,(o,g)=>(c(),U(V,{label:o.title,value:o.id},null,8,["label","value"]))),256))]),_:1},8,["modelValue"]),s("div",De,[s("span",{class:"cursor-pointer text-primary mr-[10px]",onClick:J},m(n(r)("createPage")),1),s("span",{class:"cursor-pointer text-primary",onClick:K},m(n(r)("refreshPage")),1)])]),_:1},512),[[v,u.value=="diy"]])]),_:1},8,["model"])):N("",!0)]),_:1},8,["modelValue","title"])],64)}}});const pt=ne(Pe,[["__scopeId","data-v-03de5c28"]]);export{pt as default};
|