Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
452d78cf
提交
452d78cf
authored
2月 03, 2023
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
aad23ec0
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
93 行增加
和
18 行删除
+93
-18
AddVideoDialog.vue
...se/create/components/stepTwoComponents/AddVideoDialog.vue
+93
-18
没有找到文件。
src/modules/course/create/components/stepTwoComponents/AddVideoDialog.vue
浏览文件 @
452d78cf
...
...
@@ -3,6 +3,7 @@ import { getVideoList, createCharacter, getCourseListSearch, getLessonList, getO
import
CardListItem
from
'./CardListItem.vue'
import
{
useGetCategoryList
}
from
'@/composables/useGetCategoryList'
import
{
ElMessage
}
from
'element-plus'
import
{
PictureFilled
}
from
'@element-plus/icons-vue'
const
appList
=
ref
()
// 资源出处 tab触发
const
tabValue
=
ref
(
'1'
)
...
...
@@ -74,6 +75,7 @@ const listOptions = computed(() => {
callback
(
data
:
any
)
{
data
.
list
.
forEach
((
item
:
any
)
=>
(
item
.
check_status
=
false
))
tableData
=
data
console
.
log
(
tableData
.
list
,
'123'
)
return
{
list
:
data
.
list
,
total
:
data
.
total
}
},
params
:
{
tab
:
tabValue
,
status
:
'1'
,
authorized
:
''
,
name
:
''
,
course_id
:
props
.
course_id
||
''
}
...
...
@@ -82,7 +84,25 @@ const listOptions = computed(() => {
{
prop
:
'classification'
,
label
:
'类别:'
,
slots
:
'filter-type'
},
{
type
:
'input'
,
prop
:
'name'
,
label
:
'标题:'
}
],
columns
:
[],
columns
:
[
{
type
:
'selection'
},
{
label
:
'视频标题'
,
prop
:
'name'
,
align
:
'center'
,
computed
({
row
}:
any
)
{
return
row
.
name
?.
length
>
10
?
`
${
row
.
name
.
slice
(
0
,
10
)}
...`
:
row
.
name
}
},
{
label
:
'视频分类'
,
prop
:
'classification_name'
,
align
:
'center'
},
{
label
:
'知识点'
,
prop
:
'knowledge_points'
,
align
:
'center'
},
{
label
:
'封面'
,
slots
:
'table-cover'
,
width
:
150
,
align
:
'center'
},
{
label
:
'资源状态'
,
prop
:
'status_name'
,
align
:
'center'
},
{
label
:
'审核状态'
,
prop
:
'audit_status_name'
,
align
:
'center'
},
{
label
:
'更新人'
,
prop
:
'updated_operator_name'
,
align
:
'center'
},
{
label
:
'更新人部门'
,
prop
:
'organ_id_name'
,
align
:
'center'
},
{
label
:
'更新日期'
,
prop
:
'updated_time'
,
align
:
'center'
}
],
data
:
tableData
.
list
}
})
...
...
@@ -156,21 +176,43 @@ const checkboxSelect = function () {
const
addVideo
=
function
()
{
const
data
=
tableData
.
list
.
filter
((
item
:
any
)
=>
item
.
check_status
===
true
)
data
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
const
params
:
any
=
{
name
:
item
.
name
,
course_id
:
props
.
course_id
,
resource_type
:
props
.
btnInfo
.
resource_type
,
parent_id
:
props
.
chapterID
,
resource_id
:
item
.
id
addRequest
(
item
,
index
,
data
)
})
}
const
addRequest
=
function
(
item
:
any
,
index
:
number
,
data
:
any
)
{
const
params
:
any
=
{
name
:
item
.
name
,
course_id
:
props
.
course_id
,
resource_type
:
props
.
btnInfo
.
resource_type
,
parent_id
:
props
.
chapterID
,
resource_id
:
item
.
id
}
createCharacter
(
params
).
then
(()
=>
{
if
(
index
===
data
.
length
-
1
)
{
emit
(
'update:isShowAddDialog'
,
false
)
emit
(
'create'
,
item
)
ElMessage
.
success
(
'添加成功'
)
}
createCharacter
(
params
).
then
(()
=>
{
console
.
log
(
index
===
data
.
length
,
'index === data.length'
)
if
(
index
===
data
.
length
-
1
)
{
emit
(
'update:isShowAddDialog'
,
false
)
emit
(
'create'
,
item
)
ElMessage
.
success
(
'添加成功'
)
}
})
})
}
// 列表切换
let
isCard
=
$ref
(
true
)
const
changeCard
=
()
=>
{
isCard
=
!
isCard
}
let
checkBox
=
$ref
([])
const
select
=
function
(
row
:
any
)
{
checkBox
=
row
console
.
log
(
row
)
}
const
addVideoList
=
function
()
{
console
.
log
(
checkBox
,
'checkBox'
)
checkBox
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
addRequest
(
item
,
index
,
checkBox
)
})
}
</
script
>
...
...
@@ -189,8 +231,32 @@ const addVideo = function () {
<el-tab-pane
label=
"部门资源"
name=
"2"
></el-tab-pane>
<el-tab-pane
label=
"公开资源"
name=
"3"
></el-tab-pane>
</el-tabs>
<div
class=
"video-head-icon"
@
click=
"changeCard"
>
<img
v-if=
"!isCard"
src=
"https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/change_card.png"
alt=
""
/>
<img
v-else
src=
"https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/change_list.png"
alt=
""
/>
</div>
</div>
<AppList
v-bind=
"listOptions"
ref=
"appList"
>
<AppList
@
selection-change=
"select"
v-bind=
"listOptions"
ref=
"appList"
>
<template
#
header-aside
></
template
>
<
template
#
table-cover=
"{ row }"
>
<div
style=
"background: #ccc"
>
<el-icon
:size=
"50"
color=
"#fff"
v-if=
"row.cover == ''"
>
<PictureFilled></PictureFilled>
</el-icon>
<div
v-else
:style=
"`width: 150px;
display: block;
height: 83px;
background-size: cover;
background-image: url($
{row.cover});`"
>
</div>
</div>
</
template
>
<
template
#
filter-type=
"{ params }"
>
<el-tree-select
filterable
...
...
@@ -202,7 +268,7 @@ const addVideo = function () {
:default-expanded-keys=
"selectTree.length ? [selectTree[0]?.id] : []"
/>
</
template
>
<
template
#
body=
"{ data }"
>
<
template
#
body=
"{ data }"
v-if=
"isCard"
>
<div
class=
"card-list"
v-if=
"data.length"
>
<div
style=
"display: flex; margin-bottom: 20px"
>
<el-button
type=
"primary"
@
click=
"checkboxAll"
>
{{
checkName
}}
</el-button>
...
...
@@ -221,8 +287,8 @@ const addVideo = function () {
</CardListItem>
</div>
</div>
<!--
<el-empty
v-else
description=
"暂无数据"
/>
-->
</
template
>
<el-button
style=
"margin-bottom: 20px"
type=
"primary"
@
click=
"addVideoList"
v-if=
"!isCard"
>
添加
</el-button>
</AppList>
</el-drawer>
</template>
...
...
@@ -251,4 +317,13 @@ const addVideo = function () {
.video-tool-btn
{
padding
:
10px
0
30px
0
;
}
.video-head-icon
{
position
:
absolute
;
top
:
0
;
right
:
0
;
font-size
:
30px
;
color
:
#666
;
cursor
:
pointer
;
}
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论