Commit ee4045b8 by DaiJiezhang

Refine wechat list workspace

parent a3e29145
......@@ -242,27 +242,13 @@ function getSelectedRecord(moduleKey) {
}
/**
* 代码作用(白话):渲染页面顶部的标题、说明和操作按钮,让路由切换后头部信息能跟着模块变化;关联文件:F:/Project/xyw_console/index.html、F:/Project/xyw_console/src/router/index.js;关联逻辑(调用链/消息链/数据流):renderModule() -> renderHeader() -> pageHeader.innerHTML
* 代码作用(白话):处理页面顶部壳层区域,但当前按最新界面要求不再渲染面包屑和顶部按钮,避免旧头部继续占住企微主工作区;关联文件:F:/Project/xyw_console/index.html、F:/Project/xyw_console/src/router/index.js、F:/Project/xyw_console/styles.css;关联逻辑(调用链/消息链/数据流):renderModule() -> renderHeader() -> pageHeader.innerHTML 置空
*/
function renderHeader(moduleKey) {
if (!pageHeader) {
return;
}
const config = MODULE_CONFIG[moduleKey] || MODULE_CONFIG.overview;
const actionsHtml = (config.actions || [])
.map((action) => `<button type="button" class="header-action ${escapeHtml(action.kind)}">${escapeHtml(action.text)}</button>`)
.join('');
pageHeader.innerHTML = `
<div class="workspace-heading">
<div class="heading-copy">
<p class="heading-caption">本地资产后台</p>
<h2 class="page-title">${escapeHtml(config.title)}</h2>
<p class="page-summary">${escapeHtml(config.description || '')}</p>
</div>
<div class="header-actions">${actionsHtml}</div>
</div>
`;
pageHeader.innerHTML = '';
}
/**
......@@ -492,6 +478,7 @@ function renderExternalRuntime(moduleKey) {
wechatText: {
allRecords: '全部记录',
add: '新增资料',
sync: '同步数据',
reset: '重置',
realName: '姓名',
account: '账号',
......@@ -517,6 +504,8 @@ function renderExternalRuntime(moduleKey) {
pageSuffix: ' 条/页',
searchPlaceholder: '搜索姓名、账号、手机号、部门或实名人',
loadFailed: '加载企微列表失败,请确认本地后端已启动',
syncSuccess: '企微列表已刷新',
syncFailed: '同步数据失败,请稍后重试',
openFailed: '打开企微详情失败,请稍后重试',
imageRemoved: '已删除手机图片',
imageRemoveFailed: '删除手机图片失败,请稍后重试'
......@@ -719,10 +708,3 @@ function initPage() {
window.updateActiveNav = updateActiveNav;
window.renderModule = renderModule;
document.addEventListener('DOMContentLoaded', initPage);
......@@ -312,6 +312,21 @@
}
/**
* 代码作用(白话):处理“同步数据”按钮,按当前兼容方案重新拉取企微列表,避免在未知后端同步接口上误触发不确定副作用;关联文件:F:/Project/xyw_console/app-v2.js、F:/Project/xyw_console/src/modules/shared/wechat-api-client.js;关联逻辑(调用链/消息链/数据流):同步数据按钮 -> handleSync() -> loadAllRecords() -> allRecordsCache/visibleRows 刷新。
*/
async function handleSync() {
loading.value = true;
try {
await loadAllRecords();
window.ElementPlus?.ElMessage?.success?.(props.wechatText.syncSuccess);
} catch (error) {
props.notifyError(error.message || props.wechatText.syncFailed);
} finally {
loading.value = false;
}
}
/**
* 代码作用(白话):统一处理企微列表的查看和编辑动作,把副作用交给外层注入的动作入口;关联文件:F:/Project/xyw_console/app-v2.js、F:/Project/xyw_console/src/modules/wechat/wechat-detail-drawer.js;关联逻辑(调用链/消息链/数据流):操作按钮 -> handleRowAction() -> openDrawer() -> 详情抽屉或编辑弹窗打开。
*/
async function handleRowAction(mode, recordId) {
......@@ -375,6 +390,7 @@
handlePageSizeChange,
resetTableState,
handleAdd,
handleSync,
handleRowAction,
handleReplaceImage,
handleRemoveImage,
......@@ -432,7 +448,10 @@
</div>
</div>
<div class="toolbar-right">
<button class="btn btn-primary" type="button" @click="handleAdd" style="height: 32px; padding: 0 16px;">{{ wechatText.add }}</button>
<div class="toolbar-primary-actions">
<button class="btn btn-primary" type="button" @click="handleAdd" style="height: 32px; padding: 0 16px;">{{ wechatText.add }}</button>
<button class="btn btn-primary" type="button" @click="handleSync" style="height: 32px; padding: 0 16px;">{{ wechatText.sync }}</button>
</div>
<button class="btn-reset btn-reset-refined" type="button" @click="resetTableState">{{ wechatText.reset }}</button>
</div>
</div>
......
......@@ -1143,3 +1143,10 @@
.toolbar-primary-actions {
display: flex;
align-items: center;
gap: 8px;
}
......@@ -2951,6 +2951,10 @@ button {
.heading-copy { display: grid; gap: 8px; flex: 1 1 420px; min-width: 0; max-width: 760px; align-content: start; }
.heading-caption-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.heading-caption { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7a90; }
.breadcrumb-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 42px; font-size: 14px; line-height: 1.5; color: #667085; }
.breadcrumb-item { color: #667085; font-weight: 600; }
.breadcrumb-item.current { color: #0f172a; font-weight: 800; }
.breadcrumb-separator { color: #98a2b3; font-weight: 600; }
.heading-badge { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; background: #eef4ff; color: #2554cf; font-size: 12px; font-weight: 700; }
.page-title { margin: 0; font-size: 30px; line-height: 1.08; font-weight: 800; color: #0f172a; }
.page-summary { margin: 0; color: #667085; font-size: 14px; line-height: 1.5; }
......@@ -3073,3 +3077,4 @@ button {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment