龚焕茏
2024-07-03 68b8ed3b4b7ddbb5fe113c1d7df3aa909dc66fb6
feat:新增随机时间题目配置
3个文件已修改
1个文件已添加
81 ■■■■■ 已修改文件
src/api/examPaper.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/personalRandomTemplate/config.vue 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/personalRandomTemplate/edit.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/examPaper.js
@@ -17,4 +17,6 @@
  mathList: query => post('/api/admin/exam/count/sourceList', query),
  uploadEnrolmentsa: query => down('/api/admin/exam/count/exportTemplatesSheet/'+query),
  selectStudent: query => post('/api/admin/exam/paper/selectStudent', query),
  getConfig: query => get('/api/admin/exam/templates/getConfig'),
  setConfig: query => post('/api/admin/exam/templates/setConfig', query),
}
src/router.js
@@ -176,6 +176,12 @@
        meta: { title: '随机试卷', noCache: true }
      },
      {
        path: 'personalRandomTemplate/config',
        component: () => import('@/views/exam/personalRandomTemplate/config'),
        name: 'personalSimulationConfig',
        meta: { title: '随机试卷配置', noCache: true }
      },
      {
        path: 'personalRandomTemplate/edit',
        component: () => import('@/views/exam/personalRandomTemplate/edit'),
        name: 'personalSimulationEdit',
src/views/exam/personalRandomTemplate/config.vue
New file
@@ -0,0 +1,69 @@
<template>
  <div class="app-container">
    <el-form :model="form" ref="form" label-width="100px">
      <el-form-item label="单选题" prop="radioNum" :rules="[
      { required: true, message: '单选题不能为空' },
      { type: 'number', message: '单选题必须为数字值' }
    ]">
        <el-input v-model.number="form.radioNum" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item label="多选题" prop="checkNum" :rules="[
      { required: true, message: '多选题不能为空' },
      { type: 'number', message: '多选题必须为数字值' }
    ]">
        <el-input v-model.number="form.checkNum" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item label="判断题" prop="judgingNum" :rules="[
      { required: true, message: '判断题不能为空' },
      { type: 'number', message: '判断题必须为数字值' }
    ]">
        <el-input v-model.number="form.judgingNum" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="submitForm('form')">提交</el-button>
        <el-button @click="resetForm('form')">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import Pagination from '@/components/Pagination'
import examPaperApi from '@/api/examPaper'
export default {
  components: { Pagination },
  data() {
    return {
      form: {
        radioNum: '',
        checkNum: '',
        judgingNum: ''
      }
    }
  },
  created() {
    examPaperApi.getConfig('').then(res => {
      if (res.response) this.form = res.response;
    })
  },
  methods: {
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          examPaperApi.setConfig(this.form).then(res => {
            if (res.code === 1) {
              this.$message.success('操作成功')
            } else {
              this.$message.error(res.message)
            }
          })
        }
      });
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    }
  }
}
</script>
src/views/exam/personalRandomTemplate/edit.vue
@@ -43,7 +43,7 @@
          </el-col>
        </el-row>
      </el-form-item>
      <el-form-item :key="item.subjectId" :label="item.label" required v-for="(item, key) in form.questionTypeVMS"
      <!-- <el-form-item :key="item.subjectId" :label="item.label" required v-for="(item, key) in form.questionTypeVMS"
        v-if="form.paperType == 7">
        <el-row>
          <el-col :span="3">
@@ -66,7 +66,7 @@
            <el-input v-model="form.questionTypeVMS[key].trueFalse" style="width: 80%" />
          </el-col>
        </el-row>
      </el-form-item>
      </el-form-item> -->
      <!--      <el-form-item label="总数分:" v-if="form.paperType==7"  prop="name" required>-->
      <!--        <el-input v-model="form.name"/>-->
      <!--      </el-form-item>-->