突出赋能中心快捷入口,支持功能页面直接访问

This commit is contained in:
2026-11-11 14:14:20 +08:00
parent 3b2cc19021
commit 4f25f40915
3 changed files with 28 additions and 3 deletions
+5
View File
@@ -584,6 +584,11 @@ button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px s
.activity-photos:empty { display:none; } .activity-photos:empty { display:none; }
.activity-photos img { width:120px; height:90px; object-fit:cover; border-radius:8px; border:1px solid var(--line); cursor:zoom-in; } .activity-photos img { width:120px; height:90px; object-fit:cover; border-radius:8px; border:1px solid var(--line); cursor:zoom-in; }
.center-toolbar { margin-bottom:24px; } .center-toolbar { margin-bottom:24px; }
.center-shortcuts { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px; width:100%; padding:22px 24px; background:var(--primary-soft); border:1px solid #d5e5da; border-radius:12px; }
.center-shortcuts strong { font-size:18px; }
.center-shortcuts p { margin:5px 0 0; color:var(--muted); font-size:13px; }
.center-shortcut-actions { display:flex; flex-wrap:wrap; gap:10px; }
.center-shortcut-actions a { text-decoration:none; display:inline-flex; align-items:center; }
.center-tabs { max-width:500px; margin-bottom:24px; } .center-tabs { max-width:500px; margin-bottom:24px; }
.center-check-status { padding:18px 20px; background:var(--primary-soft); border:1px solid #d5e5da; border-radius:12px; margin-bottom:20px; } .center-check-status { padding:18px 20px; background:var(--primary-soft); border:1px solid #d5e5da; border-radius:12px; margin-bottom:20px; }
.center-subhead { margin-top:32px; } .center-subhead { margin-top:32px; }
+6 -2
View File
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WorkLog · 活动记录</title> <title>WorkLog · 活动记录</title>
<meta name="theme-color" content="#f5f7f5" /> <meta name="theme-color" content="#f5f7f5" />
<link rel="stylesheet" href="/assets/styles.css?v=16" /> <link rel="stylesheet" href="/assets/styles.css?v=17" />
</head> </head>
<body> <body>
<div id="app"> <div id="app">
@@ -115,6 +115,10 @@
<h2>活动墙</h2> <h2>活动墙</h2>
<p class="muted" id="feed-sub">看看大家都在参加什么</p> <p class="muted" id="feed-sub">看看大家都在参加什么</p>
</div> </div>
<section class="center-shortcuts" aria-label="赋能中心一楼快捷入口">
<div><strong>赋能中心一楼</strong><p>上传活动照片,完成每日清点,申请物品借用</p></div>
<div class="center-shortcut-actions"><a class="btn primary" href="#center-records">一楼活动记录</a><a class="btn" href="#center-assets">物品清点与借出</a></div>
</section>
<div class="filters"> <div class="filters">
<input id="feed-q" aria-label="搜索活动或地点" placeholder="搜索活动 / 地点" type="search" /> <input id="feed-q" aria-label="搜索活动或地点" placeholder="搜索活动 / 地点" type="search" />
<select id="feed-dept" aria-label="按部门筛选"><option value="">全部部门</option></select> <select id="feed-dept" aria-label="按部门筛选"><option value="">全部部门</option></select>
@@ -292,7 +296,7 @@
<div id="toast" class="toast hidden" role="status" aria-live="polite"></div> <div id="toast" class="toast hidden" role="status" aria-live="polite"></div>
<script src="/js/app.js?v=23"></script> <script src="/js/app.js?v=24"></script>
</div> </div>
</body> </body>
</html> </html>
+17 -1
View File
@@ -150,7 +150,7 @@
showForcePassword(); showForcePassword();
return; return;
} }
show("feed"); if (!openCenterFromHash()) show("feed");
} }
// ------------------------------------------------------------- 强制设置密码 // ------------------------------------------------------------- 强制设置密码
@@ -1021,6 +1021,21 @@
let centerItems = []; let centerItems = [];
let centerCanReview = false; let centerCanReview = false;
let centerRecords = []; let centerRecords = [];
function openCenterFromHash() {
if (!state.me || !['#center', '#center-records', '#center-assets'].includes(location.hash)) return false;
centerTab = location.hash === '#center-assets' ? 'assets' : 'records';
$$('[data-center-tab]').forEach(button => button.classList.toggle('active', button.dataset.centerTab === centerTab));
$('#center-records').classList.toggle('hidden', centerTab !== 'records');
$('#center-assets').classList.toggle('hidden', centerTab !== 'assets');
show('center');
return true;
}
window.addEventListener('hashchange', openCenterFromHash);
$$('.center-shortcut-actions a').forEach(link => link.addEventListener('click', event => {
event.preventDefault();
history.replaceState(null, '', link.hash);
openCenterFromHash();
}));
async function loadCenter() { async function loadCenter() {
try { try {
if (centerTab === 'records') { if (centerTab === 'records') {
@@ -1044,6 +1059,7 @@
} }
$$('[data-center-tab]').forEach(button => button.addEventListener('click', () => { $$('[data-center-tab]').forEach(button => button.addEventListener('click', () => {
centerTab = button.dataset.centerTab; centerTab = button.dataset.centerTab;
history.replaceState(null, '', '#center-' + centerTab);
$$('[data-center-tab]').forEach(b => b.classList.toggle('active', b === button)); $$('[data-center-tab]').forEach(b => b.classList.toggle('active', b === button));
$('#center-records').classList.toggle('hidden', centerTab !== 'records'); $('#center-records').classList.toggle('hidden', centerTab !== 'records');
$('#center-assets').classList.toggle('hidden', centerTab !== 'assets'); $('#center-assets').classList.toggle('hidden', centerTab !== 'assets');