|
@@ -252,6 +252,21 @@ function getPageNumberInfo() {
|
|
|
];
|
|
|
}
|
|
|
|
|
|
+function getExtraInfo(pageDom) {
|
|
|
+ const info = {
|
|
|
+ barcode: [],
|
|
|
+ };
|
|
|
+ const courseBarDom = pageDom.querySelector(".course-barcode");
|
|
|
+ if (courseBarDom) {
|
|
|
+ info.barcode.push({
|
|
|
+ field: "courseCode",
|
|
|
+ area: getOffsetInfo(courseBarDom),
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ return info;
|
|
|
+}
|
|
|
+
|
|
|
function parsePageExchange(pages) {
|
|
|
initFillAreaIndex();
|
|
|
|
|
@@ -262,17 +277,14 @@ function parsePageExchange(pages) {
|
|
|
.getBoundingClientRect();
|
|
|
const pageNumberInfo = pages.length > 2 ? getPageNumberInfo() : null;
|
|
|
npages.forEach((page, pindex) => {
|
|
|
- curPageOffsetInfo = document
|
|
|
- .getElementById(`preview-page-box-${pindex}`)
|
|
|
- .getBoundingClientRect();
|
|
|
+ const curPageDom = document.getElementById(`preview-page-box-${pindex}`);
|
|
|
+ curPageOffsetInfo = curPageDom.getBoundingClientRect();
|
|
|
|
|
|
let exchange = {
|
|
|
card_type: 2,
|
|
|
page_size: page.pageSize,
|
|
|
page_image: "",
|
|
|
- locator: elementInfoFunc.LOCATOR(
|
|
|
- document.getElementById(`preview-page-box-${pindex}`)
|
|
|
- ),
|
|
|
+ locator: elementInfoFunc.LOCATOR(curPageDom),
|
|
|
fill_locator: [],
|
|
|
check_area: {
|
|
|
black_line: [],
|
|
@@ -312,6 +324,12 @@ function parsePageExchange(pages) {
|
|
|
exchange.fill_area = exchange.fill_area.concat(pnoInfo);
|
|
|
}
|
|
|
|
|
|
+ // 课程代码条码
|
|
|
+ const extraInfo = getExtraInfo(curPageDom);
|
|
|
+ Object.entries(extraInfo).forEach(([key, vals]) => {
|
|
|
+ exchange[key] = exchange[key].concat(vals);
|
|
|
+ });
|
|
|
+
|
|
|
page.exchange = exchange;
|
|
|
});
|
|
|
|