|
@@ -30,6 +30,7 @@ export default {
|
|
"COMPOSITION",
|
|
"COMPOSITION",
|
|
],
|
|
],
|
|
curPageOffsetInfo: {},
|
|
curPageOffsetInfo: {},
|
|
|
|
+ curPageDom: null,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -55,15 +56,14 @@ export default {
|
|
pages.length <= 2 ? null : this.getPageNumberInfo();
|
|
pages.length <= 2 ? null : this.getPageNumberInfo();
|
|
|
|
|
|
npages.forEach((page, pindex) => {
|
|
npages.forEach((page, pindex) => {
|
|
- this.curPageOffsetInfo = document
|
|
|
|
- .getElementById(`preview-page-box-${pindex}`)
|
|
|
|
- .getBoundingClientRect();
|
|
|
|
|
|
+ this.curPageDom = document.getElementById(`preview-page-box-${pindex}`);
|
|
|
|
+ this.curPageOffsetInfo = this.curPageDom.getBoundingClientRect();
|
|
|
|
|
|
let exchange = {
|
|
let exchange = {
|
|
card_type: 2,
|
|
card_type: 2,
|
|
page_size: page.pageSize,
|
|
page_size: page.pageSize,
|
|
page_image: "",
|
|
page_image: "",
|
|
- locator: this.getLocatorInfo(page.locators),
|
|
|
|
|
|
+ locator: this.getLocatorInfo(this.curPageDom),
|
|
fill_locator: [],
|
|
fill_locator: [],
|
|
check_area: {
|
|
check_area: {
|
|
black_line: [],
|
|
black_line: [],
|
|
@@ -114,7 +114,7 @@ export default {
|
|
return npages;
|
|
return npages;
|
|
},
|
|
},
|
|
getPageNumberInfo() {
|
|
getPageNumberInfo() {
|
|
- const dom = document.querySelector(".page-box-0");
|
|
|
|
|
|
+ const dom = document.getElementById(`preview-page-box-0`);
|
|
let options = [];
|
|
let options = [];
|
|
dom
|
|
dom
|
|
.querySelector(".page-number-rect-list")
|
|
.querySelector(".page-number-rect-list")
|
|
@@ -139,14 +139,20 @@ export default {
|
|
},
|
|
},
|
|
];
|
|
];
|
|
},
|
|
},
|
|
- getLocatorInfo(locators) {
|
|
|
|
- const tops = locators.top.map((locator) => {
|
|
|
|
- return this.getOffsetInfo(document.getElementById(locator.id));
|
|
|
|
- });
|
|
|
|
- const bottoms = locators.bottom.map((locator) => {
|
|
|
|
- return this.getOffsetInfo(document.getElementById(locator.id));
|
|
|
|
- });
|
|
|
|
|
|
+ getLocatorInfo(curPageDom) {
|
|
|
|
+ let tops = [];
|
|
|
|
+ curPageDom
|
|
|
|
+ .querySelector(".page-locator-top")
|
|
|
|
+ .childNodes.forEach((item) => {
|
|
|
|
+ tops.push(this.getOffsetInfo(item));
|
|
|
|
+ });
|
|
|
|
|
|
|
|
+ let bottoms = [];
|
|
|
|
+ curPageDom
|
|
|
|
+ .querySelector(".page-locator-bottom")
|
|
|
|
+ .childNodes.forEach((item) => {
|
|
|
|
+ bottoms.push(this.getOffsetInfo(item));
|
|
|
|
+ });
|
|
return {
|
|
return {
|
|
top: tops,
|
|
top: tops,
|
|
bottom: bottoms,
|
|
bottom: bottoms,
|
|
@@ -206,9 +212,7 @@ export default {
|
|
main_number: null,
|
|
main_number: null,
|
|
sub_number: null,
|
|
sub_number: null,
|
|
options: [
|
|
options: [
|
|
- this.getOffsetInfo(
|
|
|
|
- document.getElementById("dynamic-miss-area")
|
|
|
|
- ),
|
|
|
|
|
|
+ this.getOffsetInfo(dom.querySelector(".dynamic-miss-area")),
|
|
],
|
|
],
|
|
recog_info: [],
|
|
recog_info: [],
|
|
},
|
|
},
|
|
@@ -227,9 +231,7 @@ export default {
|
|
main_number: null,
|
|
main_number: null,
|
|
sub_number: null,
|
|
sub_number: null,
|
|
options: [
|
|
options: [
|
|
- this.getOffsetInfo(
|
|
|
|
- document.getElementById("dynamic-breach-area")
|
|
|
|
- ),
|
|
|
|
|
|
+ this.getOffsetInfo(dom.querySelector(".dynamic-breach-area")),
|
|
],
|
|
],
|
|
recog_info: [],
|
|
recog_info: [],
|
|
},
|
|
},
|
|
@@ -243,14 +245,14 @@ export default {
|
|
barcode.push({
|
|
barcode.push({
|
|
field: "paperType",
|
|
field: "paperType",
|
|
area: this.getOffsetInfo(
|
|
area: this.getOffsetInfo(
|
|
- document.getElementById("dynamic-aorb-barcode")
|
|
|
|
|
|
+ dom.querySelector(".dynamic-aorb-barcode")
|
|
),
|
|
),
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
// fill_area
|
|
// fill_area
|
|
let options = [];
|
|
let options = [];
|
|
- document
|
|
|
|
- .getElementById("head-dynamic-aorb")
|
|
|
|
|
|
+ dom
|
|
|
|
+ .querySelector(".head-dynamic-aorb")
|
|
.querySelectorAll(".head-dynamic-rect")
|
|
.querySelectorAll(".head-dynamic-rect")
|
|
.forEach((optionItem, optionIndex) => {
|
|
.forEach((optionItem, optionIndex) => {
|
|
options[optionIndex] = this.getOffsetInfo(optionItem);
|
|
options[optionIndex] = this.getOffsetInfo(optionItem);
|