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