1 |
- import{s as L}from"./index.module-622ebf5e-1731319840132.js";import{S as z}from"./index-1c1bf5e5-1731319840132.js";import{C as S}from"./index-108fa044-1731319840132.js";import{P as A}from"./index-9710e333-1731319840132.js";import{d as B,e as P,$ as r,r as G,q as $,C as T,T as W,f as a,a0 as j,a1 as q,k as u,F as x,c as J,a as O,u as K,b as H,N as Q,g as p,y as g,x as R,j as F,aG as X,l as Z,m as _,V as E}from"./index-6198d9d3-1731319840132.js";import{g as ee}from"./api-7fc192d9-1731319840132.js";import{c as te}from"./api-de5ca66f-1731319840132.js";import{g as I,s as m}from"./index-db345329-1731319840132.js";import{s as U}from"./api-5a9c06c7-1731319840132.js";import{T as ae}from"./index-eedcb178-1731319840132.js";import{U as le}from"./index-50e5d83b-1731319840132.js";import{i as se,s as Y}from"./use-async-44e3cc0a-1731319840132.js";import{g as ne,c as re}from"./contants-59f01627-1731319840132.js";import{g as oe,b as ie}from"./api-e20c9545-1731319840132.js";const ue=B({name:"coai-guide",emits:["close"],setup(D,{emit:M}){const e=P({box:{height:"0px"},show:!1,steps:[{ele:"",eleRect:{},img:I("student1.png"),handStyle:{top:"0.91rem"},imgStyle:{top:r(-4),left:r(-64),width:r(518),height:r(256)},btnsStyle:{bottom:r(30),left:r(-74)},eleRectPadding:{left:7,top:7,width:14,height:14}},{ele:"",img:I("student2.png"),imgStyle:{top:r(-4),left:r(-261),width:r(515),height:r(227)},btnsStyle:{bottom:r(30),left:r(-120)},eleRectPadding:{left:7,top:7,width:14,height:14}}],step:0}),o=G(!1),n=G({});(async()=>{try{const l=localStorage.getItem("teacher-guideInfo");l?n.value=JSON.parse(l)||null:n.value={},n.value&&n.value.studentGuide?o.value=!1:o.value=!0}catch(l){console.log(l)}})();const y=()=>{var i,h,f,d;const l=document.getElementById("student-".concat(e.step));if(l){const c=l.getBoundingClientRect(),t=((i=e.steps[e.step].eleRectPadding)==null?void 0:i.left)||0,s=((h=e.steps[e.step].eleRectPadding)==null?void 0:h.top)||0,v=((f=e.steps[e.step].eleRectPadding)==null?void 0:f.width)||0,V=((d=e.steps[e.step].eleRectPadding)==null?void 0:d.height)||0;e.box={left:c.x-t+"px",top:c.y-s+"px",width:c.width+v+"px",height:c.height+V+"px"}}else b()},w=async l=>{try{if(l!=="studentList")return;n.value?n.value.studentGuide=!1:n.value={studentGuide:!1};try{U({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(n.value)})}catch(i){console.log(i)}e.step=0,y(),o.value=!0}catch(i){}};$(()=>{y(),window.addEventListener("resize",k),T.on("teacher-guideInfo",w)});const k=()=>{y()};W(()=>{window.removeEventListener("resize",k),T.off("teacher-guideInfo",w)});const b=()=>{if(e.step>=2){C();return}e.step=e.step+1,y()},C=async()=>{n.value?n.value.studentGuide=!0:n.value={studentGuide:!0};try{U({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(n.value)})}catch(l){console.log(l)}o.value=!1};return()=>a(x,null,[o.value?j(a("div",{"onUpdate:show":l=>o.value=l,class:["n-modal-mask","n-modal-mask-guide"]},[a("div",{class:m.content,onClick:()=>b()},[a("div",{class:m.backBtn,onClick:l=>{l.stopPropagation(),C()}},[u("跳过")]),a("div",{class:m.box,style:{...e.box},id:"modeType-".concat(e.step)},[e.steps.map((l,i)=>{var h,f,d,c;return a("div",{onClick:t=>t.stopPropagation(),class:m.item,style:l.type=="bottom"?{display:i===e.step?"":"none",left:"".concat((h=l.eleRect)==null?void 0:h.left,"px"),top:"-".concat((f=l.imgStyle)==null?void 0:f.height)}:{display:i===e.step?"":"none",left:"".concat((d=l.eleRect)==null?void 0:d.left,"px"),top:"".concat((c=e.box)==null?void 0:c.height)}},[a("img",{class:m.img,style:l.imgStyle,src:l.img},null),a("div",{class:m.btns,style:l.btnsStyle},[e.step+1==e.steps.length?a(x,null,[a("div",{class:[m.btn],onClick:()=>C()},[u("完成")])]):a("div",{class:m.btn,onClick:()=>b()},[u("下一步 ("),e.step+1,u("/"),e.steps.length,u(")")])])])})])])]),[[q,o.value,"show"]]):null])}}),Fe=B({name:"student-studentList",setup(D,{emit:M}){J();const e=P({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:[]});e.gradeNumList=ne();const o=O(),n=K(),N=G(!1),y=H(),w=()=>{e.pagination.page=1,l(),Y({current:e.searchForm,saveKey:o.path})},k=async()=>{try{const t=await te({page:1,rows:999});e.classList=t.data.rows.map(s=>({label:s.name,value:s.id}))}catch(t){console.log(t)}},b=t=>{const s=document.createElement("input");s.value=t,document.body.appendChild(s),s.select(),s.setSelectionRange(0,s.value.length),document.execCommand("Copy"),document.body.removeChild(s),y.success("复制成功")},C=()=>{e.searchForm={keyword:"",gender:"",classGroupId:"",membership:"",currentClass:"",currentGradeNum:"",gradeYear:"",gradeLevel:""},e.popSelectYearList.length>1&&(e.searchForm.gradeYear=e.popSelectYearList[1].id),w(),Y({current:e.searchForm,saveKey:o.path})};se({current:e.searchForm,callBack:t=>{e.searchForm=t}});const l=async()=>{try{const t=await ee({...e.searchForm,...e.pagination});e.tableList=t.data.rows,e.pagination.pageTotal=t.data.total,e.tableList.length>0&&setTimeout(()=>{N.value=!0},500)}catch(t){console.log(t)}console.log("getList")},i=async()=>{try{const{data:t}=await oe(),s=t||[];s.forEach(v=>{v.name=v.name+"学年"}),e.popSelectYearList=s||[],s.length>1&&!e.searchForm.gradeYear&&(e.searchForm.gradeYear=s[1].id)}catch(t){}},h=async()=>{try{const{data:t}=await ie(),s=t||[];s.forEach(v=>{v.name=v.name+"级"}),s.unshift({id:"",name:"全部学级"}),e.popSelectLevelList=s||[],s.length>0&&!e.searchForm.gradeLevel&&(e.searchForm.gradeLevel=s[0].id)}catch(t){}};$(async()=>{e.loading=!0,await i(),await h(),await l(),await k(),e.loading=!1});const f=()=>[{title:"学生姓名",key:"nickname",render:t=>a(E,{showArrow:!1,placement:"top-start"},{trigger:()=>a("div",{style:{userSelect:"all",cursor:"pointer"},onClick:()=>b(t.nickname)},[t.nickname]),default:"点击复制"})},{title:"手机号",key:"phone",render:t=>a(E,{showArrow:!1,placement:"top-start"},{trigger:()=>a("div",{style:{userSelect:"all",cursor:"pointer"},onClick:()=>b(t.phone)},[t.phone]),default:"点击复制"})},{title:"性别",key:"gender",render(t){return a(x,null,[t.gender+""!="null"?t.gender=="0"?"女":"男":"--"])}},{title:"年级班级",key:"classGroupName"},{title:"学生类型",key:"vipMember",render(t){return a(x,null,[t.vipMember?"会员":"普通"])}},{title:"操作",key:"id",width:300,render(t,s){return a(R,null,{default:()=>[s==0?a(F,g({id:"student-1"},{text:!0,type:"primary",onClick:()=>d(t)}),{default:()=>[u("详情")]}):a(F,{text:!0,type:"primary",onClick:()=>d(t)},{default:()=>[u("详情")]}),a(F,{text:!0,type:"primary",onClick:()=>c(t),disabled:t.historyClassStudent},{default:()=>[u("修改")]})]})}}],d=t=>{n.push({path:"/studentDetail",query:{...o.query,studentId:t.id,studentName:t.nickname}})},c=t=>{e.editStatus=!0,e.activeRow=t};return()=>a("div",{class:L.listWrap},[a("div",{class:L.searchList},[a(Q,{"label-placement":"left",inline:!0},{default:()=>[a(p,null,{default:()=>[a(z,g({placeholder:"请输入学生姓名"},{class:L.searchInput,style:{width:"160px"},searchWord:e.searchForm.keyword,onChangeValue:t=>e.searchForm.keyword=t}),null)]}),a(p,null,{default:()=>[a(S,g({options:[{label:"全部性别",value:""},{label:"男",value:1},{label:"女",value:0}],placeholder:"性别",clearable:!0,inline:!0},{value:e.searchForm.gender,"onUpdate:value":t=>e.searchForm.gender=t}),null)]}),a(p,null,{default:()=>[a(S,g({options:e.popSelectYearList,placeholder:"选择学年",clearable:!1,inline:!0,labelField:"name",valueField:"id"},{value:e.searchForm.gradeYear,"onUpdate:value":t=>e.searchForm.gradeYear=t}),null)]}),a(p,null,{default:()=>[a(S,g({options:e.popSelectLevelList,placeholder:"选择学级",clearable:!0,inline:!0,labelField:"name",valueField:"id"},{value:e.searchForm.gradeLevel,"onUpdate:value":t=>e.searchForm.gradeLevel=t}),null)]}),a(p,null,{default:()=>[a(S,g({options:e.gradeNumList,placeholder:"选择年级",clearable:!0,inline:!0},{value:e.searchForm.currentGradeNum,"onUpdate:value":t=>e.searchForm.currentGradeNum=t}),null)]}),a(p,null,{default:()=>[a(S,g({options:re,placeholder:"选择班级",clearable:!0,inline:!0},{value:e.searchForm.currentClass,"onUpdate:value":t=>e.searchForm.currentClass=t}),null)]}),a(p,null,{default:()=>[a(S,g({options:[{label:"全部类型",value:""},{label:"会员",value:!0},{label:"普通",value:!1}],placeholder:"学生类型",clearable:!0,inline:!0},{value:e.searchForm.membership,"onUpdate:value":t=>e.searchForm.membership=t}),null)]}),a(p,null,{default:()=>[a(R,{justify:"end"},{default:()=>[a(F,{type:"primary",class:"searchBtn",onClick:w},{default:()=>[u("搜索")]}),a(F,{type:"primary",ghost:!0,class:"resetBtn",onClick:C},{default:()=>[u("重置")]})]})]})]})]),a("div",{class:L.tableWrap},[a(X,{class:L.classTable,loading:e.loading,columns:f(),data:e.tableList},{empty:()=>a(ae,null,null)}),a(A,{page:e.pagination.page,"onUpdate:page":t=>e.pagination.page=t,pageSize:e.pagination.rows,"onUpdate:pageSize":t=>e.pagination.rows=t,pageTotal:e.pagination.pageTotal,"onUpdate:pageTotal":t=>e.pagination.pageTotal=t,onList:l,sync:!0},null)]),a(Z,{maskClosable:_,show:e.editStatus,"onUpdate:show":t=>e.editStatus=t,class:["modalTitle background",L.updateStudent],preset:"card",title:"修改信息"},{default:()=>[a(le,{onClose:()=>e.editStatus=!1,onConfirm:()=>l(),row:e.activeRow},null)]}),N.value?a(ue,null,null):null])}});export{Fe as default};
|