zj
2025-10-05 fc68aa452e2fd56441128d1d5a4b32f254c6191d
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
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<jsp:useBean id="security" class="security.web.BaseSecurityAction" scope="page" />
 
<%@ include file="include/pagetop.jsp"%>
 
<!DOCTYPE html>
<html>
 
<head>
<%@ include file="include/head.jsp"%>
</head>
 
<body>
 
    <%@ include file="include/loading.jsp"%>
 
    <!-- //////////////////////////////////////////////////////////////////////////// -->
    <!-- START CONTENT -->
    <div class="ifr-dody">
 
        <!-- //////////////////////////////////////////////////////////////////////////// -->
        <!-- START CONTAINER -->
        <div class="ifr-con">
            <h3>交割合约配置</h3>
            
            <%@ include file="include/alert.jsp"%>
            
            <!-- //////////////////////////////////////////////////////////////////////////// -->            
            <!-- START queryForm -->
            <form action="<%=basePath%>normal/adminContractManageAction!list.action"
                method="post" id="queryForm">
                
                <input type="hidden" name="pageNo" id="pageNo" value="${pageNo}" />
                <input type="hidden" name="name_para" id="name_para" value="${name_para}" />
                <input type="hidden" name="rolename_para" id="rolename_para" value="${rolename_para}" />
                
            </form> 
            <!-- END queryForm -->
            <!-- //////////////////////////////////////////////////////////////////////////// -->
            
            <div class="row">
                <div class="col-md-12 col-lg-12">
                    <div class="panel panel-default">
 
                        <div class="panel-title">
                            <c:if test="${itemId != null}">
                                修改合约产品
                            </c:if>
                            <c:if test="${itemId == null}">
                                新增合约产品
                            </c:if>
                            <ul class="panel-tools">
                                <li><a class="icon minimise-tool"><i class="fa fa-minus"></i></a></li>
                                <li><a class="icon expand-tool"><i class="fa fa-expand"></i></a></li>
                            </ul>
                        </div>
 
                        <div class="panel-body">
                        
                            <%-- <c:if test='isResourceAccessible("ADMIN_CONTRACT_MANAGE_ADDCONTRACTITEM")'> --%>
                            
                                <form class="form-horizontal" action="<%=basePath%>normal/adminContractManageAction!addContractItem.action"
                                    method="post" name="mainForm" id="mainForm">
                                    
                                    <input type="hidden" name="itemId" id="item_id" value="${itemId}" />
                                    
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label form-label">合约名称</label>
                                        <div class="col-sm-2">
                                            <!-- <s:textfield id="name" name="name" cssClass="form-control " /> -->
                                            <input id="name" name="name" class="form-control " value="${name}" />
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label form-label">代码</label>
                                        <div class="col-sm-2">
                                            <!-- <s:textfield id="symbol" name="symbol" cssClass="form-control " /> -->
                                            <input id="symbol" name="symbol" class="form-control " value="${symbol}" />
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label form-label">保留精度</label>
                                        <div class="col-sm-2">
                                            <div class="input-group">
                                                <!-- <s:textfield id="decimals" name="decimals" cssClass="form-control " /> -->
                                                <input id="decimals" name="decimals" class="form-control " value="${decimals}" />
                                                <div class="input-group-addon">位</div>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label form-label">交易对</label>
                                        <div class="col-sm-3">
                                            <!-- <s:textfield id="symbol_data" name="symbol_data" cssClass="form-control " readonly="true"  /> -->
                                            <input id="symbol_data" name="symbol_data" class="form-control " readonly="readonly" value="${symbol_data}" />
                                        </div>
                                        <a href="javascript:chooseSymbol('${id}')" class="btn btn-light" style="margin-bottom: 10px">交易对选择</a>
                                    </div>
                                    
                                    <div class="form-group">
                                        <div class="col-sm-offset-2 col-sm-10">
                                            <a href="javascript:goUrl(${pageNo})" class="btn">取消</a> 
                                            <a href="javascript:submit()" class="btn btn-default">保存</a>
                                        </div>
                                    </div>
    
                                </form>
                                
                            <%-- </c:if> --%>
 
                        </div>
 
                    </div>
                </div>
            </div>
 
        </div>
        <!-- END CONTAINER -->
        <!-- //////////////////////////////////////////////////////////////////////////// -->
 
        <%@ include file="include/footer.jsp"%>
 
    </div>
    <!-- End Content -->
    <!-- //////////////////////////////////////////////////////////////////////////// -->
 
    <!-- 模态框 -->
    <div class="form-group">
    
        <input type="hidden" name="quote_currency" id="quote_currency" value="${quote_currency}" />
        <!-- <input type="hidden" name="base_currency" id="base_currency" value=""> -->
        
        <%-- <form action="<%=basePath%>normal/adminSymbolsAction!list.action"
            method="post" id="succeededForm">
            <input type="hidden" name="pageNo" id="pageNo"
                value="${param.pageNo}">
            <s:hidden name="id" id="id_reset"></s:hidden>
            <s:hidden name="name_para" id="name_para"></s:hidden>
            <s:hidden name="rolename_para" id="rolename_para"></s:hidden> --%>
            
        <div class="col-sm-2">
            <!-- 模态框(Modal) -->
            <div class="modal fade" id="modal_set" tabindex="-1" role="dialog"
                aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content" style="height:500px;">
                        
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="myModalLabel">交易对</h4>
                        </div>
                        
                        <%--<div class="modal-body">
                            <div class="">
                                <s:textfield id="money_revise" name="money_revise"
                                    cssClass="form-control " />
                                    <span  class="help-block">增加请输入正数,扣除请输入负数</span> 
                        </div> --%>
                        
                        <div class="modal-body" id="symbols_get" style="height:380px;">
                            <%@ include file="contract_manage_add_symbols_list.jsp"%>
                        </div>
                        
                        <div class="modal-footer" style="margin-top: 0;">
                            <button type="button" class="btn " data-dismiss="modal" >关闭</button>
                            <button id="sub" type="submit" class="btn btn-default" onclick="modalConfirm(this)">确认</button>
                        </div>
                        
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal -->
            </div>
        </div>
    <!-- </form> -->
    
    </div>
 
    <%@ include file="include/js.jsp"%>
 
    <script type="text/javascript">
        function submit() {
            swal({
                title : "是否保存?",
                text : "",
                type : "warning",
                showCancelButton : true,
                confirmButtonColor : "#DD6B55",
                confirmButtonText : "确认",
                closeOnConfirm : false
            }, function() {
                 document.getElementById("mainForm").submit();                
            });
        }
    </script>
    
    <script type="text/javascript">
        $(function(){
            var id = $('#item_id').val();
            if(typeof(id)!='undefined'&&id.length>0){
                $("#symbol").prop("readOnly",true);
                $("#symbol_data").prop("readOnly",true);
            }
        })
        function chooseSymbol(id) {
//             $("#id_resetpsw").val(id);
            csPage(1);
            $('#modal_set').modal("show");
        }
    </script>
    
    <form action="<%=basePath%>normal/adminSymbolsAction!reload.action" method="post" id="reload">
    </form>
    
    <script type="text/javascript">
        function reload() {
            swal({
                title : "是否同步远程数据库?",
                text : "",
                type : "warning",
                showCancelButton : true,
                confirmButtonColor : "#DD6B55",
                confirmButtonText : "确认",
                closeOnConfirm : true
            }, function() {
                $.ajax({
                    url:'<%=basePath%>normal/adminContractSymbolsAction!reload.action',
                        type:'post',
                        success: function (res) {
                            // 一旦设置的 dataType 选项,就不再关心 服务端 响应的 Content-Type 了
                            // 客户端会主观认为服务端返回的就是 JSON 格式的字符串
                            // console.log(res)
                            // $(".loading").hide();
                            $("#symbols_get").html(res);
                        }
                });
                // document.getElementById("reload").submit();
            });        
        }
        function csPage(pageNo, quoteCurrency, baseCurrency) {
            var url = $("#csUrl").val();
            quoteCurrency = null==quoteCurrency||''==quoteCurrency||typeof(quoteCurrency) == "undefined"?$('#quote_currency').val():quoteCurrency;
            baseCurrency = null==baseCurrency||''==baseCurrency||typeof(baseCurrency) == "undefined"?$('#base_currency').val():baseCurrency;
            pageNo = Number(pageNo)<=0?1:pageNo;
            var data = {"pageNo":pageNo,"quote_currency":quoteCurrency,"base_currency":baseCurrency};
            goAjaxUrl(url,data);
            // $('#quote_currency').val(quoteCurrency);
            // $('#base_currency').val(baseCurrency);
        }
        function goAjaxUrl(targetUrl,data) {
            $.ajax({
                url:targetUrl,
                data:data,
                type:'get',
                success: function (res) {
                    // 一旦设置的 dataType 选项,就不再关心 服务端 响应的 Content-Type 了
                    // 客户端会主观认为服务端返回的就是 JSON 格式的字符串
                    // console.log(res)
                    // $(".loading").hide();
                    $("#symbols_get").html(res);
                    $('#quote_currency').val(data.quote_currency);
                    $('#base_currency').val(data.base_currency);                            
                    if(null==data.quote_currency||''==data.quote_currency||typeof(data.quote_currency) == "undefined"){
                        $('.tr_quote:first').attr('style','background:#39ffff;');
                    }else{
                        $('#tr_'+data.quote_currency).attr('style','background:#39ffff;');
                    }
                  }
            });
        } 
        function modalConfirm(e) {
            $("#symbol_data").val($(".symbolCheck:checked").val());
            $(e).prev().click();
        }
    </script>
    
</body>
 
</html>