strong all
This commit is contained in:
@@ -302,7 +302,7 @@
|
||||
<fieldset>
|
||||
<legend>附件下载</legend>
|
||||
<p>文件: Minidump_20251221.zip (256 KB)</p>
|
||||
<a href="#" onclick="alert('开始下载真实文件...')">[点击下载附件]</a>
|
||||
<a href="#" onclick="showCustomAlert('开始下载真实文件...')">[点击下载附件]</a>
|
||||
</fieldset>
|
||||
|
||||
<div align="center" class="fake-download-area">
|
||||
@@ -570,6 +570,35 @@
|
||||
</div>
|
||||
|
||||
<!-- Modals -->
|
||||
<div class="modal-backdrop" id="confirmModal">
|
||||
<div class="modal-panel" style="width: 400px;">
|
||||
<div class="card-header">
|
||||
操作确认 <span style="cursor:pointer; float:right;" onclick="closeModal('confirmModal')">×</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p id="confirmMessage" style="margin-bottom: 20px;">确定执行此操作?</p>
|
||||
<div style="text-align: right;">
|
||||
<button class="btn" onclick="closeModal('confirmModal')">取消</button>
|
||||
<button class="btn btn-primary" id="confirmBtnAction">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-backdrop" id="alertModal">
|
||||
<div class="modal-panel" style="width: 400px;">
|
||||
<div class="card-header">
|
||||
提示 <span style="cursor:pointer; float:right;" onclick="closeModal('alertModal')">×</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p id="alertMessage" style="margin-bottom: 20px;"></p>
|
||||
<div style="text-align: right;">
|
||||
<button class="btn btn-primary" onclick="closeModal('alertModal')">知道了</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-backdrop" id="loginModal">
|
||||
<div class="modal-panel">
|
||||
<div class="card-header">
|
||||
@@ -618,6 +647,33 @@
|
||||
<script>
|
||||
// === Single Page Application Logic (SPA) ===
|
||||
|
||||
// --- Custom Alert/Confirm Logic ---
|
||||
let onConfirmCallback = null;
|
||||
|
||||
function showCustomAlert(msg) {
|
||||
document.getElementById('alertMessage').innerText = msg;
|
||||
openModal('alertModal');
|
||||
}
|
||||
|
||||
function showCustomConfirm(msg, callback) {
|
||||
document.getElementById('confirmMessage').innerText = msg;
|
||||
onConfirmCallback = callback;
|
||||
openModal('confirmModal');
|
||||
}
|
||||
|
||||
// Bind Confirm Action
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const confirmBtn = document.getElementById('confirmBtnAction');
|
||||
if(confirmBtn) {
|
||||
confirmBtn.addEventListener('click', () => {
|
||||
if (typeof onConfirmCallback === 'function') {
|
||||
onConfirmCallback();
|
||||
}
|
||||
closeModal('confirmModal');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const DB = {
|
||||
users: [
|
||||
{ id: 1, name: 'System_Admin', role: 'admin', avatar: 'https://ui-avatars.com/api/?name=SA&background=0D8ABC&color=fff' },
|
||||
|
||||
Reference in New Issue
Block a user