filesbox/web/dist/23732.b3432dcf.async.js

2 lines
11 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[23732],{96278:function(A){A.exports={root:"root___7VXfh",colorWeak:"colorWeak___2fQ5G","ant-layout":"ant-layout___2lk2i",globalSpin:"globalSpin___3wjkL","ant-table":"ant-table___3MoMQ","ant-table-thead":"ant-table-thead___2F4eD","ant-table-tbody":"ant-table-tbody___1iFAX",formBox:"formBox___1MR6m",hrefModal:"hrefModal___GOUPi",shop:"shop___3KrmS"}},44943:function(){},23732:function(A,h,e){"use strict";e.r(h),e.d(h,{default:function(){return O}});var c=e(71194),m=e(50146),F=e(13062),B=e(71230),X=e(89032),V=e(15746),r=e(34792),k=e(48086),H=e(88983),R=e(47933),Y=e(47673),$=e(4107),P=e(67294),Q=e(28216),K=e(96278),C=e.n(K),d=e(41273),t=e(85893),u,I,w=$.Z.TextArea,T=R.ZP.Group,O=(u=(0,Q.$j)(J=>{var o=J.commondesign;return{commondesign:o}}),u(I=class extends P.PureComponent{constructor(){super(...arguments);this.state={visible:!1,audioHref:"",autoplay:!1,loop:!1},this.updataDomCallBack=o=>{var f=this,U=this.props.commondesign,D=U.Audio,_=D.element,M=D.callback,a=D.callClose,l=_.find(".box");console.log("data.audioHref",o.audioHref);var i='<div class="musicPlayer"> <div class="m-content"> <div style="display: none;"><audio src="'+o.audioHref+'" '+(o.autoplay?'autoplay="autoplay"':"")+" "+(o.loop?'loop="loop"':"")+'>\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 audio \u6807\u7B7E\u3002</audio></div> </div> <div class="m-footer"> <div class="m-l-toolBox"><span class="m-player"><img class="mp-player" src="/design/designstatic/chatroom/img/music/player.png"/> <img class="mp-pause" src="/design/designstatic/chatroom/img/music/pause.png"/></span></div> <div class="m-r-toolBox"><span class="m-voice"><img class="mv-voice" src="/design/designstatic/chatroom/img/music/voice.png"> <img class="mv-muted" src="/design/designstatic/chatroom/img/music/muted.png"/></span><span class="m-voice-progress"><span class="m-voice-progress-bg"></span></span></div> </div> <div class="m-play-infoBox"> <div class="m-play-progress"><span class="m-play-progress-bg"><span class="m-play-progress-btn"></span></span></div> <div class="m-play-time"><span class="mp-left-time">00:00</span><span class="mp-right-time">00:00</span></div> </div></div>';_.find(".musicPlayer").remove(),_.append(i),_.attr("data-mp3",JSON.stringify(o))},this.show=o=>{o?(o=JSON.parse(o),this.setState({audioHref:o.audioHref,autoplay:o.autoplay,loop:o.loop})):this.setState({visible:!0,audioHref:""})},this.cancelEvent=()=>{var o=this,f=this.props.dispatch;f({type:"commondesign/setState",payload:{Audio:{visible:!1,callback:()=>{},callClose:()=>{}}}})}}componentDidMount(){var o=this.props.commondesign,f=o.Audio,U=f.visible,D=f.element,_=f.callback,M=f.callClose;this.setState({visible:U});var a=D.attr("data-mp3");this.show(a)}render(){var o=this,f=this.props,U=f.commondesign,D=f.dispatch,_=U.Audio.callback,M=this.state,a=M.visible,l=M.audioHref,i=M.autoplay,n=M.loop,s=v=>{o.cancelEvent()},L=v=>{if(l!=""){var E={audioHref:l,autoplay:i,loop:n};o.updataDomCallBack(E),_&&_(E),o.cancelEvent()}else k.ZP.error("\u8BF7\u6DFB\u52A0mp3\u6587\u4EF6\u7F51\u7EDC\u5730\u5740")},y=v=>{o.setState({audioHref:v.target.value})},Z=()=>{window.fileBoxApi.fileSelect({title:"\u97F3\u4E50\u9009\u62E9",type:"file",single:!0,allowExt:"mp3",callback:function(E){var q=E.data||{},z=q.selectItems||[],S=z[0];if(z.length){var b=(S==null?void 0:S.sourceInfo)||{};o.setState({audioHref:b.downloadUrl||b.h264Path?b.downloadUrl||b.h264Path:S.downloadUrl||S.h264Path})}}})},W=v=>{this.setState({autoplay:v.target.value})},x=v=>{this.setState({loop:v.target.value})};return(0,t.jsx)(m.Z,{title:"\u6DFB\u52A0mp3",visible:a,onOk:L,width:520,onCancel:s,maskClosable:!1,className:C().hrefModal,children:(0,t.jsxs)("div",{className:"divRow",children:[(0,t.jsx)("div",{className:"label",style:{marginBottom:0},children:"\u6587\u4EF6\u5730\u5740\uFF1A"}),(0,t.jsxs)("div",{className:"content",style:{paddingLeft:100,marginTop:-28},children:[(0,t.jsx)("a",{onClick:Z,children:"\u9009\u62E9\u97F3\u4E50\u6587\u4EF6"}),(0,t.jsx)($.Z,{value:l,onChange:y,style: