Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
9ed4007c
提交
9ed4007c
authored
7月 05, 2022
作者:
lihuihui
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://gitlab-pro.ezijing.com/ezijing-web/center-resource
上级
500a31cc
1824e960
显示空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
322 行增加
和
213 行删除
+322
-213
base.ts
src/api/base.ts
+5
-1
menus.ts
src/assets/menus.ts
+20
-6
AppList.vue
src/components/base/AppList.vue
+5
-5
Aside.vue
src/components/layout/Aside.vue
+22
-3
useQuestionList.ts
src/composables/useQuestionList.ts
+20
-0
api.ts
src/modules/course/create/api.ts
+12
-21
AddExam.vue
...es/course/create/components/stepOneComponents/AddExam.vue
+18
-93
AddExamDialog.vue
...rse/create/components/stepOneComponents/AddExamDialog.vue
+148
-0
AddChapterDialog.vue
.../create/components/stepTwoComponents/AddChapterDialog.vue
+1
-2
AddExamDialog.vue
...rse/create/components/stepTwoComponents/AddExamDialog.vue
+25
-20
AddLiveDialog.vue
...rse/create/components/stepTwoComponents/AddLiveDialog.vue
+20
-11
AddSectionDialog.vue
.../create/components/stepTwoComponents/AddSectionDialog.vue
+2
-2
AddVideoDialog.vue
...se/create/components/stepTwoComponents/AddVideoDialog.vue
+7
-4
CardListItem.vue
...urse/create/components/stepTwoComponents/CardListItem.vue
+2
-2
StepTwo.vue
src/modules/course/create/views/StepTwo.vue
+10
-38
CardListItem.vue
src/modules/resource/video/components/CardListItem.vue
+5
-5
没有找到文件。
src/api/base.ts
浏览文件 @
9ed4007c
...
...
@@ -55,6 +55,10 @@ export function getCategoryList(params: { type: string; category_name?: string }
}
// 获取项目列表
export
function
getProjectList
(
params
:
{
organization_id
?:
string
,
project_id
?:
string
})
{
export
function
getProjectList
(
params
:
{
organization_id
?:
string
;
project_id
?:
string
})
{
return
httpRequest
.
get
(
'/api/resource/v1/util/members'
,
{
params
})
}
// 获取试题分类
export
function
getQuestionCategory
(
params
:
{
project_tag
:
string
})
{
return
httpRequest
.
get
(
`/api/qbs/admin/v2/question-category/tree/
${
params
.
project_tag
}
`
,
{
params
})
}
src/assets/menus.ts
浏览文件 @
9ed4007c
import
type
{
IMenuItem
}
from
'@/types'
import
{
Expand
,
Document
,
VideoCamera
,
Suitcase
,
Collection
,
Files
,
Monitor
,
Edit
,
User
,
Filter
,
Coordinate
,
Notebook
,
Picture
}
from
'@element-plus/icons-vue'
import
{
FolderOpened
,
ToiletPaper
,
VideoCamera
,
Suitcase
,
Collection
,
Files
,
Monitor
,
Edit
,
User
,
Filter
,
Coordinate
,
Notebook
,
Picture
}
from
'@element-plus/icons-vue'
export
const
menus
:
IMenuItem
[]
=
[
{
tag
:
'v1-resource'
,
...
...
@@ -20,7 +34,7 @@ export const menus: IMenuItem[] = [
},
{
tag
:
'v1-resource-lesson-plan-list'
,
icon
:
Collection
,
icon
:
FolderOpened
,
name
:
'教案'
,
path
:
'/resource/lessonplan'
},
...
...
@@ -31,14 +45,14 @@ export const menus: IMenuItem[] = [
path
:
'/resource/other'
},
{
icon
:
Expand
,
icon
:
Collection
,
name
:
'题库管理'
,
path
:
'
/
'
path
:
'
https://qa-center.ezijing.com/question/list
'
},
{
icon
:
Document
,
icon
:
ToiletPaper
,
name
:
'试卷管理'
,
path
:
'
/
'
path
:
'
https://qa-center.ezijing.com/paper/list
'
}
]
},
...
...
src/components/base/AppList.vue
浏览文件 @
9ed4007c
...
...
@@ -64,11 +64,11 @@ const fetchList = (isReset = false) => {
if
(
beforeRequest
)
{
requestParams
=
beforeRequest
(
requestParams
,
isReset
)
}
//
for (const key in params) {
//
if (params[key] === '' || params[key] === undefined || params[key] === undefined) {
//
delete params[key]
//
}
//
}
for
(
const
key
in
params
)
{
if
(
params
[
key
]
===
''
||
params
[
key
]
===
undefined
||
params
[
key
]
===
undefined
)
{
delete
params
[
key
]
}
}
loading
.
value
=
true
return
(
httpRequest
(
requestParams
)
...
...
src/components/layout/Aside.vue
浏览文件 @
9ed4007c
...
...
@@ -7,6 +7,7 @@ export default {
<
script
setup
lang=
"ts"
>
import
{
menus
}
from
'@/assets/menus'
import
type
{
IMenuItem
}
from
'@/types'
const
router
=
useRouter
()
const
route
=
useRoute
()
const
menuList
=
$computed
<
IMenuItem
[]
>
(()
=>
{
...
...
@@ -27,22 +28,40 @@ const defaultActive = computed(() => {
})
return
found
?
found
.
path
:
'/'
})
function
isUrl
(
path
:
string
)
{
return
/^https
?
:
\/\/
/
.
test
(
path
)
}
function
handleClick
(
path
:
string
)
{
if
(
isUrl
(
path
))
{
window
.
open
(
path
)
}
else
{
router
.
push
(
path
)
}
}
</
script
>
<
template
>
<aside
class=
"app-aside"
>
<nav
class=
"nav"
>
<el-menu
:default-active=
"defaultActive"
:router=
"true"
class=
"app-menu"
>
<el-menu
:default-active=
"defaultActive"
class=
"app-menu"
>
<template
v-for=
"item in menuList"
:key=
"item.path"
>
<el-sub-menu
:index=
"item.path"
v-permission=
"item.tag"
v-if=
"item.children"
>
<template
#
title
>
<el-icon><component
:is=
"item.icon"
></component></el-icon>
{{
item
.
name
}}
</
template
>
<el-menu-item
:index=
"subitem.path"
v-for=
"subitem in item.children"
:key=
"subitem.path"
v-permission=
"subitem.tag"
>
<el-menu-item
:index=
"subitem.path"
v-for=
"subitem in item.children"
:key=
"subitem.path"
v-permission=
"subitem.tag"
@
click=
"handleClick(subitem.path)"
>
{{ subitem.name }}
</el-menu-item>
</el-sub-menu>
<el-menu-item
:index=
"item.path"
v-permission=
"item.tag"
v-else
>
<el-menu-item
:index=
"item.path"
v-permission=
"item.tag"
@
click=
"handleClick(item.path)"
v-else
>
<el-icon><component
:is=
"item.icon"
></component></el-icon>
{{ item.name }}
</el-menu-item>
</template>
...
...
src/composables/useQuestionList.ts
0 → 100644
浏览文件 @
9ed4007c
import
{
getQuestionCategory
}
from
'@/api/base'
export
function
useQuestionList
()
{
const
list
=
ref
([])
getQuestionCategory
({
project_tag
:
'resourse_ci'
}).
then
((
res
:
any
)
=>
{
list
.
value
=
res
.
data
.
filter
((
item
:
any
)
=>
{
item
.
children
=
detailChild
(
item
.
children
)
return
item
.
children
})
})
const
detailChild
=
(
child
:
any
)
=>
{
if
(
!
child
)
return
[]
return
child
.
filter
((
item
:
any
)
=>
{
item
.
children
=
detailChild
(
item
.
children
)
return
item
.
children
})
}
return
{
list
}
}
src/modules/course/create/api.ts
浏览文件 @
9ed4007c
...
...
@@ -11,16 +11,19 @@ export function searchLive(params: { name: string; 'per-page'?: string }) {
}
// 试卷搜索
export
function
searchExam
(
data
:
{
nonce
:
string
timestamp
:
string
signature
:
string
paper_title
:
string
limit
:
string
is_all
:
number
project_prefix
:
string
export
function
searchExam
(
params
:
{
project_tag
:
string
id
?:
string
paper_title
?:
string
permission
:
string
paper_type
?:
string
paper_labels
?:
string
paper_category
?:
string
paper_categories
?:
string
page
?:
string
limit
?:
string
})
{
return
httpRequest
.
post
(
'/api/qbs/api/v1/question-papers/search'
,
data
)
return
httpRequest
.
get
(
`/api/qbs/admin/v2/question-papers/resourse_ci`
,
{
params
}
)
}
// 新建课件
...
...
@@ -154,18 +157,6 @@ export function getOtherList(params?: {
})
{
return
httpRequest
.
get
(
'/api/resource/v1/course/course/search-other-information'
,
{
params
})
}
// 试卷搜索
export
function
gatExamList
(
data
:
{
nonce
:
string
timestamp
:
string
signature
:
string
paper_title
:
string
limit
:
string
is_all
:
number
project_prefix
:
string
})
{
return
httpRequest
.
post
(
'/api/qbs/api/v1/question-papers/search'
,
data
)
}
// 获取视频详情
export
function
getVideoDetails
(
params
:
{
id
:
string
})
{
...
...
src/modules/course/create/components/stepOneComponents/AddExam.vue
浏览文件 @
9ed4007c
<
script
setup
lang=
"ts"
>
import
{
searchExam
}
from
'../../api'
const
emit
=
defineEmits
([
'change'
])
import
AddExamDialog
from
'./AddExamDialog.vue'
const
props
=
defineProps
({
data
:
{
type
:
Array
}
})
const
emit
=
defineEmits
([
'change'
])
const
listOptions
=
computed
(()
=>
{
return
{
columns
:
[
// { label: '', slots: 'table-avatar', align: 'center' },
{
label
:
'试卷名称'
,
prop
:
'paper_title'
,
align
:
'center'
},
{
label
:
'组卷模式'
,
...
...
@@ -36,80 +33,27 @@ const listOptions = computed(() => {
{
label
:
'及格分数'
,
prop
:
'pass_score'
,
align
:
'center'
},
{
label
:
'操作'
,
slots
:
'table-operate'
,
align
:
'center'
}
],
data
:
allLecturers
.
value
.
filter
((
item
:
any
)
=>
lecturerValue
.
value
.
find
((
i
:
any
)
=>
i
===
item
.
id
))
data
:
props
.
data
}
})
const
addExam
=
ref
([])
const
isShowExamDialog
=
ref
(
false
)
// 试卷弹窗
const
dialogVisible
=
ref
(
false
)
interface
ListItem
{
paper_title
:
string
id
:
string
}
const
options
=
ref
<
ListItem
[]
>
([])
const
loading
=
ref
(
false
)
// 所有被搜索出来的值
const
allLecturers
:
any
=
ref
([])
// 考试选中的值
const
lecturerValue
=
ref
([])
// 远程搜索
const
remoteMethod
=
(
query
:
string
)
=>
{
if
(
query
)
{
loading
.
value
=
true
searchExam
({
paper_title
:
query
,
limit
:
'100'
,
is_all
:
1
,
project_prefix
:
'resourse_ci'
,
signature
:
'UG7wBenexQhiuD2wpCwuxkU0jqcj006d'
,
timestamp
:
'32322323'
,
nonce
:
'3232'
}).
then
((
res
:
any
)
=>
{
loading
.
value
=
false
options
.
value
=
res
.
data
.
data
options
.
value
.
forEach
((
item
:
any
)
=>
{
const
findItem
=
allLecturers
.
value
.
find
((
cItem
:
any
)
=>
cItem
.
id
===
item
.
id
)
if
(
!
findItem
)
{
allLecturers
.
value
.
push
(
item
)
}
})
})
}
else
{
options
.
value
=
[]
}
}
watch
(
()
=>
props
.
data
,
value
=>
{
if
(
value
?.
length
)
{
const
list
:
any
=
value
.
map
((
item
:
any
)
=>
{
return
item
.
id
})
lecturerValue
.
value
=
list
allLecturers
.
value
=
value
options
.
value
=
value
as
[]
}
},
{
immediate
:
true
}
)
// 删除考试
// // 删除考试
const
removeLectuter
=
(
id
:
string
)
=>
{
const
index
=
lecturerValue
.
value
.
findIndex
((
ids
:
string
)
=>
ids
===
id
)
lecturerValue
.
value
.
splice
(
index
,
1
)
changeData
(
)
const
index
=
addExam
.
value
.
findIndex
((
ids
:
string
)
=>
ids
===
id
)
addExam
.
value
.
splice
(
index
,
1
)
handleAddExam
(
''
)
}
const
changeData
=
()
=>
{
emit
(
'change'
,
lecturerValue
.
value
)
const
handleAddExam
=
(
val
:
any
)
=>
{
addExam
.
value
=
val
emit
(
'change'
,
val
)
}
</
script
>
<
template
>
<div>
<el-button
type=
"primary"
@
click=
"
dialogVisible
= true"
>
添加课程考试
</el-button>
<el-button
type=
"primary"
@
click=
"
isShowExamDialog
= true"
>
添加课程考试
</el-button>
<AppList
v-bind=
"listOptions"
ref=
"appList"
>
<template
#
table-avatar=
"
{ row }">
<img
:src=
"row.avatar"
style=
"width: 50px; height: 50px; display: block; margin: 0 auto"
/>
...
...
@@ -121,29 +65,10 @@ const changeData = () => {
<el-button
plain
@
click=
"removeLectuter(row.id)"
>
删除
</el-button>
</
template
>
</AppList>
<el-dialog
v-model=
"dialogVisible"
width=
"400px"
title=
"添加考试"
>
<div
style=
"display: flex; justify-content: center"
>
<el-select
@
change=
"changeData"
v-model=
"lecturerValue"
multiple
filterable
remote
reserve-keyword
placeholder=
"请输入试卷名称"
:remote-method=
"remoteMethod"
:loading=
"loading"
>
<el-option
v-for=
"item in options"
:key=
"item.id"
:label=
"item.paper_title"
:value=
"item.id"
/>
</el-select>
</div>
<
template
#
footer
>
<span
class=
"dialog-footer"
>
<!--
<el-button
@
click=
"dialogVisible = false"
>
取消
</el-button>
-->
<el-button
type=
"primary"
@
click=
"dialogVisible = false"
>
确认
</el-button>
</span>
</
template
>
</el-dialog>
<AddExamDialog
v-if=
"isShowExamDialog === true"
v-model:isShowExamDialog=
"isShowExamDialog"
@
create=
"handleAddExam"
/>
</div>
</template>
<
style
lang=
"scss"
></
style
>
src/modules/course/create/components/stepOneComponents/AddExamDialog.vue
0 → 100644
浏览文件 @
9ed4007c
<
script
setup
lang=
"ts"
>
import
{
searchExam
}
from
'../../api'
import
{
useQuestionList
}
from
'@/composables/useQuestionList'
const
appList
=
ref
()
let
{
list
:
selectTree
}
=
useQuestionList
()
const
tabValue
=
ref
(
'1'
)
const
multipleSelection
:
any
=
ref
([])
const
emit
=
defineEmits
<
Emits
>
()
defineProps
({
isShowExamDialog
:
{
type
:
Boolean
,
required
:
true
}
})
interface
Emits
{
(
e
:
'update:isShowExamDialog'
,
isShowExamDialog
:
boolean
):
void
(
e
:
'create'
,
multipleSelection
:
any
):
void
}
const
listOptions
=
{
remote
:
{
httpRequest
:
searchExam
,
beforeRequest
(
params
:
any
)
{
params
.
paper_categories
=
[
params
.
paper_categories
]
return
params
},
callback
(
data
:
any
)
{
return
{
list
:
data
.
data
}
},
params
:
{
project_tag
:
'resourse_ci'
,
id
:
''
,
paper_title
:
''
,
permission
:
tabValue
,
paper_type
:
''
,
paper_labels
:
''
,
paper_category
:
''
,
paper_categories
:
''
}
},
filters
:
[
{
prop
:
'classification'
,
label
:
'类别:'
,
slots
:
'filter-type'
},
{
type
:
'input'
,
prop
:
'paper_title'
,
label
:
'标题:'
}
],
columns
:
[
{
type
:
'selection'
,
fixed
:
'left'
},
{
type
:
'index'
,
label
:
'序号'
,
fixed
:
'left'
},
{
label
:
'组卷模式'
,
prop
:
'paper_type'
,
computed
:
(
row
:
any
)
=>
{
return
row
.
row
.
paper_type
===
1
?
'选题组卷'
:
'自动组卷'
}
},
{
label
:
'试卷用途'
,
prop
:
'paper_uses'
,
computed
:
(
row
:
any
)
=>
{
const
map
=
{
1
:
'考试'
,
2
:
'课后作业'
,
3
:
'课程测试'
}
return
map
[
row
.
row
.
paper_uses
]
||
row
.
row
.
paper_uses
}
},
{
label
:
'试卷分类'
,
prop
:
'paper_category.name'
,
minWidth
:
200
},
{
label
:
'试卷名称'
,
prop
:
'paper_title'
,
minWidth
:
200
},
{
label
:
'总分'
,
prop
:
'paper_total_score'
},
{
label
:
'及格分数'
,
prop
:
'pass_score'
},
{
label
:
'更新时间'
,
prop
:
'updated_at'
}
]
}
// 资源出处 tab触发
const
tabChange
=
()
=>
{
appList
.
value
?.
refetch
()
}
const
handleCancel
=
()
=>
{
emit
(
'update:isShowExamDialog'
,
false
)
}
// 保存
const
handleSave
=
()
=>
{
emit
(
'update:isShowExamDialog'
,
false
)
emit
(
'create'
,
multipleSelection
)
}
// 筛选下拉选择tree 视频分类
const
defaultProps
=
{
children
:
'children'
,
label
:
'category_name'
,
value
:
'id'
}
// 刷新
const
typeFilter
=
()
=>
{
appList
.
value
.
refetch
()
}
const
handleSelectionChange
=
(
val
:
any
)
=>
{
multipleSelection
.
value
=
val
}
</
script
>
<
template
>
<el-drawer
:model-value=
"isShowExamDialog"
draggable
:before-close=
"handleCancel"
size=
"60%"
title=
"添加考试"
>
<div
class=
"video-head"
>
<el-tabs
@
tab-change=
"tabChange"
v-model=
"tabValue"
>
<el-tab-pane
label=
"我的资源"
name=
"1"
></el-tab-pane>
<el-tab-pane
label=
"公开资源"
name=
"2"
></el-tab-pane>
</el-tabs>
</div>
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<template
#
filter-type=
"
{ params }">
<el-tree-select
@
change=
"typeFilter"
clearable
:props=
"defaultProps"
v-model=
"params.paper_categories"
:data=
"selectTree"
/>
</
template
>
</AppList>
<div
class=
"btn-box"
style=
"display: flex; justify-content: center"
>
<el-button
type=
"primary"
@
click=
"handleSave"
>
保存
</el-button>
</div>
</el-drawer>
</template>
<
style
lang=
"scss"
>
.card-list
{
display
:
flex
;
flex-direction
:
column
;
}
.card-list-con
{
background
:
#fafafa
;
padding
:
20px
;
display
:
flex
;
flex-wrap
:
wrap
;
}
.video-head
{
position
:
relative
;
.video-head-icon
{
position
:
absolute
;
top
:
0
;
right
:
0
;
font-size
:
30px
;
color
:
#666
;
cursor
:
pointer
;
}
}
.video-tool-btn
{
padding
:
10px
0
30px
0
;
}
</
style
>
src/modules/course/create/components/stepTwoComponents/AddChapterDialog.vue
浏览文件 @
9ed4007c
...
...
@@ -3,7 +3,6 @@ import { createCharacter, editCharacter } from '../../api'
import
type
{
FormInstance
,
FormRules
}
from
'element-plus'
import
{
useMapStore
}
from
'@/stores/map'
const
store
=
useMapStore
()
const
emit
=
defineEmits
<
Emits
>
()
const
ruleFormRef
=
ref
<
FormInstance
>
()
// 封面状态
...
...
@@ -80,7 +79,7 @@ onMounted(() => {
:title=
"isEdit ? '编辑:章' : '新增:章'"
>
<el-form
:model=
"form"
:rules=
"rules"
ref=
"ruleFormRef"
label-width=
"80px"
>
<el-form-item
label=
"章-名称:"
prop=
"
typ
e"
>
<el-form-item
label=
"章-名称:"
prop=
"
nam
e"
>
<el-input
v-model=
"form.name"
></el-input>
</el-form-item>
</el-form>
...
...
src/modules/course/create/components/stepTwoComponents/AddExamDialog.vue
浏览文件 @
9ed4007c
<
script
setup
lang=
"ts"
>
import
{
gatExamList
,
createCharacter
}
from
'../../api'
import
{
use
GetCategoryList
}
from
'@/composables/useGetCategory
List'
import
{
searchExam
,
createCharacter
}
from
'../../api'
import
{
use
QuestionList
}
from
'@/composables/useQuestion
List'
const
appList
=
ref
()
let
{
list
:
selectTree
}
=
use
GetCategory
List
()
let
{
list
:
selectTree
}
=
use
Question
List
()
const
tabValue
=
ref
(
'1'
)
const
multipleSelection
:
any
=
ref
([])
const
emit
=
defineEmits
<
Emits
>
()
const
props
=
defineProps
({
...
...
@@ -16,7 +15,6 @@ const props = defineProps({
type
:
String
,
required
:
true
},
chapterName
:
{
type
:
String
,
required
:
true
...
...
@@ -36,23 +34,28 @@ interface Emits {
}
const
listOptions
=
{
remote
:
{
httpRequest
:
gatExamList
,
httpRequest
:
searchExam
,
beforeRequest
(
params
:
any
)
{
params
.
paper_categories
=
[
params
.
paper_categories
]
return
params
},
callback
(
data
:
any
)
{
return
{
list
:
data
.
data
}
},
params
:
{
tab
:
tabValue
,
project_tag
:
'resourse_ci'
,
id
:
''
,
paper_title
:
''
,
is_all
:
1
,
p
roject_prefix
:
'x1
'
,
signature
:
'UG7wBenexQhiuD2wpCwuxkU0jqcj006d
'
,
timestamp
:
'32322323
'
,
nonce
:
'3232
'
permission
:
tabValue
,
p
aper_type
:
'
'
,
paper_labels
:
'
'
,
paper_category
:
'
'
,
paper_categories
:
'
'
}
},
filters
:
[
{
prop
:
'
classification
'
,
label
:
'类别:'
,
slots
:
'filter-type'
},
{
type
:
'input'
,
prop
:
'paper_
category.nam
e'
,
label
:
'标题:'
}
{
prop
:
'
paper_categories
'
,
label
:
'类别:'
,
slots
:
'filter-type'
},
{
type
:
'input'
,
prop
:
'paper_
titl
e'
,
label
:
'标题:'
}
],
columns
:
[
{
type
:
'selection'
,
fixed
:
'left'
},
...
...
@@ -118,18 +121,20 @@ const typeFilter = () => {
const
handleSelectionChange
=
(
val
:
any
)
=>
{
multipleSelection
.
value
=
val
}
const
title
=
computed
(()
=>
{
return
`添加
${
props
.
btnInfo
.
btn_name
}
`
})
</
script
>
<
template
>
<el-drawer
:model-value=
"isShowExamDialog"
draggable
:before-close=
"handleCancel"
size=
"60%"
:title=
"title"
>
<el-drawer
:model-value=
"isShowExamDialog"
draggable
:before-close=
"handleCancel"
size=
"60%"
:title=
"`添加$
{props.btnInfo.btn_name}`"
>
<div
class=
"video-head"
>
<el-tabs
@
tab-change=
"tabChange"
v-model=
"tabValue"
>
<el-tab-pane
label=
"我的资源"
name=
"1"
></el-tab-pane>
<el-tab-pane
label=
"部门资源"
name=
"2"
></el-tab-pane>
<el-tab-pane
label=
"公开资源"
name=
"3"
></el-tab-pane>
<el-tab-pane
label=
"公开资源"
name=
"2"
></el-tab-pane>
</el-tabs>
</div>
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
...
...
src/modules/course/create/components/stepTwoComponents/AddLiveDialog.vue
浏览文件 @
9ed4007c
...
...
@@ -17,11 +17,12 @@ interface IliveList {
let
liveList
=
ref
<
IliveList
[]
>
([])
// 封面状态
const
form
=
reactive
({
name
:
''
let
form
=
reactive
({
name
:
''
,
resource_id
:
''
})
const
rules
=
reactive
<
FormRules
>
({
name
:
[{
required
:
true
,
message
:
'请输入
直播
名称'
,
trigger
:
'change'
}]
name
:
[{
required
:
true
,
message
:
'请输入
章节
名称'
,
trigger
:
'change'
}]
})
const
props
=
defineProps
({
isShowLiveDialog
:
{
...
...
@@ -60,8 +61,7 @@ const handleConfirm = () => {
{
course_id
:
props
.
course_id
,
resource_type
:
props
.
btnInfo
.
resource_type
,
parent_id
:
props
.
chapterID
,
resource_id
:
lecturerValue
.
value
[
0
]
parent_id
:
props
.
chapterID
},
form
)
...
...
@@ -71,9 +71,8 @@ const handleConfirm = () => {
})
}
const
loading
=
ref
(
false
)
// 直播选中的值
const
lecturerValue
=
ref
([]
)
// const lecturerValue = ref(''
)
// 所有被搜索出来的值
const
allLecturers
:
any
=
ref
([])
...
...
@@ -94,19 +93,29 @@ const handleLiveList = (query: string) => {
liveList
.
value
=
[]
}
}
const
changeLive
=
(
val
:
any
)
=>
{
if
(
val
!==
''
)
{
form
.
name
=
allLecturers
.
value
?.
filter
((
item
:
any
)
=>
item
.
id
===
val
)[
0
].
subject
}
else
{
form
.
name
=
''
}
}
</
script
>
<
template
>
<el-dialog
:model-value=
"isShowLiveDialog"
draggable
:before-close=
"handleCancel"
width=
"30%"
title=
"添加直播"
>
<el-form
:model=
"form"
:rules=
"rules"
ref=
"ruleFormRef"
label-width=
"120px"
>
<el-form-item
props=
"lecturerValue"
label=
"直播名称:"
>
{{
form
.
resource_id
}}
<el-form-item
props=
"form.resource_id"
label=
"直播名称:"
>
<el-select
v-model=
"lecturerValue"
v-model=
"form.resource_id"
clearable
filterable
remote
reserve-keyword
placeholder=
"请输入直播名称"
placeholder=
"请输入直播名称或者直播id"
:remote-method=
"handleLiveList"
:loading=
"loading"
style=
"width: 200px"
@
change=
"changeLive"
>
<el-option
v-for=
"item in liveList"
:key=
"item.id"
:label=
"item.subject"
:value=
"item.id"
/>
</el-select>
...
...
src/modules/course/create/components/stepTwoComponents/AddSectionDialog.vue
浏览文件 @
9ed4007c
...
...
@@ -79,10 +79,10 @@ onMounted(() => {
:title=
"props.isEdit ? '编辑:节' : '新增:节'"
>
<el-form
:model=
"form"
:rules=
"rules"
ref=
"ruleFormRef"
label-width=
"80px"
>
<el-form-item
label=
"所属章:"
prop=
"
typ
e"
>
<el-form-item
label=
"所属章:"
prop=
"
chapterNam
e"
>
<p>
{{
chapterName
}}
</p>
</el-form-item>
<el-form-item
label=
"节-名称:"
prop=
"
typ
e"
>
<el-form-item
label=
"节-名称:"
prop=
"
nam
e"
>
<el-input
v-model=
"form.name"
></el-input>
</el-form-item>
</el-form>
...
...
src/modules/course/create/components/stepTwoComponents/AddVideoDialog.vue
浏览文件 @
9ed4007c
...
...
@@ -49,9 +49,6 @@ const defaultProps = {
const
typeFilter
=
()
=>
{
appList
.
value
.
refetch
()
}
const
title
=
computed
(()
=>
{
return
`添加
${
props
.
btnInfo
.
btn_name
}
`
})
const
listOptions
=
computed
(()
=>
{
console
.
log
(
props
.
btnInfo
.
resource_type
)
...
...
@@ -110,7 +107,13 @@ const handleSave = () => {
</
script
>
<
template
>
<el-drawer
:model-value=
"isShowAddDialog"
draggable
:before-close=
"handleCancel"
size=
"60%"
:title=
"title"
>
<el-drawer
:model-value=
"isShowAddDialog"
draggable
:before-close=
"handleCancel"
size=
"60%"
:title=
"`添加$
{props.btnInfo.btn_name}`"
>
<div
class=
"video-head"
>
<el-tabs
@
tab-change=
"tabChange"
v-model=
"tabValue"
>
<el-tab-pane
label=
"我的资源"
name=
"1"
></el-tab-pane>
...
...
src/modules/course/create/components/stepTwoComponents/CardListItem.vue
浏览文件 @
9ed4007c
...
...
@@ -10,9 +10,9 @@ const props: any = defineProps<{ data: object; tabIndex: string }>()
<div
class=
"cover-img"
:style=
"`background-image:url($
{props.data.cover})`">
</div>
<div
class=
"tool-pop-btn"
>
<div
style=
"min-width: 100%"
>
<router-link
v-if=
"props.data.auth_edit"
:to=
"`/resource/video/update?id=$
{props.data.id}`">
<
!--
<
router-link
v-if=
"props.data.auth_edit"
:to=
"`/resource/video/update?id=$
{props.data.id}`">
<div
class=
"edit-btn"
>
编辑
</div>
</router-link>
</router-link>
-->
</div>
<div
style=
"min-width: 100%"
>
<router-link
v-if=
"props.data.auth_view"
:to=
"`/resource/video/view?id=$
{props.data.id}`">
...
...
src/modules/course/create/views/StepTwo.vue
浏览文件 @
9ed4007c
<
script
lang=
"ts"
setup
>
import
{
Plus
}
from
'@element-plus/icons-vue'
import
{
ElMessage
}
from
'element-plus'
import
{
getCharacter
,
delCharacter
,
getVideoDetails
,
getCourseWareDetails
,
getLessonDetails
,
dragChapterList
,
getOtherDetails
}
from
'../api'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
getCharacter
,
delCharacter
,
getVideoDetails
,
dragChapterList
}
from
'../api'
import
AddSectionDialog
from
'../components/stepTwoComponents/AddSectionDialog.vue'
import
AddLiveDialog
from
'../components/stepTwoComponents/AddLiveDialog.vue'
import
AddVideoDialog
from
'../components/stepTwoComponents/AddVideoDialog.vue'
...
...
@@ -34,9 +24,6 @@ const chapterID = ref('')
const
btnInfo
=
ref
({})
// 按钮信息
const
isEdit
=
ref
(
false
)
const
videoUrl
=
ref
(
''
)
// const courseUrl = ref('')
// const lessonPlanUrl = ref('')
const
otherUrl
=
ref
(
''
)
const
btnList
=
[
{
btn_name
:
'视频'
,
...
...
@@ -84,7 +71,6 @@ const handleChapterList = () => {
// 新增章节
const
handleAddChapter
=
()
=>
{
isShowDialog
.
value
=
true
console
.
log
(
isShowDialog
.
value
)
isEdit
.
value
=
false
}
// 页面刷新
...
...
@@ -93,10 +79,8 @@ const handleFresh = () => {
}
// 添加小节
const
handleAddSection
=
(
node
:
any
)
=>
{
console
.
log
(
node
,
'oooo'
)
chapterName
.
value
=
node
.
label
chapterID
.
value
=
node
.
key
console
.
log
(
isShowSectionDialog
.
value
)
isShowSectionDialog
.
value
=
true
}
//编辑章节
...
...
@@ -113,11 +97,13 @@ const handleEdit = (node: any) => {
}
// 删除章节
const
handleDel
=
(
node
:
any
)
=>
{
ElMessageBox
.
confirm
(
'确定要删除吗?'
,
'提示'
).
then
(()
=>
{
const
params
=
{
id
:
node
.
key
,
course_id
:
id
}
delCharacter
(
params
).
then
(()
=>
{
ElMessage
.
success
(
'删除成功'
)
handleFresh
()
})
})
}
// 添加
...
...
@@ -138,9 +124,7 @@ const handleAddDialog = (node: any, item: any) => {
isShowExamDialog
.
value
=
true
}
}
//查阅
const
handleConsult
=
(
node
:
any
)
=>
{
console
.
log
(
node
.
data
.
resource_type
,
'000'
)
// 视频
...
...
@@ -153,25 +137,10 @@ const handleConsult = (node: any) => {
}
// 下载
const
handleDownload
=
(
node
:
any
)
=>
{
if
(
node
.
data
.
resource_type
===
'10'
)
{
// 课件
getCourseWareDetails
({
id
:
node
.
data
.
resource_id
}).
then
((
res
:
any
)
=>
{
otherUrl
.
value
=
res
.
data
.
url
window
.
open
(
otherUrl
.
value
)
})
}
else
if
(
node
.
data
.
resource_type
===
'11'
)
{
//教案
getLessonDetails
({
id
:
node
.
data
.
resource_id
}).
then
(
res
=>
{
otherUrl
.
value
=
res
.
data
.
url
window
.
open
(
otherUrl
.
value
)
})
}
else
if
(
node
.
data
.
resource_type
===
'4'
)
{
getOtherDetails
({
id
:
node
.
data
.
resource_id
}).
then
(
res
=>
{
otherUrl
.
value
=
res
.
data
.
url
window
.
open
(
otherUrl
.
value
)
})
}
console
.
log
(
node
.
data
.
resource
.
can_view
)
window
.
open
(
node
.
data
.
resource
.
url
)
}
//拖拽
const
allowDrop
=
(
draggingNode
:
any
,
dropNode
:
any
,
type
:
any
)
=>
{
console
.
log
(
draggingNode
.
data
,
dropNode
,
type
)
if
(
draggingNode
.
data
.
depth
===
dropNode
.
data
.
depth
)
{
...
...
@@ -185,6 +154,7 @@ const allowDrop = (draggingNode: any, dropNode: any, type: any) => {
return
false
}
}
//拖拽列表
const
handleDrop
=
(
startNode
:
any
,
endNode
:
any
,
position
:
any
,
event
:
any
)
=>
{
console
.
log
(
startNode
,
endNode
,
position
,
event
)
const
params
=
{
...
...
@@ -225,12 +195,14 @@ const handleDrop = (startNode: any, endNode: any, position: any, event: any) =>
class=
"btn_edit"
v-if=
"data.depth === '3' && node.data.resource_type === '2'"
@
click=
"handleConsult(node)"
:disabled=
"node.data.resource.can_view !== true"
>
查阅
</el-link
>
<el-link
class=
"btn_edit"
v-if=
"data.depth === '3' && node.data.resource_type !== '2' && node.data.resource_type !== '6'"
@
click=
"handleDownload(node)"
:disabled=
"node.data.resource.can_view !== true"
>
下载
</el-link
>
...
...
src/modules/resource/video/components/CardListItem.vue
浏览文件 @
9ed4007c
...
...
@@ -9,14 +9,14 @@ const props: any = defineProps<{ data: object; tabIndex: string }>()
<div
class=
"cover-img"
:style=
"`background-image:url($
{props.data.cover})`">
</div>
<div
class=
"tool-pop-btn"
>
<div
style=
"min-width: 100%"
>
<router-link
v-if=
"props.data.auth_
view"
:to=
"`/resource/video/view
?id=$
{props.data.id}`">
<div
class=
"
view-btn"
>
查看
</div>
<router-link
v-if=
"props.data.auth_
edit"
:to=
"`/resource/video/update
?id=$
{props.data.id}`">
<div
class=
"
edit-btn"
>
编辑
</div>
</router-link>
</div>
<div
style=
"min-width: 100%"
>
<
!--
<router-link
v-if=
"props.data.auth_view"
:to=
"`/resource/video/view?id=$
{props.data.id}`"> --
>
<div
class=
"view-btn"
>
选择
</div>
<
!--
</router-link>
--
>
<
router-link
v-if=
"props.data.auth_view"
:to=
"`/resource/video/view?id=$
{props.data.id}`"
>
<div
class=
"view-btn"
>
查看
</div>
<
/router-link
>
</div>
</div>
</div>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论