- shared/types/logging.ts: 新增 canvas + canvas-window 日志分类 - nav-config.ts: 移除合规素材库导航项 (合规素材库页面待后续实现) - package.json + lock: 补充 zustand 依赖声明 - tsconfig.node.json: 补充 @shared/* 路径别名 (主进程导入) - .gitignore: 排除 infinite_canvas_140 目录 Co-Authored-By: Claude <noreply@anthropic.com>
187 lines
4.8 KiB
TypeScript
187 lines
4.8 KiB
TypeScript
// ============================================================
|
|
// 导航栏配置 —— 按版本(个人版 / 企业版)定义导航项
|
|
// 每个导航项的 iconSrc 指向 src/assets/header_actions/ 下的 SVG 图标
|
|
// ============================================================
|
|
|
|
import type { NavItemConfig } from './types';
|
|
|
|
// ---------- SVG 图标导入(?raw = 内联渲染,使 currentColor 生效)----------
|
|
import announcementsSvg from '@/assets/header_actions/announcements.svg?raw';
|
|
import accountSvg from '@/assets/header_actions/account.svg?raw';
|
|
import membershipSvg from '@/assets/header_actions/membership.svg?raw';
|
|
import rechargeSvg from '@/assets/header_actions/recharge.svg?raw';
|
|
import billingSvg from '@/assets/header_actions/billing.svg?raw';
|
|
import orderDetailsSvg from '@/assets/header_actions/order_details.svg?raw';
|
|
import wechatWorkSvg from '@/assets/header_actions/wechat_work.svg?raw';
|
|
import settingsSvg from '@/assets/header_actions/settings.svg?raw';
|
|
import signOutSvg from '@/assets/header_actions/sign_out.svg?raw';
|
|
import projectManagementSvg from '@/assets/header_actions/project_management.svg?raw';
|
|
|
|
// ============================================================
|
|
// 个人版导航项
|
|
// ============================================================
|
|
|
|
/** 个人版 — 左侧 */
|
|
const personalLeft: NavItemConfig[] = [
|
|
|
|
];
|
|
|
|
/** 个人版 — 右侧(从左至右排列) */
|
|
const personalRight: NavItemConfig[] = [
|
|
{
|
|
key: 'announcements',
|
|
label: '公告',
|
|
iconSrc: announcementsSvg,
|
|
action: 'drawer',
|
|
position: 'right',
|
|
},
|
|
{
|
|
key: 'account',
|
|
label: '查帐户',
|
|
iconSrc: accountSvg,
|
|
action: 'page',
|
|
target: '/account',
|
|
modalType: 'floating',
|
|
position: 'right',
|
|
requireLogin: true,
|
|
},
|
|
{
|
|
key: 'vip-activate',
|
|
label: '开会员/激活',
|
|
iconSrc: membershipSvg,
|
|
action: 'page',
|
|
target: '/vip',
|
|
modalType: 'modal',
|
|
position: 'right',
|
|
},
|
|
{
|
|
key: 'recharge-points',
|
|
label: '充值',
|
|
iconSrc: rechargeSvg,
|
|
action: 'page',
|
|
target: '/recharge',
|
|
modalType: 'modal',
|
|
position: 'right',
|
|
requireLogin: true,
|
|
},
|
|
{
|
|
key: 'billing-history',
|
|
label: '消费记录',
|
|
iconSrc: billingSvg,
|
|
action: 'page',
|
|
target: '/billing',
|
|
modalType: 'floating',
|
|
position: 'right',
|
|
requireLogin: true,
|
|
},
|
|
{
|
|
key: 'order-details',
|
|
label: '订单明细',
|
|
iconSrc: orderDetailsSvg,
|
|
action: 'page',
|
|
target: '/orders',
|
|
modalType: 'floating',
|
|
position: 'right',
|
|
requireLogin: true,
|
|
},
|
|
{
|
|
key: 'wechat-work',
|
|
label: '企业微信',
|
|
iconSrc: wechatWorkSvg,
|
|
action: 'page',
|
|
target: '/wechat-work',
|
|
modalType: 'modal',
|
|
position: 'right',
|
|
},
|
|
{
|
|
key: 'settings',
|
|
label: '设置',
|
|
iconSrc: settingsSvg,
|
|
action: 'button',
|
|
position: 'right',
|
|
},
|
|
{
|
|
key: 'auth',
|
|
label: '登录/注册',
|
|
iconSrc: accountSvg,
|
|
action: 'button',
|
|
position: 'right',
|
|
requireGuest: true,
|
|
},
|
|
{
|
|
key: 'logout',
|
|
label: '退出登录',
|
|
iconSrc: signOutSvg,
|
|
action: 'button',
|
|
position: 'right',
|
|
requireLogin: true,
|
|
},
|
|
];
|
|
|
|
// ============================================================
|
|
// 企业版导航项
|
|
// ============================================================
|
|
|
|
/** 企业版 — 左侧 */
|
|
const enterpriseLeft: NavItemConfig[] = [
|
|
{
|
|
key: 'project-management',
|
|
label: '项目管理',
|
|
iconSrc: projectManagementSvg,
|
|
action: 'page',
|
|
target: '/projects',
|
|
modalType: 'floating',
|
|
position: 'left',
|
|
},
|
|
];
|
|
|
|
/** 企业版 — 右侧(从左至右排列) */
|
|
const enterpriseRight: NavItemConfig[] = [
|
|
{
|
|
key: 'announcements',
|
|
label: '公告',
|
|
iconSrc: announcementsSvg,
|
|
action: 'drawer',
|
|
position: 'right',
|
|
},
|
|
{
|
|
key: 'quota-check',
|
|
label: '查配额',
|
|
iconSrc: accountSvg,
|
|
action: 'page',
|
|
target: '/quota',
|
|
modalType: 'floating',
|
|
position: 'right',
|
|
requireLogin: false,
|
|
},
|
|
{
|
|
key: 'settings',
|
|
label: '设置',
|
|
iconSrc: settingsSvg,
|
|
action: 'button',
|
|
position: 'right',
|
|
},
|
|
{
|
|
key: 'auth',
|
|
label: '登录/注册',
|
|
iconSrc: accountSvg,
|
|
action: 'button',
|
|
position: 'right',
|
|
requireGuest: true,
|
|
},
|
|
{
|
|
key: 'logout',
|
|
label: '退出登录',
|
|
iconSrc: signOutSvg,
|
|
action: 'button',
|
|
position: 'right',
|
|
requireLogin: true,
|
|
},
|
|
];
|
|
|
|
// ============================================================
|
|
// 导出
|
|
// ============================================================
|
|
|
|
export { personalLeft, personalRight, enterpriseLeft, enterpriseRight };
|