diff --git a/package.json b/package.json index 1031d57..b6a1a0e 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,8 @@ "js-beautify": "1.13.0", "js-cookie": "3.0.1", "jsencrypt": "3.0.0-rc.1", + "less": "^4.3.0", + "less-loader": "5.0.0", "nprogress": "0.2.0", "quill": "1.3.7", "screenfull": "5.0.2", diff --git a/src/assets/images/bg.jpg b/src/assets/images/bg.jpg new file mode 100644 index 0000000..b158a53 Binary files /dev/null and b/src/assets/images/bg.jpg differ diff --git a/src/assets/images/model.jpg b/src/assets/images/model.jpg new file mode 100644 index 0000000..72d57a3 Binary files /dev/null and b/src/assets/images/model.jpg differ diff --git a/src/assets/images/modelbg1.jpg b/src/assets/images/modelbg1.jpg new file mode 100644 index 0000000..37bb9c2 Binary files /dev/null and b/src/assets/images/modelbg1.jpg differ diff --git a/src/permission.js b/src/permission.js index 0c35fea..3ccedb8 100644 --- a/src/permission.js +++ b/src/permission.js @@ -1,15 +1,15 @@ import router from './router' import store from './store' -import { Message } from 'element-ui' +import {Message} from 'element-ui' import NProgress from 'nprogress' import 'nprogress/nprogress.css' -import { getToken } from '@/utils/auth' -import { isRelogin } from '@/utils/request' +import {getToken} from '@/utils/auth' +import {isRelogin} from '@/utils/request' import defaultSettings from '@/settings' -NProgress.configure({ showSpinner: false }) +NProgress.configure({showSpinner: false}) -const whiteList = ['/login', '/register','/AirportModel'] +const whiteList = ['/login', '/register', '/AirportModel', '/modelBoard'] router.beforeEach((to, from, next) => { NProgress.start() @@ -17,7 +17,7 @@ router.beforeEach((to, from, next) => { to.meta.title && store.dispatch('settings/setTitle', to.meta.title) /* has token*/ if (to.path === '/login') { - next({ path: '/' }) + next({path: '/'}) NProgress.done() } else if (whiteList.indexOf(to.path) !== -1) { next() @@ -30,14 +30,14 @@ router.beforeEach((to, from, next) => { store.dispatch('GenerateRoutes').then(accessRoutes => { // 根据roles权限生成可访问的路由表 router.addRoutes(accessRoutes) // 动态添加可访问路由表 - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 + next({...to, replace: true}) // hack方法 确保addRoutes已完成 }) }).catch(err => { - store.dispatch('LogOut').then(() => { - Message.error(err) - next({ path: '/' }) - }) + store.dispatch('LogOut').then(() => { + Message.error(err) + next({path: '/'}) }) + }) } else { next() } diff --git a/src/router/index.js b/src/router/index.js index 1ecf080..d4d33d2 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -21,80 +21,50 @@ import plainView from '@/plainView' * roles: ['admin', 'common'] // 访问路由的角色权限 * permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限 * meta : { - noCache: true // 如果设置为true,则不会被 缓存(默认 false) - title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字 - icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg - breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示 - activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。 - } + noCache: true // 如果设置为true,则不会被 缓存(默认 false) + title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字 + icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg + breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示 + activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。 + } */ // 公共路由 -export const constantRoutes = [ - { - path: '/redirect', - component: Layout, - hidden: true, - children: [ - { - path: '/redirect/:path(.*)', - component: () => import('@/views/redirect') - } - ] - }, - { - path: '/login', - component: () => import('@/views/login'), - hidden: true - }, - { - path: '/AirportModel', - component: () => import('@/views/board/model/AirportModel'), - hidden: true - }, - { - path: '/register', - component: () => import('@/views/register'), - hidden: true - }, - { - path: '/404', - component: () => import('@/views/error/404'), - hidden: true - }, - { - path: '/401', - component: () => import('@/views/error/401'), - hidden: true - }, - { - path: '', - component: Layout, - redirect: 'index', - children: [ - { - path: 'index', - component: () => import('@/views/index'), - name: 'Index', - meta: { title: '首页', icon: 'dashboard', affix: true } - } - ] - }, - { - path: "/production/bom-info", - component: Layout, - hidden: true, - permissions: ["mes/prod:prodBomInfo:list"], - children: [ - { - path: "index/:materialCode(\\d+)", - component: () => import("@/views/mes/prod/prodBomInfo/childIndex"), - name: "childBom", - meta: {title: "查看生产BOM信息", activeMenu: "/prod/prodBomInfo"}, - }, - ], - }, - // { +export const constantRoutes = [{ + path: '/redirect', component: Layout, hidden: true, children: [{ + path: '/redirect/:path(.*)', component: () => import('@/views/redirect') + }] +}, { + path: '/login', component: () => import('@/views/login'), hidden: true +}, { + path: '/modelBoard', component: () => import('@/views/board/index.vue'), hidden: true +}, { + path: '/AirportModel', component: () => import('@/views/board/model/AirportModel'), hidden: true +}, { + path: '/register', component: () => import('@/views/register'), hidden: true +}, { + path: '/404', component: () => import('@/views/error/404'), hidden: true +}, { + path: '/401', component: () => import('@/views/error/401'), hidden: true +}, { + path: '', component: Layout, redirect: 'index', children: [{ + path: 'index', + component: () => import('@/views/index'), + name: 'Index', + meta: {title: '首页', icon: 'dashboard', affix: true} + }] +}, { + path: "/production/bom-info", + component: Layout, + hidden: true, + permissions: ["mes/prod:prodBomInfo:list"], + children: [{ + path: "index/:materialCode(\\d+)", + component: () => import("@/views/mes/prod/prodBomInfo/childIndex"), + name: "childBom", + meta: {title: "查看生产BOM信息", activeMenu: "/prod/prodBomInfo"}, + },], +}, // { // path: '/nestRoutes', // meta: { // title: '多级路由嵌套(缓存测试)', @@ -145,107 +115,62 @@ export const constantRoutes = [ // ] // }, { - path: '/user', - component: Layout, - hidden: true, - redirect: 'noredirect', - children: [ - { - path: 'profile', - component: () => import('@/views/system/user/profile/index'), - name: 'Profile', - meta: { title: '个人中心', icon: 'user' } - } - ] - } -] + path: '/user', component: Layout, hidden: true, redirect: 'noredirect', children: [{ + path: 'profile', + component: () => import('@/views/system/user/profile/index'), + name: 'Profile', + meta: {title: '个人中心', icon: 'user'} + }] + }] // 动态路由,基于用户权限动态去加载 -export const dynamicRoutes = [ - { - path: '/system/user-auth', - component: Layout, - hidden: true, - permissions: ['system:user:edit'], - children: [ - { - path: 'role/:userId(\\d+)', - component: () => import('@/views/system/user/authRole'), - name: 'AuthRole', - meta: { title: '分配角色', activeMenu: '/system/user' } - } - ] - }, - { - path: '/system/role-auth', - component: Layout, - hidden: true, - permissions: ['system:role:edit'], - children: [ - { - path: 'user/:roleId(\\d+)', - component: () => import('@/views/system/role/authUser'), - name: 'AuthUser', - meta: { title: '分配用户', activeMenu: '/system/role' } - } - ] - }, - { - path: '/system/dict-data', - component: Layout, - hidden: true, - permissions: ['system:dict:list'], - children: [ - { - path: 'index/:dictId(\\d+)', - component: () => import('@/views/system/dict/data'), - name: 'Data', - meta: { title: '字典数据', activeMenu: '/system/dict' } - } - ] - }, - { - path: '/monitor/job-log', - component: Layout, - hidden: true, - permissions: ['monitor:job:list'], - children: [ - { - path: 'index/:jobId(\\d+)', - component: () => import('@/views/monitor/job/log'), - name: 'JobLog', - meta: { title: '调度日志', activeMenu: '/monitor/job' } - } - ] - }, - { - path: '/tool/gen-edit', - component: Layout, - hidden: true, - permissions: ['tool:gen:edit'], - children: [ - { - path: 'index/:tableId(\\d+)', - component: () => import('@/views/tool/gen/editTable'), - name: 'GenEdit', - meta: { title: '修改生成配置', activeMenu: '/tool/gen' } - } - ] - }, - { - path: '/mes/release-order', - component: Layout, - hidden: true, - permissions: ['mes/prod:prodOrderInfo:edit'], - children: [ - { - path: 'index/:objId(\\d+)', - component: () => import('@/views/mes/prod/prodOrderInfo/releasePlan'), - name: 'releaseOrder', - meta: { title: '订单下达', activeMenu: '/mes/releasePlan' } - } - ] - }, +export const dynamicRoutes = [{ + path: '/system/user-auth', component: Layout, hidden: true, permissions: ['system:user:edit'], children: [{ + path: 'role/:userId(\\d+)', + component: () => import('@/views/system/user/authRole'), + name: 'AuthRole', + meta: {title: '分配角色', activeMenu: '/system/user'} + }] +}, { + path: '/system/role-auth', component: Layout, hidden: true, permissions: ['system:role:edit'], children: [{ + path: 'user/:roleId(\\d+)', + component: () => import('@/views/system/role/authUser'), + name: 'AuthUser', + meta: {title: '分配用户', activeMenu: '/system/role'} + }] +}, { + path: '/system/dict-data', component: Layout, hidden: true, permissions: ['system:dict:list'], children: [{ + path: 'index/:dictId(\\d+)', + component: () => import('@/views/system/dict/data'), + name: 'Data', + meta: {title: '字典数据', activeMenu: '/system/dict'} + }] +}, { + path: '/monitor/job-log', component: Layout, hidden: true, permissions: ['monitor:job:list'], children: [{ + path: 'index/:jobId(\\d+)', + component: () => import('@/views/monitor/job/log'), + name: 'JobLog', + meta: {title: '调度日志', activeMenu: '/monitor/job'} + }] +}, { + path: '/tool/gen-edit', component: Layout, hidden: true, permissions: ['tool:gen:edit'], children: [{ + path: 'index/:tableId(\\d+)', + component: () => import('@/views/tool/gen/editTable'), + name: 'GenEdit', + meta: {title: '修改生成配置', activeMenu: '/tool/gen'} + }] +}, { + path: '/mes/release-order', + component: Layout, + hidden: true, + permissions: ['mes/prod:prodOrderInfo:edit'], + children: [{ + path: 'index/:objId(\\d+)', + component: () => import('@/views/mes/prod/prodOrderInfo/releasePlan'), + name: 'releaseOrder', + meta: {title: '订单下达', activeMenu: '/mes/releasePlan'} + }] +}, ] @@ -263,6 +188,5 @@ Router.prototype.replace = function push(location) { export default new Router({ mode: 'history', // 去掉url中的# - scrollBehavior: () => ({ y: 0 }), - routes: constantRoutes + scrollBehavior: () => ({y: 0}), routes: constantRoutes }) diff --git a/src/views/board/index.vue b/src/views/board/index.vue new file mode 100644 index 0000000..b06e052 --- /dev/null +++ b/src/views/board/index.vue @@ -0,0 +1,124 @@ + + + +