智慧校园考试-班级报告
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 2.2KB

1 rok temu
1 rok temu
1 rok temu
1 rok temu
1 rok temu
1 rok temu
1 rok temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. $(function () {
  2. function loadSectionHtml(sectionsData) {
  3. var loadHtmlArr = [
  4. // "cover", //封面
  5. // "preface", //前言
  6. "section_1",
  7. // "section_2",
  8. // "section_3",
  9. // "section_4",
  10. // "section_5",
  11. ];
  12. $(".pdf_root").html(loadHtmlArr.map(function (htmlName) {
  13. return "<div class='" + htmlName + "_html_root'></div>";
  14. }).join(""));
  15. loadHtmlArr.forEach(function (htmlName) {
  16. // 考试概况ksgk, 成绩分析cjfx, 成绩分析-等级分析djfx, 违纪分析wjfx, 优秀试卷yxsj
  17. if (htmlName === "cover") {
  18. $("." + htmlName + "_html_root").data("page-params", JSON.stringify(sectionsData.ksgk));
  19. } else if (htmlName === "preface") {
  20. $("." + htmlName + "_html_root").data("page-params", JSON.stringify(sectionsData));
  21. } else if (htmlName === "section_1") {
  22. $("." + htmlName + "_html_root").data("page-params", JSON.stringify(sectionsData));
  23. } else if (htmlName === "section_2") {
  24. $("." + htmlName + "_html_root").data("page-params", JSON.stringify({
  25. cjfx: sectionsData.cjfx,
  26. djfx: sectionsData.djfx
  27. }));
  28. } else if (htmlName === "section_3") {
  29. $("." + htmlName + "_html_root").data("page-params", JSON.stringify(sectionsData.wjfx));
  30. } else if (htmlName === "section_4") {
  31. $("." + htmlName + "_html_root").data("page-params", JSON.stringify(sectionsData.yxsj));
  32. } else if (htmlName === "section_5") {
  33. $("." + htmlName + "_html_root").data("page-params", JSON.stringify(sectionsData.wjsj));
  34. }
  35. $("." + htmlName + "_html_root").load("../sections/" + htmlName + ".html");
  36. });
  37. }
  38. // 请求接口前缀
  39. var _pdfBaseurl = "https://schoolapitest.xhkjedu.com/";
  40. // 47.1.1pdf报告
  41. var _sexam_ers_pdf = _pdfBaseurl + "sexam/erc/pdf";
  42. $.ajax({
  43. type: "POST",
  44. url: _sexam_ers_pdf,
  45. data: JSON.stringify({
  46. examid: 2,
  47. classid:9666
  48. }),
  49. dataType: "json",
  50. contentType: "application/json; charset=utf-8",
  51. success: function (data) {
  52. if (data.code === 0) {
  53. loadSectionHtml(data.obj);
  54. } else {
  55. alert(data.msg);
  56. }
  57. }
  58. });
  59. });