|
@@ -23,7 +23,7 @@
|
|
</div>
|
|
</div>
|
|
<div v-if="modalIsShow" class="area-container">
|
|
<div v-if="modalIsShow" class="area-container">
|
|
<area-cropper
|
|
<area-cropper
|
|
- v-for="(paper, index) in paperList"
|
|
|
|
|
|
+ v-for="(paper, index) in papers"
|
|
:imgUrl="paper.imgUrl"
|
|
:imgUrl="paper.imgUrl"
|
|
ref="AreaCropper"
|
|
ref="AreaCropper"
|
|
:key="paper.imgUrl"
|
|
:key="paper.imgUrl"
|
|
@@ -39,7 +39,6 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import AreaCropper from "./areaCropper/AreaCropper.vue";
|
|
import AreaCropper from "./areaCropper/AreaCropper.vue";
|
|
-import { examStructureFindJpg } from "../../api";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "modify-mark-area",
|
|
name: "modify-mark-area",
|
|
@@ -56,23 +55,30 @@ export default {
|
|
default() {
|
|
default() {
|
|
return {};
|
|
return {};
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ paperList: {
|
|
|
|
+ type: Array,
|
|
|
|
+ default() {
|
|
|
|
+ return [];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
modalIsShow: false,
|
|
modalIsShow: false,
|
|
- paperList: []
|
|
|
|
|
|
+ papers: []
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- mounted() {
|
|
|
|
- this.getPaperList();
|
|
|
|
- },
|
|
|
|
methods: {
|
|
methods: {
|
|
visibleChange() {
|
|
visibleChange() {
|
|
- this.paperList.forEach(paper => (paper.areas = []));
|
|
|
|
|
|
+ this.papers = this.paperList.map(paper => {
|
|
|
|
+ let npaper = { ...paper };
|
|
|
|
+ npaper.areas = [];
|
|
|
|
+ return npaper;
|
|
|
|
+ });
|
|
this.group.pictureConfigList.forEach(config => {
|
|
this.group.pictureConfigList.forEach(config => {
|
|
const index = config.i - 1;
|
|
const index = config.i - 1;
|
|
- this.paperList[index].areas.push({ ...config });
|
|
|
|
|
|
+ this.papers[index].areas.push({ ...config });
|
|
});
|
|
});
|
|
},
|
|
},
|
|
cancel() {
|
|
cancel() {
|
|
@@ -81,23 +87,8 @@ export default {
|
|
open() {
|
|
open() {
|
|
this.modalIsShow = true;
|
|
this.modalIsShow = true;
|
|
},
|
|
},
|
|
- async getPaperList() {
|
|
|
|
- const data = await examStructureFindJpg({
|
|
|
|
- examId: this.baseInfo.examId,
|
|
|
|
- courseCode: this.baseInfo.courseCode,
|
|
|
|
- paperNumber: this.baseInfo.paperNumber
|
|
|
|
- });
|
|
|
|
- const papers = data || [];
|
|
|
|
- papers.sort((a, b) => a.index - b.index);
|
|
|
|
- this.paperList = papers.map(paper => {
|
|
|
|
- return {
|
|
|
|
- imgUrl: paper.path,
|
|
|
|
- areas: []
|
|
|
|
- };
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
areaChange(index, areas) {
|
|
areaChange(index, areas) {
|
|
- this.paperList[index].areas = areas;
|
|
|
|
|
|
+ this.papers[index].areas = areas;
|
|
},
|
|
},
|
|
cropperCurareaChange(area) {
|
|
cropperCurareaChange(area) {
|
|
this.$refs.AreaCropper.forEach(cropper => {
|
|
this.$refs.AreaCropper.forEach(cropper => {
|
|
@@ -106,7 +97,7 @@ export default {
|
|
},
|
|
},
|
|
confirm() {
|
|
confirm() {
|
|
let areas = [];
|
|
let areas = [];
|
|
- this.paperList.forEach((paper, pindex) => {
|
|
|
|
|
|
+ this.papers.forEach((paper, pindex) => {
|
|
if (!paper.areas.length) return;
|
|
if (!paper.areas.length) return;
|
|
paper.areas.forEach(area => {
|
|
paper.areas.forEach(area => {
|
|
let narea = { i: pindex + 1 };
|
|
let narea = { i: pindex + 1 };
|