-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
252 lines (229 loc) · 13.4 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
<!DOCTYPE html>
<!-- saved from url=(0037)http://v3.bootcss.com/examples/cover/ -->
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="http://v3.bootcss.com/favicon.ico">
<title>RMB</title>
<!-- Bootstrap core CSS -->
<link href="bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="cover.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="site-wrapper">
<div class="site-wrapper-inner">
<div class="cover-container">
<div class="masthead clearfix">
<div class="inner">
<h3 class="masthead-brand">本币demo</h3>
<nav>
<ul class="nav masthead-nav">
<!-- <li class="active"><a href="http://v3.bootcss.com/examples/cover/#">Home</a></li>
<li><a href="http://v3.bootcss.com/examples/cover/#">Features</a></li>
<li><a href="http://v3.bootcss.com/examples/cover/#">Contact</a></li> -->
</ul>
</nav>
</div>
</div>
<div class="inner cover">
<h1 class="cover-heading">报价补全demo</h1>
<p class="lead">后端请求,补全机构名称和债券名称,补全所有机构下交易员名称</p>
<p class="lead">
<!-- Button trigger modal -->
<button type="button" class="btn btn-default btn-lg" data-toggle="modal" data-target="#myModal">
报价
</button>
<!-- Modal -->
<div class="modal fade modal-style" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h3 id="myModalLabel">报价表单</h3>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-sm-3 control-label">对手方</label>
<div class="col-sm-8">
<input type="text" class="form-control" placeholder="对手方机构" id='entityName' data-provide="typeahead">
</div>
</div>
<div class="form-group">
<label for="lastname" class="col-sm-3 control-label">交易员</label>
<div class="col-sm-8">
<select class="form-control" id="userList"></select>
</div>
</div>
<div class="form-group">
<label for="firstname" class="col-sm-3 control-label">债券代码</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="assetCode" placeholder="债券代码">
</div>
</div>
<div class="form-group">
<label for="firstname" class="col-sm-3 control-label">债券名称</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="assetName"
placeholder="债券名称">
</div>
</div>
<div class="form-group">
<label for="lastname" class="col-sm-3 control-label">清算速度</label>
<div class="col-sm-8">
<select class="form-control">
<option>T+0</option>
<option>T+1</option>
<option>T+2</option>
</select>
</div>
</div>
<div class="form-group">
<label for="firstname" class="col-sm-3 control-label">净价(元)</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="firstname"
placeholder="净价">
</div>
</div>
<div class="form-group">
<label for="firstname" class="col-sm-3 control-label">到期收益率(%)</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="firstname"
placeholder="到期收益率">
</div>
</div>
<div class="form-group">
<label for="firstname" class="col-sm-3 control-label">券面总额(万元)</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="firstname"
placeholder="券面总额">
</div>
</div>
<div class="form-group">
<label for="lastname" class="col-sm-3 control-label">结算方式</label>
<div class="col-sm-8">
<select class="form-control">
<option>券款对付</option>
<option>先款后券</option>
<option>先券后款</option>
</select>
</div>
</div>
<div class="form-group">
<label for="lastname" class="col-sm-3 control-label">清算类型</label>
<div class="col-sm-8">
<select class="form-control">
<option>全额清算</option>
<option>净额清算</option>
</select>
</div>
</div>
<div class="form-group">
<label for="lastname" class="col-sm-3 control-label">买卖方向</label>
<div class="col-sm-8">
<label class="radio">
<input type="radio" value="买入" name="buysellgroup" checked="checked">
买入
</label>
<label class="radio">
<input type="radio" value="卖出" name="buysellgroup">
卖出
</label>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">提交</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="jquery.min.js"></script>
<script src="bootstrap.min.js"></script>
<script src="typeahead.js"></script>
<script>
var entyDescSrnoMap = {};
var assetDescSrnoMap = {};
var userArray = [];
$("#entityName").typeahead({
items: 12,
source: function(query, process){
console.log(query);
userArray = [];
$("#userList").empty();
$.get('./search', {entyDesc:query}, function(data){
console.log(data);
entyDescSrnoMap = {};
var entyDescArray = [];
data.forEach(function(e){
e = JSON.parse(e);
entyDescArray.push(e.desc);
entyDescSrnoMap[e.desc] = e.entySrno;
});
process(entyDescArray);
});
},
matcher:function(item){
return true;
},
afterSelect: function (item) {
console.log(entyDescSrnoMap[item]);//取出选中的机构序列号
$.get('./entyUser', {entySrno:entyDescSrnoMap[item]}, function(data){
console.log(data);
data.forEach(function(user){
$("#userList").append("<option>"+user.userDesc+"</option>")
});
});
},
delay: 500
});
$("#assetName").typeahead({
items: 12,
source: function(query, process){
console.log(query);
$("#assetCode").val('');
$.get('./search', {assetDesc:query}, function(data){
console.log(data);
var assetDescArray = [];
data.forEach(function(e){
e = JSON.parse(e);
assetDescArray.push(e.desc);
assetDescSrnoMap[e.desc] = e.assetCode;
});
process(assetDescArray);
});
},
afterSelect: function (item) {
//获取债券代码
console.log(assetDescSrnoMap[item]);
$("#assetCode").val(assetDescSrnoMap[item]);
},
matcher:function(item){
return true;
},
delay: 500
});
</script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
</body>
</html>