AI测试反馈的报错调整
This commit is contained in:
@@ -103,7 +103,7 @@ service.interceptors.response.use(res => {
|
||||
return Promise.reject('error')
|
||||
} else if (code !== 200) {
|
||||
Notification.error({ title: msg })
|
||||
return Promise.reject('error')
|
||||
return Promise.reject(new Error(msg))
|
||||
} else {
|
||||
return res.data
|
||||
}
|
||||
|
||||
@@ -55,8 +55,8 @@
|
||||
<div v-loading="loading" class="course-list">
|
||||
<div v-if="!courses.length" class="empty-tip">该班次学期暂无可排课程</div>
|
||||
<div
|
||||
v-for="c in courses"
|
||||
:key="c.sskcbh"
|
||||
v-for="(c, i) in courses"
|
||||
:key="c.sskcbh + '#' + i"
|
||||
class="course-item"
|
||||
:class="{ 'is-active': currentCourse && currentCourse.sskcbh === c.sskcbh, 'is-full': c.full, 'is-readonly': !c.editable }"
|
||||
@click="selectCourse(c)"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item :label="dimLabel">
|
||||
<el-select v-model="targetId" :placeholder="'请选择' + dimLabel" clearable filterable :loading="optionsLoading" style="width: 240px">
|
||||
<el-option v-for="o in targetOptions" :key="o.value" :label="o.label" :value="o.value" />
|
||||
<el-option v-for="(o, i) in targetOptions" :key="(o.value || '') + '_' + i" :label="o.label" :value="o.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="日期范围">
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/>
|
||||
<el-button size="small" @click="shiftDay(1)">下一天<i class="el-icon-arrow-right" /></el-button>
|
||||
</div>
|
||||
<el-table v-loading="todayLoading" :data="todayRows" border stripe size="small" max-height="560">
|
||||
<el-table v-loading="todayLoading" :data="todayRows" border stripe size="small" max-height="560" :empty-text="todayError || '暂无数据'">
|
||||
<el-table-column prop="sksj" label="上课时间" width="170" align="center" />
|
||||
<el-table-column prop="kc" label="课程" min-width="150" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="bc" label="班次" min-width="130" align="center" show-overflow-tooltip />
|
||||
@@ -39,7 +39,7 @@
|
||||
<el-button type="primary" icon="el-icon-search" @click="loadCourses">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="courseLoading" :data="courseRows" border stripe size="small" max-height="560">
|
||||
<el-table v-loading="courseLoading" :data="courseRows" border stripe size="small" max-height="560" :empty-text="courseError || '暂无数据'">
|
||||
<el-table-column prop="kcmcksxs" label="课程名称/课时系数" min-width="180" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="zrjykc" label="责任教员/课次" min-width="140" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="jhxs" label="计划学时" width="80" align="center" />
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
<!-- ==================== 本室教员 ==================== -->
|
||||
<el-tab-pane label="本室教员" name="teachers">
|
||||
<el-table v-loading="teacherLoading" :data="teacherRows" border stripe size="small" max-height="560">
|
||||
<el-table v-loading="teacherLoading" :data="teacherRows" border stripe size="small" max-height="560" :empty-text="teacherError || '暂无数据'">
|
||||
<el-table-column prop="jybh" label="教员编号" width="140" align="center" />
|
||||
<el-table-column prop="jyxm" label="姓名" min-width="140" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
@@ -76,11 +76,14 @@ export default {
|
||||
day: '',
|
||||
todayRows: [],
|
||||
todayLoading: false,
|
||||
todayError: '',
|
||||
courseQuery: { nd: null, xqdc: null },
|
||||
courseRows: [],
|
||||
courseLoading: false,
|
||||
courseError: '',
|
||||
teacherRows: [],
|
||||
teacherLoading: false
|
||||
teacherLoading: false,
|
||||
teacherError: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -103,20 +106,26 @@ export default {
|
||||
},
|
||||
loadToday() {
|
||||
this.todayLoading = true
|
||||
this.todayError = ''
|
||||
myOfficeToday({ rq: this.day })
|
||||
.then(res => { this.todayRows = res.data || [] })
|
||||
.catch(err => { this.todayRows = []; this.todayError = (err && err.message) || '加载失败' })
|
||||
.finally(() => { this.todayLoading = false })
|
||||
},
|
||||
loadCourses() {
|
||||
this.courseLoading = true
|
||||
this.courseError = ''
|
||||
myOfficeCourses(this.courseQuery)
|
||||
.then(res => { this.courseRows = res.data || [] })
|
||||
.catch(err => { this.courseRows = []; this.courseError = (err && err.message) || '加载失败' })
|
||||
.finally(() => { this.courseLoading = false })
|
||||
},
|
||||
loadTeachers() {
|
||||
this.teacherLoading = true
|
||||
this.teacherError = ''
|
||||
myOfficeTeachers()
|
||||
.then(res => { this.teacherRows = res.data || [] })
|
||||
.catch(err => { this.teacherRows = []; this.teacherError = (err && err.message) || '加载失败' })
|
||||
.finally(() => { this.teacherLoading = false })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,6 +385,10 @@ export default {
|
||||
eventCalendarVisible: false,
|
||||
eventCalendarSemester: null,
|
||||
|
||||
// ==================== 教学配当 ====================
|
||||
allocationVisible: false,
|
||||
allocationSemester: null,
|
||||
|
||||
// ==================== 批量创建班次学期 ====================
|
||||
batchAddVisible: false,
|
||||
batchAddForm: { nd: undefined, xqdc: undefined, startTime: '', endTime: '' },
|
||||
|
||||
@@ -1330,8 +1330,9 @@ export default {
|
||||
this.roleLoading = true
|
||||
listRole({ pageNum: 1, pageSize: 200, status: '0' }).then(res => {
|
||||
this.roleOptions = res.rows || res.data || []
|
||||
}).catch(e => {
|
||||
console.error('加载角色列表失败', e)
|
||||
}).catch(() => {
|
||||
// 无角色管理权限(如教研室账号)时只保留默认教员角色,不影响新增
|
||||
this.roleOptions = [{ roleId: 101, roleName: '教员' }]
|
||||
}).finally(() => {
|
||||
this.roleLoading = false
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user