1 |
- import{O as Q}from"./index.be2c3766.js";import{e as X}from"./index.38b203e1.js";import{D as ee,d as C,r as I,Z as x,$ as k,c as t,q as y,ak as $,P as Z,al as M,m as v,g as L,an as te,aj as K,B as A,ag as ae,ah as se,ai as E,y as le,a5 as ce,a_ as oe,o as D}from"./index.1c621181.js";import{s as b}from"./index.module.a0fba9ef.js";import{O as G}from"./index.b491c24a.js";import{i as w}from"./icon_teacher.df08d662.js";import{S as U}from"./index.d5b73933.js";import{L as R}from"./index.d5ee0b18.js";import{C as B}from"./index.9813a8ae.js";import{C as j}from"./index.2db9d877.js";import{C as _}from"./index.fd5ae97b.js";import{I as N}from"./index.4c221cbe.js";import{T as Y}from"./index.4e64eb97.js";import{C as F}from"./index.3e68170a.js";import{G as ie,a as P}from"./index.5a8ac45d.js";import{P as ne}from"./index.53518914.js";import{O as q}from"./index.944c4ba2.js";import{T as re,a as V}from"./index.88a00aa9.js";import{i as W}from"./icon_student.660125da.js";import{O as de}from"./index.120b6f0d.js";import{O as ue}from"./index.ff934114.js";import{O as he}from"./index.d74d4bd4.js";import{a as pe}from"./Picker.9bc4331c.js";import{T as me}from"./index.c4f0d694.js";import{F as O}from"./index.c7a20c76.js";import{D as fe}from"./index.d270485b.js";import"./index.339fc024.js";import"./use-tab-status.40058c51.js";import"./Checker.6bb59ec3.js";import"./index.78a302c3.js";import"./index.7c36c16c.js";import"./index.6999cc47.js";import"./index.de594f37.js";import"./ImagePreview.410fc85b.js";import"./function-call.db8bb852.js";import"./utils.3d9f83cd.js";const ge=ee(pe),Se="_searchBand_1dppi_1",ve="_bandName_1dppi_7",be="_gridContainer_1dppi_12",ye="_title_1dppi_15",_e="_red_1dppi_26",Te="_name_1dppi_29",Ce="_gridClass_1dppi_34",Ie="_img_1dppi_34",ke="_teacherName_1dppi_41",Le="_classCheckbox_1dppi_58",xe="_orchestraName_1dppi_62",we="_className_1dppi_72",je="_line_1dppi_79",Ne="_classCellGroup_1dppi_101";var h={searchBand:Se,bandName:ve,gridContainer:be,title:ye,red:_e,name:Te,gridClass:Ce,img:Ie,teacherName:ke,classCheckbox:Le,orchestraName:xe,className:we,line:je,classCellGroup:Ne};function He(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!M(i)}var Ee=C({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(U,{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(R,{finished:e.listState.finished,finishedText:" ",class:[h.liveList],onLoad:c,immediateCheck:!1},{default:()=>[t(B,{class:[h.gridContainer,h.gridClass],modelValue:e.check,"onUpdate:modelValue":s=>e.check=s},He(a=e.list.map(s=>t(j,{class:h.classCellGroup,onClick:()=>n(s.id),border:!1},{default:()=>[t(_,{center:!0,titleStyle:{flex:"0 auto"},valueClass:h.classCheckbox},{icon:()=>t(N,{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(F,{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($,{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 De="_cellTeacher_bjfo6_1",Ve="_img_bjfo6_1",Oe="_name_bjfo6_9",Ae="_checkboxValue_bjfo6_25",$e="_subjectContainer_bjfo6_29",Me="_tagSubject_bjfo6_35";var T={cellTeacher:De,img:Ve,name:Oe,class:"_class_bjfo6_16",checkboxValue:Ae,subjectContainer:$e,tagSubject:Me};function Ue(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!M(i)}var Re=C({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(d=>{d.subjectNames=d.subjectName?d.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(U,{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(R,{finished:c.listState.finished,finishedText:" ",onLoad:n,style:{paddingTop:"12px"},immediateCheck:!1},{default:()=>[t(B,{class:[T.gridContainer,T.gridClass],modelValue:c.check,"onUpdate:modelValue":o=>c.check=o},Ue(l=c.list.map(o=>t(j,{inset:!0,style:{marginBottom:"12px"},onClick:()=>a(o.id)},{default:()=>[t(_,{center:!0,class:T.cellTeacher,valueClass:T.checkboxValue},{icon:()=>t(N,{class:T.img,src:o.avatar||w,fit:"cover"},null),title:()=>t("div",{class:T.content},[t("p",{class:[T.name,"van-ellipsis"]},[o.nickname])]),value:()=>t(F,{name:o.id,ref:r=>c.checkboxRefs[o.id]=r,onClick:r=>{r.preventDefault(),r.stopPropagation(),a(o.id)}},null)})]})))?l:{default:()=>[l]})]}):t($,{btnStatus:!1,tips:"\u6682\u65E0\u7BA1\u7406\u8001\u5E08"},null)])}}});const Be="_cellTeacher_bjfo6_1",Fe="_img_bjfo6_1",Pe="_name_bjfo6_9",Ge="_checkboxValue_bjfo6_25",Ye="_subjectContainer_bjfo6_29",qe="_tagSubject_bjfo6_35";var g={cellTeacher:Be,img:Fe,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]"&&!M(i)}var We=C({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(U,{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(R,{finished:e.listState.finished,finishedText:" ",onLoad:p,style:{paddingTop:"12px"},immediateCheck:!1},{default:()=>[t(B,{class:[g.gridContainer,g.gridClass],modelValue:e.check,"onUpdate:modelValue":s=>e.check=s},z(a=e.list.map(s=>t(j,{inset:!0,style:{marginBottom:"12px"},onClick:()=>n(s.id)},{default:()=>[t(_,{center:!0,class:g.cellTeacher,valueClass:g.checkboxValue},{icon:()=>t(N,{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(F,{name:s.id,ref:l=>e.checkboxRefs[s.id]=l,onClick:l=>{l.preventDefault(),l.stopPropagation(),n(s.id)}},null)})]})))?a:{default:()=>[a]})]}):t($,{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]"&&!M(i)}var et=C({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(d=>{d.subjectNames=d.subjectName?d.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(U,{position:"top",offsetTop:i.headerHeight,style:{width:"100%"}},{default:()=>[t(q,{placeholder:"\u4F34\u5B66\u6307\u5BFC\u59D3\u540D",onSearch:o=>{c.params.keyword=o,f()}},null)]}),c.listState.dataShow?t(R,{finished:c.listState.finished,finishedText:" ",style:{paddingTop:"12px"},onLoad:n,immediateCheck:!1},{default:()=>[t(B,{class:[S.gridContainer,S.gridClass],modelValue:c.check,"onUpdate:modelValue":o=>c.check=o},J(l=c.list.map(o=>t(j,{inset:!0,style:{marginBottom:"12px"},onClick:()=>a(o.id)},{default:()=>[t(_,{center:!0,class:S.cellTeacher,valueClass:S.checkboxValue},{icon:()=>t(N,{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(F,{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($,{btnStatus:!1,tips:"\u6682\u65E0\u4F34\u5B66\u6307\u5BFC"},null)])}}}),tt=C({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}=te(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(V,{title:"\u73ED\u7EA7\u5217\u8868",name:"class"},{default:()=>[t(Ee,{height:e.height,headerHeight:e.headerHeight,bottomHeight:e.bottomHeight,selectItem:e.selectClass,"onUpdate:selectItem":n=>e.selectClass=n},null)]}),t(V,{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(V,{title:"\u4F34\u5B66\u6307\u5BFC",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(V,{title:"\u7BA1\u7406\u8001\u5E08",name:"manage"},{default:()=>[t(Re,{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",Ut=C({name:"create-message",setup(){const i=ae(),m=se(),e=I({id:m.query.id,type:"ADD",bucket:"i-m",sendStatus:!1,sendType:"IMMEDIATELY",textMessage:null,sendTime:null,sendTimeStatus:!1,maxDate:E(new Date).add(60,"day").toDate(),currentDate:[],currentTime:[E().format("HH"),E().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){D("\u8BF7\u9009\u62E9\u53D1\u9001\u65B9\u5F0F");return}if(!e.textMessage){D("\u8BF7\u8F93\u5165\u53D1\u9001\u5185\u5BB9");return}if(e.receives.length<=0){D("\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(d=>{const u={receiveType:d.receiveType,receiveId:d.receiveId,receiveName:d.receiveName,avatar:d.avatar};e.receives.push(u);const H={id:d.receiveId,value:d.receiveName,avatar:d.avatar};d.receiveType==="CLASS"?l.class.push(H):d.receiveType==="STUDENT"?l.student.push(H):d.receiveType==="TEACHER"?l.teacher.push(H):d.receiveType==="SCHOOL"&&l.school.push(H)}),e.selectList=l;const o=a.attachments||[],r=[];o.forEach(d=>{r.push(d.imgUrl||d.imgMessage)}),e.attachments=r}catch(a){console.log(a,"e")}},n=le(()=>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(()=>{D("\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(j,{inset:!0,class:b.cellGroup},{default:()=>[t(O,{inputAlign:"right",label:"\u53D1\u9001\u65B9\u5F0F",modelValue:X[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(O,{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(O,{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(O,{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(N,{class:b.img,src:a.avatar||s},null),extra:()=>!n.value&&t(ce,{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(ue,{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=E(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:oe},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(Q,{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||[],d=[];s.forEach(u=>{d.push({receiveType:"CLASS",receiveId:u.id,receiveName:u.value,avatar:u.avatar})}),l.forEach(u=>{d.push({receiveType:"STUDENT",receiveId:u.id,receiveName:u.value,avatar:u.avatar})}),o.forEach(u=>{d.push({receiveType:"TEACHER",receiveId:u.id,receiveName:u.value,avatar:u.avatar})}),r.forEach(u=>{d.push({receiveType:"SCHOOL",receiveId:u.id,receiveName:u.value,avatar:u.avatar})}),e.receives=d}},null)]}),t(de,{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{Ut as default};
|