HEL-405: make directory rows fully clickable and show all archives

Directory management rows are now one hit target except rename/delete, and the selected-directory table lists every archive instead of the first six.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
美术师
2026-09-02 21:37:16 +08:00
co-authored by Cursor multica-agent
parent de7b4f79a2
commit 7ba117ed9a
3 changed files with 31 additions and 14 deletions
+14 -9
View File
@@ -740,14 +740,19 @@ img { display: block; }
.v-fusion .dir-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--hairline); }
.v-fusion .dir-col-title { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-2); }
.v-fusion .dir-col-title small { color: var(--text-3); font-weight: 500; margin-left: 6px; letter-spacing: 0; }
.v-fusion .dir-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 14px; font-size: 13px; border-bottom: 1px solid var(--hairline); cursor: pointer; text-align: left; transition: background-color 120ms ease; }
.v-fusion .dir-row:last-child { border-bottom: 0; }
@media (hover: hover) and (pointer: fine) { .v-fusion .dir-row:hover { background: var(--row-hover); } }
.v-fusion .dir-row[data-active] { background: var(--accent-soft); }
.v-fusion .dir-row[data-active] .dir-name { color: var(--accent); }
.v-fusion .dir-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-fusion .dir-row[data-disabled] .dir-name { color: var(--text-3); font-weight: 500; }
.v-fusion .dir-acts { margin-left: auto; display: flex; gap: 2px; flex: 0 0 auto; }
.v-fusion .dir-row-wrap { display: flex; align-items: center; border-bottom: 1px solid var(--hairline); transition: background-color 120ms ease; }
.v-fusion .dir-row-wrap:last-child { border-bottom: 0; }
@media (hover: hover) and (pointer: fine) { .v-fusion .dir-row-wrap:hover { background: var(--row-hover); } }
.v-fusion .dir-row-wrap[data-active] { background: var(--accent-soft); }
.v-fusion .dir-row-wrap[data-active] .dir-name { color: var(--accent); }
.v-fusion .dir-row {
display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; width: 100%;
padding: 9px 14px; font-size: 13px; cursor: pointer; text-align: left; color: inherit;
}
.v-fusion .dir-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; border-radius: 6px; }
.v-fusion .dir-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.v-fusion .dir-row-wrap[data-disabled] .dir-name, .v-fusion .dir-row[data-disabled] .dir-name { color: var(--text-3); font-weight: 500; }
.v-fusion .dir-acts { margin-left: 0; display: flex; gap: 2px; flex: 0 0 auto; position: relative; z-index: 1; padding-right: 8px; }
.v-fusion .dir-acts button { font-size: 11.5px; color: var(--text-3); padding: 2px 6px; border-radius: 5px; transition: background-color 120ms ease, color 120ms ease; }
@media (hover: hover) and (pointer: fine) { .v-fusion .dir-acts button:hover { background: var(--hover); color: var(--accent); } }
.v-fusion .dir-rename { height: 24px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--focus-ring); background: var(--surface); font-size: 12.5px; outline: none; max-width: 150px; }
@@ -1291,4 +1296,4 @@ img { display: block; }
/* 目录行操作链接与样板 button 同形 */
.v-fusion .dir-acts a { font-size: 11.5px; color: var(--text-3); padding: 2px 6px; border-radius: 5px; transition: background-color 120ms ease, color 120ms ease; }
@media (hover: hover) and (pointer: fine) { .v-fusion .dir-acts a:hover { background: var(--hover); color: var(--accent); } }
.v-fusion .dir-row a.nav-badge { color: inherit; }
.v-fusion .dir-row .nav-badge { color: inherit; flex: 0 0 auto; }
+7
View File
@@ -1079,6 +1079,7 @@ document.addEventListener("click", (e) => {
const openModalBtn = t.closest("[data-open-modal]");
if (openModalBtn) { openModal(openModalBtn.dataset.openModal, openModalBtn); return; }
if (t.closest("[data-close-modal]")) { closeModal(); return; }
if (t.closest(".dir-acts")) return;
const opener = t.closest("[data-open-detail]");
if (opener) { if (!t.closest("a,button,input,select,textarea,label")) openDetail(opener.dataset.openDetail); return; }
if (t.closest("[data-close-drawer]")) { closeOverlays(); return; }
@@ -1102,6 +1103,12 @@ document.addEventListener("input", (e) => {
document.addEventListener("keydown", (e) => {
if (e.key === "Enter" && e.target.matches && e.target.matches("[data-open-detail]")) openDetail(e.target.dataset.openDetail);
if (e.target.matches && e.target.matches("a.dir-row") && (e.key === "Enter" || e.key === " ")) {
if (e.key === " ") {
e.preventDefault();
e.target.click();
}
}
if (popKind === "menu" && menuEl && !menuEl.hidden) {
const opts = $$(".jn-menu-opt:not(:disabled)", menuEl);
if (e.key === "Escape") { e.preventDefault(); closePops(); return; }
+10 -5
View File
@@ -2737,9 +2737,14 @@ if ($action === 'home' && $view === 'dirs') {
if ($level >= 2) { $qs['d2'] = $level === 2 ? $id : $d2; }
if ($level >= 3) { $qs['d3'] = $id; }
$href = 'index.php?' . http_build_query($qs);
$html .= '<div class="dir-row"' . ($id === $selId ? ' data-active' : '') . '>'
. '<a class="dir-name" href="' . e($href) . '" title="查看下级">' . e((string)$n['name']) . '</a>'
. '<a class="nav-badge num" href="' . e($href) . '">' . $dirArchiveCount($id) . '</a>';
$name = (string)$n['name'];
$html .= '<div class="dir-row-wrap"' . ($id === $selId ? ' data-active' : '') . '>'
. '<a class="dir-row" href="' . e($href) . '" title="查看下级"'
. ($id === $selId ? ' aria-current="true"' : '')
. ' aria-label="查看下级:' . e($name) . '">'
. '<span class="dir-name">' . e($name) . '</span>'
. '<span class="nav-badge num">' . $dirArchiveCount($id) . '</span>'
. '</a>';
if ($isAdmin) {
$html .= '<span class="dir-acts">'
. '<a href="index.php?action=edit_dir&id=' . $id . '" title="改名">改名</a>'
@@ -2787,7 +2792,7 @@ if ($action === 'home' && $view === 'dirs') {
<table>
<thead><tr><th>档案名称</th><th>借款人</th><th>贷款机构</th><th>类型</th><th class="cell-right">剩余额度</th><th>状态</th></tr></thead>
<tbody>
<?php foreach (array_slice($previewRows, 0, 6) as $a):
<?php foreach ($previewRows as $a):
$s = archiveStatusWithConfig($a['end_date'], getArchiveFinanceConfig($financeAllGlobal, (int)$a['id'])); ?>
<tr data-open-detail="<?= (int)$a['id'] ?>" tabindex="0" role="button" aria-label="查看 <?= e((string)$a['borrower']) ?> 档案详情">
<td><div class="cell-main"><?= e((string)$a['name']) ?></div></td>
@@ -2802,7 +2807,7 @@ if ($action === 'home' && $view === 'dirs') {
</table>
</div>
<div class="filter-bar" style="margin:12px 0 0;">
<span class="filter-note"><?= count($previewRows) > 6 ? '仅显示前 6 笔 · 共 ' . count($previewRows) . ' 笔' : '共 ' . count($previewRows) . ' 笔' ?></span>
<span class="filter-note">共 <?= count($previewRows) ?> 笔</span>
<span class="filter-spacer"></span>
<a class="btn btn--plain" href="index.php?dir_id=<?= $selDirId ?>">在档案列表中查看 ›</a>
</div>