master V1.0.0
yujialong 4 years ago
parent 1c1c28a93a
commit dfa5632b29
  1. 5
      src/components/breadcrumb/index.vue
  2. 2
      src/components/testPaperDetail/index.vue
  3. 8
      src/layouts/navbar/index.vue
  4. 2
      src/libs/auth/generateBtnPermission.js
  5. 8
      src/pages/achievement/list/examResults.vue
  6. 4
      src/pages/achievement/list/index.vue
  7. 14
      src/pages/achievement/list/practiceResults.vue
  8. 10
      src/pages/achievement/list/wrongBook.vue
  9. 4
      src/pages/assessment/detail/index.vue
  10. 50
      src/pages/assessment/doReview/index.vue
  11. 14
      src/pages/assessment/list/index.vue
  12. 4
      src/pages/assessment/list/studentSide.vue
  13. 2
      src/pages/assessment/monitor/index.vue
  14. 27
      src/pages/assessment/review/index.vue
  15. 8
      src/pages/assessment/scoreQuery/index.vue
  16. 7
      src/pages/index/list/index.vue
  17. 4
      src/pages/practice/detail/index.vue
  18. 85
      src/pages/practice/doReview/index.vue
  19. 9
      src/pages/practice/list/index.vue
  20. 30
      src/pages/practice/result/index.vue
  21. 29
      src/pages/practice/review/index.vue
  22. 6
      src/pages/practice/scoreQuery/index.vue
  23. 26
      src/pages/quesBank/list/index.vue
  24. 6
      src/pages/quesBank/list/myQuesBank.vue
  25. 13
      src/pages/quesBank/list/quesDialog.vue
  26. 569
      src/pages/student/list/index.vue
  27. 390
      src/pages/student/list/organization.vue
  28. 553
      src/pages/student/list/student.vue
  29. 30
      src/pages/system/list/index.vue
  30. 12
      src/pages/system/list/organization.vue
  31. 9
      src/pages/system/list/role.vue
  32. 6
      src/pages/system/list/staff.vue
  33. 8
      src/pages/testPaper/add/index.vue
  34. 4
      src/pages/testPaper/list/allTestPaper.vue
  35. 4
      src/pages/testPaper/list/index.vue
  36. 3
      src/pages/testPaper/list/myTestPaper.vue
  37. 2
      src/setting.js
  38. 2
      src/store/modules/practice.js
  39. 11
      src/styles/common.scss

@ -3,7 +3,7 @@
<span class="cur">当前位置</span> <span class="cur">当前位置</span>
<el-breadcrumb separator="/"> <el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">教师管理端</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/' }">教师管理端</el-breadcrumb-item>
<el-breadcrumb-item v-for="(item,index) in pages" :key="index" :to="{ path: index == pages.length - 1 ? curRoute : route }">{{item}}</el-breadcrumb-item> <el-breadcrumb-item v-for="(item,index) in pages" :key="index" :to="{ path: index == pages.length - 1 ? curRoute : path }">{{item}}</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</div> </div>
</template> </template>
@ -14,7 +14,8 @@ export default {
data() { data() {
return { return {
pages: this.data.split('/'), pages: this.data.split('/'),
curRoute: this.$route.path curRoute: this.$route.path,
path: this.route ? this.route : 'list'
}; };
}, },
methods: { methods: {

@ -132,7 +132,7 @@ export default {
answer.push(n[j]) answer.push(n[j])
} }
} }
n.answer = answer.join('|') n.answer = answer.join('')
} }
}) })
} }

@ -109,15 +109,17 @@ export default {
], ],
menus: [], menus: [],
actives: { actives: {
index: ['index-add'], testPaper: ['testPaper-add','testPaper-show'],
practice: ['practice-review','practice-result','practice-doReview','practice-scoreQuery','practice-detail'],
assessment: ['assessment-monitor','assessment-review','assessment-doReview','assessment-scoreQuery','assessment-detail'],
} }
}; }
}, },
computed: { computed: {
onRoutes() { onRoutes() {
let actives = this.actives let actives = this.actives
for(let i in this.actives){ for(let i in this.actives){
if(actives[i].includes(this.$route.name)) return `/${i}` if(actives[i].includes(this.$route.name)) return `/${i}/list`
} }
return this.$route.path return this.$route.path
}, },

@ -21,7 +21,5 @@ export default function(data){
}) })
} }
}) })
// console.log(33,result,store)
store.dispatch('auth/addBtnAuth',result) store.dispatch('auth/addBtnAuth',result)
// console.log('geneBtn:',result)
} }

@ -4,7 +4,7 @@
<ul class="filter"> <ul class="filter">
<li> <li>
<label>考试班级</label> <label>考试班级</label>
<el-select v-model="classId" clearable placeholder="请选择考试班级" size="small" @change="getAssess"> <el-select v-model="classId" placeholder="请选择考试班级" size="small" @change="getAssess">
<el-option v-for="(item,index) in classList" :key="index" :label="item.className" :value="item.classId"></el-option> <el-option v-for="(item,index) in classList" :key="index" :label="item.className" :value="item.classId"></el-option>
</el-select> </el-select>
</li> </li>
@ -20,8 +20,8 @@
</li> </li>
</ul> </ul>
<div> <div>
<el-button type="primary" size="small" round @click="toStat" v-auth="'/achievement/list:考试成绩:成绩统计'">班级成绩分析报告</el-button> <el-button type="primary" size="small" round @click="toStat" v-auth="'/achievement/list:考试成绩:班级成绩分析报告'">班级成绩分析报告</el-button>
<el-button type="primary" size="small" round @click="exportData" v-auth="'/achievement/list:考试成绩:导出'">导出成绩表</el-button> <el-button type="primary" size="small" round @click="exportData" v-auth="'/achievement/list:考试成绩:导出成绩表'">导出成绩表</el-button>
</div> </div>
</div> </div>
@ -48,7 +48,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="show(scope.row)" v-auth="'/achievement/list:考试成绩:查看详情'">查看答卷</el-button> <el-button type="text" @click="show(scope.row)" v-auth="'/achievement/list:考试成绩:查看答卷'">查看答卷</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

