create-message-legacy.796e292f.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.6cf9fd4f.js","./index-legacy.4e015ad0.js","./index-legacy.06229de7.js","./index.module-legacy.475a9872.js","./index-legacy.74cb326f.js","./icon_teacher-legacy.07765f44.js","./index-legacy.33772deb.js","./index-legacy.ecdeb772.js","./index-legacy.cc2af90c.js","./index-legacy.69af2236.js","./index-legacy.6f80e7ba.js","./index-legacy.c4bb9d1e.js","./index-legacy.bf334811.js","./index-legacy.2086bc31.js","./index-legacy.d6538365.js","./index-legacy.e68f03d6.js","./index-legacy.6db3f7a2.js","./index-legacy.5b57e31e.js","./icon_student-legacy.6118fd72.js","./index-legacy.8367ebcb.js","./index-legacy.1ace578b.js","./index-legacy.e41865a6.js","./Picker-legacy.96c4ea3f.js","./index-legacy.6638bee5.js","./index-legacy.b893b771.js","./index-legacy.b02dbd1b.js","./use-tab-status-legacy.96841dfc.js","./Checker-legacy.c7ee598c.js","./index-legacy.4b70c4b0.js","./index-legacy.7b9723ea.js","./index-legacy.a105452a.js","./index-legacy.a047a179.js","./ImagePreview-legacy.33cb5418.js","./function-call-legacy.053a90b5.js","./utils-legacy.976fa788.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.O},function(e){a=e.e},function(e){s=e.D,i=e.d,l=e.r,c=e.Z,n=e.$,o=e.c,r=e.q,d=e.ak,h=e.P,u=e.al,p=e.m,m=e.g,g=e.an,f=e.aj,_=e.B,v=e.ag,b=e.ah,y=e.ai,S=e.y,j=e.a5,x=e.b2,C=e.o},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=s(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=i({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=l({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:[]}),s=async()=>{try{if(a.isClick)return;a.isClick=!0;const{data:e}=await p.post("/api-school/classGroup/page",{data:{...a.params,schoolId:m.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}},i=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)};c((()=>e.selectItem),(()=>{g()}),{deep:!0});const g=()=>{const t=e.selectItem||[],s=[];t.forEach((e=>{s.push(e.id)})),a.check=s};return n((async()=>{await(async()=>{try{const{data:e}=await p.post("/api-school/orchestra/page",{data:{page:1,rows:100,schoolId:m.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 s(),g()})),()=>{let t;return o("div",{class:[K.practiceClass,!a.listState.dataShow&&"emptyRootContainer"],style:{"min-height":`calc(100vh - ${e.height}px - ${e.bottomHeight}px)`}},[a.orchestraList.length>0&&o(I,{position:"top",offsetTop:e.headerHeight,style:{width:"100%"}},{default:()=>[o("div",{class:"searchGroup-single"},[o("div",{class:["searchItem",a.showPopover?"searchItem-active":""],onClick:()=>a.showPopover=!0},[o("span",null,[a.orchestraName])])])]}),a.listState.dataShow?o(L,{finished:a.listState.finished,finishedText:" ",class:[K.liveList],onLoad:s,immediateCheck:!1},{default:()=>{return[o(N,{class:[K.gridContainer,K.gridClass],modelValue:a.check,"onUpdate:modelValue":e=>a.check=e},(e=t=a.list.map((e=>o(H,{class:K.classCellGroup,onClick:()=>i(e.id),border:!1},{default:()=>[o(E,{center:!0,titleStyle:{flex:"0 auto"},valueClass:K.classCheckbox},{icon:()=>o(D,{src:w,class:K.img},null),title:()=>o("div",{class:K.content},[o("div",{class:K.teacherName},[o("span",{class:["van-ellipsis",K.name]},[e.teacherName]),o(V,{type:"primary"},{default:()=>[e.name]})]),o("div",{class:[K.orchestraName,"van-ellipsis"]},[e.orchestraName])]),value:()=>o(A,{name:e.id,ref:t=>a.checkboxRefs[e.id]=t,onClick:t=>{t.preventDefault(),t.stopPropagation(),i(e.id)}},null)}),o(O,{border:!1,columnNum:3},{default:()=>[o(M,null,{default:()=>[o("p",{class:K.title},[e.preStudentNum]),o("p",{class:K.name},[r("学员人数")])]}),o(M,null,{default:()=>[o("p",{class:[K.title]},[e.courseScheduleNum-e.completeCourseScheduleNum]),o("p",{class:K.name},[r("剩余课时")])]}),o(M,null,{default:()=>[o("p",{class:K.title},[e.courseScheduleNum]),o("p",{class:K.name},[r("总课时")])]})]})]}))),"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!u(e)?t:{default:()=>[t]}))];var e}}):o(d,{btnStatus:!1,tips:"暂无班级"},null),o(h,{show:a.showPopover,"onUpdate:show":e=>a.showPopover=e,position:"bottom",round:!0,class:"popupBottomSearch",teleport:"#select-send-message"},{default:()=>[o(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,s()}},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=i({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:s}){const i=l({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:[]}),r=async()=>{try{if(i.isLoad)return;i.isLoad=!0;const e=await p.post("/api-school/schoolStaff/page",{data:{...i.params,schoolId:m.user.data.school.id,status:"ACTIVATION"}});i.listState.loading=!1;const t=e.data||{};if(i.list.length>0&&1===t.current)return;const a=t.rows||[];a.forEach((e=>{e.subjectNames=e.subjectName?e.subjectName.split(","):[]})),i.list=i.list.concat(a),i.listState.finished=t.current>=t.pages,i.params.page=t.current+1,i.listState.dataShow=i.list.length>0,i.isLoad=!1}catch{i.listState.dataShow=!1,i.listState.finished=!0,i.isLoad=!1}},h=e=>{i.checkboxRefs[e].toggle();const t=[];i.list.forEach((e=>{i.check.includes(e.id)&&t.push({id:e.id,value:e.nickname,avatar:e.avatar})})),s("update:selectItem",t)};c((()=>e.selectItem),(()=>{g()}),{deep:!0});const g=()=>{const t=e.selectItem||[],a=[];t.forEach((e=>{a.push(e.id)})),i.check=a};return n((()=>{r(),g(),console.log(e.height,e.bottomHeight,"11121212")})),()=>{let t;return o("div",{class:[!i.listState.dataShow&&"emptyRootContainer"],style:{"min-height":`calc(100vh - ${"auto"===e.height?0:e.height}px - ${e.bottomHeight}px)`}},[o(I,{position:"top",offsetTop:e.headerHeight,style:{width:"100%"}},{default:()=>[o(R,{placeholder:"管理老师姓名/手机号",onSearch:e=>{i.params.keyword=e,i.params.page=1,i.list=[],i.listState.dataShow=!0,i.listState.loading=!1,i.listState.finished=!1,r()}},null)]}),i.listState.dataShow?o(L,{finished:i.listState.finished,finishedText:" ",onLoad:r,style:{paddingTop:"12px"},immediateCheck:!1},{default:()=>{return[o(N,{class:[X.gridContainer,X.gridClass],modelValue:i.check,"onUpdate:modelValue":e=>i.check=e},(e=t=i.list.map((e=>o(H,{inset:!0,style:{marginBottom:"12px"},onClick:()=>h(e.id)},{default:()=>[o(E,{center:!0,class:X.cellTeacher,valueClass:X.checkboxValue},{icon:()=>o(D,{class:X.img,src:e.avatar||w,fit:"cover"},null),title:()=>o("div",{class:X.content},[o("p",{class:[X.name,"van-ellipsis"]},[e.nickname])]),value:()=>o(A,{name:e.id,ref:t=>i.checkboxRefs[e.id]=t,onClick:t=>{t.preventDefault(),t.stopPropagation(),h(e.id)}},null)})]}))),"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!u(e)?t:{default:()=>[t]}))];var e}}):o(d,{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)&&!u(e)}var se=i({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=l({teacherStatus:!1,isLoad:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{keyword:null,page:1,rows:20},check:e.selectItem||[],checkboxRefs:[]}),s=async()=>{try{if(a.isLoad)return;a.isLoad=!0;const e=await p.post("/api-school/student/page",{data:{...a.params,schoolId:m.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}},i=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)};c((()=>e.selectItem),(()=>{r()}),{deep:!0});const r=()=>{const t=e.selectItem||[],s=[];t.forEach((e=>{s.push(e.id)})),a.check=s};return n((()=>{s(),r()})),()=>{let t;return o("div",{class:[!a.listState.dataShow&&"emptyRootContainer"],style:{"min-height":`calc(100vh - ${e.height}px - ${e.bottomHeight}px)`}},[o(I,{position:"top",offsetTop:e.headerHeight,style:{width:"100%"}},{default:()=>[o(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,s()}},null)]}),a.listState.dataShow?o(L,{finished:a.listState.finished,finishedText:" ",onLoad:s,style:{paddingTop:"12px"},immediateCheck:!1},{default:()=>[o(N,{class:[te.gridContainer,te.gridClass],modelValue:a.check,"onUpdate:modelValue":e=>a.check=e},ae(t=a.list.map((e=>o(H,{inset:!0,style:{marginBottom:"12px"},onClick:()=>i(e.id)},{default:()=>[o(E,{center:!0,class:te.cellTeacher,valueClass:te.checkboxValue},{icon:()=>o(D,{class:te.img,src:e.avatar||w,fit:"cover"},null),title:()=>o("div",{class:te.content},[o("p",{class:[te.name,"van-ellipsis"]},[e.nickname]),o("p",{class:te.class},[e.subjectNames&&e.subjectNames.map((e=>o(V,{type:"primary",class:te.tagSubject,color:"#FFE7DA",textColor:"#F67146"},ae(e)?e:{default:()=>[e]})))])]),value:()=>o(A,{name:e.id,ref:t=>a.checkboxRefs[e.id]=t,onClick:t=>{t.preventDefault(),t.stopPropagation(),i(e.id)}},null)})]}))))?t:{default:()=>[t]})]}):o(d,{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)&&!u(e)}var ce=i({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:s}){const i=l({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:[]}),h=async()=>{try{if(i.isLoad)return;i.isLoad=!0;const t=await p.post("/api-school/teacher/page",{data:{...i.params,schoolId:m.user.data.school.id,removeTeacherId:e.removeTeacherId,delFlag:!1}});i.listState.loading=!1;const a=t.data||{};if(i.list.length>0&&1===a.current)return;const s=a.rows||[];s.forEach((e=>{e.subjectNames=e.subjectName?e.subjectName.split(","):[]})),i.list=i.list.concat(s),i.listState.finished=a.current>=a.pages,i.params.page=a.current+1,i.listState.dataShow=i.list.length>0,i.isLoad=!1}catch{i.listState.dataShow=!1,i.listState.finished=!0,i.isLoad=!1}},u=e=>{i.checkboxRefs[e].toggle();const t=[];i.list.forEach((e=>{i.check.includes(e.id)&&t.push({id:e.id,value:e.nickname,avatar:e.avatar})})),s("update:selectItem",t)};c((()=>e.selectItem),(()=>{g()}),{deep:!0});const g=()=>{const t=e.selectItem||[],a=[];t.forEach((e=>{a.push(e.id)})),i.check=a};return n((()=>{h(),g()})),()=>{let t;return o("div",{class:[!i.listState.dataShow&&"emptyRootContainer"],style:{"min-height":`calc(100vh - ${e.height}px - ${e.bottomHeight}px)`}},[o(I,{position:"top",offsetTop:e.headerHeight,style:{width:"100%"}},{default:()=>[o(R,{placeholder:"伴学老师姓名",onSearch:e=>{i.params.keyword=e,i.params.page=1,i.list=[],i.listState.dataShow=!0,i.listState.loading=!1,i.listState.finished=!1,h()}},null)]}),i.listState.dataShow?o(L,{finished:i.listState.finished,finishedText:" ",style:{paddingTop:"12px"},onLoad:h,immediateCheck:!1},{default:()=>[o(N,{class:[ie.gridContainer,ie.gridClass],modelValue:i.check,"onUpdate:modelValue":e=>i.check=e},le(t=i.list.map((e=>o(H,{inset:!0,style:{marginBottom:"12px"},onClick:()=>u(e.id)},{default:()=>[o(E,{center:!0,class:ie.cellTeacher,valueClass:ie.checkboxValue},{icon:()=>o(D,{class:ie.img,src:e.avatar||w,fit:"cover"},null),title:()=>o("div",{class:ie.content},[o("p",{class:[ie.name,"van-ellipsis"]},[e.nickname])]),value:()=>o(A,{name:e.id,ref:t=>i.checkboxRefs[e.id]=t,onClick:t=>{t.preventDefault(),t.stopPropagation(),u(e.id)}},null)}),o(E,{center:!0},{title:()=>o("div",{class:ie.subjectContainer},[o("span",null,[r("声部:")]),o("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap"}},[e.subjectNames&&e.subjectNames.map((e=>o(V,{type:"primary",class:ie.tagSubject,color:"#FFE7DA",textColor:"#F67146"},le(e)?e:{default:()=>[e]})))])])})]}))))?t:{default:()=>[t]})]}):o(d,{btnStatus:!1,tips:"暂无伴学老师"},null)])}}}),ne=i({name:"select-send",props:{selectList:{type:Object,default:()=>({})},selectStatus:{type:Boolean,default:!1}},emits:["close","confirm","update:selectList"],setup(e,{emit:t}){const a=l({headerHeight:0,height:"auto",bottomHeight:0,tabValue:"class",selectClass:[],selectStudent:[],selectTeacher:[],selectManage:[]}),s=async()=>{const e={class:a.selectClass,student:a.selectStudent,teacher:a.selectTeacher,school:a.selectManage};t("close"),t("update:selectList",e),t("confirm",e)};c((()=>e.selectList),(()=>{console.log("watch",e.selectList),i()}),{deep:!0});const i=()=>{const t=e.selectList||{};a.selectClass=t.class||[],a.selectTeacher=t.teacher||[],a.selectManage=t.school||[],a.selectStudent=t.student||[]};return n((()=>{const{height:e}=g(document.querySelector(".van-tab"));a.height="auto"===a.height?e:a.height+e,i(),console.log(a,"select")})),()=>o("div",{class:T.orchestraDetail,style:{background:"#f6f6f6",minHeight:"100vh"},id:"select-send-message"},[o(k,{onGetHeight:e=>{console.log(e,"height"),a.height="auto"===a.height?e:a.height+e,a.headerHeight=e}},{default:()=>[o(f,{title:"发送对象"},null)]}),o(B,{sticky:!0,lineWidth:20,lineHeight:4,active:a.tabValue,"onUpdate:active":e=>a.tabValue=e,offsetTop:a.headerHeight},{default:()=>[o(P,{title:"班级列表",name:"class"},{default:()=>[o(Q,{height:a.height,headerHeight:a.headerHeight,bottomHeight:a.bottomHeight,selectItem:a.selectClass,"onUpdate:selectItem":e=>a.selectClass=e},null)]}),o(P,{title:"学员列表",name:"student"},{default:()=>[o(se,{height:a.height,headerHeight:a.headerHeight,bottomHeight:a.bottomHeight,selectItem:a.selectStudent,"onUpdate:selectItem":e=>a.selectStudent=e},null)]}),o(P,{title:"伴学老师",name:"teacher"},{default:()=>[o(ce,{height:a.height,headerHeight:a.headerHeight,bottomHeight:a.bottomHeight,selectItem:a.selectTeacher,"onUpdate:selectItem":e=>a.selectTeacher=e},null)]}),o(P,{title:"管理老师",name:"manage"},{default:()=>[o(ee,{height:a.height,headerHeight:a.headerHeight,bottomHeight:a.bottomHeight,selectItem:a.selectManage,"onUpdate:selectItem":e=>a.selectManage=e},null)]})]}),o(k,{position:"bottom",onGetHeight:e=>{a.bottomHeight=e}},{default:()=>[o("div",{class:"btnGroup"},[o(_,{round:!0,block:!0,type:"primary",onClick:s},{default:()=>[r("确认")]})])]})])}});e("default",i({name:"create-message",setup(){const e=v(),s=b(),i=l({id:s.query.id,type:"ADD",bucket:"i-m",sendStatus:!1,sendType:"IMMEDIATELY",textMessage:null,sendTime:null,sendTimeStatus:!1,maxDate:y(new Date).add(60,"day").toDate(),currentDate:[],currentTime:[y().format("HH"),y().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"}]}),c=async()=>{try{if(!i.sendType)return void C("请选择发送方式");if(!i.textMessage)return void C("请输入发送内容");if(i.receives.length<=0)return void C("请选择发送对象");const t=[];i.attachments.forEach((e=>{t.push({imgUrl:e,imgMessage:e})}));const a=[];i.receives.forEach((e=>{a.push({receiveType:e.receiveType,receiveId:e.receiveId})}));const s={sendType:i.sendType,textMessage:i.textMessage,attachments:t,receives:a,sendTime:i.sendTime};console.log(s,"params"),i.id?i.updateLoading=!0:i.sureLoading=!0,i.id?(s.id=i.id,await p.post("/api-school/imMessageBatchSending/update",{hideLoading:!1,data:s})):await p.post("/api-school/imMessageBatchSending/save",{hideLoading:!1,data:s}),e.back(),i.sureLoading=!1,i.updateLoading=!1}catch{i.sureLoading=!1,i.updateLoading=!1}},d=S((()=>"SEND"===i.type)),u=async()=>{try{i.closeLoading=!0,await p.post("/api-school/imMessageBatchSending/remove",{requestType:"form",hideLoading:!1,data:{id:i.id}}),setTimeout((()=>{C("撤销成功")}),100),setTimeout((()=>{e.back(),i.closeLoading=!1}),1100)}catch{i.closeLoading=!1}};return n((()=>{(async()=>{try{if(!i.id)return;const{data:e}=await p.get("/api-school/imMessageBatchSending/detail/"+i.id);i.sendType=e.sendType,i.textMessage=e.textMessage,i.sendTime=e.sendTime,i.type=e.sendStatus;const t=e.receives||[],a={class:[],teacher:[],student:[],school:[]};t.forEach((e=>{const t={receiveType:e.receiveType,receiveId:e.receiveId,receiveName:e.receiveName,avatar:e.avatar};i.receives.push(t);const s={id:e.receiveId,value:e.receiveName,avatar:e.avatar};"CLASS"===e.receiveType?a.class.push(s):"STUDENT"===e.receiveType?a.student.push(s):"TEACHER"===e.receiveType?a.teacher.push(s):"SCHOOL"===e.receiveType&&a.school.push(s)})),i.selectList=a;const s=e.attachments||[],l=[];s.forEach((e=>{l.push(e.imgUrl||e.imgMessage)})),i.attachments=l}catch(e){console.log(e,"e")}})()})),()=>o("div",{class:T["create-message"]},[o(f,null,null),o(H,{inset:!0,class:T.cellGroup},{default:()=>[o(W,{inputAlign:"right",label:"发送方式",modelValue:a[i.sendType],placeholder:"请选择发送方式",onClick:()=>{d.value||(i.sendStatus=!0)},readonly:!0,isLink:!d.value,class:T.inputForm},null),"SCHEDULED"===i.sendType&&o(W,{inputAlign:"right",label:"发送时间",modelValue:i.sendTime,placeholder:"请选择发送时间",onClick:()=>{d.value||(i.sendTimeStatus=!0)},readonly:!0,isLink:!0,class:T.inputForm},null),o(E,{title:"发送内容"},{label:()=>o(W,{style:{padding:"0",marginTop:"12px"},placeholder:"请输入发送内容",modelValue:i.textMessage,"onUpdate:modelValue":e=>i.textMessage=e,type:"textarea",rows:3,showWordLimit:!0,maxlength:400,readonly:d.value},null)}),o(E,{title:"上传附件"},{label:()=>o($,{modelValue:i.attachments,"onUpdate:modelValue":e=>i.attachments=e,maxCount:9,bucket:i.bucket,disabled:d.value},null)}),o(W,{label:"发送对象",readonly:!0,inputAlign:"right",class:T.sendObjPlaceholder,placeholder:d.value?"":"请选择发送对象",isLink:!d.value,border:!1,onClick:()=>{d.value||(i.selectStatus=!0)}},null),i.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),o(E,{class:T.receives,title:e.receiveName,center:!0,border:!1},{icon:()=>o(D,{class:T.img,src:e.avatar||t},null),extra:()=>!d.value&&o(j,{name:"clear",color:"#d7d7d7",size:20,onClick:()=>{i.delSelectItem=e,i.delStatus=!0}},null)})}))]}),o(k,{position:"bottom"},{default:()=>["ADD"===i.type&&o("div",{class:"btnGroup"},[o(_,{round:!0,block:!0,type:"primary",onClick:c,disabled:i.sureLoading},{default:()=>[r("确认发送")]})]),"WAIT"===i.type&&o("div",{class:["btnGroup","btnMore"]},[o(_,{round:!0,type:"primary",onClick:c,disabled:i.updateLoading},{default:()=>[r("修改")]}),o(_,{round:!0,color:"#64A9FF",onClick:u,disabled:i.closeLoading},{default:()=>[r("撤销")]})])]}),o(F,{show:i.sendStatus,"onUpdate:show":e=>i.sendStatus=e,actions:i.actions,onSelect:e=>{i.actions.forEach((e=>{e.selected=!1})),e.selected=!0,i.sendType=e.value,i.sendStatus=!1}},null),o(h,{show:i.sendTimeStatus,"onUpdate:show":e=>i.sendTimeStatus=e,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[o(J,{title:"发送时间",tabs:["选择日期","选择时间"],onCancel:()=>i.sendTimeStatus=!1,onConfirm:e=>{const t=e[0].selectedValues.join("-"),a=e[1].selectedValues.join(":");i.sendTime=y(t+" "+a).format("YYYY-MM-DD HH:mm:ss"),i.sendTimeStatus=!1}},{default:()=>[o(Z,{minDate:new Date,maxDate:i.maxDate,modelValue:i.currentDate,"onUpdate:modelValue":e=>i.currentDate=e,formatter:x},null),o(q,{modelValue:i.currentTime,"onUpdate:modelValue":e=>i.currentTime=e,formatter:(e,t)=>("hour"===e&&(t.text+="时"),"minute"===e&&(t.text+="分"),t)},null)]})]}),o(t,{modelValue:i.selectStatus,"onUpdate:modelValue":e=>i.selectStatus=e},{default:()=>[o(ne,{selectList:i.selectList,"onUpdate:selectList":e=>i.selectList=e,onClose:()=>i.selectStatus=!1,onConfirm:e=>{const t=e.class||[],a=e.student||[],s=e.teacher||[],l=e.school||[],c=[];t.forEach((e=>{c.push({receiveType:"CLASS",receiveId:e.id,receiveName:e.value,avatar:e.avatar})})),a.forEach((e=>{c.push({receiveType:"STUDENT",receiveId:e.id,receiveName:e.value,avatar:e.avatar})})),s.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})})),i.receives=c}},null)]}),o(G,{show:i.delStatus,"onUpdate:show":e=>i.delStatus=e,showCancelButton:!0,message:"您是否删除该数据",onConfirm:()=>{const e=i.selectList;if("CLASS"===i.delSelectItem.receiveType){const t=e.class||[],a=t.findIndex((e=>e.id===i.delSelectItem.receiveId));t.splice(a,1)}else if("SCHOOL"===i.delSelectItem.receiveType){const t=e.school||[],a=t.findIndex((e=>e.id===i.delSelectItem.receiveId));t.splice(a,1)}else if("TEACHER"===i.delSelectItem.receiveType){const t=e.teacher||[],a=t.findIndex((e=>e.id===i.delSelectItem.receiveId));t.splice(a,1)}else if("STUDENT"===i.delSelectItem.receiveType){const t=e.student||[],a=t.findIndex((e=>e.id===i.delSelectItem.receiveId));t.splice(a,1)}i.selectList=e,console.log(i.selectList,"forms.selectList");const t=i.receives.findIndex((e=>e.receiveId===i.delSelectItem.receiveId));i.receives.splice(t,1)}},null)])}}))}}}))}();