-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo11.html
More file actions
71 lines (67 loc) · 2.04 KB
/
demo11.html
File metadata and controls
71 lines (67 loc) · 2.04 KB
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>flowJS demo11</title>
</head>
<body>
</body>
<script type="text/javascript" src="./flowJS.js"></script>
<script type="text/javascript">
flowJS({
init:function(){
console.log('执行 init');
this.setNext('步骤A').setNext('步骤B').setNext('步骤C');
this.next();
},
'步骤A':function(){
console.log('执行 步骤A');
this.nextData({name1:'value1'});
this.flowData({name2:'value2'});
this.next();
},
'步骤B':{
init:function(){
console.log('执行 子步骤B init');
this.setNext('子步骤B1').setNext('子步骤B2').setNext('子步骤B3');
this.next();
},
'子步骤B1':function(){
console.log('执行 子步骤B1');
this.nextData({name3:'value3'});
this.flowData({name4:'value4'});
this.next();
},
'子步骤B2':function(){
console.log('执行 子步骤B2');
console.log('父步骤的上一步 :'+this.parent.getPrev());
console.log('父步骤的步骤名 :'+this.parent.getCurr());
console.log('父步骤的下一步 :'+this.parent.getNext());
console.log('父步骤的数据:');
console.log(this.parent.stepData());
console.log(this.parent.flowData());
console.log('上一步 :'+this.getPrev());
console.log('当前步 :'+this.getCurr());
console.log('下一步 :'+this.getNext());
console.log('当前步的数据:');
console.log(this.stepData());
console.log(this.flowData());
this.next();
},
'子步骤B3':function(){
console.log('执行 子步骤B3');
this.parent.nextData({name5:'value5'});
this.parent.flowData({name6:'value6'});
this.parent.next();
}
},
'步骤C':function(){
console.log('执行 步骤C');
console.log(this.stepData());
console.log(this.flowData());
console.log('当前流程运行的轨迹:');
console.log(flowJS.trace);
}
});
</script>
</html>