import{d as g,ah as f,ag as _,r as v,$ as y,c as o,aj as w,q as S,ak as I,P as z,m as n,g as c}from"./index.28bb778f.js";import{i as L}from"./icon-or.620acfd8.js";import{O as d}from"./index.82695db9.js";import{O as C}from"./index.08f6aad4.js";import{C as N}from"./index.9e732f91.js";import{C as k}from"./index.49de14a4.js";import{L as x}from"./index.4ac17938.js";import{P as D}from"./index.a84bc6c4.js";import"./use-tab-status.c9f6a196.js";import"./Picker.eaac7d1a.js";import"./index.d0943117.js";import"./index.0534ba7c.js";import"./index.1d9189ec.js";const G="_phoneDetail_zuput_1",P="_photoWrap_zuput_6",O="_photoItem_zuput_16",A="_gridImg_zuput_21",b="_iconNew_zuput_35",R="_iconImage_zuput_45",q="_gridName_zuput_49",F="_gridDes_zuput_56",H="_cellGroup_zuput_62",T="_imgSection_zuput_66",U="_select_zuput_80",V="_icon_zuput_35";var a={phoneDetail:G,photoWrap:P,photoItem:O,gridImg:A,iconNew:b,iconImage:R,gridName:q,gridDes:F,cellGroup:H,imgSection:T,select:U,icon:V},oe=g({name:"photo-detail",props:{orchestraId:{type:String,default:""}},setup(W){const u=f(),p=_(),e=v({refreshing:!1,loading:!1,finished:!1,pages:{page:1,rows:20},list:[],schoolStatus:!1,schoolList:[],school:{}}),i=async()=>{var t;e.refreshing&&(e.pages.page=1,e.finished=!1,e.list=[]),e.loading=!0;try{const s=await n.post(`${c.platformApi}/orchestraPhotoAlbum/page`,{data:{...e.pages,schoolId:e.school.id},hideLoading:!0});Array.isArray((t=s==null?void 0:s.data)==null?void 0:t.rows)&&(e.list=e.list.concat(s.data.rows),e.pages.page+=1,s.data.rows.length||(e.finished=!0))}catch{e.finished=!0}e.loading=!1,setTimeout(()=>{e.refreshing=!1},500)},h=async()=>{var t;try{const s=await n.post("/api-teacher/school/teacherSchoolPage",{data:{teacherId:c.user.data.id,page:1,rows:999}});Array.isArray((t=s.data)==null?void 0:t.rows)&&(e.schoolList=s.data.rows.map(l=>({name:l.schoolName||"",id:l.schoolId||""})),e.school=e.schoolList[0]||{})}catch{}};return y(async()=>{await h(),await i(),document.title=u.query.name||""}),()=>o("div",null,[o(d,{onGetHeight:t=>{document.documentElement.style.setProperty("--header-height",t+"px")}},{default:()=>[o(w,null,null)]}),e.schoolList.length>0&&o(d,{offsetTop:"var(--header-height)",onGetHeight:t=>{document.documentElement.style.setProperty("--header-cellGroup",t+"px")}},{default:()=>[o("div",{style:{overflow:"hidden"}},[o(N,{inset:!0,class:a.cellGroup},{default:()=>[o(k,{class:a.select,center:!0,isLink:!0,onClick:()=>e.schoolStatus=!0},{icon:()=>o("img",{class:a.icon,src:L},null),title:()=>o("div",{class:"van-ellipsis"},[e.school.name])})]})])]}),o(C,{modelValue:e.refreshing,"onUpdate:modelValue":t=>e.refreshing=t,onRefresh:()=>i()},{default:()=>[o("div",{class:[a.phoneDetail]},[!e.loading&&!!e.list.length&&o(x,{loading:e.loading,finished:e.finished,finishedText:"\u6CA1\u6709\u66F4\u591A\u6570\u636E",onLoad:i,immediateCheck:!1},{default:()=>[o("div",{class:a.photoWrap},[e.list.map((t,s)=>o("div",{class:a.photoItem,onClick:()=>{p.push({path:"/photo-list",query:{id:t.id,name:t.name}})}},[o("div",{class:a.imgSection},[o("div",{class:a.gridImg,style:t.coverUrl?{backgroundImage:`url(${t.coverUrl})`,backgroundSize:"cover"}:""},[t.newFlag?o("i",{class:a.iconNew},null):""])]),o("div",{class:a.gridName},[t.name]),o("div",{class:a.gridDes},[t.photoCount,S("\u5F20")])]))])]}),!e.loading&&!e.list.length&&o("div",{class:"emptyRootContainer",style:{minHeight:"78%"}},[o(I,{btnStatus:!1,tips:"\u6682\u65E0\u76F8\u518C"},null)]),o(z,{show:e.schoolStatus,"onUpdate:show":t=>e.schoolStatus=t,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[o(D,{columns:e.schoolList,columnsFieldNames:{text:"name",value:"id"},onCancel:()=>e.schoolStatus=!1,onConfirm:({selectedValues:t})=>{var r;const s=t[0]||"";if(e.schoolStatus=!1,s==((r=e.school)==null?void 0:r.id))return;const l=e.schoolList.find(m=>m.id==s)||{};e.school=l,e.pages.page=1,e.list=[],e.finished=!1,i()}},null)]})])]})])}});export{oe as default};
