Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
bab50a3f
提交
bab50a3f
authored
6月 13, 2022
作者:
lihuihui
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://gitlab-pro.ezijing.com/ezijing-web/center-resource
上级
66c87c78
e2b341f4
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
544 行增加
和
45 行删除
+544
-45
AppList.vue
src/components/base/AppList.vue
+1
-1
List.vue
src/modules/admin/category/views/List.vue
+66
-15
api.ts
src/modules/resource/courseware/api.ts
+19
-0
Operation.vue
...modules/resource/courseware/components/view/Operation.vue
+200
-0
View.vue
src/modules/resource/courseware/views/View.vue
+6
-5
api.ts
src/modules/resource/other/api.ts
+23
-0
Operation.vue
src/modules/resource/other/components/Operation.vue
+200
-0
index.ts
src/modules/resource/other/index.ts
+2
-2
View.vue
src/modules/resource/other/views/View.vue
+21
-15
api.ts
src/modules/system/cover/api.ts
+1
-1
List.vue
src/modules/system/cover/views/List.vue
+2
-2
api.ts
src/modules/system/dictionary/api.ts
+2
-2
ListAddDialog.vue
src/modules/system/dictionary/component/ListAddDialog.vue
+1
-2
没有找到文件。
src/components/base/AppList.vue
浏览文件 @
bab50a3f
...
...
@@ -73,7 +73,7 @@ const fetchList = (isReset = false) => {
return
(
httpRequest
(
requestParams
)
.
then
((
res
:
any
)
=>
{
const
{
list
=
[],
total
=
0
}
=
callback
?
callback
(
res
.
data
)
:
res
.
data
||
{}
const
{
list
=
[],
total
=
0
}
=
callback
?
callback
(
res
.
data
,
requestParams
)
:
res
.
data
||
{}
page
.
total
=
total
dataList
.
value
=
list
})
...
...
src/modules/admin/category/views/List.vue
浏览文件 @
bab50a3f
...
...
@@ -2,7 +2,6 @@
import
Sortable
from
'sortablejs'
import
type
{
MoveEvent
,
SortableEvent
}
from
'sortablejs'
import
AddDialog
from
'../component/AddDialog.vue'
import
{
Operation
}
from
'@element-plus/icons-vue'
import
{
getCategoryList
,
delCategory
,
moveCategory
}
from
'../api'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
AppList
from
'@/components/base/AppList.vue'
...
...
@@ -98,16 +97,16 @@ const listOptions = computed(() => {
remote
:
{
httpRequest
:
getCategoryList
,
params
:
{
type
:
'tree'
,
category_name
:
''
},
callback
(
data
:
ICategory
[])
{
tableData
=
data
tableDataList
=
flatten
(
data
)
return
{
list
:
data
}
callback
(
data
:
ICategory
[],
params
:
any
)
{
const
list
=
rebuildData
(
params
.
category_name
,
data
)
tableData
=
list
tableDataList
=
flatten
(
list
)
return
{
list
}
}
},
filters
:
[{
type
:
'input'
,
prop
:
'name'
,
label
:
'类别名称:'
}],
filters
:
[{
type
:
'input'
,
prop
:
'
category_
name'
,
label
:
'类别名称:'
}],
columns
:
[
{
align
:
'center'
,
slots
:
'table-drag'
},
{
label
:
'类别名称'
,
prop
:
'category_name'
,
align
:
'center'
},
{
label
:
'类别名称'
,
prop
:
'category_name'
,
align
:
'left'
},
{
label
:
'层级'
,
prop
:
'depth'
,
align
:
'center'
},
{
label
:
'状态'
,
prop
:
'status_name'
,
align
:
'center'
},
{
label
:
'操作'
,
slots
:
'table-operate'
,
width
:
230
,
align
:
'center'
}
...
...
@@ -148,7 +147,11 @@ function useSortable() {
if
(
oldIndex
===
undefined
||
newIndex
===
undefined
||
oldIndex
===
newIndex
)
return
const
draggedRow
=
tableDataList
[
oldIndex
]
const
relatedRow
=
tableDataList
[
newIndex
]
moveCategory
({
id
:
draggedRow
.
id
,
brother_id
:
relatedRow
.
id
,
type
:
newIndex
>
oldIndex
?
'after'
:
'before'
}).
then
(()
=>
{
moveCategory
({
id
:
draggedRow
.
id
,
brother_id
:
relatedRow
.
id
,
type
:
newIndex
>
oldIndex
?
'after'
:
'before'
}).
then
(()
=>
{
// 修复拖拽后数据顺序不对的问题
if
(
oldIndex
<
newIndex
)
{
tableData
=
[]
...
...
@@ -169,17 +172,57 @@ function onExpandChange(row: ICategory, expanded: boolean) {
}
}
// 重点代码 根据name字段模糊匹配树状结构数据,最后将处理好的数据返回出来
const
rebuildData
=
(
value
:
any
,
arr
:
any
)
=>
{
if
(
!
arr
)
{
return
[]
}
let
newArr
:
any
=
[]
arr
.
forEach
((
element
:
any
)
=>
{
console
.
log
(
element
,
'element'
)
// indexOf用来判读当前节点name字段是否包含所搜索的字符串value
// 返回值:包含则返回索引值,反之返回-1
if
(
element
.
category_name
.
indexOf
(
value
)
>
-
1
)
{
const
ab
=
rebuildData
(
value
,
element
.
children
)
const
obj
=
{
...
element
,
children
:
ab
}
newArr
.
push
(
obj
)
}
else
{
// 判断当前节点知否有子节点,并且子节点中有数据,有数据继续递归查找
if
(
element
.
children
&&
element
.
children
.
length
>
0
)
{
const
ab
=
rebuildData
(
value
,
element
.
children
)
const
obj
=
{
...
element
,
children
:
ab
}
if
(
ab
&&
ab
.
length
>
0
)
{
newArr
.
push
(
obj
)
}
}
}
})
return
newArr
}
onMounted
(()
=>
{
useSortable
()
})
</
script
>
<
template
>
<AppCard
title=
"类别管理"
>
<AppList
v-bind=
"listOptions"
:has-pagination=
"false"
row-key=
"id"
ref=
"appList"
:expand-row-keys=
"expandRowKeys"
@
expand-change=
"onExpandChange"
>
<el-button
type=
"primary"
@
click=
"handleAddCategory"
>
新增类别
</el-button>
<template
#
table-drag
>
<el-icon><Operation
/></el-icon>
</
template
>
<AppList
v-bind=
"listOptions"
:has-pagination=
"false"
row-key=
"id"
ref=
"appList"
:expand-row-keys=
"expandRowKeys"
@
expand-change=
"onExpandChange"
border
stripe
>
<el-button
type=
"primary"
@
click=
"handleAddCategory"
style=
"margin-bottom: 20px"
>
新增类别
</el-button>
<template
#
table-operate=
"
{ row }">
<el-link
type=
"primary"
style=
"margin-right: 5px"
@
click=
"handleEdit(row)"
>
编辑
</el-link>
<el-link
type=
"primary"
style=
"margin-right: 5px"
@
click=
"handleAddRow(row)"
>
新增
</el-link>
...
...
@@ -187,5 +230,13 @@ onMounted(() => {
</
template
>
</AppList>
</AppCard>
<AddDialog
v-model:dialogVisible=
"dialogVisible"
@
updatePage=
"handleUpdate"
:editData=
"editData"
:isEdit=
"isEdit"
:title=
"title"
:prevCategoryName=
"prevCategoryName"
v-if=
"dialogVisible"
/>
<AddDialog
v-model:dialogVisible=
"dialogVisible"
@
updatePage=
"handleUpdate"
:editData=
"editData"
:isEdit=
"isEdit"
:title=
"title"
:prevCategoryName=
"prevCategoryName"
v-if=
"dialogVisible"
/>
</template>
src/modules/resource/courseware/api.ts
浏览文件 @
bab50a3f
...
...
@@ -47,3 +47,22 @@ export function getCourseDetails(params: { id: string }) {
export
function
getProjectList
(
params
:
{
organization_id
:
string
})
{
return
httpRequest
.
get
(
'/api/resource/v1/util/members'
,
{
params
})
}
// 部门共享
export
function
setDepartment
(
data
:
{
id
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/resource/courseware/set-department'
,
data
)
}
// 平台共享
export
function
setPlatform
(
data
:
{
id
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/resource/courseware/set-platform'
,
data
)
}
// 上下线
export
function
setStatus
(
data
:
{
id
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/resource/vset-status'
,
data
)
}
// 更改负责人
export
function
setBelong
(
data
:
{
id
:
string
;
belong_operator
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/resource/courseware/set-belong'
,
data
)
}
src/modules/resource/courseware/components/view/Operation.vue
0 → 100644
浏览文件 @
bab50a3f
<
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'
])
const
path
=
router
.
currentRoute
.
value
.
path
console
.
log
(
path
,
'path'
)
// 详情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"
style=
"margin-bottom: 20px"
>
<template
v-if=
"path === '/resource/courseware/view'"
>
<router-link
:to=
"`/resource/courseware/update?id=$
{id}`">
<div
class=
"btn-item"
>
编辑课件信息
</div>
</router-link>
<!--
<router-link
:to=
"`/resource/video/edit-courseware?id=$
{id}`">
<div
class=
"btn-item"
>
编辑视频课件
</div>
</router-link>
-->
</
template
>
<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/courseware/views/View.vue
浏览文件 @
bab50a3f
...
...
@@ -34,21 +34,22 @@ getCourseDetails({ id: id }).then(res => {
<
template
>
<AppCard
title=
"课件资源信息"
>
<div
class=
"btn-box"
>
<
!--
<
div
class=
"btn-box"
>
<div
class=
"btn-item"
>
部门共享
</div>
<div
class=
"btn-item"
>
平台共享
</div>
<div
class=
"btn-item"
>
资源下线
</div>
<div
class=
"btn-item"
>
更改负责人
</div>
</div>
<TopInfo></TopInfo>
<CenterInfo></CenterInfo>
</div>
-->
<Operation
:data=
"courseDetails"
style=
"margin-bottom: 20px"
></Operation>
<TopInfo
:data=
"courseDetails"
></TopInfo>
<CenterInfo
v-if=
"Object.keys(courseDetails).length"
:data=
"courseDetails"
></CenterInfo>
<BottomInfo></BottomInfo>
</AppCard>
<AppCard
title=
"课件资源关联使用课程"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
stripe
>
<template
#
table-operate=
"
{ row }">
<el-space>
<router-link
:to=
"`/
video/update/
$
{row.id}`">
<router-link
:to=
"`/
resource/courseware/update/?id=
$
{row.id}`">
<el-button
style=
"color: #399ee8"
type=
"primary"
link
>
查看
</el-button>
</router-link>
</el-space>
...
...
src/modules/resource/other/api.ts
浏览文件 @
bab50a3f
...
...
@@ -11,6 +11,10 @@ export function getOtherList(params?: {
})
{
return
httpRequest
.
get
(
'/api/resource/v1/resource/other-information/list'
,
{
params
})
}
// 获取其他资料详情
export
function
getOtherDetails
(
params
:
{
id
:
string
})
{
return
httpRequest
.
get
(
'/api/resource/v1/resource/other-information/view'
,
{
params
})
}
// 获取项目列表
export
function
getProjectList
(
params
:
{
organization_id
:
string
})
{
...
...
@@ -20,3 +24,22 @@ export function getProjectList(params: { organization_id: string }) {
export
function
getCategoryList
(
params
:
{
type
:
string
;
category_name
?:
string
})
{
return
httpRequest
.
get
(
'/api/resource/v1/backend/category/list'
,
{
params
})
}
// 部门共享
export
function
setDepartment
(
data
:
{
id
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/resource/other-information/set-department'
,
data
)
}
// 平台共享
export
function
setPlatform
(
data
:
{
id
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/resource/other-information/set-platform'
,
data
)
}
// 上下线
export
function
setStatus
(
data
:
{
id
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/resource/other-information/set-status'
,
data
)
}
// 更改负责人
export
function
setBelong
(
data
:
{
id
:
string
;
belong_operator
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/resource/other-information/set-belong'
,
data
)
}
src/modules/resource/other/components/Operation.vue
0 → 100644
浏览文件 @
bab50a3f
<
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'
])
const
path
=
router
.
currentRoute
.
value
.
path
console
.
log
(
path
,
'path'
)
// 详情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"
style=
"margin-bottom: 20px"
>
<template
v-if=
"path === '/resource/other/view'"
>
<router-link
:to=
"`/resource/other/update?id=$
{id}`">
<div
class=
"btn-item"
>
编辑其他资料信息
</div>
</router-link>
<!--
<router-link
:to=
"`/resource/video/edit-courseware?id=$
{id}`">
<div
class=
"btn-item"
>
编辑视频课件
</div>
</router-link>
-->
</
template
>
<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/other/index.ts
浏览文件 @
bab50a3f
...
...
@@ -7,8 +7,8 @@ export const routes: Array<RouteRecordRaw> = [
component
:
AppLayout
,
children
:
[
{
path
:
''
,
component
:
()
=>
import
(
'./views/List.vue'
)
},
{
path
:
'update'
,
component
:
()
=>
import
(
'./views/Update.vue'
)
},
{
path
:
'view'
,
component
:
()
=>
import
(
'./views/View.vue'
)
}
{
path
:
'
/resource/other/
update'
,
component
:
()
=>
import
(
'./views/Update.vue'
)
},
{
path
:
'
/resource/other/
view'
,
component
:
()
=>
import
(
'./views/View.vue'
)
}
// { path: 'update/:id', component: () => import('./views/Update.vue'), props: true }
]
}
...
...
src/modules/resource/other/views/View.vue
浏览文件 @
bab50a3f
...
...
@@ -2,6 +2,9 @@
import
TopInfo
from
'../components/view/TopInfo.vue'
import
CenterInfo
from
'../components/view/CenterInfo.vue'
import
BottomInfo
from
'../components/view/BottomInfo.vue'
import
{
getOtherDetails
}
from
'../api'
const
router
=
useRouter
()
const
listOptions
=
{
columns
:
[
{
label
:
'课程图片'
,
prop
:
'img'
,
align
:
'center'
},
...
...
@@ -20,31 +23,34 @@ const listOptions = {
{
img
:
5
,
cursor_name
:
'宏观经济学.pptx'
,
type_name
:
'5'
,
zhang
:
'5'
,
jie
:
'吉林师范大学'
,
update
:
'王重阳'
}
]
}
const
id
=
router
.
currentRoute
.
value
.
query
.
id
as
string
// 获取详情
let
otherDetails
:
any
=
ref
({})
getOtherDetails
({
id
:
id
}).
then
((
res
:
any
)
=>
{
otherDetails
.
value
=
res
.
data
})
</
script
>
<
template
>
<AppCard
title=
"课件资源信息"
>
<div
class=
"btn-box"
>
<
!--
<
div
class=
"btn-box"
>
<div
class=
"btn-item"
>
部门共享
</div>
<div
class=
"btn-item"
>
平台共享
</div>
<div
class=
"btn-item"
>
资源下线
</div>
<div
class=
"btn-item"
>
更改负责人
</div>
</div>
<TopInfo></TopInfo>
<CenterInfo></CenterInfo>
</div>
-->
<Operation
:data=
"otherDetails"
style=
"margin-bottom: 20px"
></Operation>
<TopInfo
:data=
"otherDetails"
></TopInfo>
<CenterInfo
v-if=
"Object.keys(otherDetails).length"
:data=
"otherDetails"
></CenterInfo>
<BottomInfo></BottomInfo>
</AppCard>
<AppCard
title=
"课件资源关联使用课程"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
stripe
>
<template
#
table-operate=
"
{ row }">
<el-space>
<router-link
:to=
"`/video/update/$
{row.id}`">
<el-button
style=
"color: #399EE8;"
type=
"primary"
link
>
查看
</el-button
>
<router-link
:to=
"`/other/update/?id=$
{row.id}`">
<el-button
style=
"color: #399ee8"
type=
"primary"
link
>
查看
</el-button>
</router-link>
</el-space>
</
template
>
...
...
@@ -52,17 +58,17 @@ const listOptions = {
</AppCard>
</template>
<
style
lang=
"scss"
scoped
>
.btn-box
{
.btn-box
{
display
:
flex
;
justify-content
:
right
;
.btn-item
{
.btn-item
{
width
:
127px
;
line-height
:
36px
;
background
:
#
AA
1941
;
background
:
#
aa
1941
;
border-radius
:
20px
;
margin-right
:
10px
;
font-size
:
14px
;
color
:
#
FFFFFF
;
color
:
#
ffffff
;
text-align
:
center
;
}
}
...
...
src/modules/system/cover/api.ts
浏览文件 @
bab50a3f
import
httpRequest
from
'@/utils/axios'
// 获取封面列表
export
function
getCoverList
(
params
?:
{
type
?:
string
;
page
?:
number
;
page_size
?:
number
})
{
export
function
getCoverList
(
params
?:
{
type
?:
string
;
page
?:
number
;
[
'per-page'
]
?:
number
})
{
return
httpRequest
.
get
(
'/api/resource/v1/backend/cover/list'
,
{
params
})
}
// 创建封面
...
...
src/modules/system/cover/views/List.vue
浏览文件 @
bab50a3f
...
...
@@ -63,8 +63,8 @@ const handleEdit = (row: any) => {
</
template
>
<
template
#
table-operate=
"{ row }"
>
<el-space>
<el-
button
type=
"primary"
plain
@
click=
"handleEdit(row)"
>
编辑
</el-button
>
<el-
button
type=
"primary"
plain
@
click=
"handleDelete(row)"
>
删除
</el-button
>
<el-
link
type=
"primary"
plain
@
click=
"handleEdit(row)"
>
编辑
</el-link
>
<el-
link
type=
"primary"
plain
@
click=
"handleDelete(row)"
>
删除
</el-link
>
</el-space>
</
template
>
<
template
v-if=
"isShowDialog === true"
>
...
...
src/modules/system/dictionary/api.ts
浏览文件 @
bab50a3f
import
httpRequest
from
'@/utils/axios'
// 获取视频列表
export
function
getVideoList
(
params
?:
{
type
?:
string
;
page
?:
number
;
page_size
?:
number
})
{
export
function
getVideoList
(
params
?:
{
type
?:
string
;
page
?:
number
;
[
'per-page'
]
?:
number
})
{
return
httpRequest
.
get
(
'/api/resource/backend/video/index'
,
{
params
})
}
// 获取字典列表
...
...
@@ -12,7 +12,7 @@ export function getDictionaryList(params?: {
created_time_start
?:
string
created_time_end
?:
string
page
?:
number
page_size
?:
number
[
'per-page'
]
?:
number
})
{
return
httpRequest
.
get
(
'/api/resource/v1/backend/data-dictionary/list'
,
{
params
})
}
...
...
src/modules/system/dictionary/component/ListAddDialog.vue
浏览文件 @
bab50a3f
...
...
@@ -69,7 +69,6 @@ const handleConfirm = async (formEl: FormInstance | undefined) => {
await
formEl
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
props
.
isEdit
===
true
)
{
// emit('confirm', { form, isUpdate: 1, id: props.editData.id })
// 更新字典的值
const
params
=
Object
.
assign
({
id
:
props
.
editData
.
id
,
data_dictionary_id
:
props
.
dictionaryId
},
form
)
updateDictionaryItem
(
params
).
then
(()
=>
{
...
...
@@ -78,7 +77,6 @@ const handleConfirm = async (formEl: FormInstance | undefined) => {
emit
(
'updatePage'
)
})
}
else
{
// emit('confirm', { form, isUpdate: 0 })
// 新增字典的值
const
params
=
Object
.
assign
({
data_dictionary_id
:
props
.
dictionaryId
},
form
)
createDictionaryItem
(
params
).
then
(()
=>
{
...
...
@@ -99,6 +97,7 @@ onMounted(() => {
form
.
remark
=
props
.
editData
.
remark
form
.
status
=
props
.
editData
.
status
form
.
sort
=
props
.
editData
.
sort
form
.
can_edit
=
props
.
editData
.
can_edit
}
})
</
script
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论