import{d as K,n as V,f as Q,O as Z,r as c,aL as ee,s as ae,a4 as $,N as o,q as te,h as k,c as le,e as l,w as n,a as h,t as r,u as s,i as f,y as oe,I as D,B as z,W as se,X as ne,E as ie,Y as re,$ as pe,ah as me,aj as de,at as ue,aD as ce,aE as _e,aa as he,a0 as fe}from"./index-4dcc0234.js";/* empty css *//* empty css */import{_ as ge}from"./index-742b412a.js";/* 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 *//* empty css */import"./el-form-item-4ed993c7.js";import{f as ve,m as ye,n as be,o as we}from"./diy-aa30030c.js";import{p as Ve}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 ke={class:"main-container"},xe={class:"flex justify-between items-center"},De={class:"text-[20px]"},Ce={class:"mr-[10px]"},Ee={class:"mr-[10px]"},Re={class:"mt-[16px] flex justify-end"},Se={class:"dialog-footer"},da=K({__name:"route",setup(Pe){const B=V({});Q();const I=Z().meta.title;c(),c(!1);const i=V({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{title:""}}),x=c("");(async()=>{x.value=(await Ve()).data.wap_url})();const g=(a=1)=>{i.loading=!0,i.page=a,ye({page:i.page,limit:i.limit,...i.searchParam}).then(e=>{i.loading=!1;const d=Math.ceil(e.data.length/i.limit),_=JSON.parse(JSON.stringify(e.data)),u=[];for(let y=0;y{i.loading=!1})};g(),ve({}).then(a=>{for(const e in a.data)B[e]=a.data[e]});const C=c(),{copy:O,isSupported:j,copied:E}=ee(),R=a=>{j.value||$({message:o("notSupportCopy"),type:"warning"}),O(a)};ae(E,()=>{E.value&&$({message:o("copySuccess"),type:"success"})});const p=c("wechat"),S=c(""),P=c(0),v=V({title:"",name:"",page:"",is_share:0,sort:0}),m=V({wechat:{title:"",desc:"",url:""},weapp:{title:"",url:""}}),b=c(!1),J=te(()=>({})),U=c(),L=async a=>{const e=(await be({name:a.name})).data;e.title&&(a.id=e.id,a.title=e.title,a.name=e.name,a.page=e.page,a.is_share=e.is_share,a.sort=e.sort,a.share=e.share),v.title=a.title,v.name=a.name,v.page=a.page,v.is_share=a.is_share,v.sort=a.sort,P.value=a.id,S.value=a.title;const d=a.share?JSON.parse(a.share):{wechat:{title:"",desc:"",url:""},weapp:{title:"",url:""}};d&&(m.wechat=d.wechat,m.weapp=d.weapp),b.value=!0},M=async a=>{a&&await a.validate(async e=>{e&&we({id:P.value,share:JSON.stringify(m),...v}).then(()=>{g(),b.value=!1}).catch(()=>{})})},q=a=>{a&&(a.resetFields(),g())};return(a,e)=>{const d=se,_=ne,u=ie,y=re,F=pe,w=me,A=de,G=ue,T=ce,W=_e,X=ge,Y=he,H=fe;return k(),le("div",ke,[l(F,{class:"box-card !border-none",shadow:"never"},{default:n(()=>[h("div",xe,[h("span",De,r(s(I)),1)]),l(F,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:n(()=>[l(y,{inline:!0,model:i.searchParam,ref_key:"searchFormDiyRouteRef",ref:C},{default:n(()=>[l(_,{label:s(o)("title"),prop:"title"},{default:n(()=>[l(d,{modelValue:i.searchParam.title,"onUpdate:modelValue":e[0]||(e[0]=t=>i.searchParam.title=t),placeholder:s(o)("titlePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(_,null,{default:n(()=>[l(u,{type:"primary",onClick:e[1]||(e[1]=t=>g())},{default:n(()=>[f(r(s(o)("search")),1)]),_:1}),l(u,{onClick:e[2]||(e[2]=t=>q(C.value))},{default:n(()=>[f(r(s(o)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),oe((k(),D(A,{data:i.data,size:"large"},{empty:n(()=>[h("span",null,r(i.loading?"":s(o)("emptyData")),1)]),default:n(()=>[l(w,{prop:"title",label:s(o)("title"),"min-width":"70"},null,8,["label"]),l(w,{prop:"addon_title",label:s(o)("forAddon"),"min-width":"70"},null,8,["label"]),l(w,{prop:"page",label:s(o)("wapUrl"),"min-width":"170"},{default:n(({row:t})=>[h("span",Ce,r(x.value+t.page),1),l(u,{type:"primary",link:"",onClick:N=>R(x.value+t.page)},{default:n(()=>[f(r(s(o)("copy")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"]),l(w,{prop:"page",label:s(o)("weappUrl"),"min-width":"120"},{default:n(({row:t})=>[h("span",Ee,r(t.page),1),l(u,{type:"primary",link:"",onClick:N=>R(t.page)},{default:n(()=>[f(r(s(o)("copy")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"]),l(w,{label:s(o)("share"),fixed:"right",align:"right","min-width":"80"},{default:n(({row:t})=>[t.is_share==1?(k(),D(u,{key:0,type:"primary",link:"",onClick:N=>L(t)},{default:n(()=>[f(r(s(o)("shareSet")),1)]),_:2},1032,["onClick"])):z("",!0)]),_:1},8,["label"])]),_:1},8,["data"])),[[H,i.loading]]),h("div",Re,[l(G,{"current-page":i.page,"onUpdate:current-page":e[3]||(e[3]=t=>i.page=t),"page-size":i.limit,"onUpdate:page-size":e[4]||(e[4]=t=>i.limit=t),layout:"total, sizes, prev, pager, next, jumper",total:i.total,onSizeChange:e[5]||(e[5]=t=>g()),onCurrentChange:g},null,8,["current-page","page-size","total"])])]),_:1}),l(Y,{modelValue:b.value,"onUpdate:modelValue":e[12]||(e[12]=t=>b.value=t),title:s(o)("shareSet"),width:"30%"},{footer:n(()=>[h("span",Se,[l(u,{onClick:e[10]||(e[10]=t=>b.value=!1)},{default:n(()=>[f(r(s(o)("cancel")),1)]),_:1}),l(u,{type:"primary",onClick:e[11]||(e[11]=t=>M(U.value))},{default:n(()=>[f(r(s(o)("confirm")),1)]),_:1})])]),default:n(()=>[l(W,{modelValue:p.value,"onUpdate:modelValue":e[6]||(e[6]=t=>p.value=t)},{default:n(()=>[l(T,{label:s(o)("wechat"),name:"wechat"},null,8,["label"]),l(T,{label:s(o)("weapp"),name:"weapp"},null,8,["label"])]),_:1},8,["modelValue"]),l(y,{model:m[p.value],"label-width":"90px",ref_key:"shareFormRef",ref:U,rules:s(J)},{default:n(()=>[l(_,{label:s(o)("sharePage")},{default:n(()=>[h("span",null,r(S.value),1)]),_:1},8,["label"]),l(_,{label:s(o)("shareTitle"),prop:"title"},{default:n(()=>[l(d,{modelValue:m[p.value].title,"onUpdate:modelValue":e[7]||(e[7]=t=>m[p.value].title=t),placeholder:s(o)("shareTitlePlaceholder"),clearable:"",maxlength:"30","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),p.value=="wechat"?(k(),D(_,{key:0,label:s(o)("shareDesc"),prop:"desc"},{default:n(()=>[l(d,{modelValue:m[p.value].desc,"onUpdate:modelValue":e[8]||(e[8]=t=>m[p.value].desc=t),placeholder:s(o)("shareDescPlaceholder"),type:"textarea",rows:"4",clearable:"",maxlength:"100","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):z("",!0),l(_,{label:s(o)("shareImageUrl"),prop:"url"},{default:n(()=>[l(X,{modelValue:m[p.value].url,"onUpdate:modelValue":e[9]||(e[9]=t=>m[p.value].url=t),limit:1},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"])])}}});export{da as default};