yujialong 2 months ago
parent 3df0023d16
commit d79c0d0cbb
  1. 80
      src/api/index.js
  2. 0
      src/pages/allocationReview/detail/auto.vue
  3. 0
      src/pages/allocationReview/detail/index.vue
  4. 0
      src/pages/allocationReview/detail/manual.vue
  5. 0
      src/pages/allocationReview/detail/repeatQues.vue
  6. 0
      src/pages/allocationReview/detail/template.vue
  7. 268
      src/pages/allocationReview/list/index.vue
  8. 152
      src/pages/allocationReview/list/progress.vue
  9. 203
      src/pages/allocationReview/list/progressDetail.vue
  10. 501
      src/pages/allocationReview/list/setup.vue
  11. 0
      src/pages/allocationReview/preview/index.vue
  12. 50
      src/pages/myReview/records/index.vue
  13. 585
      src/pages/testPaper/list/index.vue
  14. 14
      src/router/modules/allocationReview.js

@ -4,81 +4,11 @@ const { apiBaseURL: host } = Setting
export default {
getCurrentTime: `/competition/competition/management/getCurrentTime`,
encrypt: `/nakadai/data/encrypt`,
queryProfessional: `/exam/exam/professional/queryProfessional`,
queryProvince: `nakadai/nakadai/province/queryProvince`,
queryCity: `nakadai/nakadai/city/queryCity`,
querySchool: `nakadai/nakadai/school/querySchool`,
queryProvince: `/nakadai/nakadai/province/queryProvince`,
queryCity: `/nakadai/nakadai/city/queryCity`,
querySchool: `/nakadai/nakadai/school/querySchool`,
getDetailedExamScores: `exam/exam/paper/getDetailedExamScores`,
categoriesDel: `/exam/exam/question/bank/categories/batchDeletion`,
categoriesFind: `/exam/exam/question/bank/categories/findById`,
getAllQuestionBankCategories: `/exam/exam/question/bank/categories/getAllQuestionBankCategories`,
categoriesSave: `/exam/exam/question/bank/categories/saveOrUpdate`,
categoriesDisable: `/exam/exam/question/bank/categories/updateStatus`,
questionBankDel: `/exam/exam/questionBank/batchDeletion`,
questionBankFind: `/exam/exam/questionBank/findById`,
questionBankList: `/exam/exam/questionBank/pagingQuery`,
questionBankSave: `/exam/exam/questionBank/saveOrUpdate`,
questionBankDisable: `/exam/exam/questionBank/updateStatus`,
copyQuestionBank: `/exam/exam/questionBank/copyQuestionBank`,
questionBankStructureLevel: `/exam/exam/question/bank/categories/questionBankStructureLevel`,
TreeStructure: `/exam/exam/knowledgeHierarchy/TreeStructure`,
classificationTreeStructure: `/exam/exam/knowledgeHierarchy/classificationTreeStructure`,
knowledgeHierarchyDel: `/exam/exam/knowledgeHierarchy/batchDeletion`,
knowledgeHierarchyFind: `/exam/exam/knowledgeHierarchy/findById`,
knowledgeHierarchySave: `/exam/exam/knowledgeHierarchy/saveOrUpdate`,
knowledgeHierarchyList: `/exam/exam/knowledgeHierarchy/pagingQuery`,
libraryClassificationDel: `/exam/exam/libraryClassification/delete`,
libraryClassificationSave: `/exam/exam/libraryClassification/save`,
libraryClassificationList: `/exam/exam/libraryClassification/treeList`,
libraryClassificationUpdate: `/exam/exam/libraryClassification/update`,
libraryClassificationDisable: `/exam/exam/libraryClassification/updateStatus`,
libraryClassificationFind: `/exam/exam/libraryClassification/details`,
paperLibraryDel: `/exam/exam/paperLibrary/delete`,
libraryList: `/exam/exam/paperLibrary/libraryList`,
paperLibrarySave: `/exam/exam/paperLibrary/save`,
paperLibraryUpdate: `/exam/exam/paperLibrary/update`,
paperLibraryDisable: `/exam/exam/paperLibrary/updateStatus`,
copyExamPaperLibrary: `/exam/exam/paperLibrary/copyExamPaperLibrary`,
examClassificationDel: `/exam/exam/classification/delete`,
examClassificationSave: `/exam/exam/classification/save`,
examClassificationList: `/exam/exam/classification/treeList`,
examClassificationUpdate: `/exam/exam/classification/update`,
examClassificationFind: `/exam/exam/classification/details`,
paperDel: `/exam/exam/paper/delete`,
examPaperList: `/exam/exam/paper/examPaperList`,
saveExamPaper: `/exam/exam/paper/saveExamPaper`,
paperDisable: `/exam/exam/paper/updateStatus`,
avgValues: `/exam/exam/paper/avgValues`,
examPaperDetails: `/exam/exam/paper/examPaperDetails`,
deleteTemplate: `/exam/exam/paperTemplate/deleteTemplate`,
examPaperTemplateList: `/exam/exam/paperTemplate/examPaperTemplateList`,
saveExamPaperTemplate: `/exam/exam/paperTemplate/saveExamPaperTemplate`,
templateDetails: `/exam/exam/paperTemplate/templateDetails`,
addQuestion: `/exam/exam/questions/addQuestion`,
findQuestion: `/exam/exam/questions/findById`,
listQuestion: `/exam/exam/questions/pagingQuery`,
updateQuestion: `/exam/exam/questions/updateQuestion`,
checkQuestion: `/exam/exam/questions/checkQuestion`,
delQuestion: `/exam/exam/questions/batchDeletion`,
checkQuestionIsUse: `/exam/exam/questions/checkQuestionIsUse`,
copyQuestion: `/exam/exam/questions/copyQuestion`,
createNewVersion: `/exam/exam/questions/createNewVersion`,
disableOrEnableQuestion: `/exam/exam/questions/disableOrEnableQuestion`,
findAllByQuestionBank: `/exam/exam/questions/findAllByQuestionBank`,
selectQuestionsByTypeAndDifficulty: `/exam/exam/questions/selectQuestionsByTypeAndDifficulty`,
removeQuestionKnowledge: `/exam/exam/questions/removeQuestionKnowledge`,
batchImportQuestions: `${host}/exam/exam/questions/batchImportQuestions`,
downloadQuesExcel: `${host}/exam/exam/questions/downloadExcel`,
batchImportQuesFailure: `${host}/exam/exam/questions/exportFailure`,
getDetailedExamScores: `/exam/exam/paper/getDetailedExamScores`,
reviewSettingsList: `/competition/competition/readAndAppraise/reviewSettingsList`,
}

