1 |
- !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;a<arguments.length;a++){var r=null!=arguments[a]?arguments[a]:{};a%2?e(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t,n,a,r,o,i){try{var c=e[o](i),s=c.value}catch(u){return void n(u)}c.done?t(s):Promise.resolve(s).then(a,r)}function r(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function c(e){a(i,r,o,c,s,"next",e)}function s(e){a(i,r,o,c,s,"throw",e)}c(void 0)}))}}System.register(["./index-legacy.48c8d62c.js","./photo.module-legacy.43141335.js","./index-legacy.f3037807.js","./index-legacy.8cf5f94f.js","./index-legacy.04f465c8.js","./index-legacy.55fe5b03.js","./index-legacy.b7e8815a.js","./index-legacy.3a3809b6.js","./index-legacy.ac553194.js","./use-tab-status-legacy.6949b1de.js","./index-legacy.087e0425.js","./index-legacy.71f28922.js","./ImagePreview-legacy.caacc6f4.js","./index-legacy.71047e87.js","./index-legacy.0e0de364.js","./function-call-legacy.ac971547.js"],(function(e){"use strict";var n,a,o,i,c,s,u,l,p,d,f,h,m,g,v,b,y,w,k,x,S,P,j,I;return{setters:[function(e){n=e.d,a=e.aV,o=e.ag,i=e.r,c=e.$,s=e.c,u=e.B,l=e.q,p=e.ai,d=e.P,f=e.o,h=e.m,m=e.b6,g=e.be,v=e.bl,b=e.bv,y=e.bw},function(e){w=e.s},function(e){k=e.O},function(e){x=e.O},function(e){S=e.L},function(e){P=e.F},function(e){j=e.A},function(e){I=e.U},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){e("default",n({name:"phone",props:{height:{type:[String,Number],default:"auto"}},setup:function(e){var n=a(),O=o(),R=i({oPopover:!1,showPhoto:!1,status:!1,isLoading:!1,photoName:null,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{page:1,rows:20},selectItem:{},selectType:"add",fileList:[],bucket:"gyt"}),C=function(){var e=r(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,R.photoName){e.next=5;break}return f("请输入相册名称"),R.status=!0,e.abrupt("return");case 5:if("add"!==R.selectType){e.next=13;break}return e.next=8,h.post("/api-school/orchestraPhotoAlbum/save",{data:{orchestraId:n.query.orchestraId,name:R.photoName,parentId:n.query.parentId}});case 8:R.status=!1,R.photoName=null,L(),e.next=18;break;case 13:return e.next=15,h.post("/api-school/orchestraPhotoAlbum/update",{data:{id:R.selectItem.id,orchestraId:n.query.orchestraId,parentId:n.query.parentId,name:R.photoName}});case 15:R.status=!1,R.photoName=null,L();case 18:e.next=22;break;case 20:e.prev=20,e.t0=e.catch(0);case 22:case"end":return e.stop()}}),e,null,[[0,20]])})));return function(){return e.apply(this,arguments)}}(),L=function(){R.params.page=1,R.list=[],R.listState.dataShow=!0,R.listState.loading=!1,R.listState.finished=!1,N()},N=function(){var e=r(regeneratorRuntime.mark((function e(){var a,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!R.isLoading){e.next=3;break}return e.abrupt("return");case 3:return R.isLoading=!0,e.next=6,h.post("/api-school/orchestraPhotoAlbum/page",{data:t(t({},R.params),{},{orchestraId:n.query.orchestraId,parentId:n.query.parentId})});case 6:if(a=e.sent,R.listState.loading=!1,r=a.data||{},!(R.list.length>0&&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:m({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,h.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)||(f("上传文件大小不能超过 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),g();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,h.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,v({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,b(y(R.bucket),{method:"POST",data:s});case 17:l=y(R.bucket)+o,g(),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)}}(),V=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 f("请上传照片"),e.abrupt("return");case 4:return t=R.fileList.map((function(e){return e.src})),console.log(t,"onSubmitPhoto"),e.next=8,h.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(k,{title:"创建相册"},null),s("div",{class:w.btnGroup},[s(u,{icon:"plus",block:!0,class:w.addPhone,onClick:function(){R.photoName="",R.status=!0,R.selectType="add"}},{default:function(){return[l("新建相册")]}}),s(u,{icon:"plus",block:!0,class:w.addPhone,onClick:function(){return R.showPhoto=!0}},{default:function(){return[l("上传照片")]}})])]}}),s("div",{class:w.phone},[R.listState.dataShow?s(S,{finished:R.listState.finished,finishedText:" ",onLoad:N,immediateCheck:!1,class:w.informationGroup},{default:function(){return[s("div",{class:w.phoneContainer},[R.list.map((function(e){return s("div",{class:w.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:w.more,onClick:function(t){t.stopPropagation(),R.oPopover=!0,R.selectItem=e,R.selectType="update"}},null),s("div",{class:w.img,style:e.coverUrl?{backgroundImage:"url(".concat(e.coverUrl,")"),backgroundSize:"cover"}:""},null),s("p",{class:[w.name,"van-ellipsis"]},[e.name]),s("p",{class:w.num},[e.photoCount,l("张")])])}))])]}}):s(p,{btnStatus:!1,tips:"暂无相册"},null),s(d,{show:R.status,"onUpdate:show":function(e){return R.status=e},round:!0,style:{width:"80%"}},{default:function(){return[s("div",{class:w.container},[s("div",{class:w.dialogTitle},[s("i",null,null),"add"===R.selectType?"新建相册":"重命名相册"]),s(P,{class:w.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(u,{onClick:function(){return R.status=!1},class:["van-button van-button--default van-button--large van-dialog__cancel"]},{default:function(){return[l("取消")]}}),s(u,{onClick:C,class:["van-button van-button--default van-button--large van-dialog__confirm van-hairline--left"]},{default:function(){return[l("确认")]}})])])]}}),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(d,{show:R.showPhoto,"onUpdate:show":function(e){return R.showPhoto=e},round:!0,style:{width:"92%"}},{default:function(){return[s("div",{class:w.container},[s("div",{class:w.dialogTitle},[s("i",null,null),l("上传照片")]),s("div",{class:w.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(u,{onClick:function(){R.showPhoto=!1,R.fileList=[]},class:["van-button van-button--default van-button--large van-dialog__cancel"]},{default:function(){return[l("取消")]}}),s(u,{onClick:V,class:["van-button van-button--default van-button--large van-dialog__confirm van-hairline--left"]},{default:function(){return[l("确认")]}})])])]}})])}}}))}}}))}();
|