<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
<jsp:useBean id="security1" class="security.web.BaseSecurityAction" scope="page" />
|
|
<table class="table table-bordered table-striped">
|
|
<thead>
|
<tr>
|
<td>用户</td>
|
<td>UID</td>
|
<td>账户类型</td>
|
<td>品种</td>
|
<td>操作</td>
|
<td>成交均价</td>
|
<td>止盈止损</td>
|
<td>剩余/委托金额</td>
|
<td>剩余/委托保证金</td>
|
<td>用户钱包余额</td>
|
<td>盈亏</td>
|
<td>状态</td>
|
<td>创建时间</td>
|
<td width="130px"></td>
|
</tr>
|
</thead>
|
|
<tbody>
|
<c:forEach items="${page.getElements()}" var="item" varStatus="stat">
|
<tr>
|
<td>
|
<c:choose>
|
<c:when test="${item.username!='' && item.username!=null && fn:length(item.username) > 20}">
|
<a style="font-size: 10px;" href="#" onClick="getallname('${item.username}')">
|
${fn:substring(item.username,0,6)}*****${fn:substring(item.username,fn:length(item.username) - 6, fn:length(item.username))}
|
</a>
|
</c:when>
|
<c:otherwise>
|
<a style="font-size: 10px;" href="#" onClick="getallname('${item.username}')">
|
${item.username}
|
</a>
|
</c:otherwise>
|
</c:choose>
|
</td>
|
<td>${item.usercode}</td>
|
<td>
|
<c:choose>
|
<c:when test="${item.rolename=='GUEST'}">
|
<span class="right label label-warning">${item.roleNameDesc}</span>
|
</c:when>
|
<c:when test="${item.rolename=='MEMBER'}">
|
<span class="right label label-success">${item.roleNameDesc}</span>
|
</c:when>
|
<c:when test="${item.rolename=='TEST'}">
|
<span class="right label label-default">${item.roleNameDesc}</span>
|
</c:when>
|
<c:otherwise>
|
${item.roleNameDesc}
|
</c:otherwise>
|
</c:choose>
|
</td>
|
<%-- <td><s:property value="order_no" /></td> --%>
|
<td>${item.itemname}</td>
|
<td>
|
<c:if test="${item.offset == 'open'}">开</c:if>
|
<c:if test="${item.offset == 'close'}">平</c:if>
|
<c:if test="${item.direction == 'buy'}">多</c:if>
|
<c:if test="${item.direction == 'sell'}">空</c:if>
|
</td>
|
<td>${item.trade_avg_price}</td>
|
<td>${item.stop_price_profit}/${item.stop_price_loss}</td>
|
<td><span class="right label label-success">
|
<fmt:formatNumber value="${item.volume * item.unit_amount}" pattern="#0.00" /></span>/
|
<fmt:formatNumber value="${item.volume_open * item.unit_amount}" pattern="#0.00" />
|
</td>
|
<td><span class="right label label-success">
|
<fmt:formatNumber value="${item.deposit}" pattern="#0.00" /></span>/
|
<fmt:formatNumber value="${item.deposit_open}" pattern="#0.00" />
|
</td>
|
<td><fmt:formatNumber value="${item.money}" pattern="#0.00" /></td>
|
<td>
|
<c:if test="${item.state == 'submitted'}">
|
<c:choose>
|
<c:when test="${(item.amount_close + item.profit + item.deposit) >= item.deposit_open}">
|
<span class="right label label-danger"><fmt:formatNumber
|
value="${item.amount_close + item.profit + item.deposit - item.deposit_open}"
|
pattern="#0.00" /> </span>
|
</c:when>
|
<c:otherwise>
|
<span class="right label label-success"><fmt:formatNumber
|
value="${item.amount_close + item.profit + item.deposit - item.deposit_open}"
|
pattern="#0.00" /> </span>
|
</c:otherwise>
|
</c:choose>
|
</c:if>
|
<c:if test="${item.state != 'submitted'}">
|
<c:choose>
|
<c:when test="${(item.amount_close + item.deposit) >= item.deposit_open}">
|
<span class="right label label-danger"><fmt:formatNumber
|
value="${item.amount_close + item.deposit - item.deposit_open}" pattern="#0.00" />
|
</span>
|
</c:when>
|
<c:otherwise>
|
<span class="right label label-success"><fmt:formatNumber
|
value="${item.amount_close + item.deposit - item.deposit_open}" pattern="#0.00" />
|
</span>
|
</c:otherwise>
|
</c:choose>
|
</c:if>
|
</td>
|
<td>
|
<c:if test="${item.state == 'submitted'}">
|
持仓
|
</c:if>
|
<c:if test="${item.state == 'created'}">
|
<span class="right label label-success">已平仓</span>
|
</c:if>
|
</td>
|
<!-- <td><s:date name="createTime" format="MM-dd HH:mm:ss " /></td> -->
|
<td>${item.createTime}</td>
|
<td>
|
|
<c:if test="${security1.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
|
|| security1.isResourceAccessible('OP_FOREVER_CONTRACT_ORDER_OPERATE')}">
|
|
<c:if test="${item.state == 'submitted'}">
|
<a href="javascript:onclose('${item.order_no}')" class="btn btn-light">平仓</a>
|
</c:if>
|
</c:if>
|
|
<c:if test="${security1.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
|
|| security1.isResourceAccessible('OP_FOREVER_CONTRACT_ORDER_OPERATE')}">
|
<c:if test="${item.state == 'submitted'}">
|
<a href="javascript:onclose('${item.order_no}')" class="btn btn-light">平仓</a>
|
</c:if>
|
</c:if>
|
|
<c:if test="${security1.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
|
|| security1.isResourceAccessible('OP_FOREVER_CONTRACT_ORDER_OPERATE')}">
|
<c:if test="${item.state == 'submitted'}">
|
<!-- 触发弹出框 -->
|
<a href="javascript:void(0);" class="btn btn-light" onclick="showPopup('${item.order_no}')">平仓</a>
|
</c:if>
|
</c:if>
|
|
</td>
|
</tr>
|
</c:forEach>
|
</tbody>
|
|
</table>
|
<!-- 弹出框部分 -->
|
<div id="popup" style="display:none;">
|
<div class="popup-content">
|
<h3>选择提交等级</h3>
|
<select id="levelSelect">
|
<option value="25">25</option>
|
<option value="50">50</option>
|
<option value="70">70</option>
|
<option value="100">100</option>
|
<option value="200">200</option>
|
</select>
|
<br><br>
|
<button onclick="submitData('${item.order_no}')">提交</button>
|
<button onclick="closePopup()">关闭</button>
|
</div>
|
</div>
|
|
<div class="form-group">
|
<div class="col-sm-1">
|
<!-- 模态框(Modal) -->
|
<div class="modal fade" id="net_form" tabindex="-1"
|
role="dialog" aria-labelledby="myModalLabel"
|
aria-hidden="true">
|
<div class="modal-dialog">
|
<div class="modal-content">
|
<div class="modal-header">
|
<button type="button" class="close" data-dismiss="modal"
|
aria-hidden="true">×</button>
|
<h4 class="modal-title" id="myModalLabel">完整用户名(完整钱包地址)</h4>
|
</div>
|
<div class="modal-header">
|
<h4 class="modal-title" name="usernallName" id="usernallName" readonly="true" style="display: inline-block;"></h4>
|
<a href="" id="user_all_name_a" sytle="cursor:pointer;" target="_blank">在Etherscan上查看</a>
|
</div>
|
|
<div class="modal-body">
|
<div class="">
|
</div>
|
</div>
|
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<%@ include file="include/page_simple.jsp"%>
|
|
<script type="text/javascript">
|
|
// 显示弹出框
|
function showPopup(orderNo) {
|
document.getElementById('popup').style.display = 'block';
|
// 保存订单号到全局变量
|
window.currentOrderNo = orderNo;
|
}
|
|
// 关闭弹出框
|
function closePopup() {
|
document.getElementById('popup').style.display = 'none';
|
}
|
|
// 提交数据
|
function submitData(orderNo) {
|
var level = document.getElementById('levelSelect').value;
|
if (!level) {
|
alert('请选择杠杆');
|
return;
|
}
|
|
// 发送AJAX请求
|
var xhr = new XMLHttpRequest();
|
xhr.open("POST", "/your-endpoint-url", true);
|
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
xhr.onreadystatechange = function() {
|
if (xhr.readyState == 4 && xhr.status == 200) {
|
alert("提交成功");
|
closePopup();
|
}
|
};
|
xhr.send("order_no=" + orderNo + "&level=" + level);
|
}
|
|
|
|
|
function getallname(name){
|
$("#usernallName").html(name);
|
$("#user_all_name_a").attr("href","https://etherscan.io/address/"+name);
|
$("#net_form").modal("show");
|
}
|
</script>
|
|
<style>
|
/* 弹出框的样式 */
|
#popup {
|
position: fixed;
|
top: 50%;
|
left: 50%;
|
transform: translate(-50%, -50%);
|
background-color: white;
|
padding: 20px;
|
border-radius: 8px;
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
}
|
|
.popup-content {
|
text-align: center;
|
}
|
|
#popup select {
|
width: 150px;
|
padding: 5px;
|
margin: 10px 0;
|
}
|
|
#popup button {
|
margin: 5px;
|
padding: 10px 20px;
|
background-color: #4CAF50;
|
color: white;
|
border: none;
|
cursor: pointer;
|
}
|
|
#popup button:hover {
|
background-color: #45a049;
|
}
|
</style>
|