|
@@ -0,0 +1,376 @@
|
|
|
+// $(document).ready(function() {
|
|
|
+
|
|
|
+export default function getPdfPoints() {
|
|
|
+ // pdf容器contenterPdf
|
|
|
+ var contenterPdf = $("#contenterPdf")
|
|
|
+ var baseX = contenterPdf.offset().left
|
|
|
+ var baseY = contenterPdf.offset().top
|
|
|
+ // 每一页pdf
|
|
|
+ var page_cell = contenterPdf.find(".page_cell")
|
|
|
+ // pdf数据
|
|
|
+ var pdfData = {
|
|
|
+ "stdPoints": [],
|
|
|
+ "titleInfo": {},
|
|
|
+ "studentInfo": [],
|
|
|
+ "studentNo": [],
|
|
|
+ "noteInfo": [],
|
|
|
+ "barCodeInfo": [],
|
|
|
+ "missExamInfo": [],
|
|
|
+ "objectiveQues": [],
|
|
|
+ "tkQues":[],
|
|
|
+ ywzwQues:[]
|
|
|
+ }
|
|
|
+ var pdfPointsList = [];
|
|
|
+ Array.from(page_cell).forEach((item) => {
|
|
|
+ console.log(item)
|
|
|
+ // 标准点
|
|
|
+ let pointList = [];
|
|
|
+ for (var i = 0; i < $(".stdPoints").length; i++) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(".stdPoints").eq(i).offset().left - baseX,
|
|
|
+ y: $(".stdPoints").eq(i).offset().top - baseY,
|
|
|
+ w: $(".stdPoints").eq(i).width(),
|
|
|
+ h: $(".stdPoints").eq(i).height(),
|
|
|
+ type: "rect",
|
|
|
+ fill:1
|
|
|
+ })
|
|
|
+ }
|
|
|
+ pdfData.stdPoints = pointList
|
|
|
+ pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+
|
|
|
+ pointList = [];
|
|
|
+ // 标题
|
|
|
+ pointList.push({
|
|
|
+ x: $("#paperNameTextAreaTem").offset().left - baseX,
|
|
|
+ y: $("#paperNameTextAreaTem").offset().top - baseY,
|
|
|
+ w: $("#paperNameTextAreaTem").width(),
|
|
|
+ h: $("#paperNameTextAreaTem").height(),
|
|
|
+ text: $("#paperNameTextAreaTem").text(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ pdfData.titleInfo = pointList
|
|
|
+ pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+
|
|
|
+ // 考生信息
|
|
|
+ pointList = []
|
|
|
+ // 姓名,下划线
|
|
|
+ pointList.push({
|
|
|
+ x: $("#name").offset().left - baseX,
|
|
|
+ y: $("#name").offset().top - baseY,
|
|
|
+ w: $("#name").width(),
|
|
|
+ h: $("#name").height(),
|
|
|
+ text: $("#name").text(),
|
|
|
+ type: "text"
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $("#nameLine").offset().left - baseX,
|
|
|
+ y: $("#nameLine").offset().top - baseY,
|
|
|
+ w: $("#nameLine").width(),
|
|
|
+ h: $("#nameLine").height(),
|
|
|
+ text: $("#nameLine").text(),
|
|
|
+ type: "line"
|
|
|
+ })
|
|
|
+ // 班级,下划线
|
|
|
+ pointList.push({
|
|
|
+ x: $("#className").offset().left - baseX,
|
|
|
+ y: $("#className").offset().top - baseY,
|
|
|
+ w: $("#className").width(),
|
|
|
+ h: $("#className").height(),
|
|
|
+ type: "text",
|
|
|
+ text: $("#className").text()
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $("#classNameLine").offset().left - baseX,
|
|
|
+ y: $("#classNameLine").offset().top - baseY,
|
|
|
+ w: $("#classNameLine").width(),
|
|
|
+ h: $("#classNameLine").height(),
|
|
|
+ text: $("#classNameLine").text(),
|
|
|
+ type: "line"
|
|
|
+ })
|
|
|
+ // 考场号,下划线
|
|
|
+ pointList.push({
|
|
|
+ x: $("#kcNo").offset().left - baseX,
|
|
|
+ y: $("#kcNo").offset().top - baseY,
|
|
|
+ w: $("#kcNo").width(),
|
|
|
+ h: $("#kcNo").height(),
|
|
|
+ type: "text",
|
|
|
+ text: $("#kcNo").text()
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $("#kcNoLine").offset().left - baseX,
|
|
|
+ y: $("#kcNoLine").offset().top - baseY,
|
|
|
+ w: $("#kcNoLine").width(),
|
|
|
+ h: $("#kcNoLine").height(),
|
|
|
+ text: $("#kcNoLine").text(),
|
|
|
+ type: "line"
|
|
|
+ })
|
|
|
+ // 座位号,下划线
|
|
|
+ pointList.push({
|
|
|
+ x: $("#sitNo").offset().left - baseX,
|
|
|
+ y: $("#sitNo").offset().top - baseY,
|
|
|
+ w: $("#sitNo").width(),
|
|
|
+ h: $("#sitNo").height(),
|
|
|
+ type: "text",
|
|
|
+ text: $("#sitNo").text(),
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $("#sitNoLine").offset().left - baseX,
|
|
|
+ y: $("#sitNoLine").offset().top - baseY,
|
|
|
+ w: $("#sitNoLine").width(),
|
|
|
+ h: $("#sitNoLine").height(),
|
|
|
+ text: $("#sitNoLine").text(),
|
|
|
+ type: "line"
|
|
|
+ })
|
|
|
+ pdfData.studentInfo = pointList
|
|
|
+ pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+
|
|
|
+ // 准考证号和填涂框
|
|
|
+ pointList = []
|
|
|
+ pointList.push({
|
|
|
+ x: $("#zkzh").offset().left - baseX,
|
|
|
+ y: $("#zkzh").offset().top - baseY,
|
|
|
+ w: $("#zkzh").width(),
|
|
|
+ h: $("#zkzh").height(),
|
|
|
+ text: $("#zkzh").text().replace(" ",""),
|
|
|
+ type: "text"
|
|
|
+ })
|
|
|
+ for (var i = 0; i < $(".zkzh_rect").length; i++) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(".zkzh_rect").eq(i).offset().left - baseX,
|
|
|
+ y: $(".zkzh_rect").eq(i).offset().top - baseY,
|
|
|
+ w: $(".zkzh_rect").eq(i).width(),
|
|
|
+ h: $(".zkzh_rect").eq(i).height(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ pdfData.studentNo = pointList
|
|
|
+ pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+
|
|
|
+ // 注意事项
|
|
|
+ pointList = []
|
|
|
+ pointList.push({
|
|
|
+ x: $("#noteInfo").offset().left - baseX,
|
|
|
+ y: $("#noteInfo").offset().top - baseY,
|
|
|
+ w: $("#noteInfo").width(),
|
|
|
+ h: $("#noteInfo").height(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $("#noteInfo_title").offset().left - baseX,
|
|
|
+ y: $("#noteInfo_title").offset().top - baseY,
|
|
|
+ w: $("#noteInfo_title").width(),
|
|
|
+ h: $("#noteInfo_title").height(),
|
|
|
+ type: "text",
|
|
|
+ text: $("#noteInfo_title").text()
|
|
|
+ })
|
|
|
+ for (var i = 0; i < $(".noteInfo_desc").length; i++) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(".noteInfo_desc").eq(i).offset().left - baseX,
|
|
|
+ y: $(".noteInfo_desc").eq(i).offset().top - baseY,
|
|
|
+ w: $(".noteInfo_desc").eq(i).width(),
|
|
|
+ h: $(".noteInfo_desc").eq(i).height(),
|
|
|
+ type: "text",
|
|
|
+ text: $(".noteInfo_desc").eq(i).text()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ pdfData.noteInfo = pointList
|
|
|
+ pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+
|
|
|
+ // 条形码区域
|
|
|
+ pointList = []
|
|
|
+ pointList.push({
|
|
|
+ x: $("#barCodeRect").offset().left - baseX,
|
|
|
+ y: $("#barCodeRect").offset().top - baseY,
|
|
|
+ w: $("#barCodeRect").width(),
|
|
|
+ h: $("#barCodeRect").height(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $("#barCodeTitle").offset().left - baseX,
|
|
|
+ y: $("#barCodeTitle").offset().top - baseY,
|
|
|
+ w: $("#barCodeTitle").width(),
|
|
|
+ h: $("#barCodeTitle").height(),
|
|
|
+ type: "text",
|
|
|
+ text: $("#barCodeTitle").text()
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $("#barCodeNote").offset().left - baseX,
|
|
|
+ y: $("#barCodeNote").offset().top - baseY,
|
|
|
+ w: $("#barCodeNote").width(),
|
|
|
+ h: $("#barCodeNote").height(),
|
|
|
+ type: "text",
|
|
|
+ text: $("#barCodeNote").text()
|
|
|
+ })
|
|
|
+ pdfData.barCodeInfo = pointList
|
|
|
+ pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+
|
|
|
+ // 缺考标记
|
|
|
+ pointList = []
|
|
|
+ pointList.push({
|
|
|
+ x: $("#missExamRect").offset().left - baseX,
|
|
|
+ y: $("#missExamRect").offset().top - baseY,
|
|
|
+ w: $("#missExamRect").width(),
|
|
|
+ h: $("#missExamRect").height(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $("#exactFill").offset().left - baseX,
|
|
|
+ y: $("#exactFill").offset().top - baseY,
|
|
|
+ w: $("#exactFill").width(),
|
|
|
+ h: $("#exactFill").height(),
|
|
|
+ type: "text",
|
|
|
+ text: $("#exactFill").text()
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $("#exactFillRect").offset().left - baseX,
|
|
|
+ y: $("#exactFillRect").offset().top - baseY,
|
|
|
+ w: $("#exactFillRect").width(),
|
|
|
+ h: $("#exactFillRect").height(),
|
|
|
+ type: "rect",
|
|
|
+ fill:1
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $("#missExamFill").offset().left - baseX,
|
|
|
+ y: $("#missExamFill").offset().top - baseY,
|
|
|
+ w: $("#missExamFill").width(),
|
|
|
+ h: $("#missExamFill").height(),
|
|
|
+ type: "text",
|
|
|
+ text: $("#missExamFill").text()
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $("#missExamFillRect").offset().left - baseX,
|
|
|
+ y: $("#missExamFillRect").offset().top - baseY,
|
|
|
+ w: $("#missExamFillRect").width(),
|
|
|
+ h: $("#missExamFillRect").height(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ pdfData.missExamInfo = pointList
|
|
|
+ pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+
|
|
|
+ // 客观题
|
|
|
+ pointList = []
|
|
|
+ if ($(".page_objective_title").length > 0) {
|
|
|
+ // 客观题标题
|
|
|
+ pointList.push({
|
|
|
+ x: $(".page_objective_title").eq(0).offset().left - baseX,
|
|
|
+ y: $(".page_objective_title").eq(0).offset().top - baseY,
|
|
|
+ w: $(".page_objective_title").eq(0).width(),
|
|
|
+ h: $(".page_objective_title").eq(0).height(),
|
|
|
+ type: "text",
|
|
|
+ text: $(".page_objective_title").eq(0).text()
|
|
|
+ })
|
|
|
+ // 客观题矩形区域
|
|
|
+ pointList.push({
|
|
|
+ x: $(".page_objective_rect").eq(0).offset().left - baseX,
|
|
|
+ y: $(".page_objective_rect").eq(0).offset().top - baseY,
|
|
|
+ w: $(".page_objective_rect").eq(0).width(),
|
|
|
+ h: $(".page_objective_rect").eq(0).height(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ // 客观题选项
|
|
|
+ // Array.from($(".page_objective_ques")).forEach(item=>{
|
|
|
+ let tmid = $(".page_cell_tm_id").eq(0);
|
|
|
+ for (var i = 0; i < $(".page_cell_tm_id").length; i++) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(".page_cell_tm_id").eq(i).offset().left - baseX,
|
|
|
+ y: $(".page_cell_tm_id").eq(i).offset().top - baseY,
|
|
|
+ w: $(".page_cell_tm_id").eq(i).width(),
|
|
|
+ h: $(".page_cell_tm_id").eq(i).height(),
|
|
|
+ type: "text",
|
|
|
+ text: $(".page_cell_tm_id").eq(i).text(),
|
|
|
+ })
|
|
|
+ }
|
|
|
+ for (var i = 0; i < $(".page_cell_options").length; i++) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(".page_cell_options").eq(i).offset().left - baseX,
|
|
|
+ y: $(".page_cell_options").eq(i).offset().top - baseY,
|
|
|
+ w: $(".page_cell_options").eq(i).width(),
|
|
|
+ h: $(".page_cell_options").eq(i).height(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ for (var i = 0; i < $(".page_cell_options_char").length; i++) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(".page_cell_options_char").eq(i).offset().left - baseX,
|
|
|
+ y: $(".page_cell_options_char").eq(i).offset().top - baseY,
|
|
|
+ w: $(".page_cell_options_char").eq(i).width(),
|
|
|
+ h: $(".page_cell_options_char").eq(i).height(),
|
|
|
+ type: "text",
|
|
|
+ text: $(".page_cell_options_char").eq(i).text()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ pdfData.objectiveQues = pointList
|
|
|
+ pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+ console.log(pdfData, 33333333333333)
|
|
|
+ console.log(pdfPointsList,44444444444444444)
|
|
|
+
|
|
|
+ // 填空题
|
|
|
+ pointList = []
|
|
|
+ if ($(".page_tk_title").length > 0) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(".page_tk_title").eq(0).offset().left - baseX,
|
|
|
+ y: $(".page_tk_title").eq(0).offset().top - baseY,
|
|
|
+ w: $(".page_tk_title").eq(0).width(),
|
|
|
+ h: $(".page_tk_title").eq(0).height(),
|
|
|
+ type: "text",
|
|
|
+ text: $(".page_tk_title").eq(0).text()
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $(".page_tk_rect").eq(0).offset().left - baseX,
|
|
|
+ y: $(".page_tk_rect").eq(0).offset().top - baseY,
|
|
|
+ w: $(".page_tk_rect").eq(0).width(),
|
|
|
+ h: $(".page_tk_rect").eq(0).height(),
|
|
|
+ type: "rect",
|
|
|
+ })
|
|
|
+ for (var i = 0; i < $(".page_tk_tm_id").length; i++) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(".page_tk_tm_id").eq(i).offset().left - baseX,
|
|
|
+ y: $(".page_tk_tm_id").eq(i).offset().top - baseY,
|
|
|
+ w: $(".page_tk_tm_id").eq(i).width(),
|
|
|
+ h: $(".page_tk_tm_id").eq(i).height(),
|
|
|
+ type: "text",
|
|
|
+ text: $(".page_tk_tm_id").eq(i).text(),
|
|
|
+ })
|
|
|
+ }
|
|
|
+ for (var i = 0; i < $(".page_tk_tm_line").length; i++) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(".page_tk_tm_line").eq(i).offset().left - baseX,
|
|
|
+ y: $(".page_tk_tm_line").eq(i).offset().top - baseY,
|
|
|
+ w: $(".page_tk_tm_line").eq(i).width(),
|
|
|
+ h: $(".page_tk_tm_line").eq(i).height(),
|
|
|
+ type: "line"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ pdfData.tkQues = pointList
|
|
|
+ pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 语文作文题
|
|
|
+ pointList = []
|
|
|
+ if ($(".page_tk_title").length > 0) {
|
|
|
+ for (var i = 0; i < $(".left_div_words").length; i++) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(".left_div_words").eq(i).offset().left - baseX,
|
|
|
+ y: $(".left_div_words").eq(i).offset().top - baseY,
|
|
|
+ w: $(".left_div_words").eq(i).width(),
|
|
|
+ h: $(".left_div_words").eq(i).height(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ for (var i = 0; i < $(".left_div_words_li").length; i++) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(".left_div_words_li").eq(i).offset().left - baseX,
|
|
|
+ y: $(".left_div_words_li").eq(i).offset().top - baseY,
|
|
|
+ w: $(".left_div_words_li").eq(i).width(),
|
|
|
+ h: $(".left_div_words_li").eq(i).height(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ pdfData.ywzwQues = pointList
|
|
|
+ pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return pdfPointsList;
|
|
|
+}
|