index-331779b6.js 6.5 KB

1
  1. import{aA as E,d as _a,r as e,a4 as ca,o as d,c as b,f as s,A as y,a as _,k,B as v,E as ua,a2 as R,C as W,D as Z,F as na,V as ia,W as sa,J as oa,Z as ma,L as pa,M as da,_ as ya,__tla as va}from"./index-54aa57d8.js";import{_ as ha,__tla as fa}from"./ContentWrap-260746ab.js";import Ma,{__tla as xa}from"./main-46e737d0.js";import Ua,{__tla as ba}from"./MenuEditor-05a9c123.js";import ga,{__tla as Ia}from"./MenuPreviewer-e91f7052.js";import{h as wa}from"./tree-0af4953a.js";import{u as Ca,__tla as Ta}from"./useMessage-f56cafbb.js";import{__tla as Ea}from"./el-card-e7d6628c.js";import{__tla as ka}from"./index-298fa07e.js";import{__tla as Va}from"./main-af1852d2.js";import{__tla as Da}from"./TabNews-d26a7f62.js";import{__tla as qa}from"./main-5e9b140e.js";import{__tla as Sa}from"./el-image-94dad5a7.js";import{__tla as Aa}from"./el-image-viewer-ec0edec4.js";import{__tla as $a}from"./main-769eea97.js";import{__tla as Na}from"./index-e6a7fd1e.js";import{__tla as za}from"./index-254a9b5e.js";import{__tla as Fa}from"./main-804a3bb8.js";import{__tla as Ha}from"./main-9d34a4d6.js";import{__tla as La}from"./index-c0057675.js";import{__tla as Pa}from"./index-58e47029.js";import{__tla as Ba}from"./formatTime-e6197688.js";import{__tla as Ga}from"./TabText-c90f2938.js";import{__tla as Ja}from"./TabImage-033bdb45.js";import{__tla as Oa}from"./useUpload-c467154e.js";import{__tla as Ra}from"./TabVoice-48254a09.js";import{__tla as Wa}from"./TabVideo-dc39f432.js";import{__tla as Za}from"./TabMusic-0f1b3575.js";import{__tla as ja}from"./vuedraggable.umd-38c48584.js";let j,Ka=Promise.all([(()=>{try{return va}catch{}})(),(()=>{try{return fa}catch{}})(),(()=>{try{return xa}catch{}})(),(()=>{try{return ba}catch{}})(),(()=>{try{return Ia}catch{}})(),(()=>{try{return Ta}catch{}})(),(()=>{try{return Ea}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return Da}catch{}})(),(()=>{try{return qa}catch{}})(),(()=>{try{return Sa}catch{}})(),(()=>{try{return Aa}catch{}})(),(()=>{try{return $a}catch{}})(),(()=>{try{return Na}catch{}})(),(()=>{try{return za}catch{}})(),(()=>{try{return Fa}catch{}})(),(()=>{try{return Ha}catch{}})(),(()=>{try{return La}catch{}})(),(()=>{try{return Pa}catch{}})(),(()=>{try{return Ba}catch{}})(),(()=>{try{return Ga}catch{}})(),(()=>{try{return Ja}catch{}})(),(()=>{try{return Oa}catch{}})(),(()=>{try{return Ra}catch{}})(),(()=>{try{return Wa}catch{}})(),(()=>{try{return Za}catch{}})(),(()=>{try{return ja}catch{}})()]).then(async()=>{let V,D,q,S,A,$,N,z,F,x;V={class:"clearfix public-account-management"},D={class:"left"},q={class:"weixin-hd"},S={class:"weixin-title"},A={class:"clearfix weixin-menu"},$={class:"save_div"},N={key:0,class:"right"},z={key:1,class:"right"},F=[(U=>(pa("data-v-e74cfd0c"),U=U(),da(),U))(()=>v("p",null,"\u8BF7\u9009\u62E9\u83DC\u5355\u914D\u7F6E",-1))],x="__MENU_NOT_SELECTED__",j=ya(_a({name:"MpMenu",__name:"index",setup(U){const o=Ca(),c=e(!1),m=e(-1),H=e(""),u=e([]),h=e(x),g=e(-1),f=e(!1),I=e(!0),n=e({}),r=e({grand:"0",x:0,y:0}),K=e(!1),Q=(t,a)=>{m.value=t,H.value=a,w()},w=async()=>{c.value=!1;try{const t=await(l=>E.get({url:"/mp/menu/list?accountId="+l}))(m.value),a=X(t);u.value=wa(a,"id")}finally{c.value=!1}},X=t=>{if(!t)return[];const a=[];return t.forEach(l=>{const p={...l};p.reply={type:l.replyMessageType,accountId:l.accountId,content:l.replyContent,mediaId:l.replyMediaId,url:l.replyMediaUrl,title:l.replyTitle,description:l.replyDescription,thumbMediaId:l.replyThumbMediaId,thumbMediaUrl:l.replyThumbMediaUrl,articles:l.replyArticles,musicUrl:l.replyMusicUrl,hqMusicUrl:l.replyHqMusicUrl},a.push(p)}),a},Y=()=>{h.value=x,g.value=-1,f.value=!1,n.value={},r.value={grand:"0",x:0,y:0},K.value=!1},aa=async()=>{var t;try{await o.confirm("\u786E\u5B9A\u8981\u5220\u9664\u5417?"),r.value.grand==="1"?u.value.splice(r.value.x,1):r.value.grand==="2"&&((t=u.value[r.value.x].children)==null||t.splice(r.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,ra()),w(),o.notifySuccess("\u53D1\u5E03\u6210\u529F")}finally{c.value=!1}},la=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),Y(),w(),o.notifySuccess("\u6E05\u7A7A\u6210\u529F")}finally{c.value=!1}},ra=()=>{const t=[];return u.value.forEach(a=>{const l=L(a);t.push(l),!a.children||a.children.length<=0||(l.children=[],a.children.forEach(p=>{l.children.push(L(p))}))}),t},L=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 l=ia,p=sa,P=ha,B=oa,G=ca("hasPermi"),ea=ma;return d(),b(na,null,[s(P,null,{default:y(()=>[s(p,{class:"-mb-15px",ref:"queryFormRef",inline:!0,"label-width":"68px"},{default:y(()=>[s(l,{label:"\u516C\u4F17\u53F7",prop:"accountId"},{default:y(()=>[s(_(Ma),{onChange:Q})]),_:1})]),_:1},512)]),_:1}),s(P,null,{default:y(()=>[k((d(),b("div",V,[v("div",D,[v("div",q,[v("div",S,ua(_(H)),1)]),v("div",A,[s(ga,{modelValue:_(u),"onUpdate:modelValue":a[0]||(a[0]=i=>R(u)?u.value=i:null),"account-id":_(m),"active-index":_(h),"parent-index":_(g),onMenuClicked:a[1]||(a[1]=(i,C)=>((T,M)=>{f.value=!0,n.value=T,r.value.grand="1",r.value.x=M,I.value=!0,h.value=`${M}`,g.value=M})(i,C)),onSubmenuClicked:a[2]||(a[2]=(i,C,T)=>((M,J,O)=>{f.value=!0,n.value=M,r.value.grand="2",r.value.x=J,r.value.y=O,I.value=!1,h.value=`${J}-${O}`})(i,C,T))},null,8,["modelValue","account-id","active-index","parent-index"])]),v("div",$,[k((d(),W(B,{class:"save_btn",type:"success",onClick:ta},{default:y(()=>[Z("\u4FDD\u5B58\u5E76\u53D1\u5E03\u83DC\u5355")]),_:1})),[[G,["mp:menu:save"]]]),k((d(),W(B,{class:"save_btn",type:"danger",onClick:la},{default:y(()=>[Z("\u6E05\u7A7A\u83DC\u5355")]),_:1})),[[G,["mp:menu:delete"]]])])]),_(f)?(d(),b("div",N,[s(Ua,{"account-id":_(m),"is-parent":_(I),modelValue:_(n),"onUpdate:modelValue":a[3]||(a[3]=i=>R(n)?n.value=i:null),onDelete:aa},null,8,["account-id","is-parent","modelValue"])])):(d(),b("div",z,[...F]))])),[[ea,_(c)]])]),_:1})],64)}}}),[["__scopeId","data-v-e74cfd0c"],["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mp/menu/index.vue"]])});export{Ka as __tla,j as default};