-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
900 lines (876 loc) · 27 KB
/
index.html
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>路由</title>
<script src='../js/vue.min.js'></script>
<script src='../js/vue-router.js'></script>
<script src='../js/jquery-3.0.0.min.js'></script>
<!-- 离线引入element,icon加载不出来 -->
<script src='../js/element-ui.js'></script>
<link rel="stylesheet" href="../css/element-ui.css">
<!-- 在线引入element -->
<!-- <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">
<script src="https://unpkg.com/element-ui/lib/index.js"></script> -->
<!--日期格式化库-->
<script src='../js/moment.min.js'></script>
<style>
body{
margin:0;
padding:0;
}
header.header{
width: 100%;
height: 80px;
background: #c6c6c6;
padding:0;
margin: 0px;
line-height: 80px;
}
.header img{
display: inline-block;
float: left;
width: 80px;
height: 80px;
margin-left: 20px;
}
.header .exit{
font-size: 18px;
cursor: pointer;
float: right;
color: #eee;
}
hr,.header h2{
margin: 0px;
}
.leftNav{
min-height: 600px;
}
.leftNav a {
text-decoration: none;
font-size: 18px;
color:#bfcbd9;
border:none;
}
.content {
margin-left: 125px;
}
</style>
</head>
<body>
<header class="header">
<img src="../images/sc/hhtc_xh.png" alt="校徽">
<h2>怀化学院校园选课系统<span class="exit">退出</span></h2>
</header>
<hr>
<div id="app">
<el-row class="tac">
<!--左侧导航-->
<el-col :span="4" class='leftNav'>
<el-menu default-active="2" class="el-menu-vertical-demo">
<el-menu-item index="1">
<i class="el-icon-message"></i>
<router-link to='/student/info'>学生管理</router-link>
</el-menu-item>
<el-menu-item index="2">
<i class="el-icon-setting"></i>
<router-link to='/course/info'>课程管理</router-link>
</el-menu-item>
<el-menu-item index="3">
<i class="el-icon-picture"></i>
<router-link to='/clazz/info'>班级管理</router-link>
</el-menu-item>
<el-menu-item index="4">
<i class="el-icon-star-on"></i>
<router-link to='/sc/info'>选课管理</router-link>
</el-menu-item>
</el-menu>
</el-col>
<!--左侧导航结束-->
<!--右侧内容-->
<el-col :span="20">
<router-view></router-view>
</el-col>
</el-row>
</div>
<script>
//jquery 设定左侧栏目高度为浏览器可视区域高度
$(function(){
$('.leftNav').height($(window).height());
$('.leftNav').css('background','lightgrey');
})
</script>
<script>
//1. 自定义组件
//学生组件
var Student = {
template:`
<div class='container'>
<el-tabs v-model="activeName" @tab-click="handleTab">
<el-tab-pane label="学生信息管理" name="info"></el-tab-pane>
</el-tabs>
<router-view></router-view>
</div>
`,
data:function(){
return {
title:'学生管理',
activeName: 'info'
}
},
methods:{
handleTab:function(tab,event){
var path = '/student/'+this.activeName;
this.$router.push({ path: path });
}
}
};
//学生档案模块
var StudentInfo={
template:`
<div style='padding:0 20px'>
<el-button type="text" @click='handleSingleImport'>单个录入</el-button>
<el-button type="text">批量导入</el-button>
<el-table
:data="studentInfo"
style="width: 100%">
<el-table-column prop="name" label="姓名"></el-table-column>
<el-table-column prop="gender" label="性别"></el-table-column>
<el-table-column prop="birth" :formatter='dateFormat' label="生日"></el-table-column>
<el-table-column prop="class.name" label="班级编号"></el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button
size="small"
icon="edit"
@click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button
size="small"
type="danger"
icon="delete"
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible">
<el-form :model="form">
<el-form-item label="姓名" :label-width='labelWidth' >
<el-input v-model="form.name" auto-complete="off"></el-input>
</el-form-item>
<el-form-item label="密码" :label-width='labelWidth'>
<el-input v-model="form.password" auto-complete="off"></el-input>
</el-form-item>
<el-form-item label="性别" :label-width='labelWidth'>
<el-radio class="radio" v-model="form.gender" label="男">男</el-radio>
<el-radio class="radio" v-model="form.gender" label="女">女</el-radio>
</el-form-item>
<el-form-item label="生日" :label-width='labelWidth'>
<el-date-picker
v-model="form.birth"
type="date"
placeholder="选择日期"
:picker-options="pickerOptions0">
</el-date-picker>
</el-form-item>
<el-form-item label="所在班级" :label-width='labelWidth'>
<el-select v-model="form.class_id" placeholder="请选择">
<el-option
v-for="item in classes"
:key="item.id"
:label="item.name"
:value='item.id'>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="handleSubmit">确 定</el-button>
</div>
</el-dialog>
</div>
`,
methods:{
dateFormat:function(row, column) {
var date = row[column.property];
if (date == undefined) {
return "";
}
return moment(date).format("YYYY-MM-DD");
},
handleSingleImport:function(){
this.dialogFormVisible = true;
this.dialogTitle = '录入学生信息';
this.form = {gender:'女'}
},
handleSubmit:function(){
this.dialogFormVisible = false;
var vm = this;
var url = 'http://127.0.0.1:3000/student/update';
if(!vm.form.id){
url = 'http://127.0.0.1:3000/student/save'
}
$.post(url,this.form,function(data){
if(data.affectedRows>0){
vm.$message({
type: 'success',
message: '操作成功!'
});
var url ='http://127.0.0.1:3000/student/findAll';
$.getJSON(url,function(data){
vm.studentInfo = data;
});
}
})
},
handleDelete:function(index,row){
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var vm = this;
var url = 'http://127.0.0.1:3000/student/batchDelete'
$.post(url,{
ids:JSON.stringify([row.id])
},function(data){
if(data.affectedRows>0){
vm.$message({
type: 'success',
message: '删除成功!'
});
}
});
//刷新studentInfo
var url ='http://127.0.0.1:3000/student/findAll';
var vm = this;
$.getJSON(url,function(data){
vm.studentInfo = data;
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
handleEdit:function(index,row){
this.dialogFormVisible = true;
this.dialogTitle = '修改学生信息';
this.form = row;
//如果直接在v-model中绑定class_id失效,使用如下方式可以解决
this.form.classId = row.class.id;
}
},
created:function(){
//加载学生的数据
var url ='http://127.0.0.1:3000/student/findAll';
var vm = this;
$.getJSON(url,function(data){
vm.studentInfo = data;
});
$.getJSON('http://127.0.0.1:3000/clazz/findAll',function(data){
vm.classes = data;
});
},
data:function(){
return {
studentInfo:[],
dialogTitle:'',
dialogFormVisible:false,
labelWidth:'70px',
classes:[],
form:{},
pickerOptions0: {
disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7;
}
}
}
}
};
var StudentGrade = {
template:`
<p>学生成绩管理模块</p>
`,
data:function(){
return {
}
}
}
//班级管理模块
var Clazz = {
template:`
<div class='container'>
<el-tabs v-model="activeName" @tab-click="handleTab">
<el-tab-pane label="班级信息" name="info"></el-tab-pane>
</el-tabs>
<router-view></router-view>
</div>
`,
data:function(){
return {
activeName: 'info'
}
},
methods:{
handleTab:function(tab,event){
var path = '/clazz/'+this.activeName;
this.$router.push({ path: path });
}
}
}
// --------------------------------------------------------
//班级管理模块
var Clazz = {
template:`
<div class='container'>
<el-tabs v-model="activeName" @tab-click="handleTab">
<el-tab-pane label="班级信息" name="info"></el-tab-pane>
</el-tabs>
<router-view></router-view>
</div>
`,
data:function(){
return {
activeName: 'info'
}
},
methods:{
handleTab:function(tab,event){
var path = '/clazz/'+this.activeName;
this.$router.push({ path: path });
}
}
}
//班级信息管理模块
var ClassInfo = {
template:`
<div style='padding:0 20px'>
<el-button type="text" @click='handleSingleImport'>单个录入</el-button>
<el-button type="text">批量导入</el-button>
<el-table
:data="clazzInfo"
style="width: 100%">
<el-table-column prop="name" label="班级名称"></el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-button
size="small"
icon="edit"
@click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button
size="small"
type="danger"
icon="delete"
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible">
<el-form :model="form">
<el-form-item label="姓名" >
<el-input v-model="form.name" auto-complete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="handleSubmit">确 定</el-button>
</div>
</el-dialog>
</div>
`,
data:function(){
return {
clazzInfo:[],
dialogTitle:'',
dialogFormVisible:false,
form:{}
}
},
created:function(){
var vm = this;
$.getJSON('http://127.0.0.1:3000/clazz/findAll',function(data){
vm.clazzInfo = data;
});
},
methods:{
handleSingleImport:function(){
this.dialogFormVisible = true;
this.dialogTitle = '录入班级信息';
this.form = {};
},
handleSubmit:function(){
this.dialogFormVisible = false;
var vm = this;
var url = 'http://127.0.0.1:3000/clazz/update';
if(!vm.form.id){
url = 'http://127.0.0.1:3000/clazz/save'
}
$.post(url,this.form,function(data){
if(data.affectedRows>0){
vm.$message({
type: 'success',
message: '操作成功!'
});
var url ='http://127.0.0.1:3000/clazz/findAll';
$.getJSON(url,function(data){
vm.clazzInfo = data;
});
}
})
},
handleDelete:function(index,row){
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var vm = this;
var url = 'http://127.0.0.1:3000/clazz/batchDelete'
$.post(url,{
ids:JSON.stringify([row.id])
},function(data){
if(data.affectedRows>0){
vm.$message({
type: 'success',
message: '删除成功!'
});
}
});
//刷新studentInfo
var url ='http://127.0.0.1:3000/clazz/findAll';
var vm = this;
$.getJSON(url,function(data){
vm.clazzInfo = data;
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
handleEdit:function(index,row){
this.dialogFormVisible = true;
this.dialogTitle = '修改班级信息';
this.form = row;
}
}
}
//------------------------课程组件------------------------
var Course = {
template:`
<div>
<el-tabs v-model="activeName" @tab-click="handleTab">
<el-tab-pane label="课程信息管理" name="info"></el-tab-pane>
</el-tabs>
<router-view></router-view>
</div>
`,
data:function(){
return {
title:'课程管理',
activeName:'info'
}
},
methods:{
handleTab:function(){
var path = '/course/'+this.activeName;
this.$router.push({ path: path });
}
}
}
//课程信息
var CourseInfo = {
template:`
<div style='padding:0 20px'>
<el-button type="text" @click='handleSingleImport'>单个录入</el-button>
<el-button type="text">批量导入</el-button>
<el-table
:data="courseInfo"
style="width: 100%">
<el-table-column prop="name" label="课程名称"></el-table-column>
<el-table-column prop="credit" label="学分"></el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-button
size="small"
icon="edit"
@click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button
size="small"
type="danger"
icon="delete"
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible">
<el-form :model="form">
<el-form-item label="课程名称" >
<el-input v-model="form.name" auto-complete="off"></el-input>
</el-form-item>
<el-form-item label="学分" >
<el-input v-model="form.credit" auto-complete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="handleSubmit">确 定</el-button>
</div>
</el-dialog>
</div>
`,
data:function(){
return {
courseInfo:[],
dialogTitle:'',
dialogFormVisible:false,
form:{}
}
},
created:function(){
var vm = this;
$.getJSON('http://127.0.0.1:3000/course/findAll',function(data){
vm.courseInfo = data;
});
},
methods:{
handleSingleImport:function(){
this.dialogFormVisible = true;
this.dialogTitle = '添加课程信息';
this.form = {};
},
handleSubmit:function(){
this.dialogFormVisible = false;
var vm = this;
var url = 'http://127.0.0.1:3000/course/update';
if(!vm.form.id){
url = 'http://127.0.0.1:3000/course/save'
}
$.post(url,this.form,function(data){
if(data.affectedRows>0){
vm.$message({
type: 'success',
message: '操作成功!'
});
var url ='http://127.0.0.1:3000/course/findAll';
$.getJSON(url,function(data){
vm.courseInfo = data;
});
}
})
},
handleDelete:function(index,row){
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var vm = this;
var url = 'http://127.0.0.1:3000/course/batchDelete'
$.post(url,{
ids:JSON.stringify([row.id])
},function(data){
if(data.affectedRows>0){
vm.$message({
type: 'success',
message: '删除成功!'
});
}
});
//刷新studentInfo
var url ='http://127.0.0.1:3000/course/findAll';
var vm = this;
$.getJSON(url,function(data){
vm.courseInfo = data;
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
handleEdit:function(index,row){
this.dialogFormVisible = true;
this.dialogTitle = '修改课程信息';
this.form = row;
}
}
}
//------------------------选课组件------------------------
/*var StuCourse={
template:`
<div>
<h2>学生信息管理</h2>
<p>测试中</p>
<p>{{msg}}</p>
</div>
`,
data:function(){
return {
msg:'this is stuCourse data'
}
}
};*/
var StudentCourse = {
template:`
<div>
<el-tabs v-model="activeName" @tab-click="handleTab">
<el-tab-pane label="选课列表" name="info"></el-tab-pane>
<el-tab-pane label="个人选课" name="selfCourse"></el-tab-pane>
</el-tabs>
<router-view></router-view>
</div>
`,
data:function(){
return {
activeName:'info'
}
},
methods:{
handleTab:function(){
var path = '/sc/'+this.activeName;
this.$router.push({ path: path });
}
}
}
//课程信息
var SCList = {
template:`
<div style='padding:0 20px'>
<el-row>
<el-col :span="6">
<el-input
placeholder="请输入关键字"
icon="search"
v-model="keywords"
:on-icon-click="handleIconClick">
</el-input>
</el-col>
</el-row>
<br />
<el-table
:data="scList"
style="width: 100%">
<el-table-column prop="s.name" label="姓名"></el-table-column>
<el-table-column prop="c.name" label="班级"></el-table-column>
<el-table-column prop="c.credit" label="学分"></el-table-column>
<el-table-column prop="sc.grade" label="成绩"></el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-button
size="small"
type="info"
icon='star-on'
@click="handleEdit(scope.$index, scope.row)">分数</el-button>
<el-button
size="small"
type="danger"
icon="delete"
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible">
<el-form :model="form">
<el-form-item label="学生姓名" >
{{student.name}}
</el-form-item>
<el-form-item label="课程名称" >
{{course.name}}
</el-form-item>
<el-form-item label="分数" label-width='50px' >
<el-input v-model="sc.grade" auto-complete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="handleSubmit">确 定</el-button>
</div>
</el-dialog>
</div>
`,
data:function(){
return {
scList:[],
dialogTitle:'',
dialogFormVisible:false,
form:{},
student:{},
course:{},
sc:{},
keywords:''
}
},
created:function(){
var vm = this;
$.getJSON('http://127.0.0.1:3000/sc/findSelectedCourse',function(data){
vm.scList = data;
});
},
methods:{
handleSubmit:function(){
this.dialogFormVisible = false;
var vm = this;
var url= 'http://127.0.0.1:3000/sc/mark';
$.getJSON(url,{id:this.sc.id,grade:this.sc.grade},function(data){
if(data.affectedRows>0){
vm.$message({
type: 'success',
message: '操作成功!'
});
$.getJSON('http://127.0.0.1:3000/sc/findSelectedCourse',function(data){
vm.scList = data;
});
}
});
},
handleEdit:function(index,row){
this.dialogFormVisible = true;
this.dialogTitle = '设置成绩';
this.student = row.s;
this.course= row.c;
this.sc = row.sc;
},
handleDelete:function(index,row){
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var vm = this;
var url = 'http://127.0.0.1:3000/sc/cancelCourse'
$.get(url,{
studentId:row.s.id,
courseId:row.c.id
},function(data){
if(data.affectedRows>0){
vm.$message({
type: 'success',
message: '删除成功!'
});
}
});
//刷新studentInfo
var url ='http://127.0.0.1:3000/sc/findSelectedCourse';
$.getJSON(url,function(data){
vm.scList = data;
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
handleIconClick:function(){
}
}
}
//个人选课
var SelfCourse = {
template:`
<div style='padding:0 20px'>
<el-table
:data="courseInfo"
style="width: 100%">
<el-table-column prop="name" label="课程名称"></el-table-column>
<el-table-column prop="credit" label="学分"></el-table-column>
<el-table-column prop="" label="报名人数"></el-table-column>
<el-table-column prop="" label="剩余名额"></el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-button
size="small"
icon="edit"
type="info"
:disabled="false"
@click="handleEdit(scope.$index, scope.row)">选修</el-button>
</template>
</el-table-column>
</el-table>
</div>
`,
data:function(){
return {
courseInfo:[],
dialogTitle:'',
dialogFormVisible:false,
form:{}
}
},
created:function(){
var vm = this;
$.getJSON('http://127.0.0.1:3000/course/findAll',function(data){
vm.courseInfo = data;
});
},
methods:{
handleEdit:function(index,row){
this.dialogFormVisible = true;
this.dialogTitle = '修改课程信息';
this.form = row;
}
}
}
//2. 创建vuerouter实例对象
var router = new VueRouter({
routes:[{
path:'/student',
component:Student,
children:[{
path:'info',
component:StudentInfo
},{
path:'grade',
component:StudentGrade
},{
path:'role',
component:StudentGrade
}]
},{
path:'/course',
component:Course,
children:[{
path:'info',
component:CourseInfo
},{
path:'test',
component:CourseInfo
}]
},{
path:'/clazz',
component:Clazz,
children:[{
path:'info',
component:ClassInfo
},{
path:'test',
component:ClassInfo
}]
},/*{
path:'/sc',
component:StuCourse
}*/{
path:'/sc',
component:StudentCourse,
children:[{
path:'info',
component:SCList
},{
path:'selfCourse',
component:SelfCourse
}]
}]
});
//3.在vue中使用router
new Vue({
el:'#app',
router:router
});
</script>
</body>
</html>