|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<el-dialog
|
|
<el-dialog
|
|
- class="card-build-dialog"
|
|
+ class="card-build-dialog opacity-dialog"
|
|
:visible.sync="modalIsShow"
|
|
:visible.sync="modalIsShow"
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
:close-on-press-escape="false"
|
|
:close-on-press-escape="false"
|
|
@@ -11,7 +11,11 @@
|
|
>
|
|
>
|
|
<div slot="title"></div>
|
|
<div slot="title"></div>
|
|
<div slot="footer"></div>
|
|
<div slot="footer"></div>
|
|
- <div v-loading="loading" element-loading-text="拼命加载中"></div>
|
|
+ <div
|
|
|
|
+ class="loading-tips"
|
|
|
|
+ v-loading="loading"
|
|
|
|
+ element-loading-text="生成题卡中"
|
|
|
|
+ ></div>
|
|
|
|
|
|
<div
|
|
<div
|
|
v-if="modalIsShow"
|
|
v-if="modalIsShow"
|
|
@@ -66,7 +70,7 @@
|
|
<script>
|
|
<script>
|
|
import { mapState, mapMutations, mapActions } from "vuex";
|
|
import { mapState, mapMutations, mapActions } from "vuex";
|
|
import { saveCard, cardConfigInfos } from "../api";
|
|
import { saveCard, cardConfigInfos } from "../api";
|
|
-import { tikuPaperDetail } from "../../exam/api";
|
|
+// import { tikuPaperDetail } from "../../exam/api";
|
|
import { getPaperJsonSimpleStructInfo } from "../autoBuild/paperStruct";
|
|
import { getPaperJsonSimpleStructInfo } from "../autoBuild/paperStruct";
|
|
import { buildCardFromPaperSimpleStruct } from "../autoBuild/simplePaperCard";
|
|
import { buildCardFromPaperSimpleStruct } from "../autoBuild/simplePaperCard";
|
|
// card components
|
|
// card components
|
|
@@ -74,6 +78,8 @@ import { getCardHeadModel } from "../../../../card/elementModel";
|
|
import TopicElementPreview from "../../../../card/components/TopicElementPreview";
|
|
import TopicElementPreview from "../../../../card/components/TopicElementPreview";
|
|
import CardView from "../../../../card/components/CardView";
|
|
import CardView from "../../../../card/components/CardView";
|
|
import CardHeadSample from "../../../../card/elements/card-head/CardHead";
|
|
import CardHeadSample from "../../../../card/elements/card-head/CardHead";
|
|
|
|
+// ceshi
|
|
|
|
+import paperData from "./paper.json";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "CardBuild",
|
|
name: "CardBuild",
|
|
@@ -122,17 +128,17 @@ export default {
|
|
this.setCardConfig(cardConfig);
|
|
this.setCardConfig(cardConfig);
|
|
|
|
|
|
// 试卷信息
|
|
// 试卷信息
|
|
- const res = await tikuPaperDetail(this.presetData.paperId).catch(
|
|
+ // const res = await tikuPaperDetail(this.presetData.paperId).catch(
|
|
- () => {}
|
|
+ // () => {}
|
|
- );
|
|
+ // );
|
|
- if (!res) {
|
|
+ // if (!res) {
|
|
- this.emitResult({ success: false, message: "试卷内容获取失败" });
|
|
+ // this.emitResult({ success: false, message: "试卷内容获取失败" });
|
|
- return;
|
|
+ // return;
|
|
- }
|
|
+ // }
|
|
|
|
+ const res = paperData;
|
|
// 构建题卡
|
|
// 构建题卡
|
|
try {
|
|
try {
|
|
const paperSimpleStruct = getPaperJsonSimpleStructInfo(res);
|
|
const paperSimpleStruct = getPaperJsonSimpleStructInfo(res);
|
|
- console.log(paperSimpleStruct);
|
|
|
|
const elementTypePreSetInfo = {
|
|
const elementTypePreSetInfo = {
|
|
FILL_QUESTION: {
|
|
FILL_QUESTION: {
|
|
pageSize: "A3",
|
|
pageSize: "A3",
|
|
@@ -146,6 +152,7 @@ export default {
|
|
this.setTopics([getCardHeadModel(this.cardConfig), ...elements]);
|
|
this.setTopics([getCardHeadModel(this.cardConfig), ...elements]);
|
|
this.resetTopicSeries();
|
|
this.resetTopicSeries();
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
|
+ console.dir(error);
|
|
this.emitResult({
|
|
this.emitResult({
|
|
success: false,
|
|
success: false,
|
|
message: error.message || "数据构建错误",
|
|
message: error.message || "数据构建错误",
|
|
@@ -214,13 +221,14 @@ export default {
|
|
const result = await saveCard(datas).catch((error) => {
|
|
const result = await saveCard(datas).catch((error) => {
|
|
this.emitResult({
|
|
this.emitResult({
|
|
success: false,
|
|
success: false,
|
|
- data: error.message || "保存题卡错误",
|
|
+ message: error.message || "保存题卡错误",
|
|
});
|
|
});
|
|
});
|
|
});
|
|
if (!result) return;
|
|
if (!result) return;
|
|
this.emitResult({ success: true, data: result });
|
|
this.emitResult({ success: true, data: result });
|
|
},
|
|
},
|
|
emitResult(data) {
|
|
emitResult(data) {
|
|
|
|
+ console.log(data);
|
|
this.loading = false;
|
|
this.loading = false;
|
|
this.$emit("confirm", data);
|
|
this.$emit("confirm", data);
|
|
this.cancel();
|
|
this.cancel();
|