main-16c68401.js 5.6 KB

1
  1. import{ap as I,d as ea,r as N,e as la,k as ia,o as r,c as p,v as S,a as t,F as Q,n as R,g as A,t as ra,f as e,w as d,m as U,q as J,O as K,_ as na,B as oa,i as ca,D as sa,G as pa,H as da,__tla as ma}from"./index-2eab2d23.js";import{_ as ua,__tla as _a}from"./index.vue_vue_type_script_setup_true_lang-5730b053.js";import ga,{__tla as fa}from"./main-74cfbf31.js";import ya,{__tla as wa}from"./main-ec2be832.js";import{_ as ha,__tla as va}from"./main.vue_vue_type_script_setup_true_lang-0610a4e1.js";import{g as ba,__tla as ka}from"./index-4663832c.js";import{g as Ia,__tla as Sa}from"./index-5f871167.js";import{d as L,__tla as Ua}from"./formatTime-41155543.js";import{_ as za}from"./_plugin-vue_export-helper-1b428a4d.js";let P,V,X,C,Y,Z,Na=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 Sa}catch{}})(),(()=>{try{return Ua}catch{}})()]).then(async()=>{var y=(n=>(n.Draft="2",n.Published="1",n))(y||{});let T,x,E,D,O,M,j,W,q,B;C=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"],O={class:"item-name"},M={key:1},j={key:2},W={key:3},q={class:"waterfall"},B={key:0},P=za(ea({name:"WxMaterialSelect",__name:"main",props:{type:{},accountId:{},newsType:{default:y.Published}},emits:["select-material"],setup(n,{emit:u}){const c=n,$=u,f=N(!1),_=N(0),g=N([]),i=la({pageNo:1,pageSize:10,accountId:c.accountId}),w=o=>{$("select-material",o)},F=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 C(i);o.list.forEach(l=>{l.content.newsItem.forEach(m=>{m.picUrl=m.thumbUrl})}),g.value=o.list,_.value=o.total};return ia(async()=>{F()}),(o,l)=>{const m=na,v=oa,G=ca,b=ua,s=sa,H=pa,k=da;return r(),p("div",T,[c.type==="image"?(r(),p("div",x,[S((r(),p("div",E,[(r(!0),p(Q,null,R(t(g),a=>(r(),p("div",{class:"waterfall-item",key:a.mediaId},[A("img",{class:"material-img",src:a.url},null,8,D),A("p",O,ra(a.name),1),e(G,{class:"ope-row"},{default:d(()=>[e(v,{type:"success",onClick:z=>w(a)},{default:d(()=>[U(" \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",M,[S((r(),J(H,{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(L)},null,8,["formatter"]),e(s,{label:"\u64CD\u4F5C",align:"center",fixed:"right"},{default:d(a=>[e(v,{type:"primary",link:"",onClick:z=>w(a.row)},{default:d(()=>[U("\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:F},null,8,["total","page","limit"])])):c.type==="video"?(r(),p("div",j,[S((r(),J(H,{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(L)},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:z=>w(a.row)},{default:d(()=>[U("\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,[S((r(),p("div",q,[(r(!0),p(Q,null,R(t(g),a=>(r(),p("div",{class:"waterfall-item",key:a.mediaId},[a.content&&a.content.newsItem?(r(),p("div",B,[e(t(ga),{articles:a.content.newsItem},null,8,["articles"]),e(G,{class:"ope-row"},{default:d(()=>[e(v,{type:"success",onClick:z=>w(a)},{default:d(()=>[U(" \u9009\u62E9 "),e(m,{icon:"ep:circle-check"})]),_:2},1032,["onClick"])]),_:2},1024)])):K("",!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"])])):K("",!0)])}}}),[["__scopeId","data-v-2341c1e4"]]),Y=Object.freeze(Object.defineProperty({__proto__:null,default:P},Symbol.toStringTag,{value:"Module"}))});export{P as W,Na as __tla,V as c,X as d,C as g,Y as m,Z as u};