| | |
| | | <div class="app-container"> |
| | | <el-form :model="form" ref="form" label-width="200px" v-loading="formLoading" :rules="rules"> |
| | | <el-form-item label="考生:" prop="menuIds" required> |
| | | <el-cascader v-model="form.menuIds" :options="options" :props="props" @change="handleChange" clearable collapse-tags> |
| | | </el-cascader> |
| | | <el-select v-model="form.menuIds" :collapse-tags="true" multiple placeholder="请选择" @focus="selectStudent"></el-select> |
| | | </el-form-item> |
| | | <el-form-item label="课目:" prop="subjectId" required> |
| | | <el-select ref="subjectIdRef" v-model="form.subjectId" placeholder="课目" multiple |
| | |
| | | <el-button type="primary" @click="confirmQuestionSelect">确定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <el-dialog :visible.sync="studentDialog" width="70%"> |
| | | <el-form :model="student" ref="queryForm" :inline="true"> |
| | | <el-form-item label="标签:"> |
| | | <el-select v-model="student.tagId" clearable> |
| | | <el-option v-for="item in tags" :key="item.id" :value="item.id" :label="item.name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="部门:"> |
| | | <el-select v-model="student.deptId" clearable> |
| | | <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> |
| | | <el-button type="primary" @click="selectStudent">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table v-loading="student.listLoading" :data="tableData" border fit highlight-current-row style="width: 100%" @selection-change="handleSelection"> |
| | | <el-table-column type="selection"></el-table-column> |
| | | <el-table-column prop="realName" label="用户"/> |
| | | </el-table> |
| | | <pagination v-show="total > 0" :total="total" |
| | | :page.sync="student.pageIndex" :limit.sync="student.pageSize" |
| | | @pagination="selectStudent"/> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="studentDialog = false">取 消</el-button> |
| | | <el-button type="primary" @click="confirmStudentSelect">确定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import examPaperApi from '@/api/examPaper' |
| | | import questionApi from '@/api/question' |
| | | import departmentApi from '@/api/department' |
| | | import userApi from '@/api/user' |
| | | |
| | | export default { |
| | | components: { Pagination, QuestionShow }, |
| | | data () { |
| | | return { |
| | | tags: [], |
| | | depts: [], |
| | | student: {}, |
| | | studentDialog: false, |
| | | student: { |
| | | pageIndex: 1, |
| | | pageSize: 100, |
| | | listLoading: true, |
| | | multipleSelection: [] |
| | | }, |
| | | tableData: [], |
| | | total: 0, |
| | | props: { |
| | | multiple: true |
| | | // lazy: true, |
| | | // lazyLoad (node, resolve) { |
| | | // console.log(node,"node"); |
| | | // var that = this; |
| | | // departmentApi.selectUser(node.value).then(re=>{ |
| | | // console.log(re,"re"); |
| | | // const nodes = re.response.map(xxx=>{ |
| | | // return {value: xxx.id,label: xxx.realName,leaf: node.level >= 1} |
| | | // }); |
| | | // resolve(nodes); |
| | | // }) |
| | | // } |
| | | }, |
| | | options: [], |
| | | departCascaderProps:{ |
| | |
| | | }, |
| | | subjectIdList:[], |
| | | form: { |
| | | menuIds: [], |
| | | aggregateSource:100, |
| | | id: null, |
| | | departmentIds: [], |
| | |
| | | }) |
| | | }, |
| | | methods: { |
| | | getTags () { |
| | | userApi.tagList(null).then(data => { |
| | | this.tags = data.response |
| | | }) |
| | | }, |
| | | selectStudent() { |
| | | this.getTags(); |
| | | this.studentDialog = true; |
| | | examPaperApi.selectStudent(this.student).then(res => { |
| | | this.tableData = res.response.list |
| | | this.total = res.response.total |
| | | this.student.listLoading = false |
| | | }) |
| | | }, |
| | | handleChange(val){ |
| | | console.log(val) |
| | | }, |
| | |
| | | if (this.subjectIdList.length == 1){ |
| | | this.form.subjectId= this.form.subjectId |
| | | }; |
| | | let op = []; |
| | | for(var ele of this.form.menuIds){ |
| | | op.push(ele[1]) |
| | | }; |
| | | // let op = []; |
| | | // for(var ele of this.form.menuIds){ |
| | | // op.push(ele[1]) |
| | | // }; |
| | | this.form.userIds = this.form.menuIds; |
| | | this.form.menuIds = JSON.stringify(this.form.menuIds); |
| | | this.form.userIds = op; |
| | | console.log("laks",this.form) |
| | | if(this.form.questionTypeVMS == null){ |
| | | this.form.questionTypeVMS = []; |
| | |
| | | }) |
| | | this.questionPage.showDialog = false |
| | | }, |
| | | confirmStudentSelect () { |
| | | this.student.multipleSelection.forEach(q => { |
| | | if(this.form.menuIds.some(obj => obj !== q.id)) { |
| | | this.form.menuIds.push(q.id) |
| | | } |
| | | }) |
| | | this.studentDialog = false |
| | | }, |
| | | levelChange () { |
| | | // this.form.subjectId = null |
| | | // this.subjectFilter = this.subjects.filter(data =>{ |
| | |
| | | handleSelectionChange (val) { |
| | | this.questionPage.multipleSelection = val |
| | | }, |
| | | handleSelection (val) { |
| | | this.student.multipleSelection = val |
| | | }, |
| | | questionTypeFormatter (row, column, cellValue, index) { |
| | | return this.enumFormat(this.questionTypeEnum, cellValue) |
| | | }, |