2 lines
9.2 KiB
JavaScript
2 lines
9.2 KiB
JavaScript
|
import{d as se,f as pe,O as de,n as C,q as F,N as a,r as y,h as _,c as T,e as t,w as r,a as b,t as d,u as o,i as m,F as N,G as S,I as h,y as J,B as Y,z as ue,a8 as me,E as ce,W as fe,X as ge,as as _e,aF as ye,Y as ve,$ as be,ah as he,aj as we,at as Ve,aa as Pe,aD as ke,aE as xe,a0 as De}from"./index-4dcc0234.js";/* empty css */import{_ as Ce}from"./index-742b412a.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css */import{f as Te,h as Ee,j as $e,k as Ue}from"./diy-aa30030c.js";import{p as Fe}from"./sys-8ead7f22.js";/* 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 */import"./index.vue_vue_type_script_setup_true_lang-9285296e.js";/* empty css */const Ne={class:"main-container"},Se={class:"flex justify-between items-center"},Re={class:"text-[20px]"},Be={class:"mt-[16px] flex justify-end"},ze={class:"dialog-footer"},Ie={class:"dialog-footer"},hl=se({__name:"list",setup(je){const E=pe(),A=de().meta.title,k=C({}),s=C({title:"",type:"",template:""}),M=F(()=>({title:[{required:!0,message:a("titlePlaceholder"),trigger:"blur"}],type:[{required:!0,message:a("pageTypePlaceholder"),trigger:"blur"}]})),R=F(()=>{let n="";return s.template="",s.type&&(n=k[s.type].template),n}),B=y(),w=y(!1),W=async n=>{n&&await n.validate(async e=>{if(e){w.value=!1;let p=`/decorate/edit?type=${s.type}&title=${s.title}`;s.template&&(p+=`&template=${s.template}`),E.push(p)}})},X=y("");(async()=>{X.value=(await Fe()).data.wap_url})(),Te({mode:""}).then(n=>{for(const e in n.data)k[e]=n.data[e]});const i=C({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{title:"",type:"",mode:""}}),z=y(),v=(n=1)=>{i.loading=!0,i.page=n,Ee({page:i.page,limit:i.limit,...i.searchParam}).then(e=>{i.loading=!1,i.data=e.data.data,i.total=e.data.total}).catch(()=>{i.loading=!1})};v();const H=n=>{const e=E.resolve({path:"/decorate/edit",query:{id:n.id}});window.open(e.href)},K=n=>{me.confirm(a("diyPageDeleteTips"),a("warning"),{confirmButtonText:a("confirm"),cancelButtonText:a("cancel"),type:"warning"}).then(()=>{$e(n).then(()=>{v()}).catch(()=>{})})},Q=n=>{const e=E.resolve({path:"/preview/wap",query:{page:n.type_page+"?id="+n.id}});window.open(e.href)},c=y("wechat"),I=y(""),j=y(0),f=C({wechat:{title:"",desc:"",url:""},weapp:{title:"",url:""}}),V=y(!1),Z=F(()=>({})),q=y(),ee=async n=>{j.value=n.id,I.value=n.title;const e=n.share?JSON.parse(n.share):{wechat:{title:"",desc:"",url:""},weapp:{title:"",url:""}};e&&(f.wechat=e.wechat,f.weapp=e.weapp),V.value=!0},le=async n=>{n&&await n.validate(async e=>{e&&Ue({id:j.value,share:JSON.stringify(f)}).then(()=>{v(),V.value=!1}).catch(()=>{})})},te=n=>{n&&(n.resetFields(),v())};return(n,e)=>{const p=ce,x=fe,g=ge,P=_e,$=ye,U=ve,L=be,D=he,ae=we,oe=Ve,O=Pe,G=ke,re=xe,ne=Ce,ie=De;return _(),T("div",Ne,[t(L,{class:"box-card !border-none",shadow:"never"},{default:r(()=>[b("div",Se,[b("span",Re,d(o(A)),1),t(p,{type:"primary",class:"w-[100px]",onClick:e[0]||(e[0]=l=>w.value=!0)},{default:r(()=>[m(d(o(a)("addDiyPage")),1)]),_:1})]),t(L,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:r(()=>[t(U,{inline:!0,model:i.searchParam,ref_key:"searchFormDiyPageRef",ref:z},{default:r(()=>[t(g,{label:o(a)("title"),prop:"title"},{default:r(()=>[t(x,{modelValue:i.searchParam.title,"onUpdate:modelValue":e[1]||(e[1]=l=>i.searchParam.title=l),placeholde
|