photo-legacy.5ebaa13b.js 4.1 KB

1
  1. System.register(["./index-legacy.eb062188.js","./photo.module-legacy.43141335.js","./index-legacy.ad813f4d.js","./index-legacy.fad72574.js","./index-legacy.3a3e070a.js","./index-legacy.8c254533.js","./use-tab-status-legacy.91417466.js","./index-legacy.918b8c74.js"],(function(t){"use strict";var a,e,o,s,n,l,i,c,d,r,u,h,p,m,g,f,y,v,S;return{setters:[function(t){a=t.d,e=t.ah,o=t.ag,s=t.r,n=t.$,l=t.c,i=t.aj,c=t.q,d=t.ak,r=t.P,u=t.B,h=t.o,p=t.m,m=t.bd},function(t){g=t.s},function(t){f=t.O},function(t){y=t.L},function(t){v=t.F},function(t){S=t.A},function(){},function(){}],execute:function(){t("default",a({name:"phone",props:{height:{type:[String,Number],default:"auto"}},setup(t){const a=e(),b=o(),w=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:{}}),N=async()=>{try{if(!w.photoName)return h("请输入相册名称"),void(w.status=!0);"add"===w.selectType?(await p.post("/api-school/orchestraPhotoAlbum/save",{data:{name:w.photoName}}),w.status=!1,w.photoName=null,k()):(await p.post("/api-school/orchestraPhotoAlbum/update",{data:{id:w.selectItem.id,orchestraId:a.query.id,name:w.photoName}}),w.status=!1,w.photoName=null,k()),w.status=!1,w.photoName=null,k()}catch{}},k=()=>{w.params.page=1,w.list=[],w.listState.dataShow=!0,w.listState.loading=!1,w.listState.finished=!1,x()},x=async()=>{try{if(w.isLoading)return;w.isLoading=!0;const t=await p.post("/api-school/orchestraPhotoAlbum/page",{data:{...w.params,schoolId:w.school.id}});w.listState.loading=!1;const a=t.data||{};if(w.list.length>0&&1===a.current)return;const e=a.rows||[];w.list=w.list.concat(e),w.listState.finished=a.current>=a.pages,w.params.page=a.current+1,w.listState.dataShow=w.list.length>0,w.isLoading=!1}catch{w.listState.dataShow=!1,w.listState.finished=!0,w.isLoading=!1}};return n((async()=>{await x()})),()=>l("div",{class:[g.phone,!w.listState.dataShow&&"emptyRootContainer"],style:{minHeight:`calc(100vh - ${t.height}px)`}},[l(f,{position:"top"},{default:()=>[l(i,null,{right:()=>l("span",{class:g.addPhotoTop,onClick:()=>{w.photoName="",w.status=!0,w.selectType="add"}},[c("添加相册")])})]}),w.listState.dataShow?l(y,{finished:w.listState.finished,finishedText:" ",onLoad:x,immediateCheck:!1,class:g.informationGroup},{default:()=>[l("div",{class:g.phoneContainer},[w.list.map((t=>l("div",{class:g.item,onClick:()=>(t=>{sessionStorage.setItem("orchestra-detail-tab","photo"),b.push({path:"/orchestra-photo-create",query:{orchestraId:a.query.id,name:t.name,parentId:t.id}})})(t)},[l("i",{class:g.more,onClick:a=>{a.stopPropagation(),w.oPopover=!0,w.selectItem=t,w.selectType="update"}},null),l("div",{class:g.img,style:t.coverUrl?{backgroundImage:`url(${t.coverUrl})`,backgroundSize:"cover"}:""},null),l("p",{class:[g.name,"van-ellipsis"]},[t.name]),l("p",{class:g.num},[t.photoCount,c("张")])])))])]}):l(d,{btnStatus:!1,tips:"暂无相册"},null),l(r,{show:w.status,"onUpdate:show":t=>w.status=t,round:!0,style:{width:"80%"}},{default:()=>[l("div",{class:g.container},[l("div",{class:g.dialogTitle},[l("i",null,null),"add"===w.selectType?"新建相册":"重命名相册"]),l(v,{class:g.phoneName,modelValue:w.photoName,"onUpdate:modelValue":t=>w.photoName=t,placeholder:"请输入相册名称",maxlength:15},null),l("div",{class:["van-hairline--top van-dialog__footer"]},[l(u,{onClick:()=>w.status=!1,class:["van-button van-button--default van-button--large van-dialog__cancel"]},{default:()=>[c("取消")]}),l(u,{onClick:N,class:["van-button van-button--default van-button--large van-dialog__confirm van-hairline--left"]},{default:()=>[c("确认")]})])])]}),l(S,{cancelText:"取消",show:w.oPopover,"onUpdate:show":t=>w.oPopover=t,closeOnClickAction:!0,actions:[{name:"重命名",callback:()=>(async()=>{w.photoName=w.selectItem.name,w.status=!0})()},{name:"删除",color:"#F44541",callback:()=>(async()=>{m({message:"您确认删除该相册吗?"}).then((async()=>{try{await p.post("/api-school/orchestraPhotoAlbum/remove",{requestType:"form",data:{id:w.selectItem.id}}),k()}catch{}}))})()}]},null)])}}))}}}));