From ebb95bbfa4d312ba992ee3a73164778869562743 Mon Sep 17 00:00:00 2001 From: Chenx221 Date: Fri, 16 Jun 2023 15:23:36 +0800 Subject: [PATCH] TeacherQuery Signed-off-by: Chenx221 --- .../controller/OutputController.class | Bin 8639 -> 9706 bytes .../controller/TeacherController.class | Bin 4311 -> 4935 bytes .../cyou/chenx221/helper/CsvHelper.class | Bin 6719 -> 6716 bytes .../cyou/chenx221/mapper/TeacherDao.class | Bin 325 -> 488 bytes .../chenx221/mapper/impl/TeacherDaoImpl.class | Bin 938 -> 1283 bytes .../classes/cyou/chenx221/pojo/Teacher.class | Bin 3459 -> 4209 bytes .../chenx221/service/TeacherService.class | Bin 745 -> 1028 bytes .../WEB-INF/classes/mapper/TeacherMapper.xml | 36 +++++++++ .../WEB-INF/views/teacherQueryResult.jsp | 4 +- .../WEB-INF/views/teachermanage.jsp | 25 ++++++- .../chenx221/controller/OutputController.java | 27 +++++++ .../controller/TeacherController.java | 17 +++-- .../java/cyou/chenx221/helper/CsvHelper.java | 69 +++++++----------- .../main/resources/mapper/TeacherMapper.xml | 7 +- .../web/WEB-INF/views/teacherQueryResult.jsp | 4 +- project2/web/WEB-INF/views/teachermanage.jsp | 25 ++++++- 16 files changed, 155 insertions(+), 59 deletions(-) diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/OutputController.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/OutputController.class index c48bc68c3549713ec824373f1474b4f321676423..f82e325711a46a3ff23f6f8898eb52eb93ae11ab 100644 GIT binary patch literal 9706 zcmbtZ3w%^ndjEfu%-qRvc?}O81VlyT6$W1s6F?IXh=zwrKqI<3Om32a$xN6BFI^v? zD~gB@WYtB{`iSeJ3hRcKitW;LyW4KJb-R68yLC5U+ikbo+HLm*{eSn~nM{%i^4szw zcg{WM`_B2k|M_0$-0z$^@&SN(@3uEbyWIC3KB@=!G1m{OGnMky)onuv#T4Hf45ox#P zS(`eNsm!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z1J^3dX{lA2e`?{{vUJyJe$#4GbFCYv6H%w@W;6-qK{?$Q6`bkMIZ-iTpo7 zNrOx5zs9V?l+Lu{3Pg6K((4bCsYYt&VYHj3gX}oA*7NV4?O;-9QX4orPC|}S8>KtL zeJYXLe(n_`qqZ6!hxZKOWcvx6-ar?p-)^jQz4jqCw9^h%d)zP*@(kk4N&GH@i8TL! z@kE|~$dDq>KOV%NGq6bWuQioln%|ZtLs_+VVaR(5e_w*F16RJd@Tdr{ovex*0BnMv zfp<3U#X@YMD>XBdw4ed4d~3t~%p08?i}B_^jcv$cyLOB_X_hf={wAv9CHE$NoZ3uK zs8-HY*%G&5ZG)tCmJ)52W5-C-QR@8WpjDwxg|z%*a-7#^a45h~h&1&E@G zpsa+&RNFzQx(Q$pfs5s#X()iElHcE&H8ibxXj*m55T!Sag2v%=pb@II8XBQ04o#g4 zO$(vnM+g_1RW3C9uK`Uw2hDpUZ0rZa*!+9W;8Z+xa20 zRfD=e59)p$Y6aAXM}g{aI-m+wg9cToii5h#1+|U-yERwRl!Uon8D%+l3_oFlz5;9< z!sYhL6RM>+5dhmvyDbvf8 zsm8Zg`AZJ7l3@ZZo#G!{(i)M8Syohg z*>_CMn51S6syVL_&-I8C;UjnypTGe=Yw;|<6db{q@MT`$AK~5{!*Ml@fnCbJjhMvW zN9YWXVKVk%2EX+zBIn)Yt>xYQdVGp;;xqKmCphmx&U}FL9psD$IL}i!&NizR7G=-y z;`_6DSMMX9_hP#GsA^|!*p7*6o7&F(ThBBssn5rmQ|dl-zm62=@;iMlmjro%{(vMw zN_AR2$W|$3JE|U15jP1vjImd^L}BcoY2dPLM|s0hXATr!;0n9_3d z4U^RxYMRHdu9qjGMe@W06uOfjmnchT7GA8XE@q7Ge0J$!1p}&Bs&=q1rGL}<*H*hZ O5@7Eh)vq2#=>Gwq^9A4l diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/TeacherController.class b/project2/out/artifacts/project2_war_exploded/WEB-IN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lZ^8=3(p>k%O(m z$A`Ef*diwJTflD#ZgU~1xe%O->8vLIAq011AV?`r4W(SChH{lI2rhLYxD@}jAUHx? z;y`dLp=8(4jV=TmT?jtk3xc*LgrKvk4M8dQe~egLu7sd1w;Kc}XG$b%=%Nn+1W)k* fa9UPV9;4-v*~iZS{`UzU8+ddOB3}#?gAx2cb;S_S diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/TeacherDao.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/TeacherDao.class index 4d3387b2c91b6f1b779b7b0948e89bc7c1861d28..3b5189824e6ec4aa306596c47c00a5c952a45267 100644 GIT binary patch delta 127 zcmX@g^n#h|)W2Q(7#J9A83ZPBEfN(-Pb~>7O)aVnNli@7NG&R6WYE)?*drsV>64XM zmZ)D^l9{9LlUZD1&B)*bl9*V%*qn)lk%5(gje(JY9cU600|$`L$-o8Ya|6YAz%slH Md_WqclAnPA0NuSA1^@s6 delta 62 zcmaFCe3Xgn)W2Q(7#J9A8F(jhEt+i4SftL#!pOkNz{bGHzz&pPV&DK`PB4p$fg4DJ IWOx`D0I0YKNB{r; diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/impl/TeacherDaoImpl.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/impl/TeacherDaoImpl.class index dc62e8805f3f145ef42132cf76068269b4fb5718..72aa3b0a18c152339ff78403c4a4ee0c248bc13a 100644 GIT binary patch delta 510 zcmaKnJx{`56ot<%YPGb=hgK29Z>&XWU|=B*F0wQ+eyk3)X{y8&gT=_i;N;A|aFVDo zIQRqnQO4Vr7!nhf_ulj7+~=PAEIvxo_s{1SfCH5JQikf&Pzedw@lV=Lt8?yH_LbAR ziz9(08EIq)Rn2Tz_m**Ed9HEhx2`?6Hu7_P*>G&Xm!x^hz82_$@+Hl*JI%JiB=4b8 zDI2%VM$;IgYrV3Nu8V%Oh>#oSC79z`r@~Wr83X}w$b40d`$^o5O&Ccg0M=+S||>%82bmyj^tD#m=?@H!!FYz PuFjldxMA-v`abXrltNH* delta 241 zcmX|4I}!mw6zn&PDP#P$%Ci37WaTocSSWFp4U`kOg~%345jcQDDLq38-s|pH-Tijv zsLkvBcmh~rmYG-rjp&@pRu21MlQtkwD8bU8$n$6tTU0BeBAVm|N#qZA%D&~BvphsR{bDtx-~(DK64w9# diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/pojo/Teacher.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/pojo/Teacher.class index 4150b7de2068d5793e8f723b5c06ae848b2aee7f..bd6d1c5e26e2b434da66c29c252732b836592506 100644 GIT binary patch literal 4209 zcmbW4ZBrCS5XXBCj>U835K%c%xF86erx!JkBA9@p7{o*fMol!!-3AtqUA$e0>(2d7V;Dy@3UUTMy@Fi{h+?9CuMlLIt#Nunev}IGCOyXrjB?fTecNXxM@{NyH(Tp&^5ij- z1{vC@*(=_*)uJ7YZ_oPPp-?iij0{Y86+|*S?YQ>L+RB1mo3j?GGACZys?J+A zhu_1==3vQz7fjZ81b_HcZ48%87^nJHm}O#?D}=nFuZM z%A~DE?8CI-L7G8K|^nx$f z)lpJkqL;G9rKe}4G4jr}Og0p^Qcr?j^wED4-MLuJZ0(w7VT@_3)5(C&qIQ+-Nrw-h z86K#UTy$}$#yv0agPOH^)ee@til1$vxeUEc^9J4EQuU6Y{;m4#xa;0MyQDUas$P>; zIq+&5f_{#>911F>mo2wawf+8S&%3v_IugSScVBE~+rqhxRa+x|J0`C>#z?$ag(@bj zYIW8@8)~Inf@VU$KXxjkqL}9nF*+y)i+OYbHKh?CBJgYF9Id9o;upo$e5O$yDD&_h$)05M8&kCRVyG5JK}kxz6n`9yP) zPxK!7L?f3^^kF=6B&bLya6gH+5}pFjbm4arze=$Z?k#e1A3cw;sRZa0oyMD>GxP%P zym$;SDV8oA-z4!HMky#H%E;M+_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t(nJVGLO7(8+*qq6$>aRg1G$_p)%FuLf?&isQH~w`m+cHr={Y zYo(L4mZFFBNTUi@g2#d;Pj8WBA3OVINoAKR4y#7hb(*MBKL=g*1eMVThFxozt;vex z>>nL21~9!e4Xm6|+_ zX2eV}hq9{%oqEf!RZ*2Am3&IXE0as&2Ly7>w#}xOn;LBhn(B&El=~WO2^v3N6n9m{ z3gs+@Mx>#~=Ln-1e^g|T&xY*rxsW}+2eL<*mpw{5`VkT|O*44rF{{9mKtECVodlYO zHi$NamO&ds%f6q?vEsEC=Mn>3FnTP~qz%L!NzVde3Fa>7?G z(c7N#GTe$mIa!!%llTpz81dFAxjF&YZ%7McO3JgqXdD#Y_?GWt5JU@uOhnmivSE-7fNb^v;nKh$leB^-=g3dE zSzIo1g+I`63$;SAjnZ(ljoOfnw^1Fki8ck?9Y-l4dP;HHMoD@`L-Yj=({swwmvo(8 z$eov!P5-{;WbxuMk>g*z@;2xA_b&CxH9o1h9C4@;lCbO%K8G|*r8|Uz2?IbGsrnV3 zUt^nZ0Q9Yd$SE}+A`Qc;rlt8OG0buxI;Ch8b1p?Gf1A_54oOQp*rAFYYJuRUeCv$e z3GRIl{ZClzhs~mIlhHK}?w|}VLX6-d#7THm$ZBm09OpFlBKi)y?qXDjUlszrhd}Qm z&<&cR1MF@~nhmv&PgC@LEkaiXyeLD@p)AVKbHI!IZvwJB;+SwM6#37A{9fS4wC4%e yNmb>MCZ~Z>h7W=GQevpjM5ogC(I+q$qgDD8eLoC5KwGEJFyjmHIr8)=W&Z^!)qLUr diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/TeacherService.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/TeacherService.class index 7e9f4f402e5a3f92edcface2401d34a30cf1e5c2..cb66cfbad97e18fecbfb207ed388da8fe6c76716 100644 GIT binary patch delta 334 zcmZXPyD~#j6o$XGlL%)gaX&&15w|hSsI(?8pfTeGjM+mSQK&QuZRS+oL7~t@;Q_pW zUYD0J{(WLFqgj{#-|Jgzk1BVQ$=m14D{#clAQ^Q$4HjxFk{UA?p?`86dN-%x?EEtH zu8f1-{K2xp$Gflg$D)x%scakNwJxCUF&vP3mTLZ>y%YZG0lp)6sMTb zB2$i)r=}@mmN|J%X@^BGZ||Avkh<|C)e)H!^3co3igUlLRn?9)Y5Gd|Ms=0rLLX84 hL+0H-R{G~I|8tk8&AM1)YDbWbg1^a@a=c<2z5wI8B|!iH delta 172 zcmZqSc*)9j>ff$?3=9mm4Du7XUQTvoJT|$Wsal + + + \ No newline at end of file diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/teacherQueryResult.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/teacherQueryResult.jsp index a6028ba..1bca87e 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/teacherQueryResult.jsp +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/teacherQueryResult.jsp @@ -25,7 +25,7 @@ .table-container table { width: 100%; - height: 100%; + /*height: 100%;*/ } @@ -158,7 +158,7 @@ - + ${teacher.id} ${teacher.name} diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/teachermanage.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/teachermanage.jsp index 9f55f30..c2806c4 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/teachermanage.jsp +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/teachermanage.jsp @@ -133,7 +133,19 @@ style="background-image: url('${pageContext.request.contextPath}/resources/img/jason-blackeye-nyL-rzwP-Mk-unsplash.jpg'); margin-top: -58.59px;">
- +
+
+
+ +
+
+
+
+ +
+
+
@@ -642,6 +654,17 @@ $('#exampleModal3').modal('hide'); } } + + function exportCSV() { + // 构造请求 URL,根据需要导出的类型传递参数 + var exportUrl = '/output/export-csv?type=teacher'; // 示例:导出学生数据 + var link = document.createElement('a'); + link.href = exportUrl; + link.style.display = 'none'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } diff --git a/project2/src/main/java/cyou/chenx221/controller/OutputController.java b/project2/src/main/java/cyou/chenx221/controller/OutputController.java index 72c53e8..5ef4719 100644 --- a/project2/src/main/java/cyou/chenx221/controller/OutputController.java +++ b/project2/src/main/java/cyou/chenx221/controller/OutputController.java @@ -3,9 +3,11 @@ package cyou.chenx221.controller; import cyou.chenx221.pojo.Course; import cyou.chenx221.pojo.Score; import cyou.chenx221.pojo.Student; +import cyou.chenx221.pojo.Teacher; import cyou.chenx221.service.CourseService; import cyou.chenx221.service.ScoreService; import cyou.chenx221.service.StudentService; +import cyou.chenx221.service.TeacherService; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVPrinter; import org.springframework.beans.factory.annotation.Autowired; @@ -34,6 +36,9 @@ public class OutputController { @Autowired private ScoreService scoreService; + @Autowired + private TeacherService teacherService; + @GetMapping("/export-csv") public void exportCSV(HttpServletResponse response, @RequestParam("type") String type) throws IOException { response.setHeader("Content-Disposition", "attachment; filename=export.csv"); @@ -59,6 +64,11 @@ public class OutputController { List scores = scoreService.getAllScores(); // 根据实际情况获取成绩数据 data = transformScoresToData(scores); } + case "teacher" -> { + headers = Arrays.asList("教师ID", "姓名", "性别","出生日期","授课课程ID","授课课程名","授课班级"); + List teachers = teacherService.getAllTeachers(); // 根据实际情况获取教师数据 + data = transformTeachersToData(teachers); + } default -> throw new IllegalArgumentException("Invalid export type: " + type); } @@ -122,6 +132,23 @@ public class OutputController { return data; } + private List> transformTeachersToData(List teachers) { + List> data = new ArrayList<>(); + for (Teacher teacher : teachers) { + List rowData = Arrays.asList( + String.valueOf(teacher.getId()), + teacher.getName(), + teacher.getSex(), + teacher.getBirthday().toString(), + String.valueOf(teacher.getCourse().getCourseID()), + teacher.getCourse().getCourseName(), + teacher.getClasses() + ); + data.add(rowData); + } + return data; + } + @GetMapping("/get-csv") public void getCSV(HttpServletResponse response, @RequestParam("filename") String filename) throws IOException { String filePath = "file" + File.separator + filename; diff --git a/project2/src/main/java/cyou/chenx221/controller/TeacherController.java b/project2/src/main/java/cyou/chenx221/controller/TeacherController.java index 0d7878f..e1b7564 100644 --- a/project2/src/main/java/cyou/chenx221/controller/TeacherController.java +++ b/project2/src/main/java/cyou/chenx221/controller/TeacherController.java @@ -33,11 +33,15 @@ public class TeacherController { } @GetMapping("/manage") - public String manageTeacherInfo(Model model) { + public String manageTeacherInfo(@RequestParam(value = "successMessage", required = false, defaultValue = "null") String successMessage, + @RequestParam(value = "errorMessage", required = false, defaultValue = "null") String errorMessage, + Model model) { String username = new UsernameHelper().getCurrentUsername(); if (username != null) { model.addAttribute("username", username); } + model.addAttribute("successMessage", successMessage); + model.addAttribute("errorMessage", errorMessage); List teacherList = teacherService.getAllTeachers(); model.addAttribute("teacherList", teacherList); return "teachermanage"; @@ -52,7 +56,7 @@ public class TeacherController { @RequestParam(value = "course_id", defaultValue = "-1", required = false) int course_id,//课程ID @RequestParam(value = "course_name", defaultValue = "null", required = false) String course_name,//课程名 @RequestParam(value = "classes", defaultValue = "null", required = false) String classes,//授课班级 - Model model) { + Model model) throws IOException { //username helper start String username = new UsernameHelper().getCurrentUsername(); @@ -102,11 +106,8 @@ public class TeacherController { } Teacher teacher = new Teacher(id, name, sex, (course_id == -1 && course_name == null ? null : (new Course(course_id, course_name))), classes, birthdayBegin, birthdayEnd); List teachers = teacherService.getQueryTeachers(teacher); - -// scores = scoreService.getQueryScores(score); -// String download = new CsvHelper().generateScoreCSVFile(scores); -// model.addAttribute("download", download); -// model.addAttribute("scores", scores); - return "scoreQueryResult"; + model.addAttribute("teachers", teachers); + model.addAttribute("download", new CsvHelper().generateTeacherCSVFile(teachers)); + return "teacherQueryResult"; } } diff --git a/project2/src/main/java/cyou/chenx221/helper/CsvHelper.java b/project2/src/main/java/cyou/chenx221/helper/CsvHelper.java index e367634..4ddc698 100644 --- a/project2/src/main/java/cyou/chenx221/helper/CsvHelper.java +++ b/project2/src/main/java/cyou/chenx221/helper/CsvHelper.java @@ -3,6 +3,7 @@ package cyou.chenx221.helper; import cyou.chenx221.pojo.Course; import cyou.chenx221.pojo.Score; import cyou.chenx221.pojo.Student; +import cyou.chenx221.pojo.Teacher; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVPrinter; @@ -31,6 +32,10 @@ public class CsvHelper { ); data.add(rowData); } + return getString(headers, data); + } + + private String getString(List headers, List> data) throws IOException { String directoryPath = "file"; File directory = new File(directoryPath); @@ -70,28 +75,7 @@ public class CsvHelper { ); data.add(rowData); } - String directoryPath = "file"; - File directory = new File(directoryPath); - - if (!directory.exists()) { - boolean created = directory.mkdir(); //Be careful, path: tomcat's installation path (D:\softs\res\apache-tomcat-9.0.75-windows-x64\apache-tomcat-9.0.75\bin) - if (created) { - System.out.println("目录已创建"); - } else { - System.out.println("无法创建目录"); - } - } - - File csvFile = new File("file/export-" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd_HHmmss")) + ".csv"); - try (PrintWriter writer = new PrintWriter(csvFile); - CSVPrinter csvPrinter = new CSVPrinter(writer, CSVFormat.DEFAULT)) { - csvPrinter.printRecord(headers); - for (List row : data) { - csvPrinter.printRecord(row); - } - csvPrinter.flush(); - } - return csvFile.getName(); + return getString(headers, data); } public String generateCourseCSVFile(List courses) throws IOException { @@ -106,28 +90,25 @@ public class CsvHelper { ); data.add(rowData); } - String directoryPath = "file"; - File directory = new File(directoryPath); - - if (!directory.exists()) { - boolean created = directory.mkdir(); //Be careful, path: tomcat's installation path (D:\softs\res\apache-tomcat-9.0.75-windows-x64\apache-tomcat-9.0.75\bin) - if (created) { - System.out.println("目录已创建"); - } else { - System.out.println("无法创建目录"); - } - } - - File csvFile = new File("file/export-" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd_HHmmss")) + ".csv"); - try (PrintWriter writer = new PrintWriter(csvFile); - CSVPrinter csvPrinter = new CSVPrinter(writer, CSVFormat.DEFAULT)) { - csvPrinter.printRecord(headers); - for (List row : data) { - csvPrinter.printRecord(row); - } - csvPrinter.flush(); - } - return csvFile.getName(); + return getString(headers, data); } + public String generateTeacherCSVFile(List teachers) throws IOException { + List headers; + headers = Arrays.asList("教师ID", "姓名", "性别","出生日期","授课课程ID","授课课程名","授课班级"); + List> data = new ArrayList<>(); + for (Teacher teacher : teachers) { + List rowData = Arrays.asList( + String.valueOf(teacher.getId()), + teacher.getName(), + teacher.getSex(), + teacher.getBirthday().toString(), + String.valueOf(teacher.getCourse().getCourseID()), + teacher.getCourse().getCourseName(), + teacher.getClasses() + ); + data.add(rowData); + } + return getString(headers, data); + } } diff --git a/project2/src/main/resources/mapper/TeacherMapper.xml b/project2/src/main/resources/mapper/TeacherMapper.xml index bf384bc..9de3184 100644 --- a/project2/src/main/resources/mapper/TeacherMapper.xml +++ b/project2/src/main/resources/mapper/TeacherMapper.xml @@ -48,7 +48,12 @@ AND classes = #{classes} - # 待添加 + + AND birthday >= #{birthdayBegin} + + + AND birthday <= #{birthdayEnd} + \ No newline at end of file diff --git a/project2/web/WEB-INF/views/teacherQueryResult.jsp b/project2/web/WEB-INF/views/teacherQueryResult.jsp index a6028ba..1bca87e 100644 --- a/project2/web/WEB-INF/views/teacherQueryResult.jsp +++ b/project2/web/WEB-INF/views/teacherQueryResult.jsp @@ -25,7 +25,7 @@ .table-container table { width: 100%; - height: 100%; + /*height: 100%;*/ } @@ -158,7 +158,7 @@ - + diff --git a/project2/web/WEB-INF/views/teachermanage.jsp b/project2/web/WEB-INF/views/teachermanage.jsp index 9f55f30..c2806c4 100644 --- a/project2/web/WEB-INF/views/teachermanage.jsp +++ b/project2/web/WEB-INF/views/teachermanage.jsp @@ -133,7 +133,19 @@ style="background-image: url('${pageContext.request.contextPath}/resources/img/jason-blackeye-nyL-rzwP-Mk-unsplash.jpg'); margin-top: -58.59px;">
- +
+
+
+ +
+
+
+
+ +
+
+
${teacher.id} ${teacher.name}
@@ -642,6 +654,17 @@ $('#exampleModal3').modal('hide'); } } + + function exportCSV() { + // 构造请求 URL,根据需要导出的类型传递参数 + var exportUrl = '/output/export-csv?type=teacher'; // 示例:导出学生数据 + var link = document.createElement('a'); + link.href = exportUrl; + link.style.display = 'none'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }