index.0d7e2a0f.js 7.4 KB

1
  1. import{d as T,ag as I,r as j,$ as y,e as u,b3 as k,c as t,aj as N,a5 as h,q as r,ak as P,P as _,al as B,m as f,g as L}from"./index.1c621181.js";import{O as F}from"./index.944c4ba2.js";import{O}from"./index.b491c24a.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.b0685ec5.js";import{O as A}from"./index.ff934114.js";import{L as z}from"./index.d5ee0b18.js";import{C as R}from"./index.2db9d877.js";import{C as g}from"./index.fd5ae97b.js";import{I as i}from"./index.4c221cbe.js";import{T as v}from"./index.4e64eb97.js";import{G as V,a as C}from"./index.5a8ac45d.js";import{P as q}from"./index.53518914.js";import"./index.c7a20c76.js";import"./index.7c36c16c.js";import"./use-tab-status.40058c51.js";import"./Picker.9bc4331c.js";import"./index.88a00aa9.js";import"./index.78a302c3.js";import"./index.d5b73933.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]"&&!B(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{}},p=async()=>{try{const n=await f.post("/api-school/teacher/page",{data:{...e.params,schoolId:L.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()};y(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(N,{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(P,{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{Ve as default};