index.c9eb8540.js 7.4 KB

1
  1. import{d as T,ag as I,r as j,$ as y,e as d,b7 as B,c as t,aj as F,a5 as h,q as r,ak as k,P as _,al as N,m as f,g as P}from"./index.5f7ffb46.js";import{O as L}from"./index.ec2a7822.js";import{O as E}from"./index.7790de2a.js";import{i as O,a as M}from"./icon-call-message.08ca784d.js";import{i as D}from"./icon_teacher.df08d662.js";import{i as G}from"./icon-message.8c0a9e8b.js";import{O as U}from"./index.1d6ac2c5.js";import{O as A}from"./index.fdad9231.js";import{L as z}from"./index.9ef28852.js";import{C as R}from"./index.052b3caa.js";import{C as g}from"./index.abd668f7.js";import{I as i}from"./index.276a5d68.js";import{T as v}from"./index.ab2541bb.js";import{G as V,a as C}from"./index.adf0b8fc.js";import{P as q}from"./index.de1f78a6.js";import"./index.6438a25f.js";import"./index.78e196a2.js";import"./use-tab-status.69b57a37.js";import"./Picker.148c9d83.js";import"./index.6bbd7daa.js";import"./index.99e0cf1f.js";import"./index.61ab9823.js";const H="_searchBand_spdri_1",Q="_subjectContainer_spdri_7",$="_tagSubject_spdri_14",W="_manageCell_spdri_21",J="_teacherContent_spdri_28",K="_content_spdri_33",X="_name_spdri_36",Y="_classNum_spdri_43",Z="_num_spdri_47",ee="_numText_spdri_54",te="_messageImg_spdri_60",se="_avatarContainer_spdri_65",ae="_avatarType_spdri_68",oe="_img_spdri_74",ne="_phone_spdri_87",re="_status_spdri_92",ce="_frozen_spdri_97",le="_codeContainer_spdri_100",ie="_codeImg_spdri_100",ue="_codeContent_spdri_107",pe="_codeTitle_spdri_110",de="_codeName_spdri_120",me="_codeQr_spdri_126",he="_codeBtnText_spdri_139",_e="_codeTips_spdri_149",fe="_close_spdri_157",ge="_codeBottom_spdri_162",ve="_title_spdri_169",Ce="_shareImg_spdri_184",we="_shareText_spdri_188";var a={searchBand:H,subjectContainer:Q,tagSubject:$,manageCell:W,teacherContent:J,content:K,name:X,classNum:Y,num:Z,numText:ee,messageImg:te,avatarContainer:se,avatarType:ae,img:oe,phone:ne,status:re,frozen:ce,codeContainer:le,codeImg:ie,codeContent:ue,codeTitle:pe,codeName:de,codeQr:me,codeBtnText:he,codeTips:_e,close:fe,codeBottom:ge,title:ve,shareImg:Ce,shareText:we};function w(c){return typeof c=="function"||Object.prototype.toString.call(c)==="[object Object]"&&!N(c)}var Ve=T({name:"companion-teacher",setup(){const c=I(),e=j({showMessage:!1,showPopover:!1,oPopover:!1,subjectList:[{text:"\u5168\u90E8\u58F0\u90E8",value:"ALL"}],action:[{name:"\u89E3\u7ED1",id:!0},{name:"\u7ED1\u5B9A",id:!1,selected:!0}],list:[],listState:{dataShow:!0,loading:!1,finished:!1,refreshing:!1,height:0},subjectText:"\u5168\u90E8\u58F0\u90E8",statusText:"\u7ED1\u5B9A",params:{keyword:null,delFlag:!1,subjectId:null,page:1,rows:20},selectItem:{}}),S=async()=>{try{const{data:n}=await f.post("/api-school/subjectBasicConfig/page",{data:{page:1,rows:50}});(n.rows||[]).forEach(o=>{e.subjectList.push({text:o.subjectName,value:o.subjectId})})}catch{}},u=async()=>{try{const n=await f.post("/api-school/teacher/page",{data:{...e.params,schoolId:P.user.data.school.id}});e.listState.loading=!1,e.listState.refreshing=!1;const s=n.data||{};if(e.list.length>0&&s.current===1)return;const o=s.rows||[];o.forEach(p=>{p.subjectNames=p.subjectName?p.subjectName.split(","):[]}),e.list=e.list.concat(o),e.listState.finished=s.current>=s.pages,e.params.page=s.current+1,e.listState.dataShow=e.list.length>0}catch{e.listState.dataShow=!1,e.listState.refreshing=!1,e.listState.finished=!0}},l=()=>{e.params.page=1,e.list=[],e.listState.dataShow=!0,e.listState.loading=!1,e.listState.finished=!1,u()},b=n=>{c.push({path:"/companion-teacher-detail",query:{id:n.id}})},x=n=>{e.subjectText=n.selectedOptions[0].text,e.params.subjectId=n.selectedOptions[0].value==="ALL"?null:n.selectedOptions[0].value,e.showPopover=!1,l()};y(async()=>{S(),u(),window.history.pushState(null,"",document.URL),window.addEventListener("popstate",m,!1)});const m=()=>{d({api:"back"})};return B(()=>{window.removeEventListener("popstate",m)}),()=>{let n;return t("div",{class:!e.listState.dataShow&&"emptyRootContainer"},[t(E,{position:"top",onGetHeight:s=>{e.listState.height=s}},{default:()=>[t(F,{border:!1},{right:()=>t(h,{name:"plus",size:19,onClick:()=>{c.push({path:"save-share-image",query:{type:"teacher"}})}},null)}),t(L,{placeholder:"\u8BF7\u8F93\u5165\u4F34\u5B66\u8001\u5E08\u59D3\u540D",class:"searchGroupInput",onSearch:s=>{e.params.keyword=s,l()}},null),t("div",{class:"searchGroup"},[t("div",{class:["searchItem",e.showPopover&&"searchItem-active"],onClick:()=>e.showPopover=!0},[t("span",null,[e.subjectText]),t("i",{class:"arrow"},null)]),t("div",{class:["searchItem",e.oPopover&&"searchItem-active"],onClick:()=>e.oPopover=!0},[t("span",null,[e.statusText]),t("i",{class:"arrow"},null)])])]}),e.listState.dataShow?t(U,{modelValue:e.listState.refreshing,"onUpdate:modelValue":s=>e.listState.refreshing=s,onRefresh:l,style:{minHeight:`calc(100vh - ${e.listState.height}px)`}},{default:()=>[t(z,{finished:e.listState.finished,finishedText:" ",class:[a.liveList],onLoad:u,style:{paddingTop:"12px"},immediateCheck:!1},w(n=e.list.map(s=>t(R,{inset:!0,style:{marginBottom:"12px"},onClick:()=>b(s)},{default:()=>[t(g,{center:!0,isLink:!0,class:a.manageCell,clickable:!1},{icon:()=>t("div",{class:a.avatarContainer},[t(i,{class:a.img,src:s.avatar?s.avatar:D,fit:"cover"},null),s.delFlag&&t(v,{class:a.avatarType,round:!0,color:"#F44541",textColor:"#fff"},{default:()=>[r("\u89E3\u7ED1")]})]),title:()=>t("div",{class:a.teacherContent},[t("div",{class:a.content},[t("p",{class:[a.name,"van-ellipsis"]},[s.nickname])])]),value:()=>t("div",{class:a.teacherContent},[t("div",{class:a.classNum},[t("p",{class:a.num},[s.completedCourseScheduleNum||0,r("/"),s.totalCourseScheduleNum||0]),t("p",{class:a.numText},[r("\u8BFE\u65F6")])]),t("div",{class:a.message,onClick:o=>{o.stopPropagation(),o.preventDefault(),e.showMessage=!0,e.selectItem=s}},[t(i,{class:a.messageImg,src:G},null)])])}),t(g,{center:!0},{title:()=>t("div",{class:a.subjectContainer},[t("span",null,[r("\u58F0\u90E8\uFF1A")]),t("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap"}},[s.subjectNames&&s.subjectNames.length>0&&s.subjectNames.map(o=>t(v,{type:"primary",class:a.tagSubject,color:"#FFE7DA",textColor:"#F67146"},w(o)?o:{default:()=>[o]}))])])})]})))?n:{default:()=>[n]})]}):t(k,{btnStatus:!1,tips:"\u6682\u65E0\u4F34\u5B66\u8001\u5E08"},null),t(_,{show:e.showMessage,"onUpdate:show":s=>e.showMessage=s,position:"bottom",style:{background:"transparent"}},{default:()=>[t("div",{class:a.codeContainer},[t("div",{class:a.codeBottom},[t(h,{name:"cross",size:22,class:a.close,color:"#666",onClick:()=>e.showMessage=!1},null),t("h3",{class:a.title},[t("i",null,null),r("\u8054\u7CFB\u65B9\u5F0F")]),t(V,{columnNum:2,border:!1},{default:()=>[t(C,{onClick:()=>{d({api:"joinChatGroup",content:{type:"single",id:e.selectItem.imUserId}}),e.showMessage=!1}},{icon:()=>t(i,{class:a.shareImg,src:O},null),text:()=>t("div",{class:a.shareText},[r("\u53D1\u9001\u6D88\u606F")])}),t(C,{onClick:()=>{d({api:"callPhone",content:{phone:e.selectItem.phone}}),e.showMessage=!1}},{icon:()=>t(i,{class:a.shareImg,src:M},null),text:()=>t("div",{class:a.shareText},[r("\u62E8\u6253\u7535\u8BDD")])})]})])])]}),t(A,{show:e.oPopover,"onUpdate:show":s=>e.oPopover=s,actions:e.action,onSelect:s=>{e.action.forEach(o=>{o.selected=!1}),s.selected=!0,e.statusText=s.name,e.params.delFlag=s.id==="ALL"?null:s.id,e.oPopover=!1,l()}},null),t(_,{show:e.showPopover,"onUpdate:show":s=>e.showPopover=s,round:!0,position:"bottom",class:"popupBottomSearch"},{default:()=>[t(q,{columns:e.subjectList,onCancel:()=>e.showPopover=!1,onConfirm:s=>x(s)},null)]})])}}});export{Ve as default};