|
@@ -9,11 +9,21 @@ import { mapState } from "vuex";
|
|
|
import { CARD_VERSION } from "../enumerate";
|
|
|
import { deepCopy } from "@/plugins/utils";
|
|
|
|
|
|
+const initIndex = {
|
|
|
+ question: 1,
|
|
|
+ absent: 1,
|
|
|
+ paperType: 1,
|
|
|
+ examNumber: 1,
|
|
|
+ selective: 1
|
|
|
+};
|
|
|
+
|
|
|
export default {
|
|
|
name: "save-page",
|
|
|
data() {
|
|
|
return {
|
|
|
- fillAreaIndex: 0,
|
|
|
+ fillAreaIndex: {
|
|
|
+ ...initIndex
|
|
|
+ },
|
|
|
VALID_ELEMENTS_FOR_EXTERNAL: [
|
|
|
"LOCATOR",
|
|
|
"BARCODE",
|
|
@@ -29,8 +39,8 @@ export default {
|
|
|
...mapState("card", ["pages", "cardConfig", "paperParams"])
|
|
|
},
|
|
|
methods: {
|
|
|
- getFillAreaIndex() {
|
|
|
- return this.fillAreaIndex++;
|
|
|
+ getFillAreaIndex(type) {
|
|
|
+ return this.fillAreaIndex[type]++;
|
|
|
},
|
|
|
getElementHumpName(cont) {
|
|
|
return cont
|
|
@@ -68,7 +78,7 @@ export default {
|
|
|
page.exchange = exchange;
|
|
|
});
|
|
|
|
|
|
- this.fillAreaIndex = 0;
|
|
|
+ this.fillAreaIndex = { ...initIndex };
|
|
|
|
|
|
return pages;
|
|
|
},
|
|
@@ -123,7 +133,7 @@ export default {
|
|
|
|
|
|
fill_area.push({
|
|
|
field: "examNumber",
|
|
|
- index: this.getFillAreaIndex(),
|
|
|
+ index: this.getFillAreaIndex("examNumber"),
|
|
|
single: true,
|
|
|
horizontal: false,
|
|
|
items: listInfos
|
|
@@ -139,16 +149,16 @@ export default {
|
|
|
if (element.missAndFill && !element.isSimple) {
|
|
|
fill_area.push({
|
|
|
field: "absent",
|
|
|
- index: this.getFillAreaIndex(),
|
|
|
+ index: this.getFillAreaIndex("absent"),
|
|
|
single: true,
|
|
|
horizontal: true,
|
|
|
items: [
|
|
|
{
|
|
|
main_number: null,
|
|
|
sub_number: null,
|
|
|
- options: this.getOffsetInfo(
|
|
|
- document.getElementById("dynamic-miss-area")
|
|
|
- )
|
|
|
+ options: [
|
|
|
+ this.getOffsetInfo(document.getElementById("dynamic-miss-area"))
|
|
|
+ ]
|
|
|
}
|
|
|
]
|
|
|
});
|
|
@@ -174,7 +184,7 @@ export default {
|
|
|
});
|
|
|
fill_area.push({
|
|
|
field: "paperType",
|
|
|
- index: this.getFillAreaIndex(),
|
|
|
+ index: this.getFillAreaIndex("paperType"),
|
|
|
single: true,
|
|
|
horizontal: true,
|
|
|
items: [
|
|
@@ -189,7 +199,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
- info_area: headArea,
|
|
|
+ info_area: [headArea],
|
|
|
fill_area,
|
|
|
barcode
|
|
|
};
|
|
@@ -219,7 +229,7 @@ export default {
|
|
|
});
|
|
|
fillAreas.push({
|
|
|
field: "question",
|
|
|
- index: this.getFillAreaIndex(),
|
|
|
+ index: this.getFillAreaIndex("question"),
|
|
|
single,
|
|
|
horizontal,
|
|
|
items: listInfos
|
|
@@ -264,7 +274,7 @@ export default {
|
|
|
fill_area: [
|
|
|
{
|
|
|
field: "question",
|
|
|
- index: this.getFillAreaIndex(),
|
|
|
+ index: this.getFillAreaIndex("question"),
|
|
|
single: true,
|
|
|
horizontal: element.optionDirection === "horizontal",
|
|
|
items: listInfos
|