diff --git a/src/main.js b/src/main.js index 6837490..1944cca 100644 --- a/src/main.js +++ b/src/main.js @@ -31,6 +31,10 @@ Vue.use(renRegionTree) Vue.prototype.$http = http Vue.prototype.$hasPermission = hasPermission Vue.prototype.$getDictLabel = getDictLabel +// is auth +Vue.prototype.isAuth = permission => { + return "正在检查的权限是:" + permission +} // 保存整站vuex本地储存初始状态 window.SITE_CONFIG['storeState'] = cloneDeep(store.state) diff --git a/src/router/index.js b/src/router/index.js index 7f34f42..4fe984f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -2,6 +2,7 @@ import Vue from 'vue' import Router from 'vue-router' import http from '@/utils/request' import { isURL } from '@/utils/validate' +import Cookies from 'js-cookie' Vue.use(Router) @@ -12,7 +13,7 @@ export const pageRoutes = [ component: () => import('@/views/pages/404'), name: '404', meta: { title: '404未找到' }, - beforeEnter (to, from, next) { + beforeEnter(to, from, next) { // 拦截处理特殊业务场景 // 如果, 重定向路由包含__双下划线, 为临时添加路由 if (/__.*/.test(to.redirectedFrom)) { @@ -21,7 +22,20 @@ export const pageRoutes = [ next() } }, - { path: '/login', component: () => import('@/views/pages/login'), name: 'login', meta: { title: '登录' } } + { + path: '/login', + component: () => import('@/views/pages/login'), + name: 'login', + meta: { title: '登录' }, + beforeEnter(to, from, next) { + if (Cookies.get('token')) { + Vue.prototype.$message({ message:'已经登录过了', type: 'error' }) + next(false) + } else { + next() + } + } + } ] // 模块路由(基于主入口布局页面) @@ -36,7 +50,7 @@ export const moduleRoutes = { ] } -export function addDynamicRoute (routeParams, router) { +export function addDynamicRoute(routeParams, router) { // 组装路由名称, 并判断是否已添加, 如是: 则直接跳转 var routeName = routeParams.routeName var dynamicRoute = window.SITE_CONFIG['dynamicRoutes'].filter(item => item.name === routeName)[0] @@ -72,7 +86,6 @@ const router = new Router({ }) router.beforeEach((to, from, next) => { - console.log('[*] === router beforeEach: ', to, from) // 添加动态(菜单)路由 // 已添加或者当前路由为页面路由, 可直接访问 if (window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] || fnCurrentRouteIsPageRoute(to, pageRoutes)) { @@ -84,7 +97,9 @@ router.beforeEach((to, from, next) => { return } window.SITE_CONFIG['dictList'] = res.data - }).catch(() => {}) + }).catch((err) => { + // console.log("catch /sys/dict/type/all", err) + }) // 获取菜单列表, 添加并全局变量保存 http.get('/sys/menu/nav').then(({ data: res }) => { if (res.code !== 0) { @@ -94,7 +109,7 @@ router.beforeEach((to, from, next) => { window.SITE_CONFIG['menuList'] = res.data fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList']) next({ ...to, replace: true }) - }).catch(() => { + }).catch((err) => { next({ name: 'login' }) }) }) @@ -104,7 +119,7 @@ router.beforeEach((to, from, next) => { * @param {*} route 当前路由 * @param {*} pageRoutes 页面路由 */ -function fnCurrentRouteIsPageRoute (route, pageRoutes = []) { +function fnCurrentRouteIsPageRoute(route, pageRoutes = []) { var temp = [] for (var i = 0; i < pageRoutes.length; i++) { if (route.path === pageRoutes[i].path) { @@ -122,7 +137,7 @@ function fnCurrentRouteIsPageRoute (route, pageRoutes = []) { * @param {*} menuList 菜单列表 * @param {*} routes 递归创建的动态(菜单)路由 */ -function fnAddDynamicMenuRoutes (menuList = [], routes = []) { +function fnAddDynamicMenuRoutes(menuList = [], routes = []) { var temp = [] for (var i = 0; i < menuList.length; i++) { if (menuList[i].children && menuList[i].children.length >= 1) { diff --git a/src/utils/request.js b/src/utils/request.js index 19eab38..0de12ac 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -4,6 +4,7 @@ import router from '@/router' import qs from 'qs' import { clearLoginInfo } from '@/utils' import isPlainObject from 'lodash/isPlainObject' +import merge from 'lodash/merge' const http = axios.create({ baseURL: window.SITE_CONFIG['apiURL'], @@ -61,4 +62,42 @@ http.interceptors.response.use(response => { return Promise.reject(error) }) +/** + * 请求地址处理 + * @param {*} actionName action方法名称 + */ +http.adornUrl = (actionName) => { + // 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截! + return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName +} + +/** + * get请求参数处理 + * @param {*} params 参数对象 + * @param {*} openDefultParams 是否开启默认参数? + */ +http.adornParams = (params = {}, openDefaultParams = true) => { + var defaults = { + 't': new Date().getTime() + } + return openDefaultParams ? merge(defaults, params) : params +} + +/** + * post请求数据处理 + * @param {*} data 数据对象 + * @param {*} openDefultdata 是否开启默认数据? + * @param {*} contentType 数据格式 + * json: 'application/json; charset=utf-8' + * form: 'application/x-www-form-urlencoded; charset=utf-8' + */ +http.adornData = (data = {}, openDefaultdata = true, contentType = 'json') => { + var defaults = { + 't': new Date().getTime() + } + data = openDefaultdata ? merge(defaults, data) : data + return contentType === 'json' ? JSON.stringify(data) : qs.stringify(data) +} + + export default http diff --git a/src/views/modules/code/equipmenFile.vue b/src/views/modules/code/equipmenFile.vue new file mode 100644 index 0000000..d005d2f --- /dev/null +++ b/src/views/modules/code/equipmenFile.vue @@ -0,0 +1,253 @@ + + + diff --git a/src/views/modules/code/equipmenGroup.vue b/src/views/modules/code/equipmenGroup.vue new file mode 100644 index 0000000..98a8b5b --- /dev/null +++ b/src/views/modules/code/equipmenGroup.vue @@ -0,0 +1,235 @@ + + + diff --git a/src/views/modules/code/equipmenalarmlog-add-or-update.vue b/src/views/modules/code/equipmenalarmlog-add-or-update.vue new file mode 100644 index 0000000..53cac61 --- /dev/null +++ b/src/views/modules/code/equipmenalarmlog-add-or-update.vue @@ -0,0 +1,192 @@ + + + diff --git a/src/views/modules/code/equipmenattr-add-or-update.vue b/src/views/modules/code/equipmenattr-add-or-update.vue new file mode 100644 index 0000000..4f324eb --- /dev/null +++ b/src/views/modules/code/equipmenattr-add-or-update.vue @@ -0,0 +1,183 @@ + + + diff --git a/src/views/modules/code/equipmenattr.vue b/src/views/modules/code/equipmenattr.vue new file mode 100644 index 0000000..0be6837 --- /dev/null +++ b/src/views/modules/code/equipmenattr.vue @@ -0,0 +1,229 @@ + + + diff --git a/src/views/modules/code/equipmenfile-add-or-update.vue b/src/views/modules/code/equipmenfile-add-or-update.vue new file mode 100644 index 0000000..cb3dd48 --- /dev/null +++ b/src/views/modules/code/equipmenfile-add-or-update.vue @@ -0,0 +1,219 @@ + + + diff --git a/src/views/modules/code/equipmengroup-add-or-update.vue b/src/views/modules/code/equipmengroup-add-or-update.vue new file mode 100644 index 0000000..e5afd0d --- /dev/null +++ b/src/views/modules/code/equipmengroup-add-or-update.vue @@ -0,0 +1,192 @@ + + + diff --git a/src/views/modules/code/equipmengroupalarm-add-or-update.vue b/src/views/modules/code/equipmengroupalarm-add-or-update.vue new file mode 100644 index 0000000..6295601 --- /dev/null +++ b/src/views/modules/code/equipmengroupalarm-add-or-update.vue @@ -0,0 +1,237 @@ + + + diff --git a/src/views/modules/code/equipmenplc-add-or-update.vue b/src/views/modules/code/equipmenplc-add-or-update.vue new file mode 100644 index 0000000..63f5653 --- /dev/null +++ b/src/views/modules/code/equipmenplc-add-or-update.vue @@ -0,0 +1,264 @@ + + + diff --git a/src/views/modules/code/equipmenplcconnect-add-or-update.vue b/src/views/modules/code/equipmenplcconnect-add-or-update.vue new file mode 100644 index 0000000..72766d2 --- /dev/null +++ b/src/views/modules/code/equipmenplcconnect-add-or-update.vue @@ -0,0 +1,183 @@ + + + diff --git a/src/views/modules/code/equipmenplcparam-add-or-update.vue b/src/views/modules/code/equipmenplcparam-add-or-update.vue new file mode 100644 index 0000000..28cda40 --- /dev/null +++ b/src/views/modules/code/equipmenplcparam-add-or-update.vue @@ -0,0 +1,309 @@ + + + diff --git a/src/views/modules/code/equipmenquantity-add-or-update.vue b/src/views/modules/code/equipmenquantity-add-or-update.vue new file mode 100644 index 0000000..ac1781a --- /dev/null +++ b/src/views/modules/code/equipmenquantity-add-or-update.vue @@ -0,0 +1,228 @@ + + + diff --git a/src/views/modules/code/equipmenstatuslog-add-or-update.vue b/src/views/modules/code/equipmenstatuslog-add-or-update.vue new file mode 100644 index 0000000..c68898b --- /dev/null +++ b/src/views/modules/code/equipmenstatuslog-add-or-update.vue @@ -0,0 +1,219 @@ + + + diff --git a/src/views/modules/code/equipment-add-or-update.vue b/src/views/modules/code/equipment-add-or-update.vue new file mode 100644 index 0000000..28e1d4c --- /dev/null +++ b/src/views/modules/code/equipment-add-or-update.vue @@ -0,0 +1,309 @@ + + + diff --git a/src/views/modules/code/equipment.vue b/src/views/modules/code/equipment.vue new file mode 100644 index 0000000..325f714 --- /dev/null +++ b/src/views/modules/code/equipment.vue @@ -0,0 +1,317 @@ + + + diff --git a/src/views/modules/code/equipmentAlarmLog.vue b/src/views/modules/code/equipmentAlarmLog.vue new file mode 100644 index 0000000..30a9ca3 --- /dev/null +++ b/src/views/modules/code/equipmentAlarmLog.vue @@ -0,0 +1,235 @@ + + + diff --git a/src/views/modules/code/equipmentGroupAlarm.vue b/src/views/modules/code/equipmentGroupAlarm.vue new file mode 100644 index 0000000..426c3bf --- /dev/null +++ b/src/views/modules/code/equipmentGroupAlarm.vue @@ -0,0 +1,265 @@ + + + diff --git a/src/views/modules/code/equipmentPlc.vue b/src/views/modules/code/equipmentPlc.vue new file mode 100644 index 0000000..9f6a29b --- /dev/null +++ b/src/views/modules/code/equipmentPlc.vue @@ -0,0 +1,283 @@ + + + diff --git a/src/views/modules/code/equipmentPlcConnect.vue b/src/views/modules/code/equipmentPlcConnect.vue new file mode 100644 index 0000000..1ab3d13 --- /dev/null +++ b/src/views/modules/code/equipmentPlcConnect.vue @@ -0,0 +1,229 @@ + + + diff --git a/src/views/modules/code/equipmentPlcParam.vue b/src/views/modules/code/equipmentPlcParam.vue new file mode 100644 index 0000000..7e84a95 --- /dev/null +++ b/src/views/modules/code/equipmentPlcParam.vue @@ -0,0 +1,313 @@ + + + diff --git a/src/views/modules/code/equipmentQuantity.vue b/src/views/modules/code/equipmentQuantity.vue new file mode 100644 index 0000000..ec99044 --- /dev/null +++ b/src/views/modules/code/equipmentQuantity.vue @@ -0,0 +1,259 @@ + + + diff --git a/src/views/modules/code/equipmentStatusLog.vue b/src/views/modules/code/equipmentStatusLog.vue new file mode 100644 index 0000000..ac863bb --- /dev/null +++ b/src/views/modules/code/equipmentStatusLog.vue @@ -0,0 +1,253 @@ + + + diff --git a/src/views/modules/code/equipmentType.vue b/src/views/modules/code/equipmentType.vue new file mode 100644 index 0000000..098ffd8 --- /dev/null +++ b/src/views/modules/code/equipmentType.vue @@ -0,0 +1,247 @@ + + + diff --git a/src/views/modules/code/equipmentTypeFile.vue b/src/views/modules/code/equipmentTypeFile.vue new file mode 100644 index 0000000..c18e4cb --- /dev/null +++ b/src/views/modules/code/equipmentTypeFile.vue @@ -0,0 +1,253 @@ + + + diff --git a/src/views/modules/code/equipmentype-add-or-update.vue b/src/views/modules/code/equipmentype-add-or-update.vue new file mode 100644 index 0000000..e79370b --- /dev/null +++ b/src/views/modules/code/equipmentype-add-or-update.vue @@ -0,0 +1,210 @@ + + + diff --git a/src/views/modules/code/equipmentypefile-add-or-update.vue b/src/views/modules/code/equipmentypefile-add-or-update.vue new file mode 100644 index 0000000..01c6423 --- /dev/null +++ b/src/views/modules/code/equipmentypefile-add-or-update.vue @@ -0,0 +1,219 @@ + + + diff --git a/src/views/modules/code/factory-add-or-update.vue b/src/views/modules/code/factory-add-or-update.vue new file mode 100644 index 0000000..6720d9f --- /dev/null +++ b/src/views/modules/code/factory-add-or-update.vue @@ -0,0 +1,210 @@ + + + diff --git a/src/views/modules/code/factory.vue b/src/views/modules/code/factory.vue new file mode 100644 index 0000000..e7a0318 --- /dev/null +++ b/src/views/modules/code/factory.vue @@ -0,0 +1,247 @@ + + + diff --git a/src/views/modules/code/producArrt.vue b/src/views/modules/code/producArrt.vue new file mode 100644 index 0000000..04c4fa4 --- /dev/null +++ b/src/views/modules/code/producArrt.vue @@ -0,0 +1,253 @@ + + + diff --git a/src/views/modules/code/producarrt-add-or-update.vue b/src/views/modules/code/producarrt-add-or-update.vue new file mode 100644 index 0000000..db5838b --- /dev/null +++ b/src/views/modules/code/producarrt-add-or-update.vue @@ -0,0 +1,219 @@ + + + diff --git a/src/views/modules/code/product-add-or-update.vue b/src/views/modules/code/product-add-or-update.vue new file mode 100644 index 0000000..43ddcc6 --- /dev/null +++ b/src/views/modules/code/product-add-or-update.vue @@ -0,0 +1,246 @@ + + + diff --git a/src/views/modules/code/product.vue b/src/views/modules/code/product.vue new file mode 100644 index 0000000..062062b --- /dev/null +++ b/src/views/modules/code/product.vue @@ -0,0 +1,271 @@ + + + diff --git a/src/views/modules/code/productionLine.vue b/src/views/modules/code/productionLine.vue new file mode 100644 index 0000000..5e5ca75 --- /dev/null +++ b/src/views/modules/code/productionLine.vue @@ -0,0 +1,259 @@ + + + diff --git a/src/views/modules/code/productionLineRecSch.vue b/src/views/modules/code/productionLineRecSch.vue new file mode 100644 index 0000000..511a118 --- /dev/null +++ b/src/views/modules/code/productionLineRecSch.vue @@ -0,0 +1,199 @@ + + + diff --git a/src/views/modules/code/productionline-add-or-update.vue b/src/views/modules/code/productionline-add-or-update.vue new file mode 100644 index 0000000..0a75e6c --- /dev/null +++ b/src/views/modules/code/productionline-add-or-update.vue @@ -0,0 +1,228 @@ + + + diff --git a/src/views/modules/code/productionlinerecsch-add-or-update.vue b/src/views/modules/code/productionlinerecsch-add-or-update.vue new file mode 100644 index 0000000..2ef2d21 --- /dev/null +++ b/src/views/modules/code/productionlinerecsch-add-or-update.vue @@ -0,0 +1,138 @@ + + + diff --git a/src/views/modules/code/qualityInspectionDet.vue b/src/views/modules/code/qualityInspectionDet.vue new file mode 100644 index 0000000..35f97a0 --- /dev/null +++ b/src/views/modules/code/qualityInspectionDet.vue @@ -0,0 +1,229 @@ + + + diff --git a/src/views/modules/code/qualityInspectionRecord.vue b/src/views/modules/code/qualityInspectionRecord.vue new file mode 100644 index 0000000..d4d77c3 --- /dev/null +++ b/src/views/modules/code/qualityInspectionRecord.vue @@ -0,0 +1,259 @@ + + + diff --git a/src/views/modules/code/qualityInspectionType.vue b/src/views/modules/code/qualityInspectionType.vue new file mode 100644 index 0000000..8ae4ffa --- /dev/null +++ b/src/views/modules/code/qualityInspectionType.vue @@ -0,0 +1,223 @@ + + + diff --git a/src/views/modules/code/qualityinspectiondet-add-or-update.vue b/src/views/modules/code/qualityinspectiondet-add-or-update.vue new file mode 100644 index 0000000..c98dc88 --- /dev/null +++ b/src/views/modules/code/qualityinspectiondet-add-or-update.vue @@ -0,0 +1,183 @@ + + + diff --git a/src/views/modules/code/qualityinspectionrecord-add-or-update.vue b/src/views/modules/code/qualityinspectionrecord-add-or-update.vue new file mode 100644 index 0000000..37316b5 --- /dev/null +++ b/src/views/modules/code/qualityinspectionrecord-add-or-update.vue @@ -0,0 +1,228 @@ + + + diff --git a/src/views/modules/code/qualityinspectiontype-add-or-update.vue b/src/views/modules/code/qualityinspectiontype-add-or-update.vue new file mode 100644 index 0000000..485d983 --- /dev/null +++ b/src/views/modules/code/qualityinspectiontype-add-or-update.vue @@ -0,0 +1,174 @@ + + + diff --git a/src/views/modules/code/reporsheecategory-add-or-update.vue b/src/views/modules/code/reporsheecategory-add-or-update.vue new file mode 100644 index 0000000..e51db33 --- /dev/null +++ b/src/views/modules/code/reporsheecategory-add-or-update.vue @@ -0,0 +1,201 @@ + + + diff --git a/src/views/modules/code/reporsheet-add-or-update.vue b/src/views/modules/code/reporsheet-add-or-update.vue new file mode 100644 index 0000000..183b6f6 --- /dev/null +++ b/src/views/modules/code/reporsheet-add-or-update.vue @@ -0,0 +1,228 @@ + + + diff --git a/src/views/modules/code/reportSheet.vue b/src/views/modules/code/reportSheet.vue new file mode 100644 index 0000000..5f98900 --- /dev/null +++ b/src/views/modules/code/reportSheet.vue @@ -0,0 +1,259 @@ + + + diff --git a/src/views/modules/code/reportSheetCategory.vue b/src/views/modules/code/reportSheetCategory.vue new file mode 100644 index 0000000..3e59ebb --- /dev/null +++ b/src/views/modules/code/reportSheetCategory.vue @@ -0,0 +1,241 @@ + + + diff --git a/src/views/modules/code/sysfile-add-or-update.vue b/src/views/modules/code/sysfile-add-or-update.vue new file mode 100644 index 0000000..5e56a41 --- /dev/null +++ b/src/views/modules/code/sysfile-add-or-update.vue @@ -0,0 +1,192 @@ + + + diff --git a/src/views/modules/code/sysfile.vue b/src/views/modules/code/sysfile.vue new file mode 100644 index 0000000..73cf920 --- /dev/null +++ b/src/views/modules/code/sysfile.vue @@ -0,0 +1,235 @@ + + + diff --git a/src/views/modules/code/sysfileType.vue b/src/views/modules/code/sysfileType.vue new file mode 100644 index 0000000..cf2946e --- /dev/null +++ b/src/views/modules/code/sysfileType.vue @@ -0,0 +1,223 @@ + + + diff --git a/src/views/modules/code/sysfiletype-add-or-update.vue b/src/views/modules/code/sysfiletype-add-or-update.vue new file mode 100644 index 0000000..ce3f8e8 --- /dev/null +++ b/src/views/modules/code/sysfiletype-add-or-update.vue @@ -0,0 +1,174 @@ + + + diff --git a/src/views/modules/code/workShopSection.vue b/src/views/modules/code/workShopSection.vue new file mode 100644 index 0000000..ff186a2 --- /dev/null +++ b/src/views/modules/code/workShopSection.vue @@ -0,0 +1,253 @@ + + + diff --git a/src/views/modules/code/workShopSectionEquipment.vue b/src/views/modules/code/workShopSectionEquipment.vue new file mode 100644 index 0000000..5f65eb3 --- /dev/null +++ b/src/views/modules/code/workShopSectionEquipment.vue @@ -0,0 +1,229 @@ + + + diff --git a/src/views/modules/code/workshopsection-add-or-update.vue b/src/views/modules/code/workshopsection-add-or-update.vue new file mode 100644 index 0000000..036c3c8 --- /dev/null +++ b/src/views/modules/code/workshopsection-add-or-update.vue @@ -0,0 +1,219 @@ + + + diff --git a/src/views/modules/code/workshopsectionequipment-add-or-update.vue b/src/views/modules/code/workshopsectionequipment-add-or-update.vue new file mode 100644 index 0000000..3a88db1 --- /dev/null +++ b/src/views/modules/code/workshopsectionequipment-add-or-update.vue @@ -0,0 +1,183 @@ + + +