智慧校园考试-班级报告
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

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