- 样板组合(/combine): 样板库作为子组件, 点击加入组合 - 多单元紧贴排布(平移归一), 等高对齐(以首单元为参考Y向缩放) - 组合单元管理: 删除/左右调序/清空, 列表动画 - 组合结果为标准多形状 drawing_data, 渲染/报价/AI炫图/3D全链路兼容 - 组合预览 2D/3D 双模式(Three.js 直接渲染组合 sm[]) - 侧边栏菜单按业务分组: 销售业务/设计制图/生产供应/系统 - 组合算法经 Node 几何验证: 6形状无缝拼接, 高度0误差对齐
52 lines
3.4 KiB
TypeScript
52 lines
3.4 KiB
TypeScript
/** 路由:登录守卫 + 主布局 */
|
|
import { createRouter, createWebHistory } from 'vue-router'
|
|
import { useAuthStore } from '../stores/auth'
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(),
|
|
routes: [
|
|
{ path: '/login', component: () => import('../views/LoginView.vue') },
|
|
{
|
|
path: '/',
|
|
component: () => import('../views/LayoutView.vue'),
|
|
children: [
|
|
{ path: '', redirect: '/dashboard' },
|
|
{ path: 'dashboard', component: () => import('../views/DashboardView.vue'), meta: { title: '工作台' } },
|
|
{ path: 'chart', component: () => import('../views/ReportView.vue'), meta: { title: '报表统计' } },
|
|
{ path: 'orders', component: () => import('../views/OrdersView.vue'), meta: { title: '订单管理' } },
|
|
{ path: 'sunny', component: () => import('../views/SunnyHouseView.vue'), meta: { title: '阳光房' } },
|
|
{ path: 'quotations', component: () => import('../views/QuotationsView.vue'), meta: { title: '报价单' } },
|
|
{ path: 'contracts', component: () => import('../views/ContractsView.vue'), meta: { title: '合同管理' } },
|
|
{ path: 'customers', component: () => import('../views/CustomersView.vue'), meta: { title: '客户管理' } },
|
|
{ path: 'measure', component: () => import('../views/MeasureView.vue'), meta: { title: '量尺管理' } },
|
|
{ path: 'aftersale', component: () => import('../views/AfterSaleView.vue'), meta: { title: '售后管理' } },
|
|
{ path: 'templates', component: () => import('../views/TemplatesView.vue'), meta: { title: '样板库' } },
|
|
{ path: 'combine', component: () => import('../views/CombineView.vue'), meta: { title: '样板组合' } },
|
|
{ path: 'products', component: () => import('../views/ProductsView.vue'), meta: { title: '产品管理' } },
|
|
{ path: 'warehouse', component: () => import('../views/WarehouseView.vue'), meta: { title: '仓库库存' } },
|
|
{ path: 'optimize', component: () => import('../views/OptimizeView.vue'), meta: { title: '优化下料' } },
|
|
{ path: 'rendering', component: () => import('../views/RenderView.vue'), meta: { title: '效果图渲染' } },
|
|
{ path: 'ai_render', component: () => import('../views/AIRenderView.vue'), meta: { title: 'AI 炫图' } },
|
|
{ path: 'threed', component: () => import('../views/RenderView.vue'), meta: { title: '3D 展示' } },
|
|
{ path: 'printer', component: () => import('../views/PrinterView.vue'), meta: { title: '打印中心' } },
|
|
{ path: 'cut_solution', component: () => import('../views/CutSolutionView.vue'), meta: { title: '下料方案' } },
|
|
{ path: 'devices', component: () => import('../views/DevicesView.vue'), meta: { title: '设备管理' } },
|
|
{ path: 'market', component: () => import('../views/MarketView.vue'), meta: { title: '商城' } },
|
|
{ path: 'guide', component: () => import('../views/GuideView.vue'), meta: { title: '使用指南' } },
|
|
{ path: 'personal', component: () => import('../views/PersonalView.vue'), meta: { title: '个人中心' } },
|
|
],
|
|
},
|
|
{ path: '/share/order/:token', component: () => import('../views/ShareOrderView.vue') },
|
|
],
|
|
})
|
|
|
|
router.beforeEach(to => {
|
|
const auth = useAuthStore()
|
|
// 公开页:分享订单
|
|
if (to.path.startsWith('/share/')) return true
|
|
if (to.path !== '/login' && !auth.isLogin) return '/login'
|
|
return true
|
|
})
|
|
|
|
export default router
|