@ -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) { // 41
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>

@ -6,22 +6,24 @@
<ul class="filter">
<li>
<label>省份</label>
<el-select v-model="filter.provinceId" clearable placeholder="请选择省份" @change="getCity" @clear="clearprovince">
<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 ? false : true"
@clear="clearcity" @change="initData">
<el-option v-for="(item, i) in cityList" :key="i" :label="item.cityName" :value="item.cityId"></el-option>
<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="请选择学校" @change="initData">
<el-option v-for="(item, index) in schoolList" :key="index" :label="item.schoolName"
<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>
@ -88,8 +90,8 @@ export default {
loading: false,
provinces: [],
cityList: [],
schoolList: [],
cities: [],
schools: [],
status: [
{
id: 1,
@ -175,7 +177,7 @@ export default {
this.$router.push(`/myReview?questionBankId=${questionBankId}&questionBankName=${questionBankName}&questionBankCategory=${questionBankCategory}`).catch(() => { })
}
// this.getType()
this.getProvince()
// this.getProfessional()
// this.getKnowledge()
},
@ -218,38 +220,44 @@ export default {
//
async getProvince () {
const { list } = this.$get(this.api.queryProvince)
const { list } = await this.$get(this.api.queryProvince)
this.provinces = list
},
//
clearprovince () {
this.filter.city = '',
this.filter.cityId = '',
this.filter.schoolId = ''
},
//
getCity () {
//
provinceChange () {
this.clearprovince()
this.getCityData()
this.page = 1
this.getList()
this.getCity()
this.initData()
},
async getCityData () {
//
async getCity () {
const { list } = await this.$get(this.api.queryCity, {
provinceId: this.filter.provinceId
})
this.cityList = list
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: "",
cityId: ""
provinceId: this.filter.provinceId,
cityId: this.filter.cityId,
})
this.schoolList = list
this.schools = list
},
//

@ -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>

@ -3,18 +3,18 @@ import BasicLayout from '@/layouts/home'
const meta = {}
export default {
path: '/testPaper',
path: '/allocationReview',
redirect: {
path: `/testPaper/list`
path: `/allocationReview/list`
},
meta,
component: BasicLayout,
children: [
// {
// path: 'list',
// component: () => import('@/pages/testPaper/list'),
// meta: { title: '试卷管理' }
// },
{
path: 'list',
component: () => import('@/pages/allocationReview/list'),
meta: { title: '分配评阅任务' }
},
// {
// path: 'detail',
// component: () => import('@/pages/testPaper/detail'),
Loading…
Cancel
Save