/
*
查询课程计划
*
/
export const findTeachplanList
=
courseid
=
> {
return http
.requestQuickGet(apiUrl+
'
/course/teachplan/list/
'
+courseid)
}
findTeachplan(){
courseApi.findTeachplanList(this.courseid)
.then((res)
=
> {
this.teachplanList
=
[];//清空树
if(res.children){
this.teachplanList
= res.children;
}
})
mounted(){
//课程id
this.courseid
=
this.
$route.
params.courseid;
//课程计划
this.findTeachplan();
}
defaultProps: {
children:
'
children
'
,
label:
'
pname
'
}
<el
‐
dialog title
=
"
添加课程计划
"
:visible.sync
=
"
teachplayFormVisible
"
>
<el
‐
form ref=
"
teachplayForm
"
:model=
"
teachplanActive
"
label
‐
width=
"
140px
"
style
=
"
width:600px;
"
:rules
=
"
teachplanRules
"
>
<el
‐
form
‐
item label=
"
上级结点
"
>
<el
‐
select v
‐
model=
"
teachplanActive.
parentid
"
placeholder=
"
不填表示根结点
"
>
<el
‐
option
v
‐
for=
"
item in teachplanList
"
:key
=
"
item.id
"
:label=
"
item.
pname
"
:value
=
"
item.id
"
>
</el
‐
option>
</el
‐
select>
</el
‐
form
‐
item>
<el
‐
form
‐
item label=
"
章节/课时名称
"
prop
=
"
pname
"
>
<el
‐
input v
‐
model=
"
teachplanActive.
pname
"
auto
‐
complete
=
"
off
"
></el
‐
input>
</el
‐
form
‐
item>
<el
‐
form
‐
item label=
"
课程类型
"
>
<el
‐
radio
‐
group v
‐
model=
"
teachplanActive.
ptype
"
>
<el
‐
radio class
=
"
radio
"
label=
'
1
'
>视频</el
‐
radio>
<el
‐
radio class
=
"
radio
"
label=
'
2
'
>文档</el
‐
radio>
</el
‐
radio
‐
group>
</el
‐
form
‐
item>
<el
‐
form
‐
item label=
"
学习时长(分钟) 请输入数字
"
>
<el
‐
input type
=
"
number
"
v
‐
model=
"
teachplanActive.timelength
"
auto
‐
complete
=
"
off
"
></el
‐
input>
</el
‐
form
‐
item>
<el
‐
form
‐
item label=
"
排序字段
"
>
<el
‐
input v
‐
model=
"
teachplanActive.orderby
"
auto
‐
complete
=
"
off
"
></el
‐
input>
</el
‐
form
‐
item>
<el
‐
form
‐
item label=
"
章节/课时介绍
"
prop
=
"
description
"
>
<el
‐
input type
=
"
textarea
"
v
‐
model=
"
teachplanActive.description
"
></el
‐
input>
</el
‐
form
‐
item>
<el
‐
form
‐
item label=
"
状态
"
prop
=
"
status
"
>
<el
‐
radio
‐
group v
‐
model=
"
teachplanActive.status
"
>
<el
‐
radio class
=
"
radio
"
label=
"
0
"
>未发布</el
‐
radio>
<el
‐
radio class
=
"
radio
"
label=
'
1
'
>已发布</el
‐
radio>
</el
‐
radio
‐
group>
</el
‐
form
‐
item>
<el
‐
form
‐
item >
<el
‐
button type
=
"
primary
"
v
‐
on:click=
"
addTeachplan
"
>提交</el
‐
button>
<el
‐
button type
=
"
primary
"
v
‐
on:click=
"
resetForm
"
>重置</el
‐
button>
</el
‐
form
‐
item>
</el
‐
form>
</el
‐
dialog>
teachplayFormVisible:false,
teachplanRules: {
pname: [
{required: true, message:
'
请输入课程计划名称
'
, trigger:
'
blur
'
}
],
status: [
{required: true, message:
'
请选择状态
'
, trigger:
'
blur
'
}
]
},
teachplanActive:{},
<el
‐
button type
=
"
primary
"
@click=
"
teachplayFormVisible
=
true
"
>添加课程计划</el
‐
button>
//提交课程计划
addTeachplan(){
alert()
},
//重置表单
resetForm(){
this.teachplanActive
=
{}
},
@ApiOperation(
"
添加课程计划
"
)
public ResponseResult addTeachplan(Teachplan teachplan);
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |