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 s=e[o](i),c=s.value}catch(u){return void n(u)}s.done?t(c):Promise.resolve(c).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 s(e){a(i,r,o,s,c,"next",e)}function c(e){a(i,r,o,s,c,"throw",e)}s(void 0)}))}}System.register(["./index-legacy.90c82f08.js","./photo.module-legacy.43141335.js","./index-legacy.84457c4c.js","./oss-file-upload-legacy.be0f8098.js","./index-legacy.789a0824.js","./index-legacy.3c5580aa.js","./index-legacy.2870cc6d.js","./index-legacy.617aab72.js","./ImagePreview-legacy.356ad326.js","./index-legacy.64e3b474.js","./index-legacy.eb4bc59e.js","./function-call-legacy.aee1e992.js","./use-tab-status-legacy.bafe466c.js","./index-legacy.f3e5e283.js"],(function(e){"use strict";var n,a,o,i,s,c,u,l,p,f,d,h,m,g,v,b,y,w,k,x,P,S,j,I,O;return{setters:[function(e){n=e.d,a=e.ah,o=e.ag,i=e.r,s=e.$,c=e.c,u=e.aj,l=e.B,p=e.q,f=e.ak,d=e.P,h=e.o,m=e.m,g=e.b9,v=e.bf,b=e.bq,y=e.bA},function(e){w=e.s},function(e){k=e.O},function(e){x=e.U,P=e.g,S=e.o},function(e){j=e.L},function(e){I=e.F},function(e){O=e.A},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(),R=o(),C=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"}),L=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,C.photoName){e.next=5;break}return h("请输入相册名称"),C.status=!0,e.abrupt("return");case 5:if("add"!==C.selectType){e.next=13;break}return e.next=8,m.post("/api-school/orchestraPhotoAlbum/save",{data:{orchestraId:n.query.orchestraId,name:C.photoName,parentId:n.query.parentId}});case 8:C.status=!1,C.photoName=null,N(),e.next=18;break;case 13:return e.next=15,m.post("/api-school/orchestraPhotoAlbum/update",{data:{id:C.selectItem.id,orchestraId:n.query.orchestraId,parentId:n.query.parentId,name:C.photoName}});case 15:C.status=!1,C.photoName=null,N();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)}}(),N=function(){C.params.page=1,C.list=[],C.listState.dataShow=!0,C.listState.loading=!1,C.listState.finished=!1,_()},_=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,!C.isLoading){e.next=3;break}return e.abrupt("return");case 3:return C.isLoading=!0,e.next=6,m.post("/api-school/orchestraPhotoAlbum/page",{data:t(t({},C.params),{},{orchestraId:n.query.orchestraId,parentId:n.query.parentId})});case 6:if(a=e.sent,C.listState.loading=!1,r=a.data||{},!(C.list.length>0&&1===r.current)){e.next=11;break}return e.abrupt("return");case 11:o=r.rows||[],C.list=C.list.concat(o),C.listState.finished=r.current>=r.pages,C.params.page=r.current+1,C.listState.dataShow=C.list.length>0,C.isLoading=!1,e.next=24;break;case 19:e.prev=19,e.t0=e.catch(0),C.listState.dataShow=!1,C.listState.finished=!0,C.isLoading=!1;case 24:case"end":return e.stop()}}),e,null,[[0,19]])})));return function(){return e.apply(this,arguments)}}(),q=function(){var e=r(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C.photoName=C.selectItem.name,C.status=!0;case 2:case"end":return e.stop()}}),e)})));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: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:C.selectItem.id}});case 3:N(),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)}}();s((function(){_()}));var A=function(e){return!!(e.size/1024/1024<5)||(h("上传文件大小不能超过 5MB"),!1)},U=function(e,t){return!0},D=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,V(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)}}(),V=function(){var e=r(regeneratorRuntime.mark((function e(t){var n,a,r,o,i,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log(t,"files"),n=t.file,a=n.name||"",r="/orchestra/"+(a&&a.replace(/ /gi,"_")),o=(new Date).getTime()+r,e.next=8,P({filename:o,bucketName:C.bucket,postData:{filename:o,acl:"public-read",key:o,unknowValueField:[]}});case 8:return i=e.sent,s=i.data,b({message:"加载中...",forbidClick:!0,loadingType:"spinner",duration:0}),c={policy:s.policy,signature:s.signature,key:o,KSSAccessKeyId:s.kssAccessKeyId,acl:"public-read",name:o,file:n},e.next=14,S(y(C.bucket),c);case 14:u=e.sent,v(),t.src=u,t.status="done",e.next=24;break;case 20:e.prev=20,e.t0=e.catch(0),t.status="failed",console.log(e.t0,"uploadFile");case 24:case"end":return e.stop()}}),e,null,[[0,20]])})));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,!(C.fileList.length<=0)){e.next=4;break}return h("请上传照片"),e.abrupt("return");case 4:return t=C.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:C.showPhoto=!1,C.fileList=[],C.params.page=1,C.list=[],C.listState.dataShow=!0,C.listState.loading=!1,C.listState.finished=!1,_(),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 c("div",{class:!C.listState.dataShow&&"emptyRootContainer"},[c(k,{position:"top"},{default:function(){return[c(u,{title:"创建相册"},null),c("div",{class:w.btnGroup},[c(l,{icon:"plus",block:!0,class:w.addPhone,onClick:function(){C.photoName="",C.status=!0,C.selectType="add"}},{default:function(){return[p("新建相册")]}}),c(l,{icon:"plus",block:!0,class:w.addPhone,onClick:function(){return C.showPhoto=!0}},{default:function(){return[p("上传照片")]}})])]}}),c("div",{class:w.phone},[C.listState.dataShow?c(j,{finished:C.listState.finished,finishedText:" ",onLoad:_,immediateCheck:!1,class:w.informationGroup},{default:function(){return[c("div",{class:w.phoneContainer},[C.list.map((function(e){return c("div",{class:w.item,onClick:function(){return function(e){sessionStorage.setItem("orchestra-detail-tab","photo"),R.push({path:"/photo-detail",query:{photoId:e.id,name:e.name}})}(e)}},[c("i",{class:w.more,onClick:function(t){t.stopPropagation(),C.oPopover=!0,C.selectItem=e,C.selectType="update"}},null),c("div",{class:w.img,style:e.coverUrl?{backgroundImage:"url(".concat(e.coverUrl,")"),backgroundSize:"cover"}:""},null),c("p",{class:[w.name,"van-ellipsis"]},[e.name]),c("p",{class:w.num},[e.photoCount,p("张")])])}))])]}}):c(f,{btnStatus:!1,tips:"暂无相册"},null),c(d,{show:C.status,"onUpdate:show":function(e){return C.status=e},round:!0,style:{width:"80%"}},{default:function(){return[c("div",{class:w.container},[c("div",{class:w.dialogTitle},[c("i",null,null),"add"===C.selectType?"新建相册":"重命名相册"]),c(I,{class:w.phoneName,modelValue:C.photoName,"onUpdate:modelValue":function(e){return C.photoName=e},placeholder:"请输入相册名称",maxlength:15},null),c("div",{class:["van-hairline--top van-dialog__footer"]},[c(l,{onClick:function(){return C.status=!1},class:["van-button van-button--default van-button--large van-dialog__cancel"]},{default:function(){return[p("取消")]}}),c(l,{onClick:L,class:["van-button van-button--default van-button--large van-dialog__confirm van-hairline--left"]},{default:function(){return[p("确认")]}})])])]}}),c(O,{cancelText:"取消",show:C.oPopover,"onUpdate:show":function(e){return C.oPopover=e},closeOnClickAction:!0,actions:[{name:"重命名",callback:function(){return q()}},{name:"删除",color:"#F44541",callback:function(){return T()}}]},null)]),c(d,{show:C.showPhoto,"onUpdate:show":function(e){return C.showPhoto=e},round:!0,style:{width:"92%"}},{default:function(){return[c("div",{class:w.container},[c("div",{class:w.dialogTitle},[c("i",null,null),p("上传照片")]),c("div",{class:w.photos},[c(x,{modelValue:C.fileList,"onUpdate:modelValue":function(e){return C.fileList=e},afterRead:D,beforeRead:A,beforeDelete:U,accept:"image/*",maxCount:9},null)]),c("div",{class:["van-hairline--top van-dialog__footer"]},[c(l,{onClick:function(){C.showPhoto=!1,C.fileList=[]},class:["van-button van-button--default van-button--large van-dialog__cancel"]},{default:function(){return[p("取消")]}}),c(l,{onClick:F,class:["van-button van-button--default van-button--large van-dialog__confirm van-hairline--left"]},{default:function(){return[p("确认")]}})])])]}})])}}}))}}}))}();
|