diff --git a/src/components/common/Sidebar.vue b/src/components/common/Sidebar.vue index e00fb3e..54074d7 100644 --- a/src/components/common/Sidebar.vue +++ b/src/components/common/Sidebar.vue @@ -108,7 +108,7 @@ export default { actives: { dashboard: ['classinfo'], assessment: ['addAssessment'], - achievement: ['experiment','experimentVir','experimentTeach','addexperiment','showExperiment'], + achievement: ['experiment','experimentVir','experimentTeach','experimentAss','addexperiment','showExperiment'], project: ['addproject','program','programOptions'], match: ['addMatch'] } diff --git a/src/components/page/Achievement.vue b/src/components/page/Achievement.vue index 89ea16b..84ddaa7 100644 --- a/src/components/page/Achievement.vue +++ b/src/components/page/Achievement.vue @@ -61,17 +61,42 @@ {{scope.$index + (pageNo - 1) * pageSize + 1}} + + + + + + + - - - - - + @@ -127,12 +152,12 @@ export default { }, { id: 1, - name: '考核模式' + name: '竞赛模式' }, { id: 2, - name: '竞赛模式' - } + name: '考核模式' + }, ], date: '', pageNo: 1, @@ -176,34 +201,58 @@ export default { this.loadIns = Loading.service({ 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 - } - let url = this.api.queryAchievement - if(this.projectPermissions){ - url = this.api.queryAchievementNew + if(this.projectPermissions == 2){ + let data = { + searchContant: this.encodeString(this.keyword), + startTime: this.startingtime, + stopTime: this.endtime, + month: this.month, + pageNum: this.pageNo, + pageSize: this.pageSize, + userId: this.userId, + type: '', + status: '', + classId: '', + } + this.$post(this.api.getAssessmentList,data).then(res => { + this.listData = res.data.list + this.totals = res.data.total + this.$nextTick(() => { + this.loadIns.close() + }) + }).catch(res => { + this.loadIns.close() + }) }else{ - data.systemId = this.systemId - data.projectPermissions = this.projectPermissions - } - this.$get(url,data).then(res => { - this.listData = res.data.list - this.totals = res.data.total - this.$nextTick(() => { + 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 + } + let url = this.api.queryAchievement + if(this.projectPermissions){ + url = this.api.queryAchievementNew + }else{ + data.systemId = this.systemId + data.projectPermissions = this.projectPermissions + } + this.$get(url,data).then(res => { + this.listData = res.data.list + this.totals = res.data.total + this.$nextTick(() => { + this.loadIns.close() + }) + }).catch(res => { this.loadIns.close() }) - }).catch(res => { - this.loadIns.close() - }) + } }, entry(row){ - if(this.projectPermissions){ + if(this.projectPermissions == 1){ this.$store.commit('addExperimentData',{experimentData: { id: row.id, name: row.projectName, @@ -213,6 +262,24 @@ export default { experimentalName: row.experimentalName }}) this.$router.push('experimentTeach') + }else if(this.projectPermissions == 2){ + let classList = [] + let className = row.experimentalClassName.split(',') + row.classId.split(',').map((n,i) => { + classList.push({ + classId: n, + className: className[i] + }) + }) + + this.$store.commit('addExperimentData',{experimentData: { + id: row.id, + name: row.projectName, + classList, + projectId: row.projectId, + experimentalName: row.experimentalName + }}) + this.$router.push('experimentAss') }else{ this.$store.commit('addExperimentData',{experimentData: { id: row.projectId, @@ -232,7 +299,7 @@ export default { type: 'warning' }) .then(() => { - this.$post(`${this.api.deleteReportById}?projectIds=${row.projectId}&projectPermissions=${row.projectPermissions}&ids=${row.id ? row.id : ''}`).then(res => { + this.$post(`${this.api.deleteKdAssessByIds}?&ids=${row.id}`).then(res => { this.$message.success('删除成功'); this.getData() }).catch(res => {}); @@ -242,25 +309,44 @@ export default { delAllData() { if(this.multipleSelection.length != ''){ let newArr = this.multipleSelection - let delList = newArr.map(item => { - return `projectIds=${item.projectId}` - }) - let delList1 = newArr[0].id ? newArr.map(item => { - return `ids=${item.id}` - }) : [] + if(this.projectPermissions == 2){ + let delList = newArr.map(item => { + return `ids =${item.id}` + }) - this.$confirm('该项目下的所有成绩报告将会删除,是否继续?', '提示', { - type: 'warning' - }) - .then(() => { - let data = `${delList.join('&')}&projectPermissions=${this.projectPermissions}&${delList1.length ? delList1.join('&') : ''}` - this.$post(`${this.api.deleteReportById}?${data}`).then(res => { - this.$refs.table.clearSelection() - this.$message.success('删除成功'); - this.getData() - }).catch(res => {}); - }) - .catch(() => {}); + this.$confirm('该项目下的所有成绩报告将会删除,是否继续?', '提示', { + type: 'warning' + }) + .then(() => { + let data = `${delList.join('&')}&${delList1.join('&')}` + this.$post(`${this.api.deleteKdAssessByIds}?${data}`).then(res => { + this.$refs.table.clearSelection() + this.$message.success('删除成功'); + this.getData() + }).catch(res => {}); + }) + .catch(() => {}); + }else{ + let delList = newArr.map(item => { + return `projectIds=${item.projectId}` + }) + let delList1 = newArr[0].id ? newArr.map(item => { + return `ids=${item.id}` + }) : [] + + this.$confirm('该项目下的所有成绩报告将会删除,是否继续?', '提示', { + type: 'warning' + }) + .then(() => { + let data = `${delList.join('&')}&projectPermissions=${this.projectPermissions}&${delList1.length ? delList1.join('&') : ''}` + this.$post(`${this.api.deleteReportById}?${data}`).then(res => { + this.$refs.table.clearSelection() + this.$message.success('删除成功'); + this.getData() + }).catch(res => {}); + }) + .catch(() => {}); + } }else{ this.$message.error('请先选择数据 !'); } diff --git a/src/components/page/AddAssessment.vue b/src/components/page/AddAssessment.vue index fc438c5..255cbab 100644 --- a/src/components/page/AddAssessment.vue +++ b/src/components/page/AddAssessment.vue @@ -195,6 +195,18 @@ export default { } }, watch: { + date: function(val){ + if(val[0] != '0000-00-00 00:00:00'){ + this.startTime = this.formatDate("yyyy-MM-dd hh:mm:ss",new Date(val[0])) + this.stopTime = this.formatDate("yyyy-MM-dd hh:mm:ss",new Date(val[1])) + } + }, + duration: { + handler(n,o){ + this.experimentDuration = `${n.day ? n.day : 0}d${n.hour ? n.hour : 0}h${n.minute ? n.minute : 0}m` + }, + deep: true + }, keyword: function(val) { clearTimeout(this.searchTimer) this.searchTimer = setTimeout(() => { @@ -238,7 +250,6 @@ export default { } }, upload() { - // return console.log(11) if(!this.experimentalName) return this.$message.warning('请填写实验名称') if(this.expNameRepeat) return this.$message.warning('实验名称重复,请重新输入') if(this.type == 1){ diff --git a/src/components/page/Assessment.vue b/src/components/page/Assessment.vue index b67dc4b..1756af9 100644 --- a/src/components/page/Assessment.vue +++ b/src/components/page/Assessment.vue @@ -325,15 +325,22 @@ export default { this.$router.push(`addAssessment?id=${row.id}`) }, show(row){ + let classList = [] + let className = row.className.split(',') + row.classId.split(',').map((n,i) => { + classList.push({ + classId: n, + className: className[i] + }) + }) this.$store.commit('addExperimentData',{experimentData: { id: row.id, name: row.projectName, - class: row.experimentalClassName, - systemId: this.systemId, + classList, projectId: row.projectId, experimentalName: row.experimentalName }}) - this.$router.push('experimentTeach') + this.$router.push('experimentAss') }, start(row){ let data = { diff --git a/src/components/page/ExperimentAss.vue b/src/components/page/ExperimentAss.vue new file mode 100644 index 0000000..c4bd6e5 --- /dev/null +++ b/src/components/page/ExperimentAss.vue @@ -0,0 +1,363 @@ + + + + + + diff --git a/src/router/routes.js b/src/router/routes.js index 397f9bd..a1d53c0 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -60,6 +60,11 @@ export default [ component: () => import('../components/page/ExperimentTeach.vue'), meta: { title: '成绩管理' } }, + { + path: '/experimentAss', + component: () => import('../components/page/ExperimentAss.vue'), + meta: { title: '成绩管理' } + }, { path: '/addexperiment', component: () => import('../components/page/AddExperiment.vue'), diff --git a/src/utils/api.js b/src/utils/api.js index 2fc0dc7..e52b42b 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -11,10 +11,11 @@ let host1 = '' if(process.env.NODE_ENV === 'development'){ host1 = 'http://122.9.154.146' host = 'http://192.168.31.152:9090'//榕 + host = 'http://192.168.31.125:9090'//林 } export default { - logins: `${host}/liuwanr/userInfo/adminLogins`, //登录 + logins: `${host1}/liuwanr/userInfo/adminLogins`, //登录 fileupload: `${uploadURL}/oss/manage/fileupload`, updateLogInNumber: `${host}/liuwanr/userInfo/updateLogInNumber`, //用户登录修改登录次数和登陆时间 @@ -148,6 +149,10 @@ export default { getReport: `${host}/evaluation/Achievement/getReport`, editScore: `${host}/evaluation/Achievement/editScore`, getItemContentByIds:`${host}/kdSys/getItemContentByIds`, + deleteKdAssessByIds:`${host}/evaluation/kd/assessment/deleteKdAssessByIds`, + deleteReportByIds:`${host}/evaluation/kd/assessment/deleteReportByIds`, + getAssessmentList:`${host}/evaluation/kd/assessment/getAssessmentList`, + getKdAchievement:`${host}/evaluation/kd/assessment/getKdAchievement`, // 教师评语 addComment: `${host}/evaluation/Achievement/addComment`,