|
@@ -14,7 +14,8 @@ const initIndex = {
|
|
|
absent: 1,
|
|
|
paperType: 1,
|
|
|
examNumber: 1,
|
|
|
- selective: 1
|
|
|
+ selective: 1,
|
|
|
+ pageNumber: 1
|
|
|
};
|
|
|
|
|
|
export default {
|
|
@@ -50,7 +51,8 @@ export default {
|
|
|
},
|
|
|
parsePageExchange() {
|
|
|
const pages = deepCopy(this.pages);
|
|
|
- pages.forEach(page => {
|
|
|
+ const pageNumberInfo = this.getPageNumberInfo();
|
|
|
+ pages.forEach((page, pindex) => {
|
|
|
let exchange = {
|
|
|
locator: this.getLocatorInfo(page.locators),
|
|
|
barcode: [],
|
|
@@ -75,6 +77,12 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+ if (!(pindex % 2)) {
|
|
|
+ let pnoInfo = deepCopy(pageNumberInfo);
|
|
|
+ pnoInfo[0].index = this.getFillAreaIndex("pageNumber");
|
|
|
+ exchange.fill_area = exchange.fill_area.concat(pnoInfo);
|
|
|
+ }
|
|
|
+
|
|
|
page.exchange = exchange;
|
|
|
});
|
|
|
|
|
@@ -82,6 +90,30 @@ export default {
|
|
|
|
|
|
return pages;
|
|
|
},
|
|
|
+ getPageNumberInfo() {
|
|
|
+ const dom = document.querySelector(".page-box-0");
|
|
|
+ let options = [];
|
|
|
+ dom
|
|
|
+ .querySelector(".page-number-rect-list")
|
|
|
+ .childNodes.forEach((item, index) => {
|
|
|
+ options[index] = this.getOffsetInfo(item);
|
|
|
+ });
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ field: "pageNumber",
|
|
|
+ index: 1,
|
|
|
+ single: true,
|
|
|
+ horizontal: true,
|
|
|
+ items: [
|
|
|
+ {
|
|
|
+ main_number: null,
|
|
|
+ sub_number: null,
|
|
|
+ options
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ },
|
|
|
getLocatorInfo(locators) {
|
|
|
return locators.map(locatorGroup => {
|
|
|
const locatorInfos = locatorGroup.map(locator => {
|