import{d as g,ah as f,ag as _,r as v,$ as y,c as t,aj as k,q as w,ak as S,P as I,m as n,g as c}from"./index.8f93de0e.js";import{i as j}from"./icon-or.620acfd8.js";import{O as d}from"./index.a9a604b9.js";import{O as L}from"./index.ac6701a3.js";import{C}from"./index.b1095de8.js";import{C as N}from"./index.f729b332.js";import{L as x}from"./index.1e20fccc.js";import{P as D}from"./index.16055f9a.js";import"./use-tab-status.69e46758.js";import"./Picker.205ddaba.js";import"./index.b21db77d.js";import"./index.42161f4c.js";import"./index.eb2ddb38.js";const G="_phoneDetail_kjahe_1",P="_photoWrap_kjahe_6",O="_photoItem_kjahe_16",A="_gridImg_kjahe_20",b="_iconNew_kjahe_34",R="_iconImage_kjahe_44",q="_gridName_kjahe_48",F="_gridDes_kjahe_55",H="_cellGroup_kjahe_61",T="_imgSection_kjahe_65",U="_select_kjahe_79",V="_icon_kjahe_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},te=g({name:"photo-detail",props:{orchestraId:{type:String,default:""}},setup(W){const h=f(),p=_(),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)},u=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 u(),await i(),document.title=h.query.name||""}),()=>t("div",null,[t(d,{onGetHeight:o=>{document.documentElement.style.setProperty("--header-height",o+"px")}},{default:()=>[t(k,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(C,{inset:!0,class:a.cellGroup},{default:()=>[t(N,{class:a.select,center:!0,isLink:!0,onClick:()=>e.schoolStatus=!0},{icon:()=>t("img",{class:a.icon,src:j},null),title:()=>t("div",{class:"van-ellipsis"},[e.school.name])})]})])]}),t(L,{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:()=>{p.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},[o.name]),t("div",{class:a.gridDes},[o.photoCount,w("\u5F20")])]))])]}),!e.loading&&!e.list.length&&t("div",{class:"emptyRootContainer",style:{minHeight:"78%"}},[t(S,{btnStatus:!1,tips:"\u6682\u65E0\u76F8\u518C"},null)]),t(I,{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{te as default};
