index-84e294d0-1708220053196.js 12 KB

1
  1. import{d as G,e as D,b as M,c as z,r as R,f as e,v as B,k as i,X as d,p as W,H as U,O as q,Y as j,Z as J,F as T,a as K,u as H,N as Q,g as v,x as h,w as Y,j as C,$ as X,l as Z,R as A}from"./index-9bb5784d-1708220053196.js";import{s as r}from"./index.module-cda1a757-1708220053196.js";import{S as _}from"./index-a5a930f9-1708220053196.js";import{C as k}from"./index-fed94f46-1708220053196.js";import{P as ee}from"./index-4b731141-1708220053196.js";import{a as te}from"./add-efe8238e-1708220053196.js";import{s as ae,g as se}from"./api-ff130d5b-1708220053196.js";import{c as le}from"./api-abf09dee-1708220053196.js";import{s as ne,a as oe,T as re,b as ue,h as ie}from"./html2canvas.esm-a37c8fee-1708220053196.js";import{v as V}from"./urlUtils-080cac35-1708220053196.js";import{g as P,s as f,a as de,b as $}from"./api-c4d392f8-1708220053196.js";import{T as ce}from"./index-0ad8ff6b-1708220053196.js";import{U as pe}from"./index-c8cc3870-1708220053196.js";import{i as ge,s as O}from"./use-async-71e6680e-1708220053196.js";import{g as me,c as he}from"./contants-fc5baefb-1708220053196.js";import{g as fe,b as ve}from"./api-717ab2cd-1708220053196.js";const ye=""+new URL("studentTitle-8db8be71.png",import.meta.url).href,we=""+new URL("strudentCore-ce06266f.png",import.meta.url).href,be=G({props:{activeRow:{type:Object,default:()=>({id:""})},gradeNumList:{type:Array,default:()=>[]},classArray:{type:Array,default:()=>[]}},name:"resetStudent",emits:["close","getList"],setup(I,{emit:N}){D({uploading:!1}),M();const s=z();R();const t=R(V()+"/classroom-app/#/student-register?sId=".concat(I.activeRow.id));I.activeRow.registerType!="BUG_GOODS"&&(t.value=V()+"/classroom-app/#/register-member?sId=".concat(I.activeRow.id));const o=D({saveLoading:!1,image:null,shareLoading:!1}),x=()=>{if(!o.saveLoading)if(o.saveLoading=!0,o.image)c();else{const p=document.getElementById("preview-container");ie(p,{allowTaint:!0,useCORS:!0,backgroundColor:null}).then(async y=>{const w=y.toDataURL("image/png");o.image=w,c()}).catch(()=>{o.saveLoading=!1})}},c=async()=>{setTimeout(()=>{o.saveLoading=!1},100);const p=document.createElement("a");p.setAttribute("download","报名图片.png"),p.href=o.image,p.click()};return()=>e("div",{class:[r.addStudentWrap]},[e("div",{onClick:()=>{console.log("点击"),N("close")}},[e(B,{src:ne,previewDisabled:!0,class:r.studentCLose},null)]),e(B,{previewDisabled:!0,class:r.stunentStart,src:oe},null),e(B,{class:r.addTitle,previewDisabled:!0,src:ye},null),e("div",{class:r.addStudentInfo,id:"preview-container"},[e(B,{class:r.studentInfoBg,previewDisabled:!0,src:we},null),e("div",{class:r.studentCore},[e("img",{alt:"img",crossorigin:"anonymous",class:r.schoolLogo,src:s.getUserInfo.schoolInfos[0].logo+"?some=".concat(new Date().getTime())},null),e("div",{class:r.studentCoreInfo},[e("h2",null,[s.getUserInfo.schoolInfos[0].name]),e("p",{class:r.studentCoreInfoSubtitle},[i("乐器Ai学练工具"),e("span",null,[i("购买通道")])]),e("div",{class:r.codewrap},[e(re,{margin:0,text:t.value,size:119},null)]),e("div",{class:r.codewrapSubmit},[e(B,{previewDisabled:!0,src:ue},null),i("请使用微信扫码")])])])]),e("div",{class:r.studentBottom},[e("p",null,[i("请将二维码图片发送给学生家长,扫码完成报名")]),e("div",{class:r.downBtn,onClick:x},[i("下载图片")])])])}}),Se=G({name:"coai-guide",emits:["close"],setup(I,{emit:N}){const s=D({box:{height:"0px"},show:!1,steps:[{ele:"",eleRect:{},img:P("student1.png"),handStyle:{top:"0.91rem"},imgStyle:{top:d(-4),left:d(-64),width:d(518),height:d(256)},btnsStyle:{bottom:d(30),left:d(-74)},eleRectPadding:{left:7,top:7,width:14,height:14}},{ele:"",img:P("student2.png"),imgStyle:{top:d(-4),left:d(-261),width:d(515),height:d(227)},btnsStyle:{bottom:d(30),left:d(-120)},eleRectPadding:{left:7,top:7,width:14,height:14}}],step:0}),t=R(!1),o=R({});(async()=>{var n;try{const u=await de({guideTag:"teacher-guideInfo"});u.data?o.value=JSON.parse((n=u.data)==null?void 0:n.guideValue)||null:o.value={},o.value&&o.value.studentGuide?t.value=!1:t.value=!0}catch(u){console.log(u)}})();const c=()=>{var u,b,S,L;const n=document.getElementById("student-".concat(s.step));if(n){const g=n.getBoundingClientRect(),E=((u=s.steps[s.step].eleRectPadding)==null?void 0:u.left)||0,a=((b=s.steps[s.step].eleRectPadding)==null?void 0:b.top)||0,l=((S=s.steps[s.step].eleRectPadding)==null?void 0:S.width)||0,m=((L=s.steps[s.step].eleRectPadding)==null?void 0:L.height)||0;s.box={left:g.x-E+"px",top:g.y-a+"px",width:g.width+l+"px",height:g.height+m+"px"}}else w()},p=async n=>{try{if(n!=="studentList")return;o.value?o.value.studentGuide=!1:o.value={studentGuide:!1};try{await $({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(o.value)})}catch(u){console.log(u)}s.step=0,c(),t.value=!0}catch(u){}};W(()=>{c(),window.addEventListener("resize",y),U.on("teacher-guideInfo",n=>p(n))});const y=()=>{c()};q(()=>{window.removeEventListener("resize",y),U.off("teacher-guideInfo",p)});const w=()=>{if(s.step>=2){F();return}s.step=s.step+1,c()},F=async()=>{o.value?o.value.studentGuide=!0:o.value={studentGuide:!0};try{const n=await $({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(o.value)})}catch(n){console.log(n)}t.value=!1};return()=>e(T,null,[t.value?j(e("div",{"onUpdate:show":n=>t.value=n,class:["n-modal-mask","n-modal-mask-guide"]},[e("div",{class:f.content,onClick:()=>w()},[e("div",{class:f.backBtn,onClick:n=>{n.stopPropagation(),F()}},[i("跳过")]),e("div",{class:f.box,style:{...s.box},id:"modeType-".concat(s.step)},[s.steps.map((n,u)=>{var b,S,L,g;return e("div",{onClick:E=>E.stopPropagation(),class:f.item,style:n.type=="bottom"?{display:u===s.step?"":"none",left:"".concat((b=n.eleRect)==null?void 0:b.left,"px"),top:"-".concat((S=n.imgStyle)==null?void 0:S.height)}:{display:u===s.step?"":"none",left:"".concat((L=n.eleRect)==null?void 0:L.left,"px"),top:"".concat((g=s.box)==null?void 0:g.height)}},[e("img",{class:f.img,style:n.imgStyle,src:n.img},null),e("div",{class:f.btns,style:n.btnsStyle},[s.step+1==s.steps.length?e(T,null,[e("div",{class:[f.endBtn],onClick:()=>F()},[i("完成")]),e("div",{class:f.nextBtn,onClick:()=>{s.step=0,c()}},[i("再看一遍")])]):e("div",{class:f.btn,onClick:()=>w()},[i("下一步 ("),s.step+1,i("/"),s.steps.length,i(")")])])])})])])]),[[J,t.value,"show"]]):null])}}),Ve=G({name:"student-studentList",setup(I,{emit:N}){const s=z(),t=D({searchForm:{keyword:"",gender:"",classGroupId:"",membership:"",currentClass:"",currentGradeNum:"",gradeYear:"",gradeLevel:""},gradeNumList:[],searchWord:"",orchestraType:null,courseTypeCode:null,subjectId:null,classId:null,studentType:null,loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],classList:[],addStudentVisible:!1,editStatus:!1,activeRow:{},popSelectYearList:[],popSelectLevelList:[]});t.gradeNumList=me();const o=K(),x=H(),c=R(!1),p=M(),y=()=>{t.pagination.page=1,u(),O({current:t.searchForm,saveKey:o.path})},w=async()=>{try{const a=await le({page:1,rows:999});t.classList=a.data.rows.map(l=>({label:l.name,value:l.id}))}catch(a){console.log(a)}},F=a=>{const l=document.createElement("input");l.value=a,document.body.appendChild(l),l.select(),l.setSelectionRange(0,l.value.length),document.execCommand("Copy"),document.body.removeChild(l),p.success("复制成功")},n=()=>{t.searchForm={keyword:"",gender:"",classGroupId:"",membership:"",currentClass:"",currentGradeNum:"",gradeYear:"",gradeLevel:""},t.popSelectYearList.length>0&&(t.searchForm.gradeYear=t.popSelectYearList[1].id),y(),O({current:t.searchForm,saveKey:o.path})};ge({current:t.searchForm,callBack:a=>{t.searchForm=a}});const u=async()=>{try{const a=await se({...t.searchForm,...t.pagination});t.tableList=a.data.rows,t.pagination.pageTotal=a.data.total,t.tableList.length>0&&setTimeout(()=>{c.value=!0},500)}catch(a){console.log(a)}console.log("getList")},b=async()=>{try{const{data:a}=await fe(),l=a||[];l.forEach(m=>{m.name=m.name+"学年"}),l.unshift({id:"",name:"全部学年"}),t.popSelectYearList=l||[],l.length>0&&!t.searchForm.gradeYear&&(t.searchForm.gradeYear=l[1].id)}catch(a){}},S=async()=>{try{const{data:a}=await ve(),l=a||[];l.forEach(m=>{m.name=m.name+"级"}),l.unshift({id:"",name:"全部学级"}),t.popSelectLevelList=l||[],l.length>0&&!t.searchForm.gradeLevel&&(t.searchForm.gradeLevel=l[0].id)}catch(a){}};W(async()=>{t.loading=!0,await b(),await S(),await u(),await w(),t.loading=!1});const L=()=>[{title:"学生姓名",key:"nickname",render:a=>e(A,{showArrow:!1,placement:"top-start"},{trigger:()=>e("div",{style:{userSelect:"all",cursor:"pointer"},onClick:()=>F(a.nickname)},[a.nickname]),default:"点击复制"})},{title:"手机号",key:"phone",render:a=>e(A,{showArrow:!1,placement:"top-start"},{trigger:()=>e("div",{style:{userSelect:"all",cursor:"pointer"},onClick:()=>F(a.phone)},[a.phone]),default:"点击复制"})},{title:"性别",key:"gender",render(a){return e(T,null,[a.gender+""!="null"?a.gender=="0"?"女":"男":"--"])}},{title:"年级班级",key:"classGroupName"},{title:"学生类型",key:"vipMember",render(a){return e(T,null,[a.vipMember?"会员":"普通"])}},{title:"操作",key:"id",width:300,render(a,l){return e(Y,null,{default:()=>[l==0?e(C,h({id:"student-1"},{text:!0,type:"primary",onClick:()=>g(a)}),{default:()=>[i("详情")]}):e(C,{text:!0,type:"primary",onClick:()=>g(a)},{default:()=>[i("详情")]}),e(C,{text:!0,type:"primary",onClick:()=>E(a)},{default:()=>[i("修改")]})]})}}],g=a=>{x.push({path:"/studentDetail",query:{...o.query,studentId:a.id,studentName:a.nickname}})},E=a=>{t.editStatus=!0,t.activeRow=a};return()=>e("div",{class:r.listWrap},[e("div",{class:r.searchList},[e(Q,{"label-placement":"left",inline:!0},{default:()=>[e(v,null,{default:()=>[e(_,h({placeholder:"请输入学生姓名"},{class:r.searchInput,style:{width:"160px"},searchWord:t.searchForm.keyword,onChangeValue:a=>t.searchForm.keyword=a}),null)]}),e(v,null,{default:()=>[e(k,h({options:[{label:"全部性别",value:""},{label:"男",value:1},{label:"女",value:0}],placeholder:"性别",clearable:!0,inline:!0},{value:t.searchForm.gender,"onUpdate:value":a=>t.searchForm.gender=a}),null)]}),e(v,null,{default:()=>[e(k,h({options:t.popSelectYearList,placeholder:"选择学年",clearable:!0,inline:!0,labelField:"name",valueField:"id"},{value:t.searchForm.gradeYear,"onUpdate:value":a=>t.searchForm.gradeYear=a}),null)]}),e(v,null,{default:()=>[e(k,h({options:t.popSelectLevelList,placeholder:"选择学级",clearable:!0,inline:!0,labelField:"name",valueField:"id"},{value:t.searchForm.gradeLevel,"onUpdate:value":a=>t.searchForm.gradeLevel=a}),null)]}),e(v,null,{default:()=>[e(k,h({options:t.gradeNumList,placeholder:"选择年级",clearable:!0,inline:!0},{value:t.searchForm.currentGradeNum,"onUpdate:value":a=>t.searchForm.currentGradeNum=a}),null)]}),e(v,null,{default:()=>[e(k,h({options:he,placeholder:"选择班级",clearable:!0,inline:!0},{value:t.searchForm.currentClass,"onUpdate:value":a=>t.searchForm.currentClass=a}),null)]}),e(v,null,{default:()=>[e(k,h({options:[{label:"全部类型",value:""},{label:"会员",value:!0},{label:"普通",value:!1}],placeholder:"学生类型",clearable:!0,inline:!0},{value:t.searchForm.membership,"onUpdate:value":a=>t.searchForm.membership=a}),null)]}),e(v,null,{default:()=>[e(Y,{justify:"end"},{default:()=>[e(C,{type:"primary",class:"searchBtn",onClick:y},{default:()=>[i("搜索")]}),e(C,{type:"primary",ghost:!0,class:"resetBtn",onClick:n},{default:()=>[i("重置")]})]})]})]})]),e(C,h({id:"student-0"},{onClick:async()=>{try{const{schoolInfos:a}=s.getUserInfo,l=a.length>0?a[0].id:null;if(l){const{data:m}=await ae({id:l});t.activeRow=m,t.addStudentVisible=!0}}catch(a){}},class:r.addBtn,type:"primary"}),{default:()=>[i("邀请学生")],icon:()=>e(T,null,[e(B,{class:r.addBtnIcon,previewDisabled:!0,src:te},null)])}),e("div",{class:r.tableWrap},[e(X,{class:r.classTable,loading:t.loading,columns:L(),data:t.tableList},{empty:()=>e(ce,null,null)}),e(ee,{page:t.pagination.page,"onUpdate:page":a=>t.pagination.page=a,pageSize:t.pagination.rows,"onUpdate:pageSize":a=>t.pagination.rows=a,pageTotal:t.pagination.pageTotal,"onUpdate:pageTotal":a=>t.pagination.pageTotal=a,onList:u,sync:!0},null)]),t.addStudentVisible?j(e("div",{"onUpdate:show":a=>t.addStudentVisible=a,class:"n-modal-mask"},[e(be,{activeRow:t.activeRow,onClose:()=>{t.addStudentVisible=!1}},null)]),[[J,t.addStudentVisible,"show"]]):null,e(Z,{show:t.editStatus,"onUpdate:show":a=>t.editStatus=a,class:["modalTitle background",r.updateStudent],preset:"card",title:"修改信息"},{default:()=>[e(pe,{onClose:()=>t.editStatus=!1,onConfirm:()=>u(),row:t.activeRow},null)]}),c.value?e(Se,null,null):null])}});export{Ve as default};