create-message-legacy.889461e6.js 28 KB

1
  1. !function(){var e=document.createElement("style");e.innerHTML='._searchBand_1dppi_1{display:inline-block;font-size:.37333rem;font-weight:600;color:#333}._searchBand_1dppi_1 ._bandName_1dppi_7{display:inline-block;max-width:4.8rem;vertical-align:text-top}._gridContainer_1dppi_12{margin:0 .34667rem .32rem}._gridContainer_1dppi_12 ._title_1dppi_15{font-size:.69333rem;font-weight:700;color:#333;font-family:DINA}._gridContainer_1dppi_12 ._title_1dppi_15 i{font-style:normal;font-size:.32rem;color:#333}._gridContainer_1dppi_12 ._red_1dppi_26{color:#f67146}._gridContainer_1dppi_12 ._name_1dppi_29{padding-top:.21333rem;font-size:.32rem;color:#777}._gridClass_1dppi_34 ._img_1dppi_34{width:1.06667rem;height:1.06667rem;margin-right:.21333rem;border-radius:50%;overflow:hidden}._gridClass_1dppi_34 ._teacherName_1dppi_41{display:flex;align-items:center}._gridClass_1dppi_34 ._teacherName_1dppi_41 ._name_1dppi_29{padding:0;max-width:3.2rem;font-size:.42667rem;font-weight:600;color:#333;line-height:.58667rem}._gridClass_1dppi_34 ._teacherName_1dppi_41 .van-tag{margin-left:.21333rem;height:.45333rem;border-radius:.10667rem}._gridClass_1dppi_34 ._classCheckbox_1dppi_58{display:flex;justify-content:flex-end}._gridClass_1dppi_34 ._orchestraName_1dppi_62{padding-top:.08rem;font-size:.32rem;color:#777;line-height:.45333rem;max-width:5.86667rem}._gridClass_1dppi_34 ._title_1dppi_15{font-size:.64rem}._gridClass_1dppi_34 ._className_1dppi_72{padding:.45333rem .4rem 0;font-size:.42667rem;font-weight:500;color:#333;line-height:.58667rem}._gridClass_1dppi_34 ._className_1dppi_72 ._line_1dppi_79{display:inline-block;width:.10667rem;height:.32rem;background:#ff8057;border-radius:.08rem;margin-right:.16rem}._gridClass_1dppi_34 .van-grid-item:after{content:" ";position:absolute;top:50%;right:0;margin-top:-.26667rem;width:.02667rem;height:.53333rem;background:#eaeaea;border-radius:.02667rem}._gridClass_1dppi_34 .van-grid-item:last-child:after{display:none}._classCellGroup_1dppi_101{margin-bottom:.32rem;border-radius:.26667rem;overflow:hidden}._cellTeacher_bjfo6_1 ._img_bjfo6_1{width:1.28rem;height:1.28rem;overflow:hidden;border-radius:50%;margin-right:.32rem;flex-shrink:0}._cellTeacher_bjfo6_1 ._name_bjfo6_9{font-size:.42667rem;font-weight:500;color:#333;line-height:.58667rem;max-width:3.2rem}._cellTeacher_bjfo6_1 ._class_bjfo6_16{font-size:.32rem;color:#777;line-height:.45333rem}._cellTeacher_bjfo6_1 .van-tag{margin-top:.08rem;margin-right:.21333rem}._cellTeacher_bjfo6_1 ._checkboxValue_bjfo6_25{display:flex;justify-content:flex-end}._subjectContainer_bjfo6_29{display:flex}._subjectContainer_bjfo6_29>span{flex-shrink:0}._subjectContainer_bjfo6_29 ._tagSubject_bjfo6_35{margin-right:.26667rem;margin-top:.05333rem;margin-bottom:.05333rem;padding:.02667rem .21333rem}._cellTeacher_fnv0v_1 ._img_fnv0v_1{width:1.06667rem;height:1.06667rem;overflow:hidden;border-radius:50%;margin-right:.32rem;flex-shrink:0}._cellTeacher_fnv0v_1 ._name_fnv0v_9{font-size:.42667rem;font-weight:500;color:#333;line-height:.58667rem;max-width:3.2rem}._cellTeacher_fnv0v_1 ._class_fnv0v_16{font-size:.32rem;color:#777;line-height:.45333rem}._cellTeacher_fnv0v_1 .van-tag{margin-top:.08rem;margin-right:.21333rem}._cellTeacher_fnv0v_1 ._checkboxValue_fnv0v_25{display:flex;justify-content:flex-end}._subjectContainer_fnv0v_29{display:flex}._subjectContainer_fnv0v_29>span{flex-shrink:0}._subjectContainer_fnv0v_29 ._tagSubject_fnv0v_35{margin-right:.26667rem;margin-top:.05333rem;margin-bottom:.05333rem;padding:.02667rem .21333rem}\n',document.head.appendChild(e),System.register(["./index-legacy.eb062188.js","./index-legacy.b1009ea0.js","./index-legacy.4e015ad0.js","./index.module-legacy.475a9872.js","./index-legacy.ad813f4d.js","./icon_teacher-legacy.07765f44.js","./index-legacy.10d8486a.js","./index-legacy.fad72574.js","./index-legacy.8fb0ec91.js","./index-legacy.148f784c.js","./index-legacy.918b8c74.js","./index-legacy.fecc738b.js","./index-legacy.11f1ea5f.js","./index-legacy.d39f6f47.js","./index-legacy.761bf286.js","./index-legacy.38b799d5.js","./index-legacy.a530d593.js","./index-legacy.ac7c51db.js","./icon_student-legacy.6118fd72.js","./index-legacy.e0860c0a.js","./index-legacy.d552a2f3.js","./index-legacy.b5cefa24.js","./Picker-legacy.95f03705.js","./index-legacy.ab2ce923.js","./index-legacy.3a3e070a.js","./index-legacy.5f462740.js","./use-tab-status-legacy.91417466.js","./Checker-legacy.9bbda964.js","./index-legacy.fab451f1.js","./index-legacy.8c254533.js","./index-legacy.bd6987bf.js","./index-legacy.b7c35e0c.js","./ImagePreview-legacy.747d0051.js","./function-call-legacy.0bd16987.js","./utils-legacy.6e8de97c.js"],(function(e){"use strict";var t,a,s,i,l,c,n,o,r,d,h,u,p,m,g,f,_,v,b,y,S,j,x,C,T,k,w,I,L,N,H,E,D,V,A,O,M,U,R,B,P,z,G,F,$,Y,q,W,Z;return{setters:[function(e){t=e.D,a=e.d,s=e.r,i=e.Z,l=e.$,c=e.c,n=e.q,o=e.ak,r=e.P,d=e.al,h=e.m,u=e.g,p=e.an,m=e.aj,g=e.B,f=e.ag,_=e.ah,v=e.ai,b=e.y,y=e.a5,S=e.b2,j=e.o},function(e){x=e.O},function(e){C=e.e},function(e){T=e.s},function(e){k=e.O},function(e){w=e.i},function(e){I=e.S},function(e){L=e.L},function(e){N=e.C},function(e){H=e.C},function(e){E=e.C},function(e){D=e.I},function(e){V=e.T},function(e){A=e.C},function(e){O=e.G,M=e.a},function(e){U=e.P},function(e){R=e.O},function(e){B=e.T,P=e.a},function(e){z=e.i},function(e){G=e.O},function(e){F=e.O},function(e){$=e.O},function(e){Y=e.a},function(e){q=e.T},function(e){W=e.F},function(e){Z=e.D},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){const J=t(Y);var K={searchBand:"_searchBand_1dppi_1",bandName:"_bandName_1dppi_7",gridContainer:"_gridContainer_1dppi_12",title:"_title_1dppi_15",red:"_red_1dppi_26",name:"_name_1dppi_29",gridClass:"_gridClass_1dppi_34",img:"_img_1dppi_34",teacherName:"_teacherName_1dppi_41",classCheckbox:"_classCheckbox_1dppi_58",orchestraName:"_orchestraName_1dppi_62",className:"_className_1dppi_72",line:"_line_1dppi_79",classCellGroup:"_classCellGroup_1dppi_101"};var Q=a({name:"practice-class",props:{height:{type:[String,Number],default:"auto"},bottomHeight:{type:[String,Number],default:0},headerHeight:{type:[String,Number],default:0},selectItem:{type:Array,default:()=>[]}},emits:["close","confirm","update:selectItem"],setup(e,{emit:t}){const a=s({showPopover:!1,orchestraId:null,orchestraName:null,orchestraList:[],isClick:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{type:null,page:1,rows:20},check:[],checkboxRefs:[]}),p=async()=>{try{if(a.isClick)return;a.isClick=!0;const{data:e}=await h.post("/api-school/classGroup/page",{data:{...a.params,schoolId:u.user.data.school.id,orchestraId:a.orchestraId}});a.isClick=!1,a.listState.loading=!1;const t=e||{};if(a.list.length>0&&1===t.current)return;a.list=a.list.concat(t.rows||[]),a.listState.finished=t.current>=t.pages,a.params.page=t.current+1,a.listState.dataShow=a.list.length>0}catch{a.listState.dataShow=!1,a.listState.finished=!0,a.isClick=!1}},m=e=>{a.checkboxRefs[e].toggle();const s=[];a.list.forEach((e=>{a.check.includes(e.id)&&s.push({id:e.id,value:e.name,avatar:""})})),t("update:selectItem",s)};i((()=>e.selectItem),(()=>{g()}),{deep:!0});const g=()=>{const t=e.selectItem||[],s=[];t.forEach((e=>{s.push(e.id)})),a.check=s};return l((async()=>{await(async()=>{try{const{data:e}=await h.post("/api-school/orchestra/page",{data:{page:1,rows:100,schoolId:u.user.data.school.id,status:"DONE"}}),t=e.rows||[],s=[];t.forEach((e=>{s.push({text:e.name,value:e.id})})),a.orchestraList=[...s],s.length>0&&(a.orchestraId=s[0].value,a.orchestraName=s[0].text)}catch{}})(),await p(),g()})),()=>{let t;return c("div",{class:[K.practiceClass,!a.listState.dataShow&&"emptyRootContainer"],style:{"min-height":`calc(100vh - ${e.height}px - ${e.bottomHeight}px)`}},[a.orchestraList.length>0&&c(I,{position:"top",offsetTop:e.headerHeight,style:{width:"100%"}},{default:()=>[c("div",{class:"searchGroup-single"},[c("div",{class:["searchItem",a.showPopover?"searchItem-active":""],onClick:()=>a.showPopover=!0},[c("span",null,[a.orchestraName])])])]}),a.listState.dataShow?c(L,{finished:a.listState.finished,finishedText:" ",class:[K.liveList],onLoad:p,immediateCheck:!1},{default:()=>{return[c(N,{class:[K.gridContainer,K.gridClass],modelValue:a.check,"onUpdate:modelValue":e=>a.check=e},(e=t=a.list.map((e=>c(H,{class:K.classCellGroup,onClick:()=>m(e.id),border:!1},{default:()=>[c(E,{center:!0,titleStyle:{flex:"0 auto"},valueClass:K.classCheckbox},{icon:()=>c(D,{src:w,class:K.img},null),title:()=>c("div",{class:K.content},[c("div",{class:K.teacherName},[c("span",{class:["van-ellipsis",K.name]},[e.teacherName]),c(V,{type:"primary"},{default:()=>[e.name]})]),c("div",{class:[K.orchestraName,"van-ellipsis"]},[e.orchestraName])]),value:()=>c(A,{name:e.id,ref:t=>a.checkboxRefs[e.id]=t,onClick:t=>{t.preventDefault(),t.stopPropagation(),m(e.id)}},null)}),c(O,{border:!1,columnNum:3},{default:()=>[c(M,null,{default:()=>[c("p",{class:K.title},[e.preStudentNum]),c("p",{class:K.name},[n("学员人数")])]}),c(M,null,{default:()=>[c("p",{class:[K.title]},[e.courseScheduleNum-e.completeCourseScheduleNum]),c("p",{class:K.name},[n("剩余课时")])]}),c(M,null,{default:()=>[c("p",{class:K.title},[e.courseScheduleNum]),c("p",{class:K.name},[n("总课时")])]})]})]}))),"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!d(e)?t:{default:()=>[t]}))];var e}}):c(o,{btnStatus:!1,tips:"暂无班级"},null),c(r,{show:a.showPopover,"onUpdate:show":e=>a.showPopover=e,position:"bottom",round:!0,class:"popupBottomSearch",teleport:"#select-send-message"},{default:()=>[c(U,{columns:a.orchestraList,onCancel:()=>a.showPopover=!1,onConfirm:e=>{a.orchestraId=e.selectedOptions[0].value,a.orchestraName=e.selectedOptions[0].text,a.showPopover=!1,a.params.page=1,a.list=[],a.listState.dataShow=!0,a.listState.loading=!1,a.listState.finished=!1,p()}},null)]})])}}});var X={cellTeacher:"_cellTeacher_bjfo6_1",img:"_img_bjfo6_1",name:"_name_bjfo6_9",class:"_class_bjfo6_16",checkboxValue:"_checkboxValue_bjfo6_25",subjectContainer:"_subjectContainer_bjfo6_29",tagSubject:"_tagSubject_bjfo6_35"};var ee=a({name:"manage-list",props:{height:{type:[String,Number],default:"auto"},bottomHeight:{type:[String,Number],default:0},headerHeight:{type:[String,Number],default:0},removeTeacherId:{type:String,default:""},subjectIdList:{type:Array,default:()=>[]},selectItem:{type:Array,default:()=>[]}},emits:["close","select","update:selectItem"],setup(e,{slots:t,attrs:a,emit:n}){const r=s({teacherStatus:!1,isLoad:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{keyword:null,subjectIdList:e.subjectIdList,page:1,rows:20},check:e.selectItem||[],checkboxRefs:[]}),p=async()=>{try{if(r.isLoad)return;r.isLoad=!0;const e=await h.post("/api-school/schoolStaff/page",{data:{...r.params,schoolId:u.user.data.school.id,status:"ACTIVATION"}});r.listState.loading=!1;const t=e.data||{};if(r.list.length>0&&1===t.current)return;const a=t.rows||[];a.forEach((e=>{e.subjectNames=e.subjectName?e.subjectName.split(","):[]})),r.list=r.list.concat(a),r.listState.finished=t.current>=t.pages,r.params.page=t.current+1,r.listState.dataShow=r.list.length>0,r.isLoad=!1}catch{r.listState.dataShow=!1,r.listState.finished=!0,r.isLoad=!1}},m=e=>{r.checkboxRefs[e].toggle();const t=[];r.list.forEach((e=>{r.check.includes(e.id)&&t.push({id:e.id,value:e.nickname,avatar:e.avatar})})),n("update:selectItem",t)};i((()=>e.selectItem),(()=>{g()}),{deep:!0});const g=()=>{const t=e.selectItem||[],a=[];t.forEach((e=>{a.push(e.id)})),r.check=a};return l((()=>{p(),g(),console.log(e.height,e.bottomHeight,"11121212")})),()=>{let t;return c("div",{class:[!r.listState.dataShow&&"emptyRootContainer"],style:{"min-height":`calc(100vh - ${"auto"===e.height?0:e.height}px - ${e.bottomHeight}px)`}},[c(I,{position:"top",offsetTop:e.headerHeight,style:{width:"100%"}},{default:()=>[c(R,{placeholder:"管理老师姓名/手机号",onSearch:e=>{r.params.keyword=e,r.params.page=1,r.list=[],r.listState.dataShow=!0,r.listState.loading=!1,r.listState.finished=!1,p()}},null)]}),r.listState.dataShow?c(L,{finished:r.listState.finished,finishedText:" ",onLoad:p,style:{paddingTop:"12px"},immediateCheck:!1},{default:()=>{return[c(N,{class:[X.gridContainer,X.gridClass],modelValue:r.check,"onUpdate:modelValue":e=>r.check=e},(e=t=r.list.map((e=>c(H,{inset:!0,style:{marginBottom:"12px"},onClick:()=>m(e.id)},{default:()=>[c(E,{center:!0,class:X.cellTeacher,valueClass:X.checkboxValue},{icon:()=>c(D,{class:X.img,src:e.avatar||w,fit:"cover"},null),title:()=>c("div",{class:X.content},[c("p",{class:[X.name,"van-ellipsis"]},[e.nickname])]),value:()=>c(A,{name:e.id,ref:t=>r.checkboxRefs[e.id]=t,onClick:t=>{t.preventDefault(),t.stopPropagation(),m(e.id)}},null)})]}))),"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!d(e)?t:{default:()=>[t]}))];var e}}):c(o,{btnStatus:!1,tips:"暂无管理老师"},null)])}}});var te={cellTeacher:"_cellTeacher_bjfo6_1",img:"_img_bjfo6_1",name:"_name_bjfo6_9",class:"_class_bjfo6_16",checkboxValue:"_checkboxValue_bjfo6_25",subjectContainer:"_subjectContainer_bjfo6_29",tagSubject:"_tagSubject_bjfo6_35"};function ae(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!d(e)}var se=a({name:"teacher-list",props:{height:{type:[String,Number],default:"auto"},bottomHeight:{type:[String,Number],default:0},headerHeight:{type:[String,Number],default:0},selectItem:{type:Array,default:()=>[]}},emits:["close","select","update:selectItem"],setup(e,{emit:t}){const a=s({teacherStatus:!1,isLoad:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{keyword:null,page:1,rows:20},check:e.selectItem||[],checkboxRefs:[]}),n=async()=>{try{if(a.isLoad)return;a.isLoad=!0;const e=await h.post("/api-school/student/page",{data:{...a.params,schoolId:u.user.data.school.id}});a.listState.loading=!1;const t=e.data||{};if(a.list.length>0&&1===t.current)return;const s=t.rows||[];s.forEach((e=>{e.subjectNames=e.subjectNames?e.subjectNames.split(","):[]})),a.list=a.list.concat(s),a.listState.finished=t.current>=t.pages,a.params.page=t.current+1,a.listState.dataShow=a.list.length>0,a.isLoad=!1}catch{a.listState.dataShow=!1,a.listState.finished=!0,a.isLoad=!1}},r=e=>{a.checkboxRefs[e].toggle();const s=[];a.list.forEach((e=>{a.check.includes(e.id)&&s.push({id:e.id,value:e.nickname,avatar:e.avatar})})),t("update:selectItem",s)};i((()=>e.selectItem),(()=>{d()}),{deep:!0});const d=()=>{const t=e.selectItem||[],s=[];t.forEach((e=>{s.push(e.id)})),a.check=s};return l((()=>{n(),d()})),()=>{let t;return c("div",{class:[!a.listState.dataShow&&"emptyRootContainer"],style:{"min-height":`calc(100vh - ${e.height}px - ${e.bottomHeight}px)`}},[c(I,{position:"top",offsetTop:e.headerHeight,style:{width:"100%"}},{default:()=>[c(R,{placeholder:"学员名称/手机号",onSearch:e=>{a.params.keyword=e,a.params.page=1,a.list=[],a.listState.dataShow=!0,a.listState.loading=!1,a.listState.finished=!1,n()}},null)]}),a.listState.dataShow?c(L,{finished:a.listState.finished,finishedText:" ",onLoad:n,style:{paddingTop:"12px"},immediateCheck:!1},{default:()=>[c(N,{class:[te.gridContainer,te.gridClass],modelValue:a.check,"onUpdate:modelValue":e=>a.check=e},ae(t=a.list.map((e=>c(H,{inset:!0,style:{marginBottom:"12px"},onClick:()=>r(e.id)},{default:()=>[c(E,{center:!0,class:te.cellTeacher,valueClass:te.checkboxValue},{icon:()=>c(D,{class:te.img,src:e.avatar||w,fit:"cover"},null),title:()=>c("div",{class:te.content},[c("p",{class:[te.name,"van-ellipsis"]},[e.nickname]),c("p",{class:te.class},[e.subjectNames&&e.subjectNames.map((e=>c(V,{type:"primary",class:te.tagSubject,color:"#FFE7DA",textColor:"#F67146"},ae(e)?e:{default:()=>[e]})))])]),value:()=>c(A,{name:e.id,ref:t=>a.checkboxRefs[e.id]=t,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e.id)}},null)})]}))))?t:{default:()=>[t]})]}):c(o,{btnStatus:!1,tips:"暂无学员"},null)])}}});var ie={cellTeacher:"_cellTeacher_fnv0v_1",img:"_img_fnv0v_1",name:"_name_fnv0v_9",class:"_class_fnv0v_16",checkboxValue:"_checkboxValue_fnv0v_25",subjectContainer:"_subjectContainer_fnv0v_29",tagSubject:"_tagSubject_fnv0v_35"};function le(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!d(e)}var ce=a({name:"teacher-list",props:{height:{type:[String,Number],default:"auto"},bottomHeight:{type:[String,Number],default:0},headerHeight:{type:[String,Number],default:0},removeTeacherId:{type:String,default:""},subjectIdList:{type:Array,default:()=>[]},selectItem:{type:Array,default:()=>[]}},emits:["close","select","update:selectItem"],setup(e,{slots:t,attrs:a,emit:r}){const d=s({teacherStatus:!1,isLoad:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{keyword:null,subjectIdList:e.subjectIdList,page:1,rows:20},check:e.selectItem||[],checkboxRefs:[]}),p=async()=>{try{if(d.isLoad)return;d.isLoad=!0;const t=await h.post("/api-school/teacher/page",{data:{...d.params,schoolId:u.user.data.school.id,removeTeacherId:e.removeTeacherId,delFlag:!1}});d.listState.loading=!1;const a=t.data||{};if(d.list.length>0&&1===a.current)return;const s=a.rows||[];s.forEach((e=>{e.subjectNames=e.subjectName?e.subjectName.split(","):[]})),d.list=d.list.concat(s),d.listState.finished=a.current>=a.pages,d.params.page=a.current+1,d.listState.dataShow=d.list.length>0,d.isLoad=!1}catch{d.listState.dataShow=!1,d.listState.finished=!0,d.isLoad=!1}},m=e=>{d.checkboxRefs[e].toggle();const t=[];d.list.forEach((e=>{d.check.includes(e.id)&&t.push({id:e.id,value:e.nickname,avatar:e.avatar})})),r("update:selectItem",t)};i((()=>e.selectItem),(()=>{g()}),{deep:!0});const g=()=>{const t=e.selectItem||[],a=[];t.forEach((e=>{a.push(e.id)})),d.check=a};return l((()=>{p(),g()})),()=>{let t;return c("div",{class:[!d.listState.dataShow&&"emptyRootContainer"],style:{"min-height":`calc(100vh - ${e.height}px - ${e.bottomHeight}px)`}},[c(I,{position:"top",offsetTop:e.headerHeight,style:{width:"100%"}},{default:()=>[c(R,{placeholder:"伴学老师姓名",onSearch:e=>{d.params.keyword=e,d.params.page=1,d.list=[],d.listState.dataShow=!0,d.listState.loading=!1,d.listState.finished=!1,p()}},null)]}),d.listState.dataShow?c(L,{finished:d.listState.finished,finishedText:" ",style:{paddingTop:"12px"},onLoad:p,immediateCheck:!1},{default:()=>[c(N,{class:[ie.gridContainer,ie.gridClass],modelValue:d.check,"onUpdate:modelValue":e=>d.check=e},le(t=d.list.map((e=>c(H,{inset:!0,style:{marginBottom:"12px"},onClick:()=>m(e.id)},{default:()=>[c(E,{center:!0,class:ie.cellTeacher,valueClass:ie.checkboxValue},{icon:()=>c(D,{class:ie.img,src:e.avatar||w,fit:"cover"},null),title:()=>c("div",{class:ie.content},[c("p",{class:[ie.name,"van-ellipsis"]},[e.nickname])]),value:()=>c(A,{name:e.id,ref:t=>d.checkboxRefs[e.id]=t,onClick:t=>{t.preventDefault(),t.stopPropagation(),m(e.id)}},null)}),c(E,{center:!0},{title:()=>c("div",{class:ie.subjectContainer},[c("span",null,[n("声部:")]),c("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap"}},[e.subjectNames&&e.subjectNames.map((e=>c(V,{type:"primary",class:ie.tagSubject,color:"#FFE7DA",textColor:"#F67146"},le(e)?e:{default:()=>[e]})))])])})]}))))?t:{default:()=>[t]})]}):c(o,{btnStatus:!1,tips:"暂无伴学老师"},null)])}}}),ne=a({name:"select-send",props:{selectList:{type:Object,default:()=>({})},selectStatus:{type:Boolean,default:!1}},emits:["close","confirm","update:selectList"],setup(e,{emit:t}){const a=s({headerHeight:0,height:"auto",bottomHeight:0,tabValue:"class",selectClass:[],selectStudent:[],selectTeacher:[],selectManage:[]}),o=async()=>{const e={class:a.selectClass,student:a.selectStudent,teacher:a.selectTeacher,school:a.selectManage};t("close"),t("update:selectList",e),t("confirm",e)};i((()=>e.selectList),(()=>{console.log("watch",e.selectList),r()}),{deep:!0});const r=()=>{const t=e.selectList||{};a.selectClass=t.class||[],a.selectTeacher=t.teacher||[],a.selectManage=t.school||[],a.selectStudent=t.student||[]};return l((()=>{const{height:e}=p(document.querySelector(".van-tab"));a.height="auto"===a.height?e:a.height+e,r(),console.log(a,"select")})),()=>c("div",{class:T.orchestraDetail,style:{background:"#f6f6f6",minHeight:"100vh"},id:"select-send-message"},[c(k,{onGetHeight:e=>{console.log(e,"height"),a.height="auto"===a.height?e:a.height+e,a.headerHeight=e}},{default:()=>[c(m,{title:"发送对象"},null)]}),c(B,{sticky:!0,lineWidth:20,lineHeight:4,active:a.tabValue,"onUpdate:active":e=>a.tabValue=e,offsetTop:a.headerHeight},{default:()=>[c(P,{title:"班级列表",name:"class"},{default:()=>[c(Q,{height:a.height,headerHeight:a.headerHeight,bottomHeight:a.bottomHeight,selectItem:a.selectClass,"onUpdate:selectItem":e=>a.selectClass=e},null)]}),c(P,{title:"学员列表",name:"student"},{default:()=>[c(se,{height:a.height,headerHeight:a.headerHeight,bottomHeight:a.bottomHeight,selectItem:a.selectStudent,"onUpdate:selectItem":e=>a.selectStudent=e},null)]}),c(P,{title:"伴学老师",name:"teacher"},{default:()=>[c(ce,{height:a.height,headerHeight:a.headerHeight,bottomHeight:a.bottomHeight,selectItem:a.selectTeacher,"onUpdate:selectItem":e=>a.selectTeacher=e},null)]}),c(P,{title:"管理老师",name:"manage"},{default:()=>[c(ee,{height:a.height,headerHeight:a.headerHeight,bottomHeight:a.bottomHeight,selectItem:a.selectManage,"onUpdate:selectItem":e=>a.selectManage=e},null)]})]}),c(k,{position:"bottom",onGetHeight:e=>{a.bottomHeight=e}},{default:()=>[c("div",{class:"btnGroup"},[c(g,{round:!0,block:!0,type:"primary",onClick:o},{default:()=>[n("确认")]})])]})])}});e("default",a({name:"create-message",setup(){const e=f(),t=_(),a=s({id:t.query.id,type:"ADD",bucket:"i-m",sendStatus:!1,sendType:"IMMEDIATELY",textMessage:null,sendTime:null,sendTimeStatus:!1,maxDate:v(new Date).add(60,"day").toDate(),currentDate:[],currentTime:[v().format("HH"),v().format("mm")],attachments:[],receives:[],selectStatus:!1,selectList:{},delSelectItem:{},delStatus:!1,sureLoading:!1,updateLoading:!1,closeLoading:!1,actions:[{name:"即时发送",value:"IMMEDIATELY",selected:!0},{name:"定时发送",value:"SCHEDULED"}]}),i=async()=>{try{if(!a.sendType)return void j("请选择发送方式");if(!a.textMessage)return void j("请输入发送内容");if(a.receives.length<=0)return void j("请选择发送对象");const t=[];a.attachments.forEach((e=>{t.push({imgUrl:e,imgMessage:e})}));const s=[];a.receives.forEach((e=>{s.push({receiveType:e.receiveType,receiveId:e.receiveId})}));const i={sendType:a.sendType,textMessage:a.textMessage,attachments:t,receives:s,sendTime:a.sendTime};console.log(i,"params"),a.id?a.updateLoading=!0:a.sureLoading=!0,a.id?(i.id=a.id,await h.post("/api-school/imMessageBatchSending/update",{hideLoading:!1,data:i})):await h.post("/api-school/imMessageBatchSending/save",{hideLoading:!1,data:i}),e.back(),a.sureLoading=!1,a.updateLoading=!1}catch{a.sureLoading=!1,a.updateLoading=!1}},o=b((()=>"SEND"===a.type)),d=async()=>{try{a.closeLoading=!0,await h.post("/api-school/imMessageBatchSending/remove",{requestType:"form",hideLoading:!1,data:{id:a.id}}),setTimeout((()=>{j("撤销成功")}),100),setTimeout((()=>{e.back(),a.closeLoading=!1}),1100)}catch{a.closeLoading=!1}};return l((()=>{(async()=>{try{if(!a.id)return;const{data:e}=await h.get("/api-school/imMessageBatchSending/detail/"+a.id);a.sendType=e.sendType,a.textMessage=e.textMessage,a.sendTime=e.sendTime,a.type=e.sendStatus;const t=e.receives||[],s={class:[],teacher:[],student:[],school:[]};t.forEach((e=>{const t={receiveType:e.receiveType,receiveId:e.receiveId,receiveName:e.receiveName,avatar:e.avatar};a.receives.push(t);const i={id:e.receiveId,value:e.receiveName,avatar:e.avatar};"CLASS"===e.receiveType?s.class.push(i):"STUDENT"===e.receiveType?s.student.push(i):"TEACHER"===e.receiveType?s.teacher.push(i):"SCHOOL"===e.receiveType&&s.school.push(i)})),a.selectList=s;const i=e.attachments||[],l=[];i.forEach((e=>{l.push(e.imgUrl||e.imgMessage)})),a.attachments=l}catch(e){console.log(e,"e")}})()})),()=>c("div",{class:T["create-message"]},[c(m,null,null),c(H,{inset:!0,class:T.cellGroup},{default:()=>[c(W,{inputAlign:"right",label:"发送方式",modelValue:C[a.sendType],placeholder:"请选择发送方式",onClick:()=>{o.value||(a.sendStatus=!0)},readonly:!0,isLink:!o.value,class:T.inputForm},null),"SCHEDULED"===a.sendType&&c(W,{inputAlign:"right",label:"发送时间",modelValue:a.sendTime,placeholder:"请选择发送时间",onClick:()=>{o.value||(a.sendTimeStatus=!0)},readonly:!0,isLink:!0,class:T.inputForm},null),c(E,{title:"发送内容"},{label:()=>c(W,{style:{padding:"0",marginTop:"12px"},placeholder:"请输入发送内容",modelValue:a.textMessage,"onUpdate:modelValue":e=>a.textMessage=e,type:"textarea",rows:3,showWordLimit:!0,maxlength:400,readonly:o.value},null)}),c(E,{title:"上传附件"},{label:()=>c($,{modelValue:a.attachments,"onUpdate:modelValue":e=>a.attachments=e,maxCount:9,bucket:a.bucket,disabled:o.value},null)}),c(W,{label:"发送对象",readonly:!0,inputAlign:"right",class:T.sendObjPlaceholder,placeholder:o.value?"":"请选择发送对象",isLink:!o.value,border:!1,onClick:()=>{o.value||(a.selectStatus=!0)}},null),a.receives.map((e=>{let t=z;return"CLASS"===e.receiveType?t="./assets/icon_jiaofu.97430aa5.png":"STUDENT"===e.receiveType?t=z:"TEACHER"!==e.receiveType&&"SCHOOL"!==e.receiveType||(t=w),c(E,{class:T.receives,title:e.receiveName,center:!0,border:!1},{icon:()=>c(D,{class:T.img,src:e.avatar||t},null),extra:()=>!o.value&&c(y,{name:"clear",color:"#d7d7d7",size:20,onClick:()=>{a.delSelectItem=e,a.delStatus=!0}},null)})}))]}),c(k,{position:"bottom"},{default:()=>["ADD"===a.type&&c("div",{class:"btnGroup"},[c(g,{round:!0,block:!0,type:"primary",onClick:i,disabled:a.sureLoading},{default:()=>[n("确认发送")]})]),"WAIT"===a.type&&c("div",{class:["btnGroup","btnMore"]},[c(g,{round:!0,type:"primary",onClick:i,disabled:a.updateLoading},{default:()=>[n("修改")]}),c(g,{round:!0,color:"#64A9FF",onClick:d,disabled:a.closeLoading},{default:()=>[n("撤销")]})])]}),c(F,{show:a.sendStatus,"onUpdate:show":e=>a.sendStatus=e,actions:a.actions,onSelect:e=>{a.actions.forEach((e=>{e.selected=!1})),e.selected=!0,a.sendType=e.value,a.sendStatus=!1}},null),c(r,{show:a.sendTimeStatus,"onUpdate:show":e=>a.sendTimeStatus=e,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[c(J,{title:"发送时间",tabs:["选择日期","选择时间"],onCancel:()=>a.sendTimeStatus=!1,onConfirm:e=>{const t=e[0].selectedValues.join("-"),s=e[1].selectedValues.join(":");a.sendTime=v(t+" "+s).format("YYYY-MM-DD HH:mm:ss"),a.sendTimeStatus=!1}},{default:()=>[c(Z,{minDate:new Date,maxDate:a.maxDate,modelValue:a.currentDate,"onUpdate:modelValue":e=>a.currentDate=e,formatter:S},null),c(q,{modelValue:a.currentTime,"onUpdate:modelValue":e=>a.currentTime=e,formatter:(e,t)=>("hour"===e&&(t.text+="时"),"minute"===e&&(t.text+="分"),t)},null)]})]}),c(x,{modelValue:a.selectStatus,"onUpdate:modelValue":e=>a.selectStatus=e},{default:()=>[c(ne,{selectList:a.selectList,"onUpdate:selectList":e=>a.selectList=e,onClose:()=>a.selectStatus=!1,onConfirm:e=>{const t=e.class||[],s=e.student||[],i=e.teacher||[],l=e.school||[],c=[];t.forEach((e=>{c.push({receiveType:"CLASS",receiveId:e.id,receiveName:e.value,avatar:e.avatar})})),s.forEach((e=>{c.push({receiveType:"STUDENT",receiveId:e.id,receiveName:e.value,avatar:e.avatar})})),i.forEach((e=>{c.push({receiveType:"TEACHER",receiveId:e.id,receiveName:e.value,avatar:e.avatar})})),l.forEach((e=>{c.push({receiveType:"SCHOOL",receiveId:e.id,receiveName:e.value,avatar:e.avatar})})),a.receives=c}},null)]}),c(G,{show:a.delStatus,"onUpdate:show":e=>a.delStatus=e,showCancelButton:!0,message:"您是否删除该数据",onConfirm:()=>{const e=a.selectList;if("CLASS"===a.delSelectItem.receiveType){const t=e.class||[],s=t.findIndex((e=>e.id===a.delSelectItem.receiveId));t.splice(s,1)}else if("SCHOOL"===a.delSelectItem.receiveType){const t=e.school||[],s=t.findIndex((e=>e.id===a.delSelectItem.receiveId));t.splice(s,1)}else if("TEACHER"===a.delSelectItem.receiveType){const t=e.teacher||[],s=t.findIndex((e=>e.id===a.delSelectItem.receiveId));t.splice(s,1)}else if("STUDENT"===a.delSelectItem.receiveType){const t=e.student||[],s=t.findIndex((e=>e.id===a.delSelectItem.receiveId));t.splice(s,1)}a.selectList=e,console.log(a.selectList,"forms.selectList");const t=a.receives.findIndex((e=>e.receiveId===a.delSelectItem.receiveId));a.receives.splice(t,1)}},null)])}}))}}}))}();