1 |
- import{D as Q,d as T,r as I,Z as x,$ as k,c as t,q as y,ak as V,P as Z,al as O,m as v,g as L,an as X,aj as K,B as A,ag as ee,ah as te,ai as D,y as ae,a5 as se,b2 as le,o as H}from"./index.5f7ffb46.js";import{O as ce}from"./index.59b9f984.js";import{e as oe}from"./index.b28db9f5.js";import{s as b}from"./index.module.a0fba9ef.js";import{O as G}from"./index.7790de2a.js";import{i as w}from"./icon_teacher.df08d662.js";import{S as $}from"./index.61ab9823.js";import{L as M}from"./index.9ef28852.js";import{C as U}from"./index.d979c853.js";import{C as E}from"./index.052b3caa.js";import{C as _}from"./index.abd668f7.js";import{I as j}from"./index.276a5d68.js";import{T as Y}from"./index.ab2541bb.js";import{C as R}from"./index.13900508.js";import{G as ie,a as P}from"./index.adf0b8fc.js";import{P as ne}from"./index.de1f78a6.js";import{O as q}from"./index.ec2a7822.js";import{T as re,a as F}from"./index.6bbd7daa.js";import{i as W}from"./icon_student.660125da.js";import{O as ue}from"./index.95a99ca5.js";import{O as de}from"./index.fdad9231.js";import{O as he}from"./index.ef7edda2.js";import{a as pe}from"./Picker.148c9d83.js";import{T as me}from"./index.b9737213.js";import{F as B}from"./index.6438a25f.js";import{D as fe}from"./index.af85409e.js";import"./use-tab-status.69b57a37.js";import"./Checker.40bdbb46.js";import"./index.99e0cf1f.js";import"./index.78e196a2.js";import"./index.36e5ddaf.js";import"./index.4f3f29e9.js";import"./ImagePreview.289405c5.js";import"./function-call.aca3a7bc.js";import"./utils.0f86fc1f.js";const ge=Q(pe),Se="_searchBand_1dppi_1",ve="_bandName_1dppi_7",be="_gridContainer_1dppi_12",ye="_title_1dppi_15",_e="_red_1dppi_26",Ce="_name_1dppi_29",Te="_gridClass_1dppi_34",Ie="_img_1dppi_34",ke="_teacherName_1dppi_41",Le="_classCheckbox_1dppi_58",xe="_orchestraName_1dppi_62",we="_className_1dppi_72",Ee="_line_1dppi_79",je="_classCellGroup_1dppi_101";var h={searchBand:Se,bandName:ve,gridContainer:be,title:ye,red:_e,name:Ce,gridClass:Te,img:Ie,teacherName:ke,classCheckbox:Le,orchestraName:xe,className:we,line:Ee,classCellGroup:je};function Ne(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!O(i)}var De=T({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(i,{emit:m}){const e=I({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{const{data:a}=await v.post("/api-school/orchestra/page",{data:{page:1,rows:100,schoolId:L.user.data.school.id,status:"DONE"}}),s=a.rows||[],l=[];s.forEach(o=>{l.push({text:o.name,value:o.id})}),e.orchestraList=[...l],l.length>0&&(e.orchestraId=l[0].value,e.orchestraName=l[0].text)}catch{}},c=async()=>{try{if(e.isClick)return;e.isClick=!0;const{data:a}=await v.post("/api-school/classGroup/page",{data:{...e.params,schoolId:L.user.data.school.id,orchestraId:e.orchestraId}});e.isClick=!1,e.listState.loading=!1;const s=a||{};if(e.list.length>0&&s.current===1)return;e.list=e.list.concat(s.rows||[]),e.listState.finished=s.current>=s.pages,e.params.page=s.current+1,e.listState.dataShow=e.list.length>0}catch{e.listState.dataShow=!1,e.listState.finished=!0,e.isClick=!1}},n=a=>{e.checkboxRefs[a].toggle();const s=[];e.list.forEach(l=>{e.check.includes(l.id)&&s.push({id:l.id,value:l.name,avatar:""})}),m("update:selectItem",s)};x(()=>i.selectItem,()=>{f()},{deep:!0});const f=()=>{const a=i.selectItem||[],s=[];a.forEach(l=>{s.push(l.id)}),e.check=s};return k(async()=>{await p(),await c(),f()}),()=>{let a;return t("div",{class:[h.practiceClass,!e.listState.dataShow&&"emptyRootContainer"],style:{"min-height":`calc(100vh - ${i.height}px - ${i.bottomHeight}px)`}},[e.orchestraList.length>0&&t($,{position:"top",offsetTop:i.headerHeight,style:{width:"100%"}},{default:()=>[t("div",{class:"searchGroup-single"},[t("div",{class:["searchItem",e.showPopover?"searchItem-active":""],onClick:()=>e.showPopover=!0},[t("span",null,[e.orchestraName])])])]}),e.listState.dataShow?t(M,{finished:e.listState.finished,finishedText:" ",class:[h.liveList],onLoad:c,immediateCheck:!1},{default:()=>[t(U,{class:[h.gridContainer,h.gridClass],modelValue:e.check,"onUpdate:modelValue":s=>e.check=s},Ne(a=e.list.map(s=>t(E,{class:h.classCellGroup,onClick:()=>n(s.id),border:!1},{default:()=>[t(_,{center:!0,titleStyle:{flex:"0 auto"},valueClass:h.classCheckbox},{icon:()=>t(j,{src:w,class:h.img},null),title:()=>t("div",{class:h.content},[t("div",{class:h.teacherName},[t("span",{class:["van-ellipsis",h.name]},[s.teacherName]),t(Y,{type:"primary"},{default:()=>[s.name]})]),t("div",{class:[h.orchestraName,"van-ellipsis"]},[s.orchestraName])]),value:()=>t(R,{name:s.id,ref:l=>e.checkboxRefs[s.id]=l,onClick:l=>{l.preventDefault(),l.stopPropagation(),n(s.id)}},null)}),t(ie,{border:!1,columnNum:3},{default:()=>[t(P,null,{default:()=>[t("p",{class:h.title},[s.preStudentNum]),t("p",{class:h.name},[y("\u5B66\u5458\u4EBA\u6570")])]}),t(P,null,{default:()=>[t("p",{class:[h.title]},[s.courseScheduleNum-s.completeCourseScheduleNum]),t("p",{class:h.name},[y("\u5269\u4F59\u8BFE\u65F6")])]}),t(P,null,{default:()=>[t("p",{class:h.title},[s.courseScheduleNum]),t("p",{class:h.name},[y("\u603B\u8BFE\u65F6")])]})]})]})))?a:{default:()=>[a]})]}):t(V,{btnStatus:!1,tips:"\u6682\u65E0\u73ED\u7EA7"},null),t(Z,{show:e.showPopover,"onUpdate:show":s=>e.showPopover=s,position:"bottom",round:!0,class:"popupBottomSearch",teleport:"#select-send-message"},{default:()=>[t(ne,{columns:e.orchestraList,onCancel:()=>e.showPopover=!1,onConfirm:s=>{e.orchestraId=s.selectedOptions[0].value,e.orchestraName=s.selectedOptions[0].text,e.showPopover=!1,e.params.page=1,e.list=[],e.listState.dataShow=!0,e.listState.loading=!1,e.listState.finished=!1,c()}},null)]})])}}});const He="_cellTeacher_bjfo6_1",Fe="_img_bjfo6_1",Be="_name_bjfo6_9",Ae="_checkboxValue_bjfo6_25",Ve="_subjectContainer_bjfo6_29",Oe="_tagSubject_bjfo6_35";var C={cellTeacher:He,img:Fe,name:Be,class:"_class_bjfo6_16",checkboxValue:Ae,subjectContainer:Ve,tagSubject:Oe};function $e(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!O(i)}var Me=T({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(i,{slots:m,attrs:e,emit:p}){const c=I({teacherStatus:!1,isLoad:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{keyword:null,subjectIdList:i.subjectIdList,page:1,rows:20},check:i.selectItem||[],checkboxRefs:[]}),n=async()=>{try{if(c.isLoad)return;c.isLoad=!0;const l=await v.post("/api-school/schoolStaff/page",{data:{...c.params,schoolId:L.user.data.school.id,status:"ACTIVATION"}});c.listState.loading=!1;const o=l.data||{};if(c.list.length>0&&o.current===1)return;const r=o.rows||[];r.forEach(u=>{u.subjectNames=u.subjectName?u.subjectName.split(","):[]}),c.list=c.list.concat(r),c.listState.finished=o.current>=o.pages,c.params.page=o.current+1,c.listState.dataShow=c.list.length>0,c.isLoad=!1}catch{c.listState.dataShow=!1,c.listState.finished=!0,c.isLoad=!1}},f=()=>{c.params.page=1,c.list=[],c.listState.dataShow=!0,c.listState.loading=!1,c.listState.finished=!1,n()},a=l=>{c.checkboxRefs[l].toggle();const o=[];c.list.forEach(r=>{c.check.includes(r.id)&&o.push({id:r.id,value:r.nickname,avatar:r.avatar})}),p("update:selectItem",o)};x(()=>i.selectItem,()=>{s()},{deep:!0});const s=()=>{const l=i.selectItem||[],o=[];l.forEach(r=>{o.push(r.id)}),c.check=o};return k(()=>{n(),s(),console.log(i.height,i.bottomHeight,"11121212")}),()=>{let l;return t("div",{class:[!c.listState.dataShow&&"emptyRootContainer"],style:{"min-height":`calc(100vh - ${i.height==="auto"?0:i.height}px - ${i.bottomHeight}px)`}},[t($,{position:"top",offsetTop:i.headerHeight,style:{width:"100%"}},{default:()=>[t(q,{placeholder:"\u7BA1\u7406\u8001\u5E08\u59D3\u540D/\u624B\u673A\u53F7",onSearch:o=>{c.params.keyword=o,f()}},null)]}),c.listState.dataShow?t(M,{finished:c.listState.finished,finishedText:" ",onLoad:n,style:{paddingTop:"12px"},immediateCheck:!1},{default:()=>[t(U,{class:[C.gridContainer,C.gridClass],modelValue:c.check,"onUpdate:modelValue":o=>c.check=o},$e(l=c.list.map(o=>t(E,{inset:!0,style:{marginBottom:"12px"},onClick:()=>a(o.id)},{default:()=>[t(_,{center:!0,class:C.cellTeacher,valueClass:C.checkboxValue},{icon:()=>t(j,{class:C.img,src:o.avatar||w,fit:"cover"},null),title:()=>t("div",{class:C.content},[t("p",{class:[C.name,"van-ellipsis"]},[o.nickname])]),value:()=>t(R,{name:o.id,ref:r=>c.checkboxRefs[o.id]=r,onClick:r=>{r.preventDefault(),r.stopPropagation(),a(o.id)}},null)})]})))?l:{default:()=>[l]})]}):t(V,{btnStatus:!1,tips:"\u6682\u65E0\u7BA1\u7406\u8001\u5E08"},null)])}}});const Ue="_cellTeacher_bjfo6_1",Re="_img_bjfo6_1",Pe="_name_bjfo6_9",Ge="_checkboxValue_bjfo6_25",Ye="_subjectContainer_bjfo6_29",qe="_tagSubject_bjfo6_35";var g={cellTeacher:Ue,img:Re,name:Pe,class:"_class_bjfo6_16",checkboxValue:Ge,subjectContainer:Ye,tagSubject:qe};function z(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!O(i)}var We=T({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(i,{emit:m}){const e=I({teacherStatus:!1,isLoad:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{keyword:null,page:1,rows:20},check:i.selectItem||[],checkboxRefs:[]}),p=async()=>{try{if(e.isLoad)return;e.isLoad=!0;const a=await v.post("/api-school/student/page",{data:{...e.params,schoolId:L.user.data.school.id}});e.listState.loading=!1;const s=a.data||{};if(e.list.length>0&&s.current===1)return;const l=s.rows||[];l.forEach(o=>{o.subjectNames=o.subjectNames?o.subjectNames.split(","):[]}),e.list=e.list.concat(l),e.listState.finished=s.current>=s.pages,e.params.page=s.current+1,e.listState.dataShow=e.list.length>0,e.isLoad=!1}catch{e.listState.dataShow=!1,e.listState.finished=!0,e.isLoad=!1}},c=()=>{e.params.page=1,e.list=[],e.listState.dataShow=!0,e.listState.loading=!1,e.listState.finished=!1,p()},n=a=>{e.checkboxRefs[a].toggle();const s=[];e.list.forEach(l=>{e.check.includes(l.id)&&s.push({id:l.id,value:l.nickname,avatar:l.avatar})}),m("update:selectItem",s)};x(()=>i.selectItem,()=>{f()},{deep:!0});const f=()=>{const a=i.selectItem||[],s=[];a.forEach(l=>{s.push(l.id)}),e.check=s};return k(()=>{p(),f()}),()=>{let a;return t("div",{class:[!e.listState.dataShow&&"emptyRootContainer"],style:{"min-height":`calc(100vh - ${i.height}px - ${i.bottomHeight}px)`}},[t($,{position:"top",offsetTop:i.headerHeight,style:{width:"100%"}},{default:()=>[t(q,{placeholder:"\u5B66\u5458\u540D\u79F0/\u624B\u673A\u53F7",onSearch:s=>{e.params.keyword=s,c()}},null)]}),e.listState.dataShow?t(M,{finished:e.listState.finished,finishedText:" ",onLoad:p,style:{paddingTop:"12px"},immediateCheck:!1},{default:()=>[t(U,{class:[g.gridContainer,g.gridClass],modelValue:e.check,"onUpdate:modelValue":s=>e.check=s},z(a=e.list.map(s=>t(E,{inset:!0,style:{marginBottom:"12px"},onClick:()=>n(s.id)},{default:()=>[t(_,{center:!0,class:g.cellTeacher,valueClass:g.checkboxValue},{icon:()=>t(j,{class:g.img,src:s.avatar||w,fit:"cover"},null),title:()=>t("div",{class:g.content},[t("p",{class:[g.name,"van-ellipsis"]},[s.nickname]),t("p",{class:g.class},[s.subjectNames&&s.subjectNames.map(l=>t(Y,{type:"primary",class:g.tagSubject,color:"#FFE7DA",textColor:"#F67146"},z(l)?l:{default:()=>[l]}))])]),value:()=>t(R,{name:s.id,ref:l=>e.checkboxRefs[s.id]=l,onClick:l=>{l.preventDefault(),l.stopPropagation(),n(s.id)}},null)})]})))?a:{default:()=>[a]})]}):t(V,{btnStatus:!1,tips:"\u6682\u65E0\u5B66\u5458"},null)])}}});const ze="_cellTeacher_fnv0v_1",Je="_img_fnv0v_1",Ze="_name_fnv0v_9",Ke="_checkboxValue_fnv0v_25",Qe="_subjectContainer_fnv0v_29",Xe="_tagSubject_fnv0v_35";var S={cellTeacher:ze,img:Je,name:Ze,class:"_class_fnv0v_16",checkboxValue:Ke,subjectContainer:Qe,tagSubject:Xe};function J(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!O(i)}var et=T({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(i,{slots:m,attrs:e,emit:p}){const c=I({teacherStatus:!1,isLoad:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{keyword:null,subjectIdList:i.subjectIdList,page:1,rows:20},check:i.selectItem||[],checkboxRefs:[]}),n=async()=>{try{if(c.isLoad)return;c.isLoad=!0;const l=await v.post("/api-school/teacher/page",{data:{...c.params,schoolId:L.user.data.school.id,removeTeacherId:i.removeTeacherId,delFlag:!1}});c.listState.loading=!1;const o=l.data||{};if(c.list.length>0&&o.current===1)return;const r=o.rows||[];r.forEach(u=>{u.subjectNames=u.subjectName?u.subjectName.split(","):[]}),c.list=c.list.concat(r),c.listState.finished=o.current>=o.pages,c.params.page=o.current+1,c.listState.dataShow=c.list.length>0,c.isLoad=!1}catch{c.listState.dataShow=!1,c.listState.finished=!0,c.isLoad=!1}},f=()=>{c.params.page=1,c.list=[],c.listState.dataShow=!0,c.listState.loading=!1,c.listState.finished=!1,n()},a=l=>{c.checkboxRefs[l].toggle();const o=[];c.list.forEach(r=>{c.check.includes(r.id)&&o.push({id:r.id,value:r.nickname,avatar:r.avatar})}),p("update:selectItem",o)};x(()=>i.selectItem,()=>{s()},{deep:!0});const s=()=>{const l=i.selectItem||[],o=[];l.forEach(r=>{o.push(r.id)}),c.check=o};return k(()=>{n(),s()}),()=>{let l;return t("div",{class:[!c.listState.dataShow&&"emptyRootContainer"],style:{"min-height":`calc(100vh - ${i.height}px - ${i.bottomHeight}px)`}},[t($,{position:"top",offsetTop:i.headerHeight,style:{width:"100%"}},{default:()=>[t(q,{placeholder:"\u4F34\u5B66\u8001\u5E08\u59D3\u540D",onSearch:o=>{c.params.keyword=o,f()}},null)]}),c.listState.dataShow?t(M,{finished:c.listState.finished,finishedText:" ",style:{paddingTop:"12px"},onLoad:n,immediateCheck:!1},{default:()=>[t(U,{class:[S.gridContainer,S.gridClass],modelValue:c.check,"onUpdate:modelValue":o=>c.check=o},J(l=c.list.map(o=>t(E,{inset:!0,style:{marginBottom:"12px"},onClick:()=>a(o.id)},{default:()=>[t(_,{center:!0,class:S.cellTeacher,valueClass:S.checkboxValue},{icon:()=>t(j,{class:S.img,src:o.avatar||w,fit:"cover"},null),title:()=>t("div",{class:S.content},[t("p",{class:[S.name,"van-ellipsis"]},[o.nickname])]),value:()=>t(R,{name:o.id,ref:r=>c.checkboxRefs[o.id]=r,onClick:r=>{r.preventDefault(),r.stopPropagation(),a(o.id)}},null)}),t(_,{center:!0},{title:()=>t("div",{class:S.subjectContainer},[t("span",null,[y("\u58F0\u90E8\uFF1A")]),t("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap"}},[o.subjectNames&&o.subjectNames.map(r=>t(Y,{type:"primary",class:S.tagSubject,color:"#FFE7DA",textColor:"#F67146"},J(r)?r:{default:()=>[r]}))])])})]})))?l:{default:()=>[l]})]}):t(V,{btnStatus:!1,tips:"\u6682\u65E0\u4F34\u5B66\u8001\u5E08"},null)])}}}),tt=T({name:"select-send",props:{selectList:{type:Object,default:()=>({})},selectStatus:{type:Boolean,default:!1}},emits:["close","confirm","update:selectList"],setup(i,{emit:m}){const e=I({headerHeight:0,height:"auto",bottomHeight:0,tabValue:"class",selectClass:[],selectStudent:[],selectTeacher:[],selectManage:[]}),p=async()=>{const n={class:e.selectClass,student:e.selectStudent,teacher:e.selectTeacher,school:e.selectManage};m("close"),m("update:selectList",n),m("confirm",n)};x(()=>i.selectList,()=>{console.log("watch",i.selectList),c()},{deep:!0});const c=()=>{const n=i.selectList||{};e.selectClass=n.class||[],e.selectTeacher=n.teacher||[],e.selectManage=n.school||[],e.selectStudent=n.student||[]};return k(()=>{const{height:n}=X(document.querySelector(".van-tab"));e.height=e.height==="auto"?n:e.height+n,c(),console.log(e,"select")}),()=>t("div",{class:b.orchestraDetail,style:{background:"#f6f6f6",minHeight:"100vh"},id:"select-send-message"},[t(G,{onGetHeight:n=>{console.log(n,"height"),e.height=e.height==="auto"?n:e.height+n,e.headerHeight=n}},{default:()=>[t(K,{title:"\u53D1\u9001\u5BF9\u8C61"},null)]}),t(re,{sticky:!0,lineWidth:20,lineHeight:4,active:e.tabValue,"onUpdate:active":n=>e.tabValue=n,offsetTop:e.headerHeight},{default:()=>[t(F,{title:"\u73ED\u7EA7\u5217\u8868",name:"class"},{default:()=>[t(De,{height:e.height,headerHeight:e.headerHeight,bottomHeight:e.bottomHeight,selectItem:e.selectClass,"onUpdate:selectItem":n=>e.selectClass=n},null)]}),t(F,{title:"\u5B66\u5458\u5217\u8868",name:"student"},{default:()=>[t(We,{height:e.height,headerHeight:e.headerHeight,bottomHeight:e.bottomHeight,selectItem:e.selectStudent,"onUpdate:selectItem":n=>e.selectStudent=n},null)]}),t(F,{title:"\u4F34\u5B66\u8001\u5E08",name:"teacher"},{default:()=>[t(et,{height:e.height,headerHeight:e.headerHeight,bottomHeight:e.bottomHeight,selectItem:e.selectTeacher,"onUpdate:selectItem":n=>e.selectTeacher=n},null)]}),t(F,{title:"\u7BA1\u7406\u8001\u5E08",name:"manage"},{default:()=>[t(Me,{height:e.height,headerHeight:e.headerHeight,bottomHeight:e.bottomHeight,selectItem:e.selectManage,"onUpdate:selectItem":n=>e.selectManage=n},null)]})]}),t(G,{position:"bottom",onGetHeight:n=>{e.bottomHeight=n}},{default:()=>[t("div",{class:"btnGroup"},[t(A,{round:!0,block:!0,type:"primary",onClick:p},{default:()=>[y("\u786E\u8BA4")]})])]})])}}),at="./assets/icon_jiaofu.97430aa5.png",Ot=T({name:"create-message",setup(){const i=ee(),m=te(),e=I({id:m.query.id,type:"ADD",bucket:"i-m",sendStatus:!1,sendType:"IMMEDIATELY",textMessage:null,sendTime:null,sendTimeStatus:!1,maxDate:D(new Date).add(60,"day").toDate(),currentDate:[],currentTime:[D().format("HH"),D().format("mm")],attachments:[],receives:[],selectStatus:!1,selectList:{},delSelectItem:{},delStatus:!1,sureLoading:!1,updateLoading:!1,closeLoading:!1,actions:[{name:"\u5373\u65F6\u53D1\u9001",value:"IMMEDIATELY",selected:!0},{name:"\u5B9A\u65F6\u53D1\u9001",value:"SCHEDULED"}]}),p=async()=>{try{if(!e.sendType){H("\u8BF7\u9009\u62E9\u53D1\u9001\u65B9\u5F0F");return}if(!e.textMessage){H("\u8BF7\u8F93\u5165\u53D1\u9001\u5185\u5BB9");return}if(e.receives.length<=0){H("\u8BF7\u9009\u62E9\u53D1\u9001\u5BF9\u8C61");return}const a=[];e.attachments.forEach(o=>{a.push({imgUrl:o,imgMessage:o})});const s=[];e.receives.forEach(o=>{s.push({receiveType:o.receiveType,receiveId:o.receiveId})});const l={sendType:e.sendType,textMessage:e.textMessage,attachments:a,receives:s,sendTime:e.sendTime};console.log(l,"params"),e.id?e.updateLoading=!0:e.sureLoading=!0,e.id?(l.id=e.id,await v.post("/api-school/imMessageBatchSending/update",{hideLoading:!1,data:l})):await v.post("/api-school/imMessageBatchSending/save",{hideLoading:!1,data:l}),i.back(),e.sureLoading=!1,e.updateLoading=!1}catch{e.sureLoading=!1,e.updateLoading=!1}},c=async()=>{try{if(!e.id)return;const{data:a}=await v.get("/api-school/imMessageBatchSending/detail/"+e.id);e.sendType=a.sendType,e.textMessage=a.textMessage,e.sendTime=a.sendTime,e.type=a.sendStatus;const s=a.receives||[],l={class:[],teacher:[],student:[],school:[]};s.forEach(u=>{const d={receiveType:u.receiveType,receiveId:u.receiveId,receiveName:u.receiveName,avatar:u.avatar};e.receives.push(d);const N={id:u.receiveId,value:u.receiveName,avatar:u.avatar};u.receiveType==="CLASS"?l.class.push(N):u.receiveType==="STUDENT"?l.student.push(N):u.receiveType==="TEACHER"?l.teacher.push(N):u.receiveType==="SCHOOL"&&l.school.push(N)}),e.selectList=l;const o=a.attachments||[],r=[];o.forEach(u=>{r.push(u.imgUrl||u.imgMessage)}),e.attachments=r}catch(a){console.log(a,"e")}},n=ae(()=>e.type==="SEND"),f=async()=>{try{e.closeLoading=!0,await v.post("/api-school/imMessageBatchSending/remove",{requestType:"form",hideLoading:!1,data:{id:e.id}}),setTimeout(()=>{H("\u64A4\u9500\u6210\u529F")},100),setTimeout(()=>{i.back(),e.closeLoading=!1},1100)}catch{e.closeLoading=!1}};return k(()=>{c()}),()=>t("div",{class:b["create-message"]},[t(K,null,null),t(E,{inset:!0,class:b.cellGroup},{default:()=>[t(B,{inputAlign:"right",label:"\u53D1\u9001\u65B9\u5F0F",modelValue:oe[e.sendType],placeholder:"\u8BF7\u9009\u62E9\u53D1\u9001\u65B9\u5F0F",onClick:()=>{n.value||(e.sendStatus=!0)},readonly:!0,isLink:!n.value,class:b.inputForm},null),e.sendType==="SCHEDULED"&&t(B,{inputAlign:"right",label:"\u53D1\u9001\u65F6\u95F4",modelValue:e.sendTime,placeholder:"\u8BF7\u9009\u62E9\u53D1\u9001\u65F6\u95F4",onClick:()=>{n.value||(e.sendTimeStatus=!0)},readonly:!0,isLink:!0,class:b.inputForm},null),t(_,{title:"\u53D1\u9001\u5185\u5BB9"},{label:()=>t(B,{style:{padding:"0",marginTop:"12px"},placeholder:"\u8BF7\u8F93\u5165\u53D1\u9001\u5185\u5BB9",modelValue:e.textMessage,"onUpdate:modelValue":a=>e.textMessage=a,type:"textarea",rows:3,showWordLimit:!0,maxlength:400,readonly:n.value},null)}),t(_,{title:"\u4E0A\u4F20\u9644\u4EF6"},{label:()=>t(he,{modelValue:e.attachments,"onUpdate:modelValue":a=>e.attachments=a,maxCount:9,bucket:e.bucket,disabled:n.value},null)}),t(B,{label:"\u53D1\u9001\u5BF9\u8C61",readonly:!0,inputAlign:"right",class:b.sendObjPlaceholder,placeholder:n.value?"":"\u8BF7\u9009\u62E9\u53D1\u9001\u5BF9\u8C61",isLink:!n.value,border:!1,onClick:()=>{n.value||(e.selectStatus=!0)}},null),e.receives.map(a=>{let s=W;return a.receiveType==="CLASS"?s=at:a.receiveType==="STUDENT"?s=W:(a.receiveType==="TEACHER"||a.receiveType==="SCHOOL")&&(s=w),t(_,{class:b.receives,title:a.receiveName,center:!0,border:!1},{icon:()=>t(j,{class:b.img,src:a.avatar||s},null),extra:()=>!n.value&&t(se,{name:"clear",color:"#d7d7d7",size:20,onClick:()=>{e.delSelectItem=a,e.delStatus=!0}},null)})})]}),t(G,{position:"bottom"},{default:()=>[e.type==="ADD"&&t("div",{class:"btnGroup"},[t(A,{round:!0,block:!0,type:"primary",onClick:p,disabled:e.sureLoading},{default:()=>[y("\u786E\u8BA4\u53D1\u9001")]})]),e.type==="WAIT"&&t("div",{class:["btnGroup","btnMore"]},[t(A,{round:!0,type:"primary",onClick:p,disabled:e.updateLoading},{default:()=>[y("\u4FEE\u6539")]}),t(A,{round:!0,color:"#64A9FF",onClick:f,disabled:e.closeLoading},{default:()=>[y("\u64A4\u9500")]})])]}),t(de,{show:e.sendStatus,"onUpdate:show":a=>e.sendStatus=a,actions:e.actions,onSelect:a=>{e.actions.forEach(s=>{s.selected=!1}),a.selected=!0,e.sendType=a.value,e.sendStatus=!1}},null),t(Z,{show:e.sendTimeStatus,"onUpdate:show":a=>e.sendTimeStatus=a,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[t(ge,{title:"\u53D1\u9001\u65F6\u95F4",tabs:["\u9009\u62E9\u65E5\u671F","\u9009\u62E9\u65F6\u95F4"],onCancel:()=>e.sendTimeStatus=!1,onConfirm:a=>{const s=a[0].selectedValues.join("-"),l=a[1].selectedValues.join(":");e.sendTime=D(s+" "+l).format("YYYY-MM-DD HH:mm:ss"),e.sendTimeStatus=!1}},{default:()=>[t(fe,{minDate:new Date,maxDate:e.maxDate,modelValue:e.currentDate,"onUpdate:modelValue":a=>e.currentDate=a,formatter:le},null),t(me,{modelValue:e.currentTime,"onUpdate:modelValue":a=>e.currentTime=a,formatter:(a,s)=>(a==="hour"&&(s.text+="\u65F6"),a==="minute"&&(s.text+="\u5206"),s)},null)]})]}),t(ce,{modelValue:e.selectStatus,"onUpdate:modelValue":a=>e.selectStatus=a},{default:()=>[t(tt,{selectList:e.selectList,"onUpdate:selectList":a=>e.selectList=a,onClose:()=>e.selectStatus=!1,onConfirm:a=>{const s=a.class||[],l=a.student||[],o=a.teacher||[],r=a.school||[],u=[];s.forEach(d=>{u.push({receiveType:"CLASS",receiveId:d.id,receiveName:d.value,avatar:d.avatar})}),l.forEach(d=>{u.push({receiveType:"STUDENT",receiveId:d.id,receiveName:d.value,avatar:d.avatar})}),o.forEach(d=>{u.push({receiveType:"TEACHER",receiveId:d.id,receiveName:d.value,avatar:d.avatar})}),r.forEach(d=>{u.push({receiveType:"SCHOOL",receiveId:d.id,receiveName:d.value,avatar:d.avatar})}),e.receives=u}},null)]}),t(ue,{show:e.delStatus,"onUpdate:show":a=>e.delStatus=a,showCancelButton:!0,message:"\u60A8\u662F\u5426\u5220\u9664\u8BE5\u6570\u636E",onConfirm:()=>{const a=e.selectList;if(e.delSelectItem.receiveType==="CLASS"){const l=a.class||[],o=l.findIndex(r=>r.id===e.delSelectItem.receiveId);l.splice(o,1)}else if(e.delSelectItem.receiveType==="SCHOOL"){const l=a.school||[],o=l.findIndex(r=>r.id===e.delSelectItem.receiveId);l.splice(o,1)}else if(e.delSelectItem.receiveType==="TEACHER"){const l=a.teacher||[],o=l.findIndex(r=>r.id===e.delSelectItem.receiveId);l.splice(o,1)}else if(e.delSelectItem.receiveType==="STUDENT"){const l=a.student||[],o=l.findIndex(r=>r.id===e.delSelectItem.receiveId);l.splice(o,1)}e.selectList=a,console.log(e.selectList,"forms.selectList");const s=e.receives.findIndex(l=>l.receiveId===e.delSelectItem.receiveId);e.receives.splice(s,1)}},null)])}});export{Ot as default};
|