Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin-fdc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
admin-fdc
Commits
19201640
提交
19201640
authored
6月 14, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修复班级课程列表、教师列表、学员列表没有分页的问题;数据总览代码错误的问题;
上级
be69776e
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
76 行增加
和
117 行删除
+76
-117
AppList.vue
src/components/base/AppList.vue
+9
-35
List.vue
src/modules/dashboard/dataview/views/List.vue
+1
-1
CourseList.vue
src/modules/school/class/components/CourseList.vue
+18
-23
StudentList.vue
src/modules/school/class/components/StudentList.vue
+22
-32
TeachList.vue
src/modules/school/class/components/TeachList.vue
+18
-18
Detail.vue
src/modules/school/class/views/Detail.vue
+8
-8
没有找到文件。
src/components/base/AppList.vue
浏览文件 @
19201640
...
...
@@ -13,19 +13,9 @@
<!-- input -->
<el-input
v-model=
"params[item.prop]"
v-bind=
"item"
clearable
v-if=
"item.type === 'input'"
/>
<!-- select -->
<el-select
v-model=
"params[item.prop]"
clearable
v-bind=
"item"
v-if=
"item.type === 'select'"
@
change=
"search"
>
<el-select
v-model=
"params[item.prop]"
clearable
v-bind=
"item"
v-if=
"item.type === 'select'"
@
change=
"search"
>
<template
v-for=
"(option, index) in item.options"
>
<el-option
:label=
"option[item.labelKey] || option.label"
:value=
"option[item.valueKey] || option.value"
:key=
"index"
></el-option>
<el-option
:label=
"option[item.labelKey] || option.label"
:value=
"option[item.valueKey] || option.value"
:key=
"index"
></el-option>
</
template
>
</el-select>
</template>
...
...
@@ -44,14 +34,7 @@
<!-- 主体 -->
<div
class=
"table-list-bd"
>
<slot
name=
"body"
v-bind=
"{ data: dataList }"
>
<el-table
:data=
"dataList"
v-loading=
"loading"
v-bind=
"$attrs"
v-on=
"$listeners"
style=
"height: 100%"
ref=
"table"
>
<el-table
:data=
"dataList"
v-loading=
"loading"
v-bind=
"$attrs"
v-on=
"$listeners"
style=
"height: 100%"
ref=
"table"
>
<
template
v-for=
"item in columns"
>
<el-table-column
v-bind=
"item"
:key=
"item.prop"
v-if=
"visible(item)"
>
<template
v-slot:default=
"scope"
v-if=
"item.slots || item.computed"
>
...
...
@@ -96,19 +79,9 @@
<!-- input -->
<el-input
v-model=
"params[item.prop]"
v-bind=
"item"
clearable
v-if=
"item.type === 'input'"
/>
<!-- select -->
<el-select
v-model=
"params[item.prop]"
clearable
v-bind=
"item"
v-if=
"item.type === 'select'"
style=
"width: 100%"
>
<el-select
v-model=
"params[item.prop]"
clearable
v-bind=
"item"
v-if=
"item.type === 'select'"
style=
"width: 100%"
>
<template
v-for=
"(option, index) in item.options"
>
<el-option
:label=
"option[item.labelKey] || option.label"
:value=
"option[item.valueKey] || option.value"
:key=
"index"
></el-option>
<el-option
:label=
"option[item.labelKey] || option.label"
:value=
"option[item.valueKey] || option.value"
:key=
"index"
></el-option>
</
template
>
</el-select>
</template>
...
...
@@ -206,12 +179,13 @@ export default {
this
.
loading
=
true
httpRequest
(
params
)
.
then
(
res
=>
{
const
{
data
=
{}
}
=
res
||
{}
this
.
page
.
total
=
parseInt
(
data
.
total
||
0
)
const
data
=
res
.
data
||
{}
if
(
Array
.
isArray
(
data
))
{
this
.
dataList
=
callback
?
callback
(
data
)
:
data
}
else
{
this
.
dataList
=
callback
?
callback
(
data
)
:
data
.
list
const
{
list
,
total
}
=
callback
?
callback
(
data
)
:
data
this
.
dataList
=
list
this
.
page
.
total
=
parseInt
(
total
||
0
)
}
})
.
catch
(()
=>
{
...
...
src/modules/dashboard/dataview/views/List.vue
浏览文件 @
19201640
...
...
@@ -141,7 +141,7 @@ export default {
align
:
'center'
,
prop
:
'expiration_time'
,
computed
({
row
})
{
return
row
.
expiration_time
.
slice
(
0
,
10
)
return
row
.
expiration_time
?
.
slice
(
0
,
10
)
}
},
{
label
:
'重修次数'
,
align
:
'center'
,
prop
:
'study_times'
},
...
...
src/modules/school/class/components/CourseList.vue
浏览文件 @
19201640
...
...
@@ -13,43 +13,39 @@
<!--
<el-button
@
click=
"onEdit(row)"
type=
"primary"
size=
"mini"
plain
>
更新
</el-button>
<el-button
@
click=
"onRemove(row)"
type=
"danger"
size=
"mini"
plain
>
删除
</el-button>
-->
</
template
>
<AddCourse
v-if=
"isShowDialog"
:info=
"info"
:title=
"info ? '更新课程' : '添加课程'"
:visible
.
sync=
"isShowDialog"
@
success=
"success"
/>
<AddCourse
v-if=
"isShowDialog"
:info=
"info"
:title=
"info ? '更新课程' : '添加课程'"
:visible
.
sync=
"isShowDialog"
@
success=
"success"
/>
</app-list>
</template>
<
script
>
import
{
addCourse
}
from
'../api'
import
{
addCourse
,
getClassDetail
}
from
'../api'
import
AddCourse
from
'./AddCourse.vue'
export
default
{
components
:
{
AddCourse
},
props
:
{
id
:
{
type
:
String
}
},
data
()
{
return
{
isShowDialog
:
false
,
info
:
{}
}
},
components
:
{
AddCourse
},
props
:
{
detail
:
{
type
:
Object
},
id
:
{
type
:
String
}
},
computed
:
{
// 列表配置
tableOptions
()
{
return
{
data
:
this
.
detail
.
course
.
list
,
remote
:
{
httpRequest
:
getClassDetail
,
params
:
{
id
:
this
.
id
},
beforeRequest
(
params
)
{
params
[
'course-page'
]
=
params
.
page
params
[
'course-per-page'
]
=
params
.
page_size
return
params
},
callback
(
data
)
{
return
data
.
course
}
},
columns
:
[
{
label
:
'课程图片'
,
width
:
'140'
,
slots
:
'table-img'
},
{
label
:
'课程名称'
,
prop
:
'course_name'
},
...
...
@@ -60,10 +56,9 @@ export default {
}
}
},
created
()
{},
methods
:
{
success
()
{
this
.
$
parent
.
$parent
.
getDetail
(
)
this
.
$
refs
.
list
.
refetch
(
true
)
this
.
isShowDialog
=
false
},
handleAdd
()
{
...
...
@@ -96,7 +91,7 @@ export default {
}
addCourse
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
$
parent
.
$parent
.
getDetail
(
)
this
.
$
refs
.
list
.
refetch
(
true
)
this
.
$message
.
success
(
'删除成功'
)
}
})
...
...
src/modules/school/class/components/StudentList.vue
浏览文件 @
19201640
...
...
@@ -2,17 +2,8 @@
<!-- 学员 -->
<app-list
v-bind=
"tableOptions"
ref=
"list"
>
<template
#
header-aside
>
<el-button
type=
"primary"
icon=
"el-icon-plus"
@
click=
"addStudent"
v-permission=
"'menu_class_add_student'"
>
添加
</el-button
>
<el-button
type=
"primary"
icon=
"el-icon-upload2"
style=
"margin-left: 20px"
@
click=
"importStudent"
v-permission=
"'menu_class_import_student'"
>
导入
</el-button
>
<el-button
type=
"primary"
icon=
"el-icon-plus"
@
click=
"addStudent"
v-permission=
"'menu_class_add_student'"
>
添加
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-upload2"
style=
"margin-left: 20px"
@
click=
"importStudent"
v-permission=
"'menu_class_import_student'"
>
导入
</el-button>
</
template
>
<
template
v-slot:table-x=
"{ row }"
>
<el-button
@
click=
"onRemove(row)"
type=
"danger"
size=
"mini"
plain
>
删除
</el-button>
...
...
@@ -22,30 +13,34 @@
</template>
<
script
>
import
{
addStudents
}
from
'../api'
import
{
addStudents
,
getClassDetail
}
from
'../api'
import
AddStudent
from
'./AddStudent.vue'
export
default
{
data
()
{
return
{
isShowDialog
:
false
}
},
components
:
{
AddStudent
},
props
:
{
id
:
{
type
:
String
},
detail
:
{
type
:
Object
props
:
{
id
:
{
type
:
String
}
},
data
()
{
return
{
isShowDialog
:
false
}
},
computed
:
{
// 列表配置
tableOptions
()
{
return
{
data
:
this
.
detail
.
student
.
list
,
remote
:
{
httpRequest
:
getClassDetail
,
params
:
{
id
:
this
.
id
},
beforeRequest
(
params
)
{
params
[
'student-page'
]
=
params
.
page
params
[
'student-per-page'
]
=
params
.
page_size
return
params
},
callback
(
data
)
{
return
data
.
student
}
},
columns
:
[
{
label
:
'姓名'
,
align
:
'center'
,
prop
:
'personal_name'
},
{
label
:
'学号'
,
align
:
'center'
,
prop
:
'sno'
},
...
...
@@ -58,18 +53,13 @@ export default {
},
methods
:
{
success
()
{
this
.
$
parent
.
$parent
.
getDetail
(
)
this
.
$
refs
.
list
.
refetch
(
true
)
},
addStudent
()
{
this
.
isShowDialog
=
true
},
importStudent
()
{
this
.
$router
.
push
({
name
:
'ImportStudent'
,
query
:
{
id
:
this
.
id
}
})
this
.
$router
.
push
({
name
:
'ImportStudent'
,
query
:
{
id
:
this
.
id
}
})
},
// 删除
onRemove
(
row
)
{
...
...
@@ -91,7 +81,7 @@ export default {
// 删除学员
addStudents
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
$parent
.
$parent
.
getDetail
()
this
.
success
()
this
.
$message
({
type
:
'success'
,
message
:
'删除成功'
})
}
})
...
...
src/modules/school/class/components/TeachList.vue
浏览文件 @
19201640
<
template
>
<app-list
v-bind=
"tableOptions"
ref=
"list"
>
<template
#
header-aside
>
<el-button
type=
"primary"
icon=
"el-icon-plus"
@
click=
"addTeacher"
v-permission=
"'menu_class_add_teacher'"
>
添加
</el-button
>
<el-button
type=
"primary"
icon=
"el-icon-plus"
@
click=
"addTeacher"
v-permission=
"'menu_class_add_teacher'"
>
添加
</el-button>
</
template
>
<
template
v-slot:table-x=
"{ row }"
>
<el-button
@
click=
"onRemove(row)"
type=
"danger"
size=
"mini"
plain
>
删除
</el-button>
...
...
@@ -13,31 +11,33 @@
</template>
<
script
>
import
{
addTeachers
}
from
'../api'
import
{
addTeachers
,
getClassDetail
}
from
'../api'
import
AddTeacher
from
'./AddTeacher.vue'
export
default
{
components
:
{
AddTeacher
},
props
:
{
id
:
{
type
:
String
}
},
data
()
{
return
{
isShowDialog
:
false
}
},
components
:
{
AddTeacher
},
props
:
{
detail
:
{
type
:
Object
},
id
:
{
type
:
String
}
},
computed
:
{
// 列表配置
tableOptions
()
{
return
{
data
:
this
.
detail
.
staff
.
list
,
remote
:
{
httpRequest
:
getClassDetail
,
params
:
{
id
:
this
.
id
},
beforeRequest
(
params
)
{
params
[
'staff-page'
]
=
params
.
page
params
[
'staff-per-page'
]
=
params
.
page_size
return
params
},
callback
(
data
)
{
return
data
.
staff
}
},
columns
:
[
{
label
:
'姓名'
,
align
:
'center'
,
prop
:
'personal_name'
},
{
label
:
'手机号'
,
align
:
'center'
,
prop
:
'telephone'
},
...
...
@@ -48,7 +48,7 @@ export default {
},
methods
:
{
success
()
{
this
.
$
parent
.
$parent
.
getDetail
(
)
this
.
$
refs
.
list
.
refetch
(
true
)
},
addTeacher
()
{
this
.
isShowDialog
=
true
...
...
@@ -72,7 +72,7 @@ export default {
}
addTeachers
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
$parent
.
$parent
.
getDetail
()
this
.
success
()
this
.
$message
.
success
(
'删除成功'
)
}
})
...
...
src/modules/school/class/views/Detail.vue
浏览文件 @
19201640
...
...
@@ -4,17 +4,17 @@
<el-tab-pane
label=
"班级信息"
>
<ClassForm
:detail=
"detail.info"
/>
</el-tab-pane>
<el-tab-pane
label=
"课程"
>
<CourseList
:
detail=
"detail"
:
id=
"id"
/>
<el-tab-pane
label=
"课程"
lazy
>
<CourseList
:id=
"id"
/>
</el-tab-pane>
<el-tab-pane
label=
"考试"
>
<
class-exam
:detail=
"detail"
@
update=
"getDetail"
></class-e
xam>
<
ClassExam
:detail=
"detail"
@
update=
"getDetail"
></ClassE
xam>
</el-tab-pane>
<el-tab-pane
label=
"教师"
>
<TeachList
:
detail=
"detail"
:
id=
"id"
/>
<el-tab-pane
label=
"教师"
lazy
>
<TeachList
:id=
"id"
/>
</el-tab-pane>
<el-tab-pane
label=
"学员"
>
<StudentList
:
detail=
"detail"
:
id=
"id"
/>
<el-tab-pane
label=
"学员"
lazy
>
<StudentList
:id=
"id"
/>
</el-tab-pane>
</el-tabs>
<!-- 班级 -->
...
...
@@ -26,7 +26,7 @@
<CourseList
:detail=
"detail"
:id=
"id"
/>
</app-card>
-->
<!-- 考试 -->
<!--
<
class-exam
:detail=
"detail"
@
update=
"getDetail"
></class-e
xam>
-->
<!--
<
ClassExam
:detail=
"detail"
@
update=
"getDetail"
></ClassE
xam>
-->
<!-- 教务 -->
<!--
<app-card
title=
"教师"
>
<TeachList
:detail=
"detail"
:id=
"id"
/>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论