Commit c5325aab authored by zhengke's avatar zhengke

修改

parent dace142b
<style>
.examForm .q-table__bottom{
min-height: 10px;
}
</style>
<template>
<div class="page-content examForm">
<q-table :pagination="pageMsg" :loading="loading" no-data-label="暂无相关数据" flat
class="sticky-column-table sticky-right-column-table" separator="none" :data="dataList" :columns="columns"
row-key="name">
<template v-slot:top="props">
<div class="col-2 q-table__title">考试管理</div>
<q-space />
</template>
<template v-slot:body-cell-StartTime="props">
<q-td :props="props">
{{ props.row.StartTime }} -- {{ props.row.EndTime }}
</q-td>
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" color="accent" style="font-weight: 400" label="修改" @click="publishExam(props.row)" />
<q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left: 10px">
<q-list>
<q-item clickable v-close-popup @click="submitExamAudit(props.row)"
v-if="props.row.ExamineStatus==0||props.row.ExamineStatus==3||props.row.ExamineStatus==4">
<q-item-section>
<q-item-label>{{props.row.ExamineStatus==0?'提交审核':"重新提交审核"}}</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="seeExamineeList(props.row)">
<q-item-section>
<q-item-label>考生管理</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="deleteExamPublish(props.row)" v-if="props.row.ExamineStatus!=2">
<q-item-section>
<q-item-label>删除</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</q-td>
</template>
<template v-slot:bottom>
<div></div>
</template>
</q-table>
</div>
</template>
<script>
export default {
meta: {
title: "考试管理"
},
props: {
dataList: {
type: Array,
default: null
},
loading: {
type:Boolean,
default: null
}
},
data() {
return {
columns: [{
name: "Id",
label: "编号",
field: "Id",
align: "left",
},
{
name: "PaperName",
label: "试卷名称",
field: "PaperName",
align: "left",
},
{
name: "CreateByName",
label: "创建人",
field: "CreateByName",
align: "left",
},
{
name: "StudentCount",
label: "考生人数",
field: "StudentCount",
align: "left",
},
{
name: "StartTime",
label: "考试时间",
field: "StartTime",
align: "left",
},
{
name: "ExamTimes",
label: "考试时长",
field: "ExamTimes",
align: "left",
},
{
name: "ReviewerName",
label: "审核人",
field: "ReviewerName",
align: "left",
},
{
name: "ExamineStatusStr",
label: "状态",
field: "ExamineStatusStr",
align: "left",
},
{
name: "optioned",
label: "操作",
field: "Id",
},
],
pageMsg: {
rowsPerPage: 10,
},
}
},
created() {
},
mounted() {
},
methods: {
}
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
<style>
.examForm .q-table__bottom {
min-height: 10px;
}
</style>
<template>
<div class="page-content examForm">
<div style="margin-top:15px;">
<q-btn v-if="multipleSelection&&multipleSelection.length>0" color="accent" size="sm" class="q-mr-md"
@click="movePaperFile()" label="移动到" />
<q-btn v-if="multipleSelection&&multipleSelection.length>0" color="accent" size="sm" class="q-mr-md"
label="删除" @click="batchDelete()" />
</div>
<el-table :data="dataList" v-loading="loading" ref="multipleTable" :cell-class-name="isRender"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column prop="PaperName" label="文件夹/试卷" width="300">
<template slot-scope="scope">
<div class="Exam_PaperName">
<i v-if="scope.row.PaperType==1" title="文件夹" class="iconfont icon-weibiaoti5" style="color:#85CDFD;"></i>
<i v-if="scope.row.PaperType==2" title="试卷" class="iconfont icon-icon-test1" style="color:#85CDFD;"></i>
<div class="Exam_PaperName">
<template v-if="scope.row.PaperType==1">
<span style="cursor:pointer;" @click="getPaperChild(scope.row.PaperId)">
{{ scope.row.PaperName }}</span>
</template>
<template v-else>
{{ scope.row.PaperName }}
<q-tooltip v-if="scope.row.PaperName.length>10" :offset="[10, 10]">{{ scope.row.PaperName }}
</q-tooltip>
</template>
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="QuestionCount" label="题量">
<template slot-scope="scope">
<template v-if="scope.row.PaperType==1">
---
</template>
<template v-if="scope.row.PaperType==2">
{{ scope.row.QuestionCount }}
</template>
</template>
</el-table-column>
<el-table-column prop="DifficultyTypeName" label="难度">
<template slot-scope="scope">
<template v-if="scope.row.PaperType==1">
---
</template>
<template v-if="scope.row.PaperType==2">
{{ scope.row.DifficultyTypeName }}
</template>
</template>
</el-table-column>
<el-table-column prop="PublishCount" label="发布考试次数">
<template slot-scope="scope">
<template v-if="scope.row.PaperType==1">
---
</template>
<template v-if="scope.row.PaperType==2">
{{ scope.row.PublishCount }}
</template>
</template>
</el-table-column>
<el-table-column prop="OpenStr" label="开放状态">
<template slot-scope="scope">
{{ scope.row.OpenStr }}
</template>
</el-table-column>
<el-table-column prop="CreateByName" label="创建人">
<template slot-scope="scope">
{{ scope.row.CreateByName }}
</template>
</el-table-column>
<el-table-column prop="CreateTimeStr" label="创建时间" width="148">
<template slot-scope="scope">
{{ scope.row.CreateTimeStr }}
</template>
</el-table-column>
<el-table-column prop="ReviewerName" label="审核人">
<template slot-scope="scope">
{{ scope.row.ReviewerName }}
</template>
</el-table-column>
<el-table-column prop="ExamineStatusStr" label="状态">
<template slot-scope="scope">
{{ scope.row.ExamineStatusStr }}
<template v-if="scope.row.ExamineRemark">
<q-tooltip :offset="[10, 10]">驳回原因:{{ scope.row.ExamineRemark }}
</q-tooltip>
</template>
</template>
</el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<template v-if="scope.row.PaperType==1">
<q-btn flat size="xs" color="primary" style="font-weight:400" @click="showExamFolder(scope.row)" label="重命名"
v-if="currentUserInfo.Id==scope.row.CreateBy" />
</template>
<template v-if="scope.row.PaperType==2">
<q-btn flat size="xs" color="primary" style="font-weight:400" @click="goExameEdit(scope.row)" label="编辑"
v-if="currentUserInfo.Id==scope.row.CreateBy &&(scope.row.ExamineStatus==0||scope.row.ExamineStatus==3||scope.row.ExamineStatus==4)" />
</template>
<q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left: 10px">
<q-list>
<q-item clickable v-close-popup @click="submitAudit(scope.row)"
v-if="scope.row.PaperType==2&&currentUserInfo.Id==scope.row.CreateBy &&(scope.row.ExamineStatus==0||scope.row.ExamineStatus==3||scope.row.ExamineStatus==4) ">
<q-item-section>
<q-item-label>{{scope.row.ExamineStatus==0?'提交审核':"重新提交审核"}}</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="publishExam(scope.row)"
v-if="scope.row.PaperType==2 &&currentUserInfo.Id==scope.row.CreateBy&&scope.row.ExamineStatus==2">
<q-item-section>
<q-item-label>发布考试</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="showPaperInfo(scope.row)" v-if="scope.row.PaperType==2">
<q-item-section>
<q-item-label>详情</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="movePaperInfo(scope.row)"
v-if="currentUserInfo.Id==scope.row.CreateBy">
<q-item-section>
<q-item-label>移动到</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="showOpenForm(scope.row)"
v-if="currentUserInfo.Id==scope.row.CreateBy||IsPaperManager">
<q-item-section>
<q-item-label>设置访问权限</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="copyPaperInfo(scope.row)" v-if="scope.row.PaperType==2">
<q-item-section>
<q-item-label>复制</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="deletePaperInfo(scope.row)"
v-if="currentUserInfo.Id==scope.row.CreateBy">
<q-item-section>
<q-item-label>删除</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</template>
</el-table-column>
</el-table>
<paperfolderForm v-if="isShowExamFolder" :saveObj="examObj" :FaParentId="msg.ParentId"  @close="closeExamForm"
 @success="refreshPage">
</paperfolderForm>
<movefolderForm v-if="isShowMoveFolder" :saveObj="examObj" :Ids="MoveIds"  @close="closeExamForm"
 @success="refreshPage">
</movefolderForm>
<setopenForm v-if="isShowSetOpenFolder" :saveObj="examObj"  @close="closeExamForm"  @success="refreshPage">
</setopenForm>
</div>
</template>
<script>
import paperfolderForm from '../../components/exam/paperfolder-form'
import movefolderForm from '../../components/exam/movefolder-form'
import setopenForm from '../../components/exam/setopen-form'
import {
deletePaperInfo,
copyPaperInfo,
submitApproval
} from '../../api/teacher/index';
export default {
components: {
paperfolderForm,
movefolderForm,
setopenForm
},
meta: {
title: "试卷库管理"
},
props: {
dataList: {
type: Array,
default: null
},
loading: {
type: Boolean,
default: null
}
},
data() {
return {
isShowExamFolder: false, //是否显示新增文件夹
isShowMoveFolder: false, //是否显示
isShowSetOpenFolder: false, //是否显示设置权限
examObj:{},
multipleSelection: [],
MoveIds: '',
currentUserInfo: {}, //当前登录用户
IsPaperManager:false
}
},
created() {
let userinfo = this.getLocalStorage();
this.currentUserInfo = userinfo;
userinfo.ActionMenuList.map(x => { //判断权限
if (x.FunctionCode == "Paper_Manager") { //判断是否是试卷管理员
this.IsPaperManager = true;
}
})
this.commonAccountId = this.currentUserInfo.AccountId;
},
mounted() {},
methods: {
isRender(row) {
if (row.row.CreateBy != this.currentUserInfo.Id) {
return 'disabled-column'
}
},
//提交审核,重新提交审核
submitAudit(item) {
submitApproval({
PaperId: item.PaperId
}).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功!',
position: 'top'
})
this.refreshPage();
}
})
},
//全选
handleSelectionChange(val) {
this.multipleSelection = val;
var myArray = [];
if (this.multipleSelection.length > 0) {
this.multipleSelection.forEach(x => {
if (x.CreateBy == this.currentUserInfo.Id) {
myArray.push(x.PaperId);
}
})
this.MoveIds = myArray.toString();
}
},
//移动文件
movePaperFile() {
if (this.multipleSelection.length == 0) {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择文件夹`
})
return
} else {
this.isShowMoveFolder = true;
}
},
rowsClick(row, column, event) {
this.$refs.examPaperTab.toggleRowExpansion(row);
},
getPaperChild(Id) {
this.msg.ParentId = Id;
this.refreshPage();
},
//点击编辑 跳转
goExameEdit(item) {
var obj = {
Id: 0,
ToParentId: this.msg.ParentId
}
if (item) {
obj.Id = item.PaperId;
obj.ToParentId = item.ParentId;
}
this.OpenNewUrl('/exam/paperEdit', obj)
},
//新增修改文件夹
showExamFolder(obj) {
this.examObj = obj;
this.isShowExamFolder = true;
},
//实在开放权限
showOpenForm(obj) {
this.examObj = obj;
this.isShowSetOpenFolder = true;
},
//关闭弹窗
closeExamForm() {
this.isShowExamFolder = false;
this.isShowMoveFolder = false;
this.isShowSetOpenFolder = false;
},
//发布考试
publishExam(item) {
let PaperId = 0;
if (item) {
PaperId = item.PaperId
}
this.OpenNewUrl('/exam/paperPublish', {
PaperId: PaperId
})
},
//试卷详情
showPaperInfo(item) {
let PaperId = 0;
if (item) {
PaperId = item.PaperId
}
this.OpenNewUrl('/exam/paperInfo', {
Id: PaperId
})
},
//移动到文件夹
movePaperInfo(item) {
this.examObj = item;
this.isShowMoveFolder = true;
},
//复制试卷
copyPaperInfo(item) {
var msg = {
PaperId: item.PaperId
}
var message = "是否要复制【" + item.PaperName + "】试卷?";
this.$q.dialog({
title: '提示信息',
message: message,
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
copyPaperInfo(msg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功!',
position: 'top'
})
this.refreshPage();
}
});
})
},
//批量删除
batchDelete() {
var msg = {
PaperIds: this.MoveIds
}
var message = "是否要删除选中的文件信息";
this.deletePaperCommon(msg, message);
},
//删除
deletePaperInfo(item) {
var msg = {
PaperId: item.PaperId
}
var message = "";
if (item.PaperType == 1) {
message = "是否要删除【" + item.PaperName + "】及下面的内容?";
} else {
message = "是否要删除【" + item.PaperName + "】试卷?"
}
this.deletePaperCommon(msg, message);
},
deletePaperCommon(msg, tipMsg) {
this.$q.dialog({
title: '提示信息',
message: tipMsg,
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
deletePaperInfo(msg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功!',
position: 'top'
})
this.refreshPage();
}
});
})
}
}
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
<style>
</style>
<!--试卷库管理-->
<template>
<div class="page-body">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input @change="getList" clearable filled v-model="msg.PaperName" @clear="getList" maxlength="20"
label="输入试卷名称" />
</div>
</div>
<div class="page-option"></div>
</div>
<div class="page-content">
<examForm :dataList="dataList" :loading="loading"></examForm>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</div>
</div>
</template>
<script>
import {
queryPublishExamPage,
submitExamApply,
deletePublishExam
} from "../../api/teacher/index";
//获取校区列表
import examForm from "../../components/exam/exam-form"
export default {
components: {
examForm
},
meta: {
title: "考卷管理",
},
data() {
return {
data: [],
msg: {
pageIndex: 1,
pageSize: 10,
rowsPerPage: 10,
PaperName: "", //试卷名称
},
pageCount: 0,
loading: false,
dataList: [],
expandKeys: [],
isShowExamFolder: false, //是否显示新增文件夹
examObj: {}, //弹窗对象
};
},
created() {},
mounted() {
this.getList();
},
methods: {
//删除考卷
deleteExamPublish(item) {
var delMsg = {
Id: item.Id
};
var tipMsg = "是否要删除【" + item.PaperName + "】试卷?删除后将无法恢复!";
this.$q.dialog({
title: '提示信息',
message: tipMsg,
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
deletePublishExam(delMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功!',
position: 'top'
})
this.refreshPage();
}
});
})
},
submitExamAudit(item) {
var msg = {
Id: item.Id
};
submitExamApply(msg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功!',
position: 'top'
})
this.refreshPage();
}
})
},
//修改考试相关
publishExam(item) {
this.OpenNewUrl("/exam/paperPublish", {
Id: item.Id,
});
},
//创建试卷
CreatePaper() {
this.OpenNewUrl("/exam/paperCreate", {});
},
//查看考生列表
seeExamineeList(item) {
this.OpenNewUrl("/exam/examineeManager", {
Id: item.Id,
});
},
//翻页
changePage(val) {
this.msg.pageIndex = val;
this.getList();
},
//获取菜单分页列表
getList() {
this.loading = true;
this.dataList = [];
queryPublishExamPage(this.msg)
.then((res) => {
this.loading = false;
this.dataList = res.Data.PageData;
this.pageCount = res.Data.PageCount;
})
.catch(() => {
this.loading = false;
});
},
//刷新页面
refreshPage() {
this.getList();
},
//关闭弹窗
closeExamForm() {
this.isShowExamFolder = false;
},
},
};
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
<style>
.Exam_PaperName {
width: 300px;
display: inline;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.Exam_PaperName i {
font-size: 18px;
}
.examPaper .el-table th {
background-color: #F5F6F7;
}
.examPNav {
margin: 10px 0;
color: #3A8BFF;
font-size: 12px;
}
.examPNav span {
cursor: pointer;
}
.examPNav span:hover {
text-decoration: underline;
}
.lastExam {
color: #6B89B3;
cursor: default !important;
pointer-events: none;
}
.disabled-column .el-checkbox__input {
display: none;
}
</style>
<!--试卷库管理-->
<template>
<div class="page-body">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input @change="getList" clearable filled v-model="msg.PaperName" @clear="getList" maxlength="20"
label="输入试卷名称、组卷人查找" />
<div style="margin-top:15px;">
<q-btn v-if="multipleSelection&&multipleSelection.length>0" color="accent" size="sm" class="q-mr-md"
@click="movePaperFile()" label="移动到" />
<q-btn v-if="multipleSelection&&multipleSelection.length>0" color="accent" size="sm" class="q-mr-md"
label="删除" @click="batchDelete()" />
</div>
</div>
</div>
<div class="page-option">
<q-btn color="accent" size="sm" v-if="IsCreateFolder" class="q-mr-md" label="新增文件夹"
@click="showExamFolder(null)" />
<q-btn-dropdown flat size="xs" color="dark" label="新增试卷" v-if="IsCreatePaper" style="margin-left:10px;">
<q-list>
<q-item clickable v-close-popup @click="CreatePaper()">
<q-item-section>
<q-item-label>智能组卷</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="goExameEdit(null)">
<q-item-section>
<q-item-label>手动组卷</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
</div>
<div class="page-content examPaper">
<div v-if="navList&&navList.length>0" class="examPNav">
<span @click="getPaperChild(0)">全部</span> >
<template v-for="(item,index) in navList">
<span @click="getPaperChild(item.PaperId)" :class="{'lastExam':index==navList.length-1}" :key="index">
{{item.PaperName}}
</span>
<span v-if="index!=navList.length-1" :key="index">></span>
</template>
</div>
<el-table :data="dataList" v-loading="loading" ref="multipleTable" :cell-class-name="isRender"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column prop="PaperName" label="文件夹/试卷" width="300">
<template slot-scope="scope">
<div class="Exam_PaperName">
<i v-if="scope.row.PaperType==1" title="文件夹" class="iconfont icon-weibiaoti5" style="color:#85CDFD;"></i>
<i v-if="scope.row.PaperType==2" title="试卷" class="iconfont icon-icon-test1" style="color:#85CDFD;"></i>
<div class="Exam_PaperName">
<template v-if="scope.row.PaperType==1">
<span style="cursor:pointer;" @click="getPaperChild(scope.row.PaperId)">
{{ scope.row.PaperName }}</span>
</template>
<template v-else>
{{ scope.row.PaperName }}
<q-tooltip v-if="scope.row.PaperName.length>10" :offset="[10, 10]">{{ scope.row.PaperName }}
</q-tooltip>
</template>
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="QuestionCount" label="题量">
<template slot-scope="scope">
<template v-if="scope.row.PaperType==1">
---
</template>
<template v-if="scope.row.PaperType==2">
{{ scope.row.QuestionCount }}
</template>
</template>
</el-table-column>
<el-table-column prop="DifficultyTypeName" label="难度">
<template slot-scope="scope">
<template v-if="scope.row.PaperType==1">
---
</template>
<template v-if="scope.row.PaperType==2">
{{ scope.row.DifficultyTypeName }}
</template>
</template>
</el-table-column>
<el-table-column prop="PublishCount" label="发布考试次数">
<template slot-scope="scope">
<template v-if="scope.row.PaperType==1">
---
</template>
<template v-if="scope.row.PaperType==2">
{{ scope.row.PublishCount }}
</template>
</template>
</el-table-column>
<el-table-column prop="OpenStr" label="开放状态">
<template slot-scope="scope">
{{ scope.row.OpenStr }}
</template>
</el-table-column>
<el-table-column prop="CreateByName" label="创建人">
<template slot-scope="scope">
{{ scope.row.CreateByName }}
</template>
</el-table-column>
<el-table-column prop="CreateTimeStr" label="创建时间" width="148">
<template slot-scope="scope">
{{ scope.row.CreateTimeStr }}
</template>
</el-table-column>
<el-table-column prop="ReviewerName" label="审核人">
<template slot-scope="scope">
{{ scope.row.ReviewerName }}
</template>
</el-table-column>
<el-table-column prop="ExamineStatusStr" label="状态">
<template slot-scope="scope">
{{ scope.row.ExamineStatusStr }}
<template v-if="scope.row.ExamineRemark">
<q-tooltip :offset="[10, 10]">驳回原因:{{ scope.row.ExamineRemark }}
</q-tooltip>
</template>
</template>
</el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<template v-if="scope.row.PaperType==1">
<q-btn flat size="xs" color="primary" style="font-weight:400" @click="showExamFolder(scope.row)"
label="重命名" v-if="currentUserInfo.Id==scope.row.CreateBy" />
</template>
<template v-if="scope.row.PaperType==2">
<q-btn flat size="xs" color="primary" style="font-weight:400" @click="goExameEdit(scope.row)" label="编辑"
v-if="currentUserInfo.Id==scope.row.CreateBy &&(scope.row.ExamineStatus==0||scope.row.ExamineStatus==3||scope.row.ExamineStatus==4)" />
</template>
<q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left: 10px">
<q-list>
<q-item clickable v-close-popup @click="submitAudit(scope.row)"
v-if="scope.row.PaperType==2&&currentUserInfo.Id==scope.row.CreateBy &&(scope.row.ExamineStatus==0||scope.row.ExamineStatus==3||scope.row.ExamineStatus==4) ">
<q-item-section>
<q-item-label>{{scope.row.ExamineStatus==0?'提交审核':"重新提交审核"}}</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="publishExam(scope.row)"
v-if="scope.row.PaperType==2 &&currentUserInfo.Id==scope.row.CreateBy&&scope.row.ExamineStatus==2">
<q-item-section>
<q-item-label>发布考试</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="showPaperInfo(scope.row)" v-if="scope.row.PaperType==2">
<q-item-section>
<q-item-label>详情</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="movePaperInfo(scope.row)"
v-if="currentUserInfo.Id==scope.row.CreateBy">
<q-item-section>
<q-item-label>移动到</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="showOpenForm(scope.row)"
v-if="currentUserInfo.Id==scope.row.CreateBy||IsPaperManager">
<q-item-section>
<q-item-label>设置访问权限</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="copyPaperInfo(scope.row)" v-if="scope.row.PaperType==2">
<q-item-section>
<q-item-label>复制</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="deletePaperInfo(scope.row)"
v-if="currentUserInfo.Id==scope.row.CreateBy">
<q-item-section>
<q-item-label>删除</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</template>
</el-table-column>
</el-table>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</div>
<paperfolderForm v-if="isShowExamFolder" :saveObj="examObj" :FaParentId="msg.ParentId"  @close="closeExamForm"
 @success="refreshPage">
</paperfolderForm>
<movefolderForm v-if="isShowMoveFolder" :saveObj="examObj" :Ids="MoveIds"  @close="closeExamForm"
 @success="refreshPage">
</movefolderForm>
<setopenForm v-if="isShowSetOpenFolder" :saveObj="examObj"  @close="closeExamForm"  @success="refreshPage">
</setopenForm>
</div>
</template>
<script>
import paperfolderForm from '../../components/exam/paperfolder-form'
import movefolderForm from '../../components/exam/movefolder-form'
import setopenForm from '../../components/exam/setopen-form'
import {
GetPaperPage,
deletePaperInfo,
copyPaperInfo,
submitApproval
} from '../../api/teacher/index';
//获取校区列表
export default {
components: {
paperfolderForm,
movefolderForm,
setopenForm
},
meta: {
title: "考试管理"
},
data() {
return {
data: [],
msg: {
pageIndex: 1,
pageSize: 10,
rowsPerPage: 10,
PaperName: '', //题库名
ParentId: 0,
},
pageCount: 0,
loading: false,
dataList: [],
isShowExamFolder: false, //是否显示新增文件夹
isShowMoveFolder: false, //是否显示
isShowSetOpenFolder: false, //是否显示设置权限
examObj: {}, //弹窗对象
navList: [], //导航列表
IsCreateFolder: false, //是否试卷创建文件夹权限
IsCreatePaper: false, //是否创建试卷权限
IsPaperManager: false, //是否有试卷管理员权限
multipleSelection: [],
MoveIds: '',
currentUserInfo: {}, //当前登录用户
}
},
created() {
let userinfo = this.getLocalStorage();
this.currentUserInfo = userinfo;
userinfo.ActionMenuList.map(x => { //判断权限
if (x.FunctionCode == "Paper_CreateManager") { //判断是否试卷创建文件夹权限
this.IsCreateFolder = true;
}
if (x.FunctionCode == "Paper_CreatePaper") { //判断是否有创建试卷权限
this.IsCreatePaper = true;
}
if (x.FunctionCode == "Paper_Manager") { //判断是否是试卷管理员
this.IsPaperManager = true;
}
})
},
mounted() {
this.getList();
},
methods: {
isRender(row) {
if (row.row.CreateBy != this.currentUserInfo.Id) {
return 'disabled-column'
}
},
//提交审核,重新提交审核
submitAudit(item) {
submitApproval({
PaperId: item.PaperId
}).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功!',
position: 'top'
})
this.refreshPage();
}
})
},
//全选
handleSelectionChange(val) {
this.multipleSelection = val;
var myArray = [];
if (this.multipleSelection.length > 0) {
this.multipleSelection.forEach(x => {
if (x.CreateBy == this.currentUserInfo.Id) {
myArray.push(x.PaperId);
}
})
this.MoveIds = myArray.toString();
}
},
//移动文件
movePaperFile() {
if (this.multipleSelection.length == 0) {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择文件夹`
})
return
} else {
this.isShowMoveFolder = true;
}
},
rowsClick(row, column, event) {
this.$refs.examPaperTab.toggleRowExpansion(row);
},
//创建试卷
CreatePaper() {
this.OpenNewUrl('/exam/paperCreate', {
ToParentId: this.msg.ParentId
})
},
//翻页
changePage(val) {
this.msg.pageIndex = val;
this.getList()
},
getPaperChild(Id) {
this.msg.ParentId = Id;
this.refreshPage();
},
//获取菜单分页列表
getList() {
this.loading = true;
this.dataList = [];
GetPaperPage(this.msg).then(res => {
this.loading = false;
if (res.Code == 1) {
this.dataList = res.Data.pageModel.PageData;
this.pageCount = res.Data.pageModel.PageCount;
this.navList = res.Data.navList;
}
}).catch(() => {
this.loading = false
})
},
//刷新页面
refreshPage() {
this.getList();
},
//点击编辑 跳转
goExameEdit(item) {
var obj = {
Id: 0,
ToParentId: this.msg.ParentId
}
if (item) {
obj.Id = item.PaperId;
obj.ToParentId = item.ParentId;
}
this.OpenNewUrl('/exam/paperEdit', obj)
},
//新增修改文件夹
showExamFolder(obj) {
this.examObj = obj;
this.isShowExamFolder = true;
},
//实在开放权限
showOpenForm(obj) {
this.examObj = obj;
this.isShowSetOpenFolder = true;
},
//关闭弹窗
closeExamForm() {
this.isShowExamFolder = false;
this.isShowMoveFolder = false;
this.isShowSetOpenFolder = false;
},
//发布考试
publishExam(item) {
let PaperId = 0;
if (item) {
PaperId = item.PaperId
}
this.OpenNewUrl('/exam/paperPublish', {
PaperId: PaperId
})
},
//试卷详情
showPaperInfo(item) {
let PaperId = 0;
if (item) {
PaperId = item.PaperId
}
this.OpenNewUrl('/exam/paperInfo', {
Id: PaperId
})
},
//移动到文件夹
movePaperInfo(item) {
this.examObj = item;
this.isShowMoveFolder = true;
},
//复制试卷
copyPaperInfo(item) {
var msg = {
PaperId: item.PaperId
}
var message = "是否要复制【" + item.PaperName + "】试卷?";
this.$q.dialog({
title: '提示信息',
message: message,
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
copyPaperInfo(msg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功!',
position: 'top'
})
this.refreshPage();
}
});
})
},
//批量删除
batchDelete() {
var msg = {
PaperIds: this.MoveIds
}
var message = "是否要删除选中的文件信息";
this.deletePaperCommon(msg, message);
},
//删除
deletePaperInfo(item) {
var msg = {
PaperId: item.PaperId
}
var message = "";
if (item.PaperType == 1) {
message = "是否要删除【" + item.PaperName + "】及下面的内容?";
} else {
message = "是否要删除【" + item.PaperName + "】试卷?"
}
this.deletePaperCommon(msg, message);
},
deletePaperCommon(msg, tipMsg) {
this.$q.dialog({
title: '提示信息',
message: tipMsg,
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
deletePaperInfo(msg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功!',
position: 'top'
})
this.refreshPage();
}
});
})
}
}
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
<style>
.OtherCourseNum {
display: inline-block;
width: 25px;
height: 25px;
text-align: center;
line-height: 25px;
border: 1px solid #2961FE;
border-radius: 50%;
cursor: pointer;
color: #2961FE;
}
.OCourseTable {
width: 400px;
text-align: center;
}
.OCourseTable tr td {
height: 40px;
}
.OCourseTable tr th {
height: 40px;
background-color: rgb(238, 238, 239);
}
.Exam_PaperName {
width: 300px;
display: inline;
......@@ -34,11 +60,9 @@
cursor: default !important;
pointer-events: none;
}
.disabled-column .el-checkbox__input {
display: none;
.disabled-column .el-checkbox__input{
display:none;
}
</style>
<!--试卷库管理-->
<template>
......@@ -48,12 +72,6 @@
<div class="col-3">
<q-input @change="getList" clearable filled v-model="msg.PaperName" @clear="getList" maxlength="20"
label="输入试卷名称、组卷人查找" />
<div style="margin-top:15px;">
<q-btn v-if="multipleSelection&&multipleSelection.length>0" color="accent" size="sm" class="q-mr-md"
@click="movePaperFile()" label="移动到" />
<q-btn v-if="multipleSelection&&multipleSelection.length>0" color="accent" size="sm" class="q-mr-md"
label="删除" @click="batchDelete()" />
</div>
</div>
</div>
<div class="page-option">
......@@ -85,162 +103,14 @@
<span v-if="index!=navList.length-1" :key="index">></span>
</template>
</div>
<el-table :data="dataList" v-loading="loading" ref="multipleTable" :cell-class-name="isRender"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column prop="PaperName" label="文件夹/试卷" width="300">
<template slot-scope="scope">
<div class="Exam_PaperName">
<i v-if="scope.row.PaperType==1" title="文件夹" class="iconfont icon-weibiaoti5" style="color:#85CDFD;"></i>
<i v-if="scope.row.PaperType==2" title="试卷" class="iconfont icon-icon-test1" style="color:#85CDFD;"></i>
<div class="Exam_PaperName">
<template v-if="scope.row.PaperType==1">
<span style="cursor:pointer;" @click="getPaperChild(scope.row.PaperId)">
{{ scope.row.PaperName }}</span>
</template>
<template v-else>
{{ scope.row.PaperName }}
<q-tooltip v-if="scope.row.PaperName.length>10" :offset="[10, 10]">{{ scope.row.PaperName }}
</q-tooltip>
</template>
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="QuestionCount" label="题量">
<template slot-scope="scope">
<template v-if="scope.row.PaperType==1">
---
</template>
<template v-if="scope.row.PaperType==2">
{{ scope.row.QuestionCount }}
</template>
</template>
</el-table-column>
<el-table-column prop="DifficultyTypeName" label="难度">
<template slot-scope="scope">
<template v-if="scope.row.PaperType==1">
---
</template>
<template v-if="scope.row.PaperType==2">
{{ scope.row.DifficultyTypeName }}
</template>
</template>
</el-table-column>
<el-table-column prop="PublishCount" label="发布考试次数">
<template slot-scope="scope">
<template v-if="scope.row.PaperType==1">
---
</template>
<template v-if="scope.row.PaperType==2">
{{ scope.row.PublishCount }}
</template>
</template>
</el-table-column>
<el-table-column prop="OpenStr" label="开放状态">
<template slot-scope="scope">
{{ scope.row.OpenStr }}
</template>
</el-table-column>
<el-table-column prop="CreateByName" label="创建人">
<template slot-scope="scope">
{{ scope.row.CreateByName }}
</template>
</el-table-column>
<el-table-column prop="CreateTimeStr" label="创建时间" width="148">
<template slot-scope="scope">
{{ scope.row.CreateTimeStr }}
</template>
</el-table-column>
<el-table-column prop="ReviewerName" label="审核人">
<template slot-scope="scope">
{{ scope.row.ReviewerName }}
</template>
</el-table-column>
<el-table-column prop="ExamineStatusStr" label="状态">
<template slot-scope="scope">
{{ scope.row.ExamineStatusStr }}
<template v-if="scope.row.ExamineRemark">
<q-tooltip :offset="[10, 10]">驳回原因:{{ scope.row.ExamineRemark }}
</q-tooltip>
</template>
</template>
</el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<template v-if="scope.row.PaperType==1">
<q-btn flat size="xs" color="primary" style="font-weight:400" @click="showExamFolder(scope.row)"
label="重命名" v-if="currentUserInfo.Id==scope.row.CreateBy" />
</template>
<template v-if="scope.row.PaperType==2">
<q-btn flat size="xs" color="primary" style="font-weight:400" @click="goExameEdit(scope.row)" label="编辑"
v-if="currentUserInfo.Id==scope.row.CreateBy &&(scope.row.ExamineStatus==0||scope.row.ExamineStatus==3||scope.row.ExamineStatus==4)" />
</template>
<q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left: 10px">
<q-list>
<q-item clickable v-close-popup @click="submitAudit(scope.row)"
v-if="scope.row.PaperType==2&&currentUserInfo.Id==scope.row.CreateBy &&(scope.row.ExamineStatus==0||scope.row.ExamineStatus==3||scope.row.ExamineStatus==4) ">
<q-item-section>
<q-item-label>{{scope.row.ExamineStatus==0?'提交审核':"重新提交审核"}}</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="publishExam(scope.row)"
v-if="scope.row.PaperType==2 &&currentUserInfo.Id==scope.row.CreateBy&&scope.row.ExamineStatus==2">
<q-item-section>
<q-item-label>发布考试</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="showPaperInfo(scope.row)" v-if="scope.row.PaperType==2">
<q-item-section>
<q-item-label>详情</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="movePaperInfo(scope.row)"
v-if="currentUserInfo.Id==scope.row.CreateBy">
<q-item-section>
<q-item-label>移动到</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="showOpenForm(scope.row)"
v-if="currentUserInfo.Id==scope.row.CreateBy||IsPaperManager">
<q-item-section>
<q-item-label>设置访问权限</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="copyPaperInfo(scope.row)" v-if="scope.row.PaperType==2">
<q-item-section>
<q-item-label>复制</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="deletePaperInfo(scope.row)"
v-if="currentUserInfo.Id==scope.row.CreateBy">
<q-item-section>
<q-item-label>删除</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</template>
</el-table-column>
</el-table>
<examPaperForm :dataList="dataList" ref="examPaper" :loading="loading"></examPaperForm>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</div>
<paperfolderForm v-if="isShowExamFolder" :saveObj="examObj" :FaParentId="msg.ParentId"  @close="closeExamForm"
 @success="refreshPage">
</paperfolderForm>
<movefolderForm v-if="isShowMoveFolder" :saveObj="examObj" :Ids="MoveIds"  @close="closeExamForm"
 @success="refreshPage">
</movefolderForm>
<setopenForm v-if="isShowSetOpenFolder" :saveObj="examObj"  @close="closeExamForm"  @success="refreshPage">
</setopenForm>
</div>
</template>
<script>
import paperfolderForm from '../../components/exam/paperfolder-form'
import movefolderForm from '../../components/exam/movefolder-form'
import setopenForm from '../../components/exam/setopen-form'
import examPaperForm from '../../components/exam/exam-paperform'
import {
GetPaperPage,
deletePaperInfo,
......@@ -250,9 +120,7 @@
//获取校区列表
export default {
components: {
paperfolderForm,
movefolderForm,
setopenForm
examPaperForm
},
meta: {
title: "考试管理"
......@@ -277,10 +145,9 @@
navList: [], //导航列表
IsCreateFolder: false, //是否试卷创建文件夹权限
IsCreatePaper: false, //是否创建试卷权限
IsPaperManager: false, //是否有试卷管理员权限
multipleSelection: [],
MoveIds: '',
currentUserInfo: {}, //当前登录用户
commonAccountId:-1,
}
},
created() {
......@@ -293,63 +160,12 @@
if (x.FunctionCode == "Paper_CreatePaper") { //判断是否有创建试卷权限
this.IsCreatePaper = true;
}
if (x.FunctionCode == "Paper_Manager") { //判断是否是试卷管理员
this.IsPaperManager = true;
}
})
},
mounted() {
this.getList();
},
methods: {
isRender(row) {
if (row.row.CreateBy != this.currentUserInfo.Id) {
return 'disabled-column'
}
},
//提交审核,重新提交审核
submitAudit(item) {
submitApproval({
PaperId: item.PaperId
}).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功!',
position: 'top'
})
this.refreshPage();
}
})
},
//全选
handleSelectionChange(val) {
this.multipleSelection = val;
var myArray = [];
if (this.multipleSelection.length > 0) {
this.multipleSelection.forEach(x => {
if (x.CreateBy == this.currentUserInfo.Id) {
myArray.push(x.PaperId);
}
})
this.MoveIds = myArray.toString();
}
},
//移动文件
movePaperFile() {
if (this.multipleSelection.length == 0) {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择文件夹`
})
return
} else {
this.isShowMoveFolder = true;
}
},
rowsClick(row, column, event) {
this.$refs.examPaperTab.toggleRowExpansion(row);
},
......@@ -513,6 +329,7 @@
});
})
}
}
}
......
......@@ -14,48 +14,9 @@
<div class="page-option"></div>
</div>
<div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat
class="sticky-column-table sticky-right-column-table" separator="none" :data="dataList" :columns="columns"
row-key="name">
<template v-slot:top="props">
<div class="col-2 q-table__title">考试管理</div>
<q-space />
</template>
<template v-slot:body-cell-StartTime="props">
<q-td :props="props">
{{ props.row.StartTime }} -- {{ props.row.EndTime }}
</q-td>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" color="accent" style="font-weight: 400" label="修改" @click="publishExam(props.row)" />
<q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left: 10px">
<q-list>
<q-item clickable v-close-popup @click="submitExamAudit(props.row)"
v-if="props.row.ExamineStatus==0||props.row.ExamineStatus==3||props.row.ExamineStatus==4">
<q-item-section>
<q-item-label>{{props.row.ExamineStatus==0?'提交审核':"重新提交审核"}}</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="seeExamineeList(props.row)">
<q-item-section>
<q-item-label>考生管理</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="deleteExamPublish(props.row)" v-if="props.row.ExamineStatus!=2">
<q-item-section>
<q-item-label>删除</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</q-td>
</template>
</q-table>
<examForm :dataList="dataList" :loading="loading"></examForm>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</div>
</div>
</template>
......@@ -66,8 +27,11 @@
deletePublishExam
} from "../../api/teacher/index";
//获取校区列表
import examForm from "../../components/exam/exam-form"
export default {
components: {},
components: {
examForm
},
meta: {
title: "考卷管理",
},
......@@ -80,60 +44,6 @@
rowsPerPage: 10,
PaperName: "", //试卷名称
},
columns: [{
name: "Id",
label: "编号",
field: "Id",
align: "left",
},
{
name: "PaperName",
label: "试卷名称",
field: "PaperName",
align: "left",
},
{
name: "CreateByName",
label: "创建人",
field: "CreateByName",
align: "left",
},
{
name: "StudentCount",
label: "考生人数",
field: "StudentCount",
align: "left",
},
{
name: "StartTime",
label: "考试时间",
field: "StartTime",
align: "left",
},
{
name: "ExamTimes",
label: "考试时长",
field: "ExamTimes",
align: "left",
},
{
name: "ReviewerName",
label: "审核人",
field: "ReviewerName",
align: "left",
},
{
name: "ExamineStatusStr",
label: "状态",
field: "ExamineStatusStr",
align: "left",
},
{
name: "optioned",
label: "操作",
field: "Id",
},
],
pageCount: 0,
loading: false,
dataList: [],
......
......@@ -957,6 +957,16 @@ const routes = [{
component: () =>
import("pages/course/jobinfo.vue")
},
{
path: "/course/ExamManage", //考试管理
component: () =>
import("pages/course/ExamManage.vue")
},
{
path: "/course/examPaper", //试卷库管理
component: () =>
import("pages/course/examPaper.vue")
},
{
path: "/studyAbroad/studyabroad", //留学
component: () =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment