From 241255fbe2b6db3b2ed263f1e5a9956f5f9a0ee2 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 11 六月 2024 11:40:58 +0800
Subject: [PATCH] 考试管理
---
src/components/PopUp/single-choice.vue | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/src/components/PopUp/single-choice.vue b/src/components/PopUp/single-choice.vue
index ad7e191..7c35dd5 100644
--- a/src/components/PopUp/single-choice.vue
+++ b/src/components/PopUp/single-choice.vue
@@ -19,9 +19,9 @@
<el-form-item label="瑙f瀽锛�" prop="analyze" required>
<el-input v-model="form.analyze" @focus="inputClick(form,'analyze')" />
</el-form-item>
- <el-form-item label="鍒嗘暟锛�" prop="score" required>
+ <!-- <el-form-item label="鍒嗘暟锛�" prop="score" required>
<el-input-number v-model="form.score" :precision="1" :step="1" :max="100"></el-input-number>
- </el-form-item>
+ </el-form-item> -->
<el-form-item label="闅惧害锛�" required>
<el-rate v-model="form.difficult" class="question-item-rate"></el-rate>
</el-form-item>
@@ -53,7 +53,6 @@
<script>
import QuestionShow from '@/components/PopUp/question/Show'
import Ueditor from '@/components/Ueditor'
-import { mapGetters, mapState, mapActions } from 'vuex'
import questionApi from '@/api/question'
import subjectApi from '@/api/subject'
@@ -117,13 +116,20 @@
}
}
},
- created () {
- let id = this.$route.query.id
+ props: {
+ id: {
+ type: Number,
+ default: 0
+ }
+ },
+ created() {
+ this.getSubjects();
+ let id = this.id
let _this = this
if (id && parseInt(id) !== 0) {
_this.formLoading = true
questionApi.select(id).then(re => {
- _this.form = re.response
+ _this.form = re.data
_this.formLoading = false
})
}
@@ -175,9 +181,7 @@
questionApi.edit(this.form).then(re => {
if (re.code === 1) {
_this.$message.success(re.message)
- _this.delCurrentView(_this).then(() => {
- _this.$router.push('/exam/question/list')
- })
+ this.$emit('callback')
} else {
_this.$message.error(re.message)
this.formLoading = false
--
Gitblit v1.8.0