1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* 视频课程分类编辑
* $Id: course_category_edit_input.inc,v 1.1 2015/10/08 11:18:53 wanggb Exp $
* @author lixq
* @access public
* @package manager.templates
**/
?>
<div id="change">
<p class="edit_title">视频课程分类编辑</p>
<form id="course_category_edit" action="course_category_edit_result.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?=$id?>"/>
<input type="hidden" name="parent_id" value="<?=$parent_id?>"/>
<input type="hidden" name="action_type" value="<?=$action_type?>"/>
<div class="edit_content">
<p><b>一级分类名称:</b><el-select v-model="parent_id" size="small">
<el-option
v-for="item in category_list"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select></p>
<p><b>分类名称:</b><el-input v-model="title" name="title" class="input_200"></el-input></p>
<br/>
<br/>
<el-button type="primary" @click="edit()" class="edit_btn" style="margin-left: 120px;">编辑</el-button>
<el-button type="primary" @click="back()" class="edit_btn">返回</el-button>
<br/><br/>
</div>
</form>
</div>
<script type="text/javascript">
new Vue({
el:'#change',
data:{
title:'<?=$title?>',
parent_id:<?=$parent_id?>,
category_list:<?=json_encode($category_list)?>
},
methods:{
back:function(){
window.history.go(-1);
},
edit:function(){
if(!this.title){
this.$message({
type: 'error',
message: '请输入分类名称!'
});
return;
}
$("input[name='parent_id']").val(this.parent_id);
$('#course_category_edit').submit();
}
}
})
</script>