@@ -1,7 +1,97 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}交易记录{% endblock %}
|
||||
{% block heading %}交易记录{% endblock %}
|
||||
{% block breadcrumb %}开平仓记录{% endblock %}
|
||||
{% block title %}交易记录
|
||||
<div id="confirmOverlay" style="display:none;position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:199;" onclick="hideConfirm()"></div>
|
||||
<div id="confirmBox" style="display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:28px 32px;z-index:200;text-align:center;max-width:90vw;">
|
||||
<p id="confirmMsg" style="font-size:0.95rem;margin-bottom:20px;"></p>
|
||||
<div style="display:flex;gap:10px;justify-content:center;">
|
||||
<button class="btn" style="background:var(--th-bg);color:var(--fg);" onclick="hideConfirm()">取消</button>
|
||||
<button class="btn" style="background:var(--danger);color:#fff;" id="confirmBtn">确认删除</button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var confirmTarget = '';
|
||||
function confirmDelete(e, msg, url) {
|
||||
e.preventDefault();
|
||||
document.getElementById('confirmMsg').textContent = msg;
|
||||
document.getElementById('confirmBtn').onclick = function() {
|
||||
var f = document.createElement('form');
|
||||
f.method = 'POST';
|
||||
f.action = url;
|
||||
document.body.appendChild(f);
|
||||
f.submit();
|
||||
};
|
||||
document.getElementById('confirmOverlay').style.display = 'block';
|
||||
document.getElementById('confirmBox').style.display = 'block';
|
||||
}
|
||||
function hideConfirm() {
|
||||
document.getElementById('confirmOverlay').style.display = 'none';
|
||||
document.getElementById('confirmBox').style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
{% block heading %}交易记录
|
||||
<div id="confirmOverlay" style="display:none;position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:199;" onclick="hideConfirm()"></div>
|
||||
<div id="confirmBox" style="display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:28px 32px;z-index:200;text-align:center;max-width:90vw;">
|
||||
<p id="confirmMsg" style="font-size:0.95rem;margin-bottom:20px;"></p>
|
||||
<div style="display:flex;gap:10px;justify-content:center;">
|
||||
<button class="btn" style="background:var(--th-bg);color:var(--fg);" onclick="hideConfirm()">取消</button>
|
||||
<button class="btn" style="background:var(--danger);color:#fff;" id="confirmBtn">确认删除</button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var confirmTarget = '';
|
||||
function confirmDelete(e, msg, url) {
|
||||
e.preventDefault();
|
||||
document.getElementById('confirmMsg').textContent = msg;
|
||||
document.getElementById('confirmBtn').onclick = function() {
|
||||
var f = document.createElement('form');
|
||||
f.method = 'POST';
|
||||
f.action = url;
|
||||
document.body.appendChild(f);
|
||||
f.submit();
|
||||
};
|
||||
document.getElementById('confirmOverlay').style.display = 'block';
|
||||
document.getElementById('confirmBox').style.display = 'block';
|
||||
}
|
||||
function hideConfirm() {
|
||||
document.getElementById('confirmOverlay').style.display = 'none';
|
||||
document.getElementById('confirmBox').style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
{% block breadcrumb %}开平仓记录
|
||||
<div id="confirmOverlay" style="display:none;position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:199;" onclick="hideConfirm()"></div>
|
||||
<div id="confirmBox" style="display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:28px 32px;z-index:200;text-align:center;max-width:90vw;">
|
||||
<p id="confirmMsg" style="font-size:0.95rem;margin-bottom:20px;"></p>
|
||||
<div style="display:flex;gap:10px;justify-content:center;">
|
||||
<button class="btn" style="background:var(--th-bg);color:var(--fg);" onclick="hideConfirm()">取消</button>
|
||||
<button class="btn" style="background:var(--danger);color:#fff;" id="confirmBtn">确认删除</button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var confirmTarget = '';
|
||||
function confirmDelete(e, msg, url) {
|
||||
e.preventDefault();
|
||||
document.getElementById('confirmMsg').textContent = msg;
|
||||
document.getElementById('confirmBtn').onclick = function() {
|
||||
var f = document.createElement('form');
|
||||
f.method = 'POST';
|
||||
f.action = url;
|
||||
document.body.appendChild(f);
|
||||
f.submit();
|
||||
};
|
||||
document.getElementById('confirmOverlay').style.display = 'block';
|
||||
document.getElementById('confirmBox').style.display = 'block';
|
||||
}
|
||||
function hideConfirm() {
|
||||
document.getElementById('confirmOverlay').style.display = 'none';
|
||||
document.getElementById('confirmBox').style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
@@ -101,7 +191,7 @@
|
||||
<button style="background:var(--danger-bg);color:var(--danger-fg);border:1px solid var(--danger);padding:3px 10px;border-radius:4px;cursor:pointer;font-size:0.78rem;margin-left:8px;"
|
||||
onclick="showEditForm('trade', {{ t.id }}, '{{ t.product_code }}', '{{ t.contract_code }}', '{{ t.direction }}', {{ t.open_price }}, {{ t.open_fee or 0 }}, '{{ t.open_date }}', null, null, null, '{{ t.status }}')">编辑</button>
|
||||
<form method="post" action="/trades/{{ t.id }}/delete" style="display:inline;margin-left:8px;">
|
||||
<button style="background:var(--surface);color:var(--fg);border:1px solid var(--border);padding:3px 10px;border-radius:4px;cursor:pointer;font-size:0.78rem;" onclick="return confirm('删除此记录?')">删除</button>
|
||||
<button style="background:var(--surface);color:var(--fg);border:1px solid var(--border);padding:3px 10px;border-radius:4px;cursor:pointer;font-size:0.78rem;" onclick="confirmDelete(event, '确定删除此记录?', this.closest('form').action)">删除</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -178,7 +268,7 @@
|
||||
<button style="background:var(--danger-bg);color:var(--danger-fg);border:1px solid var(--danger);padding:3px 10px;border-radius:4px;cursor:pointer;font-size:0.78rem;margin-left:8px;"
|
||||
onclick="showEditForm('trade', {{ t.id }}, '{{ t.product_code }}', '{{ t.contract_code }}', '{{ t.direction }}', {{ t.open_price }}, {{ t.open_fee or 0 }}, '{{ t.open_date }}', {{ t.close_price }}, {{ t.close_fee or 0 }}, '{{ t.close_date }}', '{{ t.status }}')">编辑</button>
|
||||
<form method="post" action="/trades/{{ t.id }}/delete" style="display:inline;margin-left:8px;">
|
||||
<button style="background:var(--surface);color:var(--fg);border:1px solid var(--border);padding:3px 10px;border-radius:4px;cursor:pointer;font-size:0.78rem;" onclick="return confirm('删除此记录?')">删除</button>
|
||||
<button style="background:var(--surface);color:var(--fg);border:1px solid var(--border);padding:3px 10px;border-radius:4px;cursor:pointer;font-size:0.78rem;" onclick="confirmDelete(event, '确定删除此记录?', this.closest('form').action)">删除</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -338,4 +428,34 @@ function hideEditForm() {
|
||||
document.getElementById('editFormBox').style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="confirmOverlay" style="display:none;position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:199;" onclick="hideConfirm()"></div>
|
||||
<div id="confirmBox" style="display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:28px 32px;z-index:200;text-align:center;max-width:90vw;">
|
||||
<p id="confirmMsg" style="font-size:0.95rem;margin-bottom:20px;"></p>
|
||||
<div style="display:flex;gap:10px;justify-content:center;">
|
||||
<button class="btn" style="background:var(--th-bg);color:var(--fg);" onclick="hideConfirm()">取消</button>
|
||||
<button class="btn" style="background:var(--danger);color:#fff;" id="confirmBtn">确认删除</button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var confirmTarget = '';
|
||||
function confirmDelete(e, msg, url) {
|
||||
e.preventDefault();
|
||||
document.getElementById('confirmMsg').textContent = msg;
|
||||
document.getElementById('confirmBtn').onclick = function() {
|
||||
var f = document.createElement('form');
|
||||
f.method = 'POST';
|
||||
f.action = url;
|
||||
document.body.appendChild(f);
|
||||
f.submit();
|
||||
};
|
||||
document.getElementById('confirmOverlay').style.display = 'block';
|
||||
document.getElementById('confirmBox').style.display = 'block';
|
||||
}
|
||||
function hideConfirm() {
|
||||
document.getElementById('confirmOverlay').style.display = 'none';
|
||||
document.getElementById('confirmBox').style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user