index-04d3eeaf.js 6.7 KB

1
  1. import{az as E,d as _a,r as e,a3 as ca,o as d,c as g,f as s,A as y,a as _,k,B as v,E as ua,a1 as Y,C as j,D as G,F as na,U as ia,V as sa,J as oa,Y as ma,L as pa,M as da,__tla as ya}from"./index-6e0fa573.js";import{_ as va,__tla as ha}from"./ContentWrap.vue_vue_type_script_setup_true_lang-bed37a76.js";import{_ as fa,__tla as Ma}from"./main.vue_vue_type_script_setup_true_lang-febf3024.js";import xa,{__tla as Ua}from"./MenuEditor-176e68ea.js";import ga,{__tla as Ia}from"./MenuPreviewer-3da68b71.js";import{h as ba}from"./tree-0af4953a.js";import{u as wa,__tla as Ca}from"./useMessage-7f978edc.js";import{_ as Ta}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as Ea}from"./el-card-f999e23d.js";import{__tla as ka}from"./index-beb1acaf.js";import{__tla as Va}from"./main-6814dcb6.js";import{__tla as qa}from"./TabNews-cc75a8a3.js";import{__tla as Da}from"./main-026202e2.js";import{__tla as Sa}from"./el-image-f27c893c.js";import{__tla as Aa}from"./el-image-viewer-bd37a3c0.js";import{__tla as Ha}from"./main-eee84b21.js";import{__tla as Pa}from"./index.vue_vue_type_script_setup_true_lang-cd12277f.js";import{__tla as $a}from"./index-99c4720b.js";import{__tla as Fa}from"./main-18748f23.js";import{__tla as La}from"./main.vue_vue_type_script_setup_true_lang-185dddab.js";import{__tla as Na}from"./index-980a0d8a.js";import{__tla as Ra}from"./index-bafcb871.js";import{__tla as za}from"./formatTime-4408999b.js";import{__tla as Ba}from"./TabText.vue_vue_type_script_setup_true_lang-c5f48a01.js";import{__tla as Ja}from"./TabImage-8f05d985.js";import{__tla as Oa}from"./useUpload-ed037640.js";import{__tla as Ya}from"./TabVoice-356f5463.js";import{__tla as ja}from"./TabVideo-91379e59.js";import{__tla as Ga}from"./TabMusic.vue_vue_type_script_setup_true_lang-cce0dd5f.js";import{__tla as Ka}from"./vuedraggable.umd-eaa236f5.js";let K,Qa=Promise.all([(()=>{try{return ya}catch{}})(),(()=>{try{return ha}catch{}})(),(()=>{try{return Ma}catch{}})(),(()=>{try{return Ua}catch{}})(),(()=>{try{return Ia}catch{}})(),(()=>{try{return Ca}catch{}})(),(()=>{try{return Ea}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return qa}catch{}})(),(()=>{try{return Da}catch{}})(),(()=>{try{return Sa}catch{}})(),(()=>{try{return Aa}catch{}})(),(()=>{try{return Ha}catch{}})(),(()=>{try{return Pa}catch{}})(),(()=>{try{return $a}catch{}})(),(()=>{try{return Fa}catch{}})(),(()=>{try{return La}catch{}})(),(()=>{try{return Na}catch{}})(),(()=>{try{return Ra}catch{}})(),(()=>{try{return za}catch{}})(),(()=>{try{return Ba}catch{}})(),(()=>{try{return Ja}catch{}})(),(()=>{try{return Oa}catch{}})(),(()=>{try{return Ya}catch{}})(),(()=>{try{return ja}catch{}})(),(()=>{try{return Ga}catch{}})(),(()=>{try{return Ka}catch{}})()]).then(async()=>{let V,q,D,S,A,H,P,$,F,x;V={class:"clearfix public-account-management"},q={class:"left"},D={class:"weixin-hd"},S={class:"weixin-title"},A={class:"clearfix weixin-menu"},H={class:"save_div"},P={key:0,class:"right"},$={key:1,class:"right"},F=[(U=>(pa("data-v-c849596e"),U=U(),da(),U))(()=>v("p",null,"\u8BF7\u9009\u62E9\u83DC\u5355\u914D\u7F6E",-1))],x="__MENU_NOT_SELECTED__",K=Ta(_a({name:"MpMenu",__name:"index",setup(U){const o=wa(),c=e(!1),m=e(-1),L=e(""),u=e([]),h=e(x),I=e(-1),f=e(!1),b=e(!0),n=e({}),l=e({grand:"0",x:0,y:0}),Q=e(!1),W=(t,a)=>{m.value=t,L.value=a,w()},w=async()=>{c.value=!1;try{const t=await(r=>E.get({url:"/mp/menu/list?accountId="+r}))(m.value),a=X(t);u.value=ba(a,"id")}finally{c.value=!1}},X=t=>{if(!t)return[];const a=[];return t.forEach(r=>{const p={...r};p.reply={type:r.replyMessageType,accountId:r.accountId,content:r.replyContent,mediaId:r.replyMediaId,url:r.replyMediaUrl,title:r.replyTitle,description:r.replyDescription,thumbMediaId:r.replyThumbMediaId,thumbMediaUrl:r.replyThumbMediaUrl,articles:r.replyArticles,musicUrl:r.replyMusicUrl,hqMusicUrl:r.replyHqMusicUrl},a.push(p)}),a},Z=()=>{h.value=x,I.value=-1,f.value=!1,n.value={},l.value={grand:"0",x:0,y:0},Q.value=!1},aa=async()=>{var t;try{await o.confirm("\u786E\u5B9A\u8981\u5220\u9664\u5417?"),l.value.grand==="1"?u.value.splice(l.value.x,1):l.value.grand==="2"&&((t=u.value[l.value.x].children)==null||t.splice(l.value.y,1)),o.notifySuccess("\u5220\u9664\u6210\u529F"),n.value={},f.value=!1,h.value=x}catch{}},ta=async()=>{try{await o.confirm("\u786E\u5B9A\u8981\u4FDD\u5B58\u5417?"),c.value=!0,await((t,a)=>E.post({url:"/mp/menu/save",data:{accountId:t,menus:a}}))(m.value,la()),w(),o.notifySuccess("\u53D1\u5E03\u6210\u529F")}finally{c.value=!1}},ra=async()=>{try{await o.confirm("\u786E\u5B9A\u8981\u5220\u9664\u5417?"),c.value=!0,await(t=>E.delete({url:"/mp/menu/delete?accountId="+t}))(m.value),Z(),w(),o.notifySuccess("\u6E05\u7A7A\u6210\u529F")}finally{c.value=!1}},la=()=>{const t=[];return u.value.forEach(a=>{const r=N(a);t.push(r),!a.children||a.children.length<=0||(r.children=[],a.children.forEach(p=>{r.children.push(N(p))}))}),t},N=t=>{let a={...t,children:void 0,reply:void 0};return a.replyMessageType=t.reply.type,a.replyContent=t.reply.content,a.replyMediaId=t.reply.mediaId,a.replyMediaUrl=t.reply.url,a.replyTitle=t.reply.title,a.replyDescription=t.reply.description,a.replyThumbMediaId=t.reply.thumbMediaId,a.replyThumbMediaUrl=t.reply.thumbMediaUrl,a.replyArticles=t.reply.articles,a.replyMusicUrl=t.reply.musicUrl,a.replyHqMusicUrl=t.reply.hqMusicUrl,a};return(t,a)=>{const r=ia,p=sa,R=va,z=oa,B=ca("hasPermi"),ea=ma;return d(),g(na,null,[s(R,null,{default:y(()=>[s(p,{class:"-mb-15px",ref:"queryFormRef",inline:!0,"label-width":"68px"},{default:y(()=>[s(r,{label:"\u516C\u4F17\u53F7",prop:"accountId"},{default:y(()=>[s(_(fa),{onChange:W})]),_:1})]),_:1},512)]),_:1}),s(R,null,{default:y(()=>[k((d(),g("div",V,[v("div",q,[v("div",D,[v("div",S,ua(_(L)),1)]),v("div",A,[s(ga,{modelValue:_(u),"onUpdate:modelValue":a[0]||(a[0]=i=>Y(u)?u.value=i:null),"account-id":_(m),"active-index":_(h),"parent-index":_(I),onMenuClicked:a[1]||(a[1]=(i,C)=>((T,M)=>{f.value=!0,n.value=T,l.value.grand="1",l.value.x=M,b.value=!0,h.value=`${M}`,I.value=M})(i,C)),onSubmenuClicked:a[2]||(a[2]=(i,C,T)=>((M,J,O)=>{f.value=!0,n.value=M,l.value.grand="2",l.value.x=J,l.value.y=O,b.value=!1,h.value=`${J}-${O}`})(i,C,T))},null,8,["modelValue","account-id","active-index","parent-index"])]),v("div",H,[k((d(),j(z,{class:"save_btn",type:"success",onClick:ta},{default:y(()=>[G("\u4FDD\u5B58\u5E76\u53D1\u5E03\u83DC\u5355")]),_:1})),[[B,["mp:menu:save"]]]),k((d(),j(z,{class:"save_btn",type:"danger",onClick:ra},{default:y(()=>[G("\u6E05\u7A7A\u83DC\u5355")]),_:1})),[[B,["mp:menu:delete"]]])])]),_(f)?(d(),g("div",P,[s(xa,{"account-id":_(m),"is-parent":_(b),modelValue:_(n),"onUpdate:modelValue":a[3]||(a[3]=i=>Y(n)?n.value=i:null),onDelete:aa},null,8,["account-id","is-parent","modelValue"])])):(d(),g("div",$,F))])),[[ea,_(c)]])]),_:1})],64)}}}),[["__scopeId","data-v-c849596e"]])});export{Qa as __tla,K as default};