教学管理调整

This commit is contained in:
fan 2021-03-25 14:09:03 +08:00
parent 0d57d977a1
commit 159aec918f
10 changed files with 80 additions and 40 deletions

View File

@ -103,17 +103,17 @@ export function getExamClassList(lessonId) {
}); });
} }
/** 获取自己发布的课程列表 */ /** 获取自己发布的课程列表 */
export function getLessonListSelf(params) { export function getLessonProjectList(params) {
return request({ return request({
url: '/api/lesson/paged/self', url: '/api/lesson/paged/byLoginProject',
method: 'get', method: 'get',
params params
}); });
} }
/** 获取自己发布课程列表不分页 */ /** 获取自己发布课程列表不分页 */
export function getLessonListsSelfNoPage() { export function getLessonProjectListNoPage() {
return request({ return request({
url: '/api/lesson/unPaged/self', url: '/api/lesson/list/byLoginProject',
method: 'get' method: 'get'
}); });
} }

View File

@ -93,18 +93,18 @@ export function updateExamRules(data) {
data: data data: data
}); });
} }
/** 查询本项目下自己创建的考试列表 */ /** 查询本项目下的考试列表 */
export function getExamListSelf(params) { export function getExamListProject(params) {
return request({ return request({
url: `/api/exam/paged/loginProject/self`, url: `/api/exam/paged/loginProject`,
method: 'get', method: 'get',
params params
}); });
} }
/** 查询本项目下自己创建的考试列表不分页 */ /** 查询本项目下自己创建的考试列表不分页 */
export function getExamListSelfUnpage(params) { export function getExamListProjectUnpage(params) {
return request({ return request({
url: `/api/exam/list/loginProject/self`, url: `/api/exam/list/loginProject`,
methods: 'get', methods: 'get',
params params
}); });

View File

@ -2,10 +2,10 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪 // BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.8.129:9000'; // 旭强 // BASE_API = 'http://192.168.8.129:9000'; // 旭强
// BASE_API = 'http://192.168.8.119:9000'; // 张赛 BASE_API = 'http://192.168.8.119:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康 // BASE_API = 'http://192.168.8.140:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -24,7 +24,7 @@
</template> </template>
<script> <script>
import { getLessonListsSelfNoPage } from '@/api/jmap/lesson'; import { getLessonProjectListNoPage } from '@/api/jmap/lesson';
import { getClassAssociatedLessons, setClassAssociatedLessons } from '@/api/company'; import { getClassAssociatedLessons, setClassAssociatedLessons } from '@/api/company';
export default { export default {
@ -58,7 +58,7 @@ export default {
async doShow(row) { async doShow(row) {
try { try {
this.lessonList = []; this.lessonList = [];
const resp = await getLessonListsSelfNoPage(); const resp = await getLessonProjectListNoPage();
this.lessonList = resp.data; this.lessonList = resp.data;
const rest = await getClassAssociatedLessons(row.id); const rest = await getClassAssociatedLessons(row.id);
this.classModel.id = row.id; this.classModel.id = row.id;

View File

@ -61,7 +61,7 @@ export default {
}, },
{ {
title: '创建人', title: '创建人',
prop: 'creatorId' prop: 'creatorName'
}, },
{ {
type: 'button', type: 'button',
@ -71,7 +71,10 @@ export default {
{ {
name: '编辑班级', name: '编辑班级',
handleClick: this.handleUpdateClass, handleClick: this.handleUpdateClass,
type: 'primary' type: 'primary',
showControl: (row) => {
return row.creatorId == this.userId;
}
}, },
{ {
name: '学生管理', name: '学生管理',
@ -86,12 +89,18 @@ export default {
{ {
name: '排课', name: '排课',
handleClick: this.handleBindLesson, handleClick: this.handleBindLesson,
type: 'primary' type: 'primary',
showControl: (row) => {
return row.creatorId == this.userId;
}
}, },
{ {
name: '删除', name: '删除',
handleClick: this.handleDeleteClass, handleClick: this.handleDeleteClass,
type: 'danger' type: 'danger',
showControl: (row) => {
return row.creatorId == this.userId;
}
} }
] ]
} }
@ -103,6 +112,11 @@ export default {
} }
}; };
}, },
computed: {
userId() {
return this.$store.state.user.id;
}
},
methods: { methods: {
handleUpdateClass(index, row) { handleUpdateClass(index, row) {
this.$refs.createClass.doShow(row); this.$refs.createClass.doShow(row);
@ -134,7 +148,7 @@ export default {
this.$router.go(-1); this.$router.go(-1);
}, },
handleStudentDetail( index, row ) { handleStudentDetail( index, row ) {
this.$router.push({ path: '/info/studentManage', query: { classId: row.id, className: row.name} }); this.$router.push({ path: '/info/studentManage', query: { classId: row.id, className: row.name, creatorId: row.creatorId} });
}, },
handleBindLesson(index, row) { handleBindLesson(index, row) {
this.$refs.bindLessons.doShow(row); this.$refs.bindLessons.doShow(row);

View File

@ -62,15 +62,18 @@ export default {
{ {
name: '移出班级', name: '移出班级',
handleClick: this.removeStudent, handleClick: this.removeStudent,
type: 'danger' type: 'danger',
showControl: (row) => {
return this.$route.query.creatorId == this.$store.state.user.id;
}
} }
] ]
} }
], ],
actions: [ actions: [
{ text: '添加学生', handler: this.createStudent }, { text: '添加学生', handler: this.createStudent, show: this.$route.query.creatorId == this.$store.state.user.id },
{ text: '导入模板下载', handler: this.exportTemplate }, { text: '导入模板下载', handler: this.exportTemplate },
{ text: '导入学生', handler: this.importResults, fileType: 'file' }, { text: '导入学生', handler: this.importResults, fileType: 'file', show: this.$route.query.creatorId == this.$store.state.user.id },
{ text: '返回', handler: this.goBack } { text: '返回', handler: this.goBack }
] ]
} }

View File

@ -19,7 +19,7 @@
</template> </template>
<script> <script>
import { getLessonListsSelfNoPage } from '@/api/jmap/lesson'; import { getLessonProjectListNoPage } from '@/api/jmap/lesson';
import { createLessonFromPublish } from '@/api/jmap/lessondraft'; import { createLessonFromPublish } from '@/api/jmap/lessondraft';
export default { export default {
@ -53,7 +53,7 @@ export default {
doShow() { doShow() {
this.lessonList = []; this.lessonList = [];
this.mapData = {}; this.mapData = {};
getLessonListsSelfNoPage().then(response => { getLessonProjectListNoPage().then(response => {
this.lessonList = response.data.map(elem => { this.lessonList = response.data.map(elem => {
this.mapData[elem.id] = elem.mapId; this.mapData[elem.id] = elem.mapId;
return { code: elem.id, name: elem.name }; return { code: elem.id, name: elem.name };

View File

@ -11,9 +11,9 @@
</template> </template>
<script> <script>
import { getLessonListsSelfNoPage } from '@/api/jmap/lesson'; import { getLessonProjectListNoPage } from '@/api/jmap/lesson';
import { getClassListUnPage } from '@/api/company'; import { getClassListUnPage } from '@/api/company';
import { getExamListSelf, deleteExam } from '@/api/management/exam'; import { getExamListProject, deleteExam } from '@/api/management/exam';
import localStore from 'storejs'; import localStore from 'storejs';
export default { export default {
@ -52,7 +52,7 @@ export default {
} }
}, },
examQueryList: { examQueryList: {
query: getExamListSelf, query: getExamListProject,
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
@ -78,16 +78,19 @@ export default {
}, },
{ {
title: '满分', title: '满分',
prop: 'fullPoint' prop: 'fullPoint',
width: '80'
}, },
{ {
title: '及格分', title: '及格分',
prop: 'passingPoint' prop: 'passingPoint',
width: '80'
}, },
{ {
title: '时长', title: '时长',
prop: 'duration', prop: 'duration',
type: 'tag', type: 'tag',
width: '80',
columnValue: (row) => { columnValue: (row) => {
return Math.floor(row.duration / 60); return Math.floor(row.duration / 60);
}, },
@ -95,7 +98,8 @@ export default {
}, },
{ {
title: '创建人', title: '创建人',
prop: 'creatorId' prop: 'creatorName',
width: '150'
}, },
{ {
type: 'button', type: 'button',
@ -113,7 +117,10 @@ export default {
{ {
name: '删除', name: '删除',
handleClick: this.handleDeleteExam, handleClick: this.handleDeleteExam,
type: 'danger' type: 'danger',
showControl: (row) => {
return row.creatorId == this.userId;
}
} }
] ]
} }
@ -125,8 +132,13 @@ export default {
} }
}; };
}, },
computed: {
userId() {
return this.$store.state.user.id;
}
},
created() { created() {
getLessonListsSelfNoPage().then(response => { getLessonProjectListNoPage().then(response => {
this.lessonList = response.data; this.lessonList = response.data;
this.lessonList.forEach(item => { this.lessonList.forEach(item => {
this.examQueryForm.queryObject.lessonId.config.data.push({ value: item.id, label: item.name }); this.examQueryForm.queryObject.lessonId.config.data.push({ value: item.id, label: item.name });

View File

@ -13,7 +13,7 @@
<script> <script>
import { getPublishMapListOnline } from '@/api/jmap/map'; import { getPublishMapListOnline } from '@/api/jmap/map';
import { getLessonListSelf, forceDeleteLesson } from '@/api/jmap/lesson'; import { getLessonProjectList, forceDeleteLesson } from '@/api/jmap/lesson';
import EditLessonInfo from './editLessonInfo'; import EditLessonInfo from './editLessonInfo';
import localStore from 'storejs'; import localStore from 'storejs';
export default { export default {
@ -42,7 +42,7 @@ export default {
} }
}, },
lessonQueryList: { lessonQueryList: {
query: getLessonListSelf, query: getLessonProjectList,
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
@ -67,7 +67,7 @@ export default {
}, },
{ {
title: '创建人', title: '创建人',
prop: 'creatorId' prop: 'creatorName'
}, },
{ {
type: 'button', type: 'button',
@ -77,7 +77,10 @@ export default {
{ {
name: '修改课程', name: '修改课程',
handleClick: this.handleEditLessonInfo, handleClick: this.handleEditLessonInfo,
type: 'primary' type: 'primary',
showControl: (row) => {
return row.creatorId == this.userId;
}
}, },
{ {
name: '考试管理', name: '考试管理',
@ -87,7 +90,10 @@ export default {
{ {
name: '删除', name: '删除',
handleClick: this.handleDeleteLesson, handleClick: this.handleDeleteLesson,
type: 'danger' type: 'danger',
showControl: (row) => {
return row.creatorId == this.userId;
}
} }
] ]
} }
@ -98,6 +104,11 @@ export default {
} }
}; };
}, },
computed: {
userId() {
return this.$store.state.user.id;
}
},
mounted() { mounted() {
this.mapIdList = []; this.mapIdList = [];
getPublishMapListOnline().then(response => { getPublishMapListOnline().then(response => {

View File

@ -234,8 +234,8 @@
<script> <script>
import { createRule, updateRule, getRuleDetailById } from '@/api/company'; import { createRule, updateRule, getRuleDetailById } from '@/api/company';
import { getExamListSelfUnpage } from '@/api/management/exam'; import { getExamListProjectUnpage } from '@/api/management/exam';
import { getLessonListsSelfNoPage } from '@/api/jmap/lesson'; import { getLessonProjectListNoPage } from '@/api/jmap/lesson';
export default { export default {
name: 'CreateRule', name: 'CreateRule',
data() { data() {
@ -329,12 +329,12 @@ export default {
for (let i = 2015; i < nowYear + 1; i++) { for (let i = 2015; i < nowYear + 1; i++) {
this.schoolYearList.unshift({ label: `${i}-${i + 1}学年`, value: `${i}-${i + 1}`}); this.schoolYearList.unshift({ label: `${i}-${i + 1}学年`, value: `${i}-${i + 1}`});
} }
getLessonListsSelfNoPage().then(resp => { getLessonProjectListNoPage().then(resp => {
this.lessonList = resp.data; this.lessonList = resp.data;
}).catch(() => { }).catch(() => {
this.$message.error('获取课程列表失败!'); this.$message.error('获取课程列表失败!');
}); });
getExamListSelfUnpage().then(resp=> { getExamListProjectUnpage().then(resp=> {
this.examList = resp.data; this.examList = resp.data;
}).catch(() => { }).catch(() => {
this.$message.error('获取试卷列表失败!'); this.$message.error('获取试卷列表失败!');