ZhangXianQiang
2024-05-17 caf356587e08608be27dc25e7cc63c9b191d9aa5
src/views/exam/paper/edit.vue
@@ -12,6 +12,11 @@
                     :label="item.name+' '"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="部门:" prop="deptId" required>
        <el-select v-model="form.deptId" collapse-tags placeholder="部门">
          <el-option v-for="item in depts" :key="item.id" :value="item.id" :label="item.name"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="试卷类型:" prop="paperType" required>
        <el-select v-model="form.paperType" placeholder="试卷类型"  @visible-change="subjectIdEvent">
          <el-option v-for="item in paperTypeEnum" :key="item.key" :value="item.key" :label="item.value" ></el-option>
@@ -135,6 +140,7 @@
  components: { Pagination, QuestionShow },
  data () {
    return {
      depts: [],
      props: {
        multiple: true
        // lazy: true,
@@ -177,6 +183,9 @@
        ],
        subjectId: [
          { required: true, message: '请选择课目', trigger: 'change' }
          ],
        deptId: [
          { required: true, message: '请选择部门', trigger: 'change' }
        ],
        paperType: [
          { required: true, message: '请选择试卷类型', trigger: 'change' }
@@ -224,6 +233,9 @@
      console.log("res",res);
      _this.options = res.response.map(x=>{return{value:x.department.id,label:x.department.name,children:x.userList.map(xx=>{return{value: xx.id,label: xx.realName}})}})
    })
    departmentApi.getDeptAdmins().then(res => {
      this.depts = res.response
    })
  },
  methods: {
@@ -340,6 +352,7 @@
      })
    },
    addQuestion (titleItem) {
      console.log('titleItem', titleItem)
      this.currentTitleItem = titleItem
      this.questionPage.showDialog = true
      this.search()
@@ -358,7 +371,9 @@
      let _this = this
      this.questionPage.multipleSelection.forEach(q => {
        questionApi.select(q.id).then(re => {
          _this.currentTitleItem.questionItems.push(re.response)
          if (!_this.currentTitleItem.questionItems.some(obj => obj.id === re.response.id)) {
            _this.currentTitleItem.questionItems.push(re.response)
          }
        })
      })
      this.questionPage.showDialog = false