photo-legacy.71f7b49c.js 6.9 KB

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