index.b52461bd.js 3.8 KB

1
  1. import{d as g,aV as f,ag as y,r as _,$ as v,c as o,q as x,ai as w,P as I,m as n,f as c}from"./index.ffe80dbe.js";import{O as L}from"./index.a0ef77e4.js";import{i as S}from"./icon-or.620acfd8.js";import{O as d}from"./index.4ddd16f0.js";import{O as C}from"./index.45b38760.js";import{C as N}from"./index.914765a1.js";import{C as k}from"./index.ea031708.js";import{L as D}from"./index.cafcb8b5.js";import{P as G}from"./index.777c6c1a.js";import"./index.1d5c6f70.js";import"./use-tab-status.5a3cd090.js";import"./index.466e527a.js";import"./index.b4b77b5a.js";import"./index.02edecb1.js";const O="_phoneDetail_1ydtx_1",P="_photoWrap_1ydtx_6",A="_photoItem_1ydtx_16",b="_gridImg_1ydtx_21",R="_iconNew_1ydtx_35",V="_iconImage_1ydtx_45",q="_gridName_1ydtx_49",F="_gridDes_1ydtx_55",H="_cellGroup_1ydtx_61",T="_select_1ydtx_65",U="_icon_1ydtx_35";var a={phoneDetail:O,photoWrap:P,photoItem:A,gridImg:b,iconNew:R,iconImage:V,gridName:q,gridDes:F,cellGroup:H,select:T,icon:U},oe=g({name:"photo-detail",props:{orchestraId:{type:String,default:""}},setup(W){const h=f(),p=y(),e=_({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)},u=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 v(async()=>{await u(),await i(),document.title=h.query.name||""}),()=>o("div",null,[o(d,{onGetHeight:t=>{document.documentElement.style.setProperty("--header-height",t+"px")}},{default:()=>[o(L,null,null)]}),o(d,{offsetTop:"var(--header-height)",onGetHeight:t=>{document.documentElement.style.setProperty("--header-cellGroup",t+"px")}},{default:()=>[e.schoolList.length>0&&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:S},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(D,{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.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,x("\u5F20")])]))])]}),!e.loading&&!e.list.length&&o("div",{class:"emptyRootContainer",style:{minHeight:"78%"}},[o(w,{btnStatus:!1,tips:"\u6682\u65E0\u76F8\u518C"},null)]),o(I,{show:e.schoolStatus,"onUpdate:show":t=>e.schoolStatus=t,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[o(G,{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};