import{d as v,ah as y,ag as N,r as b,$ as x,c as e,aj as I,q as a,ak as w,B as G,P as F,a5 as j,e as _,F as B,al as D,m as u,g as p}from"./index.3b0304e1.js";import{i as E}from"./icon_teacher.df08d662.js";import{i as S}from"./icon-message.8c0a9e8b.js";import{i as M,a as L}from"./icon-call-message.08ca784d.js";import{O}from"./index.454c666f.js";import{O as A}from"./index.495ac005.js";import{C as d}from"./index.ead63c4f.js";import{C as l}from"./index.ff3f298b.js";import{I as r}from"./index.710cd200.js";import{T as f}from"./index.1e205a49.js";import{G as z,a as h}from"./index.53bfa96a.js";const P="_detailCellGroup_okqf8_1",Q="_subjectContainer_okqf8_6",R="_tagSubject_okqf8_12",U="_sectionCellGroup_okqf8_18",V="_detailCell_okqf8_1",H="_teacherContent_okqf8_29",$="_content_okqf8_37",W="_name_okqf8_41",J="_classNum_okqf8_48",K="_num_okqf8_52",X="_numText_okqf8_59",Y="_messageImg_okqf8_64",Z="_avatarContainer_okqf8_69",ee="_avatarType_okqf8_72",te="_img_okqf8_78",se="_phone_okqf8_91",oe="_status_okqf8_96",ae="_frozen_okqf8_101",ne="_sectionTitle_okqf8_104",le="_functionGrid_okqf8_119",ce="_functionImg_okqf8_126",ie="_functionText_okqf8_130",ue="_companionCell_okqf8_140",re="_className_okqf8_146",de="_musicName_okqf8_152",me="_nums_okqf8_158",_e="_numTip_okqf8_165",pe="_codeContainer_okqf8_170",fe="_codeImg_okqf8_170",he="_codeContent_okqf8_177",ge="_codeTitle_okqf8_180",Ce="_codeName_okqf8_188",ke="_codeQr_okqf8_194",qe="_codeBtnText_okqf8_207",Te="_codeTips_okqf8_217",ve="_close_okqf8_225",ye="_codeBottom_okqf8_230",Ne="_title_okqf8_237",be="_shareImg_okqf8_252",xe="_shareText_okqf8_256";var t={detailCellGroup:P,subjectContainer:Q,tagSubject:R,sectionCellGroup:U,detailCell:V,teacherContent:H,content:$,name:W,classNum:J,num:K,numText:X,messageImg:Y,avatarContainer:Z,avatarType:ee,img:te,phone:se,status:oe,frozen:ae,sectionTitle:ne,functionGrid:le,functionImg:ce,functionText:ie,companionCell:ue,className:re,musicName:de,nums:me,numTip:_e,codeContainer:pe,codeImg:fe,codeContent:he,codeTitle:ge,codeName:Ce,codeQr:ke,codeBtnText:qe,codeTips:Te,close:ve,codeBottom:ye,title:Ne,shareImg:be,shareText:xe};function Ie(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!D(i)}var Qe=v({name:"companion-detail",setup(i,{slots:we,attrs:Ge,emit:Fe}){const c=y(),m=N(),s=b({showMessage:!1,detail:{},classList:[],showDialog:!1}),g=async()=>{try{const o=c.query,{data:n}=await u.post("/api-school/teacher/detail",{data:{teacherId:o.id,schoolId:p.user.data.school.id}});s.detail=n;const T=n.subjectName?n.subjectName.split(","):[];s.detail.subjectNames=T}catch{}},C=async()=>{try{const o=c.query,{data:n}=await u.post("/api-school/classGroup/page",{data:{teacherId:o.id,schoolId:p.user.data.school.id,page:1,rows:100}});s.classList=n.rows||[]}catch{}},k=async()=>{try{const{data:o}=await u.post("/api-school/classGroup/teacherHandoverList/"+c.query.id,{hideLoading:!1});if((o||[]).length>0){m.push({path:"/companion-unbind",query:{id:c.query.id}});return}s.showDialog=!0}catch{}},q=async()=>{try{await u.post("/api-school/classGroup/handoverTeacher",{data:{teacherId:c.query.id}}),m.back()}catch{}};return x(()=>{g(),C()}),()=>e(B,null,[e(I,null,null),e(d,{inset:!0,class:t.detailCellGroup},{default:()=>[e(l,{center:!0,class:t.detailCell},{icon:()=>e("div",{class:t.avatarContainer},[e(r,{class:t.img,src:s.detail.avatar||E,fit:"cover"},null),s.detail.delFlag&&e(f,{class:t.avatarType,round:!0,color:"#F44541",textColor:"#fff"},{default:()=>[a("\u89E3\u7ED1")]})]),title:()=>e("div",{class:t.teacherContent},[e("div",{class:t.content},[e("p",{class:[t.name,"van-ellipsis"]},[s.detail.nickname])]),e("div",{class:t.classNum},[e("p",{class:t.num},[s.detail.completedCourseScheduleNum||0,a("/"),s.detail.totalCourseScheduleNum||0]),e("p",{class:t.numText},[a("\u8BFE\u65F6")])])]),value:()=>e(r,{class:t.messageImg,src:S,onClick:()=>s.showMessage=!0},null)}),s.detail.subjectNames&&s.detail.subjectNames.legnth>0&&e(l,{center:!0},{title:()=>e("div",{class:t.subjectContainer},[e("span",null,[a("\u58F0\u90E8\uFF1A")]),e("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap"}},[s.detail.subjectNames&&s.detail.subjectNames.map(o=>e(f,{type:"primary",class:t.tagSubject,color:"#FFE7DA",textColor:"#F67146"},Ie(o)?o:{default:()=>[o]}))])])})]}),e("div",{class:t.sectionTitle},[e("i",null,null),a("\u57FA\u672C\u4FE1\u606F")]),e(d,{inset:!0,class:[t.detailCellGroup,t.sectionCellGroup]},{default:()=>[e(l,{title:"\u624B\u673A\u53F7\u7801",value:s.detail.phone},null),e(l,{title:"\u6027\u522B",value:s.detail.gender==1?"\u7537":s.detail.gender==0?"\u5973":""},null),e(l,{title:"\u58F0\u90E8",value:s.detail.subjectName},null)]}),e("div",{class:t.sectionTitle},[e("i",null,null),a("\u6240\u5728\u73ED\u7EA7")]),e(d,{inset:!0,class:[t.detailCellGroup,t.sectionCellGroup]},{default:()=>[s.classList.map(o=>e(l,{center:!0,class:t.companionCell},{title:()=>e("div",{class:t.classInfo},[e("p",{class:t.className},[o.name]),e("p",{class:t.musicName},[o.orchestraName])]),value:()=>e("div",{class:t.num},[e("p",{class:t.nums},[o.completeCourseScheduleNum,a("/"),o.courseScheduleNum]),e("p",{class:t.numTip},[a("\u603B\u8BFE\u65F6")])])})),s.classList.length<=0&&e(w,{btnStatus:!1,tips:"\u6682\u65E0\u73ED\u7EA7"},null)]}),s.detail.id&&!s.detail.delFlag&&e(O,{position:"bottom"},{default:()=>[e("div",{class:["btnGroup"],style:{paddingLeft:"13px",paddingRight:"13px"}},[e(G,{type:"primary",round:!0,block:!0,onClick:k},{default:()=>[a("\u89E3\u9664\u7ED1\u5B9A")]})])]}),e(F,{show:s.showMessage,"onUpdate:show":o=>s.showMessage=o,position:"bottom",style:{background:"transparent"}},{default:()=>[e("div",{class:t.codeContainer},[e("div",{class:t.codeBottom},[e(j,{name:"cross",size:22,class:t.close,color:"#666",onClick:()=>s.showMessage=!1},null),e("h3",{class:t.title},[e("i",null,null),a("\u8054\u7CFB\u65B9\u5F0F")]),e(z,{columnNum:2,border:!1},{default:()=>[e(h,{onClick:()=>{_({api:"joinChatGroup",content:{type:"single",id:s.detail.imUserId}}),s.showMessage=!1}},{icon:()=>e(r,{class:t.shareImg,src:M},null),text:()=>e("div",{class:t.shareText},[a("\u53D1\u9001\u6D88\u606F")])}),e(h,{onClick:()=>{_({api:"callPhone",content:{phone:s.detail.phone}}),s.showMessage=!1}},{icon:()=>e(r,{class:t.shareImg,src:L},null),text:()=>e("div",{class:t.shareText},[a("\u62E8\u6253\u7535\u8BDD")])})]})])])]}),e(A,{show:s.showDialog,"onUpdate:show":o=>s.showDialog=o,title:"\u89E3\u9664\u7ED1\u5B9A",message:`\u89E3\u9664\u7ED1\u5B9A\u540E\uFF0C\u8BE5\u4F34\u5B66\u8001\u5E08\u5C06\u9000\u51FA\u6240\u6709\u73ED\u7EA7\u7FA4\uFF0C\u82E5\u9700\u91CD\u65B0\u7ED1\u5B9A\u53EF\u901A\u8FC7\u4F34\u5B66\u8001\u5E08\u9080\u8BF7\u7801\u91CD\u65B0\u586B\u5199\u8D44\u6599\u540E\u7ED1\u5B9A \u786E\u8BA4\u9700\u8981\u89E3\u9664\u7ED1\u5B9A\u5417\uFF1F`,messageAlign:"left",showCancelButton:!0,confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88",onConfirm:q},null)])}});export{Qe as default};