|
@@ -96,6 +96,8 @@ export default {
|
|
this.fieldData = {
|
|
this.fieldData = {
|
|
paperName: res.data.name,
|
|
paperName: res.data.name,
|
|
courseName: `${res.data.course.name}(${res.data.course.code})`,
|
|
courseName: `${res.data.course.name}(${res.data.course.code})`,
|
|
|
|
+ totalScore: res.data.totalScore,
|
|
|
|
+ rootOrgName: res.data.rootOrgName,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
async getPaperTempList() {
|
|
async getPaperTempList() {
|
|
@@ -115,11 +117,30 @@ export default {
|
|
: { pages: [] };
|
|
: { pages: [] };
|
|
this.paperTempJson = paperTempJson;
|
|
this.paperTempJson = paperTempJson;
|
|
this.pages = paperTempJson.pages;
|
|
this.pages = paperTempJson.pages;
|
|
|
|
+ this.updaterFieldInfo();
|
|
|
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.buildData();
|
|
this.buildData();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ updaterFieldInfo() {
|
|
|
|
+ const VALID_ELEMENTS_FOR_EXTERNAL = ["FIELD_TEXT"];
|
|
|
|
+ this.paperTempJson.pages.forEach((page) => {
|
|
|
|
+ page.columns.forEach((column) => {
|
|
|
|
+ column.elements.forEach((elem) => {
|
|
|
|
+ if (!elem.elements || !elem.elements.length) return;
|
|
|
|
+
|
|
|
|
+ elem.elements.forEach((element) => {
|
|
|
|
+ if (!VALID_ELEMENTS_FOR_EXTERNAL.includes(element.type)) return;
|
|
|
|
+
|
|
|
|
+ if (element.type === "FIELD_TEXT") {
|
|
|
|
+ element.content = this.fieldData[element.field];
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
async buildData() {
|
|
async buildData() {
|
|
this.maxColumnWidth = document.getElementById("column-0-0").offsetWidth;
|
|
this.maxColumnWidth = document.getElementById("column-0-0").offsetWidth;
|
|
this.maxColumnHeight = document.getElementById("column-0-0").offsetHeight;
|
|
this.maxColumnHeight = document.getElementById("column-0-0").offsetHeight;
|