companion-detail.c97dc7c0.js 6.8 KB

123
  1. import{d as v,aV as y,ag as N,r as b,$ as x,c as e,q as a,ai as I,B as w,P as G,a5 as F,k as _,F as j,ak as B,m as u,f as p}from"./index.ffe80dbe.js";import{O as D}from"./index.a0ef77e4.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.4ddd16f0.js";import{O as A}from"./index.d745568a.js";import{C as d}from"./index.914765a1.js";import{C as l}from"./index.ea031708.js";import{I as r}from"./index.7e972106.js";import{T as f}from"./index.55ba7429.js";import{G as z,a as h}from"./index.72ca63b9.js";import"./index.1d5c6f70.js";const P="_detailCellGroup_okqf8_1",V="_subjectContainer_okqf8_6",Q="_tagSubject_okqf8_12",R="_sectionCellGroup_okqf8_18",U="_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",oe="_phone_okqf8_91",se="_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:V,tagSubject:Q,sectionCellGroup:R,detailCell:U,teacherContent:H,content:$,name:W,classNum:J,num:K,numText:X,messageImg:Y,avatarContainer:Z,avatarType:ee,img:te,phone:oe,status:se,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]"&&!B(i)}var Re=v({name:"companion-detail",setup(i,{slots:we,attrs:Ge,emit:Fe}){const c=y(),m=N(),o=b({showMessage:!1,detail:{},classList:[],showDialog:!1}),g=async()=>{try{const s=c.query,{data:n}=await u.post("/api-school/teacher/detail",{data:{teacherId:s.id,schoolId:p.user.data.school.id}});o.detail=n;const T=n.subjectName?n.subjectName.split(","):[];o.detail.subjectNames=T}catch{}},C=async()=>{try{const s=c.query,{data:n}=await u.post("/api-school/classGroup/page",{data:{teacherId:s.id,schoolId:p.user.data.school.id,page:1,rows:100}});o.classList=n.rows||[]}catch{}},k=async()=>{try{const{data:s}=await u.post("/api-school/classGroup/teacherHandoverList/"+c.query.id,{hideLoading:!1});if((s||[]).length>0){m.push({path:"/companion-unbind",query:{id:c.query.id}});return}o.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(j,null,[e(D,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:o.detail.avatar||E,fit:"cover"},null),o.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"]},[o.detail.nickname])]),e("div",{class:t.classNum},[e("p",{class:t.num},[o.detail.completedCourseScheduleNum||0,a("/"),o.detail.totalCourseScheduleNum||0]),e("p",{class:t.numText},[a("\u8BFE\u65F6")])])]),value:()=>e(r,{class:t.messageImg,src:S,onClick:()=>o.showMessage=!0},null)}),o.detail.subjectNames&&o.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"}},[o.detail.subjectNames&&o.detail.subjectNames.map(s=>e(f,{type:"primary",class:t.tagSubject,color:"#FFE7DA",textColor:"#F67146"},Ie(s)?s:{default:()=>[s]}))])])})]}),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:o.detail.phone},null),e(l,{title:"\u6027\u522B",value:o.detail.gender==1?"\u7537":o.detail.gender==0?"\u5973":""},null),e(l,{title:"\u58F0\u90E8",value:o.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:()=>[o.classList.map(s=>e(l,{center:!0,class:t.companionCell},{title:()=>e("div",{class:t.classInfo},[e("p",{class:t.className},[s.name]),e("p",{class:t.musicName},[s.orchestraName])]),value:()=>e("div",{class:t.num},[e("p",{class:t.nums},[s.completeCourseScheduleNum,a("/"),s.courseScheduleNum]),e("p",{class:t.numTip},[a("\u603B\u8BFE\u65F6")])])})),o.classList.length<=0&&e(I,{btnStatus:!1,tips:"\u6682\u65E0\u73ED\u7EA7"},null)]}),o.detail.id&&!o.detail.delFlag&&e(O,{position:"bottom"},{default:()=>[e("div",{class:["btnGroup"],style:{paddingLeft:"13px",paddingRight:"13px"}},[e(w,{type:"primary",round:!0,block:!0,onClick:k},{default:()=>[a("\u89E3\u9664\u7ED1\u5B9A")]})])]}),e(G,{show:o.showMessage,"onUpdate:show":s=>o.showMessage=s,position:"bottom",style:{background:"transparent"}},{default:()=>[e("div",{class:t.codeContainer},[e("div",{class:t.codeBottom},[e(F,{name:"cross",size:22,class:t.close,color:"#666",onClick:()=>o.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:o.detail.imUserId}}),o.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:o.detail.phone}}),o.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:o.showDialog,"onUpdate:show":s=>o.showDialog=s,title:"\u89E3\u9664\u7ED1\u5B9A",message:`\u89E3\u9664\u7ED1\u5B9A\u540E\uFF0C\u8BE5\u4F34\u5B66\u6307\u5BFC\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
  2. \u786E\u8BA4\u9700\u8981\u89E3\u9664\u7ED1\u5B9A\u5417\uFF1F`,messageAlign:"left",showCancelButton:!0,confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88",onConfirm:q},null)])}});export{Re as default};