odc.xiaohui
2023-06-14 0010df4254d5c49dcdd68ce19ec5e856df62ab7b
修改部门数据
7个文件已修改
58 ■■■■■ 已修改文件
src/App.vue 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/question/edit/gap-filling.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/question/edit/multiple-choice.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/question/edit/short-answer.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/question/edit/single-choice.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/question/edit/true-false.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/question/list.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/App.vue
@@ -7,11 +7,17 @@
<script>
import { mapGetters, mapState, mapActions } from 'vuex'
import departmentApi from '@/api/department'
import enumItem from '@/store/modules/enumItem'
export default {
  name: 'App',
  data(){
    return{
      depart:[]
      depart:[],
      queryParam: {
        level: null,
        pageIndex: 1,
        pageSize: 100
      },
    }
  },
  created () {
@@ -26,12 +32,19 @@
    this.seachPageDepartMentList()
  },
  methods:{
    seachPageDepartMentList(){
    async seachPageDepartMentList () {
      let that = this
      departmentApi.pageList(this.queryParam).then(res=>{
      await departmentApi.pageList(this.queryParam).then(res => {
        console.log(res)
        if (res.code == 1){
        if (res.code == 1) {
          that.depart = res.response.list
          console.log(that.depart)
          this.depart.map(item=>{
            item.key = item.id
            item.value = item.name
          })
          enumItem.state.user.levelEnum = that.depart
        }
      })
    }
src/views/exam/question/edit/gap-filling.vue
@@ -124,6 +124,10 @@
      _this.formLoading = true
      questionApi.select(id).then(re => {
        _this.form = re.response
        _this.form.subjectIds = []
        _this.form.questionSubjects.forEach(item=>{
          _this.form.subjectIds.push(item.subjectId)
        })
        _this.formLoading = false
      })
    }
src/views/exam/question/edit/multiple-choice.vue
@@ -139,6 +139,10 @@
      _this.formLoading = true
      questionApi.select(id).then(re => {
        _this.form = re.response
        _this.form.subjectIds = []
        _this.form.questionSubjects.forEach(item=>{
          _this.form.subjectIds.push(item.subjectId)
        })
        _this.formLoading = false
      })
    }
src/views/exam/question/edit/short-answer.vue
@@ -123,6 +123,10 @@
      _this.formLoading = true
      questionApi.select(id).then(re => {
        _this.form = re.response
        _this.form.subjectIds = []
        _this.form.questionSubjects.forEach(item=>{
          _this.form.subjectIds.push(item.subjectId)
        })
        _this.formLoading = false
      })
    }
src/views/exam/question/edit/single-choice.vue
@@ -136,8 +136,13 @@
    })
    if (id && parseInt(id) !== 0) {
      _this.formLoading = true
      questionApi.select(id).then(re => {
        _this.form = re.response
        _this.form.subjectIds = []
        _this.form.questionSubjects.forEach(item=>{
          _this.form.subjectIds.push(item.subjectId)
        })
        _this.formLoading = false
      })
    }
src/views/exam/question/edit/true-false.vue
@@ -135,6 +135,10 @@
      _this.formLoading = true
      questionApi.select(id).then(re => {
        _this.form = re.response
        _this.form.subjectIds = []
        _this.form.questionSubjects.forEach(item=>{
          _this.form.subjectIds.push(item.subjectId)
        })
        _this.formLoading = false
      })
    }
src/views/exam/question/list.vue
@@ -36,7 +36,13 @@
    </el-form>
    <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%">
      <el-table-column prop="id" label="Id" width="90px"/>
      <el-table-column prop="subjectId" label="课目" :formatter="subjectFormatter" width="120px"/>
      <el-table-column prop="subjectId" label="课目" :formatter="subjectIdFormatte" width="120px"/>
<!--      <el-table-column prop="subjectId" label="课目">-->
<!--        <template slot-scope="scope">-->
<!--&lt;!&ndash;          <span>{{this.subjectIdFormatte}}</span>&ndash;&gt;-->
<!--          <span>{{scope.row.questionSubjects.forEach(item=>{ return item.subName})}}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
      <el-table-column prop="questionType" label="题型" :formatter="questionTypeFormatter" width="70px"/>
      <el-table-column prop="shortTitle" label="题干" show-overflow-tooltip/>
      <el-table-column prop="score" label="分数" width="60px"/>
@@ -142,6 +148,14 @@
    questionTypeFormatter (row, column, cellValue, index) {
      return this.enumFormat(this.questionType, cellValue)
    },
    subjectIdFormatte(row, column, cellValue, index){
      console.log(row, column, cellValue, index)
      let str = ''
      row.questionSubjects.forEach(item=>{
        str+=item.subName+','
      })
      return str = str.slice(0,str.length-1)
    },
    subjectFormatter (row, column, cellValue, index) {
      return this.subjectEnumFormat(cellValue)
    },