1 |
- import{aq as E,d as _a,r as e,Q as ca,o as d,c as g,f as s,w as y,a as _,x as k,g as v,t as ua,O as R,v as G,m as J,F as na,A as ia,D as sa,C as oa,I as ma,p as pa,j as da,_ as ya,__tla as va}from"./index-430b3151.js";import{_ as ha,__tla as fa}from"./ContentWrap-60842994.js";import Ma,{__tla as xa}from"./main-69107f9b.js";import Ua,{__tla as ga}from"./MenuEditor-311b072c.js";import ba,{__tla as Ia}from"./MenuPreviewer-77ac813c.js";import{h as wa}from"./tree-0af4953a.js";import{u as Ca,__tla as Ta}from"./useMessage-d226ba89.js";import{__tla as Ea}from"./el-card-dee5b36b.js";import{__tla as ka}from"./index-5da4587f.js";import{__tla as qa}from"./main-f5913091.js";import{__tla as Da}from"./TabNews-8f442431.js";import{__tla as Va}from"./main-7725eed7.js";import{__tla as Sa}from"./el-image-c98b70f9.js";import{__tla as za}from"./el-image-viewer-467ebe35.js";import{__tla as Aa}from"./main-568dadca.js";import{__tla as Fa}from"./index-c425c88f.js";import{__tla as $a}from"./index-555139e7.js";import{__tla as Ha}from"./main-c23ad61b.js";import{__tla as Na}from"./main-52b26646.js";import{__tla as Oa}from"./index-4a8c9c46.js";import{__tla as Pa}from"./index-f7b2db2d.js";import{__tla as ja}from"./formatTime-00eecbb7.js";import{__tla as Ba}from"./TabText-c66f78b3.js";import{__tla as La}from"./TabImage-fafb1b04.js";import{__tla as Qa}from"./useUpload-d575fd30.js";import{__tla as Ra}from"./TabVoice-46af681a.js";import{__tla as Ga}from"./TabVideo-8f378fad.js";import{__tla as Ja}from"./TabMusic-5688eb8b.js";import{__tla as Ka}from"./vuedraggable.umd-28fd5f71.js";let K,Wa=Promise.all([(()=>{try{return va}catch{}})(),(()=>{try{return fa}catch{}})(),(()=>{try{return xa}catch{}})(),(()=>{try{return ga}catch{}})(),(()=>{try{return Ia}catch{}})(),(()=>{try{return Ta}catch{}})(),(()=>{try{return Ea}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return qa}catch{}})(),(()=>{try{return Da}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return Sa}catch{}})(),(()=>{try{return za}catch{}})(),(()=>{try{return Aa}catch{}})(),(()=>{try{return Fa}catch{}})(),(()=>{try{return $a}catch{}})(),(()=>{try{return Ha}catch{}})(),(()=>{try{return Na}catch{}})(),(()=>{try{return Oa}catch{}})(),(()=>{try{return Pa}catch{}})(),(()=>{try{return ja}catch{}})(),(()=>{try{return Ba}catch{}})(),(()=>{try{return La}catch{}})(),(()=>{try{return Qa}catch{}})(),(()=>{try{return Ra}catch{}})(),(()=>{try{return Ga}catch{}})(),(()=>{try{return Ja}catch{}})(),(()=>{try{return Ka}catch{}})()]).then(async()=>{let q,D,V,S,z,A,F,$,H,x;q={class:"clearfix public-account-management"},D={class:"left"},V={class:"weixin-hd"},S={class:"weixin-title"},z={class:"clearfix weixin-menu"},A={class:"save_div"},F={key:0,class:"right"},$={key:1,class:"right"},H=[(U=>(pa("data-v-e74cfd0c"),U=U(),da(),U))(()=>v("p",null,"\u8BF7\u9009\u62E9\u83DC\u5355\u914D\u7F6E",-1))],x="__MENU_NOT_SELECTED__",K=ya(_a({name:"MpMenu",__name:"index",setup(U){const o=Ca(),c=e(!1),m=e(-1),N=e(""),u=e([]),h=e(x),b=e(-1),f=e(!1),I=e(!0),n=e({}),r=e({grand:"0",x:0,y:0}),W=e(!1),X=(t,a)=>{m.value=t,N.value=a,w()},w=async()=>{c.value=!1;try{const t=await(l=>E.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,b.value=-1,f.value=!1,n.value={},r.value={grand:"0",x:0,y:0},W.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),Z(),w(),o.notifySuccess("\u6E05\u7A7A\u6210\u529F")}finally{c.value=!1}},ra=()=>{const t=[];return u.value.forEach(a=>{const l=O(a);t.push(l),!a.children||a.children.length<=0||(l.children=[],a.children.forEach(p=>{l.children.push(O(p))}))}),t},O=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,j=oa,B=ca("hasPermi"),ea=ma;return d(),g(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:X})]),_:1})]),_:1},512)]),_:1}),s(P,null,{default:y(()=>[k((d(),g("div",q,[v("div",D,[v("div",V,[v("div",S,ua(_(N)),1)]),v("div",z,[s(ba,{modelValue:_(u),"onUpdate:modelValue":a[0]||(a[0]=i=>R(u)?u.value=i:null),"account-id":_(m),"active-index":_(h),"parent-index":_(b),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}`,b.value=M})(i,C)),onSubmenuClicked:a[2]||(a[2]=(i,C,T)=>((M,L,Q)=>{f.value=!0,n.value=M,r.value.grand="2",r.value.x=L,r.value.y=Q,I.value=!1,h.value=`${L}-${Q}`})(i,C,T))},null,8,["modelValue","account-id","active-index","parent-index"])]),v("div",A,[k((d(),G(j,{class:"save_btn",type:"success",onClick:ta},{default:y(()=>[J("\u4FDD\u5B58\u5E76\u53D1\u5E03\u83DC\u5355")]),_:1})),[[B,["mp:menu:save"]]]),k((d(),G(j,{class:"save_btn",type:"danger",onClick:la},{default:y(()=>[J("\u6E05\u7A7A\u83DC\u5355")]),_:1})),[[B,["mp:menu:delete"]]])])]),_(f)?(d(),g("div",F,[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(),g("div",$,[...H]))])),[[ea,_(c)]])]),_:1})],64)}}}),[["__scopeId","data-v-e74cfd0c"],["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mp/menu/index.vue"]])});export{Wa as __tla,K as default};
|