From 1c98da6c11e94373e3b987c002f88f1cce45d256 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Fri, 10 Jul 2020 17:23:17 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 31 +-- src/router/index_Common.js | 12 +- src/router/index_HYD.js | 13 +- src/store/modules/permission.js | 1 - src/views/dashboard/echarts/demonstration.vue | 175 --------------- src/views/dashboard/echarts/exam.vue | 191 ---------------- src/views/dashboard/echarts/lesson.vue | 175 --------------- src/views/dashboard/echarts/permission.vue | 204 ------------------ src/views/dashboard/index.vue | 95 -------- src/views/designPlatform/mapPreviewNew.vue | 7 +- src/views/error-page/401.vue | 107 --------- src/views/newMap/displayNew/index.vue | 3 +- src/views/newMap/jlmapNew/index.vue | 2 +- .../newMap/mapsystemNew/common/index.vue | 45 ++-- src/views/newMap/newDesignUser/demonList.vue | 9 - .../newDesignUser/mapmanage/operateMenu.vue | 2 +- .../newDesignUser/mapmanage/publish.vue | 2 +- .../newDesignUser/mapmanage/publish3d.vue | 4 +- .../newMap/newDesignUser/mapmanage/saveAs.vue | 2 +- 19 files changed, 52 insertions(+), 1028 deletions(-) delete mode 100644 src/views/dashboard/echarts/demonstration.vue delete mode 100644 src/views/dashboard/echarts/exam.vue delete mode 100644 src/views/dashboard/echarts/lesson.vue delete mode 100644 src/views/dashboard/echarts/permission.vue delete mode 100644 src/views/dashboard/index.vue delete mode 100644 src/views/error-page/401.vue diff --git a/src/permission.js b/src/permission.js index 1bf6726f0..4b2a02ca2 100644 --- a/src/permission.js +++ b/src/permission.js @@ -4,16 +4,16 @@ import router from './router/index_APP_TARGET'; import {PermissionParam} from '@/scripts/ProjectConfig'; import NProgress from 'nprogress'; import 'nprogress/nprogress.css'; -import { admin } from './router/index_APP_TARGET'; +// import { admin } from './router/index_APP_TARGET'; import { getToken, removeToken, getSessionStorage } from '@/utils/auth'; import localStore from 'storejs'; import { loginInfo } from '@/scripts/ProjectConfig'; -function hasPermission(roles, permissionRoles) { - if (roles.indexOf(admin) >= 0) return true; - if (!permissionRoles) return true; - return roles.some(role => permissionRoles.indexOf(role) >= 0); -} +// function hasPermission(roles, permissionRoles) { +// if (roles.indexOf(admin) >= 0) return true; +// if (!permissionRoles) return true; +// return roles.some(role => permissionRoles.indexOf(role) >= 0); +// } const whiteList = ['/login', '/design/login', '/gzzbxy/relay']; // 不重定向白名单 @@ -59,7 +59,8 @@ function getRouteInfo(to) { } function handleRoute(to, next, loginPath) { - if (store.getters.roles.length === 0) { + console.log(store.getters.roles, 'roles'); + if (store.getters.roles.length == 0) { store.dispatch('GetInfo', getToken()).then(res => { // 根据roles权限生成可访问的路由表 const roles = res.roles; @@ -80,16 +81,16 @@ function handleRoute(to, next, loginPath) { }); } else { // 除没有动态改变权限的需求可直接next() 删下方权限判断 - if (hasPermission(store.getters.roles, to.meta.roles)) { - if (to.path === '/404' && to.redirectedFrom === '/') { - const project = getSessionStorage('project'); - next(localStore.get('trainingPlatformRoute' + store.getters.id + project) || '/trainingPlatform'); - } else { - next(); - } + // if (hasPermission(store.getters.roles, to.meta.roles)) { + if (to.path === '/404' && to.redirectedFrom === '/') { + const project = getSessionStorage('project'); + next(localStore.get('trainingPlatformRoute' + store.getters.id + project) || '/trainingPlatform'); } else { - next({ path: '/401', replace: true, query: { noGoBack: true } }); + next(); } + // } else { + // next({ path: '/401', replace: true, query: { noGoBack: true } }); + // } } } diff --git a/src/router/index_Common.js b/src/router/index_Common.js index dc4590441..53a2187af 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -27,7 +27,7 @@ const TrainRoom = () => import('@/views/trainRoom/index'); const JointTraining = () => import('@/views/jointTraining/index'); const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index'); -const Error401 = () => import('@/views/error-page/401'); +// const Error401 = () => import('@/views/error-page/401'); const Errpr404 = () => import('@/views/error-page/404'); const Dictionary = () => import('@/views/system/dictionary/index'); @@ -232,11 +232,6 @@ export const constantRoutes = [ component: Jlmap3dTrain, hidden: true }, - { - path: '/401', - component: Error401, - hidden: true - }, { // 竞赛系统报名 path: '/jsxtApply', component: JsxtApply, @@ -858,11 +853,6 @@ export const asyncRouter = [ meta: { } } - // { // 地图绘制 - // path: 'map/draw/:mapId/:view', - // component: NewMapDraft, - // hidden: true - // } ] }, { // 新地图绘制 diff --git a/src/router/index_HYD.js b/src/router/index_HYD.js index 89fef869f..667d6a237 100644 --- a/src/router/index_HYD.js +++ b/src/router/index_HYD.js @@ -23,7 +23,7 @@ const TrainRoom = () => import('@/views/trainRoom/index'); const JointTraining = () => import('@/views/jointTraining/index'); const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index'); -const Error401 = () => import('@/views/error-page/401'); +// const Error401 = () => import('@/views/error-page/401'); const Errpr404 = () => import('@/views/error-page/404'); const Dictionary = () => import('@/views/system/dictionary/index'); @@ -194,12 +194,11 @@ export const constantRoutes = [ component: Jlmap3dTrain, hidden: true }, - { - path: '/401', - component: Error401, - hidden: true - }, - + // { + // path: '/401', + // component: Error401, + // hidden: true + // }, { path: '/404', component: Errpr404, diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 46cf50006..59362abc9 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -77,7 +77,6 @@ function resetAsyncRouter({ systemType }) { } else if (systemType == projectTky) { list = [...list, ...asyncRouter]; } - console.log(list, '222222222222'); return list; } diff --git a/src/views/dashboard/echarts/demonstration.vue b/src/views/dashboard/echarts/demonstration.vue deleted file mode 100644 index 27e912cab..000000000 --- a/src/views/dashboard/echarts/demonstration.vue +++ /dev/null @@ -1,175 +0,0 @@ - - - diff --git a/src/views/dashboard/echarts/exam.vue b/src/views/dashboard/echarts/exam.vue deleted file mode 100644 index 4d4f5a557..000000000 --- a/src/views/dashboard/echarts/exam.vue +++ /dev/null @@ -1,191 +0,0 @@ - - - - diff --git a/src/views/dashboard/echarts/lesson.vue b/src/views/dashboard/echarts/lesson.vue deleted file mode 100644 index 133753cf2..000000000 --- a/src/views/dashboard/echarts/lesson.vue +++ /dev/null @@ -1,175 +0,0 @@ - - - diff --git a/src/views/dashboard/echarts/permission.vue b/src/views/dashboard/echarts/permission.vue deleted file mode 100644 index b48ed6273..000000000 --- a/src/views/dashboard/echarts/permission.vue +++ /dev/null @@ -1,204 +0,0 @@ - - - - diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue deleted file mode 100644 index 578ac8cce..000000000 --- a/src/views/dashboard/index.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - - - diff --git a/src/views/designPlatform/mapPreviewNew.vue b/src/views/designPlatform/mapPreviewNew.vue index 9ce60a632..386a9fcbf 100644 --- a/src/views/designPlatform/mapPreviewNew.vue +++ b/src/views/designPlatform/mapPreviewNew.vue @@ -84,13 +84,10 @@ export default { } }, onContextmenu(em) { - this.point = { - x: em.clientX, - y: em.clientY - }; + const point = { x: em.clientX, y: em.clientY }; if (!em.deviceType) { var menu = getDeviceMenuByDeviceType('Cancel'); - this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu }); + this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu }); } }, // 设置地图定位 diff --git a/src/views/error-page/401.vue b/src/views/error-page/401.vue deleted file mode 100644 index 2f5be5120..000000000 --- a/src/views/error-page/401.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - - - diff --git a/src/views/newMap/displayNew/index.vue b/src/views/newMap/displayNew/index.vue index 11bb0a031..cd3059ff8 100644 --- a/src/views/newMap/displayNew/index.vue +++ b/src/views/newMap/displayNew/index.vue @@ -21,7 +21,6 @@ @devicemodel="devicemodel" @showScheduling="showScheduling" /> - import { mapGetters } from 'vuex'; import { getDeviceMenuByDeviceType, OperationEvent } from '@/scripts/ConstDic'; -// import { letfMouseSelectDevice } from '@/api/simulation'; import deviceType from '@/jmap/constant/deviceType'; import JlmapVisual from '@/views/newMap/jlmapNew/index'; import TrainingTips from '@/views/newMap/mapsystemNew/plugin/trainingtip'; @@ -23,11 +22,7 @@ export default { data() { return { selected: null, - menus: null, - point: { - x: 0, - y: 0 - } + menus: null }; }, computed: { @@ -85,11 +80,11 @@ export default { }, clickEvent(em) { var device = { _type: em.deviceType, _code: em.deviceCode }; - var CanClickDeviceList = [ - deviceType.Switch, - deviceType.Signal, - deviceType.StationStand - ]; + // var CanClickDeviceList = [ + // deviceType.Switch, + // deviceType.Signal, + // deviceType.StationStand + // ]; const lineCode = this.$store.getters['map/lineCode']; if (em.deviceType === 'StationStand' && lineCode === '01') { const menu = getDeviceMenuByDeviceType(device._type) || []; @@ -98,13 +93,13 @@ export default { if (em.deviceCode) { device = this.getDeviceByEm(em); - if (CanClickDeviceList.includes(em.deviceType)) { - try { - // letfMouseSelectDevice(em.deviceCode, this.group); - } catch (error) { - console.log('send left mouse click error.'); - } - } + // if (CanClickDeviceList.includes(em.deviceType)) { + // try { + // // letfMouseSelectDevice(em.deviceCode, this.group); + // } catch (error) { + // console.log('send left mouse click error.'); + // } + // } } this.selected = device; this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType}); @@ -118,7 +113,7 @@ export default { contextmenu(em) { var menu = null; var device = null; - this.point = { x: em.clientX, y: em.clientY }; + const point = { x: em.clientX, y: em.clientY }; const lineCode = this.$store.getters['map/lineCode']; if (em.subType === 'TrainWindow') { device = { _type: deviceType.TrainWindow, code: em.deviceCode }; @@ -127,16 +122,16 @@ export default { const equipment = this.getDeviceByEm(em); this.$store.dispatch('menuOperation/setSelected', {device:equipment, subType: em.subType}); menu = getDeviceMenuByDeviceType('StationControl'); - this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu }); + this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu }); this.$store.dispatch('training/emitTipFresh'); return; } else if (em.subType == 'enabled' && em.deviceType == 'Switch') { menu = getDeviceMenuByDeviceType('Enabled'); - this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu }); + this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu }); return; } else if (em.subType === 'enabled' && em.deviceType === 'Signal') { menu = getDeviceMenuByDeviceType('Enabled'); - this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu}); + this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu}); return; } else if (em.deviceCode && !this.isScreen) { device = this.getDeviceByEm(em); @@ -146,18 +141,18 @@ export default { if (!this.buttonOperation) { this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType}); if (!this.checkShouldPop(device)) { - this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: null }); + this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: null }); } else { if (em.deviceType === 'StationStand' && lineCode === '01') { return; } menu = getDeviceMenuByDeviceType(device._type); - this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu }); + this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu }); } } } else { menu = getDeviceMenuByDeviceType('Cancel'); - this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu }); + this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu }); } this.$store.dispatch('training/emitTipFresh'); }, diff --git a/src/views/newMap/newDesignUser/demonList.vue b/src/views/newMap/newDesignUser/demonList.vue index df942a8df..5fbfbdffd 100644 --- a/src/views/newMap/newDesignUser/demonList.vue +++ b/src/views/newMap/newDesignUser/demonList.vue @@ -16,8 +16,6 @@
{{ $t('map.importMap') }} - {{ $t('map.newConstruction') }}
@@ -68,13 +66,6 @@ export default { lineCode: '' }; }, - computed: { - // role() { - // return this.$store.state.user.roles.includes('04') || - // this.$store.state.user.roles.includes('05') || - // this.$store.state.user.roles.includes('01'); - // } - }, watch: { filterText(val) { this.$refs.tree.filter(val); diff --git a/src/views/newMap/newDesignUser/mapmanage/operateMenu.vue b/src/views/newMap/newDesignUser/mapmanage/operateMenu.vue index f6dbad79b..ae7a5413b 100644 --- a/src/views/newMap/newDesignUser/mapmanage/operateMenu.vue +++ b/src/views/newMap/newDesignUser/mapmanage/operateMenu.vue @@ -261,7 +261,7 @@ export default { this.$refs.publish3d.show(); } }, - assetmanager3d(){ + assetmanager3d() { this.$emit('assetmanager3d'); }, jlmap3d() { diff --git a/src/views/newMap/newDesignUser/mapmanage/publish.vue b/src/views/newMap/newDesignUser/mapmanage/publish.vue index 6b38c793b..4c1432b64 100644 --- a/src/views/newMap/newDesignUser/mapmanage/publish.vue +++ b/src/views/newMap/newDesignUser/mapmanage/publish.vue @@ -2,7 +2,7 @@
- {{ this.map.name }} + {{ map.name }} diff --git a/src/views/newMap/newDesignUser/mapmanage/publish3d.vue b/src/views/newMap/newDesignUser/mapmanage/publish3d.vue index a8acc0238..be4c181ed 100644 --- a/src/views/newMap/newDesignUser/mapmanage/publish3d.vue +++ b/src/views/newMap/newDesignUser/mapmanage/publish3d.vue @@ -2,7 +2,7 @@
- {{ this.map.name }} + {{ map.name }} @@ -23,7 +23,7 @@