From 5ba93805c127439949cd3f5273efe97f67d2dd9c Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 23 Sep 2019 17:47:54 +0800 Subject: [PATCH 001/179] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=A0=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Logout.vue | 24 +++++- src/permission.js | 11 ++- src/router/index.js | 130 +++++++++++++++++++++++++------ src/store/modules/permission.js | 24 ++++-- src/store/modules/user.js | 13 +++- src/utils/auth.js | 13 ++++ src/utils/login.js | 3 +- src/views/login/index.vue | 6 +- 8 files changed, 184 insertions(+), 40 deletions(-) diff --git a/src/layout/components/Logout.vue b/src/layout/components/Logout.vue index 6638fef8d..2a7d1232f 100644 --- a/src/layout/components/Logout.vue +++ b/src/layout/components/Logout.vue @@ -7,6 +7,9 @@ + + {{ $t('router.selfPermission') }} + {{ $t('global.language') }} @@ -19,8 +22,9 @@ diff --git a/src/permission.js b/src/permission.js index a863cda63..feee8e475 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import store from '@/store'; import router from './router'; import NProgress from 'nprogress'; // Progress 进度条 import 'nprogress/nprogress.css';// Progress 进度条样式 -import { admin } from './router'; +import { admin, userDesign} from './router'; import { getToken, getScreenToken, getPlanToken } from '@/utils/auth'; // 验权 import { LoginParams } from '@/utils/login'; +import { getSessionStorage } from '@/utils/auth'; function hasPermission(roles, permissionRoles) { if (roles.indexOf(admin) >= 0) return true; @@ -15,7 +16,7 @@ function hasPermission(roles, permissionRoles) { const isDev = process.env.NODE_ENV === 'development'; -const whiteList = ['/login', '/login1', '/dp/login', '/dp/login1', '/plan/login', '/plan/login1']; // 不重定向白名单 +const whiteList = ['/login', '/login1', '/dp/login', '/dp/login1', '/plan/login', '/plan/login1', '/design/login1']; // 不重定向白名单 const loginPage = isDev ? whiteList[1] : whiteList[0]; @@ -52,11 +53,15 @@ function handleRoute(to, from, next, routeInfo) { // 拉取用户信息 store.dispatch('GetInfo', routeInfo.getTokenInfo).then(res => { // 根据roles权限生成可访问的路由表 + // debugger; const roles = res.roles; - + if (getSessionStorage('design')) { + roles.push(userDesign); + } store.dispatch('GenerateRoutes', { roles, clientId: routeInfo.clientId }).then(() => { // 动态添加可访问路由表 router.addRoutes(store.getters.addRouters); + // router.addRoutes(asyncRouter1); if (to.redirectedFrom) { next({ path: to.redirectedFrom, replace: true }); } else { diff --git a/src/router/index.js b/src/router/index.js index 7a59299de..433aaac9b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -11,6 +11,7 @@ import LoginNewScreen from '@/views/login/loginNewScreen'; import LoginScreen from '@/views/login/loginScreen'; import LoginNewPlan from '@/views/login/loginNewPlan'; import LoginPlan from '@/views/login/loginPlan'; +import LoginDesign from '@/views/login/loginDesign'; import Jlmap3dedit from '@/views/jlmap3d/edit/jlmap3dedit'; import Jlmap3d from '@/views/jlmap3d/drive/jl3ddrive'; @@ -70,6 +71,9 @@ import PlanMonitor from '@/views/planMonitor/index'; import PlanMonitorHome from '@/views/planMonitor/home'; import PlanMonitorDetail from '@/views/planMonitor/detail'; +// import DesignPlatform from '@/views/designPlatform/index'; +import DesignPlatformHome from '@/views/designPlatform/home'; + import Replay from '@/views/replay/index'; import Package from '@/views/package/index'; import PackageDraft from '@/views/package/draft/ruleForm'; @@ -142,6 +146,7 @@ export const userLesson = '012'; // 教学系统 export const userSimulation = '013'; // 仿真系统 export const userScreen = '014'; // 大屏系统 export const userPlan = '015'; // 计划系统 +export const userDesign='016'; // 设计系统 export const UrlConfig = { display: '/display', @@ -193,6 +198,12 @@ export const UrlConfig = { detail: '/plan/detail', pay: '/plan/pay' }, + design: { + prefix: '/design' + // tool: '/design/tool', + // detail: '/plan/detail', + // pay: '/plan/pay' + }, replay: { prefix: '/replay' }, @@ -277,6 +288,12 @@ export const constantRoutes = [ component: LoginPlan, hidden: true }, + // 密码登录 + { + path: '/design/login1', + component: LoginDesign, + hidden: true + }, { path: '/jlmap3d/edit', component: Jlmap3dedit, @@ -294,19 +311,22 @@ export const constantRoutes = [ hidden: true }, - { - path: '/', - component: Layout, - redirect: '/dashboard', - children: [{ - path: 'dashboard', - component: Dashboard, - meta: { - i18n: 'router.homePage', - icon: 'dashboard' - } - }] - }, + // { + // path: '/', + // component: Layout, + // redirect: '/dashboard', + // meta: { + // roles: [admin, user] + // }, + // children: [{ + // path: 'dashboard', + // component: Dashboard, + // meta: { + // i18n: 'router.homePage', + // icon: 'dashboard' + // } + // }] + // }, { path: '*', redirect: '/404', hidden: true } ]; @@ -317,13 +337,54 @@ export const asyncRouter = [ component: Layout, redirect: '/dashboard', hidden: true, + meta: { + roles: [admin, user] + }, children: [ { path: 'dashboard', - component: Dashboard1 + component: Dashboard, + meta: { + i18n: 'router.homePage', + icon: 'dashboard' + } } ] }, + { + path: '/design/home', + redirect: '/design/home/index', + component: Layout, + meta: { + roles: [admin, user, userDesign] + }, + children: [ + { + path: 'index', + component: DesignPlatformHome, + meta: { + i18n: 'router.homePage', + icon: 'design' + } + } + ] + }, + // { + // path: '/', + // component: Layout, + // redirect: '/dashboard', + // meta: { + // roles: [admin, user] + // }, + // children: [{ + // path: 'dashboard', + // component: Dashboard, + // meta: { + // i18n: 'router.homePage', + // icon: 'dashboard' + // } + // }] + // }, { path: '/display/:mode', component: Display, @@ -361,7 +422,7 @@ export const asyncRouter = [ path: '/map', meta: { i18n: 'router.mapManage', - roles: [admin, mapCreater] + roles: [admin, mapCreater, userDesign] }, component: Layout, children: [ @@ -426,7 +487,7 @@ export const asyncRouter = [ component: Layout, meta: { i18n: 'router.lessaonManage', - roles: [admin, lessonCreater] + roles: [admin, lessonCreater, userDesign] }, children: [ { @@ -485,7 +546,7 @@ export const asyncRouter = [ path: '/script', component: Layout, meta: { - roles: [admin, lessonCreater, user] + roles: [admin, lessonCreater, user, userDesign] }, children: [ { @@ -515,6 +576,7 @@ export const asyncRouter = [ { path: '/teach', component: Layout, + hidden: true, meta: { roles: [admin, userLesson, user] }, @@ -561,6 +623,7 @@ export const asyncRouter = [ { path: '/exam', component: Layout, + hidden: true, meta: { roles: [admin, userExam, user] }, @@ -622,6 +685,7 @@ export const asyncRouter = [ }, { path: '/demonstration', + hidden: true, component: Layout, meta: { roles: [admin, userSimulation, user] @@ -658,6 +722,7 @@ export const asyncRouter = [ }, { path: '/dp', + hidden: true, redirect: '/dp/home', component: ScreenMonitor, meta: { @@ -696,7 +761,7 @@ export const asyncRouter = [ redirect: '/plan/home', component: PlanMonitor, meta: { - roles: [admin, user] + roles: [admin, user, userDesign] }, children: [ { @@ -723,7 +788,7 @@ export const asyncRouter = [ path: '/replay', component: Layout, meta: { - roles: [admin] + roles: [admin, userDesign] }, children: [ { @@ -741,6 +806,7 @@ export const asyncRouter = [ meta: { roles: [admin, user] }, + hidden: true, children: [ { path: 'manage', @@ -766,7 +832,7 @@ export const asyncRouter = [ component: Layout, meta: { i18n: 'router.pulishManage', - roles: [admin] + roles: [admin, userDesign] }, children: [ { @@ -857,7 +923,7 @@ export const asyncRouter = [ component: Layout, meta: { i18n: 'router.orderAuthorityManage', - roles: [admin] + roles: [admin, userDesign] }, children: [ { @@ -949,7 +1015,7 @@ export const asyncRouter = [ component: Layout, meta: { i18n: 'router.systemManage', - roles: [admin] + roles: [admin, userDesign] }, children: [ { @@ -1011,6 +1077,26 @@ export const asyncRouter = [ } ] } + // , + // { + // path: '/design', + // redirect: '/design/home', + // component: Layout, + // hidden: true, + // meta: { + // roles: [admin, user] + // }, + // children: [ + // { + // path: 'home', + // component: DesignPlatformHome, + // meta: { + // i18n: 'router.homePage', + // icon: 'design' + // } + // } + // ] + // } ]; const createRouter = () => new Router({ diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index cd75fad78..263502d1b 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -1,6 +1,7 @@ -import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin } from '@/router'; +import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin, userDesign } from '@/router'; import { PermissionType } from '@/utils/PermissionType'; import { UrlConfig } from '@/router/index'; +import { getSessionStorage } from '@/utils/auth'; function setHonePagePath(route, roles) { if (roles && roles.length === 2 && roles.indexOf(user) >= 0 && (route.path === '/' || route.path === 'dashboard')) { @@ -26,7 +27,16 @@ function setHonePagePath(route, roles) { function hasPermission(roles, route, parentsRoles) { setHonePagePath(route, roles); if (route.meta && route.meta.roles) { + // debugger; // 如果存在本级路由,则使用自己的roles过滤 + if (getSessionStorage('design')&& route.meta.roles.indexOf(userDesign)===-1 ) { + route.hidden = true; + } else { + // debugger; + if (!getSessionStorage('design')&&route.meta.roles.indexOf(userDesign)>0) { + route.hidden = true; + } + } return roles.some(role => route.meta.roles.indexOf(role) >= 0); } else if (parentsRoles) { // 如果没有本级路由,有父级路由,则使用父级路由过滤 @@ -91,13 +101,15 @@ const permission = { // 生成其他权限路由 GenerateRoutes({ commit }, data) { return new Promise(resolve => { + // debugger; const { roles } = convertRouterRoles(data); let accessedRouters; - if (roles.indexOf(superAdmin) >= 0) { - accessedRouters = asyncRouter; - } else { - accessedRouters = filterAsyncRouter(asyncRouter, roles); - } + // if (roles.indexOf(superAdmin) >= 0) { + // accessedRouters = asyncRouter; + // } else { + // eslint-disable-next-line prefer-const + accessedRouters = filterAsyncRouter(asyncRouter, roles); + // } commit('SET_ROUTERS', accessedRouters); resolve(); diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 3297633a9..5412c5597 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,6 +1,6 @@ -import { setSessionStorage } from '@/utils/auth'; +import { setSessionStorage, removeSessionStorage } from '@/utils/auth'; import { login, logout, getInfo } from '@/api/login'; -import { getToken, setToken, removeToken, removeScreenToken, setScreenToken, getScreenToken, setPlanToken, getPlanToken, removePlanToken, handleToken, handleRemoveToken } from '@/utils/auth'; +import { getToken, setToken, removeToken, removeScreenToken, setScreenToken, getScreenToken, setPlanToken, setDesignToken, getPlanToken, removePlanToken, handleToken, handleRemoveToken } from '@/utils/auth'; import { getUserConfigInfo } from '@/api/management/user'; import { LoginParams } from '@/utils/login'; import { creatSubscribe, perpetualTopic } from '@/utils/stomp'; @@ -77,6 +77,14 @@ const user = { const header = { group: '', 'X-Token': getPlanToken() }; creatSubscribe(perpetualTopic, header); }; + } else if (userInfo.type == 'design') { + params = Object.assign({ account: username, password }, LoginParams.Design); + execFc = (token) => { + setDesignToken(token); + commit('SET_TOKENPLAN', token); + const header = { group: '', 'X-Token': getPlanToken() }; + creatSubscribe(perpetualTopic, header); + }; } else { params = Object.assign({ account: username, password }, LoginParams.LianKeTang); execFc = (token) => { @@ -170,6 +178,7 @@ const user = { commit('SET_TOKEN', ''); commit('SET_ROLES', []); commit('SET_ID', ''); + removeSessionStorage('design'); handleRemoveToken(); resolve(); }).catch(error => { diff --git a/src/utils/auth.js b/src/utils/auth.js index 0e120f462..8b97f45e2 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -7,6 +7,8 @@ const TokenScreenKey = 'Screen-Token'; const TokenPlanKey = 'Plan-Token'; +const TokenDesignKey='Admin-Token'; + // 设置教学,实训,仿真系统token export function getToken() { return SessionStorage.getItem(TokenKey); @@ -28,6 +30,17 @@ export function removeScreenToken() { return SessionStorage.removeItem(TokenScreenKey); } +// 设置城市轨道交通设计平台token +export function getDesignToken() { + return SessionStorage.getItem(TokenDesignKey); +} +export function setDesignToken(token) { + return SessionStorage.setItem(TokenDesignKey, token); +} +export function removeDesignToken() { + return SessionStorage.removeItem(TokenDesignKey); +} + // 设置琏计划token export function getPlanToken() { return SessionStorage.getItem(TokenPlanKey); diff --git a/src/utils/login.js b/src/utils/login.js index cbb2a2270..6dad0c93f 100644 --- a/src/utils/login.js +++ b/src/utils/login.js @@ -4,5 +4,6 @@ export const LoginParams = { LianKeTang: { clientId: '1', secret: 'joylink' }, // "琏课堂" DaPing: { clientId: '2', secret: 'bigscreen' }, // "大屏系统" LianJiHua: { clientId: '3', secret: 'linkplan' }, // "琏计划" - Assistant: { clientId: '4', secret: 'linkassistant' } // "琏课堂助手" + Assistant: { clientId: '4', secret: 'linkassistant' }, // "琏课堂助手" + Design: { clientId: '1', secret: 'joylink' } // "城市轨道交通设计平台" }; diff --git a/src/views/login/index.vue b/src/views/login/index.vue index cffc7633a..2aed87609 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -33,7 +33,8 @@ - 琏课堂 + + 城市轨道交通实训平台
{{ tipsMsg }}
@@ -80,7 +81,8 @@ export default { }; }, mounted() { - document.title = '琏课堂'; + // document.title = '琏课堂'; + document.title = '城市轨道交通实训平台'; }, methods: { showPwd() { From d063625c4587a2117f9aa22b3c6269402193fc26 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 23 Sep 2019 17:49:04 +0800 Subject: [PATCH 002/179] =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=88=86=E5=8C=96?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/en/router.js | 3 +- src/i18n/langs/zh/router.js | 3 +- src/router/index.js | 68 +++++++++-- src/utils/baseUrl.js | 4 +- src/views/demonstration/detail/index.vue | 126 ++++++++----------- src/views/teach/detail/index.vue | 1 + src/views/trainingPlatform/demonList.vue | 148 +++++++++++++++++++++++ src/views/trainingPlatform/home.vue | 97 +++++++++++++++ src/views/trainingPlatform/index.vue | 76 ++++++++++++ 9 files changed, 440 insertions(+), 86 deletions(-) create mode 100644 src/views/trainingPlatform/demonList.vue create mode 100644 src/views/trainingPlatform/home.vue create mode 100644 src/views/trainingPlatform/index.vue diff --git a/src/i18n/langs/en/router.js b/src/i18n/langs/en/router.js index daff10210..46fcf8efe 100644 --- a/src/i18n/langs/en/router.js +++ b/src/i18n/langs/en/router.js @@ -58,5 +58,6 @@ export default { userExamManage: 'User examination management', userSimulationManage: 'User simulation management', existingSimulation: 'Existence simulation management', - ibpDraw: 'ibp Draw' + ibpDraw: 'Ibp Draw', + trainingPlatform: 'trainingPlatform' }; diff --git a/src/i18n/langs/zh/router.js b/src/i18n/langs/zh/router.js index 118b85442..5270ff627 100644 --- a/src/i18n/langs/zh/router.js +++ b/src/i18n/langs/zh/router.js @@ -59,5 +59,6 @@ export default { userSimulationManage: '用户仿真统计', existingSimulation: '存在仿真管理', - ibpDraw: 'Ibp盘绘制' + ibpDraw: 'Ibp盘绘制', + trainingPlatform: '实训平台' }; diff --git a/src/router/index.js b/src/router/index.js index 7a59299de..45ca6a444 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -86,6 +86,8 @@ import ProductStatus from '@/views/publish/productStatus/index'; import PublishLesson from '@/views/publish/publishLesson/index'; // import SimulationScript from '@/views/publish/simulationScript/index'; import IbpEdit from '@/views/ibp/ibpDraft/ibpEdit/index'; +import TrainingPlatform from '@/views/trainingPlatform/index'; +import TrainingPlatformHome from '@/views/trainingPlatform/home'; import Commodity from '@/views/orderauthor/commodity/index'; import CommodityDraft from '@/views/orderauthor/commodity/draft'; @@ -233,6 +235,13 @@ export const UrlConfig = { prefix: 'ibp', draft: '/ibp/draft', edit: 'ibp/edit' + }, + trainingPlatform: { + trainingPlatform: '/trainingPlatform', + trainingPlatformHome: '/trainingPlatform/home', + prodDetail: '/trainingPlatform/detail', + teachDetail: '/trainingPlatform/teach', + examDetail: '/trainingPlatform/exam' } }; @@ -531,14 +540,14 @@ export const asyncRouter = [ path: 'home', component: TeachHome }, - { - // 课程详情 - path: 'detail/:lessonId', - component: TeachDetail, - meta: { - }, - hidden: true - }, + // { + // // 课程详情 + // path: 'detail/:lessonId', + // component: TeachDetail, + // meta: { + // }, + // hidden: true + // }, { // 实训详情 path: 'practical/:trainingId/:lessonId', @@ -620,6 +629,47 @@ export const asyncRouter = [ } ] }, + { + path: '/trainingPlatform', + component: Layout, + meta: { + roles: [admin, userSimulation, user] + }, + children: [ + { + path: '', + redirect: '/trainingPlatform/home', + component: TrainingPlatform, + meta: { + i18n: 'router.trainingPlatform' + }, + children: [ + { + path: 'home', + component: TrainingPlatformHome, + meta: { + i18n: 'router.trainingPlatform' + } + }, + { + path: 'detail/:mapId/:prodId', + component: DemonstrationDetail, + hidden: true + }, + { + path: 'teach/:lessonId', + component: TeachDetail, + hidden: true + }, + { + path: 'exam/:examId', + component: ExamDetail, + hidden: true + } + ] + } + ] + }, { path: '/demonstration', component: Layout, @@ -643,7 +693,7 @@ export const asyncRouter = [ } }, { - path: 'detail/:mapId', + path: 'detail/:mapId/:prodId', component: DemonstrationDetail, hidden: true }, diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 09e20008f..871e8ec9c 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,10 +3,10 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 - BASE_API = 'http://192.168.3.41:9000'; // 王兴杰 + // BASE_API = 'http://192.168.3.41:9000'; // 王兴杰 } else { BASE_API = process.env.VUE_APP_BASE_API; } diff --git a/src/views/demonstration/detail/index.vue b/src/views/demonstration/detail/index.vue index 28b3d5762..52950b5f1 100644 --- a/src/views/demonstration/detail/index.vue +++ b/src/views/demonstration/detail/index.vue @@ -1,25 +1,9 @@ + + diff --git a/src/views/trainingPlatform/home.vue b/src/views/trainingPlatform/home.vue new file mode 100644 index 000000000..8f98c83e8 --- /dev/null +++ b/src/views/trainingPlatform/home.vue @@ -0,0 +1,97 @@ + + + + diff --git a/src/views/trainingPlatform/index.vue b/src/views/trainingPlatform/index.vue new file mode 100644 index 000000000..2c3d722fe --- /dev/null +++ b/src/views/trainingPlatform/index.vue @@ -0,0 +1,76 @@ + + + + From 7514a7657f4f38734ed57683015209fe0c5e118e Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 23 Sep 2019 17:50:07 +0800 Subject: [PATCH 003/179] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=A0=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/designPlatform/home.vue | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/views/designPlatform/home.vue diff --git a/src/views/designPlatform/home.vue b/src/views/designPlatform/home.vue new file mode 100644 index 000000000..e69de29bb From fd8a1817c56dfdaa1e0a6f33f7d3451700ff2ba4 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 23 Sep 2019 17:52:44 +0800 Subject: [PATCH 004/179] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=A0=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/loginDesign.vue | 239 ++++++++++++++++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 src/views/login/loginDesign.vue diff --git a/src/views/login/loginDesign.vue b/src/views/login/loginDesign.vue new file mode 100644 index 000000000..e1b5ed6ca --- /dev/null +++ b/src/views/login/loginDesign.vue @@ -0,0 +1,239 @@ + + + + + + + From e2ee048f561e5d2cc79bd48e6003662ca4f90a8f Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 23 Sep 2019 18:06:29 +0800 Subject: [PATCH 005/179] =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=88=86=E5=8C=96?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index a04b039bc..81199c32b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -344,21 +344,21 @@ export const asyncRouter = [ { path: '/', component: Layout, - redirect: '/dashboard', + redirect: '/trainingPlatform', hidden: true, meta: { roles: [admin, user] - }, - children: [ - { - path: 'dashboard', - component: Dashboard, - meta: { - i18n: 'router.homePage', - icon: 'dashboard' - } - } - ] + } + // children: [ + // { + // path: 'dashboard', + // component: Dashboard, + // meta: { + // i18n: 'router.homePage', + // icon: 'dashboard' + // } + // } + // ] }, { path: '/design/home', @@ -602,14 +602,6 @@ export const asyncRouter = [ path: 'home', component: TeachHome }, - // { - // // 课程详情 - // path: 'detail/:lessonId', - // component: TeachDetail, - // meta: { - // }, - // hidden: true - // }, { // 实训详情 path: 'practical/:trainingId/:lessonId', @@ -704,15 +696,14 @@ export const asyncRouter = [ redirect: '/trainingPlatform/home', component: TrainingPlatform, meta: { - i18n: 'router.trainingPlatform' }, children: [ { path: 'home', component: TrainingPlatformHome, meta: { - i18n: 'router.trainingPlatform' - } + }, + hidden: true }, { path: 'detail/:mapId/:prodId', From 823eb02b9075087a626110e350d656bb2fd578a1 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 24 Sep 2019 10:51:41 +0800 Subject: [PATCH 006/179] =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=88=86=E5=8C=96?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=A0=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Navbar.vue | 5 +- src/permission.js | 5 ++ src/router/index.js | 39 +++++++------ src/store/modules/permission.js | 1 - src/store/modules/user.js | 6 ++ src/views/designPlatform/home.vue | 97 +++++++++++++++++++++++++++++++ src/views/login/index.vue | 4 +- src/views/login/loginDesign.vue | 5 +- 8 files changed, 138 insertions(+), 24 deletions(-) diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 6ef9d3747..0588c1354 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -8,6 +8,7 @@ text-color="#fff" active-text-color="#ffd04b" > + \ No newline at end of file From e7d7ad76f0d08c36f41ea115d43fd0b19b1f4a4b Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 25 Sep 2019 13:05:01 +0800 Subject: [PATCH 016/179] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Logout.vue | 11 ----- src/layout/components/Title.vue | 3 +- src/router/index.js | 12 +++++ src/views/demonstration/detail/index.vue | 2 +- src/views/package/index.vue | 62 +++--------------------- src/views/trainingPlatform/demonList.vue | 1 + src/views/trainingPlatform/index.vue | 10 +++- 7 files changed, 31 insertions(+), 70 deletions(-) diff --git a/src/layout/components/Logout.vue b/src/layout/components/Logout.vue index 2a7d1232f..8bd608547 100644 --- a/src/layout/components/Logout.vue +++ b/src/layout/components/Logout.vue @@ -7,9 +7,6 @@ - - {{ $t('router.selfPermission') }} - {{ $t('global.language') }} @@ -22,7 +19,6 @@ - diff --git a/src/views/trainingPlatform/demonList.vue b/src/views/trainingPlatform/demonList.vue index e14ebd8c1..5175ec71f 100644 --- a/src/views/trainingPlatform/demonList.vue +++ b/src/views/trainingPlatform/demonList.vue @@ -103,6 +103,7 @@ this.$router.push({ path: `${UrlConfig.trainingPlatform.prodDetail}/${this.mapId}/${obj.id}` }); } else if ( obj.type === 'map'){ this.mapId = obj.id; + this.$router.push({ path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`}); } else if ( obj.type === 'lesson' ){ this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${obj.id}`}); } else if ( obj.type === 'exam' ){ diff --git a/src/views/trainingPlatform/index.vue b/src/views/trainingPlatform/index.vue index 3c07179bd..adc03aa4c 100644 --- a/src/views/trainingPlatform/index.vue +++ b/src/views/trainingPlatform/index.vue @@ -6,7 +6,7 @@ - + @@ -39,6 +39,9 @@ ]), height() { return this.$store.state.app.height - 50; + }, + width() { + return this.$store.state.app.width; } }, watch: { @@ -77,6 +80,9 @@ } .examList { - float: left; + /*float: left;*/ + position: fixed; + top: 61px; + height: 100%; } From 7abd6ddeea9da31f1cce20b1434e0f4cf9ad1341 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 25 Sep 2019 13:45:20 +0800 Subject: [PATCH 017/179] =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=88=86=E5=8C=96?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/permission.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 5f0a37e85..d7cb1b7a2 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -28,11 +28,18 @@ function hasPermission(roles, route, parentsRoles) { setHonePagePath(route, roles); if (route.meta && route.meta.roles) { // 如果存在本级路由,则使用自己的roles过滤 - if (getSessionStorage('design')&& route.meta.roles.indexOf(userDesign)===-1 ) { - route.hidden = true; + // debugger; + if (getSessionStorage('design')) { + if (route.meta.roles.indexOf(userDesign)===-1) { + route.hidden = true; + } else { + if (!(route.meta.roles.indexOf(admin)>=0 && roles.indexOf(admin)>=0)) { + route.hidden = true; + } + } + } else { - // debugger; - if (!getSessionStorage('design')&&route.meta.roles.indexOf(userDesign)>0) { + if (route.meta.roles.indexOf(userDesign)>0) { route.hidden = true; } } @@ -109,7 +116,6 @@ const permission = { // eslint-disable-next-line prefer-const accessedRouters = filterAsyncRouter(asyncRouter, roles); // } - commit('SET_ROUTERS', accessedRouters); resolve(); }); From 7f77c3d33f161d7c0a8c09c4c17aa2aea9e90ef2 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 25 Sep 2019 14:45:18 +0800 Subject: [PATCH 018/179] =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=88=86=E5=8C=96=20?= =?UTF-8?q?=E6=A0=87=E9=A2=98,=E8=B7=AF=E7=94=B1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Navbar.vue | 4 +-- src/layout/components/Title.vue | 38 ++++++++++++++------ src/router/index.js | 61 +++++++++++++++++++++----------- 3 files changed, 69 insertions(+), 34 deletions(-) diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 65d299a48..bfb179b4e 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -8,7 +8,7 @@ text-color="#fff" active-text-color="#ffd04b" > - + @@ -165,6 +170,16 @@ createTask() { this.$refs.CreateTask.doShow(); }, + turnback() { + this.$router.go(-1) + }, } } + diff --git a/src/views/lesson/trainingRule/list.vue b/src/views/lesson/trainingRule/list.vue index 90092c59d..02b454f49 100644 --- a/src/views/lesson/trainingRule/list.vue +++ b/src/views/lesson/trainingRule/list.vue @@ -4,7 +4,13 @@ +
+ + {{ $t('global.back') }} + +
+ + diff --git a/src/views/lesson/trainingmanage/index.vue b/src/views/lesson/trainingmanage/index.vue index 8af900867..8ebd0ceba 100644 --- a/src/views/lesson/trainingmanage/index.vue +++ b/src/views/lesson/trainingmanage/index.vue @@ -8,6 +8,11 @@ :training-operate-type-map="trainingOperateTypeMap" @refresh="reloadTable" /> +
+ + {{ $t('global.back') }} + +
@@ -142,7 +147,12 @@ export default { name: this.$t('lesson.demonstration'), handleClick: this.demoDisplay, type: '' - } + }, + { + name: '实训录制', + handleClick: this.trainingRecord, + type: '' + } ] } ], @@ -270,7 +280,25 @@ export default { }, reloadTable() { this.queryList.reload(); - } + }, + turnback() { + this.$router.go(-1) + }, + trainingRecord(index, node) { + trainingNotify({ trainingId: node.id }).then(resp => { + this.group = resp.data; + this.$router.push({ path: `${UrlConfig.design.trainingRecord}/${node.id}/${node.name}`, query: { group: resp.data } }); + }).catch(error => { + this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`); + }); + } } }; + From a46f94f85e3c8ec48d892f0be5a7bed0ad99fd7c Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 30 Sep 2019 17:31:40 +0800 Subject: [PATCH 051/179] =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=88=86=E5=8C=96=20?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E7=B3=BB=E7=BB=9F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/quest.js | 9 ++++++--- src/permission.js | 23 +++++++++++++---------- src/store/modules/user.js | 1 - src/utils/auth.js | 28 ++++++++++++++++++++-------- src/utils/login.js | 2 +- 5 files changed, 40 insertions(+), 23 deletions(-) diff --git a/src/api/quest.js b/src/api/quest.js index 7baa7b116..799467a5c 100644 --- a/src/api/quest.js +++ b/src/api/quest.js @@ -10,7 +10,8 @@ export function getQuestPageList(mapId) { /** 创建任务 */ export function createQuest(data) { return request({ - url: `/api/script`, + // url: `/api/script`, + url: `/api/script/draft/create`, method: 'post', data }); @@ -18,7 +19,8 @@ export function createQuest(data) { /** 根据任务id删除任务 */ export function deleteQuest(id) { return request({ - url: `/api/script/${id}`, + // url: `/api/script/${id}`, + url: `/api/script/draft/${id}/delete`, method: 'delete' }); } @@ -39,7 +41,8 @@ export function getQuestByIdList(id) { /** 更新任务基本信息 */ export function updateQuest(id, data) { return request({ - url: `/api/script/${id}`, + // url: `/api/script/${id}`, + url: `/api/script/draft/${id}/update`, method: 'put', data }); diff --git a/src/permission.js b/src/permission.js index cf0a42dc8..8a3547478 100644 --- a/src/permission.js +++ b/src/permission.js @@ -4,7 +4,8 @@ import router from './router'; import NProgress from 'nprogress'; // Progress 进度条 import 'nprogress/nprogress.css';// Progress 进度条样式 import { admin, userDesign} from './router'; -import { getToken, getScreenToken, getPlanToken } from '@/utils/auth'; // 验权 +import { getToken, getScreenToken, getDesignToken} from '@/utils/auth'; // 验权 +// getPlanToken import { LoginParams } from '@/utils/login'; import { getSessionStorage } from '@/utils/auth'; @@ -16,14 +17,15 @@ function hasPermission(roles, permissionRoles) { const isDev = process.env.NODE_ENV === 'development'; -const whiteList = ['/login', '/login1', '/dp/login', '/dp/login1', '/plan/login', '/plan/login1', '/design/login1']; // 不重定向白名单 +// '/plan/login', '/plan/login1', +const whiteList = ['/login', '/login1', '/dp/login', '/dp/login1', '/design/login1']; // 不重定向白名单 const loginPage = isDev ? whiteList[1] : whiteList[0]; const loginScreenPage = isDev ? whiteList[3] : whiteList[2]; -const loginPlanPage = isDev ? whiteList[5] : whiteList[4]; -const loginDesignPage = isDev ? whiteList[6] : whiteList[6]; +// const loginPlanPage = isDev ? whiteList[5] : whiteList[4]; +const loginDesignPage = isDev ? whiteList[4] : whiteList[4]; // 获取路径数据 function getRouteInfo(to) { @@ -36,13 +38,14 @@ function getRouteInfo(to) { loginPath = loginScreenPage; getTokenInfo = getScreenToken; clientId = LoginParams.DaPing.clientId; - } else if (/^\/plan/.test(toRoutePath) || /^\/display\/plan/.test(toRoutePath) || /^\/planEdit/.test(toRoutePath)) { - loginPath = loginPlanPage; - getTokenInfo = getToken; - clientId = LoginParams.LianJiHua.clientId; - } else if (/^\/design/.test(toRoutePath)) { + } + // else if (/^\/plan/.test(toRoutePath) || /^\/display\/plan/.test(toRoutePath) || /^\/planEdit/.test(toRoutePath)) { + // loginPath = loginPlanPage; + // getTokenInfo = getToken; + // clientId = LoginParams.LianJiHua.clientId; + else if (/^\/design/.test(toRoutePath) || /^\/scriptDisplay/.test(toRoutePath) || /^\/plan/.test(toRoutePath) || /^\/publish/.test(toRoutePath) || /^\/orderauthor/.test(toRoutePath) || /^\/orderauthor/.test(system)) { loginPath = loginDesignPage; - getTokenInfo = getToken; + getTokenInfo = getDesignToken; clientId = LoginParams.Design.clientId; } else { loginPath = loginPage; diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 3c06a0447..0d9226688 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -132,7 +132,6 @@ const user = { // 获取用户信息 GetInfo({ commit }, getTokenInfo) { return new Promise((resolve, reject) => { - // debugger; getInfo(getTokenInfo()).then(response => { const user = response.data; if (user.roles && user.roles.length > 0) { // 验证返回的roles是否是一个非空数组 diff --git a/src/utils/auth.js b/src/utils/auth.js index 8b97f45e2..8e18ffa97 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -7,7 +7,7 @@ const TokenScreenKey = 'Screen-Token'; const TokenPlanKey = 'Plan-Token'; -const TokenDesignKey='Admin-Token'; +const TokenDesignKey='Design-Token'; // 设置教学,实训,仿真系统token export function getToken() { @@ -67,9 +67,13 @@ export function handleToken() { const path = window.location.href; if (path.includes('/dp/') || path.includes('/display/dp')) { return getScreenToken(); - } else if (path.includes('/plan') || path.includes('/display/plan')) { - return getPlanToken(); - } else { + } else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/plan') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system')) { + return getDesignToken(); + } + // else if (path.includes('/plan') || path.includes('/display/plan')) { + // return getPlanToken(); + // } + else { return getToken(); } } @@ -79,8 +83,12 @@ export function handleRemoveToken() { const path = window.location.href; if (path.includes('/dp/') || path.includes('/display/dp')) { return removeScreenToken(); - } else if (path.includes('/plan') || path.includes('/display/plan')) { - return removePlanToken(); + } + // else if (path.includes('/plan') || path.includes('/display/plan')) { + // return removePlanToken(); + // } + else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/plan') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system')) { + return removeDesignToken(); } else { return removeToken(); } @@ -92,8 +100,12 @@ export function gainClientId() { let clientId = null; if (path.includes('/dp/') || path.includes('/display/dp')) { clientId = LoginParams.DaPing.clientId; - } else if (path.includes('/plan') || path.includes('/display/plan')) { - clientId = LoginParams.LianJiHua.clientId; + } + // else if (path.includes('/plan') || path.includes('/display/plan')) { + // clientId = LoginParams.LianJiHua.clientId; + // } + else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/plan') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system')) { + clientId = LoginParams.Design.clientId; } return clientId; diff --git a/src/utils/login.js b/src/utils/login.js index 6dad0c93f..7697c4cfa 100644 --- a/src/utils/login.js +++ b/src/utils/login.js @@ -5,5 +5,5 @@ export const LoginParams = { DaPing: { clientId: '2', secret: 'bigscreen' }, // "大屏系统" LianJiHua: { clientId: '3', secret: 'linkplan' }, // "琏计划" Assistant: { clientId: '4', secret: 'linkassistant' }, // "琏课堂助手" - Design: { clientId: '1', secret: 'joylink' } // "城市轨道交通设计平台" + Design: { clientId: '6', secret: 'design' } // "城市轨道交通设计平台" }; From 641345e80119d2bb59934d69dea57bfbde0039ae Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 30 Sep 2019 17:56:16 +0800 Subject: [PATCH 052/179] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/QueryListPage/QueryForm.vue | 10 +++++++--- src/views/error-page/404.vue | 10 +++++++--- src/views/lesson/home.vue | 6 +++++- .../lesson/lessoncategory/edit/sorttree/index.vue | 3 --- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/components/QueryListPage/QueryForm.vue b/src/components/QueryListPage/QueryForm.vue index 5ef16def7..51a24c6ac 100644 --- a/src/components/QueryListPage/QueryForm.vue +++ b/src/components/QueryListPage/QueryForm.vue @@ -128,9 +128,9 @@ - {{ $t('global.query') }} - {{ $t('global.reset') }} - {{ $t('global.export') }} + {{ $t('global.query') }} + {{ $t('global.reset') }} + {{ $t('global.export') }} @@ -480,4 +481,7 @@ export default { max-width: 240px; min-width: 100px; } + .button_style { + margin-bottom: 10px; + } diff --git a/src/views/error-page/404.vue b/src/views/error-page/404.vue index 03e20fcd5..c94ad1250 100644 --- a/src/views/error-page/404.vue +++ b/src/views/error-page/404.vue @@ -15,21 +15,25 @@
{{ message }}
Please check that the URL you entered is correct, or click the button below to return to the homepage.
- Back to home + diff --git a/src/views/lesson/home.vue b/src/views/lesson/home.vue index d3694db6c..83bdc9ead 100644 --- a/src/views/lesson/home.vue +++ b/src/views/lesson/home.vue @@ -85,7 +85,11 @@ showEdit: false }; }, - + watch: { + $route() { + this.refresh(); + } + }, mounted() { this.loading = true; this.loadInitData(); diff --git a/src/views/lesson/lessoncategory/edit/sorttree/index.vue b/src/views/lesson/lessoncategory/edit/sorttree/index.vue index 31ceb1faf..a93f217cf 100644 --- a/src/views/lesson/lessoncategory/edit/sorttree/index.vue +++ b/src/views/lesson/lessoncategory/edit/sorttree/index.vue @@ -72,7 +72,6 @@ export default { initData(data) { getLessonTree({ mapId: '' }).then(response => { this.treeData = this.convertTreeData(response.data, data); - console.log('=======',response,this.treeData); }).catch(() => { this.$messageBox(this.$t('error.refreshFailed')); }); @@ -91,7 +90,6 @@ export default { }, getLeesonId(node) { if (node.parent.data.type === 'lesson'){ - console.log(node, '======',node.parent.data.id); return node.parent.data.id; }else { return this.getLeesonId(node.parent) @@ -100,7 +98,6 @@ export default { handleDragEnd(draggingNode, dropNode, dropType, ev) { if (draggingNode && dropNode && dropType !== 'none') { const lessonId = this.getLeesonId(dropNode); - console.log('======**-*-',lessonId); const model = { location: dropType, sourceId: draggingNode.data.id, From ca413e33316cfbada4262edf9ab492916173320a Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 30 Sep 2019 18:11:31 +0800 Subject: [PATCH 053/179] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E5=9B=BE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/planMonitor/editTool/menuBar.vue | 31 +++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/views/planMonitor/editTool/menuBar.vue b/src/views/planMonitor/editTool/menuBar.vue index 2dc44cb8a..c382e3835 100644 --- a/src/views/planMonitor/editTool/menuBar.vue +++ b/src/views/planMonitor/editTool/menuBar.vue @@ -146,19 +146,19 @@ export default { { title: this.$t('planMonitor.file'), children: [ - { - title: this.$t('planMonitor.openRunningDiagram'), - click: this.handleOpenRunPlan - }, + // { + // title: this.$t('planMonitor.openRunningDiagram'), + // click: this.handleOpenRunPlan + // }, // { // type: 'file', // title: '导入运行图', // click: this.handleImportRunPlan // }, - { - title: this.$t('planMonitor.createRunningDiagram'), - click: this.handleCreateEmptyPlan - }, + // { + // title: this.$t('planMonitor.createRunningDiagram'), + // click: this.handleCreateEmptyPlan + // }, // { // title: '修改运行图名称', // click: this.handleEditPlan @@ -303,7 +303,8 @@ export default { }, methods: { back() { - this.$router.push({ path: `${UrlConfig.plan.detail}/${this.$route.query.mapId}` }); + // this.$router.push({ path: `${UrlConfig.plan.detail}/${this.$route.query.mapId}` }); + this.$router.go(-1); }, menuConvert(menuBase) { const menus = []; @@ -396,9 +397,9 @@ export default { }); }, // 打开运行图列表 - handleOpenRunPlan() { - this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} }); - }, + // handleOpenRunPlan() { + // this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} }); + // }, // handledeleteRunPlan() { // this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'delete'} }); // }, @@ -469,9 +470,9 @@ export default { this.closeMenu(); }, // 新建运行图 - handleCreateEmptyPlan() { - this.$emit('dispatchDialog', { name: 'createEmptyPlan', params: {} }); - }, + // handleCreateEmptyPlan() { + // this.$emit('dispatchDialog', { name: 'createEmptyPlan', params: {} }); + // }, // 修改站间运行时间 handleModifyingStationIntervalTime() { this.$emit('dispatchDialog', { name: 'modifyingStationIntervalTime', params: {} }); From 35faeb8583f31452f1fe14e830bc8106ca7dd7fd Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 30 Sep 2019 18:13:24 +0800 Subject: [PATCH 054/179] =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=88=86=E5=8C=96=20?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=B9=B3=E5=8F=B0=20=E5=89=A7=E6=9C=AC?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/quest.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/quest.js b/src/api/quest.js index 799467a5c..7384988ff 100644 --- a/src/api/quest.js +++ b/src/api/quest.js @@ -3,7 +3,8 @@ import request from '@/utils/request'; /** 查找个人录制的仿真任务*/ export function getQuestPageList(mapId) { return request({ - url: `/api/script/${mapId}/list`, + // url: `/api/script/${mapId}/list`, + url: `/api/script/draft/list/${mapId}`, method: 'get' }); } @@ -27,7 +28,8 @@ export function deleteQuest(id) { /** 根据id查询任务基础信息 */ export function getQuestById(id) { return request({ - url: `/api/script/${id}/basic`, + // url: `/api/script/${id}/basic`, + url: `/api/script/draft/${id}/basic`, method: 'get' }); } From 2c5284b6c4ffce01f1927033156a8d96f6659901 Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Mon, 30 Sep 2019 18:38:42 +0800 Subject: [PATCH 055/179] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BF=A1=E5=8F=B7?= =?UTF-8?q?=E6=9C=BA=E4=BD=8D=E7=BD=AE=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlmap3d/edit/Jlmap3ddata.js | 6 ++--- src/jlmap3d/edit/editmodel/LinkList.js | 4 +-- src/jlmap3d/edit/editmodel/RailList.js | 10 +++---- src/jlmap3d/edit/editmodel/SectionList.js | 4 +++ src/jlmap3d/edit/editmodel/SignalList.js | 32 ++++++++++++++++++++++- src/jlmap3d/edit/jlmap3dedit.js | 2 ++ src/jlmap3d/main/control/ScalControls.js | 2 +- 7 files changed, 48 insertions(+), 12 deletions(-) diff --git a/src/jlmap3d/edit/Jlmap3ddata.js b/src/jlmap3d/edit/Jlmap3ddata.js index 6ee42ad2c..e93eaa0af 100644 --- a/src/jlmap3d/edit/Jlmap3ddata.js +++ b/src/jlmap3d/edit/Jlmap3ddata.js @@ -46,8 +46,8 @@ export function Jlmap3ddata(mapid,scope){ }else{ // console.log(editmapid); // console.log(data.data.id); - // init3d(editmapid,data.data); - initobj(editmapid,data.data.id); + init3d(editmapid,data.data); + // initobj(editmapid,data.data.id); } } @@ -154,7 +154,7 @@ export function Jlmap3ddata(mapid,scope){ }) .then(function(data){ //console.log(data); - return jlmap3ddata.signallist.loadpromise(signaldata,scene,assetloader); + return jlmap3ddata.signallist.loadpromise(signaldata,scene,assetloader,mapdata.signalList); }) .then(function(data){ //console.log(data); diff --git a/src/jlmap3d/edit/editmodel/LinkList.js b/src/jlmap3d/edit/editmodel/LinkList.js index e04436985..094c78b95 100644 --- a/src/jlmap3d/edit/editmodel/LinkList.js +++ b/src/jlmap3d/edit/editmodel/LinkList.js @@ -89,7 +89,7 @@ function linkhelp(data,scene){ testmesh2.lengthfact = data[i].lengthfact; for(let i=0;i link.lengthfact/2){ + posx = link.position.x + signaldata.offset - link.lengthfact/2-10; + }else{ + posx = link.position.x - (link.lengthfact/2 - signaldata.offset)+10; + } + //根据线路方向修改信号灯位置 + if(signaldata.directionType == "01"){ + signaldata.position.set(posx,0,link.position.z-3); + signaldata.rotation.z = ( Math.PI / 2 ); + }else if(signaldata.directionType == "02"){ + signaldata.position.set(posx,0,link.position.z+3); + signaldata.rotation.z = ( - Math.PI / 2 ); + } + } + }; this.init = function(data,realsectionlist,scene,assetloader){ diff --git a/src/jlmap3d/edit/jlmap3dedit.js b/src/jlmap3d/edit/jlmap3dedit.js index f2ee2712f..398870a18 100644 --- a/src/jlmap3d/edit/jlmap3dedit.js +++ b/src/jlmap3d/edit/jlmap3dedit.js @@ -243,6 +243,8 @@ export function JLmap3dEdit(dom, data, mapid) { this.autoss = function(){ console.log("autoss"); + console.log(scope.mapdata); + scope.mapdata.signallist.resetsignal(scope.mapdata.linklist); }; function onWindowResize() { diff --git a/src/jlmap3d/main/control/ScalControls.js b/src/jlmap3d/main/control/ScalControls.js index d6e291b26..a56070eea 100644 --- a/src/jlmap3d/main/control/ScalControls.js +++ b/src/jlmap3d/main/control/ScalControls.js @@ -142,7 +142,7 @@ THREE.ScalControls = function ( scene,_camera, _domElement ) { // _movemesh.geometry.computeBoundingBox(); _movemesh.geometry.computeBoundingSphere(); _movemesh.geometry.center(); - _movemesh.lengthfact = (_movemesh.geometry.attributes.position.array[_movemesh.rightlist[0]] - _movemesh.geometry.attributes.position.array[_movemesh.leftlist[0]])*2+20.5; + _movemesh.lengthfact = (_movemesh.geometry.attributes.position.array[_movemesh.rightlist[0]] - _movemesh.geometry.attributes.position.array[_movemesh.leftlist[0]])*2+28.5; // testmesh2.position.z = 50; // testmesh2.geometry.center(); From 873fbcd686d1354bb23046bc2f2a88316da58c5a Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 8 Oct 2019 09:51:13 +0800 Subject: [PATCH 056/179] =?UTF-8?q?=E8=B6=85=E6=97=B6=E7=99=BB=E5=87=BA?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/designPlatform.js | 34 ++++++++++++++++++------------ src/permission.js | 2 +- src/store/modules/user.js | 44 ++++++++++++++++++++++++--------------- 3 files changed, 49 insertions(+), 31 deletions(-) diff --git a/src/api/designPlatform.js b/src/api/designPlatform.js index b6887da04..a81753421 100644 --- a/src/api/designPlatform.js +++ b/src/api/designPlatform.js @@ -10,23 +10,31 @@ export function getDraftLesson(params, mapId) { } /** 获取用户地图树 */ export function getUserMapTree(cityCode) { - return request({ - url: `/api/mapSystem/findDraftMapByCityCode?cityCode=${cityCode}`, - method: 'get' - }); + return request({ + url: `/api/mapSystem/findDraftMapByCityCode?cityCode=${cityCode}`, + method: 'get' + }); } /** 运行图*/ export function getRpListByUserMapId(mapId) { - return request({ - url: `/api/runPlan/draft/user/${mapId}/list`, - method: 'get' - }); + return request({ + url: `/api/runPlan/draft/user/${mapId}/list`, + method: 'get' + }); } export function getMapList(cityCode) { - /** 根据cityCode获取地图列表 */ - return request({ - url: `/api/mapSystem/queryMapByCityCode/${cityCode}`, - method: 'get', - }); + /** 根据cityCode获取地图列表 */ + return request({ + url: `/api/mapSystem/queryMapByCityCode/${cityCode}`, + method: 'get' + }); +} + +/** 获取用户自己的运行图详情*/ +export function getRpDetailByUserMapId(planId) { + return request({ + url: `/api/runPlan/draft/user/${planId}`, + method: 'get' + }); } diff --git a/src/permission.js b/src/permission.js index 8a3547478..ef1e15806 100644 --- a/src/permission.js +++ b/src/permission.js @@ -43,7 +43,7 @@ function getRouteInfo(to) { // loginPath = loginPlanPage; // getTokenInfo = getToken; // clientId = LoginParams.LianJiHua.clientId; - else if (/^\/design/.test(toRoutePath) || /^\/scriptDisplay/.test(toRoutePath) || /^\/plan/.test(toRoutePath) || /^\/publish/.test(toRoutePath) || /^\/orderauthor/.test(toRoutePath) || /^\/orderauthor/.test(system)) { + else if (/^\/design/.test(toRoutePath) || /^\/scriptDisplay/.test(toRoutePath) || /^\/plan/.test(toRoutePath) || /^\/publish/.test(toRoutePath) || /^\/orderauthor/.test(toRoutePath) || /^\/system/.test(toRoutePath)) { loginPath = loginDesignPage; getTokenInfo = getDesignToken; clientId = LoginParams.Design.clientId; diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 0d9226688..87bf0c111 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,6 +1,6 @@ import { setSessionStorage, removeSessionStorage } from '@/utils/auth'; import { login, logout, getInfo } from '@/api/login'; -import { getToken, setToken, removeToken, removeScreenToken, setScreenToken, getScreenToken, setPlanToken, setDesignToken, getPlanToken, removePlanToken, handleToken, handleRemoveToken } from '@/utils/auth'; +import { getToken, setToken, removeToken, removeScreenToken, setScreenToken, getScreenToken, setPlanToken, getDesignToken, setDesignToken, getPlanToken, removeDesignToken, removePlanToken, handleToken, handleRemoveToken } from '@/utils/auth'; import { getUserConfigInfo } from '@/api/management/user'; import { LoginParams } from '@/utils/login'; import { creatSubscribe, perpetualTopic } from '@/utils/stomp'; @@ -28,6 +28,9 @@ const user = { SET_TOKENSCREEN: (state, token) => { state.tokenScreen = token; }, + SET_TOKENDESIGN: (state, token) => { + state.tokenScreen = token; + }, SET_TOKENPLAN: (state, token) => { state.tokenPlan = token; }, @@ -73,20 +76,22 @@ const user = { const header = { group: '', 'X-Token': getScreenToken() }; creatSubscribe(perpetualTopic, header); }; - } else if (userInfo.type == 'plan') { - params = Object.assign({ account: username, password }, LoginParams.LianJiHua); - execFc = (token) => { - setPlanToken(token); - commit('SET_TOKENPLAN', token); - const header = { group: '', 'X-Token': getPlanToken() }; - creatSubscribe(perpetualTopic, header); - }; - } else if (userInfo.type == 'design') { + } + // else if (userInfo.type == 'plan') { + // params = Object.assign({ account: username, password }, LoginParams.LianJiHua); + // execFc = (token) => { + // setPlanToken(token); + // commit('SET_TOKENPLAN', token); + // const header = { group: '', 'X-Token': getPlanToken() }; + // creatSubscribe(perpetualTopic, header); + // }; + // } + else if (userInfo.type == 'design') { params = Object.assign({ account: username, password }, LoginParams.Design); execFc = (token) => { setDesignToken(token); - commit('SET_TOKENPLAN', token); - const header = { group: '', 'X-Token': getPlanToken() }; + commit('SET_TOKENDESIGN', token); + const header = { group: '', 'X-Token': getDesignToken() }; creatSubscribe(perpetualTopic, header); }; } else { @@ -167,12 +172,17 @@ const user = { FedLogOut({ commit }, clientId) { return new Promise(resolve => { if (clientId == LoginParams.DaPing.clientId) { - commit('SET_TOKENSCREEN', ''); + commit('SET_TOKENDESIGN', ''); removeScreenToken(); - } else if (clientId == LoginParams.LianJiHua.clientId) { - commit('SET_TOKENPLAN', ''); - removePlanToken(); - } else { + } else if (clientId == LoginParams.Design.clientId) { + commit('SET_TOKENSCREEN', ''); + removeDesignToken(); + } + // else if (clientId == LoginParams.LianJiHua.clientId) { + // commit('SET_TOKENPLAN', ''); + // removePlanToken(); + // } + else { commit('SET_TOKEN', ''); removeToken(); } From db971bf591bf95a05d9a19a3defccd0f842871ea Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 8 Oct 2019 14:12:53 +0800 Subject: [PATCH 057/179] =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=88=86=E5=8C=96?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E5=9B=BE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/designPlatform.js | 4 +- src/router/index.js | 10 + src/views/planMonitor/detail.vue | 7 +- src/views/planMonitor/editTool/index.vue | 12 +- src/views/planMonitor/editTool/menuBar.vue | 17 +- src/views/planMonitor/editTool/statusBar.vue | 25 +- src/views/planMonitor/editTool/userindex.vue | 485 +++++++++++++++++++ 7 files changed, 539 insertions(+), 21 deletions(-) create mode 100644 src/views/planMonitor/editTool/userindex.vue diff --git a/src/api/designPlatform.js b/src/api/designPlatform.js index a81753421..eec081d7d 100644 --- a/src/api/designPlatform.js +++ b/src/api/designPlatform.js @@ -19,7 +19,7 @@ export function getUserMapTree(cityCode) { /** 运行图*/ export function getRpListByUserMapId(mapId) { return request({ - url: `/api/runPlan/draft/user/${mapId}/list`, + url: `/api/draftMap/runPlan/findByDraftMapId/${mapId}`, method: 'get' }); } @@ -34,7 +34,7 @@ export function getMapList(cityCode) { /** 获取用户自己的运行图详情*/ export function getRpDetailByUserMapId(planId) { return request({ - url: `/api/runPlan/draft/user/${planId}`, + url: `/api/draftMap/runPlan/selectDiagramData/${planId}`, method: 'get' }); } diff --git a/src/router/index.js b/src/router/index.js index c6af8b380..f9fdb8ec9 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -58,6 +58,8 @@ import ScreenMonitorHome from '@/views/screenMonitor/home'; import ScreenMonitorDetail from '@/views/screenMonitor/detail/index'; import PlanMonitorEditTool from '@/views/planMonitor/editTool/index'; +import PlanMonitorEditUserTool from '@/views/planMonitor/editTool/userindex'; + import PlanMonitor from '@/views/planMonitor/index'; import PlanMonitorHome from '@/views/planMonitor/home'; import PlanMonitorDetail from '@/views/planMonitor/detail'; @@ -171,6 +173,7 @@ export const UrlConfig = { plan: { prefix: '/plan', tool: '/plan/tool', + usertool: '/plan/usertool', detail: '/plan/detail', pay: '/plan/pay' }, @@ -802,6 +805,13 @@ export const asyncRouter = [ } ] }, + { + path: '/plan/usertool', + component: PlanMonitorEditUserTool, + meta: { + }, + hidden: true + }, { path: '/plan/tool', component: PlanMonitorEditTool, diff --git a/src/views/planMonitor/detail.vue b/src/views/planMonitor/detail.vue index 840c62b11..d25dc386c 100644 --- a/src/views/planMonitor/detail.vue +++ b/src/views/planMonitor/detail.vue @@ -255,7 +255,12 @@ export default { this.$store.dispatch('runPlan/refresh'); } else { const query = { skinCode: skinCode, mapId: this.$route.params.mapId, planId: planId, planName: planName }; - this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query }); + if(/^\/design\/userlist/.test(this.$route.fullPath)){ + this.$router.push({ path: `${UrlConfig.plan.usertool}`, query: query }); + } + else{ + this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query }); + } } }, // 删除运行图 diff --git a/src/views/planMonitor/editTool/index.vue b/src/views/planMonitor/editTool/index.vue index 0447c388f..f6f9b1a88 100644 --- a/src/views/planMonitor/editTool/index.vue +++ b/src/views/planMonitor/editTool/index.vue @@ -10,8 +10,8 @@ /> - - + + @@ -42,8 +42,8 @@ import MenuBar from './menuBar'; import StatusBar from './statusBar'; import Schedule from './schedule'; -import OpenRunPlan from './menus/openRunPlan'; -import CreateEmptyPlan from './menus/createEmptyPlan'; +// import OpenRunPlan from './menus/openRunPlan'; +// import CreateEmptyPlan from './menus/createEmptyPlan'; import Parameter from './menus/parameter/index'; import OffLine from './menus/offLine'; import AddPlanningTrain from './menus/addPlanningTrain'; @@ -67,8 +67,8 @@ export default { MenuBar, StatusBar, Schedule, - OpenRunPlan, - CreateEmptyPlan, + // OpenRunPlan, + // CreateEmptyPlan, Parameter, OffLine, AddPlanningTrain, diff --git a/src/views/planMonitor/editTool/menuBar.vue b/src/views/planMonitor/editTool/menuBar.vue index c382e3835..31446780d 100644 --- a/src/views/planMonitor/editTool/menuBar.vue +++ b/src/views/planMonitor/editTool/menuBar.vue @@ -1,14 +1,14 @@