diff --git a/.env.development b/.env.development
deleted file mode 100644
index 8971a6a..0000000
--- a/.env.development
+++ /dev/null
@@ -1,6 +0,0 @@
-# just a flag
-ENV = 'development'
-
-# base api
-VUE_APP_BASE_API = 'http://127.0.0.1:9001'
-VUE_APP_FACE_API = 'http://127.0.0.1:5000'
diff --git a/src/assets/2-主界面/危化品管理.png b/src/assets/2-主界面/危化品管理.png
new file mode 100644
index 0000000..54b9c34
Binary files /dev/null and b/src/assets/2-主界面/危化品管理.png differ
diff --git a/src/permission.js b/src/permission.js
index fd4c991..38a7aca 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -4,7 +4,8 @@ import store from './store'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
import getPageTitle from '@/utils/get-page-title'
-import { getALLRouter } from '@/utils'
+import { get_path, getALLRouter } from '@/utils'
+import mapTitle from '@/utils/mapTitle'
NProgress.configure({ showSpinner: false }) // NProgress Configuration
@@ -26,16 +27,10 @@ router.beforeEach(async(to, from, next) => {
next({ path: '/' })
NProgress.done()
} else {
- const pa = to.path.split('/')[1]
- const pathMap = {
- 'reagent': 'reagent',
- 'user': 'user',
- 'userinfo': store.getters.classification
- }
- const pat = pathMap[pa]
+ const pat = get_path(to.path)
if (to.name) {
// 设置header栏样式根据主预览页面不同
- if (to.path === '/reagent/mainoverview/index') {
+ if (to.path === `/${pat}/mainoverview/index`) {
store.commit('settings/CHANGE_SETTING', { key: 'isMain', value: true })
} else {
store.commit('settings/CHANGE_SETTING', { key: 'isMain', value: false })
@@ -49,6 +44,7 @@ router.beforeEach(async(to, from, next) => {
router.addRoutes(asyncRoutes)
next({ ...to, replace: true })
}
+ store.commit('app/SET_TITLE', mapTitle[pat])
}
} else {
/* has no token*/
diff --git a/src/router/modules/dangerous.js b/src/router/modules/dangerous.js
new file mode 100644
index 0000000..7dc2dd2
--- /dev/null
+++ b/src/router/modules/dangerous.js
@@ -0,0 +1,260 @@
+import Layout from '@/layout'
+
+const dangerousRouter = [
+ // {
+ // path: '/dangerous',
+ // hidden: true,
+ // redirect: '/dangerous/mainoverview/index',
+ // meta: { classification: 'dangerous', module_code: 'MainOverview' }
+ // },
+ {
+ path: '/dangerous/mainoverview',
+ component: Layout,
+ redirect: '/dangerous/mainoverview/index',
+ meta: { classification: 'dangerous', module_code: 'MainOverview' },
+ children: [
+ {
+ path: 'index',
+ name: 'dangerousMainOverview',
+ meta: { title: '主预览', icon: '主概览', classification: 'dangerous' },
+ component: () => import('@/views/reagent/mainoverview/index')
+ }
+ ]
+ },
+ {
+ path: '/dangerous/report',
+ component: Layout,
+ redirect: '/dangerous/report/index',
+ meta: { classification: 'dangerous', module_code: 'DataReportIndex' },
+ children: [
+ {
+ path: 'index',
+ name: 'dangerousReport',
+ component: () => import('@/views/reagent/report/index'),
+ meta: { title: '报告统计', icon: '报表统计', classification: 'dangerous' }
+ },
+ {
+ path: 'storeinfo',
+ name: 'dangerousStoreInfo',
+ component: () => import('@/views/reagent/report/storeinfo/index'),
+ hidden: true,
+ meta: { title: '库存信息总览', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
+ },
+ {
+ path: 'dangerousinfo',
+ name: 'dangerousInfo',
+ component: () => import('@/views/reagent/report/reagentinfo/index'),
+ hidden: true,
+ meta: { title: '危化品信息详情', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
+ },
+ {
+ path: 'warehousinginfo',
+ name: 'dangerousWarehousingInfo',
+ component: () => import('@/views/reagent/report/warehousinginfo/index'),
+ hidden: true,
+ meta: { title: '入库信息查询', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
+ },
+ {
+ path: 'inventoryconsuminfo',
+ name: 'dangerousInventoryConsumInfo',
+ component: () => import('@/views/reagent/report/inventoryconsum/index'),
+ hidden: true,
+ meta: { title: '库存消耗', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
+ },
+ {
+ path: 'dangerousconsuminfo',
+ name: 'dangerousConsumInfo',
+ component: () => import('@/views/reagent/report/reagentconsum/index'),
+ hidden: true,
+ meta: { title: '危化品消耗', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
+ },
+ {
+ path: 'userconsuminfo',
+ name: 'dangerousUserConsumInfo',
+ component: () => import('@/views/reagent/report/userconsum/index'),
+ hidden: true,
+ meta: { title: '人员用量消耗', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
+ },
+ {
+ path: 'usefrequencyinfo',
+ name: 'dangerousUseFrequencyInfo',
+ component: () => import('@/views/reagent/report/usefrequency/index'),
+ hidden: true,
+ meta: { title: '使用频率', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
+ },
+ {
+ path: 'recordinfo/:t',
+ name: 'dangerousRecordInfo',
+ component: () => import('@/views/reagent/report/record/index'),
+ hidden: true,
+ meta: { title: '记录', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
+ }
+ ]
+ },
+ {
+ path: '/dangerous/warehousing',
+ component: Layout,
+ redirect: '/dangerous/warehousing/index',
+ meta: { classification: 'dangerous', module_code: 'DataReportIndex' },
+ children: [
+ {
+ path: 'index',
+ name: 'dangerousWarehousing',
+ component: () => import('@/views/reagent/warehousing/index'),
+ meta: { title: '危化品入库', icon: '试剂入库', classification: 'dangerous' }
+ }
+ ]
+ },
+ {
+ path: '/dangerous/receiving',
+ component: Layout,
+ redirect: '/dangerous/receiving/index',
+ meta: { classification: 'dangerous', module_code: 'DrugUseView' },
+ children: [
+ {
+ path: 'index',
+ name: 'dangerousReceiving',
+ component: () => import('@/views/reagent/receivingandreturn/index'),
+ meta: { title: '危化品领用', icon: '试剂领用', classification: 'dangerous' }
+ }
+ ]
+ },
+ {
+ path: '/dangerous/sendback',
+ component: Layout,
+ redirect: '/dangerous/sendback/index',
+ meta: { classification: 'dangerous', module_code: 'DrugReturnView' },
+ children: [
+ {
+ path: 'index',
+ name: 'dangerousSendBack',
+ component: () => import('@/views/reagent/receivingandreturn/index'),
+ meta: { title: '危化品归还', icon: '试剂归还', classification: 'dangerous' }
+ }
+ ]
+ },
+ {
+ path: '/dangerous/weighing',
+ component: Layout,
+ redirect: '/dangerous/weighing/index',
+ meta: { classification: 'dangerous', module_code: 'DrugWeigh' },
+ children: [
+ {
+ path: 'index',
+ name: 'dangerousweighing',
+ component: () => import('@/views/reagent/weighing/index'),
+ meta: { title: '危化品称重', icon: '试剂称重', classification: 'dangerous' }
+ }
+ ]
+ },
+ {
+ path: '/dangerous/inventory',
+ component: Layout,
+ redirect: '/dangerous/inventory/index',
+ meta: { classification: 'dangerous', module_code: 'StockTakingIndex' },
+ children: [
+ {
+ path: 'index',
+ name: 'dangerousInventory',
+ component: () => import('@/views/reagent/inventory/index'),
+ meta: { title: '危化品盘点', icon: '库存盘点', classification: 'dangerous' }
+ }
+ ]
+ },
+ {
+ path: '/dangerous/database',
+ component: Layout,
+ redirect: '/dangerous/database/msds',
+ meta: { title: '化学品数据库', icon: '化学品数据库', classification: 'dangerous', module_code: 'ChemicaDatabase' },
+ children: [
+ {
+ path: 'msds',
+ name: 'dangerousMSDS',
+ component: () => import('@/views/reagent/database/index'),
+ meta: { title: 'MSDS数据库', classification: 'dangerous' }
+ },
+ {
+ path: 'dangerous',
+ name: 'dangerousDangerous',
+ component: () => import('@/views/reagent/database/index'),
+ meta: { title: '危化品数据库', classification: 'dangerous' }
+ }
+ ]
+ },
+ {
+ path: '/dangerous/management',
+ component: Layout,
+ redirect: '/dangerous/management/index',
+ meta: { classification: 'dangerous', module_code: 'DrugIndex' },
+ children: [
+ {
+ path: 'index',
+ name: 'dangerousManagement',
+ component: () => import('@/views/reagent/management/index'),
+ meta: { title: '危化品管理', icon: '试剂管理', classification: 'dangerous' }
+ }
+ ]
+ },
+ {
+ path: '/dangerous/client',
+ component: Layout,
+ redirect: '/dangerous/client/index',
+ meta: { classification: 'dangerous', module_code: 'CabinetIndex' },
+ children: [
+ {
+ path: 'index',
+ name: 'dangerousClient',
+ component: () => import('@/views/reagent/client/index'),
+ meta: { title: '柜体管理', icon: '柜体管理', classification: 'dangerous' }
+ }
+ ]
+ },
+ {
+ path: '/dangerous/envrecord',
+ component: Layout,
+ redirect: '/dangerous/envrecord/index',
+ meta: { classification: 'dangerous', module_code: 'HumitureIndex' },
+ children: [
+ {
+ path: 'index',
+ name: 'dangerousEnvRecord',
+ component: () => import('@/views/reagent/envrecord/index'),
+ meta: { title: '环境记录', icon: '雪花', classification: 'dangerous' }
+ }
+ ]
+ },
+ {
+ path: '/dangerous/form',
+ component: Layout,
+ redirect: '/dangerous/form/index',
+ meta: { classification: 'dangerous', module_code: 'DrugCustomForm' },
+ children: [
+ {
+ path: 'index',
+ name: 'dangerousForm',
+ component: () => import('@/views/reagent/customform/index'),
+ meta: { title: '危化品表单自定义', icon: '表单', classification: 'dangerous' }
+ }
+ ]
+ },
+ // {
+ // path: '/dangerous/buy',
+ // component: Layout,
+ // meta: { classification: 'dangerous' },
+ // children: [
+ // {
+ // path: 'index',
+ // name: 'Buy',
+ // component: () => import('@/views/reagent/buy/index'),
+ // meta: { title: '请购', icon: '请购', classification: 'dangerous' }
+ // }
+ // ]
+ // },
+ {
+ path: '/dangerous/gotohome',
+ redirect: '/home',
+ meta: { title: '返回主页', icon: 'el-icon-arrow-left', classification: 'dangerous' }
+ }
+]
+
+export default dangerousRouter
diff --git a/src/router/modules/standard.js b/src/router/modules/standard.js
new file mode 100644
index 0000000..1eaad14
--- /dev/null
+++ b/src/router/modules/standard.js
@@ -0,0 +1,260 @@
+import Layout from '@/layout'
+
+const standardRouter = [
+ // {
+ // path: '/standard',
+ // hidden: true,
+ // redirect: '/reagent/mainoverview/index',
+ // meta: { classification: 'standard', module_code: 'MainOverview' }
+ // },
+ {
+ path: '/standard/mainoverview',
+ component: Layout,
+ redirect: '/standard/mainoverview/index',
+ meta: { classification: 'standard', module_code: 'MainOverview' },
+ children: [
+ {
+ path: 'index',
+ name: 'standardMainOverview',
+ meta: { title: '主预览', icon: '主概览', classification: 'standard' },
+ component: () => import('@/views/reagent/mainoverview/index')
+ }
+ ]
+ },
+ {
+ path: '/standard/report',
+ component: Layout,
+ redirect: '/standard/report/index',
+ meta: { classification: 'standard', module_code: 'DataReportIndex' },
+ children: [
+ {
+ path: 'index',
+ name: 'standardReport',
+ component: () => import('@/views/reagent/report/index'),
+ meta: { title: '报告统计', icon: '报表统计', classification: 'standard' }
+ },
+ {
+ path: 'storeinfo',
+ name: 'standardStoreInfo',
+ component: () => import('@/views/reagent/report/storeinfo/index'),
+ hidden: true,
+ meta: { title: '库存信息总览', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' }
+ },
+ {
+ path: 'standardinfo',
+ name: 'standardInfo',
+ component: () => import('@/views/reagent/report/reagentinfo/index'),
+ hidden: true,
+ meta: { title: '标准品信息详情', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' }
+ },
+ {
+ path: 'warehousinginfo',
+ name: 'standardWarehousingInfo',
+ component: () => import('@/views/reagent/report/warehousinginfo/index'),
+ hidden: true,
+ meta: { title: '入库信息查询', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' }
+ },
+ {
+ path: 'inventoryconsuminfo',
+ name: 'standardInventoryConsumInfo',
+ component: () => import('@/views/reagent/report/inventoryconsum/index'),
+ hidden: true,
+ meta: { title: '库存消耗', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' }
+ },
+ {
+ path: 'standardconsuminfo',
+ name: 'standardConsumInfo',
+ component: () => import('@/views/reagent/report/reagentconsum/index'),
+ hidden: true,
+ meta: { title: '标准品消耗', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' }
+ },
+ {
+ path: 'userconsuminfo',
+ name: 'standardUserConsumInfo',
+ component: () => import('@/views/reagent/report/userconsum/index'),
+ hidden: true,
+ meta: { title: '人员用量消耗', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' }
+ },
+ {
+ path: 'usefrequencyinfo',
+ name: 'standardUseFrequencyInfo',
+ component: () => import('@/views/reagent/report/usefrequency/index'),
+ hidden: true,
+ meta: { title: '使用频率', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' }
+ },
+ {
+ path: 'recordinfo/:t',
+ name: 'standardRecordInfo',
+ component: () => import('@/views/reagent/report/record/index'),
+ hidden: true,
+ meta: { title: '记录', icon: '报表统计', classification: 'standard', activeMenu: '/standard/report/index' }
+ }
+ ]
+ },
+ {
+ path: '/standard/warehousing',
+ component: Layout,
+ redirect: '/standard/warehousing/index',
+ meta: { classification: 'standard', module_code: 'DataReportIndex' },
+ children: [
+ {
+ path: 'index',
+ name: 'standardWarehousing',
+ component: () => import('@/views/reagent/warehousing/index'),
+ meta: { title: '标准品入库', icon: '试剂入库', classification: 'standard' }
+ }
+ ]
+ },
+ {
+ path: '/standard/receiving',
+ component: Layout,
+ redirect: '/standard/receiving/index',
+ meta: { classification: 'standard', module_code: 'DrugUseView' },
+ children: [
+ {
+ path: 'index',
+ name: 'standardReceiving',
+ component: () => import('@/views/reagent/receivingandreturn/index'),
+ meta: { title: '标准品领用', icon: '试剂领用', classification: 'standard' }
+ }
+ ]
+ },
+ {
+ path: '/standard/sendback',
+ component: Layout,
+ redirect: '/standard/sendback/index',
+ meta: { classification: 'standard', module_code: 'DrugReturnView' },
+ children: [
+ {
+ path: 'index',
+ name: 'standardSendBack',
+ component: () => import('@/views/reagent/receivingandreturn/index'),
+ meta: { title: '标准品归还', icon: '试剂归还', classification: 'standard' }
+ }
+ ]
+ },
+ {
+ path: '/standard/weighing',
+ component: Layout,
+ redirect: '/standard/weighing/index',
+ meta: { classification: 'standard', module_code: 'DrugWeigh' },
+ children: [
+ {
+ path: 'index',
+ name: 'standardweighing',
+ component: () => import('@/views/reagent/weighing/index'),
+ meta: { title: '标准品称重', icon: '试剂称重', classification: 'standard' }
+ }
+ ]
+ },
+ {
+ path: '/standard/inventory',
+ component: Layout,
+ redirect: '/standard/inventory/index',
+ meta: { classification: 'standard', module_code: 'StockTakingIndex' },
+ children: [
+ {
+ path: 'index',
+ name: 'standardInventory',
+ component: () => import('@/views/reagent/inventory/index'),
+ meta: { title: '标准品盘点', icon: '库存盘点', classification: 'standard' }
+ }
+ ]
+ },
+ {
+ path: '/standard/database',
+ component: Layout,
+ redirect: '/standard/database/msds',
+ meta: { title: '化学品数据库', icon: '化学品数据库', classification: 'standard', module_code: 'ChemicaDatabase' },
+ children: [
+ {
+ path: 'msds',
+ name: 'standardMSDS',
+ component: () => import('@/views/reagent/database/index'),
+ meta: { title: 'MSDS数据库', classification: 'standard' }
+ },
+ {
+ path: 'dangerous',
+ name: 'standardDangerous',
+ component: () => import('@/views/reagent/database/index'),
+ meta: { title: '危化品数据库', classification: 'standard' }
+ }
+ ]
+ },
+ {
+ path: '/standard/management',
+ component: Layout,
+ redirect: '/standard/management/index',
+ meta: { classification: 'standard', module_code: 'DrugIndex' },
+ children: [
+ {
+ path: 'index',
+ name: 'standardManagement',
+ component: () => import('@/views/reagent/management/index'),
+ meta: { title: '标准品管理', icon: '试剂管理', classification: 'standard' }
+ }
+ ]
+ },
+ {
+ path: '/standard/client',
+ component: Layout,
+ redirect: '/standard/client/index',
+ meta: { classification: 'standard', module_code: 'CabinetIndex' },
+ children: [
+ {
+ path: 'index',
+ name: 'standardClient',
+ component: () => import('@/views/reagent/client/index'),
+ meta: { title: '柜体管理', icon: '柜体管理', classification: 'standard' }
+ }
+ ]
+ },
+ {
+ path: '/standard/envrecord',
+ component: Layout,
+ redirect: '/standard/envrecord/index',
+ meta: { classification: 'standard', module_code: 'HumitureIndex' },
+ children: [
+ {
+ path: 'index',
+ name: 'standardEnvRecord',
+ component: () => import('@/views/reagent/envrecord/index'),
+ meta: { title: '环境记录', icon: '雪花', classification: 'standard' }
+ }
+ ]
+ },
+ {
+ path: '/standard/form',
+ component: Layout,
+ redirect: '/standard/form/index',
+ meta: { classification: 'standard', module_code: 'DrugCustomForm' },
+ children: [
+ {
+ path: 'index',
+ name: 'standardForm',
+ component: () => import('@/views/reagent/customform/index'),
+ meta: { title: '标准品表单自定义', icon: '表单', classification: 'standard' }
+ }
+ ]
+ },
+ // {
+ // path: '/standard/buy',
+ // component: Layout,
+ // meta: { classification: 'standard' },
+ // children: [
+ // {
+ // path: 'index',
+ // name: 'Buy',
+ // component: () => import('@/views/reagent/buy/index'),
+ // meta: { title: '请购', icon: '请购', classification: 'standard' }
+ // }
+ // ]
+ // },
+ {
+ path: '/standard/gotohome',
+ redirect: '/home',
+ meta: { title: '返回主页', icon: 'el-icon-arrow-left', classification: 'standard' }
+ }
+]
+
+export default standardRouter
diff --git a/src/store/modules/app.js b/src/store/modules/app.js
index 37fd18b..e5b15f7 100644
--- a/src/store/modules/app.js
+++ b/src/store/modules/app.js
@@ -7,7 +7,8 @@ const state = {
withoutAnimation: false,
clientOptions: []
},
- device: 'desktop'
+ device: 'desktop',
+ title: ''
}
const mutations = {
@@ -30,6 +31,9 @@ const mutations = {
},
SET_COPTS: (state, opt) => {
state.clientOptions = opt
+ },
+ SET_TITLE: (state, opt) => {
+ state.title = opt
}
}
diff --git a/src/utils/index.js b/src/utils/index.js
index 6f16d2a..57d6361 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -4,6 +4,9 @@
import reagentRouter from '@/router/modules/reagent'
import userRouter from '@/router/modules/user'
+import standardRouter from '@/router/modules/standard'
+import dangerousRouter from '@/router/modules/dangerous'
+import store from '@/store'
/**
* Parse the time to string
@@ -167,9 +170,13 @@ export function getALLRouter(data) {
// TODO: 其他路由都在此操作
const rasr = filterAsyncRoutes(reagentRouter, data.drug_manage)
const uasr = filterAsyncRoutes(userRouter, data.drug_manage)
+ // const standard = filterAsyncRoutes(standardRouter, data.drug_manage)
const asyncRoutes = [
...rasr,
...uasr,
+ // ...standard,
+ ...standardRouter,
+ ...dangerousRouter,
// 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true }
]
@@ -179,6 +186,16 @@ export function getALLRouter(data) {
router: rasr[0],
title: '试剂管理'
},
+ {
+ name: 'standard',
+ router: standardRouter[0],
+ title: '标准品管理'
+ },
+ {
+ name: 'dangerous',
+ router: dangerousRouter[0],
+ title: '危化品管理'
+ },
{
name: 'user',
router: uasr[0],
@@ -243,3 +260,15 @@ export const web_stream = {
}
}
+export const get_path = function(path) {
+ const pa = path.split('/')[1]
+ const pathMap = {
+ 'reagent': 'reagent',
+ 'user': 'user',
+ 'standard': 'standard',
+ 'dangerous': 'dangerous',
+ 'userinfo': store.getters.classification
+ }
+ return pathMap[pa]
+}
+
diff --git a/src/utils/mapTitle.js b/src/utils/mapTitle.js
new file mode 100644
index 0000000..0e52beb
--- /dev/null
+++ b/src/utils/mapTitle.js
@@ -0,0 +1,8 @@
+const mapTitle = {
+ 'reagent': '试剂',
+ 'user': 'user',
+ 'standard': '标准品',
+ 'dangerous': '危化品'
+}
+
+export default mapTitle
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 65ba160..9bf28bd 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -8,9 +8,9 @@
@@ -33,6 +33,7 @@ export default {
methods: {
picClick(name) {
const r = this.$store.getters.opts.find(item => item.name === name)
+ console.log(r)
this.$router.push(r.router.path)
}
}
@@ -70,9 +71,9 @@ export default {
background: #F7F7F7;
height:calc(100vh - 6rem);
.home-pic{
- padding-top: 4.5625rem;
+ padding-top: 8rem;
display: flex;
- justify-content: center;
+ justify-content: space-around;
.home-pic-item img{
width: 19.75rem;
margin: 0px 20px;
diff --git a/src/views/reagent/mainoverview/index.vue b/src/views/reagent/mainoverview/index.vue
index fc48566..cc1d6e4 100644
--- a/src/views/reagent/mainoverview/index.vue
+++ b/src/views/reagent/mainoverview/index.vue
@@ -48,15 +48,15 @@