Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
d098c80b
提交
d098c80b
authored
6月 14, 2022
作者:
matian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改bug
上级
b4673484
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
49 行增加
和
13 行删除
+49
-13
AppList.vue
src/components/base/AppList.vue
+9
-1
Add.vue
src/modules/admin/teacher/views/Add.vue
+11
-8
Detail.vue
src/modules/admin/teacher/views/Detail.vue
+24
-3
List.vue
src/modules/admin/teacher/views/List.vue
+5
-1
没有找到文件。
src/components/base/AppList.vue
浏览文件 @
d098c80b
...
...
@@ -173,7 +173,14 @@ defineExpose({ refetch, tableRef })
<!-- 主体 -->
<div
class=
"table-list-bd"
>
<slot
name=
"body"
v-bind=
"{ data: dataList }"
>
<el-table
:data=
"dataList"
v-loading=
"loading"
v-bind=
"$attrs"
style=
"height: 100%"
ref=
"tableRef"
>
<el-table
:data=
"dataList"
v-loading=
"loading"
v-bind=
"$attrs"
style=
"height: 100%"
ref=
"tableRef"
:header-cell-style=
"{ background: '#EFEFEF' }"
>
<el-table-column
v-bind=
"item"
v-for=
"item in columns"
:key=
"item.prop"
>
<
template
#
default=
"scope"
v-if=
"item.slots || item.computed"
>
<slot
:name=
"item.slots"
v-bind=
"scope"
v-if=
"item.slots"
></slot>
...
...
@@ -213,6 +220,7 @@ defineExpose({ refetch, tableRef })
// flex-direction: column;
// box-sizing: border-box;
// }
.table-list-hd
{
display
:
flex
;
margin-bottom
:
10px
;
...
...
src/modules/admin/teacher/views/Add.vue
浏览文件 @
d098c80b
...
...
@@ -42,6 +42,9 @@ const submitForm = async (formEl: FormInstance | undefined) => {
if
(
!
formEl
)
return
await
formEl
.
validate
(
valid
=>
{
if
(
valid
)
{
ruleForm
.
education
=
store
.
getMapValuesByKey
(
'teacher_level'
)
.
filter
(
item
=>
item
.
value
===
ruleForm
.
education
)[
0
].
label
const
params
=
Object
.
assign
({},
ruleForm
)
createTeacher
(
params
).
then
(()
=>
{
ElMessage
.
success
(
'创建讲师成功'
)
...
...
@@ -56,28 +59,28 @@ const submitForm = async (formEl: FormInstance | undefined) => {
<AppCard
title=
"添加讲师"
>
<el-form
ref=
"ruleFormRef"
:model=
"ruleForm"
:rules=
"rules"
label-width=
"120px"
class=
"demo-ruleForm"
>
<el-row>
<el-col
:span=
"
6
"
>
<el-col
:span=
"
8
"
>
<el-form-item
label=
"讲师姓名:"
prop=
"name"
>
<el-input
v-model=
"ruleForm.name"
style=
"width:
25
0px"
placeholder=
"请输入讲师姓名"
/>
<el-input
v-model=
"ruleForm.name"
style=
"width:
30
0px"
placeholder=
"请输入讲师姓名"
/>
</el-form-item>
</el-col>
<el-col
:span=
"
6
"
>
<el-col
:span=
"
8
"
>
<el-form-item
label=
"讲师职位:"
prop=
"title"
>
<el-input
v-model=
"ruleForm.title"
style=
"width:
25
0px"
placeholder=
"请输入讲师职位"
/>
<el-input
v-model=
"ruleForm.title"
style=
"width:
30
0px"
placeholder=
"请输入讲师职位"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"
6
"
>
<el-col
:span=
"
8
"
>
<el-form-item
label=
"讲师学历:"
prop=
"education"
>
<el-select
v-model=
"ruleForm.education"
clearable
style=
"width:
25
0px"
placeholder=
"请选择讲师学历"
>
<el-select
v-model=
"ruleForm.education"
clearable
style=
"width:
30
0px"
placeholder=
"请选择讲师学历"
>
<el-option
v-for=
"(item, index) in levelList"
:key=
"index"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"
6
"
>
<el-col
:span=
"
8
"
>
<el-form-item
label=
"讲师任职机构:"
prop=
"office"
>
<el-input
v-model=
"ruleForm.office"
style=
"width:
25
0px"
placeholder=
"请输入讲师任职机构"
/>
<el-input
v-model=
"ruleForm.office"
style=
"width:
30
0px"
placeholder=
"请输入讲师任职机构"
/>
</el-form-item>
</el-col>
</el-row>
...
...
src/modules/admin/teacher/views/Detail.vue
浏览文件 @
d098c80b
...
...
@@ -4,9 +4,13 @@ import { ElMessage } from 'element-plus'
import
type
{
FormRules
,
FormInstance
}
from
'element-plus'
import
VEditor
from
'@/components/tinymce/Index.vue'
import
AppUpload
from
'@/components/base/AppUpload.vue'
import
{
useMapStore
}
from
'@/stores/map'
const
store
=
useMapStore
()
const
router
=
useRouter
()
const
route
=
useRoute
()
const
appList
=
ref
()
const
levelList
=
store
.
getMapValuesByKey
(
'teacher_level'
)
const
id
=
route
.
query
.
id
as
string
const
title
=
route
.
query
.
title
as
string
...
...
@@ -61,6 +65,9 @@ const handleUpdate = async (formEl: FormInstance | undefined) => {
if
(
!
formEl
)
return
await
formEl
.
validate
(
valid
=>
{
if
(
valid
)
{
ruleForm
.
education
=
store
.
getMapValuesByKey
(
'teacher_level'
)
.
filter
(
item
=>
item
.
value
===
ruleForm
.
education
)[
0
].
label
const
params
=
Object
.
assign
({},
ruleForm
)
updateTeacher
(
params
).
then
(()
=>
{
ElMessage
.
success
(
'创建讲师成功'
)
...
...
@@ -82,7 +89,12 @@ onMounted(() => {
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"讲师图片:"
prop=
"avatar"
>
<img
v-if=
"isEdit === '1' && ruleForm.avatar !== ''"
:src=
"ruleForm.avatar"
class=
"avatar_box1"
/>
<el-image
v-if=
"isEdit === '1' && ruleForm.avatar !== ''"
:src=
"ruleForm.avatar"
class=
"avatar_box1"
fit=
"contain"
/>
<div
class=
"avatar_box"
v-else-if=
"isEdit === '1' && ruleForm.avatar === ''"
>
暂无讲师图片
</div>
<AppUpload
v-model=
"ruleForm.avatar"
v-else
/>
</el-form-item>
...
...
@@ -95,7 +107,15 @@ onMounted(() => {
<el-input
v-model=
"ruleForm.title"
:disabled=
"isEdit === '1'"
/>
</el-form-item>
<el-form-item
label=
"讲师学历:"
prop=
"education"
>
<el-input
v-model=
"ruleForm.education"
:disabled=
"isEdit === '1'"
/>
<el-select
v-model=
"ruleForm.education"
clearable
style=
"width: 250px"
placeholder=
"请选择讲师学历"
:disabled=
"isEdit === '1'"
>
<el-option
v-for=
"(item, index) in levelList"
:key=
"index"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"讲师任职机构:"
prop=
"office"
>
<el-input
v-model=
"ruleForm.office"
:disabled=
"isEdit === '1'"
/>
...
...
@@ -143,6 +163,7 @@ onMounted(() => {
border
:
1px
dashed
#ccc
;
}
.avatar_box1
{
width
:
150px
;
max-width
:
150px
;
height
:
200px
;
}
</
style
>
src/modules/admin/teacher/views/List.vue
浏览文件 @
d098c80b
...
...
@@ -29,7 +29,11 @@ const listOptions = $computed(() => {
{
label
:
'讲师姓名'
,
prop
:
'name'
,
align
:
'center'
},
{
label
:
'讲师任职机构'
,
prop
:
'office'
,
align
:
'center'
},
{
label
:
'讲师职位'
,
prop
:
'title'
,
align
:
'center'
},
{
label
:
'讲师学历'
,
prop
:
'education'
,
align
:
'center'
},
{
label
:
'讲师学历'
,
prop
:
'education'
,
align
:
'center'
},
{
label
:
'创建时间'
,
prop
:
'created_time'
,
align
:
'center'
},
{
label
:
'操作'
,
slots
:
'table-operate'
,
width
:
230
,
align
:
'center'
}
]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论