diff --git a/src/components/common/Sidebar.vue b/src/components/common/Sidebar.vue index 93da3cc..e00fb3e 100644 --- a/src/components/common/Sidebar.vue +++ b/src/components/common/Sidebar.vue @@ -61,11 +61,6 @@ export default { { icon: 'el-icon-takeaway-box', index: 'dashboard', - title: '竞赛管理' - }, - { - icon: 'el-icon-takeaway-box', - index: 'classmanager', title: '班级管理' }, { @@ -111,7 +106,7 @@ export default { ], menus: [], actives: { - dashboard: ['addclass'], + dashboard: ['classinfo'], assessment: ['addAssessment'], achievement: ['experiment','experimentVir','experimentTeach','addexperiment','showExperiment'], project: ['addproject','program','programOptions'], diff --git a/src/components/page/ClassAchievement.vue b/src/components/page/ClassAchievement.vue new file mode 100644 index 0000000..d126f03 --- /dev/null +++ b/src/components/page/ClassAchievement.vue @@ -0,0 +1,240 @@ + + + + + + diff --git a/src/components/page/ClassEdit.vue b/src/components/page/ClassEdit.vue deleted file mode 100644 index 35e828e..0000000 --- a/src/components/page/ClassEdit.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/page/ClassInfo.vue b/src/components/page/ClassInfo.vue new file mode 100644 index 0000000..3e33db2 --- /dev/null +++ b/src/components/page/ClassInfo.vue @@ -0,0 +1,103 @@ + + + + + \ No newline at end of file diff --git a/src/components/page/ClassManager.vue b/src/components/page/ClassManager.vue deleted file mode 100644 index c349a97..0000000 --- a/src/components/page/ClassManager.vue +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - diff --git a/src/components/page/ClassStudent.vue b/src/components/page/ClassStudent.vue new file mode 100644 index 0000000..ad667a6 --- /dev/null +++ b/src/components/page/ClassStudent.vue @@ -0,0 +1,552 @@ + + + + + \ No newline at end of file diff --git a/src/components/page/Dashboard.vue b/src/components/page/Dashboard.vue index cb15e2e..5f7f128 100644 --- a/src/components/page/Dashboard.vue +++ b/src/components/page/Dashboard.vue @@ -8,31 +8,35 @@
-
- - - {{item.name}} +
+ + + {{item.name}} - +
+ + + +

+ + + +
- - - - - - - - - + + + {{item.name}} +
- +
@@ -42,101 +46,66 @@ -
-
-

- 实验教学列表 -
-
- 创建实验 - 批量删除 -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -144,290 +113,163 @@ import bus from '../common/bus'; import axios from 'axios'; export default { - name: 'dashboard', data() { return { - name: sessionStorage.getItem('ms_username'), - schoolId: this.$store.state.schoolId, - systemId: this.$config.systemId, - systemList: [ - { - id: 1, - label: 'Python实验系统' - },{ - id: 2, - label: '跨国仿真系统' - },{ - id: 3, - label: '期权期货系统' - },{ - id: 4, - label: 'Python金融建模教学系统' - },{ - id: 5, - label: 'Python数据可视化教学系统' - }, - ], + form:{ + year: '', + semester: 0, + }, keyword: '', - typeList: [ + startYear: '', + endYear: '', + startTimeOptions: {}, + endTimeOptions: {}, + yearsList: [ { - value: '', + id: '', name: '不限' }, { - value: 1, - name: '手动发布' + id: 1, + name: '2021' }, { - value: 2, - name: '定时发布' - } - ], - status: ['','待开始','进行中','已完成'], - types: ['','手动发布','定时发布'], - statusList: [ + id: 2, + name: '2020' + }, { - value: '', - name: '不限' + id: 2, + name: '2019' }, { - value: 1, - name: '待开始' + id: 2, + name: '2018' }, { - value: 2, - name: '进行中' + id: 2, + name: '2017' }, { - value: 3, - name: '已完成' + id: 2, + name: '2016' + }, + { + id: 2, + name: '2015' } ], - customerData: [], - form: { - type: '', - status: '', - startTime: '', - stopTime: '', - month: '', - searchContent: '' - }, - multipleSelection: [], - dateList: [ + semesterList: [ { - id: '', + id: 0, name: '不限' }, { id: 1, - name: '近一个月' - }, - { - id: 3, - name: '近三个月' + name: '春季学期' }, { - id: 6, - name: '近六个月' + id: 2, + name: '秋季学期' } ], - date: [], - pageNo: 1, - pageSize: 10, - totals: 0, - ruleIds: [], - timerList: [], - timer: null - }; - }, - directives: { - countdown: { - bind: function(el,binding,vnode) { - let that = vnode.context - let time = binding.value - let timer = setInterval(() => { - let timeList = time.split(':') - let total = Number.parseInt(timeList[0] * 60 * 60) + Number.parseInt(timeList[1] * 60) + Number.parseInt(timeList[2]) - if(total > 0){ - --total - let hours = Math.floor(total / (60 * 60)) - let minutes = Math.floor(total % (60 * 60) / 60) - let seconds = Math.floor(total % (60 * 60) % 60) - time = `${that.formateTime(hours)}:${that.formateTime(minutes)}:${that.formateTime(seconds)}` - }else{ - clearInterval(timer) - } - console.log(11,time) - el.innerHTML = time - },1000) - that.timerList.push(timer) + classList: [{ + id: 1, + className: '实验二班', + classTime: '2021', + classSemester: '秋季学期' + }, + { + id: 2, + className: '实验二班', + classTime: '2021', + classSemester: '秋季学期' + }, + { + id: 3, + className: '实验二班', + classTime: '2021', + classSemester: '秋季学期' + }, + { + id: 4, + className: '实验二班', + classTime: '2021', + classSemester: '秋季学期' + }], + classId: '', + classVisible: false, + classForm: { + className: '', + classYear: '', + classSemester: '0' } - } + }; }, watch: { - 'form.month': function(val){ - if(val){ - let unit = 24 * 60 * 60 * 1000 - this.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))] - }else{ - this.date = [] - } - }, - date: function(val){ - if(val){ - this.form.startTime = val[0] - this.form.stopTime = val[1] - }else{ - this.form.startTime = '' - this.form.stopTime = '' - } - this.getData() - }, keyword: function(val) { - clearTimeout(this.searchTimer) - this.searchTimer = setTimeout(() => { - this.getData() - },500) - } - }, - computed: { - role() { - return this.name === 'admin' ? '超级管理员' : '普通用户'; + this.getData() } }, mounted() { - this.getData() - this.timer = setInterval(this.getData,1000) - this.$once('hook:beforeDestroy',() => { - clearInterval(this.timer) - }) + }, methods: { - getData() { - let data = { - type: this.form.type, - startTime: this.form.startTime, - stopTime: this.form.stopTime, - month: this.form.month, - searchContent: this.encodeString(this.keyword), - status: this.form.status, - page: this.pageNo, - size: this.pageSize, - systemId: this.systemId, - schoolId: this.schoolId ? this.schoolId : '' - } - this.$get(this.api.expList,data).then(res => { - this.customerData = res.list.list - this.totals = res.list.totalCount - }).catch(res => {}); - }, - permission(){ - this.$router.push('/permission') - }, - add(){ - this.$router.push('addclass') - }, - edit(row){ - this.$router.push(`addclass?id=${row.id}`) - }, - show(row){ - 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') - }, - start(row){ - let data = { - id: row.id, - startTime: this.formatDate("yyyy-MM-dd hh:mm:ss",new Date()), - status: 2 - } - this.$post(this.api.expUpdate,data).then(res => { - if(res.errmessage == 'success') { - this.$message.success('启动成功!') - this.getData() + getData(){}, + //选择开始年份 + clickStartTime() { + this.startTimeOptions.disabledDate = time => { + if (this.endYear) { + if (time.getFullYear() > new Date(this.endYear).getFullYear()) { + return true + } + } else { + if (time.getFullYear() > new Date().getFullYear()) { + return true + } } - }).catch(res => {}); + } }, - finish(row){ - this.$confirm('确定要提前结束吗?', '提示', { - type: 'warning' - }) - .then(() => { - let data = { - id: row.id, - stopTime: this.formatDate("yyyy-MM-dd hh:mm:ss",new Date()), - status: 3 - } - this.$post(this.api.expUpdate,data).then(res => { - if(res.errmessage == 'success') { - this.$message.success('提前结束成功!') - this.getData() + //选择结束年份 + clickEndTime(){ + this.endTimeOptions.disabledDate = time => { + if (this.startYear) { + if (time.getFullYear() < new Date(this.startYear).getFullYear()) { + return true } - }).catch(res => {}); - }) - .catch(() => {}) - }, - delData(row) { - this.$confirm('确定要删除吗?', '提示', { - type: 'warning' - }) - .then(() => { - this.$post(this.api.expDelete,[row.id]).then(res => { - this.$message.success('删除成功'); - this.getData() - }).catch(res => {}); - }) - .catch(() => {}); - }, - delAllData() { - if(this.multipleSelection.length != ''){ - let newArr = this.multipleSelection - let delList = newArr.map(item => { - return item.id - }) - - this.$confirm('确定要删除吗?', '提示', { - type: 'warning' - }) - .then(() => { - let data = delList - this.$post(this.api.expDelete,data).then(res => { - this.$refs.table.clearSelection() - this.$message.success('删除成功'); - this.getData() - }).catch(res => {}); - }) - .catch(() => {}); - }else{ - this.$message.error('请先选择数据 !'); + } else { + if (time.getFullYear() > new Date().getFullYear()) { + return true + } + } } }, - handleSelectionChange(val) { - this.multipleSelection = val; - }, - onSearch(){ - this.pageNo = 1 - this.getData() + addClass(){ + this.classId = '' + this.classVisible = true }, - handleCurrentChange(val) { - this.pageNo = val; - this.getData(); + editClass(item){ + this.classId = item.id + this.classVisible = true }, - transferTime(date,type){ - if(date == '0000-00-00 00:00:00') return '---' - return date + toEdit(item){ + this.$router.push('classinfo') } } }; - + \ No newline at end of file diff --git a/src/router/routes.js b/src/router/routes.js index a40d8af..397f9bd 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -20,6 +20,11 @@ export default [ component: () => import('../components/page/Dashboard.vue'), meta: { title: '班级教学' } }, + { + path: '/classinfo', + component: () => import('../components/page/ClassInfo.vue'), + meta: { title: '班级教学' } + }, { path: '/addMatch', component: () => import('../components/page/AddMatch.vue'),