Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
f2427bc5
提交
f2427bc5
authored
6月 10, 2022
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
87e19558
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
238 行增加
和
7 行删除
+238
-7
api.ts
src/modules/resource/video/api.ts
+20
-0
Operation.vue
src/modules/resource/video/components/Operation.vue
+175
-0
Update.vue
src/modules/resource/video/views/Update.vue
+43
-7
没有找到文件。
src/modules/resource/video/api.ts
浏览文件 @
f2427bc5
...
@@ -34,3 +34,23 @@ export function getProjectList(params: { organization_id: string }) {
...
@@ -34,3 +34,23 @@ export function getProjectList(params: { organization_id: string }) {
export
function
updateVideo
(
data
:
{
id
:
string
;
name
:
string
;
classification
:
string
;
knowledge_points
?:
string
;
cover
?:
string
})
{
export
function
updateVideo
(
data
:
{
id
:
string
;
name
:
string
;
classification
:
string
;
knowledge_points
?:
string
;
cover
?:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/resource/video/update'
,
data
)
return
httpRequest
.
post
(
'/api/resource/v1/resource/video/update'
,
data
)
}
}
// 部门共享
export
function
setDepartment
(
data
:
{
id
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/resource/video/set-department'
,
data
)
}
// 平台共享
export
function
setPlatform
(
data
:
{
id
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/resource/video/set-platform'
,
data
)
}
// 上下线
export
function
setStatus
(
data
:
{
id
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/resource/video/set-status'
,
data
)
}
// 更改负责人
export
function
setBelong
(
data
:
{
id
:
string
;
belong_operator
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/resource/video/set-belong'
,
data
)
}
src/modules/resource/video/components/Operation.vue
0 → 100644
浏览文件 @
f2427bc5
<
script
setup
lang=
"ts"
>
import
{
setDepartment
,
setPlatform
,
setStatus
,
getProjectList
,
setBelong
}
from
'../api'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
useMapStore
}
from
'@/stores/map'
const
store
=
useMapStore
()
console
.
log
(
store
)
const
router
=
useRouter
()
const
props
=
defineProps
([
'data'
])
// 详情id
const
id
=
router
.
currentRoute
.
value
.
query
.
id
as
string
// 设置部门共享
const
handleDepartment
=
()
=>
{
ElMessageBox
.
confirm
(
`
${
props
.
data
.
status
==
0
?
`该操作将会使本视频资源在您所在的部门“
${
props
.
data
.
organ_id_name
}
”内部共享,管理者不变,其余人员只能共享使用该资源,确认部门共享吗?`
:
`该操作将会取消本视频资源在您所在的部门“
${
props
.
data
.
organ_id_name
}
”内部共享,部门其余人员将不能再看到该共享资源,确认取消部门共享吗?`
}
`
,
'提示'
,
{
confirmButtonText
:
'确认'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}).
then
(()
=>
{
setDepartment
({
id
:
id
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
0
)
{
ElMessage
({
message
:
'更改成功'
,
type
:
'success'
})
setTimeout
(()
=>
{
router
.
go
(
0
)
},
500
)
}
})
})
}
// 设置平台共享
const
handlePlatform
=
()
=>
{
ElMessageBox
.
confirm
(
`
${
props
.
data
.
platform_public
==
0
?
'该操作将会使本视频资源在e-SaaS平台中公开共享供所有老师使用,资源的管理者不变,其余人员只能共享使用该资源,确认公开该资源吗?'
:
'该操作将会取消本视频资源在e-SaaS平台中公开共享,平台所有人员将不能再看到该共享资源,确认取消平台共享吗?'
}
`
,
'提示'
,
{
confirmButtonText
:
'确认'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}).
then
(()
=>
{
setPlatform
({
id
:
id
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
0
)
{
ElMessage
({
message
:
'更改成功'
,
type
:
'success'
})
setTimeout
(()
=>
{
router
.
go
(
0
)
},
500
)
}
})
})
}
// 上下线设置
const
handleStatus
=
()
=>
{
ElMessageBox
.
confirm
(
`
${
props
.
data
.
status
==
0
?
'已下线的资源将不能被关联到课程使用,确认下线该资源吗?'
:
'确认再次上线该资源吗?'
}
`
,
'提示'
,
{
confirmButtonText
:
'确认'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}).
then
(()
=>
{
setStatus
({
id
:
id
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
0
)
{
ElMessage
({
message
:
'更改成功'
,
type
:
'success'
})
setTimeout
(()
=>
{
router
.
go
(
0
)
},
500
)
}
})
})
}
// 更该负责人
const
form
=
reactive
({
members
:
''
})
const
dialogFormVisible
=
ref
(
false
)
// 人员列表
let
members
:
any
=
ref
([])
const
getMembers
=
()
=>
{
getProjectList
({
organization_id
:
props
.
data
.
organ_id
}).
then
((
res
:
any
)
=>
{
members
.
value
=
res
.
data
.
members
})
}
// 点击更改负责人按钮弹窗
const
handleMembers
=
()
=>
{
getMembers
()
dialogFormVisible
.
value
=
true
}
// 更改负责人确定
const
handlesetBelong
=
()
=>
{
setBelong
({
id
:
id
,
belong_operator
:
form
.
members
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
0
)
{
ElMessage
({
message
:
'更改成功'
,
type
:
'success'
})
setTimeout
(()
=>
{
dialogFormVisible
.
value
=
false
},
500
)
}
})
}
</
script
>
<
template
>
<div
class=
"tool-btn-box"
v-if=
"$route.query.id"
>
<div
class=
"btn-item"
@
click=
"handleDepartment"
>
{{
props
.
data
.
department_public
==
0
?
'部门共享'
:
'取消部门共享'
}}
</div>
<div
class=
"btn-item"
@
click=
"handlePlatform"
>
{{
props
.
data
.
platform_public
==
0
?
'平台共享'
:
'取消平台共享'
}}
</div>
<div
class=
"btn-item"
@
click=
"handleStatus"
>
{{
props
.
data
.
status
==
0
?
'资源上线'
:
'资源下线'
}}
</div>
<div
class=
"btn-item"
@
click=
"handleMembers"
>
更改负责人
</div>
</div>
<el-dialog
v-model=
"dialogFormVisible"
title=
"更改负责人"
center
>
<el-form
:model=
"form"
>
<el-form-item>
<div
style=
"width:500px"
>
<el-row>
<el-col
:span=
"12"
><div
class=
"grid-content ep-bg-purple"
/>
资源创建人:
{{
props
.
data
.
created_operator_name
}}
</el-col>
<el-col
:span=
"12"
><div
class=
"grid-content ep-bg-purple-light"
/>
创建时间:
{{
props
.
data
.
created_time
}}
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
><div
class=
"grid-content ep-bg-purple"
/>
资源负责人:
{{
props
.
data
.
belong_operator_name
}}
</el-col>
<el-col
:span=
"12"
><div
class=
"grid-content ep-bg-purple-light"
/>
更新时间:
{{
props
.
data
.
updated_time
}}
</el-col>
</el-row>
</div>
<el-select
style=
"width:500px;margin-top:20px;"
v-model=
"form.members"
placeholder=
"请选择新的资源负责人"
>
<el-option
v-for=
"item in members"
:label=
"item.name"
:value=
"item.id"
:key=
"item.id"
/>
</el-select>
</el-form-item>
</el-form>
<template
#
footer
>
<span
class=
"dialog-footer"
>
<el-button
@
click=
"dialogFormVisible = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handlesetBelong"
>
确认
</el-button
>
</span>
</
template
>
</el-dialog>
</template>
<
style
lang=
"scss"
scoped
>
.tool-btn-box
{
display
:
flex
;
justify-content
:
right
;
.btn-item
{
width
:
127px
;
line-height
:
36px
;
background
:
#AA1941
;
border-radius
:
20px
;
margin-right
:
10px
;
font-size
:
14px
;
color
:
#FFFFFF
;
text-align
:
center
;
cursor
:
pointer
;
}
}
</
style
>
src/modules/resource/video/views/Update.vue
浏览文件 @
f2427bc5
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
import
type
{
FormInstance
}
from
'element-plus'
import
type
{
FormInstance
}
from
'element-plus'
import
{
ElMessage
}
from
'element-plus'
import
{
ElMessage
}
from
'element-plus'
import
Upload
from
'../components/Upload.vue'
import
Upload
from
'../components/Upload.vue'
import
Operation
from
'../components/Operation.vue'
import
UploadAuth
from
'@/components/base/UploadAuth.vue'
import
UploadAuth
from
'@/components/base/UploadAuth.vue'
// import { useMapStore } from '@/stores/map'
// import { useMapStore } from '@/stores/map'
import
{
getCategoryList
,
getCoverList
,
createVideo
,
getVideoDetails
,
updateVideo
}
from
'../api'
import
{
getCategoryList
,
getCoverList
,
createVideo
,
getVideoDetails
,
updateVideo
}
from
'../api'
...
@@ -122,25 +123,60 @@
...
@@ -122,25 +123,60 @@
// 判断编辑还是新建
// 判断编辑还是新建
const
id
=
router
.
currentRoute
.
value
.
query
.
id
as
string
const
id
=
router
.
currentRoute
.
value
.
query
.
id
as
string
console
.
log
(
id
)
const
statusData
=
reactive
<
{
department_public
:
string
,
platform_public
:
string
,
status
:
string
,
organ_id_name
:
string
,
organ_id
:
string
,
created_operator_name
:
string
,
belong_operator_name
:
string
,
created_time
:
string
,
updated_time
:
string
}
>
({
department_public
:
'0'
,
platform_public
:
'0'
,
status
:
'0'
,
organ_id_name
:
''
,
organ_id
:
''
,
created_operator_name
:
''
,
belong_operator_name
:
''
,
created_time
:
''
,
updated_time
:
''
})
if
(
id
!==
''
&&
id
)
{
if
(
id
!==
''
&&
id
)
{
getVideoDetails
({
id
:
id
}).
then
(
res
=>
{
getVideoDetails
({
id
:
id
}).
then
(
res
=>
{
const
key
=
[
'name'
,
'classification'
,
'knowledge_points'
,
'cover'
,
'source_id'
]
const
key
=
[
'name'
,
'classification'
,
'knowledge_points'
,
'cover'
,
'source_id'
]
key
.
forEach
(
item
=>
{
key
.
forEach
(
item
=>
{
form
[
item
]
=
res
.
data
[
item
]
form
[
item
]
=
res
.
data
[
item
]
})
})
const
{
department_public
,
platform_public
,
status
,
organ_id_name
,
organ_id
,
created_operator_name
,
belong_operator_name
,
created_time
,
updated_time
}
=
res
.
data
statusData
.
department_public
=
department_public
statusData
.
platform_public
=
platform_public
statusData
.
status
=
status
statusData
.
organ_id_name
=
organ_id_name
statusData
.
organ_id
=
organ_id
statusData
.
created_operator_name
=
created_operator_name
statusData
.
belong_operator_name
=
belong_operator_name
statusData
.
created_time
=
created_time
statusData
.
updated_time
=
updated_time
})
})
}
}
</
script
>
</
script
>
<
template
>
<
template
>
<AppCard
title=
"新建视频资源"
>
<AppCard
title=
"新建视频资源"
>
<div
class=
"tool-btn-box"
v-if=
"$route.query.id"
>
<Operation
:data=
"statusData"
style=
"margin-bottom: 20px;"
></Operation>
<div
class=
"btn-item"
>
部门共享
</div>
<div
class=
"btn-item"
>
平台共享
</div>
<div
class=
"btn-item"
>
资源下线
</div>
<div
class=
"btn-item"
>
更改负责人
</div>
</div>
<el-form
ref=
"ruleFormRef"
:model=
"form"
:rules=
"rules"
style=
"width: 70%"
>
<el-form
ref=
"ruleFormRef"
:model=
"form"
:rules=
"rules"
style=
"width: 70%"
>
<el-form-item
label=
"视频文件:"
prop=
"source_id"
v-if=
"id == '' || id == undefined"
>
<el-form-item
label=
"视频文件:"
prop=
"source_id"
v-if=
"id == '' || id == undefined"
>
<div>
<div>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论