index-307e27c3.js 6.5 KB

1
  1. import{as as k,d as _a,r as e,T as ca,o as d,c as U,i as s,w as y,a as _,D as E,j as v,t as ua,R as X,k as B,l as G,F as na,I as ia,J as sa,s as oa,M as ma,v as pa,x as da,_ as ya,__tla as va}from"./index-2f799233.js";import{_ as ha,__tla as fa}from"./ContentWrap-9da801df.js";import Ma,{__tla as xa}from"./main-108765f1.js";import ba,{__tla as Ua}from"./MenuEditor-0e43935a.js";import Ia,{__tla as ga}from"./MenuPreviewer-2b3e4b93.js";import{h as wa}from"./tree-0af4953a.js";import{u as Ta,__tla as Ca}from"./useMessage-e567ad40.js";import{__tla as ka}from"./el-card-c64c83d1.js";import{__tla as Ea}from"./index-4c417a29.js";import{__tla as Va}from"./main-b8f70555.js";import{__tla as Da}from"./TabNews-479ff07e.js";import{__tla as qa}from"./main-8d30da97.js";import{__tla as Sa}from"./el-image-4d26fa76.js";import{__tla as za}from"./el-image-viewer-8e9e3571.js";import{__tla as Aa}from"./main-3a758e9c.js";import{__tla as $a}from"./index-e6cd813f.js";import{__tla as Fa}from"./index-1c180a16.js";import{__tla as Ha}from"./main-5916caaf.js";import{__tla as Na}from"./main-59faad7f.js";import{__tla as Pa}from"./index-d1cd47c8.js";import{__tla as Ra}from"./index-f6d57b08.js";import{__tla as ja}from"./formatTime-2157894c.js";import{__tla as Ja}from"./TabText-0e5634f6.js";import{__tla as La}from"./TabImage-63766296.js";import{__tla as Oa}from"./useUpload-56bf2433.js";import{__tla as Xa}from"./TabVoice-3f45746c.js";import{__tla as Ba}from"./TabVideo-40fe10a5.js";import{__tla as Ga}from"./TabMusic-a41dac8f.js";import{__tla as Ka}from"./vuedraggable.umd-2e643ed7.js";let K,Qa=Promise.all([(()=>{try{return va}catch{}})(),(()=>{try{return fa}catch{}})(),(()=>{try{return xa}catch{}})(),(()=>{try{return Ua}catch{}})(),(()=>{try{return ga}catch{}})(),(()=>{try{return Ca}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return Ea}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return Da}catch{}})(),(()=>{try{return qa}catch{}})(),(()=>{try{return Sa}catch{}})(),(()=>{try{return za}catch{}})(),(()=>{try{return Aa}catch{}})(),(()=>{try{return $a}catch{}})(),(()=>{try{return Fa}catch{}})(),(()=>{try{return Ha}catch{}})(),(()=>{try{return Na}catch{}})(),(()=>{try{return Pa}catch{}})(),(()=>{try{return Ra}catch{}})(),(()=>{try{return ja}catch{}})(),(()=>{try{return Ja}catch{}})(),(()=>{try{return La}catch{}})(),(()=>{try{return Oa}catch{}})(),(()=>{try{return Xa}catch{}})(),(()=>{try{return Ba}catch{}})(),(()=>{try{return Ga}catch{}})(),(()=>{try{return Ka}catch{}})()]).then(async()=>{let V,D,q,S,z,A,$,F,H,x;V={class:"clearfix public-account-management"},D={class:"left"},q={class:"weixin-hd"},S={class:"weixin-title"},z={class:"clearfix weixin-menu"},A={class:"save_div"},$={key:0,class:"right"},F={key:1,class:"right"},H=[(b=>(pa("data-v-e74cfd0c"),b=b(),da(),b))(()=>v("p",null,"\u8BF7\u9009\u62E9\u83DC\u5355\u914D\u7F6E",-1))],x="__MENU_NOT_SELECTED__",K=ya(_a({name:"MpMenu",__name:"index",setup(b){const o=Ta(),c=e(!1),m=e(-1),N=e(""),u=e([]),h=e(x),I=e(-1),f=e(!1),g=e(!0),n=e({}),r=e({grand:"0",x:0,y:0}),Q=e(!1),W=(t,a)=>{m.value=t,N.value=a,w()},w=async()=>{c.value=!1;try{const t=await(l=>k.get({url:"/mp/menu/list?accountId="+l}))(m.value),a=Y(t);u.value=wa(a,"id")}finally{c.value=!1}},Y=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},Z=()=>{h.value=x,I.value=-1,f.value=!1,n.value={},r.value={grand:"0",x:0,y:0},Q.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)=>k.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=>k.delete({url:"/mp/menu/delete?accountId="+t}))(m.value),Z(),w(),o.notifySuccess("\u6E05\u7A7A\u6210\u529F")}finally{c.value=!1}},ra=()=>{const t=[];return u.value.forEach(a=>{const l=P(a);t.push(l),!a.children||a.children.length<=0||(l.children=[],a.children.forEach(p=>{l.children.push(P(p))}))}),t},P=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,R=ha,j=oa,J=ca("hasPermi"),ea=ma;return d(),U(na,null,[s(R,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:W})]),_:1})]),_:1},512)]),_:1}),s(R,null,{default:y(()=>[E((d(),U("div",V,[v("div",D,[v("div",q,[v("div",S,ua(_(N)),1)]),v("div",z,[s(Ia,{modelValue:_(u),"onUpdate:modelValue":a[0]||(a[0]=i=>X(u)?u.value=i:null),"account-id":_(m),"active-index":_(h),"parent-index":_(I),onMenuClicked:a[1]||(a[1]=(i,T)=>((C,M)=>{f.value=!0,n.value=C,r.value.grand="1",r.value.x=M,g.value=!0,h.value=`${M}`,I.value=M})(i,T)),onSubmenuClicked:a[2]||(a[2]=(i,T,C)=>((M,L,O)=>{f.value=!0,n.value=M,r.value.grand="2",r.value.x=L,r.value.y=O,g.value=!1,h.value=`${L}-${O}`})(i,T,C))},null,8,["modelValue","account-id","active-index","parent-index"])]),v("div",A,[E((d(),B(j,{class:"save_btn",type:"success",onClick:ta},{default:y(()=>[G("\u4FDD\u5B58\u5E76\u53D1\u5E03\u83DC\u5355")]),_:1})),[[J,["mp:menu:save"]]]),E((d(),B(j,{class:"save_btn",type:"danger",onClick:la},{default:y(()=>[G("\u6E05\u7A7A\u83DC\u5355")]),_:1})),[[J,["mp:menu:delete"]]])])]),_(f)?(d(),U("div",$,[s(ba,{"account-id":_(m),"is-parent":_(g),modelValue:_(n),"onUpdate:modelValue":a[3]||(a[3]=i=>X(n)?n.value=i:null),onDelete:aa},null,8,["account-id","is-parent","modelValue"])])):(d(),U("div",F,[...H]))])),[[ea,_(c)]])]),_:1})],64)}}}),[["__scopeId","data-v-e74cfd0c"],["__file","D:/zx/mall-newfeifan-zx-business/src/views/mp/menu/index.vue"]])});export{Qa as __tla,K as default};