@@ -53,17 +29,18 @@
diff --git a/src/components/teacher/addExam.vue b/src/components/teacher/addExam.vue
index b2560fc..de2579d 100644
--- a/src/components/teacher/addExam.vue
+++ b/src/components/teacher/addExam.vue
@@ -1,286 +1,104 @@
\ No newline at end of file
+
+
diff --git a/src/components/teacher/selectExam.vue b/src/components/teacher/selectExam.vue
index 6d3fe72..7c63a8b 100644
--- a/src/components/teacher/selectExam.vue
+++ b/src/components/teacher/selectExam.vue
@@ -2,59 +2,20 @@
-
-
-
-
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
- 编辑
+ 编辑
+ 删除
@@ -65,17 +26,14 @@
:page-sizes="[4, 8, 10, 20]"
:page-size="pagination.size"
layout="total, sizes, prev, pager, next, jumper"
- :total="pagination.total"
- class="page"
- >
+ :total="pagination.total" class="page">
+ :before-close="handleClose">
@@ -95,12 +53,7 @@
-
+
@@ -130,82 +83,81 @@ export default {
data() {
return {
form: {}, //保存点击以后当前试卷的信息
- pagination: {
- //分页后的考试信息
+ pagination: { //分页后的考试信息
current: 1, //当前页
total: null, //记录条数
- size: 4, //每页条数
- records: [{}],
+ size: 4 //每页条数
},
- dialogVisible: false,
- };
+ dialogVisible: false
+ }
},
created() {
- this.getExamInfo();
+ this.getExamInfo()
},
methods: {
- edit(examCode) {
- //编辑试卷
- this.dialogVisible = true;
- this.$axios(`/api/exam/${examCode}`).then((res) => {
- //根据试卷id请求后台
- if (res.data.code == 200) {
- this.form = res.data.data;
+ edit(examCode) { //编辑试卷
+ this.dialogVisible = true
+ this.$axios(`/api/exam/${examCode}`).then(res => { //根据试卷id请求后台
+ if(res.data.code == 200) {
+ this.form = res.data.data
}
- });
+ })
},
- handleClose(done) {
- //关闭提醒
- this.$confirm("确认关闭?")
- .then((_) => {
+ handleClose(done) { //关闭提醒
+ this.$confirm('确认关闭?')
+ .then(_ => {
done();
- })
- .catch((_) => {});
+ }).catch(_ => {});
},
- submit() {
- //提交修改后的试卷信息
- this.dialogVisible = false;
+ submit() { //提交修改后的试卷信息
+ this.dialogVisible = false
this.$axios({
- url: "/api/exam",
- method: "put",
+ url: '/api/exam',
+ method: 'put',
data: {
- ...this.form,
- },
- }).then((res) => {
- if (res.data.code == 200) {
- this.$message({
- //成功修改提示
- message: "更新成功",
- type: "success",
- });
+ ...this.form
+ }
+ }).then(res => {
+ if(res.data.code == 200) {
+ this.$message({ //成功修改提示
+ message: '更新成功',
+ type: 'success'
+ })
}
- this.getExamInfo();
- });
+ this.getExamInfo()
+ })
},
- getExamInfo() {
- //分页查询所有试卷信息
-
- let teacherid = this.$cookies.get("cid");
- console.log(teacherid);
- this.$axios(
- `/api/findExamList/${teacherid}/${this.pagination.current}/${this.pagination.size}`
- )
- .then((res) => {
- this.pagination.records = res.data.data.data;
- this.pagination.total = res.data.data.total;
- console.log(res.data.data);
+ deleteRecord(examCode) {
+ this.$confirm("确定删除该记录吗,该操作不可逆!!!","删除提示",{
+ confirmButtonText: '确定删除',
+ cancelButtonText: '算了,留着',
+ type: 'danger'
+ }).then(()=> { //确认删除
+ this.$axios({
+ url: `/api/exam/${examCode}`,
+ method: 'delete',
+ }).then(res => {
+ this.getExamInfo()
})
- .catch((error) => {});
+ }).catch(() => {
+
+ })
+ },
+ getExamInfo() { //分页查询所有试卷信息
+ this.$axios(`/api/exams/${this.pagination.current}/${this.pagination.size}`).then(res => {
+ this.pagination = res.data.data
+ }).catch(error => {
+ })
},
//改变当前记录条数
handleSizeChange(val) {
- this.pagination.size = val;
- this.getExamInfo();
+ this.pagination.size = val
+ this.getExamInfo()
},
//改变当前页码,重新发送请求
handleCurrentChange(val) {
- this.pagination.current = val;
- this.getExamInfo();
+ this.pagination.current = val
+ this.getExamInfo()
},
},
};
@@ -219,7 +171,7 @@ export default {
justify-content: center;
align-items: center;
}
- .edit {
+ .edit{
margin-left: 20px;
}
}
diff --git a/src/router/index.js b/src/router/index.js
index f0ed9f4..59abeda 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -15,50 +15,34 @@ export default new Router({
children: [
{
path: '/', //首页默认路由
- component: () => import('@/components/teacher/hello')
+ component: () => import('@/components/common/hello')
},
{
path:'/grade', //学生成绩
component: () => import('@/components/charts/grade')
},
- {
- path:'/admingrade', //管理员查看学生成绩
- component: () => import('@/components/charts/admingrade')
- },
{
path: '/selectExamToPart', //学生分数段
component: () => import('@/components/teacher/selectExamToPart')
},
- {
- path: '/adminselectExamToPart', //学生分数段
- component: () => import('@/components/admin/selectExamToPart')
- },
{
path: '/scorePart',
component: () => import('@/components/charts/scorePart')
},
- {
- path: '/adminscorePart', //管理员查看分段
- component: () => import('@/components/charts/adminscorePart')
- },
{
path: '/allStudentsGrade', //所有学生成绩统计
component: () => import('@/components/teacher/allStudentsGrade')
},
- {
- path: '/adminallStudentsGrade', //管理员所有学生成绩统计
- component: () => import('@/components/admin/allStudentsGrade')
- },
{
path: '/examDescription', //考试管理功能描述
component: () => import('@/components/teacher/examDescription')
},
{
- path: '/selectExam', //教师查询考试
+ path: '/selectExam', //查询所有考试
component: () => import('@/components/teacher/selectExam')
},
{
- path: '/addExam', //教师添加考试
+ path: '/addExam', //添加考试
component: () => import('@/components/teacher/addExam')
},
{
@@ -69,10 +53,6 @@ export default new Router({
path: '/selectAnswer', //查询所有题库
component: () => import('@/components/teacher/selectAnswer')
},
- {
- path: '/adminselectAnswer', //管理员查询所有题库
- component: () => import('@/components/admin/selectAnswer')
- },
{
path: '/addAnswer', //增加题库主界面
component: () => import('@/components/teacher/addAnswer')
@@ -90,22 +70,13 @@ export default new Router({
component: () => import('@/components/teacher/addStudent')
},
{
- path: '/teacherManage',//管理员查询教师
+ path: '/teacherManage',
component: () => import('@/components/admin/tacherManage')
},
{
- path: '/addTeacher',//管理员添加教师
+ path: '/addTeacher',
component: () => import ('@/components/admin/addTeacher')
- },
- {
- path:'/tongaoManage',
- component: () => import ('@/components/admin/tongaoManage')
- },
- {
- path:'/addTongzhi',
- component: () => import ('@/components/admin/addTongzhi')
- },
-
+ }
]
},
{
diff --git a/src/vuex/store.js b/src/vuex/store.js
index 5140ec9..5b2f0f8 100644
--- a/src/vuex/store.js
+++ b/src/vuex/store.js
@@ -7,8 +7,42 @@ const state = {
isPractice: false, //练习模式标志
flag: false, //菜单栏左右滑动标志
userInfo: null,
- menu: [
-
+ menu: [{
+ index: '1',
+ title: '考试管理',
+ icon: 'icon-kechengbiao',
+ content:[{item1:'功能介绍',path:'/examDescription'},{item2:'考试查询',path:'selectExam'},{item3:'添加考试',path:'/addExam'}],
+ },
+ {
+ index: '2',
+ title: '题库管理',
+ icon: 'icon-tiku',
+ content:[{item1:'功能介绍',path:'/answerDescription'},{item2:'所有题库',path:'/selectAnswer'},{item3:'增加题库',path:'/addAnswer'},{path: '/addAnswerChildren'}],
+ },
+ {
+ index: '3',
+ title: '成绩查询',
+ icon: 'icon-performance',
+ content:[{item1:'学生成绩查询',path:'/allStudentsGrade'},{path: '/grade'},{item2: '成绩分段查询',path: '/selectExamToPart'},{path: '/scorePart'}],
+ },
+ {
+ index: '4',
+ title: '学生管理',
+ icon: 'icon-role',
+ content:[{item1:'学生管理',path:'/studentManage'},{item2: '添加学生',path: '/addStudent'}],
+ },
+ // {
+ // index: '5',
+ // title: '教师管理',
+ // icon: 'icon-Userselect',
+ // content:[{item1:'教师管理',path:'/teacherManage'},{item2: '添加教师',path: '/addTeacher'}],
+ // },
+ // {
+ // index: '7',
+ // title: '模块管理',
+ // icon: 'icon-module4mokuai',
+ // content:[{item1:'模块操作',path:'/module'}],
+ // }
],
}
const mutations = {
--
Gitee