parent
3df0023d16
commit
d79c0d0cbb
14 changed files with 1165 additions and 688 deletions
@ -0,0 +1,268 @@ |
||||
<template> |
||||
<div class="page"> |
||||
<h6 class="page-name">筛选</h6> |
||||
<div class="tool"> |
||||
<ul class="filter"> |
||||
<li> |
||||
<label>评阅时间</label> |
||||
<el-radio-group v-model="filter.month"> |
||||
<el-radio v-for="(item, index) in dateList" :key="index" :label="item.id" border>{{ item.name |
||||
}}</el-radio> |
||||
</el-radio-group> |
||||
<el-date-picker class="m-l-10" v-model="date" align="right" unlink-panels type="daterange" |
||||
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" |
||||
clearable></el-date-picker> |
||||
</li> |
||||
<li> |
||||
<label>评阅阶段</label> |
||||
<el-select v-model="filter.reviewStage" clearable placeholder="请选择评阅阶段" @change="initData"> |
||||
<el-option v-for="(item, i) in reviewStage" :key="i" :label="item.name" :value="item.id"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>评阅情况</label> |
||||
<el-select v-model="filter.reviewStatus" clearable placeholder="请选择评阅情况" @change="initData"> |
||||
<el-option v-for="(item, i) in reviewStatus" :key="i" :label="item.name" :value="item.id"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>任务分配情况</label> |
||||
<el-select v-model="filter.taskAllocationStatus" clearable placeholder="请选择任务分配情况" @change="initData"> |
||||
<el-option v-for="(item, i) in taskAllocationStatus" :key="i" :label="item.name" |
||||
:value="item.id"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>搜索</label> |
||||
<el-input style="width: 300px;" placeholder="请输入大赛名称、阶段赛名称、比赛内容" prefix-icon="el-icon-search" |
||||
v-model="filter.keyWord" clearable /> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
|
||||
<el-table :data="list" class="table" ref="table" stripe header-align="center" row-key="id"> |
||||
<el-table-column type="index" width="50" label="序号" align="center"></el-table-column> |
||||
<el-table-column prop="competitionName" label="大赛名称" align="center" min-width="120" |
||||
show-overflow-tooltip></el-table-column> |
||||
<el-table-column prop="stageName" label="阶段赛名称" align="center" min-width="100"></el-table-column> |
||||
<el-table-column prop="competitionContent" label="比赛内容" align="center" min-width="100"></el-table-column> |
||||
<el-table-column prop="lastEditor" label="分配答卷数" align="center" width="90"></el-table-column> |
||||
<el-table-column prop="lastEditor" label="待评答卷数" align="center" width="90"></el-table-column> |
||||
<el-table-column prop="lastEditor" label="已评答卷数" align="center" width="90"></el-table-column> |
||||
<el-table-column prop="lastEditor" label="评阅时间" align="center" width="90"></el-table-column> |
||||
<el-table-column prop="lastEditor" label="评阅阶段" align="center" width="90"></el-table-column> |
||||
<el-table-column prop="lastEditor" label="评阅情况" align="center" width="90"></el-table-column> |
||||
<el-table-column label="操作" align="center" width="200" fixed="right"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="toProgress(scope.row)">评阅进度</el-button> |
||||
<el-button type="text" @click="toSetup(scope.row)">评阅设置</el-button> |
||||
<el-button type="text" @click="toTask(scope.row)">任务分配</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" |
||||
:total="total"></el-pagination> |
||||
</div> |
||||
|
||||
<Setup :visible.sync="setupVisible" /> |
||||
<Progress :visible.sync="progressVisible" /> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Setup from './setup' |
||||
import Progress from './progress' |
||||
import Util from '@/libs/util' |
||||
import Setting from '@/setting' |
||||
import Const from '@/const/ques' |
||||
import Qs from 'qs' |
||||
import dayjs from 'dayjs' |
||||
export default { |
||||
components: { Setup, Progress }, |
||||
data () { |
||||
return { |
||||
difficults: Const.difficults, |
||||
questionTypes: Const.questionTypes, |
||||
loading: false, |
||||
dateList: [ |
||||
{ |
||||
id: '', |
||||
name: '全部' |
||||
}, |
||||
{ |
||||
id: 0, |
||||
name: '不限时' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '近一个月' |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '近三个月' |
||||
}, |
||||
{ |
||||
id: 6, |
||||
name: '近六个月' |
||||
} |
||||
], |
||||
reviewStage: [ |
||||
{ |
||||
id: 0, |
||||
name: '未开始' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '进行中' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '已完成' |
||||
}, |
||||
], |
||||
reviewStatus: [ |
||||
{ |
||||
id: 0, |
||||
name: '未完成' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '已完成' |
||||
}, |
||||
], |
||||
taskAllocationStatus: [ |
||||
{ |
||||
id: 0, |
||||
name: '未完成' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '已完成' |
||||
}, |
||||
], |
||||
date: [], |
||||
filter: { |
||||
month: '', |
||||
startTime: '', |
||||
endTime: '', |
||||
reviewStage: '', |
||||
reviewStatus: '', |
||||
taskAllocationStatus: '', |
||||
keyWord: '', |
||||
}, |
||||
list: [], |
||||
page: +this.$route.query.page || 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
|
||||
setupVisible: false, |
||||
progressVisible: false, |
||||
}; |
||||
}, |
||||
watch: { |
||||
'filter.month': function (val) { |
||||
if (val) { |
||||
let unit = 24 * 60 * 60 * 1000 |
||||
this.date = [dayjs(new Date(Date.now() - unit * 30 * val)).format('YYYY-MM-DD'), dayjs(new Date(Date.now() + unit)).format('YYYY-MM-DD')] |
||||
} else { |
||||
this.date = [] |
||||
} |
||||
}, |
||||
date: function (val) { |
||||
if (val) { |
||||
this.filter.startTime = val[0]; |
||||
this.filter.endTime = val[1]; |
||||
} else { |
||||
this.filter.startTime = '' |
||||
this.filter.endTime = '' |
||||
} |
||||
this.initData() |
||||
}, |
||||
'filter.keyWord': function () { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(this.initData, 500) |
||||
}, |
||||
}, |
||||
mounted () { |
||||
const { query } = this.$route |
||||
if (query.page) { |
||||
const { questionTypes, correctRateEnd, correctRateStart, difficultys, specialtyIds, status, keyWord, questionTypeSort, givenYearSort, difficultySort, correctRateSort, updateTimeSort, referenceCountSort, givenYears, knowledgePointIds, questionBankId, questionBankName, questionBankCategory } = query |
||||
this.filter = { |
||||
questionTypes: questionTypes ? questionTypes.split(',') : [], |
||||
correctRateEnd: correctRateEnd || '', |
||||
correctRateStart: correctRateStart || '', |
||||
difficultys: difficultys ? difficultys.split(',') : [], |
||||
specialtyIds: specialtyIds ? specialtyIds.split(',').map(e => +e) : [], |
||||
status: status ? +status : '', |
||||
keyWord: keyWord || '', |
||||
questionTypeSort: questionTypeSort || '', |
||||
givenYearSort: givenYearSort || '', |
||||
difficultySort: difficultySort || '', |
||||
correctRateSort: correctRateSort || '', |
||||
updateTimeSort: updateTimeSort || '', |
||||
referenceCountSort: referenceCountSort || '', |
||||
} |
||||
this.givenYears = givenYears || '' |
||||
this.knowledgePointIds = knowledgePointIds ? JSON.parse(knowledgePointIds) : [] |
||||
|
||||
this.$router.push(`/myReview?questionBankId=${questionBankId}&questionBankName=${questionBankName}&questionBankCategory=${questionBankCategory}`).catch(() => { }) |
||||
} |
||||
|
||||
this.initData() |
||||
}, |
||||
methods: { |
||||
async getList () { |
||||
const { pageList } = await this.$post(this.api.reviewSettingsList, { |
||||
...this.filter, |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
platformSource: 0, |
||||
}) |
||||
this.list = pageList.records |
||||
this.total = pageList.total |
||||
}, |
||||
// 切换页码 |
||||
currentChange (val) { |
||||
this.page = val |
||||
this.getList() |
||||
}, |
||||
initData () { |
||||
this.$refs.table.clearSelection() |
||||
this.page = 1 |
||||
this.getList() |
||||
}, |
||||
|
||||
// 评阅进度 |
||||
toProgress (row) { |
||||
this.progressVisible = true |
||||
}, |
||||
// 设置 |
||||
toSetup (row) { |
||||
this.setupVisible = true |
||||
}, |
||||
// 任务分配 |
||||
toTask (row) { |
||||
this.$router.push(`task`) |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.tool { |
||||
margin-bottom: 0; |
||||
|
||||
.filter { |
||||
flex-wrap: wrap; |
||||
|
||||
li { |
||||
margin-bottom: 15px; |
||||
} |
||||
|
||||
/deep/.el-radio { |
||||
margin-right: 0; |
||||
} |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,152 @@ |
||||
<template> |
||||
<div> |
||||
<el-drawer :with-header="false" :visible.sync="progressVisible" size="1200px" :close-on-click-modal="false" |
||||
custom-class="pro-dia" @closed="closeDia"> |
||||
<div class="wrap"> |
||||
<el-tabs v-model="curTab" @tab-click="tabChange"> |
||||
<el-tab-pane label="评阅统计" name="progress"></el-tab-pane> |
||||
<el-tab-pane label="评阅日志" name="log"></el-tab-pane> |
||||
</el-tabs> |
||||
|
||||
<div class="tool"> |
||||
<ul class="filter"> |
||||
<li> |
||||
<label>评阅情况</label> |
||||
<el-select v-model="filter.difficult" placeholder="请选择评阅情况" @change="difficultChange"> |
||||
<el-option v-for="(item, i) in difficults" :key="i" :label="item.name" :value="item.id"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>搜索</label> |
||||
<el-input placeholder="请输入评阅人" prefix-icon="el-icon-search" v-model="filter.keyword" clearable /> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
|
||||
<el-table :data="list" stripe header-align="center" row-key="libraryId"> |
||||
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
||||
<el-table-column prop="name" label="评阅人" align="center" min-width="90"></el-table-column> |
||||
<el-table-column prop="name" label="分配答卷" align="center" min-width="90"></el-table-column> |
||||
<el-table-column prop="name" label="分配人工判分题" align="center" min-width="90"></el-table-column> |
||||
<el-table-column prop="name" label="待评阅答卷" align="center" min-width="90"></el-table-column> |
||||
<el-table-column prop="name" label="已评阅答卷" align="center" min-width="90"></el-table-column> |
||||
<el-table-column prop="name" label="评阅情况" align="center" min-width="90"></el-table-column> |
||||
<el-table-column label="评阅进度" align="center" width="90"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="showProgress(scope.row)">查看</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background @current-change="currentChange" :current-page="page" |
||||
layout="total, prev, pager, next" :total="total"></el-pagination> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="btns"> |
||||
<el-button type="primary" @click="progressVisible = false">关闭</el-button> |
||||
</div> |
||||
</el-drawer> |
||||
|
||||
<Detail :visible.sync="detailVisible" /> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import Detail from './progressDetail' |
||||
import Setting from '@/setting' |
||||
import Util from '@/libs/util' |
||||
import _ from 'lodash' |
||||
export default { |
||||
props: ['visible'], |
||||
components: { Detail }, |
||||
data () { |
||||
return { |
||||
progressVisible: false, |
||||
curTab: 'progress', |
||||
difficults: [], |
||||
filter: { |
||||
month: '', |
||||
keyword: '', |
||||
}, |
||||
searchTimer: null, |
||||
list: [{}], |
||||
page: 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
|
||||
detailVisible: false, |
||||
}; |
||||
}, |
||||
watch: { |
||||
'filter.keyword': function (val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(this.getKnowledge, 500) |
||||
}, |
||||
visible () { |
||||
this.progressVisible = this.visible |
||||
// this.visible && this.init() |
||||
} |
||||
}, |
||||
mounted () { |
||||
|
||||
}, |
||||
methods: { |
||||
// 初始化 |
||||
init () { |
||||
this.initList() |
||||
}, |
||||
// tab切换回调 |
||||
async tabChange () { |
||||
|
||||
}, |
||||
// 获取题库 |
||||
async getList () { |
||||
try { |
||||
const type = this.quesBankTypeVal |
||||
const res = await this.$post(this.api.questionBankList, { |
||||
status: 1, |
||||
pageNum: 1, |
||||
pageSize: 1000, |
||||
questionCategoryId: type.length ? type[type.length - 1] : '', |
||||
name: this.quesBankKeyword |
||||
}) |
||||
this.quesBanks = res.message.records |
||||
this.totalQuesBank = res.message.total |
||||
} catch (e) { } |
||||
}, |
||||
initList () { |
||||
this.page = 1 |
||||
this.getList() |
||||
}, |
||||
// 切换页码 |
||||
currentChange (val) { |
||||
this.page = val |
||||
this.getList() |
||||
}, |
||||
// 查看评阅进度 |
||||
showProgress (row) { |
||||
this.detailVisible = true |
||||
}, |
||||
// 弹框关闭回调 |
||||
closeDia () { |
||||
this.$emit('update:visible', false) |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
/deep/.pro-dia { |
||||
.el-drawer__header { |
||||
margin-bottom: 20px; |
||||
} |
||||
|
||||
.wrap { |
||||
padding: 20px; |
||||
} |
||||
|
||||
.el-tabs__item:focus.is-active.is-focus:not(:active) { |
||||
box-shadow: none; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,203 @@ |
||||
<template> |
||||
<div> |
||||
<el-drawer title="xx的评阅进度" :visible.sync="progressVisible" size="1000px" :close-on-click-modal="false" |
||||
custom-class="detail-dia" @closed="closeDia"> |
||||
<div class="wrap"> |
||||
<el-tabs v-model="curTab" @tab-click="tabChange"> |
||||
<el-tab-pane label="待评阅" name="progress"></el-tab-pane> |
||||
<el-tab-pane label="已评阅" name="log"></el-tab-pane> |
||||
</el-tabs> |
||||
|
||||
<div class="tool"> |
||||
<ul class="filter"> |
||||
<li> |
||||
<label>省份</label> |
||||
<el-select v-model="filter.provinceId" clearable placeholder="请选择省份" @change="provinceChange" |
||||
@clear="clearprovince"> |
||||
<el-option v-for="(item, i) in provinces" :key="i" :label="item.provinceName" |
||||
:value="item.provinceId"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>城市</label> |
||||
<el-select v-model="filter.cityId" clearable placeholder="请选择城市" :disabled="!filter.provinceId" |
||||
@clear="clearcity" @change="getSchool"> |
||||
<el-option v-for="(item, i) in cities" :key="i" :label="item.cityName" :value="item.cityId"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>学校</label> |
||||
<el-select v-model="filter.schoolId" clearable filterable placeholder="请选择学校" :disabled="!filter.cityId" |
||||
@change="initData"> |
||||
<el-option v-for="(item, index) in schools" :key="index" :label="item.schoolName" |
||||
:value="item.schoolId"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>搜索</label> |
||||
<el-input style="width: 300px;" placeholder="请输入学生姓名、学生学号、团队名称" prefix-icon="el-icon-search" |
||||
v-model="filter.keyword" clearable /> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
|
||||
<el-table :data="list" stripe header-align="center" row-key="libraryId"> |
||||
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
||||
<el-table-column prop="name" label="省份" align="center" min-width="90"></el-table-column> |
||||
<el-table-column prop="name" label="城市" align="center" min-width="90"></el-table-column> |
||||
<el-table-column prop="name" label="学生所在院校" align="center" min-width="90"></el-table-column> |
||||
<el-table-column prop="name" label="团队名称" align="center" min-width="90"></el-table-column> |
||||
<el-table-column prop="name" label="学生姓名" align="center" min-width="90"></el-table-column> |
||||
<el-table-column prop="name" label="学号" align="center" min-width="90"></el-table-column> |
||||
<el-table-column prop="name" label="答卷ID" align="center" min-width="90"></el-table-column> |
||||
<el-table-column prop="name" label="最新评阅时间" align="center" min-width="90"></el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background @current-change="currentChange" :current-page="page" |
||||
layout="total, prev, pager, next" :total="total"></el-pagination> |
||||
</div> |
||||
</div> |
||||
</el-drawer> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import Setting from '@/setting' |
||||
import Util from '@/libs/util' |
||||
import _ from 'lodash' |
||||
export default { |
||||
props: ['visible'], |
||||
data () { |
||||
return { |
||||
progressVisible: false, |
||||
curTab: 'progress', |
||||
difficults: [], |
||||
provinces: [], |
||||
cities: [], |
||||
schools: [], |
||||
filter: { |
||||
month: '', |
||||
keyword: '', |
||||
}, |
||||
searchTimer: null, |
||||
list: [], |
||||
page: 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
|
||||
submiting: false, |
||||
}; |
||||
}, |
||||
watch: { |
||||
'filter.keyword': function (val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(this.getKnowledge, 500) |
||||
}, |
||||
visible () { |
||||
this.progressVisible = this.visible |
||||
// this.visible && this.init() |
||||
} |
||||
}, |
||||
mounted () { |
||||
|
||||
}, |
||||
methods: { |
||||
// 初始化 |
||||
init () { |
||||
this.getProvince() |
||||
this.initList() |
||||
}, |
||||
// tab切换回调 |
||||
async tabChange () { |
||||
|
||||
}, |
||||
// 获取题库 |
||||
async getList () { |
||||
try { |
||||
const type = this.quesBankTypeVal |
||||
const res = await this.$post(this.api.questionBankList, { |
||||
status: 1, |
||||
pageNum: 1, |
||||
pageSize: 1000, |
||||
questionCategoryId: type.length ? type[type.length - 1] : '', |
||||
name: this.quesBankKeyword |
||||
}) |
||||
this.quesBanks = res.message.records |
||||
this.totalQuesBank = res.message.total |
||||
} catch (e) { } |
||||
}, |
||||
initList () { |
||||
this.page = 1 |
||||
this.getList() |
||||
}, |
||||
// 切换页码 |
||||
currentChange (val) { |
||||
this.page = val |
||||
this.getList() |
||||
}, |
||||
|
||||
// 获取省份 |
||||
async getProvince () { |
||||
if (!this.provinces.length) { |
||||
const { list } = await this.$get(this.api.queryProvince) |
||||
this.provinces = list |
||||
} |
||||
}, |
||||
// 清除省份 |
||||
clearprovince () { |
||||
this.filter.cityId = '', |
||||
this.filter.schoolId = '' |
||||
}, |
||||
// 省份选择回调 |
||||
provinceChange () { |
||||
this.clearprovince() |
||||
this.getCity() |
||||
this.initData() |
||||
}, |
||||
// 获取城市 |
||||
async getCity () { |
||||
const { list } = await this.$get(this.api.queryCity, { |
||||
provinceId: this.filter.provinceId |
||||
}) |
||||
this.cities = list |
||||
}, |
||||
// 清除城市 |
||||
clearcity () { |
||||
this.filter.schoolId = '' |
||||
}, |
||||
// 城市选择回调 |
||||
cityChange () { |
||||
this.filter.schoolId = '' |
||||
this.getSchool() |
||||
this.initData() |
||||
}, |
||||
// 获取学校 |
||||
async getSchool () { |
||||
const { list } = await this.$get(this.api.querySchool, { |
||||
provinceId: this.filter.provinceId, |
||||
cityId: this.filter.cityId, |
||||
}) |
||||
this.schools = list |
||||
}, |
||||
// 弹框关闭回调 |
||||
closeDia () { |
||||
this.$emit('update:visible', false) |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
/deep/.detail-dia { |
||||
.el-drawer__header { |
||||
margin-bottom: 0; |
||||
} |
||||
|
||||
.wrap { |
||||
padding: 10px 20px; |
||||
} |
||||
|
||||
.el-tabs__item:focus.is-active.is-focus:not(:active) { |
||||
box-shadow: none; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,501 @@ |
||||
<template> |
||||
<div> |
||||
<el-drawer title="评阅设置" :visible.sync="setupVisible" size="1200px" :close-on-click-modal="false" |
||||
custom-class="setup-dia" @closed="closeDia"> |
||||
<div class="flex h-full"> |
||||
<el-form :model="form" ref="form" label-width="220px" label-suffix=":"> |
||||
<el-form-item prop="name" label="是否隐藏学生信息"> |
||||
<el-radio-group v-model="form.hide"> |
||||
<el-radio :label="3">是</el-radio> |
||||
<el-radio :label="6">否</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
<el-form-item prop="name" label="自动判分题是否允许人工评阅"> |
||||
<el-radio-group v-model="form.hide"> |
||||
<el-radio :label="3">是</el-radio> |
||||
<el-tooltip placement="top"> |
||||
<div slot="content">自动判分题最终得分取最新一次评分</div> |
||||
<i class="el-icon-question explain"></i> |
||||
</el-tooltip> |
||||
<el-radio :label="6">否</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
<el-form-item prop="name" label="评阅的时间限制"> |
||||
<el-radio-group v-model="form.hide"> |
||||
<el-radio :label="3">不限时</el-radio> |
||||
<el-tooltip placement="top"> |
||||
<div slot="content">成绩不公布时,可设置评阅时间不限时</div> |
||||
<i class="el-icon-question explain"></i> |
||||
</el-tooltip> |
||||
<el-radio :label="6">限时</el-radio> |
||||
</el-radio-group> |
||||
<el-date-picker class="m-l-10" v-model="date" align="right" unlink-panels type="datetimerange" |
||||
start-placeholder="开始日期" end-placeholder="结束日期" clearable></el-date-picker> |
||||
</el-form-item> |
||||
<el-form-item prop="name" label="每题的评阅人数"> |
||||
<el-input style="width: 200px;" placeholder="请输入" v-model.number="form.suggestTime" /> 人 |
||||
</el-form-item> |
||||
<el-form-item prop="name" label="最终得分取值规则(人工判分题多人评阅时)"> |
||||
<el-radio-group v-model="form.hide"> |
||||
<el-radio :label="1">取平均分</el-radio> |
||||
<el-radio :label="1">取修剪平均分</el-radio> |
||||
<el-tooltip placement="top"> |
||||
<div slot="content"> |
||||
<p>去掉最高分、最低分,取平均分</p> |
||||
<p class="m-t-5 m-b-5">1.建议评阅人员≥3人;</p> |
||||
<p class="m-b-5">2.若评阅人员为2人,则最终得分为2人评分的平均值;</p> |
||||
<p>3.若评阅人员为1人,则最终得分为评阅人的评分;</p> |
||||
</div> |
||||
<i class="el-icon-question explain"></i> |
||||
</el-tooltip> |
||||
<el-radio :label="1">取加权平均分</el-radio> |
||||
<el-tooltip placement="top"> |
||||
<div slot="content">每位评阅人员的最新评分乘以其对应的权重后求和</div> |
||||
<i class="el-icon-question explain"></i> |
||||
</el-tooltip> |
||||
<el-radio :label="1">取中位分</el-radio> |
||||
<el-radio :label="1">取最高分</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
</el-form> |
||||
|
||||
<el-form class="info" label-width="120px" label-suffix=":" disabled> |
||||
<h6>答卷信息</h6> |
||||
<el-form-item prop="name" label="答卷信息"> |
||||
<el-radio-group v-model="form.hide"> |
||||
<el-radio v-for="(item, i) in types" :key="i" label="item.id">{{ item.name }}</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
<el-form-item prop="name" label="题目判分类型"> |
||||
<el-checkbox-group v-model="form.type"> |
||||
<el-checkbox label="自动判分题"></el-checkbox> |
||||
<el-checkbox label="人工判分题"></el-checkbox> |
||||
</el-checkbox-group> |
||||
</el-form-item> |
||||
<el-form-item prop="name" label="成绩是否公布"> |
||||
<el-radio-group v-model="form.hide"> |
||||
<el-radio :label="3">是</el-radio> |
||||
<span style="margin: 0 10px 0 -20px;font-size: 12px;color: #333;">公布时间:2024-12-12 12:12:12</span> |
||||
<el-radio style="margin-top: 10px" :label="6">否</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
</el-form> |
||||
</div> |
||||
|
||||
<div class="btns"> |
||||
<el-button @click="setupVisible = false">取消</el-button> |
||||
<el-button type="primary" :loading="submiting" @click="submit">保存</el-button> |
||||
</div> |
||||
</el-drawer> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import Setting from '@/setting' |
||||
import Util from '@/libs/util' |
||||
import QuesConst from '@/const/ques' |
||||
import TestPaperConst from '@/const/testPaper' |
||||
import _ from 'lodash' |
||||
import Decimal from 'decimal.js' |
||||
export default { |
||||
props: ['visible'], |
||||
data () { |
||||
return { |
||||
arabicToChinese: Util.arabicToChinese, |
||||
difficults: TestPaperConst.difficults, |
||||
questionTypes: QuesConst.questionTypes, |
||||
setupVisible: false, |
||||
form: { |
||||
|
||||
}, |
||||
date: [], |
||||
types: [ |
||||
{ |
||||
id: 1, |
||||
name: '实训' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '理论' |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '论文报告' |
||||
}, |
||||
{ |
||||
id: 4, |
||||
name: '其他' |
||||
}, |
||||
], |
||||
submiting: false, |
||||
}; |
||||
}, |
||||
watch: { |
||||
visible () { |
||||
this.setupVisible = this.visible |
||||
// this.visible && this.init() |
||||
} |
||||
}, |
||||
mounted () { |
||||
|
||||
}, |
||||
methods: { |
||||
// 初始化 |
||||
init () { |
||||
this.handleQuesList() |
||||
if (!this.loaded) { |
||||
this.loaded = 1 |
||||
this.yearCheck = this.years |
||||
this.getQuesBankType() |
||||
this.initQuesBank() |
||||
this.difficult = this.$parent.form.difficult |
||||
this.difficult && this.difficultChange(this.difficult) |
||||
} |
||||
}, |
||||
// 获取题库分类 |
||||
async getQuesBankType () { |
||||
try { |
||||
const { data } = await this.$post(this.api.getAllQuestionBankCategories, { |
||||
createSource: 1, |
||||
status: 1, |
||||
}) |
||||
this.handleList(data) |
||||
this.quesBankTypes = data |
||||
} catch (e) { } |
||||
}, |
||||
// 获取题库 |
||||
async getQuesBank () { |
||||
try { |
||||
const type = this.quesBankTypeVal |
||||
const res = await this.$post(this.api.questionBankList, { |
||||
status: 1, |
||||
pageNum: 1, |
||||
pageSize: 1000, |
||||
questionCategoryId: type.length ? type[type.length - 1] : '', |
||||
name: this.quesBankKeyword |
||||
}) |
||||
this.quesBanks = res.message.records |
||||
this.totalQuesBank = res.message.total |
||||
} catch (e) { } |
||||
}, |
||||
initQuesBank () { |
||||
this.curQuesBank = {} |
||||
this.pageQuesBank = 1 |
||||
this.getQuesBank() |
||||
}, |
||||
// 切换页码 |
||||
currentChangeQuesBank (val) { |
||||
this.pageQuesBank = val |
||||
this.getQuesBank() |
||||
}, |
||||
// 题目多选回调 |
||||
questionBankClick (item) { |
||||
this.curQuesBank = item |
||||
this.knowledgeCheck = false |
||||
this.getKnowledgeType() |
||||
this.getKnowledge() |
||||
}, |
||||
|
||||
// 处理树形 |
||||
handleList (list) { |
||||
list.map(e => { |
||||
if (e.children && e.children.length) { |
||||
this.handleList(e.children) |
||||
} else { |
||||
delete e.children |
||||
} |
||||
}) |
||||
}, |
||||
// 获取知识点分类 |
||||
async getKnowledgeType () { |
||||
try { |
||||
const { data } = await this.$post(this.api.classificationTreeStructure, { |
||||
createSource: 1, |
||||
questionBankId: this.curQuesBank.id, |
||||
}) |
||||
this.handleList(data) |
||||
this.knowledgeTypes = data |
||||
} catch (e) { } |
||||
}, |
||||
// 获取知识点 |
||||
async getKnowledge () { |
||||
try { |
||||
const { id } = this.curQuesBank |
||||
if (id) { |
||||
const type = this.knowledgeTypeVal |
||||
const res = await this.$post(this.api.knowledgeHierarchyList, { |
||||
pageNum: 1, |
||||
pageSize: 1000, |
||||
questionBankId: id, |
||||
knowledgePointCategoryId: type.length ? type[type.length - 1] : '', |
||||
name: this.knowledgeKeyword, |
||||
}) |
||||
const list = res.message.records |
||||
const { allKnowledges } = this |
||||
list.map(e => { |
||||
e.check = !!allKnowledges.find(n => n.id === e.id) |
||||
}) |
||||
this.knowledges = list |
||||
} |
||||
} catch (e) { } |
||||
}, |
||||
// 切换页码 |
||||
currentChangeKn (val) { |
||||
this.pageKn = val |
||||
this.getKnowledge() |
||||
}, |
||||
// 知识点全选回调 |
||||
knowledgeAllCheckChange (val) { |
||||
this.knowledges.map(e => { |
||||
e.check = val |
||||
this.knowledgeChange(val, e) |
||||
}) |
||||
}, |
||||
// 知识点勾选回调 |
||||
knowledgeChange (checked, data) { |
||||
const checkQues = this.curQuesBank |
||||
const index = this.checked.findIndex(e => e.quesBank.id === checkQues.id) |
||||
// 已选中的题库数组里有该题库,则往该题库的知识点数组里 |
||||
if (index !== -1) { |
||||
const ques = this.checked[index] |
||||
const i = ques.knowledges.findIndex(e => e.id === data.id) |
||||
if (checked && i === -1) { |
||||
ques.knowledges.push(data) |
||||
} else if (!checked && i >= 0) { |
||||
ques.knowledges.splice(i, 1) |
||||
} |
||||
ques.knowledges.length || this.checked.splice(index, 1) |
||||
} else { |
||||
this.checked.push({ |
||||
quesBank: checkQues, |
||||
knowledges: [data] |
||||
}) |
||||
} |
||||
}, |
||||
// 处理大纲列表 |
||||
handleQuesList () { |
||||
this.list = _.cloneDeep(this.$parent.form.paperOutline) |
||||
}, |
||||
// 清空已选 |
||||
async clearChecked () { |
||||
try { |
||||
await this.$confirm(`确认要清空吗?`, '提示', { |
||||
confirmButtonText: '确定', |
||||
cancelButtonText: '取消', |
||||
type: 'warning', |
||||
closeOnClickModal: false, |
||||
}) |
||||
this.knowledges.map(e => e.check = false) |
||||
this.checked = [] |
||||
this.knowledgeCheck = false |
||||
} catch (e) { } |
||||
}, |
||||
// 删除题库 |
||||
async delQuesBank (i) { |
||||
try { |
||||
await this.$confirm(`确认要移除吗?`, '提示', { |
||||
confirmButtonText: '确定', |
||||
cancelButtonText: '取消', |
||||
type: 'warning', |
||||
closeOnClickModal: false, |
||||
}) |
||||
const k = this.knowledges |
||||
this.checked[i].knowledges.map(e => { |
||||
const cur = k.findIndex(n => n.id === e.id) |
||||
if (cur !== -1) k[cur].check = false |
||||
}) |
||||
this.checked.splice(i, 1) |
||||
this.knowledgeCheck = false |
||||
} catch (e) { } |
||||
}, |
||||
// 删除知识点 |
||||
delKnowledge (i, j, item, k) { |
||||
const cur = this.knowledges.findIndex(e => e.id === k.id) |
||||
if (cur !== -1) this.knowledges[cur].check = false |
||||
item.knowledges.splice(j, 1) |
||||
item.knowledges.length || this.checked.splice(i, 1) // 知识点清空了则把该题库删除 |
||||
this.knowledgeCheck = false |
||||
}, |
||||
|
||||
|
||||
// 试卷难度选择回调 |
||||
difficultChange (val) { |
||||
const difficultyWeights = [0.2, 0.4, 0.6, 0.8] |
||||
const names = ['basicDifficulty', 'normalDifficulty', 'hardDifficulty', 'veryHardDifficulty'] |
||||
// 遍历题型数组 |
||||
this.list.forEach(e => { |
||||
const total = e.questionNum |
||||
|
||||
let already = 0 // 已经分配的数量 |
||||
if (val === 1) { |
||||
this.$set(e, 'basicDifficulty', Math.floor(total * 0.7)) |
||||
this.$set(e, 'normalDifficulty', Math.floor(total * 0.3)) |
||||
this.$set(e, 'hardDifficulty', 0) |
||||
this.$set(e, 'veryHardDifficulty', 0) |
||||
} else if (val === 2) { |
||||
this.$set(e, 'basicDifficulty', Math.floor(total * 0.45)) |
||||
this.$set(e, 'normalDifficulty', Math.floor(total * 0.55)) |
||||
this.$set(e, 'hardDifficulty', 0) |
||||
this.$set(e, 'veryHardDifficulty', 0) |
||||
} else if (val === 3) { |
||||
this.$set(e, 'basicDifficulty', Math.floor(total * 0.3)) |
||||
this.$set(e, 'normalDifficulty', Math.floor(total * 0.3)) |
||||
this.$set(e, 'hardDifficulty', Math.floor(total * 0.4)) |
||||
this.$set(e, 'veryHardDifficulty', 0) |
||||
} else if (val === 4) { |
||||
this.$set(e, 'basicDifficulty', Math.floor(total * 0.1)) |
||||
this.$set(e, 'normalDifficulty', Math.floor(total * 0.1)) |
||||
this.$set(e, 'hardDifficulty', Math.floor(total * 0.3)) |
||||
this.$set(e, 'veryHardDifficulty', Math.floor(total * 0.5)) |
||||
} |
||||
|
||||
|
||||
already = Decimal(already).add(e.basicDifficulty).add(e.normalDifficulty).add(e.hardDifficulty).add(e.veryHardDifficulty).toNumber() |
||||
// 如果按比例分配还没分配完 |
||||
while (total > already) { |
||||
e[names[val - 1]]++ |
||||
already++ |
||||
} |
||||
this.$set(e, 'randomDifficulty', 0) |
||||
}) |
||||
}, |
||||
// 年份全选回调 |
||||
yearAllChange (val) { |
||||
this.yearCheck = val ? this.years : [] |
||||
}, |
||||
// 年份选择回调 |
||||
yearChange (val) { |
||||
this.yearAll = val.length === 11 |
||||
}, |
||||
// 提交 |
||||
async submit () { |
||||
if (this.submiting) return false |
||||
const { list } = this |
||||
let invalid = 0 |
||||
let totalCount = 0 |
||||
for (const i in list) { |
||||
const e = list[i] |
||||
const name = `第${Util.arabicToChinese(+i + 1)}大题` |
||||
if (!e.questionType) { |
||||
Util.warningMsg(`${name}请先选择题型`) |
||||
invalid = 1 |
||||
break |
||||
} |
||||
if (!e.questionNum || isNaN(e.questionNum) || e.questionNum <= 0) { |
||||
Util.warningMsg(`${name}的目标题数请输入正整数`) |
||||
invalid = 1 |
||||
break |
||||
} |
||||
let total = Decimal(e.basicDifficulty || 0).add(e.normalDifficulty || 0).add(e.hardDifficulty || 0).add(e.veryHardDifficulty || 0).toNumber() // 先算前4个难度的题数 |
||||
if (total) { // 前面4个空有填1个,则清空随机 |
||||
this.$set(e, 'randomDifficulty', 0) |
||||
} else { |
||||
total = +e.randomDifficulty || 0 |
||||
} |
||||
|
||||
if (total > e.questionNum) { |
||||
Util.warningMsg(`${name}的小题总数大于目标题数,请重新输入`) |
||||
invalid = 1 |
||||
break |
||||
} |
||||
e.count = total |
||||
totalCount = Decimal(totalCount).add(total).toNumber() |
||||
} |
||||
if (invalid) return false |
||||
if (!totalCount) return Util.warningMsg(`请填写难度题数`) |
||||
this.submiting = true |
||||
const k = this.allKnowledges.map(e => e.id) |
||||
|
||||
const years = [] |
||||
this.yearCheck.map(e => { |
||||
if (e === '暂无年份') { |
||||
years.push('') |
||||
} else if (e === '更早') { |
||||
// 选的是更早则直接传1990~2005所有年份 |
||||
for (let i = 1990; i < 2006; i++) { |
||||
years.push(i) |
||||
} |
||||
} else { |
||||
years.push(+e) |
||||
} |
||||
}) |
||||
list.map(e => { |
||||
e.givenYears = years |
||||
e.knowledgePointsIds = k |
||||
}) |
||||
try { |
||||
const res = await this.$post(this.api.selectQuestionsByTypeAndDifficulty, list) |
||||
|
||||
let invalid = 0 |
||||
let hasQues = 0 |
||||
list.map((e, i) => { |
||||
if (+e.count !== res.list[i].questions.length) invalid = 1 |
||||
if (e.examQuestions.length) hasQues = 1 |
||||
e.score = 0 |
||||
}) |
||||
|
||||
// 3种情况提示不一样 |
||||
const tips = invalid && hasQues ? |
||||
'此操作会清空当前试卷已添加的试题,并且满足自动选题设置的试题数量不足,确定要继续自动选题吗?' : |
||||
invalid && !hasQues ? |
||||
'满足自动选题设置的试题数量不足,确认要继续自动选题吗?' : |
||||
!invalid && hasQues ? '此操作会清空当前试卷已添加的试题,是否确定要继续自动选题吗?' : |
||||
'' |
||||
|
||||
if (tips) { |
||||
await this.$confirm(tips, '提示', { |
||||
confirmButtonText: '确定', |
||||
cancelButtonText: '取消', |
||||
type: 'warning', |
||||
closeOnClickModal: false, |
||||
}) |
||||
} |
||||
list.map((e, i) => { |
||||
res.list[i].questions.map((e, i) => { |
||||
e.questionId = e.id |
||||
e.serialNumber = i + 1 |
||||
e.originSort = i + 1 |
||||
this.$parent.handleQuesInfo(e) |
||||
}) |
||||
this.$parent.form.paperOutline[i].examQuestions = res.list[i].questions |
||||
}) |
||||
this.setupVisible = false |
||||
this.$parent.calcDifficult() |
||||
this.submiting = false |
||||
} catch (e) { |
||||
this.submiting = false |
||||
} |
||||
}, |
||||
// 弹框关闭回调 |
||||
closeDia () { |
||||
this.$emit('update:visible', false) |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
/deep/.setup-dia { |
||||
.el-drawer__header { |
||||
margin-bottom: 0; |
||||
} |
||||
|
||||
.explain { |
||||
margin: 0 20px 0 -20px; |
||||
font-size: 16px; |
||||
color: #8f8f8f; |
||||
cursor: pointer; |
||||
} |
||||
|
||||
.info { |
||||
flex: 1; |
||||
height: 100%; |
||||
border-left: 1px solid #ccc; |
||||
|
||||
h6 { |
||||
margin-bottom: 20px; |
||||
font-size: 16px; |
||||
text-align: center; |
||||
} |
||||
} |
||||
} |
||||
</style> |
@ -1,585 +0,0 @@ |
||||
<template> |
||||
<div class="page"> |
||||
<Breadcrumb style="margin-bottom: 0;" :data="crumbs" /> |
||||
<div class="wrap"> |
||||
<div class="side"> |
||||
<div class="m-b-20"> |
||||
<el-radio-group v-model="isNotJoin" @change="changeType"> |
||||
<div class="m-b-20"> |
||||
<el-radio :label="1">所有试卷</el-radio> |
||||
</div> |
||||
<div> |
||||
<el-radio :label="2">未加入分类的试卷</el-radio> |
||||
</div> |
||||
</el-radio-group> |
||||
</div> |
||||
<el-divider></el-divider> |
||||
<div> |
||||
<div class="flex-between m-b-10"> |
||||
<h6 class="page-name" style="margin-bottom: 0">试卷分类</h6> |
||||
<el-button type="text" @click="addType(0)">添加</el-button> |
||||
</div> |
||||
|
||||
<div style="overflow: auto"> |
||||
<el-tree v-loading="loading" :data="types" default-expand-all ref="typeTree" node-key="classificationId" |
||||
highlight-current :expand-on-click-node="false" @node-click="handleNodeClick" |
||||
:props="{ value: 'classificationId', label: 'classificationName' }"> |
||||
<span class="custom-tree-node" slot-scope="{ node, data }"> |
||||
<span class="org-name">{{ data.classificationName }}</span> |
||||
<span> |
||||
<el-button type="text" icon="el-icon-circle-plus-outline" @click="() => addType(data)"> |
||||
</el-button> |
||||
<el-button type="text" icon="el-icon-edit-outline" @click="() => editType(data)"> |
||||
</el-button> |
||||
<el-button type="text" icon="el-icon-delete" @click="() => delType(node, data)"> |
||||
</el-button> |
||||
</span> |
||||
</span> |
||||
</el-tree> |
||||
</div> |
||||
</div> |
||||
|
||||
<el-dialog :title="typeForm.classificationId ? '编辑' : '新增' + '试卷分类'" :visible.sync="typeVisible" |
||||
:close-on-click-modal="false" width="400px"> |
||||
<el-form v-if="typeVisible" ref="typeForm" :model="typeForm" :rules="typeRules" label-width="130px"> |
||||
<el-form-item label="试卷分类名称" prop="classificationName"> |
||||
<el-input v-model.trim="typeForm.classificationName" placeholder="请输入试卷分类" maxlength="20"></el-input> |
||||
</el-form-item> |
||||
<el-form-item label="设置上一级"> |
||||
<el-cascader :options="types" v-model="cascaderValue" :props="cascaderProps" clearable |
||||
style="width: 100%"> |
||||
</el-cascader> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="closeType">取 消</el-button> |
||||
<el-button type="primary" @click="typeSubmit">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
|
||||
<div class="right"> |
||||
<h6 class="page-name">筛选</h6> |
||||
<div class="tool"> |
||||
<ul class="filter"> |
||||
<li> |
||||
<label>题目类型</label> |
||||
<el-select v-model="questionType" clearable multiple placeholder="请选择题目类型" @change="initData"> |
||||
<el-option v-for="(item, i) in questionTypes" :key="i" :label="item.name" |
||||
:value="item.name"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>试卷难度</label> |
||||
<el-select v-model="filter.difficult" clearable multiple placeholder="请选择试卷难度" @change="initData"> |
||||
<el-option v-for="(item, i) in difficults" :key="i" :label="item.name" :value="item.id"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>所属专业</label> |
||||
<el-select v-model="filter.professionalId" filterable clearable placeholder="请选择所属专业" multiple |
||||
@change="initData"> |
||||
<el-option v-for="(item, i) in professionals" :key="i" :label="item.professionalName" |
||||
:value="item.professionalId"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>年份</label> |
||||
<el-date-picker v-model="particularYear" type="year" placeholder="请选择年份" format="yyyy" value-format="yyyy" |
||||
multiple @change="initData"> |
||||
</el-date-picker> |
||||
</li> |
||||
<li> |
||||
<label>建议用途</label> |
||||
<el-select v-model="filter.paperType" clearable placeholder="请选择状态" @change="initData"> |
||||
<el-option v-for="(item, i) in paperTypes" :key="i" :label="item.name" :value="item.id"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>状态</label> |
||||
<el-select v-model="status" clearable placeholder="请选择状态" @change="initData"> |
||||
<el-option v-for="(item, i) in statusList" :key="i" :label="item.name" :value="item.id"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>搜索</label> |
||||
<el-input style="width: 250px;" placeholder="请输入试卷名称" prefix-icon="el-icon-search" |
||||
v-model="filter.keyWord" clearable /> |
||||
</li> |
||||
<div style="margin-bottom: 15px;"> |
||||
<el-button type="primary" @click="add">创建试卷</el-button> |
||||
<!-- <el-button type="primary" @click="add">批量移除 </el-button> --> |
||||
<el-button type="primary" @click="delAllSelection">批量删除</el-button> |
||||
</div> |
||||
</ul> |
||||
</div> |
||||
|
||||
<el-table :data="list" v-loading="listLoading" class="table" ref="table" stripe header-align="center" |
||||
@selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange"> |
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
||||
<el-table-column prop="name" label="试卷名称" align="center" min-width="100" |
||||
show-overflow-tooltip></el-table-column> |
||||
<el-table-column prop="questionCount" label="试题总数" align="center" width="70"></el-table-column> |
||||
<el-table-column prop="score" label="总分" align="center" width="60"></el-table-column> |
||||
<el-table-column prop="questionType" label="题型" align="center" min-width="90" |
||||
show-overflow-tooltip></el-table-column> |
||||
<el-table-column prop="difficult" label="试卷难度" align="center" width="100" sortable="custom"> |
||||
<template slot-scope="scope">{{ difficults.find(e => e.id === scope.row.difficult) ? difficults.find(e => |
||||
e.id === scope.row.difficult).name : '' }}</template> |
||||
</el-table-column> |
||||
<el-table-column prop="suggestTime" label="建议用时" align="center" width="70"> |
||||
<template slot-scope="scope">{{ scope.row.suggestTime }}min</template> |
||||
</el-table-column> |
||||
<el-table-column prop="classificationPath" label="试卷分类" align="center" width="90" |
||||
show-overflow-tooltip></el-table-column> |
||||
<el-table-column prop="professionalName" label="所属专业" align="center" width="100"></el-table-column> |
||||
<el-table-column prop="particularYear" label="年份" align="center" width="70" sortable="custom"> |
||||
<template slot-scope="scope">{{ scope.row.particularYear }}年</template> |
||||
</el-table-column> |
||||
<el-table-column label="建议用途" align="center" width="70"> |
||||
<template slot-scope="scope">{{ paperTypes.find(e => e.id === scope.row.paperType) ? paperTypes.find(e => |
||||
e.id === scope.row.paperType).name : '' }}</template> |
||||
</el-table-column> |
||||
<el-table-column label="状态" align="center" width="60"> |
||||
<template slot-scope="scope">{{ !scope.row.status ? '草稿' : (scope.row.isDisable ? '禁用' : '启用') }}</template> |
||||
</el-table-column> |
||||
<el-table-column prop="createTime" label="创建时间" align="center" width="160" |
||||
sortable="custom"></el-table-column> |
||||
<el-table-column prop="updateTime" label="最近编辑时间" align="center" width="160" |
||||
sortable="custom"></el-table-column> |
||||
<el-table-column prop="createUser" label="最近编辑人" align="center" width="90"></el-table-column> |
||||
<el-table-column label="操作" align="center" width="250" fixed="right"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="toDetail(scope.row, 1)">复制</el-button> |
||||
<el-button type="text" @click="preview(scope.row)">预览</el-button> |
||||
<el-button type="text" @click="toDetail(scope.row)">编辑</el-button> |
||||
<el-button type="text" @click="del(scope.row)">删除</el-button> |
||||
<el-switch v-if="scope.row.status" v-model="scope.row.isDisable" :active-value="false" |
||||
:inactive-value="true" style="margin: 0 10px 0 5px" :active-text="scope.row.isDisable ? '禁用' : '启用'" |
||||
@change="switchOff($event, scope.row, scope.$index)"></el-switch> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="currentChange" |
||||
:current-page="page"> |
||||
</el-pagination> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<el-dialog title="提示" :visible.sync="delVisible" width="400px" :close-on-click-modal="false" custom-class="del-dia"> |
||||
<div class="del-wrap"> |
||||
<div class="icon el-icon-warning"></div> |
||||
<div> |
||||
<p>确认要删除【{{ curName }}】吗?</p> |
||||
<p class="tips">删除后,其子级分类也将被删除。</p> |
||||
<el-checkbox v-model="deleteQuestions">同时删除此分类及其子分类的试卷,删除后数据无法恢复,请谨慎操作!</el-checkbox> |
||||
</div> |
||||
</div> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="delVisible = false">取消</el-button> |
||||
<el-button type="primary" @click="delTypeSubmit">确定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Util from '@/libs/util' |
||||
import _ from 'lodash' |
||||
import Breadcrumb from '@/components/breadcrumb' |
||||
import QuesConst from '@/const/ques' |
||||
import TestPaperConst from '@/const/testPaper' |
||||
import Qs from 'qs' |
||||
export default { |
||||
components: { Breadcrumb }, |
||||
data () { |
||||
return { |
||||
crumbs: [], |
||||
questionTypes: QuesConst.questionTypes, |
||||
difficults: TestPaperConst.difficults, |
||||
paperTypes: TestPaperConst.paperTypes, |
||||
libraryId: this.$route.query.id, |
||||
name: this.$route.query.name, |
||||
createSource: 1, |
||||
loading: false, |
||||
types: [], |
||||
isNotJoin: 1, |
||||
typeVisible: false, // 员工组织架对话框 |
||||
cascaderValue: [], |
||||
cascaderProps: { |
||||
checkStrictly: true, |
||||
label: "classificationName", |
||||
value: "classificationId" |
||||
}, |
||||
|
||||
typeForm: { |
||||
classificationId: '', |
||||
classificationName: '' |
||||
}, |
||||
typeRules: { |
||||
classificationName: [ |
||||
{ required: true, message: '请输入试卷分类名称', trigger: 'blur' } |
||||
] |
||||
}, |
||||
professionals: [], |
||||
statusList: [ |
||||
{ |
||||
id: 0, |
||||
name: '启用' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '禁用' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '草稿' |
||||
}, |
||||
], |
||||
particularYear: '', |
||||
questionType: [], |
||||
status: '', |
||||
filter: { |
||||
difficult: [], |
||||
professionalId: [], |
||||
paperType: '', |
||||
updateTimeOrder: '', |
||||
crateTimeOrder: 2, |
||||
yearOrder: '', |
||||
keyWord: '', |
||||
difficultOrder: '', |
||||
}, |
||||
listLoading: false, |
||||
list: [], |
||||
page: +this.$route.query.page || 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
multipleSelection: [], |
||||
|
||||
submiting: false, |
||||
|
||||
|
||||
delVisible: false, |
||||
deleteQuestions: false, |
||||
curName: '', |
||||
curId: [], |
||||
}; |
||||
}, |
||||
watch: { |
||||
'filter.keyWord': function () { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(this.getList, 500) |
||||
}, |
||||
}, |
||||
mounted () { |
||||
const { referrer1 } = this.$store.state.user |
||||
this.crumbs = [ |
||||
{ |
||||
name: this.name || '中台试卷库', |
||||
route: referrer1 || '/testPaperLibrary' |
||||
}, |
||||
{ |
||||
name: '试卷管理' |
||||
}, |
||||
|
||||
] |
||||
|
||||
const { query } = this.$route |
||||
if (query.page) { |
||||
const { difficult, professionalId, paperType, updateTimeOrder, crateTimeOrder, yearOrder, keyWord, difficultOrder, particularYear, questionType, status, id, name } = query |
||||
this.filter = { |
||||
difficult: difficult ? difficult.split(',').map(e => +e) : [], |
||||
professionalId: professionalId ? professionalId.split(',').map(e => +e) : [], |
||||
paperType: paperType ? +paperType : '', |
||||
updateTimeOrder: updateTimeOrder ? +updateTimeOrder : '', |
||||
crateTimeOrder: crateTimeOrder ? +crateTimeOrder : 2, |
||||
yearOrder: yearOrder ? +yearOrder : '', |
||||
keyWord: keyWord || '', |
||||
difficultOrder: difficultOrder ? +difficultOrder : '', |
||||
} |
||||
this.particularYear = particularYear || '' |
||||
this.questionType = questionType ? questionType.split(',') : [] |
||||
this.status = status ? +status : '' |
||||
this.$router.push(`/testPaper?id=${id}&name=${name}`).catch(() => { }) |
||||
} |
||||
|
||||
this.getType() |
||||
this.getProfessional() |
||||
}, |
||||
methods: { |
||||
// 获取分类 |
||||
async getType () { |
||||
try { |
||||
this.loading = true |
||||
const res = await this.$post(this.api.examClassificationList, { |
||||
createSource: this.createSource, |
||||
libraryId: this.libraryId, |
||||
}) |
||||
const data = res.treeList |
||||
this.handleType(data) |
||||
this.types = data |
||||
this.getList() |
||||
} finally { |
||||
this.loading = false |
||||
} |
||||
}, |
||||
// 分类筛选回调 |
||||
changeType () { |
||||
this.$refs.typeTree.setCurrentKey(null) |
||||
this.initData() |
||||
}, |
||||
// 获取分类详情 |
||||
async getDetail (id) { |
||||
const res = await this.$get(this.api.examClassificationFind, { |
||||
id |
||||
}) |
||||
return res.examClassification |
||||
}, |
||||
// 添加分类 |
||||
async addType (row) { |
||||
this.typeForm = { |
||||
classificationId: '', |
||||
classificationName: '', |
||||
} |
||||
this.typeVisible = true |
||||
if (row) { |
||||
const data = await this.getDetail(row.classificationId) |
||||
const path = data.classificationPath.split('/').map(e => +e) |
||||
this.cascaderValue = data.classificationPath.split('/').map(e => +e) |
||||
} |
||||
}, |
||||
// 编辑分类 |
||||
async editType (row) { |
||||
this.typeForm = { |
||||
classificationId: row.classificationId, |
||||
classificationName: row.classificationName |
||||
} |
||||
this.typeVisible = true |
||||
const data = await this.getDetail(row.classificationId) |
||||
const path = data.classificationPath.split('/').map(e => +e) |
||||
this.cascaderValue = path.slice(0, path.length - 1) |
||||
}, |
||||
// 处理树形 |
||||
handleType (list) { |
||||
list.map(e => { |
||||
if (e.children && e.children.length) { |
||||
this.handleType(e.children) |
||||
} else { |
||||
delete e.children |
||||
} |
||||
}) |
||||
}, |
||||
// 删除分类 |
||||
delType (node, row) { |
||||
this.curName = row.classificationName |
||||
this.curId = [row.classificationId] |
||||
this.delVisible = true |
||||
}, |
||||
// 删除分类提交 |
||||
async delTypeSubmit () { |
||||
await this.$post(this.api.examClassificationDel, { |
||||
delete: this.deleteQuestions, |
||||
ids: this.curId |
||||
}) |
||||
Util.successMsg('删除成功') |
||||
this.delVisible = false |
||||
this.getType() |
||||
}, |
||||
// 分类新增/编辑 |
||||
typeSubmit () { |
||||
this.$refs.typeForm.validate(async (valid) => { |
||||
if (valid) { |
||||
const form = this.typeForm |
||||
const cas = this.cascaderValue |
||||
const len = cas.length |
||||
if (cas && len) { |
||||
form.parentId = cas[len - 1] |
||||
form.level = len + 1 |
||||
} else { |
||||
form.parentId = 0 |
||||
form.level = 1 |
||||
} |
||||
form.createSource = this.createSource |
||||
form.libraryId = this.libraryId |
||||
await this.$post(this.api[form.classificationId ? 'examClassificationUpdate' : 'examClassificationSave'], form) |
||||
Util.successMsg('保存成功') |
||||
this.closeType() |
||||
} |
||||
}); |
||||
}, |
||||
// 点击树节点查询列表数据 |
||||
handleNodeClick (data) { |
||||
this.isNotJoin = '' |
||||
this.initData() |
||||
}, |
||||
// 关闭组织新增编辑弹框 |
||||
closeType () { |
||||
this.typeVisible = false |
||||
this.cascaderValue = [] |
||||
this.getType() |
||||
}, |
||||
// 获取所属专业 |
||||
async getProfessional () { |
||||
try { |
||||
const res = await this.$post(this.api.queryProfessional, { |
||||
pageNum: 1, |
||||
pageSize: 1000, |
||||
}) |
||||
this.professionals = res.pageList.records |
||||
} catch (e) { } |
||||
}, |
||||
// 列表 |
||||
async getList () { |
||||
try { |
||||
this.listLoading = true |
||||
const type = this.$refs.typeTree |
||||
const res = await this.$post(this.api.examPaperList, { |
||||
...this.filter, |
||||
isDisable: this.status === 2 ? '' : this.status, // 禁用启用 |
||||
status: this.status === 2 ? 0 : '', // 草稿及发布 |
||||
particularYear: this.particularYear ? [this.particularYear] : [], |
||||
questionType: this.questionType.length ? this.questionType.join() : '', |
||||
type: this.isNotJoin, |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
libraryId: this.libraryId, |
||||
classificationId: type ? type.getCurrentKey() || '' : '', |
||||
}) |
||||
this.list = res.pageList.records |
||||
this.total = res.pageList.total |
||||
} finally { |
||||
this.listLoading = false |
||||
} |
||||
}, |
||||
// 切换页码 |
||||
currentChange (val) { |
||||
this.page = val |
||||
this.getList() |
||||
}, |
||||
handleSelectionChange (val) { // 多选 |
||||
this.multipleSelection = val |
||||
}, |
||||
initData () { |
||||
this.$refs.table.clearSelection() |
||||
this.page = 1 |
||||
this.getList() |
||||
}, |
||||
// 排序回调 |
||||
sortChange (column) { |
||||
if (column.prop === 'difficult') this.filter.difficultOrder = column.order ? column.order === 'ascending' ? 1 : 2 : '' |
||||
if (column.prop === 'particularYear') this.filter.yearOrder = column.order ? column.order === 'ascending' ? 1 : 2 : '' |
||||
if (column.prop === 'createTime') this.filter.crateTimeOrder = column.order ? column.order === 'ascending' ? 1 : 2 : '' |
||||
if (column.prop === 'updateTime') this.filter.updateTimeOrder = column.order ? column.order === 'ascending' ? 1 : 2 : '' |
||||
this.getList() |
||||
}, |
||||
// 删除 |
||||
async del (row) { |
||||
try { |
||||
await this.$confirm(`确认要删除【${row.name}】吗?`, '提示', { |
||||
confirmButtonText: '确定', |
||||
cancelButtonText: '取消', |
||||
type: 'warning', |
||||
dangerouslyUseHTMLString: true, |
||||
}) |
||||
await this.$post(this.api.paperDel, { |
||||
delete: false, |
||||
ids: [row.paperId] |
||||
}) |
||||
Util.successMsg('删除成功') |
||||
this.getList() |
||||
} catch (e) { } |
||||
}, |
||||
async switchOff (val, row) { |
||||
await this.$post(this.api.paperDisable, { |
||||
id: row.paperId, |
||||
isDisable: val, |
||||
}) |
||||
this.getList() |
||||
}, |
||||
// 缓存当前页面和参数,详情页返回到列表的时候直接取该url |
||||
setReferrer () { |
||||
const { filter } = this |
||||
this.$store.commit('user/setReferrer', { |
||||
i: 2, |
||||
url: `${this.$route.path}?${Qs.stringify(filter)}&difficult=${filter.difficult}&professionalId=${filter.professionalId}&particularYear=${this.particularYear}&questionType=${this.questionType}&status=${this.status}&id=${this.libraryId}&name=${this.name}&page=${this.page}` |
||||
}) |
||||
}, |
||||
// 添加试卷 |
||||
add () { |
||||
this.setReferrer() |
||||
this.$router.push(`/testPaper/detail?libraryId=${this.libraryId}&classificationId=${this.$refs.typeTree.getCurrentKey() || ''}`) |
||||
}, |
||||
// 编辑试卷 |
||||
async toDetail (row, isCopy = '') { |
||||
this.setReferrer() |
||||
this.$router.push(`/testPaper/detail?paperId=${row.paperId}&libraryId=${this.libraryId}&classificationId=${this.$refs.typeTree.getCurrentKey() || ''}&isCopy=${isCopy}`) |
||||
}, |
||||
// 预览 |
||||
preview (row) { |
||||
window.open(this.$router.resolve(`preview?id=${row.paperId}`).href) |
||||
}, |
||||
async delAllSelection () { |
||||
const list = this.multipleSelection |
||||
if (list.length) { |
||||
try { |
||||
await this.$confirm(`确定要删除已选定的${list.length}份试卷吗?`, '提示', { |
||||
confirmButtonText: '确定', |
||||
cancelButtonText: '取消', |
||||
type: 'warning', |
||||
closeOnClickModal: false, |
||||
}) |
||||
await this.$post(this.api.paperDel, { |
||||
delete: false, |
||||
ids: list.map(e => e.paperId) |
||||
}) |
||||
Util.successMsg('删除成功') |
||||
this.multipleSelection = [] |
||||
this.$refs.table.clearSelection() |
||||
this.getList() |
||||
} catch (e) { } |
||||
} else { |
||||
Util.warningMsg('请选择数据') |
||||
} |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.org-name { |
||||
margin-right: 20px; |
||||
} |
||||
|
||||
.wrap { |
||||
display: flex; |
||||
min-height: 100%; |
||||
|
||||
.side { |
||||
width: 300px; |
||||
padding: 24px 10px 24px 0; |
||||
margin-right: 24px; |
||||
border-right: 1px solid rgba(0, 0, 0, 0.06); |
||||
} |
||||
|
||||
.right { |
||||
width: calc(100% - 324px); |
||||
padding: 24px 0; |
||||
} |
||||
} |
||||
|
||||
.tool { |
||||
margin-bottom: 0; |
||||
|
||||
.filter { |
||||
flex-wrap: wrap; |
||||
justify-content: space-between; |
||||
|
||||
li { |
||||
margin-bottom: 15px; |
||||
} |
||||
} |
||||
} |
||||
</style> |
Loading…
Reference in new issue