|
@@ -1,222 +1,95 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
|
- <a-spin :spinning="formLoading" tip="加载中...">
|
|
|
|
|
- <a-form :model="form" ref="formRef" label-width="100px" :rules="rules">
|
|
|
|
|
- <a-form-item label="年级:" prop="gradeLevel" required>
|
|
|
|
|
- <a-select v-model:value="form.gradeLevel" placeholder="年级" :options="gradeLevelOptions" clearable />
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- <a-form-item label="学科:" prop="subjectId" required>
|
|
|
|
|
- <a-select v-model:value="form.subjectId" placeholder="学科" :options="susbjectOptions" />
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- <a-form-item label="题干:" prop="title" required>
|
|
|
|
|
- <a-input v-model="form.title" @focus="inputClick(form,'title')" />
|
|
|
|
|
- <xn-editor v-model:value="form.title" :height="150"/>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- <a-form-item label="选项:" required>
|
|
|
|
|
- <a-form-item :key="item.prefix" v-for="(item, index) in form.items" label-width="50px" class="question-item-label">
|
|
|
|
|
- <template #label>
|
|
|
|
|
- {{ item.prefix }}
|
|
|
|
|
- </template>
|
|
|
|
|
- <a-input v-model:value="item.prefix" style="width:50px;" />
|
|
|
|
|
- <a-button type="primary" danger class="question-item-remove" @click="questionItemRemove(index)">删除</a-button>
|
|
|
|
|
- <xn-editor v-model:value="item.content" :height="100"/>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- <a-form-item label="解析:" prop="analyze" required>
|
|
|
|
|
- <xn-editor v-model:value="form.analyze" :height="150"/>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- <a-form-item label="分数:" prop="score" required>
|
|
|
|
|
- <a-input-number v-model:value="form.score" :precision="1" :step="1" :max="100" />
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- <a-form-item label="难度:" required>
|
|
|
|
|
- <a-rate v-model:value="form.difficult" class="question-item-rate" />
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- <a-form-item label="正确答案:" prop="correct" required>
|
|
|
|
|
- <a-radio-group v-model:value="form.correct">
|
|
|
|
|
- <a-radio v-for="item in form.items" :key="item.prefix" :value="item.prefix">{{ item.prefix }}</a-radio>
|
|
|
|
|
- </a-radio-group>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- <a-form-item>
|
|
|
|
|
- <a-button type="primary" @click="submitForm" style="margin-right: 10px;">提交</a-button>
|
|
|
|
|
- <a-button @click="resetForm" style="margin-right: 10px;">重置</a-button>
|
|
|
|
|
- <a-button type="success" @click="questionItemAdd" style="margin-right: 10px;">添加选项</a-button>
|
|
|
|
|
- <a-button type="success" @click="showQuestion">预览</a-button>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- </a-form>
|
|
|
|
|
- </a-spin>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <a-form :model="form" ref="formRef" :rules="rules" layout="vertical">
|
|
|
|
|
+ <a-form-item label="年级:" name="gradeLevel" required>
|
|
|
|
|
+ <a-select v-model:value="form.gradeLevel" placeholder="年级" @change="levelChange">
|
|
|
|
|
+ <a-select-option v-for="item in levelEnum" :key="item.key" :value="item.key">
|
|
|
|
|
+ {{ item.value }}
|
|
|
|
|
+ </a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item label="学科:" name="subjectId" required>
|
|
|
|
|
+ <a-select v-model:value="form.subjectId" placeholder="学科">
|
|
|
|
|
+ <a-select-option v-for="item in subjectFilter" :key="item.id" :value="item.id">
|
|
|
|
|
+ {{ item.name + ' ( ' + item.levelName + ' )' }}
|
|
|
|
|
+ </a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item label="题干:" name="title" required>
|
|
|
|
|
+ <a-input v-model:value="form.title" readonly @click="inputClick(form, 'title')" />
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item label="选项:" required>
|
|
|
|
|
+ <div v-for="(item, index) in form.items" :key="item.prefix" class="question-item-label">
|
|
|
|
|
+ <a-input v-model:value="item.prefix" style="width: 50px; margin-right: 8px" />
|
|
|
|
|
+ <a-input
|
|
|
|
|
+ v-model:value="item.content"
|
|
|
|
|
+ readonly
|
|
|
|
|
+ @click="inputClick(item, 'content')"
|
|
|
|
|
+ class="question-item-content-input"
|
|
|
|
|
+ style="width: 60%"
|
|
|
|
|
+ />
|
|
|
|
|
+ <a-button danger size="small" class="question-item-remove" @click="questionItemRemove(index)">删除</a-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item label="解析:" name="analyze" required>
|
|
|
|
|
+ <a-input v-model:value="form.analyze" readonly @click="inputClick(form, 'analyze')" />
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item label="分数:" name="score" required>
|
|
|
|
|
+ <a-input-number v-model:value="form.score" :precision="1" :step="1" :max="100" />
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item label="难度:" required>
|
|
|
|
|
+ <a-rate v-model:value="form.difficult" class="question-item-rate" />
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item label="正确答案:" name="correct" required>
|
|
|
|
|
+ <a-radio-group v-model:value="form.correct">
|
|
|
|
|
+ <a-radio v-for="item in form.items" :value="item.prefix" :key="item.prefix">{{ item.prefix }}</a-radio>
|
|
|
|
|
+ </a-radio-group>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item>
|
|
|
|
|
+ <a-button type="primary" @click="submitForm" :loading="formLoading">提交</a-button>
|
|
|
|
|
+ <a-button @click="resetForm">重置</a-button>
|
|
|
|
|
+ <a-button type="success" @click="questionItemAdd">添加选项</a-button>
|
|
|
|
|
+ <a-button type="success" @click="showQuestion">预览</a-button>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-form>
|
|
|
<a-modal
|
|
<a-modal
|
|
|
v-model:visible="richEditor.dialogVisible"
|
|
v-model:visible="richEditor.dialogVisible"
|
|
|
|
|
+ width="800px"
|
|
|
:footer="null"
|
|
:footer="null"
|
|
|
- :body-style="{ padding: '0' }"
|
|
|
|
|
- :width="800"
|
|
|
|
|
|
|
+ :closable="false"
|
|
|
centered
|
|
centered
|
|
|
destroy-on-close
|
|
destroy-on-close
|
|
|
>
|
|
>
|
|
|
- <Ueditor @ready="editorReady"/>
|
|
|
|
|
- <a-button type="primary" @click="editorConfirm">确 定</a-button>
|
|
|
|
|
- <a-button @click="richEditor.dialogVisible = false">取 消</a-button>
|
|
|
|
|
|
|
+ <Editor v-model="richEditorContent" :height="300" />
|
|
|
|
|
+ <div style="text-align: right; margin-top: 16px">
|
|
|
|
|
+ <a-button type="primary" @click="editorConfirm">确定</a-button>
|
|
|
|
|
+ <a-button @click="richEditor.dialogVisible = false">取消</a-button>
|
|
|
|
|
+ </div>
|
|
|
</a-modal>
|
|
</a-modal>
|
|
|
-
|
|
|
|
|
- <a-modal
|
|
|
|
|
- v-model:visible="questionShow.dialog"
|
|
|
|
|
- :footer="null"
|
|
|
|
|
- :body-style="{ padding: '0' }"
|
|
|
|
|
- :width="800"
|
|
|
|
|
- centered
|
|
|
|
|
- destroy-on-close
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <a-modal v-model:visible="questionShow.dialog" width="800px" :footer="null" :bodyStyle="{ padding: '24px' }">
|
|
|
<QuestionShow :qType="questionShow.qType" :question="questionShow.question" :qLoading="questionShow.loading" />
|
|
<QuestionShow :qType="questionShow.qType" :question="questionShow.question" :qLoading="questionShow.loading" />
|
|
|
</a-modal>
|
|
</a-modal>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref, reactive, onMounted } from 'vue'
|
|
|
|
|
-import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
-import questionApi from '@/api/question/tQuestionApi'
|
|
|
|
|
-import QuestionShow from '@/views/exm/question/components/Show.vue'
|
|
|
|
|
-import tool from "@/utils/tool"
|
|
|
|
|
-import XnEditor from '@/components/Editor/index.vue'
|
|
|
|
|
-import Ueditor from '@/components/Ueditor/index.vue'
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-const route = useRoute()
|
|
|
|
|
-const router = useRouter()
|
|
|
|
|
-
|
|
|
|
|
-const formLoading = ref(false)
|
|
|
|
|
-// 表单引用
|
|
|
|
|
-const formRef = ref()
|
|
|
|
|
-
|
|
|
|
|
-// 数据初始化
|
|
|
|
|
-const form = ref({
|
|
|
|
|
- id: null,
|
|
|
|
|
- questionType: 1,
|
|
|
|
|
- gradeLevel: null,
|
|
|
|
|
- subjectId: null,
|
|
|
|
|
- title: '',
|
|
|
|
|
- items: [
|
|
|
|
|
- { prefix: 'A', content: '' },
|
|
|
|
|
- { prefix: 'B', content: '' },
|
|
|
|
|
- { prefix: 'C', content: '' },
|
|
|
|
|
- { prefix: 'D', content: '' }
|
|
|
|
|
- ],
|
|
|
|
|
- analyze: '',
|
|
|
|
|
- correct: '',
|
|
|
|
|
- score: '',
|
|
|
|
|
- difficult: 0
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
-const richEditor = reactive({
|
|
|
|
|
- dialogVisible: false,
|
|
|
|
|
- object: null,
|
|
|
|
|
- parameterName: '',
|
|
|
|
|
- instance: null
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
-const questionShow = reactive({
|
|
|
|
|
- qType: 0,
|
|
|
|
|
- dialog: false,
|
|
|
|
|
- question: null,
|
|
|
|
|
- loading: false
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
-const gradeLevelOptions = tool.dictList('SEMESTER')
|
|
|
|
|
-const susbjectOptions = tool.dictList('SUBJECT')
|
|
|
|
|
-const subjectFilter = ref(null)
|
|
|
|
|
-
|
|
|
|
|
-// 校验规则
|
|
|
|
|
-const rules = {
|
|
|
|
|
- gradeLevel: [{ required: true, message: '请选择年级', trigger: 'change' }],
|
|
|
|
|
- subjectId: [{ required: true, message: '请选择学科', trigger: 'change' }],
|
|
|
|
|
- title: [{ required: true, message: '请输入题干', trigger: 'blur' }],
|
|
|
|
|
- analyze: [{ required: true, message: '请输入解析', trigger: 'blur' }],
|
|
|
|
|
- score: [{ required: true, message: '请输入分数', trigger: 'blur' }],
|
|
|
|
|
- correct: [{ required: true, message: '请选择正确答案', trigger: 'change' }]
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 生命周期:组件挂载时处理路由参数
|
|
|
|
|
-onMounted(() => {
|
|
|
|
|
- const id = route.query.id
|
|
|
|
|
- if (id && parseInt(id) !== 0) {
|
|
|
|
|
- formRef.value?.resetFields()
|
|
|
|
|
- questionApi.select(id).then(re => {
|
|
|
|
|
- Object.assign(form, re.response)
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
-// 方法定义
|
|
|
|
|
-
|
|
|
|
|
-function editorReady(instance) {
|
|
|
|
|
- richEditor.instance = instance
|
|
|
|
|
- let currentContent = richEditor.object[richEditor.parameterName]
|
|
|
|
|
- richEditor.instance.setContent(currentContent)
|
|
|
|
|
- richEditor.instance.focus(true)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-function inputClick(object, parameterName) {
|
|
|
|
|
- // 获取当前聚焦的元素并移除焦点
|
|
|
|
|
- const activeElement = document.activeElement
|
|
|
|
|
- if (activeElement && typeof activeElement.blur === 'function') {
|
|
|
|
|
- activeElement.blur()
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- richEditor.object = object
|
|
|
|
|
- richEditor.parameterName = parameterName
|
|
|
|
|
- richEditor.dialogVisible = true
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-function editorConfirm() {
|
|
|
|
|
- console.log(richEditor)
|
|
|
|
|
- let content = richEditor.instance.getContent()
|
|
|
|
|
- richEditor.object[richEditor.parameterName] = content
|
|
|
|
|
- richEditor.dialogVisible = false
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-function questionItemRemove(index) {
|
|
|
|
|
- form.value.items.splice(index, 1)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-function questionItemAdd() {
|
|
|
|
|
- const items = form.value.items
|
|
|
|
|
- let newLastPrefix
|
|
|
|
|
- console.log('last', items)
|
|
|
|
|
- if (items.length > 0) {
|
|
|
|
|
- let last = items[items.length - 1]
|
|
|
|
|
- newLastPrefix = String.fromCharCode(last.prefix.charCodeAt() + 1)
|
|
|
|
|
- } else {
|
|
|
|
|
- newLastPrefix = 'A'
|
|
|
|
|
- }
|
|
|
|
|
- items.push({ id: null, prefix: newLastPrefix, content: '' })
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-function submitForm() {
|
|
|
|
|
- formRef.value.validate().then(valid => {
|
|
|
|
|
- if (valid) {
|
|
|
|
|
- formLoading.value = true
|
|
|
|
|
- questionApi.edit(form).then(re => {
|
|
|
|
|
- if (re.code === 1) {
|
|
|
|
|
- store.dispatch('tagsView/delCurrentView').then(() => {
|
|
|
|
|
- router.push('/exam/question/list')
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- }).catch(e => {
|
|
|
|
|
- console.error(e)
|
|
|
|
|
- }).finally(() => {
|
|
|
|
|
- formLoading.value = false
|
|
|
|
|
- })
|
|
|
|
|
- } else {
|
|
|
|
|
- return false
|
|
|
|
|
|
|
+ import { ref, reactive, computed, onMounted } from 'vue'
|
|
|
|
|
+ import { message } from 'ant-design-vue'
|
|
|
|
|
+ import { useExamStore } from '@/store/exam'
|
|
|
|
|
+ import tQuestionApi from '@/api/exam/question/tQuestionApi'
|
|
|
|
|
+ import QuestionShow from '../components/Show.vue'
|
|
|
|
|
+ import Editor from '@/components/Editor/index.vue'
|
|
|
|
|
+
|
|
|
|
|
+ const examStore = useExamStore()
|
|
|
|
|
+ const props = defineProps({
|
|
|
|
|
+ id: {
|
|
|
|
|
+ type: Number,
|
|
|
|
|
+ default: 0
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-function resetForm() {
|
|
|
|
|
- const lastId = form.id
|
|
|
|
|
- formRef.value.resetFields()
|
|
|
|
|
- Object.assign(form, {
|
|
|
|
|
|
|
+ const emit = defineEmits(['successful'])
|
|
|
|
|
+ const formRef = ref()
|
|
|
|
|
+ const form = reactive({
|
|
|
id: null,
|
|
id: null,
|
|
|
questionType: 1,
|
|
questionType: 1,
|
|
|
gradeLevel: null,
|
|
gradeLevel: null,
|
|
@@ -233,47 +106,144 @@ function resetForm() {
|
|
|
score: '',
|
|
score: '',
|
|
|
difficult: 0
|
|
difficult: 0
|
|
|
})
|
|
})
|
|
|
- form.id = lastId
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-function showQuestion() {
|
|
|
|
|
- questionShow.dialog = true
|
|
|
|
|
- questionShow.qType = form.value.questionType
|
|
|
|
|
- console.log(form)
|
|
|
|
|
- console.log(questionShow)
|
|
|
|
|
- questionShow.question = form.value
|
|
|
|
|
- form.value.items.forEach((item, index) => {
|
|
|
|
|
- console.log(`选项 ${item.prefix} 的内容:`, item.content)
|
|
|
|
|
|
|
+ const subjectFilter = ref([])
|
|
|
|
|
+ const formLoading = ref(false)
|
|
|
|
|
+ const rules = {
|
|
|
|
|
+ gradeLevel: [{ required: true, message: '请选择年级', trigger: 'change' }],
|
|
|
|
|
+ subjectId: [{ required: true, message: '请选择学科', trigger: 'change' }],
|
|
|
|
|
+ title: [{ required: true, message: '请输入题干', trigger: 'blur' }],
|
|
|
|
|
+ analyze: [{ required: true, message: '请输入解析', trigger: 'blur' }],
|
|
|
|
|
+ score: [{ required: true, message: '请输入分数', trigger: 'blur' }],
|
|
|
|
|
+ correct: [{ required: true, message: '请选择正确答案', trigger: 'change' }]
|
|
|
|
|
+ }
|
|
|
|
|
+ const richEditor = reactive({
|
|
|
|
|
+ dialogVisible: false,
|
|
|
|
|
+ object: null,
|
|
|
|
|
+ parameterName: '',
|
|
|
|
|
+ instance: null
|
|
|
})
|
|
})
|
|
|
-}
|
|
|
|
|
-</script>
|
|
|
|
|
|
|
+ const richEditorContent = ref('')
|
|
|
|
|
+ const questionShow = reactive({
|
|
|
|
|
+ qType: 0,
|
|
|
|
|
+ dialog: false,
|
|
|
|
|
+ question: null,
|
|
|
|
|
+ loading: false
|
|
|
|
|
+ })
|
|
|
|
|
+ const levelEnum = computed(() => examStore.levelEnum)
|
|
|
|
|
+ const subjects = computed(() => examStore.subjects)
|
|
|
|
|
+
|
|
|
|
|
+ onMounted(async () => {
|
|
|
|
|
+ await examStore.initSubject()
|
|
|
|
|
+ subjectFilter.value = subjects.value
|
|
|
|
|
+ const id = props.id
|
|
|
|
|
+ if (id && parseInt(id) !== 0) {
|
|
|
|
|
+ formLoading.value = true
|
|
|
|
|
+ tQuestionApi.select(id).then((re) => {
|
|
|
|
|
+ Object.assign(form, re)
|
|
|
|
|
+ formLoading.value = false
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ function inputClick(object, parameterName) {
|
|
|
|
|
+ richEditor.object = object
|
|
|
|
|
+ richEditor.parameterName = parameterName
|
|
|
|
|
+ richEditorContent.value = object[parameterName] || ''
|
|
|
|
|
+ richEditor.dialogVisible = true
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function editorConfirm() {
|
|
|
|
|
+ richEditor.object[richEditor.parameterName] = richEditorContent.value
|
|
|
|
|
+ richEditor.dialogVisible = false
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function questionItemRemove(index) {
|
|
|
|
|
+ form.items.splice(index, 1)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function questionItemAdd() {
|
|
|
|
|
+ const items = form.items
|
|
|
|
|
+ let newLastPrefix
|
|
|
|
|
+ if (items.length > 0) {
|
|
|
|
|
+ let last = items[items.length - 1]
|
|
|
|
|
+ newLastPrefix = String.fromCharCode(last.prefix.charCodeAt() + 1)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ newLastPrefix = 'A'
|
|
|
|
|
+ }
|
|
|
|
|
+ items.push({ prefix: newLastPrefix, content: '' })
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-<style scoped>
|
|
|
|
|
-.question-item-label {
|
|
|
|
|
- margin-top: 10px;
|
|
|
|
|
- margin-bottom: 10px !important;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ function submitForm() {
|
|
|
|
|
+ formRef.value.validate().then((valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ formLoading.value = true
|
|
|
|
|
+ tQuestionApi
|
|
|
|
|
+ .edit(form)
|
|
|
|
|
+ .then((re) => {
|
|
|
|
|
+ emit('successful')
|
|
|
|
|
+ formLoading.value = false
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ formLoading.value = false
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-.question-item-remove {
|
|
|
|
|
- margin-left: 20px;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ function resetForm() {
|
|
|
|
|
+ const lastId = form.id
|
|
|
|
|
+ formRef.value.resetFields()
|
|
|
|
|
+ Object.assign(form, {
|
|
|
|
|
+ id: null,
|
|
|
|
|
+ questionType: 1,
|
|
|
|
|
+ gradeLevel: null,
|
|
|
|
|
+ subjectId: null,
|
|
|
|
|
+ title: '',
|
|
|
|
|
+ items: [
|
|
|
|
|
+ { prefix: 'A', content: '' },
|
|
|
|
|
+ { prefix: 'B', content: '' },
|
|
|
|
|
+ { prefix: 'C', content: '' },
|
|
|
|
|
+ { prefix: 'D', content: '' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ analyze: '',
|
|
|
|
|
+ correct: '',
|
|
|
|
|
+ score: '',
|
|
|
|
|
+ difficult: 0
|
|
|
|
|
+ })
|
|
|
|
|
+ form.id = lastId
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-.question-item-content-input {
|
|
|
|
|
- margin-left: 8px;
|
|
|
|
|
- width: 60%;
|
|
|
|
|
- height: 20px;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ function levelChange() {
|
|
|
|
|
+ form.subjectId = null
|
|
|
|
|
+ subjectFilter.value = subjects.value.filter((data) => data.level === form.gradeLevel)
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-.question-item-span {
|
|
|
|
|
- vertical-align: middle;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- color: #606266;
|
|
|
|
|
- font-weight: 700;
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
- margin-left: 10px;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ function showQuestion() {
|
|
|
|
|
+ questionShow.dialog = true
|
|
|
|
|
+ questionShow.qType = form.questionType
|
|
|
|
|
+ questionShow.question = { ...form }
|
|
|
|
|
+ }
|
|
|
|
|
+</script>
|
|
|
|
|
|
|
|
-.question-item-rate {
|
|
|
|
|
- line-height: 2.5;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
|
+ .app-container {
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ padding: 24px;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .question-item-label {
|
|
|
|
|
+ margin-top: 10px;
|
|
|
|
|
+ margin-bottom: 10px !important;
|
|
|
|
|
+ }
|
|
|
|
|
+ .question-item-remove {
|
|
|
|
|
+ margin-left: 20px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .question-item-content-input {
|
|
|
|
|
+ margin-left: 8px;
|
|
|
|
|
+ width: 60%;
|
|
|
|
|
+ height: 20px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .question-item-rate {
|
|
|
|
|
+ line-height: 2.5;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|