Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
c7083fc6
提交
c7083fc6
authored
7月 05, 2022
作者:
matian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改试卷添加
上级
1824e960
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
81 行增加
和
41 行删除
+81
-41
AppList.vue
src/components/base/AppList.vue
+1
-1
AddExam.vue
...es/course/create/components/stepOneComponents/AddExam.vue
+61
-22
AddExamDialog.vue
...rse/create/components/stepOneComponents/AddExamDialog.vue
+5
-10
AddExamDialog.vue
...rse/create/components/stepTwoComponents/AddExamDialog.vue
+1
-7
StepOne.vue
src/modules/course/create/views/StepOne.vue
+9
-1
StepTwo.vue
src/modules/course/create/views/StepTwo.vue
+4
-0
没有找到文件。
src/components/base/AppList.vue
浏览文件 @
c7083fc6
...
@@ -16,7 +16,7 @@ const props = withDefaults(
...
@@ -16,7 +16,7 @@ const props = withDefaults(
columns
?:
any
[]
columns
?:
any
[]
data
?:
any
[]
data
?:
any
[]
hasPagination
?:
boolean
hasPagination
?:
boolean
limit
?:
number
,
limit
?:
number
}
>
(),
}
>
(),
{
{
hasPagination
:
true
,
hasPagination
:
true
,
...
...
src/modules/course/create/components/stepOneComponents/AddExam.vue
浏览文件 @
c7083fc6
/* eslint-disable vue/no-mutating-props */
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ElMessage
}
from
'element-plus'
import
AddExamDialog
from
'./AddExamDialog.vue'
import
AddExamDialog
from
'./AddExamDialog.vue'
const
emit
=
defineEmits
<
Emits
>
()
interface
Emits
{
(
e
:
'change'
,
examList
:
any
):
void
}
const
props
=
defineProps
({
const
props
=
defineProps
({
data
:
{
data
:
{
type
:
Array
type
:
Array
,
required
:
true
}
}
})
})
const
emit
=
defineEmits
([
'change'
])
const
examList
:
any
=
ref
([])
console
.
log
(
props
.
data
.
length
,
'length'
)
// if (props.data.length > 0) {
// examList.value = [...props.data]
// } else {
// examList.value = []
// }
watch
(
()
=>
props
.
data
,
value
=>
{
if
(
value
?.
length
>
0
)
{
examList
.
value
=
[...
props
.
data
]
}
else
{
examList
.
value
=
[]
}
},
{
immediate
:
true
}
)
const
isShowExamDialog
=
ref
(
false
)
const
listOptions
=
computed
(()
=>
{
const
listOptions
=
computed
(()
=>
{
return
{
return
{
data
:
examList
.
value
,
columns
:
[
columns
:
[
{
label
:
'试卷名称'
,
prop
:
'paper_title'
,
align
:
'center'
},
{
label
:
'试卷名称'
,
prop
:
'paper_title'
,
minWidth
:
200
},
{
{
label
:
'组卷模式'
,
label
:
'组卷模式'
,
prop
:
'paper_type'
,
prop
:
'paper_type'
,
align
:
'center'
,
computed
:
(
row
:
any
)
=>
{
computed
({
row
}:
any
)
{
return
row
.
row
.
paper_type
===
1
?
'选题组卷'
:
'自动组卷'
const
json
=
{
1
:
'选题组卷'
,
2
:
'自动组卷'
}
return
json
[
parseInt
(
row
.
paper_type
)]
}
}
},
},
{
{
label
:
'试卷用途'
,
label
:
'试卷用途'
,
prop
:
'paper_uses'
,
prop
:
'paper_uses'
,
align
:
'center'
,
computed
:
(
row
:
any
)
=>
{
computed
({
row
}:
any
)
{
if
(
row
.
row
.
paper_type
===
1
)
{
const
json
=
{
1
:
'考试'
,
2
:
'课后作业'
,
3
:
'课程测试'
}
return
'考试'
return
json
[
parseInt
(
row
.
paper_uses
)]
}
else
if
(
row
.
row
.
paper_type
===
2
)
{
return
'课后作业'
}
else
if
(
row
.
row
.
paper_type
===
3
)
{
return
'课程测试'
}
}
}
},
},
{
label
:
'总分'
,
prop
:
'paper_total_score'
,
align
:
'center'
},
{
label
:
'总分'
,
prop
:
'paper_total_score'
,
align
:
'center'
},
{
label
:
'及格分数'
,
prop
:
'pass_score'
,
align
:
'center'
},
{
label
:
'及格分数'
,
prop
:
'pass_score'
,
align
:
'center'
},
{
label
:
'操作'
,
slots
:
'table-operate'
,
align
:
'center'
}
{
label
:
'操作'
,
slots
:
'table-operate'
,
align
:
'center'
}
],
]
data
:
props
.
data
}
}
})
})
const
addExam
=
ref
([])
const
isShowExamDialog
=
ref
(
false
)
// // 删除考试
// // 删除考试
const
removeLectuter
=
(
id
:
string
)
=>
{
const
removeLectuter
=
(
id
:
string
)
=>
{
const
index
=
addExam
.
value
.
findIndex
((
ids
:
string
)
=>
ids
===
id
)
const
index
=
examList
.
value
.
findIndex
((
ids
:
string
)
=>
ids
===
id
)
addExam
.
value
.
splice
(
index
,
1
)
examList
.
value
.
splice
(
index
,
1
)
handleAddExam
(
''
)
}
}
const
handleAddExam
=
(
val
:
any
)
=>
{
const
handleAddExam
=
(
val
:
any
)
=>
{
addExam
.
value
=
val
console
.
log
(
props
.
data
,
'pppp'
)
emit
(
'change'
,
val
)
let
flag
=
false
examList
.
value
.
forEach
((
item
:
any
)
=>
{
val
.
value
.
forEach
((
it
:
any
)
=>
{
if
(
item
.
id
===
it
.
id
)
{
ElMessage
.
warning
(
'不能重复添加同一张试卷'
)
flag
=
true
return
false
}
})
})
if
(
!
flag
)
{
examList
.
value
=
[...
val
.
value
,
...
examList
.
value
]
emit
(
'change'
,
examList
.
value
)
}
}
}
</
script
>
</
script
>
...
...
src/modules/course/create/components/stepOneComponents/AddExamDialog.vue
浏览文件 @
c7083fc6
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
searchExam
}
from
'../../api'
import
{
searchExam
}
from
'../../api'
import
{
useQuestionList
}
from
'@/composables/useQuestionList'
import
{
useQuestionList
}
from
'@/composables/useQuestionList'
const
appList
=
ref
()
const
appList
=
ref
()
let
{
list
:
selectTree
}
=
useQuestionList
()
let
{
list
:
selectTree
}
=
useQuestionList
()
const
tabValue
=
ref
(
'1'
)
const
tabValue
=
ref
(
'1'
)
...
@@ -28,17 +29,11 @@ const listOptions = {
...
@@ -28,17 +29,11 @@ const listOptions = {
},
},
params
:
{
params
:
{
project_tag
:
'resourse_ci'
,
project_tag
:
'resourse_ci'
,
id
:
''
,
permission
:
tabValue
paper_title
:
''
,
permission
:
tabValue
,
paper_type
:
''
,
paper_labels
:
''
,
paper_category
:
''
,
paper_categories
:
''
}
}
},
},
filters
:
[
filters
:
[
{
prop
:
'
classification
'
,
label
:
'类别:'
,
slots
:
'filter-type'
},
{
prop
:
'
paper_categories
'
,
label
:
'类别:'
,
slots
:
'filter-type'
},
{
type
:
'input'
,
prop
:
'paper_title'
,
label
:
'标题:'
}
{
type
:
'input'
,
prop
:
'paper_title'
,
label
:
'标题:'
}
],
],
columns
:
[
columns
:
[
...
@@ -92,12 +87,12 @@ const typeFilter = () => {
...
@@ -92,12 +87,12 @@ const typeFilter = () => {
appList
.
value
.
refetch
()
appList
.
value
.
refetch
()
}
}
const
handleSelectionChange
=
(
val
:
any
)
=>
{
const
handleSelectionChange
=
(
val
:
any
)
=>
{
multipleSelection
.
value
=
val
multipleSelection
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
val
))
}
}
</
script
>
</
script
>
<
template
>
<
template
>
<el-drawer
:model-value=
"isShowExamDialog"
draggable
:before-close=
"handleCancel"
size=
"60%"
title=
"添加考试"
>
<el-drawer
:model-value=
"isShowExamDialog"
:before-close=
"handleCancel"
size=
"60%"
title=
"添加考试"
>
<div
class=
"video-head"
>
<div
class=
"video-head"
>
<el-tabs
@
tab-change=
"tabChange"
v-model=
"tabValue"
>
<el-tabs
@
tab-change=
"tabChange"
v-model=
"tabValue"
>
<el-tab-pane
label=
"我的资源"
name=
"1"
></el-tab-pane>
<el-tab-pane
label=
"我的资源"
name=
"1"
></el-tab-pane>
...
...
src/modules/course/create/components/stepTwoComponents/AddExamDialog.vue
浏览文件 @
c7083fc6
...
@@ -44,13 +44,7 @@ const listOptions = {
...
@@ -44,13 +44,7 @@ const listOptions = {
},
},
params
:
{
params
:
{
project_tag
:
'resourse_ci'
,
project_tag
:
'resourse_ci'
,
id
:
''
,
permission
:
tabValue
paper_title
:
''
,
permission
:
tabValue
,
paper_type
:
''
,
paper_labels
:
''
,
paper_category
:
''
,
paper_categories
:
''
}
}
},
},
filters
:
[
filters
:
[
...
...
src/modules/course/create/views/StepOne.vue
浏览文件 @
c7083fc6
...
@@ -83,7 +83,14 @@ const changeLecturer = (data: any) => {
...
@@ -83,7 +83,14 @@ const changeLecturer = (data: any) => {
// 选择考试
// 选择考试
const
changeExam
=
(
data
:
any
)
=>
{
const
changeExam
=
(
data
:
any
)
=>
{
form
.
exam_id
=
data
.
toString
()
console
.
log
(
data
,
'data'
)
form
.
exam_id
=
JSON
.
parse
(
JSON
.
stringify
(
data
))
.
map
((
item
:
any
)
=>
{
return
item
.
id
})
.
toString
()
console
.
log
(
form
.
exam_id
,
'data'
)
}
}
// 选择直播
// 选择直播
...
@@ -138,6 +145,7 @@ const createCourseForm = () => {
...
@@ -138,6 +145,7 @@ const createCourseForm = () => {
}
}
})
})
}
else
{
}
else
{
console
.
log
(
form
,
'form'
)
createCourse
(
form
).
then
((
res
:
any
)
=>
{
createCourse
(
form
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
// 操作第二部
// 操作第二部
...
...
src/modules/course/create/views/StepTwo.vue
浏览文件 @
c7083fc6
...
@@ -185,6 +185,7 @@ const handleDrop = (startNode: any, endNode: any, position: any, event: any) =>
...
@@ -185,6 +185,7 @@ const handleDrop = (startNode: any, endNode: any, position: any, event: any) =>
:props=
"defaultProps"
:props=
"defaultProps"
:allow-drop=
"allowDrop"
:allow-drop=
"allowDrop"
@
node-drop=
"handleDrop"
@
node-drop=
"handleDrop"
style=
"min-width: 100%"
>
>
<template
#
default=
"
{ node, data }">
<template
#
default=
"
{ node, data }">
<span
class=
"custom-tree-node"
>
<span
class=
"custom-tree-node"
>
...
@@ -228,6 +229,9 @@ const handleDrop = (startNode: any, endNode: any, position: any, event: any) =>
...
@@ -228,6 +229,9 @@ const handleDrop = (startNode: any, endNode: any, position: any, event: any) =>
</el-tree>
</el-tree>
<div
class=
"btn-box"
style=
"display: flex; justify-content: center"
>
<div
class=
"btn-box"
style=
"display: flex; justify-content: center"
>
<el-button
type=
"primary"
@
click=
"router.push('/course/my')"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"router.push('/course/my')"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"router.push({ path: '/course/update-course', query: { id: id } })"
>
上一步
</el-button
>
</div>
</div>
</AppCard>
</AppCard>
<!-- 添加章 -->
<!-- 添加章 -->
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论