@ -8,7 +8,7 @@
<div class="page-content"> <div class="page-content">
<practice-results v-if="active == 'practice'" v-auth="'成绩管理:练习成绩'"></practice-results> <practice-results v-if="active == 'practice'" v-auth="'成绩管理:练习成绩'"></practice-results>
<exam-results v-else-if="active == 'exam'" v-auth="'成绩管理:考试成绩'"></exam-results> <exam-results v-else-if="active == 'exam'" v-auth="'成绩管理:考试成绩'"></exam-results>
<wrong-book v-else v-auth="'成绩管理:错题收藏'"></wrong-book> <wrong-book v-else v-auth="'成绩管理:错题合集'"></wrong-book>
</div> </div>
</div> </div>
</div> </div>
@ -53,7 +53,7 @@ export default {
initTabs(){ initTabs(){
let tab1 = this.btns.includes('成绩管理:练习成绩') let tab1 = this.btns.includes('成绩管理:练习成绩')
let tab2 = this.btns.includes('成绩管理:考试成绩') let tab2 = this.btns.includes('成绩管理:考试成绩')
let tab3 = this.btns.includes('成绩管理:错题收藏') let tab3 = this.btns.includes('成绩管理:错题合集')
if(!tab1 && tab2){ if(!tab1 && tab2){
this.active = 'exam' this.active = 'exam'

@ -3,14 +3,14 @@
<div class="tool"> <div class="tool">
<ul class="filter"> <ul class="filter">
<li> <li>
<label>教学班级</label> <label>练习班级</label>
<el-select v-model="classId" clearable placeholder="请选择教学班级" size="small" @change="getPrac"> <el-select v-model="classId" placeholder="请选择教学班级" size="small" @change="getPrac">
<el-option v-for="(item,index) in classList" :key="index" :label="item.className" :value="item.classId"></el-option> <el-option v-for="(item,index) in classList" :key="index" :label="item.className" :value="item.classId"></el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
<label>练习名称</label> <label>练习名称</label>
<el-select v-model="practiseId" clearable placeholder="请选择练习名称" size="small" @change="getData"> <el-select v-model="practiseId" placeholder="请选择练习名称" size="small" @change="getData">
<el-option v-for="(item,index) in practiceNameList" :key="index" :label="item.practiseName" :value="item.practiseId"></el-option> <el-option v-for="(item,index) in practiceNameList" :key="index" :label="item.practiseName" :value="item.practiseId"></el-option>
</el-select> </el-select>
</li> </li>
@ -20,7 +20,7 @@
</li> </li>
</ul> </ul>
<div> <div>
<el-button type="primary" size="small" round @click="exportData" v-auth="'/achievement/list:练习成绩:导出'">导出成绩表</el-button> <el-button type="primary" size="small" round @click="exportData" v-auth="'/achievement/list:练习成绩:导出成绩表'">导出成绩表</el-button>
</div> </div>
</div> </div>
@ -49,7 +49,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="showDetail(scope.row)" v-auth="'/achievement/list:练习成绩:查看详情'">查看练习历史</el-button> <el-button type="text" @click="showDetail(scope.row)" v-auth="'/achievement/list:练习成绩:查看练习历史'">查看练习历史</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -92,8 +92,8 @@
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="detailVisible = false">取消</el-button> <el-button size="small" @click="detailVisible = false">取消</el-button>
<el-button type="primary">确定</el-button> <el-button size="small" type="primary">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>

@ -4,19 +4,19 @@
<ul class="filter"> <ul class="filter">
<li> <li>
<label>错题来源</label> <label>错题来源</label>
<el-select v-model="type" clearable placeholder="请选择错题来源" size="small" @change="getName"> <el-select v-model="type" placeholder="请选择错题来源" size="small" @change="getName">
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
<li v-if="type == 2"> <li v-if="type == 2">
<label>练习名称</label> <label>练习名称</label>
<el-select v-model="name" clearable placeholder="请选择练习名称" size="small" @change="getData"> <el-select v-model="name" placeholder="请选择练习名称" size="small" @change="getData">
<el-option v-for="(item,index) in nameList" :key="index" :label="item.practiseName" :value="item.practiseId"></el-option> <el-option v-for="(item,index) in nameList" :key="index" :label="item.practiseName" :value="item.practiseId"></el-option>
</el-select> </el-select>
</li> </li>
<li v-else> <li v-else>
<label>考试名称</label> <label>考试名称</label>
<el-select v-model="name" clearable placeholder="请选择考试名称" size="small" @change="getData"> <el-select v-model="name" placeholder="请选择考试名称" size="small" @change="getData">
<el-option v-for="(item,index) in nameList" :key="index" :label="item.assessmentName" :value="item.id"></el-option> <el-option v-for="(item,index) in nameList" :key="index" :label="item.assessmentName" :value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
@ -44,8 +44,8 @@
<el-table-column prop="wrongNum" label="错题次数" align="center"></el-table-column> <el-table-column prop="wrongNum" label="错题次数" align="center"></el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="show(scope.row,1)" v-auth="'/achievement/list:错题收藏:查看'">查看题目</el-button> <el-button type="text" @click="show(scope.row,1)" v-auth="'/achievement/list:错题合集:查看题目'">查看题目</el-button>
<el-button type="text" @click="showNum(scope.row)">历史统计</el-button> <el-button type="text" @click="showNum(scope.row)" v-auth="'/achievement/list:错题合集:历史统计'">历史统计</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

@ -3,7 +3,7 @@
<breadcrumb :data="'考试管理/成绩详情'"></breadcrumb> <breadcrumb :data="'考试管理/成绩详情'"></breadcrumb>
<div class="page"> <div class="page">
<div class="page-content"> <div class="page-content">
<h1 class="title">{{paperName }}</h1> <h1 class="title">{{paperName}}</h1>
<div class="metas"> <div class="metas">
<div class="m-r-20"> <div class="m-r-20">
<span class="name">总分</span> <span class="name">总分</span>
@ -31,7 +31,7 @@
<div class="wrap"> <div class="wrap">
<div class="item" v-for="(item,index) in curType" :key="index"> <div class="item" v-for="(item,index) in curType" :key="index">
<div class="type" :class="{wrong: item.question_score == 0,yet: item.question_score == null}"> <div class="type" :class="{wrong: item.question_score <= 0,yet: item.question_score == null}">
<span>序号{{index+1}}</span> <span>序号{{index+1}}</span>
<span>得分{{item.question_score}}</span> <span>得分{{item.question_score}}</span>
</div> </div>

@ -1,9 +1,13 @@
<template> <template>
<div class="box"> <div class="box">
<breadcrumb :data="'考管理/查看试题'"></breadcrumb> <breadcrumb :data="'考管理/查看试题'"></breadcrumb>
<div class="page"> <div class="page">
<div class="page-content"> <div class="page-content">
<h1 class="title">{{paperName}}</h1> <h1 class="title">
{{paperName}}
<span class="status" v-if="reviewStatus == 2 || reviewStatus == 3">已批阅</span>
<span class="status not" v-else>待阅</span>
</h1>
<ul class="metas"> <ul class="metas">
<li>学生姓名{{userName}}</li> <li>学生姓名{{userName}}</li>
<li>学生得分{{(reviewStatus == 2 || reviewStatus == 3) ? this_score : '--'}}</li> <li>学生得分{{(reviewStatus == 2 || reviewStatus == 3) ? this_score : '--'}}</li>
@ -18,8 +22,7 @@
<div class="wrap"> <div class="wrap">
<div class="item" v-for="(item,index) in list" :key="index"> <div class="item" v-for="(item,index) in list" :key="index">
<!-- <div class="status" :class="{done: item.isCorrecting}">{{item.isSub ? '简答题' : '客观题'}}{{getCorrectingName(item.isCorrecting)}}</div> --> <div class="type" :class="{wrong: item.question_score <= 0,yet: !item.isCorrecting}">
<div class="type" :class="{wrong: item.question_score == 0,yet: !item.isCorrecting}">
<span>题目类型{{item.typeName}}</span> <span>题目类型{{item.typeName}}</span>
<span>题目分数{{item.question_points}}</span> <span>题目分数{{item.question_points}}</span>
<span v-if="item.isCorrecting">考试得分{{item.question_score}}</span> <span v-if="item.isCorrecting">考试得分{{item.question_score}}</span>
@ -38,7 +41,7 @@
</div> </div>
</div> </div>
<div class="meta-mul"> <div class="meta-mul">
<div class="info" v-if="!item.isSub"> <div class="info" v-if="item.typeName != '简答题'">
<p class="key">正确答案</p> <p class="key">正确答案</p>
<p class="val">{{item.answer}}</p> <p class="val">{{item.answer}}</p>
</div> </div>
@ -47,7 +50,7 @@
<p class="val">{{item.user_answer}}</p> <p class="val">{{item.user_answer}}</p>
</div> </div>
</div> </div>
<div class="meta" v-if="item.isSub"> <div class="meta" v-if="item.typeName == '简答题'">
<p class="key">附件</p> <p class="key">附件</p>
<div class="val"> <div class="val">
<template v-if="item.fileUrl"> <template v-if="item.fileUrl">
@ -76,7 +79,7 @@
<div class="info"> <div class="info">
<p class="key">考试得分</p> <p class="key">考试得分</p>
<div class="val"> <div class="val">
<input type="text" v-model.number="item.question_score" :disabled="!isReview || !item.isSub"> <input type="number" min="0" v-model.number="item.question_score" :disabled="!isReview || !item.isSub">
</div> </div>
</div> </div>
</div> </div>
@ -193,17 +196,25 @@ export default {
save(status) { save(status) {
let isEmpty = false let isEmpty = false
let isNotNum = false let isNotNum = false
let lessZero = false
let invalid = false let invalid = false
this.list.map(n => { this.list.map(n => {
if(n.question_score === '') isEmpty = true if(n.question_score === ''){
if(isNaN(n.question_score)) isNotNum = true isEmpty = true
if(Number(n.question_score) > Number(n.question_points)) invalid = true }else if(isNaN(n.question_score)){
isNotNum = true
}else if(n.question_score < 0){
lessZero = true
}else if(Number(n.question_score) > Number(n.question_points)){
invalid = true
}
}) })
if(status){ if(status){
if(isEmpty) return util.warningMsg('请批阅完所有题目') if(isEmpty) return util.warningMsg('请批阅完所有题目')
if(isNotNum) return util.warningMsg('考试得分请输入数字') if(isNotNum) return util.warningMsg('考试得分请输入数字')
} }
if(invalid) return util.warningMsg('考试得分不得大于题目分数') if(invalid) return util.warningMsg('考试得分不得大于题目分数')
if(lessZero) return util.warningMsg('考试得分不得小于0')
let data = { let data = {
review: [], review: [],
assessmentId: this.reviewId, assessmentId: this.reviewId,
@ -235,9 +246,26 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.title{ .title{
text-align: center; display: flex;
justify-content: center;
align-items: center;
font-size: 20px; font-size: 20px;
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
.status{
padding: 0 8px;
color: #52C41A;
line-height: 20px;
font-size: 12px;
margin-left: 8px;
border-radius: 4px;
border: 1px solid #B7EB8F;
background-color: #F6FFED;
&.not{
color: #CC221C;
border: 1px solid #FFA39E;
background: #FFF1F0;
}
}
} }
.metas{ .metas{
display: flex; display: flex;

@ -28,8 +28,7 @@
</li> </li>
</ul> </ul>
<div> <div>
<!-- <el-button type="primary" size="small" round @click="addAss" v-auth>创建考试</el-button> --> <el-button type="primary" size="small" round @click="addAss" v-auth>创建考试</el-button>
<el-button type="primary" size="small" round @click="addAss">创建考试</el-button>
</div> </div>
</div> </div>
@ -92,8 +91,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"> <el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</el-pagination>
</div> </div>
</div> </div>
</div> </div>
@ -105,7 +103,7 @@
</el-form-item> </el-form-item>
<el-form-item label="考试类型"> <el-form-item label="考试类型">
<el-select v-model="form.type" size="small" placeholder="请选择考试类型"> <el-select v-model="form.type" size="small" placeholder="请选择考试类型">
<el-option v-for="item in typeList" :key="item.id" :value="item.id"></el-option> <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="考试时间"> <el-form-item label="考试时间">
@ -168,8 +166,8 @@
</el-table> </el-table>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="selectVisible = false">取消</el-button> <el-button size="small" @click="selectVisible = false">取消</el-button>
<el-button type="primary" @click="savePaper">确定</el-button> <el-button size="small" type="primary" @click="savePaper">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -259,7 +257,7 @@ export default {
}, },
mounted() { mounted() {
this.getData() this.getData()
// this.addInterval() this.addInterval()
}, },
watch: { watch: {
keyword: function(val) { keyword: function(val) {

@ -79,7 +79,7 @@ export default {
schoolId: this.clientId schoolId: this.clientId
} }
this.$get(`${this.api.queryStudent}/1/200`,data).then(res => { this.$get(`${this.api.queryStudent}/1/200`,data).then(res => {
res.data.studentList.map(s => { res.data.studentList.list.map(s => {
(s.ifVisible = false), (s.ischeck = false), (s.label = s.studentName) (s.ifVisible = false), (s.ischeck = false), (s.label = s.studentName)
if(studentId.includes(s.userId)){ if(studentId.includes(s.userId)){
s.ischeck = true s.ischeck = true
@ -88,7 +88,7 @@ export default {
n.ifVisible = true n.ifVisible = true
} }
}) })
e.children = res.data.studentList e.children = res.data.studentList.list
// e.userIds = res.data.studentList.map(n => n.userId) // e.userIds = res.data.studentList.map(n => n.userId)
}).catch(res => {}) }).catch(res => {})

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<breadcrumb :data="'考管理/考试监控'"></breadcrumb> <breadcrumb :data="'考管理/考试监控'"></breadcrumb>
<div class="box"> <div class="box">
<div class="page left"> <div class="page left">
<div class="tabs"> <div class="tabs">

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<breadcrumb :data="'考管理/批阅列表'"></breadcrumb> <breadcrumb :data="'考管理/批阅列表'"></breadcrumb>
<div class="page" style="margin-bottom: 24px"> <div class="page" style="margin-bottom: 24px">
<div class="tabs"> <div class="tabs">
<a class="item active">考试信息</a> <a class="item active">考试信息</a>
@ -50,7 +50,7 @@
<ul class="filter"> <ul class="filter">
<li> <li>
<label>批阅状态</label> <label>批阅状态</label>
<el-select v-model="state" clearable placeholder="请选择批阅状态" size="small" @change="getData"> <el-select v-model="state" placeholder="请选择批阅状态" size="small" @change="getData">
<el-option label="不限" value=""></el-option> <el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in reviewStatusList" :key="index" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item,index) in reviewStatusList" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
@ -83,7 +83,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="name" label="批阅状态" align="center"> <el-table-column prop="name" label="批阅状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{(!scope.row.examinationStatus && !scope.row.reviewStatus) ? '--' : getReviewStatusName(scope.row.reviewStatus)}} {{(!scope.row.examinationStatus && !scope.row.reviewStatus) || scope.row.examinationStatus == 1 ? '--' : getReviewStatusName(scope.row.reviewStatus)}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="操作" width="100">
@ -122,6 +122,7 @@ export default {
], ],
keyword: '', keyword: '',
listData: [], listData: [],
listDataAll: [],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
@ -163,16 +164,28 @@ export default {
'setReviewInfo' 'setReviewInfo'
]), ]),
getData() { getData() {
this.$post(`${this.api.reviewList}?pageNum=${this.page}&pageSize=${this.pageSize}&userId=${this.userId}&assessmentId=${this.id}&keyword=${this.keyword}&state=${this.state}`) this.$post(`${this.api.reviewList}?pageNum=${this.page}&pageSize=${10000}&userId=${this.userId}&assessmentId=${this.id}&keyword=${this.keyword}&state=${this.state}`)
.then(res => { .then(res => {
this.listData = res.data.list.list let list = res.data.list.list
this.total = res.data.list.totalCount let result = []
list.map(n => {
if(!result.find(e => e.stuId == n.stuId) && (n.reviewStatus == this.state || this.state === '')){
result.push(n)
}
})
this.listDataAll = result
this.total = result.length
this.handlePage()
}) })
.catch(err => {}) .catch(err => {})
}, },
handlePage(){
let list = this.listDataAll
this.listData = list.slice((this.page - 1) * this.pageSize,this.page * this.pageSize)
},
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val this.page = val
this.getData() this.handlePage()
}, },
review(row,isReview){ review(row,isReview){
this.setReviewInfo({ this.setReviewInfo({

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<breadcrumb :data="'练习管理/成绩列表'"></breadcrumb> <breadcrumb :data="'考试管理/成绩列表'"></breadcrumb>
<div class="page"> <div class="page">
<div class="tabs"> <div class="tabs">
<a class="item active">成绩列表</a> <a class="item active">成绩列表</a>
@ -10,7 +10,7 @@
<ul class="filter"> <ul class="filter">
<li> <li>
<label>教学班级</label> <label>教学班级</label>
<el-select v-model="classId" clearable placeholder="请选择教学班级" size="small" @change="getData"> <el-select v-model="classId" placeholder="请选择教学班级" size="small" @change="getData">
<el-option v-for="(item,index) in classList" :key="index" :label="item.className" :value="item.classId"></el-option> <el-option v-for="(item,index) in classList" :key="index" :label="item.className" :value="item.classId"></el-option>
</el-select> </el-select>
</li> </li>
@ -71,6 +71,7 @@
<script> <script>
import { mapState,mapActions } from 'vuex' import { mapState,mapActions } from 'vuex'
import util from '@/libs/util' import util from '@/libs/util'
import breadcrumb from '@/components/breadcrumb'
export default { export default {
data() { data() {
return { return {
@ -87,6 +88,9 @@ export default {
searchTimer: null, searchTimer: null,
}; };
}, },
components: {
breadcrumb
},
computed: { computed: {
...mapState('user', [ ...mapState('user', [
'userId' 'userId'

@ -238,7 +238,12 @@ export default {
}, },
review(row){ review(row){
this.setAssInfo({ this.setAssInfo({
id: row.id id: row.id,
assessmentName: row.assessmentName,
type: this.getTypeName(row.type),
startTime: row.startTime,
endTime: row.endTime,
status: this.getStateName(3)
}) })
this.$router.push('/assessment/review') this.$router.push('/assessment/review')
}, },

@ -3,7 +3,7 @@
<breadcrumb :data="'练习管理/成绩详情'"></breadcrumb> <breadcrumb :data="'练习管理/成绩详情'"></breadcrumb>
<div class="page"> <div class="page">
<div class="page-content"> <div class="page-content">
<h1 class="title">{{paperName }}</h1> <h1 class="title">{{paperName}}</h1>
<div class="metas"> <div class="metas">
<div class="m-r-20"> <div class="m-r-20">
<span class="name">总分</span> <span class="name">总分</span>
@ -27,7 +27,7 @@
<div class="wrap"> <div class="wrap">
<div class="item" v-for="(item,index) in curType" :key="index"> <div class="item" v-for="(item,index) in curType" :key="index">
<div class="type" :class="{wrong: item.questionScore == 0,yet: !item.isCorrecting}"> <div class="type" :class="{wrong: item.questionScore <= 0,yet: !item.isCorrecting}">
<span>序号{{index+1}}</span> <span>序号{{index+1}}</span>
<span>得分{{item.questionScore}}</span> <span>得分{{item.questionScore}}</span>
</div> </div>

@ -3,7 +3,11 @@
<breadcrumb :data="'练习管理/批阅'"></breadcrumb> <breadcrumb :data="'练习管理/批阅'"></breadcrumb>
<div class="page"> <div class="page">
<div class="page-content"> <div class="page-content">
<h1 class="title">{{paperName}}</h1> <h1 class="title">
{{paperName}}
<span class="status" v-if="reviewStatus == 2 || reviewStatus == 3">已批阅</span>
<span class="status not" v-else>待阅</span>
</h1>
<ul class="metas"> <ul class="metas">
<li>学生姓名{{userName}}</li> <li>学生姓名{{userName}}</li>
<li>学生得分{{(reviewStatus == 2 || reviewStatus == 3) ? this_score : '--'}}</li> <li>学生得分{{(reviewStatus == 2 || reviewStatus == 3) ? this_score : '--'}}</li>
@ -18,7 +22,7 @@
<div class="wrap"> <div class="wrap">
<div class="item" v-for="(item,index) in list" :key="index"> <div class="item" v-for="(item,index) in list" :key="index">
<div class="type" :class="{wrong: item.questionScore == 0,yet: !item.isCorrecting}"> <div class="type" :class="{wrong: item.questionScore <= 0,yet: !item.isCorrecting}">
<span>题目类型{{item.typeName}}</span> <span>题目类型{{item.typeName}}</span>
<span>题目分数{{item.questionPoints}}</span> <span>题目分数{{item.questionPoints}}</span>
<span v-if="item.isCorrecting">考试得分{{item.questionScore}}</span> <span v-if="item.isCorrecting">考试得分{{item.questionScore}}</span>
@ -37,7 +41,7 @@
</div> </div>
</div> </div>
<div class="meta-mul"> <div class="meta-mul">
<div class="info" v-if="!item.isSub"> <div class="info" v-if="item.typeName != '简答题'">
<p class="key">正确答案</p> <p class="key">正确答案</p>
<p class="val">{{item.answer}}</p> <p class="val">{{item.answer}}</p>
</div> </div>
@ -46,7 +50,7 @@
<p class="val">{{item.userAnswer}}</p> <p class="val">{{item.userAnswer}}</p>
</div> </div>
</div> </div>
<div class="meta" v-if="item.isSub"> <div class="meta" v-if="item.typeName == '简答题'">
<p class="key">附件</p> <p class="key">附件</p>
<div class="val"> <div class="val">
<template v-if="item.fileUrl"> <template v-if="item.fileUrl">
@ -75,7 +79,7 @@
<div class="info"> <div class="info">
<p class="key">考试得分</p> <p class="key">考试得分</p>
<div class="val"> <div class="val">
<input type="number" v-model.number="item.questionScore" :disabled="!isReview || !item.isSub"> <input type="number" min="0" v-model.number="item.questionScore" :disabled="!isReview || !item.isSub">
</div> </div>
</div> </div>
</div> </div>
@ -140,25 +144,12 @@ export default {
this.$post(`${this.api.reviewDetail}?id=${this.id}`) this.$post(`${this.api.reviewDetail}?id=${this.id}`)
.then(res => { .then(res => {
let data = res.data let data = res.data
data.list.map(n => {
n.isCorrecting == 0 && (n.questionScore = '')
n.isSub = n.typeName == '简答题'
if(n.typeName == '填空题'){
let answer = []
for(let i in n){
if(i.includes('option') && n[i]) answer.push(n[i])
}
n.answer = answer.join(',')
n.userAnswer = n.userAnswer ? n.userAnswer.split('&lt;&gt;').filter(n => n).join(',') : ''
}
if(n.fileUrl) n.fileUrl = JSON.parse(n.fileUrl)
if(n.videoAudio) n.videoAudio = JSON.parse(n.videoAudio)
})
this.list = data.list this.list = data.list
this.paperName = data.paperName this.paperName = data.paperName
this.userName = data.stuName this.userName = data.stuName
this.this_score = data.score this.this_score = data.score
this.duration = data.timeCost this.duration = data.timeCost
this.handleOptions()
}).catch(err => {}) }).catch(err => {})
}, },
getWrong(){ getWrong(){
@ -171,26 +162,53 @@ export default {
n.questionPoints = n.question_points n.questionPoints = n.question_points
n.questionScore = n.question_score n.questionScore = n.question_score
n.questionStem = n.question_stem n.questionStem = n.question_stem
if(n.fileUrl) n.fileUrl = JSON.parse(n.fileUrl)
if(n.videoAudio) n.videoAudio = JSON.parse(n.videoAudio)
}) })
this.list = list this.list = list
this.handleOptions()
}).catch(err => {}) }).catch(err => {})
}, },
handleOptions(){
let list = this.list
list.forEach(n => {
n.isCorrecting == 0 && (n.questionScore = '')
n.isSub = n.typeName == '简答题'
if(n.typeName == '填空题'){
let answer = []
for(let i in n){
if(i.includes('option') && n[i]) answer.push(n[i])
}
n.answer = answer.join(',')
n.userAnswer = n.userAnswer ? n.userAnswer.split('&lt;&gt;').filter(n => n).join(',') : ''
}
if(n.fileUrl) n.fileUrl = JSON.parse(n.fileUrl)
if(n.videoAudio) n.videoAudio = JSON.parse(n.videoAudio)
})
console.log(list)
this.list = list
},
save(status) { save(status) {
let isEmpty = false let isEmpty = false
let isNotNum = false let isNotNum = false
let lessZero = false
let invalid = false let invalid = false
this.list.map(n => { this.list.map(n => {
if(n.questionScore === '') isEmpty = true if(n.questionScore === ''){
if(isNaN(n.questionScore)) isNotNum = true isEmpty = true
if(Number(n.questionScore) > Number(n.questionPoints)) invalid = true }else if(isNaN(n.questionScore)){
isNotNum = true
}else if(n.questionScore < 0){
lessZero = true
}else if(Number(n.questionScore) > Number(n.questionPoints)){
invalid = true
}
}) })
if(status){ if(status){
if(isEmpty) return util.warningMsg('请批阅完所有题目') if(isEmpty) return util.warningMsg('请批阅完所有题目')
if(isNotNum) return util.warningMsg('考试得分请输入数字') if(isNotNum) return util.warningMsg('考试得分请输入数字')
} }
if(invalid) return util.warningMsg('考试得分不得大于题目分数') if(invalid) return util.warningMsg('考试得分不得大于题目分数')
if(lessZero) return util.warningMsg('考试得分不得小于0')
let data = { let data = {
identification: this.identification, identification: this.identification,
review: [], review: [],
@ -221,9 +239,26 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.title{ .title{
text-align: center; display: flex;
justify-content: center;
align-items: center;
font-size: 20px; font-size: 20px;
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
.status{
padding: 0 8px;
color: #52C41A;
line-height: 20px;
font-size: 12px;
margin-left: 8px;
border-radius: 4px;
border: 1px solid #B7EB8F;
background-color: #F6FFED;
&.not{
color: #CC221C;
border: 1px solid #FFA39E;
background: #FFF1F0;
}
}
} }
.metas{ .metas{
display: flex; display: flex;

@ -48,7 +48,7 @@
</div> </div>
<el-dialog :title="isAdd ? '创建练习' : '修改练习'" :visible.sync="addVisible" width="540px" @close="closeAdd" :close-on-click-modal="false"> <el-dialog :title="isAdd ? '创建练习' : '修改练习'" :visible.sync="addVisible" width="540px" @close="closeAdd" :close-on-click-modal="false">
<el-form ref="form" label-width="100px"> <el-form ref="form" label-width="100px" label-suffix="">
<el-form-item label="练习名称"> <el-form-item label="练习名称">
<el-input v-model="form.practiseName" size="small" placeholder="请输入练习名称"></el-input> <el-input v-model="form.practiseName" size="small" placeholder="请输入练习名称"></el-input>
</el-form-item> </el-form-item>
@ -109,8 +109,8 @@
</el-table> </el-table>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="selectVisible = false">取消</el-button> <el-button size="small" @click="selectVisible = false">取消</el-button>
<el-button type="primary" @click="savePaper">确定</el-button> <el-button size="small" type="primary" @click="savePaper">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -317,7 +317,8 @@ export default {
}, },
review(row){ review(row){
this.setPracInfo({ this.setPracInfo({
practiseId: row.practiseId practiseId: row.practiseId,
practiseName: row.practiseName
}) })
this.$router.push('review') this.$router.push('review')
}, },

@ -10,7 +10,7 @@
<ul class="filter"> <ul class="filter">
<li> <li>
<label>批阅状态</label> <label>批阅状态</label>
<el-select v-model="state" clearable placeholder="请选择批阅状态" size="small" @change="getData"> <el-select v-model="state" placeholder="请选择批阅状态" size="small" @change="getData">
<el-option label="不限" value="3"></el-option> <el-option label="不限" value="3"></el-option>
<el-option v-for="(item,index) in reviewStatusList" :key="index" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item,index) in reviewStatusList" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
@ -35,7 +35,7 @@
</el-table-column> </el-table-column>
<el-table-column label="批阅状态" align="center"> <el-table-column label="批阅状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{(!scope.row.state && !scope.row.reviewStatus) ? '--' : getReviewStatusName(scope.row.reviewStatus)}} {{(!scope.row.state && !scope.row.reviewStatus) || scope.row.state == 1 ? '--' : getReviewStatusName(scope.row.reviewStatus)}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100" align="center"> <el-table-column label="操作" width="100" align="center">
@ -74,6 +74,7 @@ export default {
], ],
keyword: '', keyword: '',
listData: [], listData: [],
listDataAll: [],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
@ -97,16 +98,25 @@ export default {
'setReviewInfo' 'setReviewInfo'
]), ]),
getData() { getData() {
this.$post(`${this.api.reviewListByStudent}?pageNum=${this.page}&pageSize=${this.pageSize}&practiseId=${this.practiseId}&userId=${this.userId}&state=${this.state}`) this.$post(`${this.api.reviewListByStudent}?pageNum=${this.page}&pageSize=${10000}&practiseId=${this.practiseId}&userId=${this.userId}&state=${this.state}`)
.then(res => { .then(res => {
this.listData = res.data.list.list let list = res.data.list.list
this.total = res.data.list.totalCount let result = []
}) list.map(n => {
.catch(err => {}) if(n.reviewStatus == this.state || this.state == 3) result.push(n)
})
this.listDataAll = result
this.total = result.length
this.handlePage()
}).catch(err => {})
},
handlePage(){
let list = this.listDataAll
this.listData = list.slice((this.page - 1) * this.pageSize,this.page * this.pageSize)
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val this.page = val
this.getData() this.handlePage()
}, },
review(row,isReview){ review(row,isReview){
this.setReviewInfo({ this.setReviewInfo({
@ -125,7 +135,5 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/.no-mb.el-form-item{
margin-bottom: 0;
}
</style> </style>

@ -10,7 +10,7 @@
<ul class="filter"> <ul class="filter">
<li> <li>
<label>批阅状态</label> <label>批阅状态</label>
<el-select v-model="state" clearable placeholder="请选择批阅状态" size="small" @change="getData"> <el-select v-model="state" placeholder="请选择批阅状态" size="small" @change="getData">
<el-option label="不限" value="3"></el-option> <el-option label="不限" value="3"></el-option>
<el-option v-for="(item,index) in reviewStatusList" :key="index" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item,index) in reviewStatusList" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
@ -71,6 +71,7 @@ export default {
], ],
keyword: '', keyword: '',
listData: [], listData: [],
listDataAll: [],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
@ -105,16 +106,24 @@ export default {
'setReviewByStudentInfo' 'setReviewByStudentInfo'
]), ]),
getData() { getData() {
this.$post(`${this.api.practiceReviewList}?pageNum=${this.page}&pageSize=${this.pageSize}&practiseId=${this.practiseId}&keyword=${this.keyword}&state=${this.state}`) this.$post(`${this.api.practiceReviewList}?pageNum=${this.page}&pageSize=${10000}&practiseId=${this.practiseId}&keyword=${this.keyword}&state=${this.state}`).then(res => {
.then(res => { let list = res.data.list.list
this.listData = res.data.list.list let result = []
this.total = res.data.list.totalCount list.map(n => {
}) result.find(e => e.userId == n.userId) || result.push(n)
.catch(err => {}) })
this.listDataAll = result
this.total = result.length
this.handlePage()
}).catch(err => {})
},
handlePage(){
let list = this.listDataAll
this.listData = list.slice((this.page - 1) * this.pageSize,this.page * this.pageSize)
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val this.page = val
this.getData() this.handlePage()
}, },
review(row,isReview){ review(row,isReview){
this.setReviewByStudentInfo({ this.setReviewByStudentInfo({
@ -127,7 +136,5 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/.no-mb.el-form-item{
margin-bottom: 0;
}
</style> </style>

@ -10,7 +10,7 @@
<ul class="filter"> <ul class="filter">
<li> <li>
<label>教学班级</label> <label>教学班级</label>
<el-select v-model="classId" clearable placeholder="请选择教学班级" size="small" @change="getData"> <el-select v-model="classId" placeholder="请选择教学班级" size="small" @change="getData">
<el-option v-for="(item,index) in classList" :key="index" :label="item.className" :value="item.classId"></el-option> <el-option v-for="(item,index) in classList" :key="index" :label="item.className" :value="item.classId"></el-option>
</el-select> </el-select>
</li> </li>
@ -94,8 +94,8 @@
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="detailVisible = false">取消</el-button> <el-button size="small" @click="detailVisible = false">取消</el-button>
<el-button type="primary">确定</el-button> <el-button size="small" type="primary">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>

@ -1,14 +1,14 @@
<template> <template>
<div> <div>
<breadcrumb :data="'题库资源管理/' + tabs[active]" ref="breadcrumb"></breadcrumb> <breadcrumb :data="'题库管理/' + tabs[active]" ref="breadcrumb"></breadcrumb>
<div class="page"> <div class="page">
<div class="tabs"> <div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a> <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a>
</div> </div>
<div class="page-content"> <div class="page-content">
<ques-bank-type v-if="active == 'type'" v-auth="'题库资源管理:题库分类'"></ques-bank-type> <ques-bank-type v-if="active == 'type'" v-auth="'题库管理:题库分类'"></ques-bank-type>
<my-ques-bank v-else-if="active == 'my'" v-auth="'题库资源管理:我上传的题库'"></my-ques-bank> <my-ques-bank v-else-if="active == 'my'" v-auth="'题库管理:我上传的题库'"></my-ques-bank>
<global-ques-bank v-else v-auth="'题库资源管理:校企公共题库'"></global-ques-bank> <global-ques-bank v-else v-auth="'题库管理:校企公共题库'"></global-ques-bank>
</div> </div>
</div> </div>
</div> </div>
@ -48,21 +48,21 @@ export default {
methods: { methods: {
tabChange(index){ tabChange(index){
this.active = index this.active = index
this.$refs.breadcrumb.update('题库资源管理/' + this.tabs[this.active]) this.$refs.breadcrumb.update('题库管理/' + this.tabs[this.active])
}, },
initTabs(){ initTabs(){
let tab1 = this.btns.includes('题库资源管理:题库分类') let tab1 = this.btns.includes('题库管理:我上传的题库')
let tab2 = this.btns.includes('题库资源管理:我上传的题库') let tab2 = this.btns.includes('题库管理:校企公共题库')
let tab3 = this.btns.includes('题库资源管理:校企公共题库') let tab3 = this.btns.includes('题库管理:题库分类')
if(!tab1 && tab2){ if(!tab1 && tab2){
this.active = 'my'
}else if(!tab1 && !tab2 && tab3){
this.active = 'global' this.active = 'global'
}else if(!tab1 && !tab2 && tab3){
this.active = 'type'
} }
if(!tab1) delete this.tabs.type if(!tab1) delete this.tabs.my
if(!tab2) delete this.tabs.my if(!tab2) delete this.tabs.global
if(!tab3) delete this.tabs.global if(!tab3) delete this.tabs.type
} }
} }
}; };

@ -15,7 +15,7 @@
</li> </li>
</ul> </ul>
<div> <div>
<el-button type="primary" size="small" round @click="addTopics" v-auth="'/quesBank/list:我上传的题库:单题上传'">单题创建</el-button> <el-button type="primary" size="small" round @click="addTopics" v-auth="'/quesBank/list:我上传的题库:单题创建'">单题创建</el-button>
<el-button type="primary" size="small" round @click="showimportVisible" v-auth="'/quesBank/list:我上传的题库:批量上传'">批量上传</el-button> <el-button type="primary" size="small" round @click="showimportVisible" v-auth="'/quesBank/list:我上传的题库:批量上传'">批量上传</el-button>
<el-button type="primary" size="small" round @click="shareDataBatch" v-auth="'/quesBank/list:我上传的题库:批量共享'">批量共享</el-button> <el-button type="primary" size="small" round @click="shareDataBatch" v-auth="'/quesBank/list:我上传的题库:批量共享'">批量共享</el-button>
<el-button type="primary" size="small" round @click="delAllData" v-auth="'/quesBank/list:我上传的题库:批量删除'">批量删除</el-button> <el-button type="primary" size="small" round @click="delAllData" v-auth="'/quesBank/list:我上传的题库:批量删除'">批量删除</el-button>
@ -27,7 +27,7 @@
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">{{scope.$index + (page - 1) * pageSize + 1}}</template> <template slot-scope="scope">{{scope.$index + (page - 1) * pageSize + 1}}</template>
</el-table-column> </el-table-column>
<el-table-column prop="questionStem" :show-overflow-tooltip="true" label="题干" align="center"></el-table-column> <el-table-column prop="questionStem" :show-overflow-tooltip="true" label="题干" min-width="200" align="center"></el-table-column>
<el-table-column prop="name" label="试题类型" width="100" align="center"></el-table-column> <el-table-column prop="name" label="试题类型" width="100" align="center"></el-table-column>
<el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column> <el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column>
<el-table-column prop="typeName" label="所属题库" width="140" align="center"></el-table-column> <el-table-column prop="typeName" label="所属题库" width="140" align="center"></el-table-column>
@ -88,7 +88,7 @@
<el-dialog title="批量导入" :visible.sync="importVisible" width="400px" :close-on-click-modal="false"> <el-dialog title="批量导入" :visible.sync="importVisible" width="400px" :close-on-click-modal="false">
<div class="upload-wrap" :class="{lg: uploadFaild}"> <div class="upload-wrap" :class="{lg: uploadFaild}">
<el-button class="download" size="small" @click="downLoad"><img src="../../../assets/img/download.png" alt=""> 模板下载</el-button> <el-button class="download" size="small" @click="downLoad"><img src="../../../assets/img/download.png" alt=""> 模板下载</el-button>
<el-upload accept=".xls,.xlsx" :on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" :action="this.api.impExcel" :file-list="uploadList" :data="{userId: this.userId,schoolId: this.clientId}" name="file"> <el-upload ref="upload" accept=".xls,.xlsx" :on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" :action="this.api.impExcel" :file-list="uploadList" :data="{userId: this.userId,schoolId: this.clientId}" name="file" :auto-upload="false">
<el-button size="small"><img src="../../../assets/img/upload.png" alt=""> 上传文件</el-button> <el-button size="small"><img src="../../../assets/img/upload.png" alt=""> 上传文件</el-button>
</el-upload> </el-upload>
<div class="link" v-if="uploadFaild"> <div class="link" v-if="uploadFaild">

@ -1,14 +1,7 @@
<template> <template>
<div> <div>
<el-dialog :title="title" :visible.sync="visible" width="1160px" @close="closeTopics" :close-on-click-modal="false"> <el-dialog :title="title" :visible.sync="visible" width="1160px" @close="closeTopics" :close-on-click-modal="false">
<el-form <el-form :model="topicForm" :rules="rules" :disabled.sync="isDetail" ref="topicForm" label-width="100px" class="topic-form" label-suffix="">
:model="topicForm"
:rules="rules"
:disabled.sync="isDetail"
ref="topicForm"
label-width="100px"
class="topic-form"
>
<el-form-item label="所属题库" prop="cid"> <el-form-item label="所属题库" prop="cid">
<el-select v-model="topicForm.cid" clearable placeholder="请选择所属题库"> <el-select v-model="topicForm.cid" clearable placeholder="请选择所属题库">
<template v-for="(item,index) in quesBankList"> <template v-for="(item,index) in quesBankList">
@ -124,8 +117,8 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer" v-show="!isDetail"> <div slot="footer" class="dialog-footer" v-show="!isDetail">
<el-button v-throttle @click="closeDialog">取消</el-button> <el-button size="small" v-throttle @click="closeDialog">取消</el-button>
<el-button type="primary" @click="saveTopics" v-throttle>确定</el-button> <el-button size="small" type="primary" @click="saveTopics" v-throttle>确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>

@ -1,565 +1,66 @@
<template> <template>
<div> <div>
<breadcrumb :data="'学生管理/学生列表'"></breadcrumb> <breadcrumb :data="'学生管理/' + tabs[active]" ref="breadcrumb"></breadcrumb>
<div class="page"> <div class="page">
<div class="tabs"> <div class="tabs">
<a class="item active">学生列表</a> <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a>
</div> </div>
<div class="page-content"> <div class="page-content">
<div class="tool"> <student v-if="active == 'student'"></student>
<ul class="filter"> <organization v-else-if="active == 'organization'"></organization>
<li>
<label>筛选</label>
<el-cascader :options="orgList" :props="props" collapse-tags clearable size="small" @change="orgChange"></el-cascader>
</li>
<li>
<label>搜索</label>
<el-input placeholder="请输入学生名称" prefix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input>
</li>
</ul>
<div>
<el-button type="primary" size="small" round @click="addstudent" v-auth>新增学生</el-button>
<el-button type="primary" size="small" round @click="batchImport" v-auth>批量导入</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth>批量删除</el-button>
</div>
</div>
<!-- <StudentSide ref="getSelectData" @fircheck="fircheck" @twocheck="twocheck" @threecheck="threecheck" @getData="getData"></StudentSide> -->
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="80" align="center"></el-table-column>
<el-table-column type="index" label="序号" width="55" align="center">
</el-table-column>
<el-table-column prop="studentName" label="学生姓名" align="center">
</el-table-column>
<el-table-column prop="workNumber" label="学生学号" align="center">
</el-table-column>
<el-table-column prop="stuProfessionalArchitectureName" label="专业" align="center">
</el-table-column>
<el-table-column prop="gradeName" label="年级" align="center">
</el-table-column>
<el-table-column prop="className" label="班级" align="center">
</el-table-column>
<el-table-column prop="loginNumber" label="登录次数" align="center">
</el-table-column>
<el-table-column prop="lastLoginTime" label="上次登录时间" width="150" align="center">
</el-table-column>
<el-table-column label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button type="text" @click="editstudent(scope.row)" v-auth>编辑</el-button>
<el-button type="text" @click="resetPassword(scope.row)" v-auth>重置密码</el-button>
<el-button type="text" @click="delstudent(scope.row)" v-auth>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total,prev, pager, next" :current-page="page" @current-change="handleCurrentChange" :total="total"></el-pagination>
</div>
</div> </div>
</div> </div>
<el-dialog :title="isAdd ? '新增学生' : '编辑学生'" :visible.sync="studentVisible" width="30%" @close="closestudent" class="dialog" :close-on-click-modal="false">
<el-form ref="studentForm" :model="studentForm" :rules="rules" label-width="90px">
<el-form-item prop="account" label="账号">
<el-input v-model="studentForm.account" placeholder="请输入学生账号" @change="accountChange"></el-input>
</el-form-item>
<el-form-item prop="userName" label="学生姓名">
<el-input v-model="studentForm.userName" placeholder="请输入学生姓名"></el-input>
</el-form-item>
<el-form-item prop="uniqueIdentificationAccount" label="唯一标识">
<el-input disabled v-model="studentForm.uniqueIdentificationAccount" placeholder="请输入学生学号获取唯一标识"></el-input>
</el-form-item>
<el-form-item prop="workNumber" label="学生学号">
<el-input v-model="studentForm.workNumber" placeholder="请输入学生学号" @change="workNumberChange"></el-input>
</el-form-item>
<el-form-item prop="professionalId" label="专业">
<el-select v-model="studentForm.professionalId" placeholder="请选择专业" @change="getGrade">
<el-option v-for="(item,index) in orgList" :key="index"
:label="item.stuProfessionalArchitectureName" :value="item.stuProfessionalArchitectureId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="gradeId" label="年级">
<el-select v-model="studentForm.gradeId" placeholder="请选择年级" :disabled="studentForm.professionalId ? false : true" @change="getClass">
<el-option v-for="(item,index) in gradeList" :key="index"
:label="item.gradeName" :value="item.gradeId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="classId" label="班级">
<el-select v-model="studentForm.classId" placeholder="请选择班级" :disabled="studentForm.gradeId ? false : true">
<el-option v-for="(item,index) in classList" :key="index"
:label="item.className" :value="item.classId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input v-model="studentForm.phone" placeholder="可以用于登录平台,以及找回密码" maxlength="11"></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱">
<el-input v-model="studentForm.email" placeholder="可以用于登录平台,以及找回密码"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="studentVisible = false">取消</el-button>
<el-button type="primary" @click="saveSure('studentForm')">确定</el-button>
</span>
</el-dialog>
<el-dialog title="批量导入" :visible.sync="importVisible" width="400px" :close-on-click-modal="false">
<div class="upload-wrap" :class="{lg: uploadFaild}">
<el-button class="download" size="small" @click="downLoad"><img src="../../../assets/img/download.png" alt=""> 模板下载</el-button>
<el-upload accept=".xls,.xlsx" :on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" :action="this.api.uploadFileStudent" :file-list="uploadList" :data="{schoolId: this.clientId}" name="file">
<el-button size="small"><img src="../../../assets/img/upload.png" alt=""> 上传文件</el-button>
</el-upload>
<div class="link" v-if="uploadFaild">
<el-link type="primary" @click="showFaild">导入失败查看原因</el-link>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="importVisible = false"> </el-button>
<el-button size="small" type="primary" @click="uploadSure"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { mapState,mapGetters } from 'vuex' import { mapState } from 'vuex'
import util from '@/libs/util'
import Setting from '@/setting' import Setting from '@/setting'
import student from './student.vue'
import organization from './organization.vue'
import breadcrumb from '@/components/breadcrumb' import breadcrumb from '@/components/breadcrumb'
export default { export default {
data() { data() {
return { return {
props: { multiple: true }, active: 'student',
orgList: [], tabs: {
twoDepartmentIds: '', student: '学生管理',
studentVisible: false, organization: '架构管理'
studentForm: { }
clientId: this.clientId,
clientName: this.clientName,
studentId: '',
userId: '',
userName: '',
workNumber: '',
phone: '',
email: '',
professionalId: '',
gradeId: '',
classId: '' ,
uniqueIdentificationAccount: '',
account: ''
},
rules: {
userName: [
{ required: true, message: '请输入学生姓名', trigger: 'blur' }
],
workNumber: [
{ required: true, message: '请输入学生学号', trigger: 'blur' },
{
pattern: /^[A-Za-z0-9]+$/,
message: '请输入正确的学生学号',
trigger: 'blur'
}
],
account: [
{ required: true, message: '请输入账号', trigger: 'blur' },
{
pattern: /^[A-Za-z0-9]*$/,
message: '请输入正确的账号',
trigger: 'blur'
}
],
professionalId: [
{ required: true, message: '请选择专业', trigger: 'change' }
],
gradeId: [
{ required: true, message: '请选择年级', trigger: 'change' }
],
classId: [
{ required: true, message: '请选择班级', trigger: 'change' }
],
phone: [
{
pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号',
trigger: 'blur'
}
],
email: [
{
pattern: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/,
message: '请输入正确的邮箱',
trigger: 'blur'
}
]
},
listData: [],
importVisible: false,
keyword: '',
page: 1,
pageSize: 10,
total: 0,
searchTimer: null,
gradeList: [],
classList: [],
professionalIds: '',
professionalStudentIds: '',
gradeIds: '',
classIds: '',
multipleSelection: [],
uploadList: [],
parmData: [],
uploadFaild: false,
token: '',
schooldId: 1,
isAdd: true,
accountRepeat: false,
workNumberRepeat: false,
originalAccount: '',
originalWorkNumber: ''
}; };
}, },
computed: {
...mapState('user', [
'userId','clientId','clientName'
])
},
components: { components: {
student,
organization,
breadcrumb breadcrumb
}, },
watch: { computed: {
keyword: function(val) { ...mapState('auth', [
clearTimeout(this.searchTimer) 'btns'
this.searchTimer = setTimeout(() => { ])
this.getData()
},500)
}
}, },
mounted(){ created() {
this.getOrg() Setting.dynamicRoute && this.initTabs()
this.studentForm.clientId = this.clientId
this.studentForm.clientName = this.clientName
this.getData()
}, },
methods: { methods: {
getOrg(){ tabChange(index){
let data = { this.active = index
schoolId: this.clientId this.$refs.breadcrumb.update('学生管理/' + this.tabs[this.active])
}
this.$get(this.api.queryStudentProfessionalArchitecture,data).then(res => {
let StaffProfessionalArchitectureList = res.data.StaffProfessionalArchitectureList
if(StaffProfessionalArchitectureList){
StaffProfessionalArchitectureList.map(e => {
e.isParent = true
e.value = e.stuProfessionalArchitectureId
e.label = e.stuProfessionalArchitectureName
let data = {
stuProfessionalArchitectureId: e.stuProfessionalArchitectureId
}
this.$get(this.api.queryGrade,data).then(res => {
e.children = res.data.Grade
e.children.map(e => {
e.value = e.gradeId
e.label = e.gradeName
let data = {
gradeId: e.gradeId
}
this.$get(this.api.queryClass,data).then(res => {
res.data.Class.map(e => {
e.value = e.classId
e.label = e.className
})
e.children = res.data.Class
}).catch(res => {})
})
}).catch(res => {})
})
setTimeout(() => {
this.orgList = StaffProfessionalArchitectureList
}, 500)
}
}).catch(res => {})
},
getData(){
let data = {
searchContent: this.keyword,
professionalIds: this.professionalStudentIds,
gradeIds: this.gradeIds,
classIds: this.classIds,
schoolId: this.clientId
}
this.$get(`${this.api.queryStudent}/${this.page}/${this.pageSize}`,data).then(res => {
this.listData = res.data.studentList
this.total = res.data.total
}).catch(res => {})
},
orgChange(node){
this.classIds = node.map(n => n[2]).toString()
this.getData()
},
closestudent(){
this.$refs.studentForm.resetFields()
},
addstudent(){
this.studentForm.studentId = ''
this.studentVisible = true
this.isAdd = true
},
editstudent(row){
this.studentVisible = true
this.isAdd = false
this.studentForm.studentId = row.studentId
this.studentForm.userId = row.userId
this.$get(`${this.api.getStudent}/${row.studentId}`).then(res => {
let student = res.data.student
let userInfo = res.data.userInfo
this.studentForm.userName = userInfo.userName,
this.studentForm.workNumber = student.workNumber,
this.originalWorkNumber = student.workNumber,
this.studentForm.uniqueIdentificationAccount = userInfo.uniqueIdentificationAccount,
this.studentForm.professionalId = student.professionalId,
this.studentForm.gradeId = student.gradeId,
this.studentForm.classId = student.classId,
this.studentForm.phone = userInfo.phone,
this.studentForm.email = userInfo.email,
this.studentForm.account = userInfo.account
this.originalAccount = userInfo.account
this.getGradeData()
this.getClassData()
}).catch(res => {});
},
resetPassword(row){
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, '提示',).then(() => {
let data = {
userId: row.userId,
password: Setting.initialPassword
}
this.$post(this.api.userinfoUpdate,data).then(res => {
if(res.success){
util.successMsg('重置成功')
}else{
util.errorMsg('重置失败')
}
}).catch(res => {})
}).catch(() => {})
},
//
getGrade(){
this.studentForm.gradeId = ''
this.studentForm.classId = ''
this.getGradeData()
},
getGradeData(){
let data = {
stuProfessionalArchitectureId: this.studentForm.professionalId
}
this.$get(this.api.queryGrade,data).then(res => {
this.gradeList = res.data.Grade
}).catch(res => {});
},
//
getClass(){
this.studentForm.classId = ''
this.getClassData()
},
getClassData(){
let data = {
gradeId: this.studentForm.gradeId
}
this.$get(this.api.queryClass,data).then(res => {
this.classList = res.data.Class
}).catch(res => {});
}, },
async accountChange(){ initTabs(){
if(this.studentForm.account !== this.originalAccount){ let tab1 = this.btns.includes('学生管理:学生管理')
this.$get(`${this.api.getAccount}?account=${this.studentForm.account}`).then(res => { let tab2 = this.btns.includes('学生管理:架构管理')
if(res.data.userInfo){
this.accountRepeat = true if(!tab1 && tab2){
util.warningMsg('该账号已存在') this.active = 'organization'
}else{
this.accountRepeat = false
}
}).catch(res => {})
}else{
this.accountRepeat = false
}
},
workNumberChange(){
if(this.studentForm.workNumber !== this.originalWorkNumber){
this.$get(`${this.api.studentGetWorkNumber}?workNumber=${this.studentForm.workNumber}`).then(res => {
if(res.data.student){
this.workNumberRepeat = true
util.warningMsg('该学号已存在')
}else{
this.workNumberRepeat = false
}
}).catch(res => {})
}else{
this.workNumberRepeat = false
}
},
saveSure(studentForm){
this.$refs[studentForm].validate((valid) => {
if (valid) {
if(this.accountRepeat) return util.warningMsg('该账号已存在')
if(this.workNumberRepeat) return util.warningMsg('该学号已存在')
let data = {
userInfo: {
isPort: 2,
roleId: 4,
clientId: this.studentForm.clientId,
clientName: this.studentForm.clientName,
userName: this.studentForm.userName,
account: this.studentForm.account,
phone: this.studentForm.phone,
email: this.studentForm.email,
uniqueIdentificationAccount: this.studentForm.uniqueIdentificationAccount,
userId: this.studentForm.userId ? this.studentForm.userId : ''
},
student: {
userId: this.studentForm.userId,
studentId: this.studentForm.studentId,
roleId: 4,
isPort: 2,
clientId: this.studentForm.clientId,
clientName: this.studentForm.clientName,
professionalId: this.studentForm.professionalId,
gradeId: this.studentForm.gradeId,
classId: this.studentForm.classId,
workNumber: this.studentForm.workNumber,
}
}
if(this.studentForm.studentId){
this.$post(this.api.updateStudent,data).then(res => {
this.studentVisible = false
util.successMsg('编辑成功')
this.getData()
}).catch(res => {});
}else{
this.$post(this.api.addStudent,data).then(res => {
this.studentVisible = false
util.successMsg('添加成功')
this.getData()
}).catch(res => {});
}
}else{
return false;
}
})
},
delstudent(row){
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', {
type: 'warning'
})
.then(() => {
let data = {
studentIds: row.studentId
}
this.$del(this.api.deleteStudents,data).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => {});
})
.catch(() => {});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delAllSelection() {
if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection
let delList = newArr.map(item => {
return item.studentId
})
//
this.$confirm(`此批量删除操作不可逆,是否确认删除${util.ellipsisStr(newArr[0].studentName)}${newArr.length}个选中项?`, '提示', {
type: 'warning'
})
.then(() => {
let data = {
studentIds: delList.join()
}
this.$del(this.api.deleteStudents,data).then(res => {
this.multipleSelection = []
util.successMsg('删除成功')
this.getData()
}).catch(res => {});
}).catch(() => {});
}else{
util.errorMsg('请先选择学生')
}
},
batchImport(){
this.importVisible = true
},
searchstudent(){
this.page = 1
this.getData()
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
downLoad(){
location.href = this.api.downloadStudentTemp
},
//
handleExceed(files, fileList) {
util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
showFaild(){
location.href = `${this.api.exportFailureStudent}?token=${this.token}`
},
uploadSuccess(res, file, fileList) {
this.uploadFaild = false
if(res.success){
if(res.data.data.token){
this.token = res.data.data.token
this.uploadFaild = true
}else{
util.successMsg('上传成功')
}
}else{
res.data.message ? util.errorMsg(res.data.message) : util.errorMsg('上传失败,请检查数据')
} }
}, if(!tab1) delete this.tabs.student
uploadError(err, file, fileList) { if(!tab2) delete this.tabs.organization
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
this.uploadList = fileList
this.uploadFaild = false
},
uploadSure(){
this.importVisible = false
this.page = 1
this.classIds = ''
this.keyword = ''
this.getData()
} }
} }
}; };
</script> </script>
<style lang="scss" scoped>
/deep/.dialog{ <style lang="scss" scopted>
.el-form-item{
.el-form-item__label{
font-size: 16px;
color: rgba(0, 0, 0, 0.65);
&:before{
margin-right: 0;
color: #CC221C;
}
}
}
.el-input,.el-select{
width: 100%;
}
}
</style> </style>

@ -0,0 +1,390 @@
<template>
<div>
<div class="tool">
<ul class="filter"></ul>
<div>
<el-button type="primary" size="small" round @click="addMajor" v-auth="'/student/list:架构管理:新增架构'">新增架构</el-button>
</div>
</div>
<el-table :data="listData" stripe header-align="center" row-key="index" :tree-props="treeProps" :indent="9">
<el-table-column prop="label" label="架构名称">
<template slot-scope="scope">
<span class="text">{{scope.row.label}}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)" v-auth="'/student/list:架构管理:编辑'">编辑</el-button>
<el-button v-if="scope.row.level" type="text" @click="add(scope.row)" v-auth="'/student/list:架构管理:添加'">添加</el-button>
<el-button type="text" @click="del(scope.row)" v-auth="'/student/list:架构管理:删除'">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :title="Form.classmajorId ? '编辑专业' : '新增专业'" :visible.sync="isaddClassMajor" width="460px" @close="closeAddClass" :close-on-click-modal="false">
<el-form ref="Form" :model="Form">
<el-form-item prop="classmajorName">
<el-input placeholder="请输入专业名称" v-model="Form.classmajorName" @change="majorChange"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="isaddClassMajor = false">取消</el-button>
<el-button size="small" type="primary" @click="sure">确定</el-button>
</span>
</el-dialog>
<el-dialog :title="Form2.departmentId ? '编辑年级' : '新增年级'" :visible.sync="isAddDepartment" width="460px" @close="closeAddClass2" :close-on-click-modal="false">
<el-form ref="Form2" :model="Form2">
<el-form-item prop="departmentName">
<el-input placeholder="请输入年级名称" v-model.number="Form2.departmentName"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="isAddDepartment = false">取消</el-button>
<el-button size="small" type="primary" @click="sureDepartment">确定</el-button>
</span>
</el-dialog>
<el-dialog :title="Form3.classId ? '编辑班级' : '新增班级'" :visible.sync="isAddClass" width="460px" @close="closeAddClass3" :close-on-click-modal="false">
<el-form ref="Form3" :model="Form3">
<el-form-item prop="className">
<el-input placeholder="请输入班级名称" v-model.number="Form3.className"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="isAddClass = false">取消</el-button>
<el-button size="small" type="primary" @click="sureClass('Form3')">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { mapState } from 'vuex'
import util from '@/libs/util'
export default {
name: 'organization',
data() {
return {
treeProps: {children: 'children', hasChildren: 'hasChildren'},
listData: [],
isaddClassMajor: false,
isAddDepartment: false,
isAddClass: false,
Form: {
classmajorId: '',
classmajorName: '',
},
Form2: {
departmentId: '',
departmentName: '',
},
Form3: {
classId: '',
className: ''
},
majorNoAdd: true,
};
},
computed: {
...mapState('user', [
'clientId','clientName'
]),
},
mounted() {
this.getData()
},
methods: {
getData(){
let data = {
schoolId: this.clientId
}
this.$get(this.api.queryStudentProfessionalArchitecture,data).then(res => {
let StaffProfessionalArchitectureList = res.data.StaffProfessionalArchitectureList
if(StaffProfessionalArchitectureList){
let index = 0
StaffProfessionalArchitectureList.map(e => {
e.level = 1
e.id = e.stuProfessionalArchitectureId
e.label = e.stuProfessionalArchitectureName
e.index = ++index
let data = {
stuProfessionalArchitectureId: e.stuProfessionalArchitectureId
}
this.$get(this.api.queryGrade,data).then(res => {
e.children = res.data.Grade
e.children.map(e => {
e.level = 2
e.id = e.gradeId
e.label = e.gradeName
e.index = ++index
let data = {
gradeId: e.gradeId
}
this.$get(this.api.queryClass,data).then(res => {
res.data.Class.map(e => {
e.id = e.classId
e.label = e.className
e.index = ++index
})
e.children = res.data.Class
}).catch(res => {})
})
}).catch(res => {})
})
setTimeout(() => {
this.listData = StaffProfessionalArchitectureList
}, 500)
}
}).catch(res => {})
},
closeAddClass(){
this.$refs.Form.resetFields()
},
closeAddClass2(){
this.$refs.Form2.resetFields()
},
closeAddClass3(){
this.$refs.Form3.resetFields()
},
add(item){
if(item.level == 1){
this.addClassDepartment(item)
}else if(item.level == 2){
this.addClass(item)
}
},
edit(item){
if(item.level == 1){
this.editmajorClass(item)
}else if(item.level == 2){
this.editDepartment(item)
}else{
this.editClass(item)
}
},
del(item){
if(item.level == 1){
this.delClassDepartment(item)
}else if(item.level == 2){
this.delDepart(item)
}else{
this.delClass(item)
}
},
addMajor(){
this.Form.classmajorId = ''
this.Form.classmajorName = ''
this.isaddClassMajor = true
},
editmajorClass(item){
this.Form.classmajorId = item.stuProfessionalArchitectureId,
this.Form.classmajorName = item.stuProfessionalArchitectureName
this.isaddClassMajor = true
},
delClassDepartment(item){
this.$confirm('确定要删除该专业吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteStudentProfessionalArchitecture}?studentProfessionalArchitectureIds=${item.stuProfessionalArchitectureId}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
},
sure(){
if(!this.Form.classmajorName) return util.warningMsg('请输入专业名称')
if(!this.majorNoAdd) return util.warningMsg('该专业名称已存在')
let data = {
stuProfessionalArchitectureName: this.Form.classmajorName,
stuProfessionalArchitectureId: this.Form.classmajorId,
schoolId: this.clientId
}
if(this.Form.classmajorId){
this.$post(this.api.updateStudentProfessionalArchitecture,data).then(res => {
util.successMsg('编辑成功')
this.isaddClassMajor = false
this.getData()
}).catch(res => {})
}else{
this.$post(this.api.addStudentProfessionalArchitecture,data).then(res => {
util.successMsg('添加成功')
this.isaddClassMajor = false
this.getData()
}).catch(res => {})
}
},
addClassDepartment(item){
this.Form2.departmentId = ''
this.Form2.departmentName = ''
this.isAddDepartment = true
this.Form.classmajorId = item.stuProfessionalArchitectureId
},
editDepartment(item){
this.Form2.departmentId = item.gradeId,
this.Form2.departmentName = item.gradeName
this.isAddDepartment = true
for (let j = 0; j < this.listData.length; j++) {
for (let k = 0; k < this.listData[j].children.length; k++) {
if(this.listData[j].children[k].gradeName == item.gradeName){
this.Form.classmajorId = this.listData[j].stuProfessionalArchitectureId
}
}
}
},
delDepart(item){
this.$confirm('确定要删除该年级吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteGrade}?gradeIds=${item.gradeId}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
})
.catch(() => {});
},
sureDepartment(){
if(!this.Form2.departmentName) return util.warningMsg('请输入年级名称')
if(isNaN(this.Form2.departmentName)) return util.warningMsg('年级名称必须为数字')
let data = {
gradeName: this.Form2.departmentName,
gradeId: this.Form2.departmentId,
stuProfessionalArchitectureId: this.Form.classmajorId,
}
if(this.Form2.departmentId){
this.$post(this.api.updateGrade,data).then(res => {
util.successMsg('编辑成功')
this.isAddDepartment = false
this.getData()
}).catch(res => {})
}else{
this.$post(this.api.addGrade,data).then(res => {
util.successMsg('添加成功')
this.isAddDepartment = false
this.getData()
}).catch(res => {})
}
},
async majorChange(){
let res = await this.$get(this.api.queryStudentPAN, { name: this.Form.classmajorName,schoolId: this.clientId })
if(res.data.studentProfessionalArchitecture != null){
util.warningMsg('该专业组织已存在')
this.majorNoAdd = false
}else{
this.majorNoAdd = true
}
},
addClass(two){
this.Form3.classId = ''
this.Form3.className = ''
this.isAddClass = true
this.Form2.departmentId = two.gradeId
},
editClass(three){
this.Form3.classId = three.classId,
this.Form3.className = three.className
this.isAddClass = true
for (let j = 0; j < this.listData.length; j++) {
for (let k = 0; k < this.listData[j].children.length; k++) {
for(let l = 0; l < this.listData[j].children[k].children.length; l++){
if(this.listData[j].children[k].children[l].className == three.className){
this.Form2.departmentId = this.listData[j].gradeId
}
}
}
}
},
delClass(item,index){
this.$confirm('确定要删除该班级吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteClass}?classIds=${item.classId}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
})
.catch(() => {});
},
sureClass(){
if(!this.Form3.className) return util.warningMsg('请输入班级名称')
let data = {
className: this.Form3.className,
classId: this.Form3.classId,
gradeId: this.Form2.departmentId
}
if(this.Form3.classId){
this.$post(this.api.updateClass,data).then(res => {
util.successMsg('编辑成功')
this.isAddClass = false
this.getData()
}).catch(res => {})
}else{
this.$post(this.api.addClass,data).then(res => {
util.successMsg('添加成功')
this.isAddClass = false
this.getData()
}).catch(res => {})
}
}
}
};
</script>
<style lang="scss" scoped>
/deep/.el-table{
th:first-child{
.cell{
&:before{
content: '';
display: inline-block;
padding-left: 25vw;
}
}
}
.el-table__body-wrapper{
td:first-child{
.cell{
display: flex;
justify-content: flex-end;
align-items: center;
flex-direction: row-reverse;
i{
font-size: 16px;
}
.text:before{
content: '';
display: inline-block;
padding-left: 25vw;
}
.el-table__placeholder + .text:before{
padding-left: 27vw;
}
.el-table__expand-icon{
transform: rotate(90deg);
&.el-table__expand-icon--expanded{
transform: rotate(-90deg);
}
}
}
}
.el-table__row--level-1{
td:first-child{
.cell{
.text:before{
content: '';
display: inline-block;
padding-left: 26vw;
}
}
}
}
}
}
</style>

@ -0,0 +1,553 @@
<template>
<div>
<div class="tool">
<ul class="filter">
<li>
<label>筛选</label>
<el-cascader :options="orgList" :props="props" collapse-tags clearable size="small" @change="orgChange"></el-cascader>
</li>
<li>
<label>搜索</label>
<el-input placeholder="请输入学生名称" prefix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input>
</li>
</ul>
<div>
<el-button type="primary" size="small" round @click="addstudent" v-auth="'/student/list:学生管理:新增学生'">新增学生</el-button>
<el-button type="primary" size="small" round @click="batchImport" v-auth="'/student/list:学生管理:批量导入'">批量导入</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth="'/student/list:学生管理:批量删除'">批量删除</el-button>
</div>
</div>
<!-- <StudentSide ref="getSelectData" @fircheck="fircheck" @twocheck="twocheck" @threecheck="threecheck" @getData="getData"></StudentSide> -->
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="80" align="center"></el-table-column>
<el-table-column type="index" label="序号" width="55" align="center">
</el-table-column>
<el-table-column prop="studentName" label="学生姓名" align="center">
</el-table-column>
<el-table-column prop="workNumber" label="学生学号" align="center">
</el-table-column>
<el-table-column prop="stuProfessionalArchitectureName" label="专业" align="center">
</el-table-column>
<el-table-column prop="gradeName" label="年级" align="center">
</el-table-column>
<el-table-column prop="className" label="班级" align="center">
</el-table-column>
<el-table-column prop="loginNumber" label="登录次数" align="center">
</el-table-column>
<el-table-column prop="lastLoginTime" label="上次登录时间" width="150" align="center">
</el-table-column>
<el-table-column label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button type="text" @click="editstudent(scope.row)" v-auth="'/student/list:学生管理:编辑'">编辑</el-button>
<el-button type="text" @click="resetPassword(scope.row)" v-auth="'/student/list:学生管理:重置密码'">重置密码</el-button>
<el-button type="text" @click="delstudent(scope.row)" v-auth="'/student/list:学生管理:删除'">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total,prev, pager, next" :current-page="page" @current-change="handleCurrentChange" :total="total"></el-pagination>
</div>
<el-dialog :title="isAdd ? '新增学生' : '编辑学生'" :visible.sync="studentVisible" width="30%" @close="closestudent" class="dialog" :close-on-click-modal="false">
<el-form ref="studentForm" :model="studentForm" :rules="rules" label-width="100px" label-suffix="">
<el-form-item prop="account" label="账号">
<el-input v-model="studentForm.account" placeholder="请输入学生账号" @change="accountChange"></el-input>
</el-form-item>
<el-form-item prop="userName" label="学生姓名">
<el-input v-model="studentForm.userName" placeholder="请输入学生姓名"></el-input>
</el-form-item>
<el-form-item prop="uniqueIdentificationAccount" label="唯一标识">
<el-input disabled v-model="studentForm.uniqueIdentificationAccount" placeholder="请输入学生学号获取唯一标识"></el-input>
</el-form-item>
<el-form-item prop="workNumber" label="学生学号">
<el-input v-model="studentForm.workNumber" placeholder="请输入学生学号" @change="workNumberChange"></el-input>
</el-form-item>
<el-form-item prop="professionalId" label="专业">
<el-select v-model="studentForm.professionalId" placeholder="请选择专业" @change="getGrade">
<el-option v-for="(item,index) in orgList" :key="index"
:label="item.stuProfessionalArchitectureName" :value="item.stuProfessionalArchitectureId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="gradeId" label="年级">
<el-select v-model="studentForm.gradeId" placeholder="请选择年级" :disabled="studentForm.professionalId ? false : true" @change="getClass">
<el-option v-for="(item,index) in gradeList" :key="index"
:label="item.gradeName" :value="item.gradeId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="classId" label="班级">
<el-select v-model="studentForm.classId" placeholder="请选择班级" :disabled="studentForm.gradeId ? false : true">
<el-option v-for="(item,index) in classList" :key="index"
:label="item.className" :value="item.classId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input v-model="studentForm.phone" placeholder="可以用于登录平台,以及找回密码" maxlength="11"></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱">
<el-input v-model="studentForm.email" placeholder="可以用于登录平台,以及找回密码"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="studentVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="saveSure('studentForm')">确定</el-button>
</span>
</el-dialog>
<el-dialog title="批量导入" :visible.sync="importVisible" width="400px" :close-on-click-modal="false">
<div class="upload-wrap" :class="{lg: uploadFaild}">
<el-button class="download" size="small" @click="downLoad"><img src="../../../assets/img/download.png" alt=""> 模板下载</el-button>
<el-upload accept=".xls,.xlsx" :on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" :action="this.api.uploadFileStudent" :file-list="uploadList" :data="{schoolId: this.clientId}" name="file">
<el-button size="small"><img src="../../../assets/img/upload.png" alt=""> 上传文件</el-button>
</el-upload>
<div class="link" v-if="uploadFaild">
<el-link type="primary" @click="showFaild">导入失败查看原因</el-link>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="importVisible = false"> </el-button>
<el-button size="small" type="primary" @click="uploadSure"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { mapState,mapGetters } from 'vuex'
import util from '@/libs/util'
import Setting from '@/setting'
export default {
data() {
return {
props: { multiple: true },
orgList: [],
twoDepartmentIds: '',
studentVisible: false,
studentForm: {
clientId: this.clientId,
clientName: this.clientName,
studentId: '',
userId: '',
userName: '',
workNumber: '',
phone: '',
email: '',
professionalId: '',
gradeId: '',
classId: '' ,
uniqueIdentificationAccount: '',
account: ''
},
rules: {
userName: [
{ required: true, message: '请输入学生姓名', trigger: 'blur' }
],
workNumber: [
{ required: true, message: '请输入学生学号', trigger: 'blur' },
{
pattern: /^[A-Za-z0-9]+$/,
message: '请输入正确的学生学号',
trigger: 'blur'
}
],
account: [
{ required: true, message: '请输入账号', trigger: 'blur' },
{
pattern: /^[A-Za-z0-9]*$/,
message: '请输入正确的账号',
trigger: 'blur'
}
],
professionalId: [
{ required: true, message: '请选择专业', trigger: 'change' }
],
gradeId: [
{ required: true, message: '请选择年级', trigger: 'change' }
],
classId: [
{ required: true, message: '请选择班级', trigger: 'change' }
],
phone: [
{
pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号',
trigger: 'blur'
}
],
email: [
{
pattern: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/,
message: '请输入正确的邮箱',
trigger: 'blur'
}
]
},
listData: [],
importVisible: false,
keyword: '',
page: 1,
pageSize: 10,
total: 0,
searchTimer: null,
gradeList: [],
classList: [],
professionalIds: '',
professionalStudentIds: '',
gradeIds: '',
classIds: '',
multipleSelection: [],
uploadList: [],
parmData: [],
uploadFaild: false,
token: '',
schooldId: 1,
isAdd: true,
accountRepeat: false,
workNumberRepeat: false,
originalAccount: '',
originalWorkNumber: ''
};
},
computed: {
...mapState('user', [
'userId','clientId','clientName'
])
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.getData()
},500)
}
},
mounted(){
this.getOrg()
this.studentForm.clientId = this.clientId
this.studentForm.clientName = this.clientName
this.getData()
},
methods: {
getOrg(){
let data = {
schoolId: this.clientId
}
this.$get(this.api.queryStudentProfessionalArchitecture,data).then(res => {
let StaffProfessionalArchitectureList = res.data.StaffProfessionalArchitectureList
if(StaffProfessionalArchitectureList){
StaffProfessionalArchitectureList.map(e => {
e.isParent = true
e.value = e.stuProfessionalArchitectureId
e.label = e.stuProfessionalArchitectureName
let data = {
stuProfessionalArchitectureId: e.stuProfessionalArchitectureId
}
this.$get(this.api.queryGrade,data).then(res => {
e.children = res.data.Grade
e.children.map(e => {
e.value = e.gradeId
e.label = e.gradeName
let data = {
gradeId: e.gradeId
}
this.$get(this.api.queryClass,data).then(res => {
res.data.Class.map(e => {
e.value = e.classId
e.label = e.className
})
e.children = res.data.Class
}).catch(res => {})
})
}).catch(res => {})
})
setTimeout(() => {
this.orgList = StaffProfessionalArchitectureList
}, 500)
}
}).catch(res => {})
},
getData(){
let data = {
searchContent: this.keyword,
professionalIds: this.professionalStudentIds,
gradeIds: this.gradeIds,
classIds: this.classIds,
schoolId: this.clientId
}
this.$get(`${this.api.queryStudent}/${this.page}/${this.pageSize}`,data).then(res => {
this.listData = res.data.studentList.list
this.total = res.data.studentList.totalCount
}).catch(res => {})
},
orgChange(node){
this.classIds = node.map(n => n[2]).toString()
this.getData()
},
closestudent(){
this.$refs.studentForm.resetFields()
},
addstudent(){
this.studentForm.studentId = ''
this.studentVisible = true
this.isAdd = true
},
editstudent(row){
this.studentVisible = true
this.isAdd = false
this.studentForm.studentId = row.studentId
this.studentForm.userId = row.userId
this.$get(`${this.api.getStudent}/${row.studentId}`).then(res => {
let student = res.data.student
let userInfo = res.data.userInfo
this.studentForm.userName = userInfo.userName,
this.studentForm.workNumber = student.workNumber,
this.originalWorkNumber = student.workNumber,
this.studentForm.uniqueIdentificationAccount = userInfo.uniqueIdentificationAccount,
this.studentForm.professionalId = student.professionalId,
this.studentForm.gradeId = student.gradeId,
this.studentForm.classId = student.classId,
this.studentForm.phone = userInfo.phone,
this.studentForm.email = userInfo.email,
this.studentForm.account = userInfo.account
this.originalAccount = userInfo.account
this.getGradeData()
this.getClassData()
}).catch(res => {});
},
resetPassword(row){
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, '提示',).then(() => {
let data = {
userId: row.userId,
password: Setting.initialPassword
}
this.$post(this.api.userinfoUpdate,data).then(res => {
if(res.success){
util.successMsg('重置成功')
}else{
util.errorMsg('重置失败')
}
}).catch(res => {})
}).catch(() => {})
},
//
getGrade(){
this.studentForm.gradeId = ''
this.studentForm.classId = ''
this.getGradeData()
},
getGradeData(){
let data = {
stuProfessionalArchitectureId: this.studentForm.professionalId
}
this.$get(this.api.queryGrade,data).then(res => {
this.gradeList = res.data.Grade
}).catch(res => {});
},
//
getClass(){
this.studentForm.classId = ''
this.getClassData()
},
getClassData(){
let data = {
gradeId: this.studentForm.gradeId
}
this.$get(this.api.queryClass,data).then(res => {
this.classList = res.data.Class
}).catch(res => {});
},
async accountChange(){
if(this.studentForm.account !== this.originalAccount){
this.$get(`${this.api.getAccount}?account=${this.studentForm.account}`).then(res => {
if(res.data.userInfo){
this.accountRepeat = true
util.warningMsg('该账号已存在')
}else{
this.accountRepeat = false
}
}).catch(res => {})
}else{
this.accountRepeat = false
}
},
workNumberChange(){
if(this.studentForm.workNumber !== this.originalWorkNumber){
this.$get(`${this.api.studentGetWorkNumber}?workNumber=${this.studentForm.workNumber}`).then(res => {
if(res.data.student){
this.workNumberRepeat = true
util.warningMsg('该学号已存在')
}else{
this.workNumberRepeat = false
}
}).catch(res => {})
}else{
this.workNumberRepeat = false
}
},
saveSure(studentForm){
this.$refs[studentForm].validate((valid) => {
if (valid) {
if(this.accountRepeat) return util.warningMsg('该账号已存在')
if(this.workNumberRepeat) return util.warningMsg('该学号已存在')
let data = {
userInfo: {
isPort: 2,
roleId: 4,
clientId: this.studentForm.clientId,
clientName: this.studentForm.clientName,
userName: this.studentForm.userName,
account: this.studentForm.account,
phone: this.studentForm.phone,
email: this.studentForm.email,
uniqueIdentificationAccount: this.studentForm.uniqueIdentificationAccount,
userId: this.studentForm.userId ? this.studentForm.userId : ''
},
student: {
userId: this.studentForm.userId,
studentId: this.studentForm.studentId,
roleId: 4,
isPort: 2,
clientId: this.studentForm.clientId,
clientName: this.studentForm.clientName,
professionalId: this.studentForm.professionalId,
gradeId: this.studentForm.gradeId,
classId: this.studentForm.classId,
workNumber: this.studentForm.workNumber,
}
}
if(this.studentForm.studentId){
this.$post(this.api.updateStudent,data).then(res => {
this.studentVisible = false
util.successMsg('编辑成功')
this.getData()
}).catch(res => {});
}else{
this.$post(this.api.addStudent,data).then(res => {
this.studentVisible = false
util.successMsg('添加成功')
this.getData()
}).catch(res => {});
}
}else{
return false;
}
})
},
delstudent(row){
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', {
type: 'warning'
})
.then(() => {
let data = {
studentIds: row.studentId
}
this.$del(this.api.deleteStudents,data).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => {});
})
.catch(() => {});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delAllSelection() {
if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection
let delList = newArr.map(item => {
return item.studentId
})
//
this.$confirm(`此批量删除操作不可逆,是否确认删除${util.ellipsisStr(newArr[0].studentName)}${newArr.length}个选中项?`, '提示', {
type: 'warning'
})
.then(() => {
let data = {
studentIds: delList.join()
}
this.$del(this.api.deleteStudents,data).then(res => {
this.multipleSelection = []
util.successMsg('删除成功')
this.getData()
}).catch(res => {});
}).catch(() => {});
}else{
util.errorMsg('请先选择学生')
}
},
batchImport(){
this.importVisible = true
},
searchstudent(){
this.page = 1
this.getData()
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
downLoad(){
location.href = this.api.downloadStudentTemp
},
//
handleExceed(files, fileList) {
util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
showFaild(){
location.href = `${this.api.exportFailureStudent}?token=${this.token}`
},
uploadSuccess(res, file, fileList) {
this.uploadFaild = false
if(res.success){
if(res.data.data.token){
this.token = res.data.data.token
this.uploadFaild = true
}else{
util.successMsg('上传成功')
}
}else{
res.data.message ? util.errorMsg(res.data.message) : util.errorMsg('上传失败,请检查数据')
}
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
this.uploadList = fileList
this.uploadFaild = false
},
uploadSure(){
this.importVisible = false
this.page = 1
this.classIds = ''
this.keyword = ''
this.getData()
}
}
};
</script>
<style lang="scss" scoped>
/deep/.dialog{
.el-form-item{
.el-form-item__label{
font-size: 16px;
color: rgba(0, 0, 0, 0.65);
&:before{
margin-right: 0;
color: #CC221C;
}
}
}
.el-input,.el-select{
width: 100%;
}
}
</style>

@ -1,14 +1,14 @@
<template> <template>
<div> <div>
<breadcrumb :data="'系统分管设置/' + tabs[active]" ref="breadcrumb"></breadcrumb> <breadcrumb :data="'系统设置/' + tabs[active]" ref="breadcrumb"></breadcrumb>
<div class="page"> <div class="page">
<div class="tabs" v-if="showTabs"> <div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a> <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a>
</div> </div>
<div class="page-content"> <div class="page-content">
<staff v-if="active == 'staff'" v-auth="'系统分管设置:员工管理'"></staff> <staff v-if="active == 'staff'" v-auth="'系统设置:员工管理'"></staff>
<role v-else-if="active == 'role'" v-auth="'系统分管设置:角色权限'"></role> <role v-else-if="active == 'role'" v-auth="'系统设置:角色权限'"></role>
<organization v-else v-auth="'系统分管设置:架构管理'"></organization> <organization v-else v-auth="'系统设置:架构管理'"></organization>
</div> </div>
</div> </div>
</div> </div>
@ -29,8 +29,7 @@ export default {
staff: '员工管理', staff: '员工管理',
role: '角色权限', role: '角色权限',
organization: '架构管理' organization: '架构管理'
}, }
showTabs: true
}; };
}, },
components: { components: {
@ -50,16 +49,21 @@ export default {
methods: { methods: {
tabChange(index){ tabChange(index){
this.active = index this.active = index
this.$refs.breadcrumb.update('系统分管设置/' + this.tabs[this.active]) this.$refs.breadcrumb.update('系统设置/' + this.tabs[this.active])
}, },
initTabs(){ initTabs(){
let showStaff = this.btns.includes('系统分管设置:员工管理') let tab1 = this.btns.includes('系统设置:员工管理')
let showRole = this.btns.includes('系统分管设置:角色权限') let tab2 = this.btns.includes('系统设置:角色权限')
let tab3 = this.btns.includes('系统设置:架构管理')
if(!showStaff || !showRole){ if(!tab1 && tab2){
this.showTabs = false this.active = 'role'
}else if(!tab1 && !tab2 && tab3){
this.active = 'organization'
} }
!showStaff && showRole && (this.activeName = 'role') if(!tab1) delete this.tabs.staff
if(!tab2) delete this.tabs.role
if(!tab3) delete this.tabs.organization
} }
} }
}; };

@ -30,7 +30,7 @@
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="isaddMajor = false"> </el-button> <el-button size="small" @click="isaddMajor = false"> </el-button>
<el-button size="small" type="primary" @click="sure('Form')"> </el-button> <el-button size="small" type="primary" @click="sure"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -42,7 +42,7 @@
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="isAddDepartment = false"> </el-button> <el-button size="small" @click="isAddDepartment = false"> </el-button>
<el-button size="small" type="primary" @click="sureDepartment('Form')"> </el-button> <el-button size="small" type="primary" @click="sureDepartment"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -132,7 +132,7 @@ export default {
} }
}, },
async majorChange(){ async majorChange(){
let res = await this.$get(this.api.queryStaffPAN, { name: this.Form.majorName,schoolId: this.schoolId }); let res = await this.$get(this.api.queryStaffPAN, { name: this.Form.majorName,schoolId: this.clientId });
if(res.data.StaffProfessionalArchitecture != null){ if(res.data.StaffProfessionalArchitecture != null){
util.warningMsg('该一级部门已存在'); util.warningMsg('该一级部门已存在');
this.majorNoAdd = false this.majorNoAdd = false
@ -155,7 +155,7 @@ export default {
let data = { let data = {
staffProfessionalArchitectureName: this.Form.majorName, staffProfessionalArchitectureName: this.Form.majorName,
staffProfessionalArchitectureId: this.Form.MajorId, staffProfessionalArchitectureId: this.Form.MajorId,
schoolId: this.schoolId, schoolId: this.clientId,
} }
if(this.Form.MajorId){ if(this.Form.MajorId){
this.$post(this.api.updateStaffPro,data).then(res => { this.$post(this.api.updateStaffPro,data).then(res => {
@ -178,11 +178,11 @@ export default {
this.isAddDepartment = true this.isAddDepartment = true
this.Form.MajorId = item.staffProfessionalArchitectureId this.Form.MajorId = item.staffProfessionalArchitectureId
}, },
sureDepartment(Form){ sureDepartment(){
if(!this.Form.departmentName) return util.warningMsg('请输入部门名称'); if(!this.Form.departmentName) return util.warningMsg('请输入部门名称');
if(!this.depNoAdd) return util.warningMsg('该二级部门已存在'); if(!this.depNoAdd) return util.warningMsg('该二级部门已存在');
let data = { let data = {
schoolId: this.schoolId, schoolId: this.clientId,
staffGradeName: this.Form.departmentName, staffGradeName: this.Form.departmentName,
staffProfessionalArchitectureId: this.Form.MajorId, staffProfessionalArchitectureId: this.Form.MajorId,
staffGradeId: this.Form.departmentId staffGradeId: this.Form.departmentId

@ -39,9 +39,8 @@
</el-pagination> </el-pagination>
</div> </div>
<el-dialog :title="isDetail ? '查看角色' : (isAdd ? '新增角色' : '编辑角色')" :visible.sync="roleVisible" <el-dialog :title="isDetail ? '查看角色' : (isAdd ? '新增角色' : '编辑角色')" :visible.sync="roleVisible" width="500px" @close="closeRole" class="dialog" :close-on-click-modal="false">
width="30%" center @close="closeRole" class="dialog" :close-on-click-modal="false"> <el-form ref="form" :model="form" label-width="100px" label-suffix="" :disabled="isDetail">
<el-form ref="form" :model="form" label-width="100px" :disabled="isDetail">
<el-form-item label="角色名称"> <el-form-item label="角色名称">
<el-input v-model="form.roleName " ref="account" placeholder="请输入角色名称"></el-input> <el-input v-model="form.roleName " ref="account" placeholder="请输入角色名称"></el-input>
</el-form-item> </el-form-item>
@ -63,8 +62,8 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail"> <span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button @click="roleVisible = false"> </el-button> <el-button size="small" @click="roleVisible = false"> </el-button>
<el-button type="primary" @click="saveData"> </el-button> <el-button size="small" type="primary" @click="saveData"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>

@ -56,7 +56,7 @@
</div> </div>
<el-dialog :title="isDetail ? '查看员工' : (isAddteacher ? '新增员工' : '编辑员工')" :visible.sync="teacherVisible" width="500px" @close="closeTeacher" class="dialog" :close-on-click-modal="false"> <el-dialog :title="isDetail ? '查看员工' : (isAddteacher ? '新增员工' : '编辑员工')" :visible.sync="teacherVisible" width="500px" @close="closeTeacher" class="dialog" :close-on-click-modal="false">
<el-form ref="teacherForm" :model="teacherForm" :rules="rules" label-width="100px" :disabled="isDetail"> <el-form ref="teacherForm" :model="teacherForm" :rules="rules" label-width="100px" label-suffix="" :disabled="isDetail">
<el-form-item prop="userAccount" label="账号"> <el-form-item prop="userAccount" label="账号">
<el-input v-model="teacherForm.userAccount" ref="account" placeholder="请输入职工账号" @change="accountChange"></el-input> <el-input v-model="teacherForm.userAccount" ref="account" placeholder="请输入职工账号" @change="accountChange"></el-input>
</el-form-item> </el-form-item>
@ -97,8 +97,8 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail"> <span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button @click="teacherVisible = false"> </el-button> <el-button size="small" @click="teacherVisible = false"> </el-button>
<el-button type="primary" @click="saveSure('teacherForm')"> </el-button> <el-button size="small" type="primary" @click="saveSure('teacherForm')"> </el-button>
</span> </span>
</el-dialog> </el-dialog>

@ -181,8 +181,8 @@
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button v-throttle @click="manualVisible = false">取消</el-button> <el-button size="small" v-throttle @click="manualVisible = false">取消</el-button>
<el-button v-throttle type="primary" @click="submitManual">确定</el-button> <el-button size="small" v-throttle type="primary" @click="submitManual">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -234,8 +234,8 @@
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button v-throttle @click="inteVisible = false">取消</el-button> <el-button size="small" v-throttle @click="inteVisible = false">取消</el-button>
<el-button type="primary" v-throttle @click="submitInte">确定</el-button> <el-button size="small" type="primary" v-throttle @click="submitInte">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>

@ -63,8 +63,8 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="120"> <el-table-column label="操作" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" v-if="scope.row.state == 0 && userId == scope.row.userId" @click="publish(scope.row)" v-auth="'/testPaper/list:所有试卷:发布'">发布</el-button> <el-button type="text" v-if="scope.row.state == 0 && userId == scope.row.userId" @click="publish(scope.row)" v-auth="'/testPaper/list:本校卷库:发布'">发布</el-button>
<el-button type="text" @click="preview(scope.row)" v-auth="'/testPaper/list:所有试卷:预览'">预览</el-button> <el-button type="text" @click="preview(scope.row)" v-auth="'/testPaper/list:本校卷库:预览'">预览</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

@ -7,7 +7,7 @@
</div> </div>
<div class="page-content"> <div class="page-content">
<my-test-paper v-if="active == 'my'" v-auth="'试卷管理:我的试卷'"></my-test-paper> <my-test-paper v-if="active == 'my'" v-auth="'试卷管理:我的试卷'"></my-test-paper>
<all-test-paper v-else v-auth="'试卷管理:所有试卷'"></all-test-paper> <all-test-paper v-else v-auth="'试卷管理:本校卷库'"></all-test-paper>
</div> </div>
</div> </div>
</div> </div>
@ -48,7 +48,7 @@ export default {
}, },
initTabs(){ initTabs(){
let tab1 = this.btns.includes('试卷管理:我的试卷') let tab1 = this.btns.includes('试卷管理:我的试卷')
let tab2 = this.btns.includes('试卷管理:所有试卷') let tab2 = this.btns.includes('试卷管理:本校卷库')
if(!tab1 && tab2){ if(!tab1 && tab2){
this.active = 'all' this.active = 'all'

@ -288,8 +288,7 @@ export default {
delData(row) { delData(row) {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', {
type: 'warning' type: 'warning'
}) }).then(() => {
.then(() => {
this.$post(`${this.api.delByMyTestPaper}?ids=${row.id}`).then(res => { this.$post(`${this.api.delByMyTestPaper}?ids=${row.id}`).then(res => {
util.successMsg('删除成功') util.successMsg('删除成功')
this.getData() this.getData()

@ -62,7 +62,7 @@ const Setting = {
maxSize: 30, maxSize: 30,
}, },
// 是否使用动态路由 // 是否使用动态路由
dynamicRoute: false dynamicRoute: true
}; };
export default Setting; export default Setting;

@ -5,6 +5,7 @@ export default {
namespaced: true, namespaced: true,
state: { state: {
practiseId: '', practiseId: '',
practiseName: '',
endTime: '', endTime: '',
id: '', id: '',
paperId: '', paperId: '',
@ -81,6 +82,7 @@ export default {
SET_INFO: (state, info) => { SET_INFO: (state, info) => {
state.practiseId = info.practiseId state.practiseId = info.practiseId
state.endTime = info.endTime state.endTime = info.endTime
state.practiseName = info.practiseName
}, },
SET_REVIEW_INFO: (state, info) => { SET_REVIEW_INFO: (state, info) => {
state.id = info.id state.id = info.id

@ -356,8 +356,15 @@
color: #ffa900; color: #ffa900;
} }
} }
.el-button--primary,.el-button--primary:hover, .el-button--primary:focus{ .el-button--primary{
background: #CC221C; color: #606266;
background: #fff;
border-color: #DCDFE6;
&:hover{
color: $--color-primary;
border-color: #efbdbb;
background-color: #fae9e8;
}
} }
} }

Loading…
Cancel
Save