1 |
- import{ar as I,d as ea,r as C,f as la,z as ia,o as r,c as p,D as z,a as t,F as Q,C as A,k as B,t as ra,i as e,w as d,m as S,j as G,l as H,_ as na,q as oa,s as ca,K as sa,L as pa,M as da,__tla as ma}from"./index-1e808f2e.js";import{_ as ua,__tla as _a}from"./index.vue_vue_type_script_setup_true_lang-571824c6.js";import ga,{__tla as fa}from"./main-fae03c69.js";import ya,{__tla as wa}from"./main-c2ebd06d.js";import{_ as ha,__tla as va}from"./main.vue_vue_type_script_setup_true_lang-068c3b56.js";import{g as ba,__tla as ka}from"./index-1a14fda3.js";import{g as Ia,__tla as za}from"./index-6e04feee.js";import{d as R,__tla as Sa}from"./formatTime-a348c3be.js";import{_ as Ua}from"./_plugin-vue_export-helper-1b428a4d.js";let P,V,X,N,Y,Z,Ca=Promise.all([(()=>{try{return ma}catch{}})(),(()=>{try{return _a}catch{}})(),(()=>{try{return fa}catch{}})(),(()=>{try{return wa}catch{}})(),(()=>{try{return va}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return za}catch{}})(),(()=>{try{return Sa}catch{}})()]).then(async()=>{var y=(n=>(n.Draft="2",n.Published="1",n))(y||{});let T,x,E,D,M,j,O,W,q,F;N=n=>I.get({url:"/mp/draft/page",params:n}),V=(n,u)=>I.post({url:"/mp/draft/create?accountId="+n,data:{articles:u}}),Z=(n,u,c)=>I.put({url:"/mp/draft/update?accountId="+n+"&mediaId="+u,method:"put",data:c}),X=(n,u)=>I.delete({url:"/mp/draft/delete?accountId="+n+"&mediaId="+u}),T={class:"pb-30px"},x={key:0},E={class:"waterfall"},D=["src"],M={class:"item-name"},j={key:1},O={key:2},W={key:3},q={class:"waterfall"},F={key:0},P=Ua(ea({name:"WxMaterialSelect",__name:"main",props:{type:{},accountId:{},newsType:{default:y.Published}},emits:["select-material"],setup(n,{emit:u}){const c=n,$=u,f=C(!1),_=C(0),g=C([]),i=la({pageNo:1,pageSize:10,accountId:c.accountId}),w=o=>{$("select-material",o)},J=async()=>{f.value=!0;try{c.type==="news"&&c.newsType===y.Published?await aa():c.type==="news"&&c.newsType===y.Draft?await ta():await h()}finally{f.value=!1}},h=async()=>{const o=await ba({...i,type:c.type});g.value=o.list,_.value=o.total},aa=async()=>{const o=await Ia(i);o.list.forEach(l=>{l.content.newsItem.forEach(m=>{m.picUrl=m.thumbUrl})}),g.value=o.list,_.value=o.total},ta=async()=>{const o=await N(i);o.list.forEach(l=>{l.content.newsItem.forEach(m=>{m.picUrl=m.thumbUrl})}),g.value=o.list,_.value=o.total};return ia(async()=>{J()}),(o,l)=>{const m=na,v=oa,K=ca,b=ua,s=sa,L=pa,k=da;return r(),p("div",T,[c.type==="image"?(r(),p("div",x,[z((r(),p("div",E,[(r(!0),p(Q,null,A(t(g),a=>(r(),p("div",{class:"waterfall-item",key:a.mediaId},[B("img",{class:"material-img",src:a.url},null,8,D),B("p",M,ra(a.name),1),e(K,{class:"ope-row"},{default:d(()=>[e(v,{type:"success",onClick:U=>w(a)},{default:d(()=>[S(" \u9009\u62E9 "),e(m,{icon:"ep:circle-check"})]),_:2},1032,["onClick"])]),_:2},1024)]))),128))])),[[k,t(f)]]),e(b,{total:t(_),page:t(i).pageNo,"onUpdate:page":l[0]||(l[0]=a=>t(i).pageNo=a),limit:t(i).pageSize,"onUpdate:limit":l[1]||(l[1]=a=>t(i).pageSize=a),onPagination:h},null,8,["total","page","limit"])])):c.type==="voice"?(r(),p("div",j,[z((r(),G(L,{data:t(g)},{default:d(()=>[e(s,{label:"\u7F16\u53F7",align:"center",prop:"mediaId"}),e(s,{label:"\u6587\u4EF6\u540D",align:"center",prop:"name"}),e(s,{label:"\u8BED\u97F3",align:"center"},{default:d(a=>[e(t(ya),{url:a.row.url},null,8,["url"])]),_:1}),e(s,{label:"\u4E0A\u4F20\u65F6\u95F4",align:"center",prop:"createTime",width:"180",formatter:t(R)},null,8,["formatter"]),e(s,{label:"\u64CD\u4F5C",align:"center",fixed:"right"},{default:d(a=>[e(v,{type:"primary",link:"",onClick:U=>w(a.row)},{default:d(()=>[S("\u9009\u62E9 "),e(m,{icon:"ep:plus"})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[k,t(f)]]),e(b,{total:t(_),page:t(i).pageNo,"onUpdate:page":l[2]||(l[2]=a=>t(i).pageNo=a),limit:t(i).pageSize,"onUpdate:limit":l[3]||(l[3]=a=>t(i).pageSize=a),onPagination:J},null,8,["total","page","limit"])])):c.type==="video"?(r(),p("div",O,[z((r(),G(L,{data:t(g)},{default:d(()=>[e(s,{label:"\u7F16\u53F7",align:"center",prop:"mediaId"}),e(s,{label:"\u6587\u4EF6\u540D",align:"center",prop:"name"}),e(s,{label:"\u6807\u9898",align:"center",prop:"title"}),e(s,{label:"\u4ECB\u7ECD",align:"center",prop:"introduction"}),e(s,{label:"\u89C6\u9891",align:"center"},{default:d(a=>[e(t(ha),{url:a.row.url},null,8,["url"])]),_:1}),e(s,{label:"\u4E0A\u4F20\u65F6\u95F4",align:"center",prop:"createTime",width:"180",formatter:t(R)},null,8,["formatter"]),e(s,{label:"\u64CD\u4F5C",align:"center",fixed:"right","class-name":"small-padding fixed-width"},{default:d(a=>[e(v,{type:"primary",link:"",onClick:U=>w(a.row)},{default:d(()=>[S("\u9009\u62E9 "),e(m,{icon:"akar-icons:circle-plus"})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[k,t(f)]]),e(b,{total:t(_),page:t(i).pageNo,"onUpdate:page":l[4]||(l[4]=a=>t(i).pageNo=a),limit:t(i).pageSize,"onUpdate:limit":l[5]||(l[5]=a=>t(i).pageSize=a),onPagination:h},null,8,["total","page","limit"])])):c.type==="news"?(r(),p("div",W,[z((r(),p("div",q,[(r(!0),p(Q,null,A(t(g),a=>(r(),p("div",{class:"waterfall-item",key:a.mediaId},[a.content&&a.content.newsItem?(r(),p("div",F,[e(t(ga),{articles:a.content.newsItem},null,8,["articles"]),e(K,{class:"ope-row"},{default:d(()=>[e(v,{type:"success",onClick:U=>w(a)},{default:d(()=>[S(" \u9009\u62E9 "),e(m,{icon:"ep:circle-check"})]),_:2},1032,["onClick"])]),_:2},1024)])):H("",!0)]))),128))])),[[k,t(f)]]),e(b,{total:t(_),page:t(i).pageNo,"onUpdate:page":l[6]||(l[6]=a=>t(i).pageNo=a),limit:t(i).pageSize,"onUpdate:limit":l[7]||(l[7]=a=>t(i).pageSize=a),onPagination:h},null,8,["total","page","limit"])])):H("",!0)])}}}),[["__scopeId","data-v-2341c1e4"]]),Y=Object.freeze(Object.defineProperty({__proto__:null,default:P},Symbol.toStringTag,{value:"Module"}))});export{P as W,Ca as __tla,V as c,X as d,N as g,Y as m,Z as u};
|