Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
aad23ec0
提交
aad23ec0
authored
2月 02, 2023
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
b19daa72
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
64 行增加
和
3 行删除
+64
-3
AddVideoDialog.vue
...se/create/components/stepTwoComponents/AddVideoDialog.vue
+58
-1
CardListItem.vue
...urse/create/components/stepTwoComponents/CardListItem.vue
+6
-2
没有找到文件。
src/modules/course/create/components/stepTwoComponents/AddVideoDialog.vue
浏览文件 @
aad23ec0
...
@@ -2,11 +2,12 @@
...
@@ -2,11 +2,12 @@
import
{
getVideoList
,
createCharacter
,
getCourseListSearch
,
getLessonList
,
getOtherList
}
from
'../../api'
import
{
getVideoList
,
createCharacter
,
getCourseListSearch
,
getLessonList
,
getOtherList
}
from
'../../api'
import
CardListItem
from
'./CardListItem.vue'
import
CardListItem
from
'./CardListItem.vue'
import
{
useGetCategoryList
}
from
'@/composables/useGetCategoryList'
import
{
useGetCategoryList
}
from
'@/composables/useGetCategoryList'
import
{
ElMessage
}
from
'element-plus'
const
appList
=
ref
()
const
appList
=
ref
()
// 资源出处 tab触发
// 资源出处 tab触发
const
tabValue
=
ref
(
'1'
)
const
tabValue
=
ref
(
'1'
)
const
path
=
ref
(
''
)
const
path
=
ref
(
''
)
let
tableData
:
any
=
reactive
({
let
tableData
:
any
=
$ref
({
list
:
[],
list
:
[],
title
:
''
,
title
:
''
,
total
:
''
total
:
''
...
@@ -121,6 +122,57 @@ if (props.btnInfo.resource_type === '2') {
...
@@ -121,6 +122,57 @@ if (props.btnInfo.resource_type === '2') {
}
else
if
(
props
.
btnInfo
.
resource_type
===
'4'
)
{
}
else
if
(
props
.
btnInfo
.
resource_type
===
'4'
)
{
path
.
value
=
'/resource/other/view'
path
.
value
=
'/resource/other/view'
}
}
let
checkName
=
$ref
(
'全选'
)
// 写到这了
const
checkboxAll
=
function
()
{
const
data
=
tableData
.
list
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
if
(
b
.
check_status
)
a
.
push
(
b
)
return
a
},
[])
if
(
data
.
length
===
tableData
.
list
.
length
)
{
tableData
.
list
.
map
((
item
:
any
)
=>
{
item
.
check_status
=
false
return
item
})
checkName
=
'全选'
}
else
{
tableData
.
list
.
map
((
item
:
any
)
=>
{
item
.
check_status
=
true
return
item
})
checkName
=
'取消全选'
}
}
const
checkboxSelect
=
function
()
{
const
data
=
tableData
.
list
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
if
(
b
.
check_status
)
a
.
push
(
b
)
return
a
},
[])
data
.
length
!==
tableData
.
list
.
length
?
(
checkName
=
'全选'
)
:
(
checkName
=
'取消全选'
)
}
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
}
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
(
'添加成功'
)
}
})
})
}
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -152,6 +204,10 @@ if (props.btnInfo.resource_type === '2') {
...
@@ -152,6 +204,10 @@ if (props.btnInfo.resource_type === '2') {
</
template
>
</
template
>
<
template
#
body=
"{ data }"
>
<
template
#
body=
"{ data }"
>
<div
class=
"card-list"
v-if=
"data.length"
>
<div
class=
"card-list"
v-if=
"data.length"
>
<div
style=
"display: flex; margin-bottom: 20px"
>
<el-button
type=
"primary"
@
click=
"checkboxAll"
>
{{
checkName
}}
</el-button>
<el-button
type=
"primary"
@
click=
"addVideo"
>
添加
</el-button>
</div>
<div
class=
"card-list-con"
>
<div
class=
"card-list-con"
>
<CardListItem
<CardListItem
v-for=
"(item, index) in data"
v-for=
"(item, index) in data"
...
@@ -161,6 +217,7 @@ if (props.btnInfo.resource_type === '2') {
...
@@ -161,6 +217,7 @@ if (props.btnInfo.resource_type === '2') {
:path=
"path"
:path=
"path"
@
add=
"handleAdd"
@
add=
"handleAdd"
>
>
<el-checkbox
@
change=
"checkboxSelect"
v-model=
"item.check_status"
></el-checkbox>
</CardListItem>
</CardListItem>
</div>
</div>
</div>
</div>
...
...
src/modules/course/create/components/stepTwoComponents/CardListItem.vue
浏览文件 @
aad23ec0
...
@@ -8,6 +8,7 @@ interface Emits {
...
@@ -8,6 +8,7 @@ interface Emits {
(
e
:
'add'
,
id
:
object
):
void
(
e
:
'add'
,
id
:
object
):
void
}
}
const
handleAdd
=
()
=>
{
const
handleAdd
=
()
=>
{
console
.
log
(
props
.
data
,
'datas'
)
emit
(
'add'
,
props
.
data
)
emit
(
'add'
,
props
.
data
)
}
}
const
bytesToSize
=
(
bytes
:
number
)
=>
{
const
bytesToSize
=
(
bytes
:
number
)
=>
{
...
@@ -48,6 +49,7 @@ const bytesToSize = (bytes: number) => {
...
@@ -48,6 +49,7 @@ const bytesToSize = (bytes: number) => {
</div>
</div>
</div>
</div>
<div
class=
"card-item-bottom"
>
<div
class=
"card-item-bottom"
>
<slot></slot>
<div
class=
"item-t"
>
<div
class=
"item-t"
>
<el-popover
trigger=
"hover"
placement=
"right"
>
<el-popover
trigger=
"hover"
placement=
"right"
>
<div
v-html=
"props.data.created_operator_name + '/' + props.data.organ_id_name"
></div>
<div
v-html=
"props.data.created_operator_name + '/' + props.data.organ_id_name"
></div>
...
@@ -61,7 +63,9 @@ const bytesToSize = (bytes: number) => {
...
@@ -61,7 +63,9 @@ const bytesToSize = (bytes: number) => {
</div>
</div>
<div
class=
"item-b"
>
<div
class=
"item-b"
>
<div
class=
"time"
>
{{ props.data.updated_time }}
</div>
<div
class=
"time"
>
{{ props.data.updated_time }}
</div>
<div
class=
"tag"
v-if=
"tabIndex === '2'"
>
{{ props.data.department_public === '0' ? '未共享' : '已共享' }}
</div>
<div
class=
"tag"
v-if=
"tabIndex === '2'"
>
{{ props.data.department_public === '0' ? '未共享' : '已共享' }}
</div>
<div
class=
"tag"
v-if=
"tabIndex === '3'"
>
{{ props.data.platform_public === '0' ? '未共享' : '已共享' }}
</div>
<div
class=
"tag"
v-if=
"tabIndex === '3'"
>
{{ props.data.platform_public === '0' ? '未共享' : '已共享' }}
</div>
</div>
</div>
</div>
</div>
...
@@ -167,7 +171,7 @@ const bytesToSize = (bytes: number) => {
...
@@ -167,7 +171,7 @@ const bytesToSize = (bytes: number) => {
}
}
.card-item-bottom
{
.card-item-bottom
{
background
:
#fff
;
background
:
#fff
;
padding
:
2
0px
16px
30px
;
padding
:
1
0px
16px
30px
;
.item-t
{
.item-t
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论