diff --git a/src/assets/img/class.png b/src/assets/img/class.png new file mode 100644 index 0000000..6144687 Binary files /dev/null and b/src/assets/img/class.png differ diff --git a/src/components/page/ClassAchievement.vue b/src/components/page/ClassAchievement.vue index d126f03..5f3d028 100644 --- a/src/components/page/ClassAchievement.vue +++ b/src/components/page/ClassAchievement.vue @@ -30,17 +30,17 @@ - + - + @@ -58,6 +58,8 @@ export default { name: 'achievement', data() { return { + classId: this.$route.query.classId, + className: this.$route.query.className, userId: this.$store.state.userLoginId, keyword: '', systemId: this.$config.systemId, @@ -138,19 +140,14 @@ export default { background: 'rgba(255,255,255,.6)' }) let data = { - searchContant: this.encodeString(this.keyword), - startTime: this.startingtime, - endtime: this.endtime, - month: this.month, - page: this.pageNo, - size: this.pageSize, - userId: this.userId, - systemId: this.systemId, - projectPermissions: this.projectPermissions + classId: this.classId, + searchContent: this.encodeString(this.keyword), + current: this.pageNo, + pageSize: this.pageSize, } - this.$get(this.api.queryAchievementNew,data).then(res => { - this.listData = res.data.list - this.totals = res.data.total + this.$post(this.api.classAssessmentList,data).then(res => { + this.listData = res.list.list + this.totals = res.list.totalCount this.$nextTick(() => { this.loadIns.close() }) @@ -159,25 +156,19 @@ export default { }) }, entry(row){ - if(this.projectPermissions){ - this.$store.commit('addExperimentData',{experimentData: { - id: row.id, - name: row.projectName, - class: row.experimentalClassName, - systemId: this.systemId, - projectId: row.projectId, - experimentalName: row.experimentalName - }}) - this.$router.push('experimentTeach') - }else{ - this.$store.commit('addExperimentData',{experimentData: { - id: row.projectId, - name: row.projectName, - class: row.experimentalClassName, - systemId: this.systemId - }}) - this.$router.push('experimentVir') - } + let classList = [{ + classId: this.classId, + className: this.className + }] + + this.$store.commit('addExperimentData',{experimentData: { + id: row.id, + name: row.projectName, + classList, + projectId: row.projectId, + experimentalName: row.experimentalName + }}) + this.$router.push('classExperimentAss') }, disabledSelection(row,index){ if(row.isdel == 0) return false diff --git a/src/components/page/ClassInfo.vue b/src/components/page/ClassInfo.vue index 3e33db2..8d994c9 100644 --- a/src/components/page/ClassInfo.vue +++ b/src/components/page/ClassInfo.vue @@ -1,14 +1,23 @@ @@ -21,6 +30,8 @@ export default { return { activeName: 'first', userId: this.$store.state.userId, + classId: this.$route.query.classId, + className: this.$route.query.className, tabs: { first: '学生管理', second: '成绩管理' @@ -37,6 +48,9 @@ export default { methods: { tabChange(index){ this.activeName = index + }, + goback() { + this.$router.back() } } }; diff --git a/src/components/page/ClassStudent.vue b/src/components/page/ClassStudent.vue index ad667a6..7801ad2 100644 --- a/src/components/page/ClassStudent.vue +++ b/src/components/page/ClassStudent.vue @@ -8,22 +8,21 @@ 批量删除
- +
- + - - - - + + + + + @@ -99,9 +98,10 @@ :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" - :action="this.api.uploadFile" - :file-list="uploadList" + :action="this.api.uploadStudents" + :file-list="uploadList" name="file" + :data="uploadData" > 上传文件 @@ -140,6 +140,7 @@ + + + diff --git a/src/main.js b/src/main.js index 230ea80..4f148db 100644 --- a/src/main.js +++ b/src/main.js @@ -11,7 +11,7 @@ import './assets/icon/iconfont.css'; import './components/common/directives'; import 'babel-polyfill'; import './util/rem'; -import {post,get,del,put} from './utils/http'; +import {post,get,del,delbody,put} from './utils/http'; import api from './utils/api'; import store from './store' import config from '@/config' @@ -29,6 +29,7 @@ Vue.prototype.api = api; Vue.prototype.$get = get; Vue.prototype.$post = post; Vue.prototype.$del = del; +Vue.prototype.$delbody = delbody; Vue.prototype.$put = put; Vue.prototype.$config = config diff --git a/src/router/routes.js b/src/router/routes.js index a1d53c0..bbf460f 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -65,6 +65,11 @@ export default [ component: () => import('../components/page/ExperimentAss.vue'), meta: { title: '成绩管理' } }, + { + path: '/classExperimentAss', + component: () => import('../components/page/classExperimentAss.vue'), + meta: { title: '成绩管理' } + }, { path: '/addexperiment', component: () => import('../components/page/AddExperiment.vue'), diff --git a/src/utils/api.js b/src/utils/api.js index e2c6df1..73c21bc 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -169,4 +169,16 @@ export default { queryPoint: `${host}/kdSys/queryPoint`, querySubject: `${host}/kdSys/querySubject`, queryItem: `${host}/kdSys/queryItem`, + + // 班级管理 + classList: `${host}/evaluation/class/management/classList`, //班级列表 + saveClass: `${host}/evaluation/class/management/saveClass`, //新增班级 + editClass: `${host}/evaluation/class/management/editClass`, //编辑班级 + deleteClass: `${host}/evaluation/class/management/deleteClass`, //删除班级 + queryStudentList: `${host}/evaluation/class/management/queryStudentList`, //学生列表 + deleteStudents: `${host}/evaluation/class/management/deleteStudents`, //删除学生 + addStudentToClass: `${host}/evaluation/class/management/addStudentToClass`, //新增学生 + uploadStudents: `${host}/evaluation/class/management/uploadFile`, //批量导入学生到班级 + + classAssessmentList: `${host}/evaluation/class/management/classAssessmentList`, //成绩管理列表 } \ No newline at end of file diff --git a/src/utils/http.js b/src/utils/http.js index 9766457..a235384 100644 --- a/src/utils/http.js +++ b/src/utils/http.js @@ -398,6 +398,89 @@ export function post(url, params) { }); } +export function delbody(url, params){ + getToken() + return new Promise((resolve, reject) =>{ + axios.delete(url, {data: params}) + .then(res => { + if(res.data.code == 99999){ + this.$message.error( + res.data.message + ) + }else{ + if (res.data.status) { + switch (res.data.status) { + case 200: + resolve(res.data); + break; + // case 300: + // this.$message.error( + // res.data.errmessage + // ); + // break; + case 500: + this.$message.error( + res.data.errmessage + ); + break; + case 404: + this.$message.error( + res.data.errmessage + ); + router.replace({ + path: '/404', + }); + break; + case 403: + this.$message.error( + res.data.errmessage + ); + break; + case 401: + Message.error("token失效,请重新登录"); + sessionStorage.removeItem('token'); + router.replace('/login') + break; + case 405: + this.$message.error( + res.data.errmessage + ); + break; + case 406: + this.$message.error( + res.data.errmessage + ); + break; + case 1000201: + this.$message.error( + res.data.errmessage + ); + break; + default: + reject(res) + } + }else if(res.data.code == 99999){ + Message.error(res.data.message); + }else if(res.data.success){ + resolve(res.data); + }else{ + if(!res.data.success) { + resolve(res.data); + } + } + } + }) + .catch(err => { + reject(err.data) + this.$message({ + showClose: true, + message: '请求失败,请刷新页面重新进行请求', + type: 'error' + }); + }) + }); +} + /** * put修改 * @param {} url