unbind.7746e6fb.js 6.9 KB

1
  1. import{d as y,r as b,$ as E,c as e,aj as F,q as i,ak as I,al as B,m as f,g as w,ah as A,ag as q,B as j,F as z,o as k}from"./index.5f7ffb46.js";import{O as N}from"./index.7790de2a.js";import{O as x}from"./index.59b9f984.js";import{O as L}from"./index.ec2a7822.js";import{i as G}from"./icon_teacher.df08d662.js";import{L as O}from"./index.9ef28852.js";import{C as v}from"./index.052b3caa.js";import{C as g}from"./index.abd668f7.js";import{I as D}from"./index.276a5d68.js";import{T as V}from"./index.ab2541bb.js";import{c as $}from"./index.b28db9f5.js";import{O as T}from"./index.95a99ca5.js";import{F as M}from"./index.6438a25f.js";import{G as R,a as S}from"./index.adf0b8fc.js";import"./use-tab-status.69b57a37.js";const U="_unbindTips_156zt_1",H="_detailCellGroup_156zt_11",P="_detailCell_156zt_11",W="_valueClass_156zt_23",J="_teacherName_156zt_28",K="_teacherContent_156zt_35",Q="_content_156zt_40",X="_classNum_156zt_43",Y="_className_156zt_47",Z="_musicName_156zt_53",ee="_nums_156zt_59",te="_numTip_156zt_65",se="_classCellGroup_156zt_70",ae="_classTitle_156zt_75",oe="_title_156zt_91",le="_name_156zt_94";var u={unbindTips:U,detailCellGroup:H,detailCell:P,valueClass:W,teacherName:J,teacherContent:K,content:Q,classNum:X,className:Y,musicName:Z,nums:ee,numTip:te,classCellGroup:se,classTitle:ae,title:oe,name:le};const ce="_name_15dqr_1",ne="_img_15dqr_8",ue="_subjects_15dqr_15",re="_subjectContainer_15dqr_18",ie="_tagSubject_15dqr_24",de="_manageCell_15dqr_30",pe="_teacherContent_15dqr_37",me="_content_15dqr_42",he="_classNum_15dqr_52",_e="_num_15dqr_56",fe="_numText_15dqr_62",ge="_messageImg_15dqr_67",Te="_phone_15dqr_85",Se="_status_15dqr_90",Ce="_frozen_15dqr_95";var n={name:ce,img:ne,subjects:ue,subjectContainer:re,tagSubject:ie,manageCell:de,teacherContent:pe,content:me,classNum:he,num:_e,numText:fe,messageImg:ge,phone:Te,status:Se,frozen:Ce};function C(c){return typeof c=="function"||Object.prototype.toString.call(c)==="[object Object]"&&!B(c)}var ye=y({name:"teacher",props:{teacherId:{type:String,default:""},courseType:{type:String,default:""}},emits:["close","select"],setup(c,{slots:d,attrs:a,emit:p}){const s=b({schoolId:null,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{keyword:null,page:1,rows:20},selectItem:{}}),r=async()=>{try{const t=await f.post("/api-school/teacher/page",{data:{...s.params,schoolId:w.user.data.school.id,removeTeacherId:c.teacherId,courseType:c.courseType,delFlag:!1}});s.listState.loading=!1;const o=t.data||{};if(s.list.length>0&&o.current===1)return;const l=o.rows||[];l.forEach(_=>{_.subjectNames=_.subjectName?_.subjectName.split(","):[]}),s.list=s.list.concat(l),s.listState.finished=o.current>=o.pages,s.params.page=o.current+1,s.listState.dataShow=s.list.length>0}catch{s.listState.dataShow=!1,s.listState.finished=!0}},m=()=>{s.params.page=1,s.list=[],s.listState.dataShow=!0,s.listState.loading=!1,s.listState.finished=!1,r()},h=t=>{p("select",t),p("close")};return E(()=>{r()}),()=>{let t;return e("div",{class:!s.listState.dataShow&&"emptyRootContainer"},[e(N,{position:"top"},{default:()=>[e(F,{title:"\u4EA4\u63A5\u4F34\u5B66\u8001\u5E08",desotry:!1,border:!1},null),e(L,{placeholder:"\u8BF7\u8F93\u5165\u4F34\u5B66\u8001\u5E08\u59D3\u540D",onSearch:o=>{s.params.keyword=o,m()}},null)]}),s.listState.dataShow?e(O,{finished:s.listState.finished,finishedText:" ",class:[n.liveList],onLoad:r,style:{paddingTop:"12px"},immediateCheck:!1},C(t=s.list.map(o=>e(v,{inset:!0,style:{marginBottom:"12px"},onClick:()=>h(o)},{default:()=>[e(g,{center:!0,class:n.manageCell,clickable:!1},{icon:()=>e(D,{class:n.img,src:o.avatar?o.avatar:G,fit:"cover"},null),title:()=>e("div",{class:n.teacherContent},[e("div",{class:n.content},[e("p",{class:[n.name,"van-ellipsis"]},[o.nickname])])])}),e(g,{center:!0},{title:()=>e("div",{class:n.subjectContainer},[e("span",null,[i("\u58F0\u90E8\uFF1A")]),e("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap"}},[o.subjectNames&&o.subjectNames.length>0&&o.subjectNames.map(l=>e(V,{type:"primary",class:n.tagSubject,color:"#FFE7DA",textColor:"#F67146"},C(l)?l:{default:()=>[l]}))])])})]})))?t:{default:()=>[t]}):e(I,{btnStatus:!1,tips:"\u6682\u65E0\u4F34\u5B66\u8001\u5E08"},null)])}}}),Ge=y({name:"unbind",setup(){const c=A(),d=q(),a=b({teacherStatus:!1,classList:[],selectTeacher:{},teacherId:c.query.id,dialogStatus:!1,dialogMessage:"",dialogStatus1:!1,dialogMessage1:""}),p=async()=>{try{const{data:t}=await f.post("/api-school/classGroup/teacherHandoverList/"+a.teacherId,{});a.classList=t||[]}catch{}},s=t=>{a.teacherStatus=!0,a.selectTeacher=t},r=t=>{console.log(t,"steacher"),a.selectTeacher.sTeacher=t},m=()=>{console.log("submit");let t=!1;const o=[];if(a.classList.forEach(l=>{(!l.sTeacher||l.sTeacher&&!l.sTeacher.id)&&(t=!0),l.sTeacher&&o.push({courseType:l.courseType,teacherId:l.sTeacher.id})}),t){k("\u8BF7\u9009\u62E9\u4EA4\u63A5\u4F34\u5B66\u8001\u5E08");return}try{a.dialogStatus=!0}catch{}},h=async()=>{try{const t=[];a.classList.forEach(l=>{l.sTeacher&&t.push({courseType:l.courseType,teacherId:l.sTeacher.id})});const o=await f.post("/api-school/classGroup/handoverTeacher",{hideLoading:!1,data:{teacherId:c.query.id,courseUpdateList:[...t]}});o.code===999?(a.dialogStatus1=!0,a.dialogMessage1=o.message):o.data.finish===!0?d.replace("/companion-teacher"):d.push({path:"/course-preview",query:{cacheId:o.data.cacheId,type:"unbind"}})}catch{}};return E(()=>{p()}),()=>e(z,null,[e(F,null,null),e("div",{class:u.unbindTips},[i("\u8BE5\u4F34\u5B66\u8001\u5E08\u5B58\u5728\u73ED\u7EA7\u6216\u672A\u5F00\u59CB\u8BFE\u7A0B\uFF0C\u8BF7\u9009\u62E9\u4EA4\u63A5\u4EBA")]),a.classList.map(t=>e(v,{inset:!0,class:u.classCellGroup,border:!1},{default:()=>[e(M,{isLink:!0,placeholder:"\u8BF7\u9009\u62E9\u4EA4\u63A5\u8001\u5E08",inputAlign:"right",readonly:!0,modelValue:t.sTeacher?t.sTeacher.nickname:"",onClick:()=>s(t)},{label:()=>e("div",{class:u.classTitle},[$[t.courseType]])}),e(R,{border:!1,columnNum:2},{default:()=>[e(S,null,{default:()=>[e("p",{class:u.title},[t.classNum]),e("p",{class:u.name},[i("\u73ED\u7EA7\u6570\u91CF")])]}),e(S,null,{default:()=>[e("p",{class:[u.title]},[t.courseNum]),e("p",{class:u.name},[i("\u5269\u4F59\u8BFE\u65F6")])]})]})]})),e(N,{position:"bottom"},{default:()=>[e("div",{class:["btnGroup"],style:{paddingLeft:"13px",paddingRight:"13px"}},[e(j,{type:"primary",round:!0,block:!0,onClick:m},{default:()=>[i("\u786E\u8BA4\u4EA4\u63A5")]})])]}),e(x,{modelValue:a.teacherStatus,"onUpdate:modelValue":t=>a.teacherStatus=t,destroy:!0,style:{background:"#F8F8F8"}},{default:()=>[e(ye,{courseType:a.selectTeacher.courseType,teacherId:a.teacherId,onClose:()=>a.teacherStatus=!1,onSelect:r},null)]}),e(T,{title:"\u63D0\u793A",show:a.dialogStatus,"onUpdate:show":t=>a.dialogStatus=t,message:"\u662F\u5426\u786E\u8BA4\u4EA4\u63A5?",confirmButtonText:"\u786E\u5B9A",showCancelButton:!0,onConfirm:h},null),e(T,{title:"\u63D0\u793A",show:a.dialogStatus1,"onUpdate:show":t=>a.dialogStatus1=t,message:a.dialogMessage1,confirmButtonText:"\u786E\u5B9A",onConfirm:()=>{d.back()}},null)])}});export{Ge as default};