教学管理调整

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({
url: '/api/lesson/paged/self',
url: '/api/lesson/paged/byLoginProject',
method: 'get',
params
});
}
/** 获取自己发布课程列表不分页 */
export function getLessonListsSelfNoPage() {
export function getLessonProjectListNoPage() {
return request({
url: '/api/lesson/unPaged/self',
url: '/api/lesson/list/byLoginProject',
method: 'get'
});
}

View File

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

View File

@ -2,10 +2,10 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// 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.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://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

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

View File

@ -61,7 +61,7 @@ export default {
},
{
title: '创建人',
prop: 'creatorId'
prop: 'creatorName'
},
{
type: 'button',
@ -71,7 +71,10 @@ export default {
{
name: '编辑班级',
handleClick: this.handleUpdateClass,
type: 'primary'
type: 'primary',
showControl: (row) => {
return row.creatorId == this.userId;
}
},
{
name: '学生管理',
@ -86,12 +89,18 @@ export default {
{
name: '排课',
handleClick: this.handleBindLesson,
type: 'primary'
type: 'primary',
showControl: (row) => {
return row.creatorId == this.userId;
}
},
{
name: '删除',
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: {
handleUpdateClass(index, row) {
this.$refs.createClass.doShow(row);
@ -134,7 +148,7 @@ export default {
this.$router.go(-1);
},
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) {
this.$refs.bindLessons.doShow(row);

View File

@ -62,15 +62,18 @@ export default {
{
name: '移出班级',
handleClick: this.removeStudent,
type: 'danger'
type: 'danger',
showControl: (row) => {
return this.$route.query.creatorId == this.$store.state.user.id;
}
}
]
}
],
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.importResults, fileType: 'file' },
{ text: '导入学生', handler: this.importResults, fileType: 'file', show: this.$route.query.creatorId == this.$store.state.user.id },
{ text: '返回', handler: this.goBack }
]
}

View File

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

View File

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

View File

@ -13,7 +13,7 @@
<script>
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 localStore from 'storejs';
export default {
@ -42,7 +42,7 @@ export default {
}
},
lessonQueryList: {
query: getLessonListSelf,
query: getLessonProjectList,
selectCheckShow: false,
indexShow: true,
columns: [
@ -67,7 +67,7 @@ export default {
},
{
title: '创建人',
prop: 'creatorId'
prop: 'creatorName'
},
{
type: 'button',
@ -77,7 +77,10 @@ export default {
{
name: '修改课程',
handleClick: this.handleEditLessonInfo,
type: 'primary'
type: 'primary',
showControl: (row) => {
return row.creatorId == this.userId;
}
},
{
name: '考试管理',
@ -87,7 +90,10 @@ export default {
{
name: '删除',
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() {
this.mapIdList = [];
getPublishMapListOnline().then(response => {

View File

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