HEL-371: retile archive form and profile settings layouts
Put create/edit archive on an equal two-column three-row card grid, move password change into the existing modal, and keep logout only in the sidebar. Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
Cursor
multica-agent
parent
82b16bb052
commit
7c879c00fc
+132
-127
@@ -140,6 +140,85 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="editor-card">
|
||||
<div class="section-title" style="margin-top:0;">是否制定还款计划</div>
|
||||
<div class="form-grid">
|
||||
<div class="form-field">
|
||||
<label for="plan_enabled">是否有分期还款计划</label>
|
||||
<select name="plan_enabled" id="plan_enabled">
|
||||
<option value="0" <?= empty($planCfg['enabled']) ? 'selected' : '' ?>>否</option>
|
||||
<option value="1" <?= !empty($planCfg['enabled']) ? 'selected' : '' ?>>是</option>
|
||||
</select>
|
||||
<div class="field-err" data-err></div>
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<label>计息说明</label>
|
||||
<div class="field-hint">到期日前可选“提前还款”;到期日后可选“按期还款/延期/逾期”。逾期未归还计划本金按上浮利率计息,剩余额度按已还款计划与手动归还本金自动计算。</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="plan_wrap" class="plan-scroll"<?= empty($planCfg['enabled']) ? ' hidden' : '' ?>>
|
||||
<table id="plan_table">
|
||||
<thead><tr><th>还款日期</th><th>还款金额</th><th>状态操作</th><th>延期日期</th><th>行操作</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($planRows as $row): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="hidden" name="plan_id[]" value="<?= e((string)($row['id'] ?? '')) ?>">
|
||||
<div class="form-field"><input type="date" name="plan_due_date[]" value="<?= e((string)($row['due_date'] ?? '')) ?>" onchange="syncPlanAction(this)"></div>
|
||||
</td>
|
||||
<td><div class="form-field"><input type="number" step="0.01" name="plan_amount[]" value="<?= e((string)($row['amount'] ?? '')) ?>"></div></td>
|
||||
<td>
|
||||
<?php $st = (string)($row['status'] ?? 'pending'); ?>
|
||||
<div class="form-field"><select name="plan_status[]" onchange="syncDelayInput(this)">
|
||||
<option value="pending" <?= $st === 'pending' ? 'selected' : '' ?>>未还款</option>
|
||||
<option value="paid" <?= $st === 'paid' ? 'selected' : '' ?>><?= (!empty($row['due_date']) && $row['due_date'] > date('Y-m-d')) ? '提前还款' : '按期还款' ?></option>
|
||||
<option value="delayed" <?= $st === 'delayed' ? 'selected' : '' ?>>延期</option>
|
||||
<option value="overdue" <?= $st === 'overdue' ? 'selected' : '' ?>>逾期</option>
|
||||
</select></div>
|
||||
</td>
|
||||
<td><div class="form-field"><input type="date" name="plan_delay_date[]" value="" <?= $st === 'delayed' ? '' : 'disabled' ?>></div></td>
|
||||
<td><button type="button" class="btn btn--danger btn--sm" onclick="this.closest('tr').remove()">删除</button></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p style="margin:12px 0 0;"><button type="button" class="btn btn--plain" onclick="addPlanRow()">+ 添加计划行</button></p>
|
||||
</div>
|
||||
<?php if ($editing): ?>
|
||||
<div class="form-grid" style="margin-top:16px;">
|
||||
<div class="form-field">
|
||||
<label for="loan_extend_to">延期新到期日(选填)</label>
|
||||
<input type="date" name="loan_extend_to" id="loan_extend_to" value="">
|
||||
<div class="field-hint">填写后保存为新的到期日,须不早于当前到期日与起始日。</div>
|
||||
</div>
|
||||
<?php if ($formKind === ARCHIVE_KIND_BANK_LOAN): ?>
|
||||
<div class="form-field">
|
||||
<label>已累计归还本金 / 利息(元)</label>
|
||||
<div class="num" style="font-weight:650;padding-top:9px;"><?= e(amount((float)$financeCfg['manual_principal_repaid'])) ?> / <?= e(amount((float)$financeCfg['manual_interest_paid'])) ?></div>
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<label for="principal_repayment_now">本次归还本金(元)</label>
|
||||
<input type="number" step="0.01" min="0" name="principal_repayment_now" id="principal_repayment_now" placeholder="0" value="">
|
||||
<div class="field-err" data-err></div>
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<label for="interest_repayment_now">本次归还利息(元)</label>
|
||||
<input type="number" step="0.01" min="0" name="interest_repayment_now" id="interest_repayment_now" placeholder="0" value="">
|
||||
<div class="field-err" data-err></div>
|
||||
</div>
|
||||
<div class="form-field full">
|
||||
<div class="field-hint">归还本金从剩余额度中扣减;归还利息计入「已归还利息」,减少当前应付与结息日应付利息。</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="form-field">
|
||||
<label>对外担保</label>
|
||||
<div class="field-hint">可仅使用延期;本金利息归还适用于银行贷款。</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="editor-card">
|
||||
<div class="section-title" style="margin-top:0;">金额与期限</div>
|
||||
<div class="form-grid">
|
||||
@@ -212,85 +291,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="editor-card">
|
||||
<div class="section-title" style="margin-top:0;">还款与担保信息</div>
|
||||
<div class="form-grid">
|
||||
<div class="form-field">
|
||||
<label for="plan_enabled">是否有分期还款计划</label>
|
||||
<select name="plan_enabled" id="plan_enabled">
|
||||
<option value="0" <?= empty($planCfg['enabled']) ? 'selected' : '' ?>>否</option>
|
||||
<option value="1" <?= !empty($planCfg['enabled']) ? 'selected' : '' ?>>是</option>
|
||||
</select>
|
||||
<div class="field-err" data-err></div>
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<label>计息说明</label>
|
||||
<div class="field-hint">到期日前可选“提前还款”;到期日后可选“按期还款/延期/逾期”。逾期未归还计划本金按上浮利率计息,剩余额度按已还款计划与手动归还本金自动计算。</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="plan_wrap" style="<?= empty($planCfg['enabled']) ? 'display:none' : '' ?>margin-top:12px;">
|
||||
<table id="plan_table">
|
||||
<thead><tr><th>还款日期</th><th>还款金额</th><th>状态操作</th><th>延期日期</th><th>行操作</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($planRows as $row): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="hidden" name="plan_id[]" value="<?= e((string)($row['id'] ?? '')) ?>">
|
||||
<div class="form-field"><input type="date" name="plan_due_date[]" value="<?= e((string)($row['due_date'] ?? '')) ?>" onchange="syncPlanAction(this)"></div>
|
||||
</td>
|
||||
<td><div class="form-field"><input type="number" step="0.01" name="plan_amount[]" value="<?= e((string)($row['amount'] ?? '')) ?>"></div></td>
|
||||
<td>
|
||||
<?php $st = (string)($row['status'] ?? 'pending'); ?>
|
||||
<div class="form-field"><select name="plan_status[]" onchange="syncDelayInput(this)">
|
||||
<option value="pending" <?= $st === 'pending' ? 'selected' : '' ?>>未还款</option>
|
||||
<option value="paid" <?= $st === 'paid' ? 'selected' : '' ?>><?= (!empty($row['due_date']) && $row['due_date'] > date('Y-m-d')) ? '提前还款' : '按期还款' ?></option>
|
||||
<option value="delayed" <?= $st === 'delayed' ? 'selected' : '' ?>>延期</option>
|
||||
<option value="overdue" <?= $st === 'overdue' ? 'selected' : '' ?>>逾期</option>
|
||||
</select></div>
|
||||
</td>
|
||||
<td><div class="form-field"><input type="date" name="plan_delay_date[]" value="" <?= $st === 'delayed' ? '' : 'disabled' ?>></div></td>
|
||||
<td><button type="button" class="btn btn--danger btn--sm" onclick="this.closest('tr').remove()">删除</button></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p style="margin:12px 0 0;"><button type="button" class="btn btn--plain" onclick="addPlanRow()">+ 添加计划行</button></p>
|
||||
</div>
|
||||
<?php if ($editing): ?>
|
||||
<div class="form-grid" style="margin-top:16px;">
|
||||
<div class="form-field">
|
||||
<label for="loan_extend_to">延期新到期日(选填)</label>
|
||||
<input type="date" name="loan_extend_to" id="loan_extend_to" value="">
|
||||
<div class="field-hint">填写后保存为新的到期日,须不早于当前到期日与起始日。</div>
|
||||
</div>
|
||||
<?php if ($formKind === ARCHIVE_KIND_BANK_LOAN): ?>
|
||||
<div class="form-field">
|
||||
<label>已累计归还本金 / 利息(元)</label>
|
||||
<div class="num" style="font-weight:650;padding-top:9px;"><?= e(amount((float)$financeCfg['manual_principal_repaid'])) ?> / <?= e(amount((float)$financeCfg['manual_interest_paid'])) ?></div>
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<label for="principal_repayment_now">本次归还本金(元)</label>
|
||||
<input type="number" step="0.01" min="0" name="principal_repayment_now" id="principal_repayment_now" placeholder="0" value="">
|
||||
<div class="field-err" data-err></div>
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<label for="interest_repayment_now">本次归还利息(元)</label>
|
||||
<input type="number" step="0.01" min="0" name="interest_repayment_now" id="interest_repayment_now" placeholder="0" value="">
|
||||
<div class="field-err" data-err></div>
|
||||
</div>
|
||||
<div class="form-field full">
|
||||
<div class="field-hint">归还本金从剩余额度中扣减;归还利息计入「已归还利息」,减少当前应付与结息日应付利息。</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="form-field">
|
||||
<label>对外担保</label>
|
||||
<div class="field-hint">可仅使用延期;本金利息归还适用于银行贷款。</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="editor-card">
|
||||
<div class="section-title" style="margin-top:0;">备注与附件</div>
|
||||
<div class="form-grid">
|
||||
@@ -307,59 +307,64 @@
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if ($editArchiveId > 0): ?>
|
||||
<div class="section-title">文件管理</div>
|
||||
<div style="display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0 0 12px;">
|
||||
<input type="file" name="files[]" form="fileUploadForm" multiple required>
|
||||
<button type="submit" form="fileUploadForm" class="btn btn--plain">上传并刷新列表</button>
|
||||
</div>
|
||||
<?php foreach ($editFiles as $f): $fext = (string)$f['file_ext']; $fid = (int)$f['id']; ?>
|
||||
<div class="file-row" style="flex-wrap:wrap;">
|
||||
<span class="file-ico"><?= e($fext !== '' ? strtoupper($fext) : 'FILE') ?></span>
|
||||
<div style="min-width:0; flex:1;">
|
||||
<div class="file-name"><?= e((string)$f['original_name']) ?></div>
|
||||
<div class="file-meta num"><?= number_format(((int)$f['file_size']) / 1024, 1) ?> KB</div>
|
||||
</div>
|
||||
<div class="file-act">
|
||||
<?php if (canPreview($fext)): ?>
|
||||
<button type="submit" form="previewFile<?= $fid ?>">预览</button>
|
||||
<?php endif; ?>
|
||||
<button type="submit" form="downloadFile<?= $fid ?>">下载</button>
|
||||
</div>
|
||||
<div class="file-act" style="flex-basis:100%; justify-content:flex-end; margin:2px 0 0;">
|
||||
<span style="display:inline-flex; align-items:center; gap:4px;">
|
||||
<input form="renameFile<?= $fid ?>" name="new_name" value="<?= e((string)pathinfo((string)$f['original_name'], PATHINFO_FILENAME)) ?>" placeholder="新文件名" required aria-label="新文件名" style="width:96px; height:24px; font-size:11.5px; padding:0 6px;">
|
||||
<button type="submit" form="renameFile<?= $fid ?>">重命名</button>
|
||||
</span>
|
||||
<button type="submit" form="deleteFile<?= $fid ?>" onclick="return confirm('确认删除?')">删除</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php if (empty($editFiles)): ?>
|
||||
<div class="empty">暂无文件</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php if ($editArchiveId > 0): ?>
|
||||
<div class="editor-page">
|
||||
<div class="editor-card">
|
||||
<div class="section-title" style="margin-top:0;">文件管理</div>
|
||||
<form method="post" action="index.php?action=upload_file" enctype="multipart/form-data" style="display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0 0 12px;">
|
||||
<input type="hidden" name="archive_id" value="<?= $editArchiveId ?>">
|
||||
<input type="file" name="files[]" multiple required>
|
||||
<button type="submit" class="btn btn--plain">上传并刷新列表</button>
|
||||
<form id="fileUploadForm" method="post" action="index.php?action=upload_file" enctype="multipart/form-data" hidden>
|
||||
<input type="hidden" name="archive_id" value="<?= $editArchiveId ?>">
|
||||
</form>
|
||||
<?php foreach ($editFiles as $f): $fid = (int)$f['id']; ?>
|
||||
<?php if (canPreview((string)$f['file_ext'])): ?>
|
||||
<form id="previewFile<?= $fid ?>" method="get" action="index.php" target="_blank" hidden>
|
||||
<input type="hidden" name="action" value="preview_file">
|
||||
<input type="hidden" name="id" value="<?= $fid ?>">
|
||||
</form>
|
||||
<?php foreach ($editFiles as $f): $fext = (string)$f['file_ext']; ?>
|
||||
<div class="file-row" style="flex-wrap:wrap;">
|
||||
<span class="file-ico"><?= e($fext !== '' ? strtoupper($fext) : 'FILE') ?></span>
|
||||
<div style="min-width:0; flex:1;">
|
||||
<div class="file-name"><?= e((string)$f['original_name']) ?></div>
|
||||
<div class="file-meta num"><?= number_format(((int)$f['file_size']) / 1024, 1) ?> KB</div>
|
||||
</div>
|
||||
<div class="file-act">
|
||||
<?php if (canPreview($fext)): ?>
|
||||
<form method="get" action="index.php" target="_blank" style="display:inline; margin:0;">
|
||||
<input type="hidden" name="action" value="preview_file">
|
||||
<input type="hidden" name="id" value="<?= (int)$f['id'] ?>">
|
||||
<button type="submit">预览</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<form method="get" action="index.php" style="display:inline; margin:0;">
|
||||
<input type="hidden" name="action" value="download_file">
|
||||
<input type="hidden" name="id" value="<?= (int)$f['id'] ?>">
|
||||
<button type="submit">下载</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="file-act" style="flex-basis:100%; justify-content:flex-end; margin:2px 0 0;">
|
||||
<form method="post" action="index.php?action=rename_file" style="display:inline-flex; align-items:center; gap:4px; margin:0;">
|
||||
<input type="hidden" name="file_id" value="<?= (int)$f['id'] ?>">
|
||||
<input name="new_name" value="<?= e((string)pathinfo((string)$f['original_name'], PATHINFO_FILENAME)) ?>" placeholder="新文件名" required aria-label="新文件名" style="width:96px; height:24px; font-size:11.5px; padding:0 6px;">
|
||||
<button type="submit">重命名</button>
|
||||
</form>
|
||||
<form method="get" action="index.php" style="display:inline; margin:0;" onsubmit="return confirm('确认删除?')">
|
||||
<input type="hidden" name="action" value="delete_file">
|
||||
<input type="hidden" name="id" value="<?= (int)$f['id'] ?>">
|
||||
<button type="submit">删除</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php if (empty($editFiles)): ?>
|
||||
<div class="empty">暂无文件</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<form id="downloadFile<?= $fid ?>" method="get" action="index.php" hidden>
|
||||
<input type="hidden" name="action" value="download_file">
|
||||
<input type="hidden" name="id" value="<?= $fid ?>">
|
||||
</form>
|
||||
<form id="renameFile<?= $fid ?>" method="post" action="index.php?action=rename_file" hidden>
|
||||
<input type="hidden" name="file_id" value="<?= $fid ?>">
|
||||
</form>
|
||||
<form id="deleteFile<?= $fid ?>" method="get" action="index.php" hidden onsubmit="return confirm('确认删除?')">
|
||||
<input type="hidden" name="action" value="delete_file">
|
||||
<input type="hidden" name="id" value="<?= $fid ?>">
|
||||
</form>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<div class="form-foot">
|
||||
<a class="btn btn--plain" href="index.php">取消</a>
|
||||
@@ -372,7 +377,7 @@
|
||||
var sel=document.getElementById('plan_enabled');
|
||||
var wrap=document.getElementById('plan_wrap');
|
||||
function setPlanVisibility(){
|
||||
if(sel&&wrap){wrap.style.display=sel.value==='1'?'block':'none';}
|
||||
if(sel&&wrap){wrap.hidden=sel.value!=='1';}
|
||||
}
|
||||
if(sel&&wrap){
|
||||
sel.addEventListener('change',setPlanVisibility);
|
||||
|
||||
+44
-35
@@ -59,43 +59,26 @@
|
||||
身份信息由管理员在「用户管理」中维护;账户仅含账号与角色,无姓名 / 机构等资料字段。
|
||||
</div>
|
||||
</div>
|
||||
<div class="acct-col">
|
||||
<div class="editor-card">
|
||||
<div class="section-title" style="margin-top:0;">密码与安全</div>
|
||||
<div class="calc-group-note" style="margin:-4px 0 12px;">校验语义:验证当前密码 · 新密码 6-20 位 · 两次输入须一致</div>
|
||||
<form method="post">
|
||||
<div class="form-grid">
|
||||
<div class="form-field"><label for="p-old">当前密码</label><input id="p-old" name="current_password" type="password" placeholder="请输入当前密码" autocomplete="current-password" required></div>
|
||||
<div></div>
|
||||
<div class="form-field"><label for="p-new">新密码(6-20 位)</label><input id="p-new" name="new_password" type="password" placeholder="6-20 位" autocomplete="new-password" required></div>
|
||||
<div class="form-field"><label for="p-new2">确认新密码</label><input id="p-new2" name="confirm_password" type="password" placeholder="再次输入新密码" autocomplete="new-password" required></div>
|
||||
</div>
|
||||
<div style="display:flex; justify-content:space-between; align-items:center; margin-top:12px; flex-wrap:wrap; gap:10px;">
|
||||
<span class="cr-hint" style="margin:0;">初始密码由管理员发放,首次登录后请在此修改;忘记密码请联系管理员重置。</span>
|
||||
<button type="submit" class="btn btn--primary">保存新密码</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="editor-card">
|
||||
<div class="section-title" style="margin-top:0;">密码与安全</div>
|
||||
<div class="setting-row" style="border-top:0; padding-top:0;">
|
||||
<div>修改登录密码<div class="hint">校验当前密码 · 新密码 6-20 位 · 两次输入须一致</div></div>
|
||||
<button type="button" class="btn btn--primary" id="btnChangePassword" data-open-modal="password">修改密码</button>
|
||||
</div>
|
||||
<div class="editor-card">
|
||||
<div class="section-title" style="margin-top:0;">主题与偏好</div>
|
||||
<div class="setting-row" style="border-top:0; padding-top:0;">
|
||||
<div>日间 / 夜间主题<div class="hint">与左下角账户区的主题切换同源,即时生效并记住选择</div></div>
|
||||
<div class="seg" role="group" aria-label="主题偏好">
|
||||
<button type="button" data-theme-btn="day">日间</button>
|
||||
<button type="button" data-theme-btn="night">夜间</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-row">
|
||||
<div>到期与还款提醒<div class="hint">本地偏好 · 到期与还款事项统一在任务中心处理</div></div>
|
||||
<button type="button" class="switch" role="switch" aria-checked="true" data-switch data-pref-switch="remind" aria-label="到期与还款提醒"></button>
|
||||
<p class="cr-hint">初始密码由管理员发放,首次登录后请在此修改;忘记密码请联系管理员重置。</p>
|
||||
</div>
|
||||
<div class="editor-card">
|
||||
<div class="section-title" style="margin-top:0;">主题与偏好</div>
|
||||
<div class="setting-row" style="border-top:0; padding-top:0;">
|
||||
<div>日间 / 夜间主题<div class="hint">与左下角账户区的主题切换同源,即时生效并记住选择</div></div>
|
||||
<div class="seg" role="group" aria-label="主题偏好">
|
||||
<button type="button" data-theme-btn="day">日间</button>
|
||||
<button type="button" data-theme-btn="night">夜间</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="editor-card">
|
||||
<div class="section-title" style="margin-top:0;">会话</div>
|
||||
<div class="setting-row" style="border-top:0; padding-top:0;">
|
||||
<div>退出登录<div class="hint">结束当前会话并返回登录页;左下账户区亦有同一入口</div></div>
|
||||
<a class="btn btn--plain" href="index.php?action=logout" style="color:var(--red); border-color:var(--red-line);">退出登录</a>
|
||||
</div>
|
||||
<div class="setting-row">
|
||||
<div>到期与还款提醒<div class="hint">本地偏好 · 到期与还款事项统一在任务中心处理</div></div>
|
||||
<button type="button" class="switch" role="switch" aria-checked="true" data-switch data-pref-switch="remind" aria-label="到期与还款提醒"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -115,4 +98,30 @@
|
||||
} catch (e) {}
|
||||
})();
|
||||
</script>
|
||||
<?php pageFooter(); exit;
|
||||
<?php
|
||||
ob_start();
|
||||
?>
|
||||
<div class="modal-card" data-modal="password" role="dialog" aria-modal="true" aria-labelledby="pwd-modal-title">
|
||||
<form method="post" autocomplete="off">
|
||||
<div class="modal-head">
|
||||
<div class="modal-title" id="pwd-modal-title">修改密码</div>
|
||||
<button type="button" class="drawer-close" data-close-modal aria-label="关闭">✕</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="calc-group-note" style="margin:0 0 12px;">校验语义:验证当前密码 · 新密码 6-20 位 · 两次输入须一致</div>
|
||||
<div class="form-grid" style="grid-template-columns:1fr; padding-top:0;">
|
||||
<div class="form-field"><label for="p-old">当前密码</label><input id="p-old" name="current_password" type="password" placeholder="请输入当前密码" autocomplete="current-password" required></div>
|
||||
<div class="form-field"><label for="p-new">新密码(6-20 位)</label><input id="p-new" name="new_password" type="password" placeholder="6-20 位" autocomplete="new-password" required minlength="6" maxlength="20"></div>
|
||||
<div class="form-field"><label for="p-new2">确认新密码</label><input id="p-new2" name="confirm_password" type="password" placeholder="再次输入新密码" autocomplete="new-password" required minlength="6" maxlength="20"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-foot">
|
||||
<button type="button" class="btn btn--plain" data-close-modal>取消</button>
|
||||
<button type="submit" class="btn btn--primary">保存新密码</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
$passwordModalHtml = ob_get_clean();
|
||||
pageFooter(true, $passwordModalHtml);
|
||||
exit;
|
||||
|
||||
+29
-11
@@ -388,6 +388,7 @@ img { display: block; }
|
||||
transition: opacity 250ms var(--ease-out);
|
||||
}
|
||||
.v-fusion[data-modal-open] .modal-scrim { opacity: 1; pointer-events: auto; }
|
||||
.v-fusion[data-modal-open] .content-shell { transform: scale(0.985); filter: var(--pushback-filter); }
|
||||
.v-fusion .modal-card {
|
||||
position: fixed; left: 50%; top: 50%; z-index: 51;
|
||||
width: min(520px, 94vw); max-height: min(640px, 90vh);
|
||||
@@ -397,10 +398,13 @@ img { display: block; }
|
||||
backdrop-filter: blur(28px) saturate(180%);
|
||||
border: 1px solid var(--gold-line); border-radius: 16px;
|
||||
box-shadow: var(--shadow-drawer);
|
||||
transform: translate(-50%, -50%) scale(0.96); opacity: 0; pointer-events: none;
|
||||
transition: transform 220ms var(--ease-out), opacity 220ms ease;
|
||||
transform: translate(-50%, -50%) scale(0.96); opacity: 0; pointer-events: none; visibility: hidden;
|
||||
transition: transform 220ms var(--ease-out), opacity 220ms ease, visibility 220ms ease;
|
||||
}
|
||||
.v-fusion[data-modal-open="import"] .modal-card[data-modal="import"],
|
||||
.v-fusion[data-modal-open="password"] .modal-card[data-modal="password"] {
|
||||
transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; visibility: visible;
|
||||
}
|
||||
.v-fusion[data-modal-open] .modal-card { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
|
||||
.v-fusion .modal-head { padding: 18px 24px 14px; border-bottom: 1px solid var(--hairline); }
|
||||
.v-fusion .modal-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
|
||||
.v-fusion .modal-body { flex: 1; overflow-y: auto; padding: 16px 24px; }
|
||||
@@ -542,16 +546,30 @@ img { display: block; }
|
||||
.v-fusion .timeline .plan-row[data-tl="due"]::before { border-color: var(--orange); }
|
||||
.v-fusion .timeline .plan-row[data-tl="over"]::before { border-color: var(--red); }
|
||||
|
||||
/* 表单页:右侧摘要 + 底部操作区 */
|
||||
/* 表单页:等宽两列三行卡片 + 底部操作区 */
|
||||
.v-fusion .editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
|
||||
.v-fusion .editor-page { display: flex; flex-direction: column; gap: 18px; max-width: 880px; }
|
||||
.v-fusion .editor-page {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||
gap: 18px;
|
||||
align-items: start;
|
||||
}
|
||||
.v-fusion .editor-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 20px 22px; }
|
||||
.v-fusion .editor-page .plan-scroll { overflow-x: auto; margin-top: 12px; }
|
||||
.v-fusion .editor-page .plan-scroll[hidden] { display: none; }
|
||||
.v-fusion .summary-card {
|
||||
position: sticky; top: 34px;
|
||||
background: var(--surface); border: 1px solid var(--gold-line); border-radius: 14px;
|
||||
padding: 16px 18px;
|
||||
}
|
||||
.v-fusion .editor-page > .summary-card { position: static; }
|
||||
.v-fusion .editor-page .summary-banner { grid-template-columns: 1fr; }
|
||||
.v-fusion .editor-page .summary-banner .summary-row {
|
||||
flex-direction: row; justify-content: space-between; align-items: baseline;
|
||||
gap: 10px; border-top: 1px solid var(--hairline); padding: 7px 0;
|
||||
}
|
||||
.v-fusion .editor-page .summary-banner .summary-row:first-child { border-top: 0; padding-top: 0; }
|
||||
.v-fusion .editor-page .summary-banner .summary-row b { text-align: right; }
|
||||
.v-fusion .summary-banner {
|
||||
display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px;
|
||||
}
|
||||
@@ -752,9 +770,9 @@ img { display: block; }
|
||||
.v-fusion .rev-line { margin-top: 10px; font-size: 12px; color: var(--gold); font-weight: 600; line-height: 1.6; }
|
||||
.v-fusion .calc-note { margin-top: 10px; font-size: 11.5px; color: var(--text-3); line-height: 1.6; }
|
||||
|
||||
/* 个人账户中心:左身份摘要(只读) + 右分区设置 */
|
||||
.v-fusion .acct-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; max-width: 1080px; }
|
||||
.v-fusion .id-card { position: sticky; top: 34px; }
|
||||
/* 个人账户中心:单列同宽卡片(个人信息 → 密码与安全 → 主题偏好) */
|
||||
.v-fusion .acct-grid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; max-width: 720px; }
|
||||
.v-fusion .id-card { position: static; }
|
||||
.v-fusion .id-head { display: flex; align-items: center; gap: 14px; }
|
||||
.v-fusion .id-avatar {
|
||||
width: 52px; height: 52px; border-radius: 14px; flex: 0 0 auto;
|
||||
@@ -820,7 +838,8 @@ img { display: block; }
|
||||
.v-fusion .scrim, .v-fusion .toast, .v-fusion .content-shell, .v-fusion .switch, .v-fusion .switch::after { transition-duration: 120ms; }
|
||||
.v-fusion .drawer { transform: none; opacity: 0; visibility: hidden; transition: opacity 150ms ease, visibility 150ms ease; }
|
||||
.v-fusion[data-drawer-open] .drawer { opacity: 1; visibility: visible; }
|
||||
.v-fusion[data-drawer-open] .content-shell { transform: none; filter: none; }
|
||||
.v-fusion[data-drawer-open] .content-shell,
|
||||
.v-fusion[data-modal-open] .content-shell { transform: none; filter: none; }
|
||||
.v-fusion .modal-card { transform: translate(-50%, -50%); transition: opacity 150ms ease; }
|
||||
.v-fusion .toast[data-hidden] { transform: none; opacity: 0; }
|
||||
.v-fusion .stagger-in { opacity: 0; transform: none; }
|
||||
@@ -853,7 +872,7 @@ img { display: block; }
|
||||
============================================================ */
|
||||
@media (max-width: 1279px) {
|
||||
.v-fusion .stats { grid-template-columns: repeat(2, 1fr); }
|
||||
.v-fusion .detail-grid, .v-fusion .editor-grid, .v-fusion .calc-grid { grid-template-columns: 1fr; }
|
||||
.v-fusion .detail-grid, .v-fusion .editor-grid, .v-fusion .editor-page, .v-fusion .calc-grid { grid-template-columns: 1fr; }
|
||||
.v-fusion .side-panel, .v-fusion .summary-card { position: static; }
|
||||
.v-fusion .summary-banner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
}
|
||||
@@ -910,7 +929,6 @@ img { display: block; }
|
||||
@media (max-width: 1279px) {
|
||||
.v-fusion .calc-side { position: static; }
|
||||
.v-fusion .lp-brand { flex-basis: 42%; min-width: 380px; padding: 44px 40px 36px; }
|
||||
.v-fusion .acct-grid { grid-template-columns: 280px minmax(0, 1fr); }
|
||||
}
|
||||
@media (max-width: 1023px) {
|
||||
.v-fusion .dir-cols { grid-template-columns: 1fr; }
|
||||
|
||||
+33
-3
@@ -101,8 +101,38 @@ function closeOverlays() {
|
||||
}
|
||||
|
||||
/* ---------- 弹层(导入等,服务端已渲染,切属性即可) ---------- */
|
||||
function openModal(name) { root()?.setAttribute("data-modal-open", name); }
|
||||
function closeModal() { root()?.removeAttribute("data-modal-open"); }
|
||||
let modalReturnFocus = null;
|
||||
function openModal(name, trigger) {
|
||||
const r = root();
|
||||
if (!r || !name) return;
|
||||
modalReturnFocus = trigger || document.activeElement;
|
||||
r.setAttribute("data-modal-open", name);
|
||||
const card = r.querySelector(`.modal-card[data-modal="${name}"]`);
|
||||
const focusEl = card && (
|
||||
card.querySelector("input:not([type=hidden]),select,textarea") ||
|
||||
card.querySelector("button.btn--primary,button")
|
||||
);
|
||||
if (focusEl) requestAnimationFrame(() => { try { focusEl.focus(); } catch (e) {} });
|
||||
}
|
||||
function closeModal() {
|
||||
const r = root();
|
||||
if (!r) return;
|
||||
const name = r.getAttribute("data-modal-open");
|
||||
if (name) {
|
||||
const card = r.querySelector(`.modal-card[data-modal="${name}"]`);
|
||||
if (card) {
|
||||
card.querySelectorAll('input[type="password"]').forEach((i) => { i.value = ""; });
|
||||
card.querySelectorAll(".form-field[data-error]").forEach((f) => f.removeAttribute("data-error"));
|
||||
card.querySelectorAll("[data-err], .field-err").forEach((el) => { el.textContent = ""; });
|
||||
}
|
||||
}
|
||||
r.removeAttribute("data-modal-open");
|
||||
const back = modalReturnFocus;
|
||||
modalReturnFocus = null;
|
||||
if (back && typeof back.focus === "function" && document.contains(back)) {
|
||||
try { back.focus(); } catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- 表单错误提示(与定版同结构) ---------- */
|
||||
function setErr(input, msg) {
|
||||
@@ -1017,7 +1047,7 @@ document.addEventListener("click", (e) => {
|
||||
const dtab = t.closest("[data-dtab]");
|
||||
if (dtab) { switchDrawerTab(dtab.dataset.dtab); return; }
|
||||
const openModalBtn = t.closest("[data-open-modal]");
|
||||
if (openModalBtn) { openModal(openModalBtn.dataset.openModal); return; }
|
||||
if (openModalBtn) { openModal(openModalBtn.dataset.openModal, openModalBtn); return; }
|
||||
if (t.closest("[data-close-modal]")) { closeModal(); return; }
|
||||
const opener = t.closest("[data-open-detail]");
|
||||
if (opener) { if (!t.closest("a,button,input,select,textarea,label")) openDetail(opener.dataset.openDetail); return; }
|
||||
|
||||
+4
-3
@@ -168,7 +168,7 @@ function pageHeader(array $me, ?int $taskCount = null): void
|
||||
<?php
|
||||
}
|
||||
|
||||
function pageFooter(bool $withDrawer = true): void
|
||||
function pageFooter(bool $withDrawer = true, ?string $extraModalHtml = null): void
|
||||
{
|
||||
$isAdmin = isAdmin();
|
||||
?>
|
||||
@@ -178,9 +178,9 @@ function pageFooter(bool $withDrawer = true): void
|
||||
<div class="scrim" data-close-drawer></div>
|
||||
<aside class="drawer" role="dialog" aria-modal="true" aria-label="档案详情" data-drawer></aside>
|
||||
<?php endif; ?>
|
||||
<?php if ($isAdmin): ?>
|
||||
<div class="modal-scrim" data-close-modal></div>
|
||||
<div class="modal-card" role="dialog" aria-modal="true" aria-label="导入档案">
|
||||
<?php if ($isAdmin): ?>
|
||||
<div class="modal-card" data-modal="import" role="dialog" aria-modal="true" aria-label="导入档案">
|
||||
<form method="post" action="index.php?action=import_archives" enctype="multipart/form-data">
|
||||
<div class="modal-head">
|
||||
<div class="modal-title">导入档案</div>
|
||||
@@ -207,6 +207,7 @@ function pageFooter(bool $withDrawer = true): void
|
||||
</form>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?= $extraModalHtml ?? '' ?>
|
||||
</div>
|
||||
</body></html>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user