Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
7034ef31
提交
7034ef31
authored
6月 15, 2022
作者:
matian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bug fixes
上级
de877f47
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
23 行增加
和
19 行删除
+23
-19
List.vue
src/modules/admin/category/views/List.vue
+0
-1
Add.vue
src/modules/admin/teacher/views/Add.vue
+8
-3
Detail.vue
src/modules/admin/teacher/views/Detail.vue
+10
-12
List.vue
src/modules/admin/teacher/views/List.vue
+5
-3
没有找到文件。
src/modules/admin/category/views/List.vue
浏览文件 @
7034ef31
...
@@ -179,7 +179,6 @@ const rebuildData = (value: any, arr: any) => {
...
@@ -179,7 +179,6 @@ const rebuildData = (value: any, arr: any) => {
}
}
let
newArr
:
any
=
[]
let
newArr
:
any
=
[]
arr
.
forEach
((
element
:
any
)
=>
{
arr
.
forEach
((
element
:
any
)
=>
{
console
.
log
(
element
,
'element'
)
// indexOf用来判读当前节点name字段是否包含所搜索的字符串value
// indexOf用来判读当前节点name字段是否包含所搜索的字符串value
// 返回值:包含则返回索引值,反之返回-1
// 返回值:包含则返回索引值,反之返回-1
if
(
element
.
category_name
.
indexOf
(
value
)
>
-
1
)
{
if
(
element
.
category_name
.
indexOf
(
value
)
>
-
1
)
{
...
...
src/modules/admin/teacher/views/Add.vue
浏览文件 @
7034ef31
...
@@ -42,9 +42,14 @@ const submitForm = async (formEl: FormInstance | undefined) => {
...
@@ -42,9 +42,14 @@ const submitForm = async (formEl: FormInstance | undefined) => {
if
(
!
formEl
)
return
if
(
!
formEl
)
return
await
formEl
.
validate
(
valid
=>
{
await
formEl
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
ruleForm
.
education
=
store
if
(
ruleForm
.
education
!==
''
)
{
.
getMapValuesByKey
(
'teacher_level'
)
ruleForm
.
education
=
store
.
filter
(
item
=>
item
.
value
===
ruleForm
.
education
)[
0
].
label
.
getMapValuesByKey
(
'teacher_level'
)
.
filter
(
item
=>
item
.
value
===
ruleForm
.
education
)[
0
].
label
}
// if (ruleForm.avatar === '') {
// ruleForm.avatar = 'https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png'
// }
const
params
=
Object
.
assign
({},
ruleForm
)
const
params
=
Object
.
assign
({},
ruleForm
)
createTeacher
(
params
).
then
(()
=>
{
createTeacher
(
params
).
then
(()
=>
{
ElMessage
.
success
(
'创建讲师成功'
)
ElMessage
.
success
(
'创建讲师成功'
)
...
...
src/modules/admin/teacher/views/Detail.vue
浏览文件 @
7034ef31
...
@@ -11,6 +11,7 @@ const router = useRouter()
...
@@ -11,6 +11,7 @@ const router = useRouter()
const
route
=
useRoute
()
const
route
=
useRoute
()
const
appList
=
ref
()
const
appList
=
ref
()
const
levelList
=
store
.
getMapValuesByKey
(
'teacher_level'
)
const
levelList
=
store
.
getMapValuesByKey
(
'teacher_level'
)
const
imgDefault
=
$ref
(
'https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png'
)
const
id
=
route
.
query
.
id
as
string
const
id
=
route
.
query
.
id
as
string
const
title
=
route
.
query
.
title
as
string
const
title
=
route
.
query
.
title
as
string
...
@@ -54,23 +55,26 @@ const handleDelete = (row: any) => {
...
@@ -54,23 +55,26 @@ const handleDelete = (row: any) => {
}
}
const
getTeacherInfo
=
()
=>
{
const
getTeacherInfo
=
()
=>
{
getTeacherDetail
({
id
:
id
}).
then
(
res
=>
{
getTeacherDetail
({
id
:
id
}).
then
(
res
=>
{
console
.
log
(
res
.
data
)
Object
.
keys
(
ruleForm
).
forEach
(
key
=>
{
Object
.
keys
(
ruleForm
).
forEach
(
key
=>
{
ruleForm
[
key
]
=
res
.
data
[
key
]
ruleForm
[
key
]
=
res
.
data
[
key
]
})
})
if
(
ruleForm
.
avatar
===
''
)
{
ruleForm
.
avatar
=
imgDefault
}
})
})
}
}
// 更新讲师
// 更新讲师
const
handleUpdate
=
async
(
formEl
:
FormInstance
|
undefined
)
=>
{
const
handleUpdate
=
async
(
formEl
:
FormInstance
|
undefined
)
=>
{
console
.
log
(
'0000'
)
if
(
!
formEl
)
return
if
(
!
formEl
)
return
await
formEl
.
validate
(
valid
=>
{
await
formEl
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
ruleForm
.
education
=
store
.
getMapValuesByKey
(
'teacher_level'
)
.
filter
(
item
=>
item
.
value
===
ruleForm
.
education
)[
0
].
label
const
params
=
Object
.
assign
({},
ruleForm
)
const
params
=
Object
.
assign
({},
ruleForm
)
params
.
education
=
store
.
getMapValuesByKey
(
'teacher_level'
)
.
filter
(
item
=>
item
.
label
===
ruleForm
.
education
)[
0
].
label
updateTeacher
(
params
).
then
(()
=>
{
updateTeacher
(
params
).
then
(()
=>
{
ElMessage
.
success
(
'
创建
讲师成功'
)
ElMessage
.
success
(
'
更新
讲师成功'
)
router
.
push
(
'/admin/teacher'
)
router
.
push
(
'/admin/teacher'
)
})
})
}
}
...
@@ -89,13 +93,7 @@ onMounted(() => {
...
@@ -89,13 +93,7 @@ onMounted(() => {
<el-row>
<el-row>
<el-col
:span=
"8"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"讲师图片:"
prop=
"avatar"
>
<el-form-item
label=
"讲师图片:"
prop=
"avatar"
>
<el-image
<el-image
v-if=
"isEdit === '1'"
:src=
"ruleForm.avatar || imgDefault"
class=
"avatar_box1"
fit=
"contain"
/>
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
/>
<AppUpload
v-model=
"ruleForm.avatar"
v-else
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
...
...
src/modules/admin/teacher/views/List.vue
浏览文件 @
7034ef31
...
@@ -72,6 +72,7 @@ const handleDetail = (row: any) => {
...
@@ -72,6 +72,7 @@ const handleDetail = (row: any) => {
}
}
})
})
}
}
const
imgDefault
=
ref
(
'https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png'
)
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -85,14 +86,15 @@ const handleDetail = (row: any) => {
...
@@ -85,14 +86,15 @@ const handleDetail = (row: any) => {
<template
#
header-aside
>
</
template
>
<template
#
header-aside
>
</
template
>
<
template
#
table-img=
"{ row }"
>
<
template
#
table-img=
"{ row }"
>
<el-image
<el-image
:src=
"row.avatar"
:src=
"row.avatar
|| imgDefault
"
alt=
""
alt=
""
style=
"width: 50px; height: 50px"
style=
"width: 50px; height: 50px"
:preview-src-list=
"[row.avatar]"
:preview-src-list=
"[row.avatar]
|| [imgDefault]
"
:initial-index=
"4"
:initial-index=
"4"
fit=
"contain"
fit=
"contain"
:preview-teleported=
"true"
:preview-teleported=
"true"
/></
template
>
/>
</
template
>
<
template
#
table-operate=
"{ row }"
>
<
template
#
table-operate=
"{ row }"
>
<el-space>
<el-space>
<el-link
type=
"primary"
plain
@
click=
"handleDetail(row)"
v-permission=
"'v1-backend-lecturer-view'"
<el-link
type=
"primary"
plain
@
click=
"handleDetail(row)"
v-permission=
"'v1-backend-lecturer-view'"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论