!function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function t(t){for(var a=1;a0&&1===r.current)){e.next=11;break}return e.abrupt("return");case 11:o=r.rows||[],R.list=R.list.concat(o),R.listState.finished=r.current>=r.pages,R.params.page=r.current+1,R.listState.dataShow=R.list.length>0,R.isLoading=!1,e.next=24;break;case 19:e.prev=19,e.t0=e.catch(0),R.listState.dataShow=!1,R.listState.finished=!0,R.isLoading=!1;case 24:case"end":return e.stop()}}),e,null,[[0,19]])})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=r(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:R.photoName=R.selectItem.name,R.status=!0;case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_=function(){var e=r(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g({message:"您确认删除该相册吗?"}).then(r(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m.post("/api-school/orchestraPhotoAlbum/remove",{requestType:"form",data:{id:R.selectItem.id}});case 3:L(),e.next=8;break;case 6:e.prev=6,e.t0=e.catch(0);case 8:case"end":return e.stop()}}),e,null,[[0,6]])}))));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();c((function(){N()}));var q=function(e){return!!(e.size/1024/1024<5)||(h("上传文件大小不能超过 5MB"),!1)},U=function(e,t){return!0},A=function(){var e=r(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.status="uploading",t.message="上传中...",e.next=5,D(t);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),v();case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t,n){return e.apply(this,arguments)}}(),D=function(){var e=r(regeneratorRuntime.mark((function e(t){var n,a,r,o,i,c,s,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(t,"files"),n=t.file,"/api-school/open/getUploadSign",a=n.name||"",r="/orchestra/"+(a&&a.replace(/ /gi,"_")),o=(new Date).getTime()+r,e.next=9,m.post("/api-school/open/getUploadSign",{data:{filename:r,bucketName:R.bucket,postData:{filename:r,acl:"public-read",key:o,unknowValueField:[]}}});case 9:for(u in i=e.sent,b({message:"加载中...",forbidClick:!0,loadingType:"spinner",duration:0}),c={policy:i.data.policy,signature:i.data.signature,key:o,KSSAccessKeyId:i.data.kssAccessKeyId,acl:"public-read",name:r},s=new FormData,c)s.append(u,c[u]);return s.append("file",n,r),e.next=17,y(w(R.bucket),{method:"POST",data:s});case 17:l=w(R.bucket)+o,v(),t.src=l,t.status="done",e.next=27;break;case 23:e.prev=23,e.t0=e.catch(0),t.status="failed",console.log(e.t0,"uploadFile");case 27:case"end":return e.stop()}}),e,null,[[0,23]])})));return function(t){return e.apply(this,arguments)}}(),F=function(){var e=r(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!(R.fileList.length<=0)){e.next=4;break}return h("请上传照片"),e.abrupt("return");case 4:return t=R.fileList.map((function(e){return e.src})),console.log(t,"onSubmitPhoto"),e.next=8,m.post("/api-school/orchestraPhoto/save",{data:{orchestraId:n.query.orchestraId,orchestraPhotoAlbumId:n.query.parentId,fileUrl:t.join(",")}});case 8:R.showPhoto=!1,R.fileList=[],R.params.page=1,R.list=[],R.listState.dataShow=!0,R.listState.loading=!1,R.listState.finished=!1,N(),e.next=20;break;case 18:e.prev=18,e.t0=e.catch(0);case 20:case"end":return e.stop()}}),e,null,[[0,18]])})));return function(){return e.apply(this,arguments)}}();return function(){return s("div",{class:!R.listState.dataShow&&"emptyRootContainer"},[s(x,{position:"top"},{default:function(){return[s(u,{title:"创建相册"},null),s("div",{class:k.btnGroup},[s(l,{icon:"plus",block:!0,class:k.addPhone,onClick:function(){R.photoName="",R.status=!0,R.selectType="add"}},{default:function(){return[p("新建相册")]}}),s(l,{icon:"plus",block:!0,class:k.addPhone,onClick:function(){return R.showPhoto=!0}},{default:function(){return[p("上传照片")]}})])]}}),s("div",{class:k.phone},[R.listState.dataShow?s(S,{finished:R.listState.finished,finishedText:" ",onLoad:N,immediateCheck:!1,class:k.informationGroup},{default:function(){return[s("div",{class:k.phoneContainer},[R.list.map((function(e){return s("div",{class:k.item,onClick:function(){return function(e){sessionStorage.setItem("orchestra-detail-tab","photo"),O.push({path:"/photo-detail",query:{photoId:e.id,name:e.name}})}(e)}},[s("i",{class:k.more,onClick:function(t){t.stopPropagation(),R.oPopover=!0,R.selectItem=e,R.selectType="update"}},null),s("div",{class:k.img,style:e.coverUrl?{backgroundImage:"url(".concat(e.coverUrl,")"),backgroundSize:"cover"}:""},null),s("p",{class:[k.name,"van-ellipsis"]},[e.name]),s("p",{class:k.num},[e.photoCount,p("张")])])}))])]}}):s(d,{btnStatus:!1,tips:"暂无相册"},null),s(f,{show:R.status,"onUpdate:show":function(e){return R.status=e},round:!0,style:{width:"80%"}},{default:function(){return[s("div",{class:k.container},[s("div",{class:k.dialogTitle},[s("i",null,null),"add"===R.selectType?"新建相册":"重命名相册"]),s(P,{class:k.phoneName,modelValue:R.photoName,"onUpdate:modelValue":function(e){return R.photoName=e},placeholder:"请输入相册名称",maxlength:15},null),s("div",{class:["van-hairline--top van-dialog__footer"]},[s(l,{onClick:function(){return R.status=!1},class:["van-button van-button--default van-button--large van-dialog__cancel"]},{default:function(){return[p("取消")]}}),s(l,{onClick:C,class:["van-button van-button--default van-button--large van-dialog__confirm van-hairline--left"]},{default:function(){return[p("确认")]}})])])]}}),s(j,{cancelText:"取消",show:R.oPopover,"onUpdate:show":function(e){return R.oPopover=e},closeOnClickAction:!0,actions:[{name:"重命名",callback:function(){return T()}},{name:"删除",color:"#F44541",callback:function(){return _()}}]},null)]),s(f,{show:R.showPhoto,"onUpdate:show":function(e){return R.showPhoto=e},round:!0,style:{width:"92%"}},{default:function(){return[s("div",{class:k.container},[s("div",{class:k.dialogTitle},[s("i",null,null),p("上传照片")]),s("div",{class:k.photos},[s(I,{modelValue:R.fileList,"onUpdate:modelValue":function(e){return R.fileList=e},afterRead:A,beforeRead:q,beforeDelete:U,accept:"image/*",maxCount:9},null)]),s("div",{class:["van-hairline--top van-dialog__footer"]},[s(l,{onClick:function(){R.showPhoto=!1,R.fileList=[]},class:["van-button van-button--default van-button--large van-dialog__cancel"]},{default:function(){return[p("取消")]}}),s(l,{onClick:F,class:["van-button van-button--default van-button--large van-dialog__confirm van-hairline--left"]},{default:function(){return[p("确认")]}})])])]}})])}}}))}}}))}();