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/store/modules/training.js b/src/store/modules/training.js index 61300ce0d..03c0afc8c 100644 --- a/src/store/modules/training.js +++ b/src/store/modules/training.js @@ -228,15 +228,17 @@ const training = { setSimulationUserList: (state, simulationUserList) => { state.simulationUserList = simulationUserList; }, - updateMemberListInScript:(state, {oldMemberId, newMemberId, userId}) => { + updateMemberListInScript:(state, {oldMemberId, newMemberId, userId, name}) => { if (oldMemberId) { // 重置旧数据 state.memberData[oldMemberId].trust = false; delete state.memberData[oldMemberId].userId; + delete state.memberData[oldMemberId].name; state.memberData[oldMemberId].disabled = false; } // 更新新数据 state.memberData[newMemberId].userId = userId; + state.memberData[newMemberId].name = name; state.memberData[newMemberId].disabled = true; state.memberData[newMemberId].trust = true; }, 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 @@ - - - - {{ $t('global.back') }} - - - - - Oops! - - {{ $t('error.gifSource') }}airbnb {{ $t('error.page') }} - {{ $t('error.noPermissionToGoToThisPage') }} - {{ $t('error.dissatisfied') }} - - {{ $t('error.orYouCanGo') }} - - - {{ $t('error.backToHome') }} - - - - {{ $t('error.justLookingAround') }} - - {{ $t('error.pointMeToSeeThePicture') }} - - - - - - - - - - - - - - - diff --git a/src/views/newMap/displayNew/chatView/chatBox.vue b/src/views/newMap/displayNew/chatView/chatBox.vue index e492b8eaa..25f4ee623 100644 --- a/src/views/newMap/displayNew/chatView/chatBox.vue +++ b/src/views/newMap/displayNew/chatView/chatBox.vue @@ -55,7 +55,7 @@ import ChatCreateGroup from './chatCreateGroup'; import ChatMemberList from './chatMemberList'; import ChatTooltip from './chatTooltip'; import RecordRTC from 'recordrtc'; -import {sendSimulationConversition, overSimulationConversition, getSimulationMembersNew, getAllConversition, getSimulationConversition} from '@/api/chat'; +import {sendSimulationConversition, overSimulationConversition, getAllConversition, getSimulationConversition} from '@/api/chat'; import ConstConfig from '@/scripts/ConstConfig'; import Cookies from 'js-cookie'; export default { @@ -135,7 +135,6 @@ export default { const objectBottom = parseInt(object.style.bottom) || 0; this.bottom = this.bottom + object.offsetHeight + objectBottom; } - this.getSimulationMembers(); }, 'userRole':function(val) { this.isHasCoversition = false; @@ -196,77 +195,78 @@ export default { }, // 获取所有的成员列表 getSimulationMembers() { - getSimulationMembersNew(this.$route.query.group).then(resp => { - let lastData = JSON.stringify(resp.data); - const roleTypeList = ConstConfig.ConstSelect.roleTypeNew; - roleTypeList.forEach(function(element) { - const rolename = element.value; - if (Cookies.get('user_lang') == 'en') { - lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel); - } else { - lastData = lastData.replace(new RegExp(rolename, 'g'), element.label); - } - }); - lastData = JSON.parse(lastData); - const activeList = this.$store.state.map.activeTrainList; - const memberList = []; - // lastData = lastData.filter(memberIn=>{ return memberIn.role != '观众'; }); - lastData.forEach((member, index)=>{ - if (member.type != '观众') { - const name = member.name == undefined ? '' : '-' + member.name; - if (member.deviceCode) { - const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode); - if (device) { - if (device._type == 'Train') { - member.memberName = member.type + device.groupNumber + name; - if (activeList.length > 0 && activeList.includes(device.groupNumber)) { - memberList.push(member); - } - } else { - member.memberName = member.type + device.name + name; - memberList.push(member); + const memberList = this.$store.state.training.memberData; + let lastData = JSON.stringify(memberList); + const roleTypeList = ConstConfig.ConstSelect.roleTypeNew; + roleTypeList.forEach(function(element) { + const rolename = element.value; + if (Cookies.get('user_lang') == 'en') { + lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel); + } else { + lastData = lastData.replace(new RegExp(rolename, 'g'), element.label); + } + }); + lastData = JSON.parse(lastData); + const activeList = this.$store.state.map.activeTrainList; + lastData = Object.values(lastData); + const lastMemberList = []; + lastData.forEach((member, index)=>{ + if (member.type != '观众') { + const name = member.name == undefined ? '' : '-' + member.name; + if (member.deviceCode) { + const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode); + if (device) { + if (device._type == 'Train') { + member.memberName = member.type + device.groupNumber + name; + if (activeList.length > 0 && activeList.includes(device.groupNumber)) { + lastMemberList.push(member); } } else { - member.memberName = member.type + member.deviceCode + name; - memberList.push(member); + member.memberName = member.type + device.name + name; + lastMemberList.push(member); } } else { - member.memberName = member.type + name; - memberList.push(member); + member.memberName = member.type + member.deviceCode + name; + lastMemberList.push(member); } - } - }); - this.memberList = memberList; - - if (this.recordSending) { - this.cancleRecording(); - } - // 获取会话列表 - getAllConversition(this.$route.query.group).then(resp=>{ - if (resp.data && resp.data.length && resp.data.length > 0) { - this.isCreate = false; - const coversitionList = resp.data; - let memberListCoversition = {}; - coversitionList.forEach(coversition=>{ - if (!coversition.over) { - const memberList = coversition.memberList; - memberList.forEach(member=>{ - if (member.memberId == this.$store.state.scriptRecord.updateRoleId) { - memberListCoversition = {id:coversition.id, all:null}; - if (member.memberId == coversition.creatorId) { - this.isCreate = true; - } - } - }); - } - }); - this.memberListCoversition = memberListCoversition; } else { - this.isCreate = false; - this.memberListCoversition = {}; + member.memberName = member.type + name; + lastMemberList.push(member); } - this.getSimulationConverMembers(); - }); + } + }); + this.memberList = lastMemberList; + this.getAllConversition(); + }, + getAllConversition() { + if (this.recordSending) { + this.cancleRecording(); + } + // 获取会话列表 + getAllConversition(this.$route.query.group).then(resp=>{ + if (resp.data && resp.data.length && resp.data.length > 0) { + this.isCreate = false; + const coversitionList = resp.data; + let memberListCoversition = {}; + coversitionList.forEach(coversition=>{ + if (!coversition.over) { + const memberList = coversition.memberList; + memberList.forEach(member=>{ + if (member.memberId == this.$store.state.scriptRecord.updateRoleId) { + memberListCoversition = {id:coversition.id, all:null}; + if (member.memberId == coversition.creatorId) { + this.isCreate = true; + } + } + }); + } + }); + this.memberListCoversition = memberListCoversition; + } else { + this.isCreate = false; + this.memberListCoversition = {}; + } + this.getSimulationConverMembers(); }); }, // 获取当前对话的信息 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 @@