| | |
| | | <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 () { |
| | |
| | | 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 |
| | | |
| | | } |
| | | }) |
| | | } |
| | |
| | | _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 |
| | | }) |
| | | } |
| | |
| | | _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 |
| | | }) |
| | | } |
| | |
| | | _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 |
| | | }) |
| | | } |
| | |
| | | }) |
| | | 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 |
| | | }) |
| | | } |
| | |
| | | _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 |
| | | }) |
| | | } |
| | |
| | | </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">--> |
| | | <!--<!– <span>{{this.subjectIdFormatte}}</span>–>--> |
| | | <!-- <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"/> |
| | |
| | | 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) |
| | | }, |