|
@@ -23,6 +23,7 @@
|
|
|
:key="tab.val"
|
|
|
size="medium"
|
|
|
:type="curTab == tab.val ? 'primary' : 'default'"
|
|
|
+ :disabled="!basicInfoIsSave && tab.val !== 'structure'"
|
|
|
@click="selectMenu(tab.val)"
|
|
|
>{{ tab.name }}
|
|
|
</el-button>
|
|
@@ -41,7 +42,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { mapMutations } from "vuex";
|
|
|
+import { mapState, mapMutations } from "vuex";
|
|
|
import MarkParamStructure from "./MarkParamStructure.vue";
|
|
|
import MarkParamMarker from "./MarkParamMarker.vue";
|
|
|
import MarkParamMarkerLeader from "./MarkParamMarkerLeader.vue";
|
|
@@ -99,6 +100,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
+ ...mapState("markParam", ["markParamInfos"]),
|
|
|
currentComponent() {
|
|
|
return `mark-param-${this.curTab}`;
|
|
|
},
|
|
@@ -111,6 +113,9 @@ export default {
|
|
|
lastStep() {
|
|
|
return this.tabs.length - 1;
|
|
|
},
|
|
|
+ basicInfoIsSave() {
|
|
|
+ return !!this.markParamInfos.basicPaperInfo.id;
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
curTab() {
|
|
@@ -128,6 +133,11 @@ export default {
|
|
|
async initData() {
|
|
|
this.initStore();
|
|
|
|
|
|
+ const basicPaperInfo = {
|
|
|
+ ...this.instance,
|
|
|
+ openClassReading: !!this.instance.openClassReading,
|
|
|
+ };
|
|
|
+
|
|
|
if (this.instance.paperInfoJson) {
|
|
|
const { paperStructureInfo, groupInfo, classInfo, structureCanEdit } =
|
|
|
JSON.parse(this.instance.paperInfoJson);
|
|
@@ -139,13 +149,13 @@ export default {
|
|
|
],
|
|
|
groupInfo: groupInfo || [],
|
|
|
classInfo: classInfo || [],
|
|
|
- basicPaperInfo: this.instance,
|
|
|
+ basicPaperInfo,
|
|
|
};
|
|
|
this.setMarkParamInfos(infos);
|
|
|
} else {
|
|
|
const detData = await cardDetail(this.instance.cardId);
|
|
|
const cardContent = JSON.parse(detData.content);
|
|
|
- let infos = { basicPaperInfo: this.instance };
|
|
|
+ let infos = { basicPaperInfo };
|
|
|
if (
|
|
|
(detData.type === "GENERIC" && detData.createMethod === "STANDARD") ||
|
|
|
detData.type === "CUSTOM"
|
|
@@ -176,7 +186,10 @@ export default {
|
|
|
this.dataReady = true;
|
|
|
},
|
|
|
async updateMarkStatus() {
|
|
|
- const res = await examStructureStatus(this.instance.id).catch(() => {});
|
|
|
+ if (!this.markParamInfos.basicPaperInfo.id) return;
|
|
|
+ const res = await examStructureStatus(
|
|
|
+ this.markParamInfos.basicPaperInfo.id
|
|
|
+ ).catch(() => {});
|
|
|
if (!res) return;
|
|
|
|
|
|
const data = JSON.parse(res);
|