photo-legacy.7ede583b.js 7.0 KB

1
  1. !function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?e(Object(a),!0).forEach((function(e){n(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,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 r(e,t,n,r,a,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(r,a)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(a,o){var i=e.apply(t,n);function s(e){r(i,a,o,s,c,"next",e)}function c(e){r(i,a,o,s,c,"throw",e)}s(void 0)}))}}System.register(["./index-legacy.48c8d62c.js","./photo.module-legacy.43141335.js","./index-legacy.8cf5f94f.js","./index-legacy.f3037807.js","./index-legacy.04f465c8.js","./index-legacy.55fe5b03.js","./index-legacy.b7e8815a.js","./index-legacy.ac553194.js","./use-tab-status-legacy.6949b1de.js","./index-legacy.087e0425.js"],(function(e){"use strict";var n,r,o,i,s,c,u,l,p,f,d,h,m,g,v,b,y,w,x;return{setters:[function(e){n=e.d,r=e.aV,o=e.ag,i=e.r,s=e.$,c=e.c,u=e.q,l=e.ai,p=e.P,f=e.B,d=e.o,h=e.m,m=e.b6},function(e){g=e.s},function(e){v=e.O},function(e){b=e.O},function(e){y=e.L},function(e){w=e.F},function(e){x=e.A},function(){},function(){},function(){}],execute:function(){e("default",n({name:"phone",props:{height:{type:[String,Number],default:"auto"}},setup:function(e){var n=r(),k=o(),S=i({oPopover:!1,status:!1,isLoading:!1,photoName:null,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{page:1,rows:20},selectItem:{},selectType:"add",schoolStatus:!1,schoolList:[],school:{}}),j=function(){var e=a(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,S.photoName){e.next=5;break}return d("请输入相册名称"),S.status=!0,e.abrupt("return");case 5:if("add"!==S.selectType){e.next=13;break}return e.next=8,h.post("/api-school/orchestraPhotoAlbum/save",{data:{name:S.photoName}});case 8:S.status=!1,S.photoName=null,P(),e.next=18;break;case 13:return e.next=15,h.post("/api-school/orchestraPhotoAlbum/update",{data:{id:S.selectItem.id,orchestraId:n.query.id,name:S.photoName}});case 15:S.status=!1,S.photoName=null,P();case 18:S.status=!1,S.photoName=null,P(),e.next=25;break;case 23:e.prev=23,e.t0=e.catch(0);case 25:case"end":return e.stop()}}),e,null,[[0,23]])})));return function(){return e.apply(this,arguments)}}(),P=function(){S.params.page=1,S.list=[],S.listState.dataShow=!0,S.listState.loading=!1,S.listState.finished=!1,O()},O=function(){var e=a(regeneratorRuntime.mark((function e(){var n,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!S.isLoading){e.next=3;break}return e.abrupt("return");case 3:return S.isLoading=!0,e.next=6,h.post("/api-school/orchestraPhotoAlbum/page",{data:t(t({},S.params),{},{schoolId:S.school.id})});case 6:if(n=e.sent,S.listState.loading=!1,r=n.data||{},!(S.list.length>0&&1===r.current)){e.next=11;break}return e.abrupt("return");case 11:a=r.rows||[],S.list=S.list.concat(a),S.listState.finished=r.current>=r.pages,S.params.page=r.current+1,S.listState.dataShow=S.list.length>0,S.isLoading=!1,e.next=24;break;case 19:e.prev=19,e.t0=e.catch(0),S.listState.dataShow=!1,S.listState.finished=!0,S.isLoading=!1;case 24:case"end":return e.stop()}}),e,null,[[0,19]])})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=a(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:S.photoName=S.selectItem.name,S.status=!0;case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),R=function(){var e=a(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:m({message:"您确认删除该相册吗?"}).then(a(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:S.selectItem.id}});case 3:P(),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)}}();return s(a(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O();case 2:case"end":return e.stop()}}),e)})))),function(){return c("div",{class:[g.phone,!S.listState.dataShow&&"emptyRootContainer"],style:{minHeight:"calc(100vh - ".concat(e.height,"px)")}},[c(v,{position:"top"},{default:function(){return[c(b,null,{right:function(){return c("span",{class:g.addPhotoTop,onClick:function(){S.photoName="",S.status=!0,S.selectType="add"}},[u("添加相册")])}})]}}),S.listState.dataShow?c(y,{finished:S.listState.finished,finishedText:" ",onLoad:O,immediateCheck:!1,class:g.informationGroup},{default:function(){return[c("div",{class:g.phoneContainer},[S.list.map((function(e){return c("div",{class:g.item,onClick:function(){return function(e){sessionStorage.setItem("orchestra-detail-tab","photo"),k.push({path:"/orchestra-photo-create",query:{orchestraId:n.query.id,name:e.name,parentId:e.id}})}(e)}},[c("i",{class:g.more,onClick:function(t){t.stopPropagation(),S.oPopover=!0,S.selectItem=e,S.selectType="update"}},null),c("div",{class:g.img,style:e.coverUrl?{backgroundImage:"url(".concat(e.coverUrl,")"),backgroundSize:"cover"}:""},null),c("p",{class:[g.name,"van-ellipsis"]},[e.name]),c("p",{class:g.num},[e.photoCount,u("张")])])}))])]}}):c(l,{btnStatus:!1,tips:"暂无相册"},null),c(p,{show:S.status,"onUpdate:show":function(e){return S.status=e},round:!0,style:{width:"80%"}},{default:function(){return[c("div",{class:g.container},[c("div",{class:g.dialogTitle},[c("i",null,null),"add"===S.selectType?"新建相册":"重命名相册"]),c(w,{class:g.phoneName,modelValue:S.photoName,"onUpdate:modelValue":function(e){return S.photoName=e},placeholder:"请输入相册名称",maxlength:15},null),c("div",{class:["van-hairline--top van-dialog__footer"]},[c(f,{onClick:function(){return S.status=!1},class:["van-button van-button--default van-button--large van-dialog__cancel"]},{default:function(){return[u("取消")]}}),c(f,{onClick:j,class:["van-button van-button--default van-button--large van-dialog__confirm van-hairline--left"]},{default:function(){return[u("确认")]}})])])]}}),c(x,{cancelText:"取消",show:S.oPopover,"onUpdate:show":function(e){return S.oPopover=e},closeOnClickAction:!0,actions:[{name:"重命名",callback:function(){return N()}},{name:"删除",color:"#F44541",callback:function(){return R()}}]},null)])}}}))}}}))}();