refactor: 整合财务系统到主应用并重构后端架构
主要变更: - 将独立的 web-finance 应用整合到 web-antd 主应用中 - 重命名 backend-mock 为 backend,增强后端功能 - 新增财务模块 API 端点(账户、预算、类别、交易) - 增强财务仪表板和报表功能 - 添加 SQLite 数据存储支持和财务数据导入脚本 - 优化路由结构,删除冗余的 finance-system 模块 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import { initPreferences } from '@vben/preferences';
|
||||
import { unmountGlobalLoading } from '@vben/utils';
|
||||
|
||||
import { overridesPreferences } from './preferences';
|
||||
import './custom.css';
|
||||
|
||||
/**
|
||||
* 应用初始化完成之后再进行页面加载渲染
|
||||
@@ -29,3 +30,68 @@ async function initApplication() {
|
||||
}
|
||||
|
||||
initApplication();
|
||||
|
||||
// Flatten FinWise Pro menu globally
|
||||
function flattenFinWiseProMenu() {
|
||||
const submenus = document.querySelectorAll('.vben-sub-menu');
|
||||
let finwiseMenu: Element | null = null;
|
||||
|
||||
submenus.forEach(menu => {
|
||||
const titleEl = menu.querySelector('.vben-sub-menu-content__title');
|
||||
if (titleEl?.textContent?.includes('FinWise Pro')) {
|
||||
finwiseMenu = menu;
|
||||
}
|
||||
});
|
||||
|
||||
if (!finwiseMenu) return;
|
||||
|
||||
const parentMenu = finwiseMenu.parentElement;
|
||||
const childrenUL = finwiseMenu.querySelector('.vben-menu');
|
||||
|
||||
if (!childrenUL || !parentMenu) return;
|
||||
|
||||
// Check if already processed
|
||||
if ((finwiseMenu as HTMLElement).getAttribute('data-hide-finwise') === 'true') return;
|
||||
|
||||
// Move all children to the parent menu
|
||||
const children = Array.from(childrenUL.children);
|
||||
children.forEach(child => {
|
||||
parentMenu.insertBefore(child, finwiseMenu);
|
||||
});
|
||||
|
||||
// Mark for hiding via CSS and hide directly
|
||||
(finwiseMenu as HTMLElement).setAttribute('data-hide-finwise', 'true');
|
||||
(finwiseMenu as HTMLElement).style.display = 'none';
|
||||
}
|
||||
|
||||
// Wait for DOM to be ready, then run the flatten function
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// Run multiple times with delays to catch menu rendering
|
||||
setTimeout(() => flattenFinWiseProMenu(), 500);
|
||||
setTimeout(() => flattenFinWiseProMenu(), 1000);
|
||||
setTimeout(() => flattenFinWiseProMenu(), 2000);
|
||||
setTimeout(() => flattenFinWiseProMenu(), 3000);
|
||||
});
|
||||
} else {
|
||||
// DOM is already loaded
|
||||
setTimeout(() => flattenFinWiseProMenu(), 500);
|
||||
setTimeout(() => flattenFinWiseProMenu(), 1000);
|
||||
setTimeout(() => flattenFinWiseProMenu(), 2000);
|
||||
setTimeout(() => flattenFinWiseProMenu(), 3000);
|
||||
}
|
||||
|
||||
// Watch for DOM changes
|
||||
setTimeout(() => {
|
||||
const observer = new MutationObserver(() => {
|
||||
setTimeout(flattenFinWiseProMenu, 100);
|
||||
});
|
||||
|
||||
const body = document.body;
|
||||
if (body) {
|
||||
observer.observe(body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
}
|
||||
}, 500);
|
||||
|
||||
Reference in New Issue
Block a user