2 lines
6.0 KiB
JavaScript
2 lines
6.0 KiB
JavaScript
var L=Object.defineProperty,q=Object.defineProperties;var F=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var $=(r,n,o)=>n in r?L(r,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[n]=o,I=(r,n)=>{for(var o in n||(n={}))J.call(n,o)&&$(r,o,n[o]);if(V)for(var o of V(n))K.call(n,o)&&$(r,o,n[o]);return r},P=(r,n)=>q(r,F(n));var U=(r,n,o)=>new Promise((f,u)=>{var g=m=>{try{t(o.next(m))}catch(S){u(S)}},C=m=>{try{t(o.throw(m))}catch(S){u(S)}},t=m=>m.done?f(m.value):Promise.resolve(m.value).then(g,C);t((o=o.apply(r,n)).next())});import{bL as Q,au as T,bY as j,av as w,bV as k,an as x,ay as Y,a9 as M}from"./bootstrap-DsjPfOC_.js";import{h as E,i as G}from"./wx-material-select.vue_vue_type_script_setup_true_lang-ojAC4QWa.js";import{_ as H}from"./wx-account-select.vue_vue_type_script_setup_true_lang-BifvCgys.js";import{U as _}from"./useUpload-B002wlOP.js";import"./wx-video-play.vue_vue_type_script_setup_true_lang-H2pAIssH.js";import"./wx-voice-play.vue_vue_type_script_setup_true_lang-DWoDJN0e.js";import{_ as O}from"./image-table.vue_vue_type_script_setup_true_lang-CMEYVx_Q.js";import"./upload-BYyfYqjq.js";import{_ as B}from"./UploadFile.vue_vue_type_script_setup_true_lang-CAECRv0i.js";import{_ as R}from"./UploadVideo.vue_vue_type_script_setup_true_lang-CdzTFG1n.js";import{_ as W}from"./video-table.vue_vue_type_script_setup_true_lang-CTVIFib2.js";import{_ as X}from"./voice-table.vue_vue_type_script_setup_true_lang-BqS_ka5z.js";import{_ as Z}from"./doc-alert.vue_vue_type_script_setup_true_lang-DEHj2GIF.js";import{_ as ee}from"./page.vue_vue_type_script_setup_true_lang-BL-xU9lB.js";import{m as ae,b9 as b,b7 as te,ab as c,b2 as v,bJ as l,ae as y,j as i,u as a,ac as h,ai as z,b4 as oe}from"../jse/index-index-CO0ZsLf2.js";import{v as ne}from"./AlertBuilder-ElnyTeiq.js";import"./vxe-table-C9eY8pUC.js";import"./dict-tag.vue_vue_type_script_setup_true_lang-BZwqGgTH.js";import"./wx-news.vue_vue_type_script_setup_true_lang-fcs7C6QO.js";import"./use-vxe-grid-z_YbcgDZ.js";import"./index-9LUz1I1h.js";import"./data-CixdoJZL.js";import"./table-action.vue_vue_type_script_setup_true_lang-BCG7vvPF.js";import"./index-vahqJcxE.js";import"./icons-CieLeI1V.js";import"./circle-check-big-I5cuJCPZ.js";import"./x--itLcJVB.js";const ie={class:"h-full"},se={class:"flex items-center"},le={class:"mt-4 flex justify-end"},re={class:"flex items-center"},pe={class:"mt-4 flex justify-end"},me={class:"flex items-center"},ue={class:"mt-4 flex justify-end"},qe=ae({name:"MpMaterial",__name:"index",setup(r){const{hasAccessByCodes:n}=Q(),o=b(_.Image),f=b(!1),u=b([]),g=b(0),C=b(-1);oe("accountId",C);const t=te({accountId:C,pageNo:1,pageSize:10,permanent:!0}),m=b(!1);function S(d){C.value=d,t.accountId=d,t.pageNo=1,p()}function p(){return U(this,null,function*(){f.value=!0;try{const d=yield E(P(I({},t),{type:o.value}));u.value=d.list,g.value=d.total}finally{f.value=!1}})}function D(){t.pageNo=1,p()}function A(){u.value=[],g.value=0,D()}function N(d){return U(this,null,function*(){yield ne("此操作将永久删除该文件, 是否继续?");const e=M.loading({content:"正在删除...",duration:0});try{yield G(d),M.success("删除成功"),yield p()}finally{e()}})}return(d,e)=>(v(),c(a(ee),{"auto-content-height":""},{doc:l(()=>[i(a(Z),{title:"公众号素材",url:"https://doc.iocoder.cn/mp/material/"})]),default:l(()=>[y("div",ie,[i(a(T),{class:"h-[10%]",bordered:!1},{default:l(()=>[i(a(j),{model:t,layout:"inline"},{default:l(()=>[i(a(j).Item,{label:"公众号"},{default:l(()=>[i(a(H),{onChange:S})]),_:1})]),_:1},8,["model"])]),_:1}),i(a(T),{bordered:!1,class:"mt-4 h-auto"},{default:l(()=>[i(a(w),{"active-key":o.value,"onUpdate:activeKey":e[8]||(e[8]=s=>o.value=s),onChange:A},{default:l(()=>[(v(),c(a(w).TabPane,{key:a(_).Image},{tab:l(()=>[y("span",se,[i(a(x),{icon:"lucide:image",class:"mr-1"}),e[9]||(e[9]=z(" 图片 ",-1))])]),default:l(()=>[a(n)(["mp:material:upload-permanent"])?(v(),c(B,{key:0,type:a(_).Image,onUploaded:p},{default:l(()=>[...e[10]||(e[10]=[z(" 支持 bmp/png/jpeg/jpg/gif 格式,大小不超过 2M ",-1)])]),_:1},8,["type"])):h("",!0),i(O,{list:u.value,loading:f.value,onDelete:N},null,8,["list","loading"]),y("div",le,[i(a(k),{current:t.pageNo,"onUpdate:current":e[0]||(e[0]=s=>t.pageNo=s),"page-size":t.pageSize,"onUpdate:pageSize":e[1]||(e[1]=s=>t.pageSize=s),total:g.value,"show-size-changer":"",onChange:p,onShowSizeChange:p},null,8,["current","page-size","total"])])]),_:1})),(v(),c(a(w).TabPane,{key:a(_).Voice},{tab:l(()=>[y("span",re,[i(a(x),{icon:"lucide:mic",class:"mr-1"}),e[11]||(e[11]=z(" 语音 ",-1))])]),default:l(()=>[a(n)(["mp:material:upload-permanent"])?(v(),c(B,{key:0,type:a(_).Voice,onUploaded:p},{default:l(()=>[...e[12]||(e[12]=[z(" 格式支持 mp3/wma/wav/amr,文件大小不超过 2M,播放长度不超过 60s ",-1)])]),_:1},8,["type"])):h("",!0),i(X,{list:u.value,loading:f.value,onDelete:N},null,8,["list","loading"]),y("div",pe,[i(a(k),{current:t.pageNo,"onUpdate:current":e[2]||(e[2]=s=>t.pageNo=s),"page-size":t.pageSize,"onUpdate:pageSize":e[3]||(e[3]=s=>t.pageSize=s),total:g.value,"show-size-changer":"",onChange:p,onShowSizeChange:p},null,8,["current","page-size","total"])])]),_:1})),(v(),c(a(w).TabPane,{key:a(_).Video},{tab:l(()=>[y("span",me,[i(a(x),{icon:"lucide:video",class:"mr-1"}),e[13]||(e[13]=z(" 视频 ",-1))])]),default:l(()=>[a(n)(["mp:material:upload-permanent"])?(v(),c(a(Y),{key:0,type:"primary",onClick:e[4]||(e[4]=s=>m.value=!0)},{default:l(()=>[...e[14]||(e[14]=[z(" 新建视频 ",-1)])]),_:1})):h("",!0),i(R,{open:m.value,"onUpdate:open":e[5]||(e[5]=s=>m.value=s),onUploaded:p},null,8,["open"]),i(W,{list:u.value,loading:f.value,onDelete:N},null,8,["list","loading"]),y("div",ue,[i(a(k),{current:t.pageNo,"onUpdate:current":e[6]||(e[6]=s=>t.pageNo=s),"page-size":t.pageSize,"onUpdate:pageSize":e[7]||(e[7]=s=>t.pageSize=s),total:g.value,"show-size-changer":"",onChange:p,onShowSizeChange:p},null,8,["current","page-size","total"])])]),_:1}))]),_:1},8,["active-key"])]),_:1})])]),_:1}))}});export{qe as default};
|