index.c49e9888.js 3.8 KB

1
  1. import{d as g,ah as f,ag as v,r as _,$ as y,c as t,aj as w,q as x,ak as I,P as q,m as n,g as c}from"./index.5f7ffb46.js";import{i as C}from"./icon-or.620acfd8.js";import{O as d}from"./index.7790de2a.js";import{O as L}from"./index.1d6ac2c5.js";import{C as S}from"./index.052b3caa.js";import{C as N}from"./index.abd668f7.js";import{L as k}from"./index.9ef28852.js";import{P as A}from"./index.de1f78a6.js";import"./use-tab-status.69b57a37.js";import"./Picker.148c9d83.js";import"./index.6bbd7daa.js";import"./index.99e0cf1f.js";import"./index.61ab9823.js";const D="_phoneDetail_ivqxi_1",G="_photoWrap_ivqxi_6",P="_photoItem_ivqxi_16",O="_gridImg_ivqxi_21",F="_iconNew_ivqxi_35",b="_iconImage_ivqxi_45",E="_gridName_ivqxi_49",R="_gridDes_ivqxi_56",H="_cellGroup_ivqxi_62",T="_select_ivqxi_66",U="_icon_ivqxi_35";var a={phoneDetail:D,photoWrap:G,photoItem:P,gridImg:O,iconNew:F,iconImage:b,gridName:E,gridDes:R,cellGroup:H,select:T,icon:U},oe=g({name:"photo-detail",props:{orchestraId:{type:String,default:""}},setup(V){const h=f(),u=v(),e=_({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)},p=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 p(),await i(),document.title=h.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(S,{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:C},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(k,{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:()=>{u.push({path:"/photo-list",query:{id:o.id,name:o.name}})}},[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,x("\u5F20")])]))])]}),!e.loading&&!e.list.length&&t("div",{class:"emptyRootContainer",style:{minHeight:"78%"}},[t(I,{btnStatus:!1,tips:"\u6682\u65E0\u76F8\u518C"},null)]),t(q,{show:e.schoolStatus,"onUpdate:show":o=>e.schoolStatus=o,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[t(A,{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{oe as default};