| | |
| | | <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" @change="cascaderChangeFun" :props="props" clearable collapse-tags>--> |
| | | <!-- </el-cascader>--> |
| | | <all-cascader :options="options" |
| | | :optionsData = "optionsData" |
| | | @change="cascaderChangeFun" |
| | | :width="200"></all-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 Pagination from '@/components/Pagination' |
| | | import QuestionShow from '../question/components/Show' |
| | | import examPaperApi from '@/api/examPaper' |
| | | import userApi from '@/api/user' |
| | | import questionApi from '@/api/question' |
| | | import departmentApi from '@/api/department' |
| | | import allCascader from '@/components/Cascader' |
| | |
| | | |
| | | data () { |
| | | return { |
| | | tags: [], |
| | | depts: [], |
| | | student: {}, |
| | | studentDialog: false, |
| | | student: { |
| | | pageIndex: 1, |
| | | pageSize: 5, |
| | | listLoading: true, |
| | | multipleSelection: [] |
| | | }, |
| | | tableData: [], |
| | | total: 0, |
| | | props: { |
| | | multiple: true |
| | | // lazy: true, |
| | |
| | | // this.subjectIdEvent(false) |
| | | }, |
| | | methods: { |
| | | handleSelection (val) { |
| | | this.student.multipleSelection = val |
| | | }, |
| | | confirmStudentSelect () { |
| | | this.student.multipleSelection.forEach(q => { |
| | | this.form.menuIds.push(q.id) |
| | | }) |
| | | this.studentDialog = false |
| | | }, |
| | | 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 |
| | | }) |
| | | }, |
| | | cascaderChangeFun(event){ |
| | | console.log(event) |
| | | this.form.menuIds = event |