import{d as u,ah as f,ag as _,r as v,$ as y,c as t,aj as w,q as S,ak as I,P as z,m as n,g as c}from"./index.27735e87.js";import{i as L}from"./icon-or.620acfd8.js";import{O as d}from"./index.71a5f9d3.js";import{O as C}from"./index.8c4977a2.js";import{C as N}from"./index.5a2d3ded.js";import{C as k}from"./index.997909e4.js";import{L as x}from"./index.ebf6ccaa.js";import{P as D}from"./index.48d9d4f7.js";import"./index.18f2dec1.js";import"./index.d02ae1ba.js";import"./use-tab-status.d6e8df54.js";import"./Picker.17d614ab.js";import"./index.b3b4f4a0.js";import"./index.d691a7aa.js";import"./index.915902eb.js";const G="_phoneDetail_1gpfz_1",P="_photoWrap_1gpfz_6",O="_photoItem_1gpfz_16",A="_gridImg_1gpfz_20",b="_iconNew_1gpfz_34",R="_iconImage_1gpfz_44",q="_gridName_1gpfz_48",F="_gridDes_1gpfz_56",H="_cellGroup_1gpfz_62",T="_imgSection_1gpfz_66",U="_select_1gpfz_80",V="_icon_1gpfz_34";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},ae=u({name:"photo-detail",props:{orchestraId:{type:String,default:""}},setup(W){const p=f(),h=_(),e=v({refreshing:!1,loading:!1,finished:!1,pages:{page:1,rows:20},list:[],schoolStatus:!1,schoolList:[],school:{}}),i=async()=>{var o;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((o=s==null?void 0:s.data)==null?void 0:o.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)},g=async()=>{var o;try{const s=await n.post("/api-teacher/school/teacherSchoolPage",{data:{teacherId:c.user.data.id,page:1,rows:999}});Array.isArray((o=s.data)==null?void 0:o.rows)&&(e.schoolList=s.data.rows.map(l=>({name:l.schoolName||"",id:l.schoolId||""})),e.school=e.schoolList[0]||{})}catch{}};return y(async()=>{await g(),await i(),document.title=p.query.name||""}),()=>t("div",null,[t(d,{onGetHeight:o=>{document.documentElement.style.setProperty("--header-height",o+"px")}},{default:()=>[t(w,null,null)]}),e.schoolList.length>0&&t(d,{offsetTop:"var(--header-height)",onGetHeight:o=>{document.documentElement.style.setProperty("--header-cellGroup",o+"px")}},{default:()=>[t("div",{style:{overflow:"hidden"}},[t(N,{inset:!0,class:a.cellGroup},{default:()=>[t(k,{class:a.select,center:!0,isLink:!0,onClick:()=>e.schoolStatus=!0},{icon:()=>t("img",{class:a.icon,src:L},null),title:()=>t("div",{class:"van-ellipsis"},[e.school.name])})]})])]}),t(C,{modelValue:e.refreshing,"onUpdate:modelValue":o=>e.refreshing=o,onRefresh:()=>i()},{default:()=>[t("div",{class:[a.phoneDetail]},[!e.loading&&!!e.list.length&&t(x,{loading:e.loading,finished:e.finished,finishedText:"\u6CA1\u6709\u66F4\u591A\u6570\u636E",onLoad:i,immediateCheck:!1},{default:()=>[t("div",{class:a.photoWrap},[e.list.map((o,s)=>t("div",{class:a.photoItem,onClick:()=>{h.push({path:"/photo-list",query:{id:o.id,name:o.name}})}},[t("div",{class:a.imgSection},[t("div",{class:a.gridImg,style:o.coverUrl?{backgroundImage:`url(${o.coverUrl})`,backgroundSize:"cover"}:""},[o.newFlag?t("i",{class:a.iconNew},null):""])]),t("div",{class:[a.gridName,"van-ellipsis"]},[o.name]),t("div",{class:a.gridDes},[o.photoCount,S("\u5F20")])]))])]}),!e.loading&&!e.list.length&&t("div",{class:"emptyRootContainer",style:{minHeight:"78%"}},[t(I,{btnStatus:!1,tips:"\u6682\u65E0\u76F8\u518C"},null)]),t(z,{show:e.schoolStatus,"onUpdate:show":o=>e.schoolStatus=o,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[t(D,{columns:e.schoolList,columnsFieldNames:{text:"name",value:"id"},onCancel:()=>e.schoolStatus=!1,onConfirm:({selectedValues:o})=>{var r;const s=o[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{ae as default};
