1 |
- import{d as T,ag as I,r as y,$ as j,k as u,a_ as k,c as t,a5 as h,q as r,ai as N,P as _,ak as P,m as f,f as B}from"./index.ffe80dbe.js";import{O as L}from"./index.a0ef77e4.js";import{O as F}from"./index.c7af3af2.js";import{O}from"./index.4ddd16f0.js";import{i as E,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.45b38760.js";import{O as A}from"./index.6daa5b04.js";import{L as z}from"./index.cafcb8b5.js";import{C as R}from"./index.914765a1.js";import{C as g}from"./index.ea031708.js";import{I as i}from"./index.7e972106.js";import{T as v}from"./index.55ba7429.js";import{G as V,a as C}from"./index.72ca63b9.js";import{P as q}from"./index.777c6c1a.js";import"./index.1d5c6f70.js";import"./index.92ec0bf4.js";import"./index.84851ef1.js";import"./use-tab-status.5a3cd090.js";import"./index.466e527a.js";import"./index.b4b77b5a.js";import"./index.02edecb1.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",pe="_codeContent_spdri_107",de="_codeTitle_spdri_110",ue="_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:pe,codeTitle:de,codeName:ue,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]"&&!P(c)}var qe=T({name:"companion-teacher",setup(){const c=I(),e=y({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{}},p=async()=>{try{const n=await f.post("/api-school/teacher/page",{data:{...e.params,schoolId:B.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(d=>{d.subjectNames=d.subjectName?d.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,p()},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()};j(async()=>{S(),p(),window.history.pushState(null,"",document.URL),window.addEventListener("popstate",m,!1)});const m=()=>{u({api:"back"})};return k(()=>{window.removeEventListener("popstate",m)}),()=>{let n;return t("div",{class:!e.listState.dataShow&&"emptyRootContainer"},[t(O,{position:"top",onGetHeight:s=>{e.listState.height=s}},{default:()=>[t(L,{border:!1},{right:()=>t(h,{name:"plus",size:19,onClick:()=>{c.push({path:"save-share-image",query:{type:"teacher"}})}},null)}),t(F,{placeholder:"\u8BF7\u8F93\u5165\u4F34\u5B66\u6307\u5BFC\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:p,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(N,{btnStatus:!1,tips:"\u6682\u65E0\u4F34\u5B66\u6307\u5BFC"},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:()=>{u({api:"joinChatGroup",content:{type:"single",id:e.selectItem.imUserId}}),e.showMessage=!1}},{icon:()=>t(i,{class:a.shareImg,src:E},null),text:()=>t("div",{class:a.shareText},[r("\u53D1\u9001\u6D88\u606F")])}),t(C,{onClick:()=>{u({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{qe as default};
|