-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo12.html
More file actions
73 lines (72 loc) · 1.85 KB
/
demo12.html
File metadata and controls
73 lines (72 loc) · 1.85 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
72
73
<!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 demo12</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', '步骤C']).setNext('步骤D');
this.next();
},
'步骤A':function(){
console.log('执行 步骤A');
this.next();
},
'步骤B':{
init:function(){
console.log('执行 子步骤B init');
this.setNext('子步骤B1').setNext('子步骤B2').setNext('子步骤B3');
this.next();
},
'子步骤B1':function(){
console.log('执行 子步骤B1');
this.next();
},
'子步骤B2':function(){
console.log('执行 子步骤B2');
this.next();
},
'子步骤B3':function(){
var self = this;
console.log('执行 子步骤B3 时间:' + new Date().getSeconds());
setTimeout(function(){
self.parent.next();
}, 2000);
}
},
'步骤C':{
init:function(){
console.log('执行 子步骤C init');
this.setNext('子步骤C1').setNext('子步骤C2').setNext('子步骤C3');
this.next();
},
'子步骤C1':function(){
console.log('执行 子步骤C1');
this.next();
},
'子步骤C2':function(){
console.log('执行 子步骤C2');
this.next();
},
'子步骤C3':function(){
var self = this;
console.log('执行 子步骤C3 时间:' + new Date().getSeconds());
setTimeout(function(){
self.parent.next();
}, 2000);
}
},
'步骤D':function(){
console.log('执行 步骤D 时间:' + new Date().getSeconds());
console.log('当前流程运行的轨迹:');
console.log(flowJS.trace);
}
});
</script>
</html>