From cf5f902a45c8833cace91ee439e44654efa47af3 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 23 Oct 2019 10:18:28 +0800 Subject: [PATCH 01/22] =?UTF-8?q?=E4=BB=A3=E7=A0=81=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 | 12 +-- src/utils/baseUrl.js | 4 +- src/views/login/index.vue | 94 ++++++++++---------- src/views/login/loginEn.vue | 105 +++++++++-------------- src/views/trainingPlatform/demonList.vue | 4 - src/views/trainingPlatform/home.vue | 97 --------------------- src/views/trainingPlatform/index.vue | 7 ++ 7 files changed, 99 insertions(+), 224 deletions(-) delete mode 100644 src/views/trainingPlatform/home.vue diff --git a/src/router/index.js b/src/router/index.js index 74914726c..f21e4c001 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -88,7 +88,6 @@ import PublishLesson from '@/views/publish/publishLesson/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'; @@ -250,7 +249,6 @@ export const UrlConfig = { }, trainingPlatform: { trainingPlatform: '/trainingPlatform', - trainingPlatformHome: '/trainingPlatform/home', prodDetail: '/trainingPlatform/detail', teachDetail: '/trainingPlatform/teach', teachHome: '/trainingPlatform/teachHome', @@ -608,19 +606,11 @@ export const asyncRouter = [ children: [ { path: '', - redirect: '/trainingPlatform/home', + redirect: '/trainingPlatform/permission/14', component: TrainingPlatform, meta: { }, children: [ - { - path: 'home', - redirect: '/trainingPlatform/permission/14', - component: TrainingPlatformHome, - meta: { - }, - hidden: true - }, { path: 'detail/:subSystem', component: DemonstrationDetail, diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index f997f31f4..871e8ec9c 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,8 +3,8 @@ 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 = 'http://192.168.3.5:9000'; // 袁琪 + 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'; // 王兴杰 } else { diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 44516de61..bb6cfd162 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -49,14 +49,14 @@ @keyup.enter="handleLogin" /> - - + +
{{ tipsMsg }}
- 自动登录 + 自动登录
{ - this.$store.dispatch('SetAccount', model.username); - this.handleLoginSucessRoute(); - }).catch(error => { - this.tipsMsg = error.message; - this.loading = false; - setTimeout(() => { this.tipsMsg = ''; }, 5000); - }); - } - }, + }, + beforeCreate() { + if (Cookies.get('UserName')&&Cookies.get('UserToken')) { + const model = {'username': Cookies.get('UserName'), 'password': Cookies.get('UserToken')}; + model.type = 'class'; + model.project = this.$route.params.project; + removeSessionStorage('againEnter'); + this.$store.dispatch('Login', model).then(() => { + this.$store.dispatch('SetAccount', model.username); + this.handleLoginSucessRoute(); + }).catch(error => { + this.tipsMsg = error.message; + this.loading = false; + setTimeout(() => { this.tipsMsg = ''; }, 5000); + }); + } + }, methods: { clearTimer(timer) { if (timer) { @@ -225,7 +225,7 @@ export default { self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token }).then(() => { // 清除定时器,设置路由 self.clearTimer(self.checkLogin); - this.handleLoginSucessRoute(); + this.handleLoginSucessRoute(); }); }).catch(error => { if (error.data && error.data.status == '1') { @@ -236,12 +236,12 @@ export default { }, 3000); }, showPwd() { - if (this.pwdType === 'password') { - this.pwdDisplay=false; + if (this.pwdType === 'password') { + this.pwdDisplay=false; this.pwdType = ''; } else { - this.pwdType = 'password'; - this.pwdDisplay=true; + this.pwdType = 'password'; + this.pwdDisplay=true; } }, handleLogin() { @@ -251,15 +251,15 @@ export default { model.password = md5(model.password); model.type = 'class'; model.project = this.$route.params.project; - this.loading = true; - if(this.isAutoLogin){ - Cookies.set('UserName', model.username, { expires: 2}); - Cookies.set('UserToken', model.password, { expires: 2}); - } + this.loading = true; + if (this.isAutoLogin) { + Cookies.set('UserName', model.username, { expires: 2}); + Cookies.set('UserToken', model.password, { expires: 2}); + } removeSessionStorage('againEnter'); this.$store.dispatch('Login', model).then(() => { - this.$store.dispatch('SetAccount', model.username); - this.handleLoginSucessRoute(); + this.$store.dispatch('SetAccount', model.username); + this.handleLoginSucessRoute(); }).catch(error => { this.tipsMsg = error.message; this.loading = false; @@ -271,17 +271,17 @@ export default { } }); }, - handleLoginSucessRoute() { - // 设置路由 - this.loading = false; - this.tipsMsg = ''; - const path = UrlConfig.trainingPlatform.trainingPlatformHome; - this.$nextTick(() => { - this.$i18n.locale = 'zh'; - Cookies.set('user_lang', 'zh'); - }); - this.$router.push({ path: path }); - } + handleLoginSucessRoute() { + // 设置路由 + this.loading = false; + this.tipsMsg = ''; + const path = '/trainingPlatform'; + this.$nextTick(() => { + this.$i18n.locale = 'zh'; + Cookies.set('user_lang', 'zh'); + }); + this.$router.push({ path: path }); + } } }; diff --git a/src/views/login/loginEn.vue b/src/views/login/loginEn.vue index 7f464799a..72d66a4a8 100644 --- a/src/views/login/loginEn.vue +++ b/src/views/login/loginEn.vue @@ -56,7 +56,7 @@
{{ tipsMsg }}
- Auto Login + Auto Login
{ - this.$store.dispatch('SetAccount', model.username); - this.handleLoginSucessRoute(); - // // 设置路由 - // this.loading = false; - // this.tipsMsg = ''; - // // let path = localStore.get('trainingPlatformRoute'+model.username); - // // if (!path || !path.startsWith('/trainingPlatform')) { - // path = UrlConfig.trainingPlatform.trainingPlatformHome; - // // } - // this.$nextTick(() => { - // this.$i18n.locale = 'en'; - // Cookies.set('user_lang', 'en'); - // }); - // this.$router.push({ path: path }); - }).catch(error => { - this.tipsMsg = error.message; - this.loading = false; - setTimeout(() => { this.tipsMsg = ''; }, 5000); - }); - } - }, + }, + beforeCreate() { + if (Cookies.get('UserName')&&Cookies.get('UserToken')) { + const model = {'username': Cookies.get('UserName'), 'password': Cookies.get('UserToken')}; + model.type = 'class'; + model.project = this.$route.params.project; + removeSessionStorage('againEnter'); + this.$store.dispatch('Login', model).then(() => { + this.$store.dispatch('SetAccount', model.username); + this.handleLoginSucessRoute(); + }).catch(error => { + this.tipsMsg = error.message; + this.loading = false; + setTimeout(() => { this.tipsMsg = ''; }, 5000); + }); + } + }, mounted() { document.title = loginTitle[this.$route.params.project||'default']; this.loginRefresh(); @@ -234,17 +222,8 @@ export default { // 设置扫码登录 self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token }).then(() => { // 清除定时器,设置路由 - self.clearTimer(self.checkLogin); - this.handleLoginSucessRoute(); - // let path = '/en/login'; - // if (this.project) { - // path = path + '/' + this.project; - // } - // self.$router.push({ path: path }); - // self.$nextTick(() => { - // self.$i18n.locale = 'en'; - // Cookies.set('user_lang', 'en'); - // }); + self.clearTimer(self.checkLogin); + this.handleLoginSucessRoute(); }); }).catch(error => { if (error.data && error.data.status == '1') { @@ -269,15 +248,15 @@ export default { model.type = 'class'; model.project = this.$route.params.project; this.loading = true; - if(this.isAutoLogin){ - Cookies.set('UserName', model.username, { expires: 2}); - Cookies.set('UserToken', model.password, { expires: 2}); - } - removeSessionStorage('againEnter'); + if (this.isAutoLogin) { + Cookies.set('UserName', model.username, { expires: 2}); + Cookies.set('UserToken', model.password, { expires: 2}); + } + removeSessionStorage('againEnter'); - this.$store.dispatch('Login', model).then(() => { - this.$store.dispatch('SetAccount', model.username); - this.handleLoginSucessRoute(); + this.$store.dispatch('Login', model).then(() => { + this.$store.dispatch('SetAccount', model.username); + this.handleLoginSucessRoute(); }).catch(error => { this.tipsMsg = error.message; this.loading = false; @@ -288,18 +267,18 @@ export default { return false; } }); - }, - handleLoginSucessRoute() { - // 设置路由 - this.loading = false; - this.tipsMsg = ''; - const path = UrlConfig.trainingPlatform.trainingPlatformHome; - this.$nextTick(() => { - this.$i18n.locale = 'en'; - Cookies.set('user_lang', 'en'); - }); - this.$router.push({ path: path }); - } + }, + handleLoginSucessRoute() { + // 设置路由 + this.loading = false; + this.tipsMsg = ''; + const path = '/trainingPlatform'; + this.$nextTick(() => { + this.$i18n.locale = 'en'; + Cookies.set('user_lang', 'en'); + }); + this.$router.push({ path: path }); + } } }; diff --git a/src/views/trainingPlatform/demonList.vue b/src/views/trainingPlatform/demonList.vue index 85e42dba3..f81ce34cf 100644 --- a/src/views/trainingPlatform/demonList.vue +++ b/src/views/trainingPlatform/demonList.vue @@ -90,10 +90,6 @@ export default { beforeDestroy () { }, mounted() { - const path = localStore.get('trainingPlatformRoute'+ this.userId); - if (path && path.startsWith('/trainingPlatform')) { - this.$router.push(path); - } }, methods: { filterNode(value, data) { diff --git a/src/views/trainingPlatform/home.vue b/src/views/trainingPlatform/home.vue deleted file mode 100644 index 8f98c83e8..000000000 --- a/src/views/trainingPlatform/home.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - - diff --git a/src/views/trainingPlatform/index.vue b/src/views/trainingPlatform/index.vue index a141eb171..17c46225c 100644 --- a/src/views/trainingPlatform/index.vue +++ b/src/views/trainingPlatform/index.vue @@ -42,6 +42,9 @@ export default { }, width() { return this.$store.state.app.width; + }, + userId() { + return this.$store.state.user.id; } }, watch: { @@ -53,6 +56,10 @@ export default { const againEnter = getSessionStorage('againEnter') || null; if (!againEnter) { launchFullscreen(); + const path = localStore.get('trainingPlatformRoute'+ this.userId); + if (path && path.startsWith('/trainingPlatform')) { + this.$router.push(path); + } setSessionStorage('againEnter', true); } From f8b149fa5a7b29b1fdc9fbc1e3e595896db72172 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 23 Oct 2019 10:43:29 +0800 Subject: [PATCH 02/22] =?UTF-8?q?=E5=90=8C=E4=B8=80=E4=B8=AA=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=88=87=E6=8D=A2=E5=B9=B3=E5=8F=B0404=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 11 --- src/store/modules/user.js | 36 +------- src/utils/auth.js | 25 ------ src/views/login/index.vue | 5 +- src/views/login/loginDesign.vue | 135 +++++++++++++++--------------- src/views/login/loginEn.vue | 5 +- src/views/login/loginEnDesign.vue | 97 ++++++++++----------- 7 files changed, 129 insertions(+), 185 deletions(-) diff --git a/src/permission.js b/src/permission.js index e64a16dc5..d2bc25038 100644 --- a/src/permission.js +++ b/src/permission.js @@ -15,17 +15,6 @@ function hasPermission(roles, permissionRoles) { return roles.some(role => permissionRoles.indexOf(role) >= 0); } -const project = getSessionStorage('project'); - -// const whiteList = ['/login', '/login1', '/dp/login', '/dp/login1', '/design/login1']; // 不重定向白名单 -// -// const loginPage = whiteList[0] + (('/'+project) || ''); -// -// const loginScreenPage = isDev ? whiteList[3] : whiteList[2]; -// -// const loginPlanPage = isDev ? whiteList[5] : whiteList[4]; -// const loginDesignPage = isDev ? whiteList[4] : whiteList[4]; - const whiteList = ['/login', '/dp/login', '/en/login', '/design/login', '/en/design/login', '/login/xty']; // 不重定向白名单 const loginPage = whiteList[0]; diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 9121840eb..14b7f9fe4 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, getDesignToken, setDesignToken, getPlanToken, removeDesignToken, removePlanToken, handleToken, handleRemoveToken } from '@/utils/auth'; +import { getToken, setToken, removeToken, getDesignToken, setDesignToken, removeDesignToken, handleToken, handleRemoveToken } from '@/utils/auth'; import { getUserConfigInfo } from '@/api/management/user'; import { LoginParams } from '@/utils/login'; import { creatSubscribe, perpetualTopic } from '@/utils/stomp'; @@ -9,8 +9,6 @@ import Cookies from 'js-cookie'; const user = { state: { token: getToken(), - tokenScreen: getScreenToken(), - tokenPlan: getPlanToken(), tokenDesign: getDesignToken(), name: '', nickname: '', @@ -70,25 +68,7 @@ const user = { return new Promise((resolve, reject) => { let params = null; let execFc = null; - if (userInfo.type == 'dp') { - params = Object.assign({ account: username, password }, LoginParams.DaPing); - execFc = (token) => { - setScreenToken(token); - commit('SET_TOKENSCREEN', token); - 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') { + if (userInfo.type == 'design') { params = Object.assign({ account: username, password }, LoginParams.Design); execFc = (token) => { setDesignToken(token); @@ -175,18 +155,10 @@ const user = { // 前端登出 FedLogOut({ commit }, clientId) { return new Promise(resolve => { - if (clientId == LoginParams.DaPing.clientId) { - commit('SET_TOKENSCREEN', ''); - removeScreenToken(); - } else if (clientId == LoginParams.Design.clientId) { + if (clientId == LoginParams.Design.clientId) { commit('SET_TOKENDESIGN', ''); removeDesignToken(); - } - // else if (clientId == LoginParams.LianJiHua.clientId) { - // commit('SET_TOKENPLAN', ''); - // removePlanToken(); - // } - else { + } else { commit('SET_TOKEN', ''); removeToken(); } diff --git a/src/utils/auth.js b/src/utils/auth.js index f05e40be3..ed723e771 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -2,11 +2,6 @@ import SessionStorage from 'sessionstorage'; import { LoginParams } from '@/utils/login'; const TokenKey = 'Admin-Token'; - -const TokenScreenKey = 'Screen-Token'; - -const TokenPlanKey = 'Plan-Token'; - const TokenDesignKey='Design-Token'; // 设置教学,实训,仿真系统token @@ -19,16 +14,6 @@ export function setToken(token) { export function removeToken() { return SessionStorage.removeItem(TokenKey); } -// 设置大屏token -export function getScreenToken() { - return SessionStorage.getItem(TokenScreenKey); -} -export function setScreenToken(token) { - return SessionStorage.setItem(TokenScreenKey, token); -} -export function removeScreenToken() { - return SessionStorage.removeItem(TokenScreenKey); -} // 设置城市轨道交通设计平台token export function getDesignToken() { @@ -41,16 +26,6 @@ export function removeDesignToken() { return SessionStorage.removeItem(TokenDesignKey); } -// 设置琏计划token -export function getPlanToken() { - return SessionStorage.getItem(TokenPlanKey); -} -export function setPlanToken(token) { - return SessionStorage.setItem(TokenPlanKey, token); -} -export function removePlanToken() { - return SessionStorage.removeItem(TokenPlanKey); -} // 操作sessionStorage export function getSessionStorage(key) { return SessionStorage.getItem(key); diff --git a/src/views/login/index.vue b/src/views/login/index.vue index bb6cfd162..e8e8b0d56 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -100,8 +100,6 @@ // import md5 from 'js-md5'; import QCode from '@/assets/erCode.jpg'; import { removeSessionStorage } from '@/utils/auth'; -import { UrlConfig } from '@/router/index'; -import localStore from 'storejs'; import Cookies from 'js-cookie'; import md5 from 'js-md5'; import QrcodeVue from 'qrcode.vue'; @@ -110,6 +108,7 @@ import { LoginParams } from '@/utils/login'; import bgImg from '@/assets/bg1.jpg'; import { setToken } from '@/utils/auth'; import { loginTitle } from '@/scripts/ConstDic'; +import { removeToken, removeDesignToken} from '@/utils/auth'; export default { name: 'Login', @@ -167,6 +166,8 @@ export default { this.loginRefresh(); }, beforeCreate() { + removeToken(); + removeDesignToken(); if (Cookies.get('UserName')&&Cookies.get('UserToken')) { const model = {'username': Cookies.get('UserName'), 'password': Cookies.get('UserToken')}; model.type = 'class'; diff --git a/src/views/login/loginDesign.vue b/src/views/login/loginDesign.vue index 7f7a82cf7..edfa8fdd6 100644 --- a/src/views/login/loginDesign.vue +++ b/src/views/login/loginDesign.vue @@ -48,14 +48,14 @@ @keyup.enter="handleLogin" /> - - + +
{{ tipsMsg }}
- 自动登录 + 自动登录
{ - removeSessionStorage('design'); - setSessionStorage('design', true); - this.handleLoginSucessRoute(); - }).catch(error => { - this.tipsMsg = error.message; - this.loading = false; - setTimeout(() => { this.tipsMsg = ''; }, 5000); - }); - } - }, + }, + beforeCreate() { + removeToken(); + removeDesignToken(); + if (Cookies.get('UserDesignName')&&Cookies.get('UserDesignToken')) { + const model = {'username': Cookies.get('UserDesignName'), 'password': Cookies.get('UserDesignToken')}; + model.type = 'design'; + this.$store.dispatch('Login', model).then(() => { + removeSessionStorage('design'); + setSessionStorage('design', true); + this.handleLoginSucessRoute(); + }).catch(error => { + this.tipsMsg = error.message; + this.loading = false; + setTimeout(() => { this.tipsMsg = ''; }, 5000); + }); + } + }, mounted() { - document.title = '城市轨道交通设计平台'; + document.title = '城市轨道交通设计平台'; this.loginRefresh(); }, methods: { @@ -162,10 +165,10 @@ export default { clearTimeout(timer); timer = null; } - }, - judgeAutoLogin(){ - - }, + }, + judgeAutoLogin() { + + }, loginRefresh() { this.loadingCode = true; getLoginWmurl(LoginParams.Design).then(response => { @@ -194,18 +197,18 @@ export default { // 清空已存在的定时器 // 设置定时器检测 - this.clearTimer(this.checkLogin); + this.clearTimer(this.checkLogin); this.checkLogin = setTimeout(() => { checkLoginStatus(self.sessionId).then(response => { setDesignToken(response.data.token); - // 设置扫码登录 - self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => { - // 清除定时器,设置路由 - self.clearTimer(self.checkLogin); - removeSessionStorage('design'); + // 设置扫码登录 + self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => { + // 清除定时器,设置路由 + self.clearTimer(self.checkLogin); + removeSessionStorage('design'); setSessionStorage('design', true); - this.handleLoginSucessRoute(); - }); + this.handleLoginSucessRoute(); + }); }).catch(error => { if (error.data && error.data.status == '1') { self.scanSuccess = true; @@ -216,31 +219,31 @@ export default { }, showPwd() { if (this.pwdType === 'password') { - this.pwdDisplay=false; + this.pwdDisplay=false; this.pwdType = ''; } else { - this.pwdType = 'password'; - this.pwdDisplay=true; + this.pwdType = 'password'; + this.pwdDisplay=true; } }, handleLogin() { this.$refs.loginForm.validate(valid => { if (valid) { - const model = Object.assign({}, this.loginForm); - model.password = md5(model.password); - - if(this.isAutoLogin){ - Cookies.set('UserDesignName', model.username, { expires: 2}); - Cookies.set('UserDesignToken', model.password, { expires: 2}); - } + const model = Object.assign({}, this.loginForm); + model.password = md5(model.password); + + if (this.isAutoLogin) { + Cookies.set('UserDesignName', model.username, { expires: 2}); + Cookies.set('UserDesignToken', model.password, { expires: 2}); + } // model.type = 'plan'; - model.type = 'design'; - + model.type = 'design'; + this.loading = true; - - this.$store.dispatch('Login', model).then(() => { - this.$store.dispatch('SetAccount', model.username); - this.handleLoginSucessRoute(); + + this.$store.dispatch('Login', model).then(() => { + this.$store.dispatch('SetAccount', model.username); + this.handleLoginSucessRoute(); }).catch(error => { this.tipsMsg = error.message; this.loading = false; @@ -252,18 +255,18 @@ export default { return false; } }); - }, - handleLoginSucessRoute() { - // 设置路由 - this.loading = false; - this.tipsMsg = ''; - const path = UrlConfig.design.prefix; - this.$nextTick(() => { - this.$i18n.locale = 'zh'; - Cookies.set('user_lang', 'zh'); - }); - this.$router.push({ path: path }); - } + }, + handleLoginSucessRoute() { + // 设置路由 + this.loading = false; + this.tipsMsg = ''; + const path = UrlConfig.design.prefix; + this.$nextTick(() => { + this.$i18n.locale = 'zh'; + Cookies.set('user_lang', 'zh'); + }); + this.$router.push({ path: path }); + } } }; diff --git a/src/views/login/loginEn.vue b/src/views/login/loginEn.vue index 72d66a4a8..d76df9c91 100644 --- a/src/views/login/loginEn.vue +++ b/src/views/login/loginEn.vue @@ -99,8 +99,6 @@ From f5dc8818feffbb28d703d49ae29715c4378d0d5a Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 23 Oct 2019 11:02:44 +0800 Subject: [PATCH 03/22] =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=94=AE=E7=9B=98=E5=9B=9E=E8=BD=A6=E7=99=BB?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Entry.vue | 17 ++++++++++++++--- src/views/login/index.vue | 15 +-------------- src/views/login/loginDesign.vue | 2 +- src/views/login/loginEn.vue | 15 +-------------- src/views/login/loginEnDesign.vue | 15 +-------------- 5 files changed, 18 insertions(+), 46 deletions(-) diff --git a/src/layout/components/Entry.vue b/src/layout/components/Entry.vue index af388eea5..7f6ffa29d 100644 --- a/src/layout/components/Entry.vue +++ b/src/layout/components/Entry.vue @@ -22,14 +22,19 @@ export default { return { entryList: [ { - name: 'global.quickEntry', - handle: this.quickEntry + // global.designPlatform + name: '城市轨道交通设计平台', + handle: this.goToDesign }, { name: 'global.scan', handle: this.qcodeEntry, hidden: process.env.NODE_ENV != 'development' - } + }, + { + name: 'global.quickEntry', + handle: this.quickEntry + }, ], stomp: null, header: null @@ -50,6 +55,12 @@ export default { }, qcodeEntry() { this.$refs.qcode.doShow(); + }, + goToDesign(){ + let routeData = this.$router.resolve({ + path: "/design", + }); + window.open(routeData.href, '_blank'); } } }; diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 44516de61..937b91ffd 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -46,7 +46,7 @@ name="password" :type="pwdType" placeholder="密码" - @keyup.enter="handleLogin" + @keyup.enter.native="handleLogin" /> @@ -72,19 +72,6 @@
无法登录?
- 登录 diff --git a/src/views/login/loginDesign.vue b/src/views/login/loginDesign.vue index 7f7a82cf7..8ca6e06be 100644 --- a/src/views/login/loginDesign.vue +++ b/src/views/login/loginDesign.vue @@ -45,7 +45,7 @@ name="password" :type="pwdType" placeholder="密码" - @keyup.enter="handleLogin" + @keyup.enter.native="handleLogin" /> diff --git a/src/views/login/loginEn.vue b/src/views/login/loginEn.vue index 7f464799a..e2840f6cd 100644 --- a/src/views/login/loginEn.vue +++ b/src/views/login/loginEn.vue @@ -47,7 +47,7 @@ name="password" :type="pwdType" placeholder="password" - @keyup.enter="handleLogin" + @keyup.enter.native="handleLogin" /> @@ -72,19 +72,6 @@
unable to login?
- login diff --git a/src/views/login/loginEnDesign.vue b/src/views/login/loginEnDesign.vue index 1955b507c..d87d5df84 100644 --- a/src/views/login/loginEnDesign.vue +++ b/src/views/login/loginEnDesign.vue @@ -45,7 +45,7 @@ name="password" :type="pwdType" placeholder="password" - @keyup.enter="handleLogin" + @keyup.enter.native="handleLogin" /> @@ -70,19 +70,6 @@
unable to login?
- login From 1c38f16199bb44ee4c33a5112f95a3bcc2b1ac60 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 23 Oct 2019 13:32:00 +0800 Subject: [PATCH 04/22] =?UTF-8?q?=E5=9B=9E=E8=BD=A6=E7=99=BB=E5=BD=95?= =?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/views/login/index.vue | 30 ++++++++++++++++++++++++------ src/views/login/loginDesign.vue | 28 +++++++++++++++++++++++----- src/views/login/loginEn.vue | 30 ++++++++++++++++++++++++------ src/views/login/loginEnDesign.vue | 22 +++++++++++++++++----- 4 files changed, 88 insertions(+), 22 deletions(-) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index f197fe1f9..a885ac26f 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -35,7 +35,7 @@ - + @@ -46,6 +46,7 @@ name="password" :type="pwdType" placeholder="密码" + ref="password" @keyup.enter.native="handleLogin" /> @@ -122,9 +123,9 @@ export default { loginForm: { username: '', password: '' - }, + }, loginRules: { - username: [{ required: true, trigger: 'blur', validator: validateUsername }], + username: [{ required: true, trigger: 'blur', validator: validateUsername },{ required: true, trigger: 'change', validator: validateUsername }], password: [{ required: true, trigger: 'blur', validator: validatePass }] }, loading: false, @@ -164,7 +165,12 @@ export default { this.$store.dispatch('SetAccount', model.username); this.handleLoginSucessRoute(); }).catch(error => { - this.tipsMsg = error.message; + if(error.code=='30001'){ + this.tipsMsg = '账号或密码不正确!'; + } + else{ + this.tipsMsg = error.message; + } this.loading = false; setTimeout(() => { this.tipsMsg = ''; }, 5000); }); @@ -231,7 +237,14 @@ export default { this.pwdType = 'password'; this.pwdDisplay=true; } - }, + }, + goToNext(){ + if (this.loginForm.username.length < 5) { + return; + }else{ + this.$refs['password'].focus(); + } + }, handleLogin() { this.$refs.loginForm.validate(valid => { if (valid) { @@ -249,7 +262,12 @@ export default { this.$store.dispatch('SetAccount', model.username); this.handleLoginSucessRoute(); }).catch(error => { - this.tipsMsg = error.message; + if(error.code=='30001'){ + this.tipsMsg = '账号或密码不正确!'; + } + else{ + this.tipsMsg = error.message; + } this.loading = false; setTimeout(() => { this.tipsMsg = ''; }, 5000); }); diff --git a/src/views/login/loginDesign.vue b/src/views/login/loginDesign.vue index 2ec98b74a..ea4fc5929 100644 --- a/src/views/login/loginDesign.vue +++ b/src/views/login/loginDesign.vue @@ -34,7 +34,7 @@ - + @@ -45,6 +45,7 @@ name="password" :type="pwdType" placeholder="密码" + ref="password" @keyup.enter.native="handleLogin" /> @@ -121,7 +122,7 @@ export default { password: '' }, loginRules: { - username: [{ required: true, trigger: 'blur', validator: validateUsername }], + username: [{ required: true, trigger: 'blur', validator: validateUsername },{ required: true, trigger: 'change', validator: validateUsername }], password: [{ required: true, trigger: 'blur', validator: validatePass }] }, loading: false, @@ -149,7 +150,12 @@ export default { setSessionStorage('design', true); this.handleLoginSucessRoute(); }).catch(error => { - this.tipsMsg = error.message; + if(error.code=='30001'){ + this.tipsMsg = '账号或密码不正确!'; + } + else{ + this.tipsMsg = error.message; + } this.loading = false; setTimeout(() => { this.tipsMsg = ''; }, 5000); }); @@ -168,7 +174,14 @@ export default { }, judgeAutoLogin() { - }, + }, + goToNext(){ + if (this.loginForm.username.length < 5) { + return; + }else{ + this.$refs['password'].focus(); + } + }, loginRefresh() { this.loadingCode = true; getLoginWmurl(LoginParams.Design).then(response => { @@ -245,7 +258,12 @@ export default { this.$store.dispatch('SetAccount', model.username); this.handleLoginSucessRoute(); }).catch(error => { - this.tipsMsg = error.message; + if(error.code=='30001'){ + this.tipsMsg = '账号或密码不正确!'; + } + else{ + this.tipsMsg = error.message; + } this.loading = false; setTimeout(() => { this.tipsMsg = ''; }, 5000); }); diff --git a/src/views/login/loginEn.vue b/src/views/login/loginEn.vue index 6f7ac0434..17e004a71 100644 --- a/src/views/login/loginEn.vue +++ b/src/views/login/loginEn.vue @@ -36,7 +36,7 @@ - + @@ -47,6 +47,7 @@ name="password" :type="pwdType" placeholder="password" + ref="password" @keyup.enter.native="handleLogin" /> @@ -97,7 +98,7 @@ import { loginTitle } from '@/scripts/ConstDic'; import { removeToken, removeDesignToken} from '@/utils/auth'; export default { - name: 'Login', + name: 'LoginEn', components: { QrcodeVue }, data() { const validateUsername = (rule, value, callback) => { @@ -123,7 +124,7 @@ export default { password: '' }, loginRules: { - username: [{ required: true, trigger: 'blur', validator: validateUsername }], + username: [{ required: true, trigger: 'blur', validator: validateUsername },{ required: true, trigger: 'change', validator: validateUsername }], password: [{ required: true, trigger: 'blur', validator: validatePass }] }, loading: false, @@ -158,7 +159,12 @@ export default { this.$store.dispatch('SetAccount', model.username); this.handleLoginSucessRoute(); }).catch(error => { - this.tipsMsg = error.message; + if(error.code=='30001'){ + this.tipsMsg = 'The account number or password is incorrect!'; + } + else{ + this.tipsMsg = error.message; + } this.loading = false; setTimeout(() => { this.tipsMsg = ''; }, 5000); }); @@ -227,7 +233,14 @@ export default { } else { this.pwdType = 'password'; } - }, + }, + goToNext(){ + if (this.loginForm.username.length < 5) { + return; + }else{ + this.$refs['password'].focus(); + } + }, handleLogin() { this.$refs.loginForm.validate(valid => { if (valid) { @@ -246,7 +259,12 @@ export default { this.$store.dispatch('SetAccount', model.username); this.handleLoginSucessRoute(); }).catch(error => { - this.tipsMsg = error.message; + if(error.code=='30001'){ + this.tipsMsg = 'The account number or password is incorrect!'; + } + else{ + this.tipsMsg = error.message; + } this.loading = false; setTimeout(() => { this.tipsMsg = ''; }, 5000); }); diff --git a/src/views/login/loginEnDesign.vue b/src/views/login/loginEnDesign.vue index 8c27ebabd..30e5c53e6 100644 --- a/src/views/login/loginEnDesign.vue +++ b/src/views/login/loginEnDesign.vue @@ -34,7 +34,7 @@ - + @@ -45,6 +45,7 @@ name="password" :type="pwdType" placeholder="password" + ref="password" @keyup.enter.native="handleLogin" /> @@ -94,7 +95,7 @@ import { setDesignToken } from '@/utils/auth'; import { removeToken, removeDesignToken} from '@/utils/auth'; export default { - name: 'LoginDesign', + name: 'LoginEnDesign', components: { QrcodeVue }, data() { const validateUsername = (rule, value, callback) => { @@ -120,7 +121,7 @@ export default { password: '' }, loginRules: { - username: [{ required: true, trigger: 'blur', validator: validateUsername }], + username: [{ required: true, trigger: 'blur', validator: validateUsername },{ required: true, trigger: 'change', validator: validateUsername }], password: [{ required: true, trigger: 'blur', validator: validatePass }] }, loading: false, @@ -136,6 +137,7 @@ export default { }; }, beforeCreate() { + debugger; removeToken(); removeDesignToken(); if (Cookies.get('UserDesignName')&&Cookies.get('UserDesignToken')) { @@ -146,7 +148,12 @@ export default { setSessionStorage('design', true); this.handleLoginSucessRoute(); }).catch(error => { - this.tipsMsg = error.message; + if(error.code=='30001'){ + this.tipsMsg = 'The account number or password is incorrect!'; + } + else{ + this.tipsMsg = error.message; + } this.loading = false; setTimeout(() => { this.tipsMsg = ''; }, 5000); }); @@ -258,7 +265,12 @@ export default { this.$store.dispatch('SetAccount', model.username); this.handleLoginSucessRoute(); }).catch(error => { - this.tipsMsg = error.message; + if(error.code=='30001'){ + this.tipsMsg = 'The account number or password is incorrect!'; + } + else{ + this.tipsMsg = error.message; + } this.loading = false; setTimeout(() => { this.tipsMsg = ''; }, 5000); }); From 89d71ed661ae0e37be34da363d905c8efe4bf899 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 23 Oct 2019 13:33:09 +0800 Subject: [PATCH 05/22] =?UTF-8?q?=E5=8F=91=E7=8E=B0=E9=97=AE=E9=A2=98?= =?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/exam.js | 5 +- src/i18n/langs/en/lesson.js | 8 +- src/i18n/langs/en/teach.js | 4 +- src/i18n/langs/zh/exam.js | 5 +- src/i18n/langs/zh/global.js | 2 +- src/i18n/langs/zh/lesson.js | 9 +- src/i18n/langs/zh/teach.js | 4 +- src/layout/components/Navbar.vue | 52 +++++------ src/views/exam/detail/questionDetail.vue | 20 ++-- src/views/exam/index.vue | 12 +-- src/views/lesson/home.vue | 92 +------------------ .../lessoncategory/edit/chapter/index.vue | 2 +- .../lessoncategory/edit/lesson/index.vue | 4 +- src/views/lesson/operateMenu.vue | 13 ++- src/views/teach/detail/index.vue | 2 +- src/views/teach/index.vue | 12 +-- src/views/trainingPlatform/demonList.vue | 4 +- 17 files changed, 90 insertions(+), 160 deletions(-) diff --git a/src/i18n/langs/en/exam.js b/src/i18n/langs/en/exam.js index 97fc53ffc..73b18ec01 100644 --- a/src/i18n/langs/en/exam.js +++ b/src/i18n/langs/en/exam.js @@ -37,5 +37,8 @@ export default { theBestTimeToCompleteTheQuestion: 'The best time to complete the question', trainingNotes: 'Training notes', giveUpTheExam: 'Give up the exam', - nameOfTestPaper: 'Test name' + nameOfTestPaper: 'Test name', + courseDescription: 'Course description', + enterTheExam: 'Enter the exam', + returnCourseList: 'Return course list' }; diff --git a/src/i18n/langs/en/lesson.js b/src/i18n/langs/en/lesson.js index 76a476b97..a45bc1097 100644 --- a/src/i18n/langs/en/lesson.js +++ b/src/i18n/langs/en/lesson.js @@ -58,7 +58,7 @@ export default { courseList: 'Course list', countSkinCode: 'Duplicate skin cannot be the same type as the copied skin', createNewCoursesFromRelease: 'Create new courses from release', - courseName: 'Course name:', + courseName: 'Course name', parentChapter: 'Parent chapter:', chapterName: 'Chapter name:', chapterInstructions: 'Chapter instructions:', @@ -71,7 +71,7 @@ export default { draftCourseName: 'Draft course name:', associatedSkin: 'Associated skin:', associatedProducts: 'Associated products:', - courseDescription: 'Course description:', + courseDescription: 'Course description', editCourse: 'Edit course', createCourse: 'Create course', courseRelease: 'Course release', @@ -116,5 +116,7 @@ export default { pendingReview: 'Pending review', published: 'Published', rejected: 'Rejected', - review: 'Review' + review: 'Review', + explanation: 'Explanation', + courseDetails: 'Course details' }; diff --git a/src/i18n/langs/en/teach.js b/src/i18n/langs/en/teach.js index d145ed68a..b03d30291 100644 --- a/src/i18n/langs/en/teach.js +++ b/src/i18n/langs/en/teach.js @@ -16,5 +16,7 @@ export default { permissionDistribute: 'Permission distribution (class)', authorityTransferred: 'Authority transferred', courseList: 'Course list', - seconds: 'seconds' + seconds: 'seconds', + enterTheCourse: 'Enter the course', + returnCourseList: 'Return course list' }; diff --git a/src/i18n/langs/zh/exam.js b/src/i18n/langs/zh/exam.js index 970e474e7..56318a45a 100644 --- a/src/i18n/langs/zh/exam.js +++ b/src/i18n/langs/zh/exam.js @@ -37,5 +37,8 @@ export default { maximumTimeToCompleteThisQuestion: '完成本题最大用时', theBestTimeToCompleteTheQuestion: '完成本题最佳用时', trainingNotes: '实训说明', - giveUpTheExam: '放弃考试' + giveUpTheExam: '放弃考试', + courseDescription: '课程说明', + enterTheExam: '进入考试', + returnCourseList: '返回课程列表' }; diff --git a/src/i18n/langs/zh/global.js b/src/i18n/langs/zh/global.js index 47813af43..be258d559 100644 --- a/src/i18n/langs/zh/global.js +++ b/src/i18n/langs/zh/global.js @@ -161,6 +161,6 @@ export default { help: '帮助', city: '城市', simulationSystem: '仿真系统', - lessonSystem: '课程系统', + lessonSystem: '教学系统', examSystem: '考试系统' }; diff --git a/src/i18n/langs/zh/lesson.js b/src/i18n/langs/zh/lesson.js index b0978644a..478f007b1 100644 --- a/src/i18n/langs/zh/lesson.js +++ b/src/i18n/langs/zh/lesson.js @@ -57,7 +57,7 @@ export default { contentSorting: '内容排序', courseList: '课程列表', createNewCoursesFromRelease: '从发布课程新建', - courseName: '课程名称:', + courseName: '课程名称', parentChapter: '父级章节:', chapterName: '章节名称:', chapterInstructions: '章节说明:', @@ -70,7 +70,7 @@ export default { draftCourseName: '草稿课程名称:', associatedSkin: '关联皮肤:', associatedProducts: '关联产品:', - courseDescription: '课程说明:', + courseDescription: '课程说明', editCourse: '编辑课程', createCourse: '创建课程', courseRelease: '课程发布', @@ -115,7 +115,8 @@ export default { pendingReview: '待审核', published: '已发布', rejected: '已驳回', - review: '查看' - + review: '查看', + explanation: '驳回说明', + courseDetails: '课程详情' }; diff --git a/src/i18n/langs/zh/teach.js b/src/i18n/langs/zh/teach.js index cb98b896c..a5663050c 100644 --- a/src/i18n/langs/zh/teach.js +++ b/src/i18n/langs/zh/teach.js @@ -16,5 +16,7 @@ export default { permissionDistribute: '权限分发(上课)', authorityTransferred: '权限转赠', courseList: '课程列表', - seconds: '秒' + seconds: '秒', + enterTheCourse: '进入课程', + returnCourseList: '返回课程列表' }; diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 8156024cb..3e412df3a 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -1,14 +1,14 @@ +
+ + 城市轨道交通实训平台 + +
@@ -149,7 +154,13 @@ export default { return true; } return false; - } + }, + goToTraining(){ + let routeData = this.$router.resolve({ + path: "/", + }); + window.open(routeData.href, '_blank'); + } } }; diff --git a/src/views/orderauthor/author/draft/edit.vue b/src/views/orderauthor/author/draft/edit.vue index 9d0d4d970..efb93e0d7 100644 --- a/src/views/orderauthor/author/draft/edit.vue +++ b/src/views/orderauthor/author/draft/edit.vue @@ -11,7 +11,7 @@ size="mini" @submit.native.prevent > - + From 3119f4f3086b721ed693b842e28e47fe2fa9b0fe Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 23 Oct 2019 15:01:25 +0800 Subject: [PATCH 12/22] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=BE=E8=AE=A1=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/lesson.js | 3 +- src/i18n/langs/zh/lesson.js | 3 +- src/utils/baseUrl.js | 4 +- src/views/approval/lesson/index.vue | 401 ++++++++++++++-------------- src/views/approval/script/index.vue | 333 ++++++++++++----------- src/views/lesson/details.vue | 38 +-- src/views/lesson/home.vue | 21 +- 7 files changed, 401 insertions(+), 402 deletions(-) diff --git a/src/i18n/langs/en/lesson.js b/src/i18n/langs/en/lesson.js index a45bc1097..3a0b71073 100644 --- a/src/i18n/langs/en/lesson.js +++ b/src/i18n/langs/en/lesson.js @@ -118,5 +118,6 @@ export default { rejected: 'Rejected', review: 'Review', explanation: 'Explanation', - courseDetails: 'Course details' + courseDetails: 'Course details', + courseTree: 'Course tree:' }; diff --git a/src/i18n/langs/zh/lesson.js b/src/i18n/langs/zh/lesson.js index 478f007b1..72ede12fb 100644 --- a/src/i18n/langs/zh/lesson.js +++ b/src/i18n/langs/zh/lesson.js @@ -117,6 +117,7 @@ export default { rejected: '已驳回', review: '查看', explanation: '驳回说明', - courseDetails: '课程详情' + courseDetails: '课程详情', + courseTree: '课程树:' }; diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 871e8ec9c..f997f31f4 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,8 +3,8 @@ 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 = 'http://192.168.3.5:9000'; // 袁琪 + // 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'; // 王兴杰 } else { diff --git a/src/views/approval/lesson/index.vue b/src/views/approval/lesson/index.vue index 3739350cd..86ededc01 100644 --- a/src/views/approval/lesson/index.vue +++ b/src/views/approval/lesson/index.vue @@ -1,214 +1,207 @@ diff --git a/src/views/approval/script/index.vue b/src/views/approval/script/index.vue index b4920e46c..84a3dd5dc 100644 --- a/src/views/approval/script/index.vue +++ b/src/views/approval/script/index.vue @@ -1,173 +1,172 @@ \ No newline at end of file + }, + created() { + }, + mounted() { + this.loadInitData(); + }, + beforeDestroy() { + + }, + methods: { + reloadTable() { + if (this.queryList && this.queryList.reload) { + this.queryList.reload(); + } + }, + goDetail() { + this.$router.push({path: ``}); + }, + async loadInitData() { + try { + // 获取地图 + this.mapList = []; + const res = await listPublishMap(); + this.allMapList=res.data; + res.data.forEach(elem => { + this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name }); + this.mapList.push({ value: elem.id, label: elem.name }); + }); + } catch (error) { + console.error(error, '获取发布地图'); + } + }, + queryFunction(params) { + return reviewScriptList(params); + }, + applyPassed(index, row) { + this.handleConfirmPass(row); + }, + applyReject(index, row) { + this.$refs.applyReject.doShow(row); + }, + scriptPreview(index, row) { + const mapInfo=this.allMapList.find(elem=>{ return elem.id==row.mapId; }); + scriptRecordNotify(row.id).then(resp => { + const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, skinCode: mapInfo.skinCode, try: 0}; + this.$router.push({ path: `${UrlConfig.design.display}/demon`, query }); + launchFullscreen(); + }).catch(error => { + this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`); + }); + }, + handleConfirmReject(data) { + rejectScript(data.id, data).then(resp => { + this.reloadTable(); + this.$message.success(this.$t('approval.rejectScriptSuccess')); + }).catch(error => { + this.$messageBox(`${this.$t('approval.rejectScriptFailed')}: ${error.message}`); + }); + } + } +}; + diff --git a/src/views/lesson/details.vue b/src/views/lesson/details.vue index e14bf2f77..2c381e182 100644 --- a/src/views/lesson/details.vue +++ b/src/views/lesson/details.vue @@ -5,22 +5,25 @@
- - - +
+

{{ this.$t('lesson.courseTree') }}

+ + + +
@@ -136,7 +139,8 @@ export default { position: relative; left: 10px; width: 400px; - padding-right: 10px; + padding-right: 20px; + padding-top: 20px; } .right_box{ } diff --git a/src/views/lesson/home.vue b/src/views/lesson/home.vue index 0baad0058..18274454d 100644 --- a/src/views/lesson/home.vue +++ b/src/views/lesson/home.vue @@ -2,9 +2,9 @@
+ {{ $t('lesson.trainingRule') }} {{ $t('lesson.trainingManage') }} {{ $t('lesson.taskManage') }} - {{ $t('lesson.trainingRule') }} {{ $t('lesson.createNewCoursesFromRelease') }} {{ $t('lesson.newConstruction') }}
@@ -78,6 +78,14 @@ export default { title: this.$t('global.operate'), width: '400', buttons: [ + { + name: this.$t('lesson.courseDetails'), + handleClick: this.goDetail, + type: 'primary', + showControl: (row) => { + return row.status !=='1'; + } + }, { name: this.$t('lesson.contentSorting'), handleClick: this.treeSort, @@ -125,14 +133,6 @@ export default { showControl: (row) => { return row.status ==='1'; } - }, - { - name: this.$t('lesson.courseDetails'), - handleClick: this.goDetail, - type: 'primary', - showControl: (row) => { - return row.status !=='1'; - } } ] } @@ -210,7 +210,7 @@ export default { this.$refs.queryListPage.refresh(true); }, lessonCreate() { - this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`, query: {skinCode: this.$route.params.skinCode} }); + this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`, query: {skinCode: this.$route.params.skinCode, mapId: this.$route.params.mapId, cityCode: this.$route.query.cityCode} }); }, lessonCreateByPublish() { this.$nextTick(() => { @@ -227,6 +227,7 @@ export default { this.$message.success(this.$t('tip.successfullyDelete')); this.loading = true; this.refresh(); + this.loading = false; }).catch(() => { this.$messageBox(this.$t('tip.failDelete')); }); From 0b23a7f9a041604126f9ccddf005512bddf7d965 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 23 Oct 2019 16:09:44 +0800 Subject: [PATCH 13/22] =?UTF-8?q?=E5=8F=B3=E4=B8=8A=E8=A7=92=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=98=B5=E7=A7=B0=E6=A0=B7=E5=BC=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/Entry.vue | 3 ++- src/layout/components/Logout.vue | 6 ++++-- src/layout/components/Navbar.vue | 27 +++++++++++++++++++-------- src/views/approval/runPlan/index.vue | 6 +++--- src/views/approval/script/index.vue | 4 +--- 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/layout/components/Entry.vue b/src/layout/components/Entry.vue index 7f6ffa29d..6defc9701 100644 --- a/src/layout/components/Entry.vue +++ b/src/layout/components/Entry.vue @@ -1,5 +1,6 @@ - -
- - 城市轨道交通实训平台 - +
+ + +
+ + 城市轨道交通实训平台 + +
+
- @@ -168,6 +171,12 @@ export default { From c83e882f6adf746acdebd61746e72a81cba7e6be Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 23 Oct 2019 17:20:32 +0800 Subject: [PATCH 20/22] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=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/i18n/langs/en/error.js | 8 +++++++- src/i18n/langs/en/trainRoom.js | 7 ++++++- src/i18n/langs/zh/error.js | 8 +++++++- src/i18n/langs/zh/trainRoom.js | 7 ++++++- src/views/trainRoom/index.vue | 27 +++++++++++---------------- 5 files changed, 37 insertions(+), 20 deletions(-) diff --git a/src/i18n/langs/en/error.js b/src/i18n/langs/en/error.js index a991c67b1..e75e4c0cc 100644 --- a/src/i18n/langs/en/error.js +++ b/src/i18n/langs/en/error.js @@ -94,5 +94,11 @@ export default { getTrainListFailed: 'Failed to get train list', getDraftCourseDataFailed: 'Failed to get draft course data!', failedToGetCourseData: 'Failed to get course data!', - failedToGetSystemData: 'Failed to get system data!' + failedToGetSystemData: 'Failed to get system data!', + inquiryPLCDeviceFailed: 'Inquiry PLC device failed!', + getScreenDoorsListFailed: 'Get the list of screen doors failed!', + theDeviceTypeAlreadyExists: 'The device type already exists!', + connectToRealDeviceFailed: 'Connect to real device failed!', + getRealDeviceListFailed: 'Get real device list failed!', + deleteRealDeviceFailed: 'Delete real device failed!' }; diff --git a/src/i18n/langs/en/trainRoom.js b/src/i18n/langs/en/trainRoom.js index 94a379547..a230a2095 100644 --- a/src/i18n/langs/en/trainRoom.js +++ b/src/i18n/langs/en/trainRoom.js @@ -27,5 +27,10 @@ export default { recording: 'recording...', sendText: 'Send text', left: 'left', - right: 'right' + right: 'right', + realDevice: 'Real device', + plcGatewayOnline: '[PLC gateway online]', + plcGatewayOffline: '[PLC gateway offline]', + uplinkPlatform: 'Uplink platform', + downlinkPlatform: 'Downlink platform' }; diff --git a/src/i18n/langs/zh/error.js b/src/i18n/langs/zh/error.js index cd065c76d..4e1d1387c 100644 --- a/src/i18n/langs/zh/error.js +++ b/src/i18n/langs/zh/error.js @@ -94,5 +94,11 @@ export default { getTrainListFailed: '获取列车列表失败', getDraftCourseDataFailed: '获取草稿课程数据失败!', failedToGetCourseData: '获取课程数据失败!', - failedToGetSystemData: '获取系统数据失败!' + failedToGetSystemData: '获取系统数据失败!', + inquiryPLCDeviceFailed: '查询PLC设备失败!', + getScreenDoorsListFailed: '获取屏蔽门列表失败!', + theDeviceTypeAlreadyExists: '已存在该设备类型!', + connectToRealDeviceFailed: '关联真实设备失败!', + getRealDeviceListFailed: '获取真实设备列表失败!', + deleteRealDeviceFailed: '删除真实设备失败!' }; diff --git a/src/i18n/langs/zh/trainRoom.js b/src/i18n/langs/zh/trainRoom.js index 04c70d8b2..481f9ebf0 100644 --- a/src/i18n/langs/zh/trainRoom.js +++ b/src/i18n/langs/zh/trainRoom.js @@ -27,5 +27,10 @@ export default { recording: '录音中...', sendText: '发送文字', left: '左', - right: '右' + right: '右', + realDevice: '真实设备', + plcGatewayOnline: '[PLC网关在线]', + plcGatewayOffline: '[PLC网关离线]', + uplinkPlatform: '上行站台', + downlinkPlatform: '下行站台' }; diff --git a/src/views/trainRoom/index.vue b/src/views/trainRoom/index.vue index af9db16d8..3bddb02a6 100644 --- a/src/views/trainRoom/index.vue +++ b/src/views/trainRoom/index.vue @@ -174,7 +174,7 @@
-

真实设备-{{ hasPlc?'[PLC网关在线]':'[PLC网关离线]' }}

+

{{ $t('trainRoom.realDevice') }}-{{ hasPlc?$t('trainRoom.plcGatewayOnline'):$t('trainRoom.plcGatewayOffline') }}

  • {{ realDeviceType[nor.deviceType] }} @@ -905,7 +905,7 @@ export default { this.hasPlc = false; } }).catch(() => { - this.$messageBox('查询PLC设备失败!'); + this.$messageBox(this.$t('error.inquiryPLCDeviceFailed')); }); }, handleDoorList(mapId, stationList) { @@ -914,14 +914,14 @@ export default { stationList.forEach(item => { res.data.forEach(it =>{ if (item.code === it.stationCode) { - const direction = parseInt(it.doorLocationType)%2 ===0? '上行站台':'下行站台'; + const direction = parseInt(it.doorLocationType)%2 ===0? this.$t('trainRoom.uplinkPlatform'):this.$t('trainRoom.downlinkPlatform'); doorList.push({code: it.code, name: item.name+direction}); } }); }); this.doorList = doorList; }).catch(() => { - this.$messageBox('获取屏蔽门列表失败!'); + this.$messageBox(this.$t('error.getScreenDoorsListFailed')); }); }, addingDevice() { @@ -933,33 +933,28 @@ export default { } }); if (typeSame) { - this.$message.info('已存在该设备类型!'); + this.$message.info(this.$t('error.theDeviceTypeAlreadyExists')); return; } setRealDevice(this.$route.query.group, roomDeviceVo); }, handleChangeDevice(nor, doorList, stationStandList) { - setRealDevice(this.$route.query.group, nor); - // doorList.forEach(item => { - // item.disabled = false; - // stationStandList.forEach(nor => { - // if (item.code == nor.deviceCode) { - // item.disabled = true; - // } - // }); - // }); + setRealDevice(this.$route.query.group, nor).then(resp => { + }).catch(() => { + this.$messageBox(this.$t('error.connectToRealDeviceFailed')); + }); }, getDevicesList() { getRealDevices(this.$route.query.group).then( resp => { this.stationStandList = resp.data; }).catch(() => { - this.$messageBox('获取真实设备列表失败!'); + this.$messageBox(this.$t('error.getRealDeviceListFailed')); }); }, handleDelDevice(nor) { delRealDevice(nor.id, this.$route.query.group).then( resp => { }).catch(() => { - this.$messageBox('删除真实设备失败!'); + this.$messageBox(this.$t('error.deleteRealDeviceFailed')); }); } } From f483a1c11552dd292068d283610f3594fc92762a Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 23 Oct 2019 17:41:24 +0800 Subject: [PATCH 21/22] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E5=9B=BE=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E6=8E=A5=E5=8F=A3=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/approval.js | 3 ++- src/i18n/langs/en/map.js | 2 +- src/i18n/langs/zh/approval.js | 4 ++-- src/views/approval/lesson/index.vue | 8 +++++++- src/views/approval/runPlan/index.vue | 21 ++++++++++++--------- src/views/approval/script/index.vue | 6 ++++++ src/views/designPlatform/demonList.vue | 3 ++- src/views/designPlatform/userDemonList.vue | 3 ++- 8 files changed, 34 insertions(+), 16 deletions(-) diff --git a/src/i18n/langs/en/approval.js b/src/i18n/langs/en/approval.js index 0625695be..682cb4c02 100644 --- a/src/i18n/langs/en/approval.js +++ b/src/i18n/langs/en/approval.js @@ -32,5 +32,6 @@ export default { instructions: 'Instructions', chapterTrainingName: 'Chapter/training name', revokeScriptSuccess: 'Revoke script success', - revokeScriptFailed: 'Revoke script failed' + revokeScriptFailed: 'Revoke script failed', + skin: 'Skin' }; diff --git a/src/i18n/langs/en/map.js b/src/i18n/langs/en/map.js index a2ea05ea2..fe71b970d 100644 --- a/src/i18n/langs/en/map.js +++ b/src/i18n/langs/en/map.js @@ -4,7 +4,7 @@ export default { pleaseSelect: 'please choose', pleaseEnter: 'please input', sketchMap: 'Draft map list', - newConstruction: 'create', + newConstruction: 'Create', importMap: 'Import the map', createNewMap: 'A new map', normalCreate: 'The normal to create', diff --git a/src/i18n/langs/zh/approval.js b/src/i18n/langs/zh/approval.js index db8c4db95..59e2c3755 100644 --- a/src/i18n/langs/zh/approval.js +++ b/src/i18n/langs/zh/approval.js @@ -32,6 +32,6 @@ export default { instructions: '说明', chapterTrainingName: '章节/课程名称', revokeScriptSuccess: '撤回成功', - revokeScriptFailed: '撤回失败' - + revokeScriptFailed: '撤回失败', + skin: '皮肤' }; diff --git a/src/views/approval/lesson/index.vue b/src/views/approval/lesson/index.vue index 86ededc01..add4b3089 100644 --- a/src/views/approval/lesson/index.vue +++ b/src/views/approval/lesson/index.vue @@ -89,7 +89,7 @@ export default { { type: 'button', title: this.$t('global.operate'), - width: '250', + width: '400', buttons: [ { name: this.$t('approval.lookOver'), @@ -205,3 +205,9 @@ export default { } }; + diff --git a/src/views/approval/runPlan/index.vue b/src/views/approval/runPlan/index.vue index ec4c44090..74406c6f2 100644 --- a/src/views/approval/runPlan/index.vue +++ b/src/views/approval/runPlan/index.vue @@ -10,7 +10,9 @@ + diff --git a/src/views/designPlatform/demonList.vue b/src/views/designPlatform/demonList.vue index 098e8b2c1..1fc5738de 100644 --- a/src/views/designPlatform/demonList.vue +++ b/src/views/designPlatform/demonList.vue @@ -20,7 +20,8 @@  {{ tnode.label }} + > +  {{ tnode.label }} diff --git a/src/views/designPlatform/userDemonList.vue b/src/views/designPlatform/userDemonList.vue index 0a44a0655..841703216 100644 --- a/src/views/designPlatform/userDemonList.vue +++ b/src/views/designPlatform/userDemonList.vue @@ -17,7 +17,8 @@  {{ tnode.label }} + > +  {{ tnode.label }} From 787580f964406046e14693e314750eddda57a52a Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 23 Oct 2019 17:41:50 +0800 Subject: [PATCH 22/22] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E8=B0=83=E6=95=B4?= =?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 | 10 +++++++++- src/views/trainRoom/index.vue | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 9b32b0b26..5199ad88b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -153,6 +153,14 @@ export const userPlan = '015'; // 计划系统 export const userDesign='016'; // 设计系统 const isDev = process.env.NODE_ENV === 'development'; +const design = getSessionStorage('design'); +let redirectPath = ''; +if (design === 'true') { + redirectPath = '/design/home'; +} else { + redirectPath = '/trainingPlatform'; +} + export const UrlConfig = { display: '/display', scriptDisplay: '/scriptDisplay', @@ -315,7 +323,7 @@ export const constantRoutes = [ }, { path: '/', - redirect: '/trainingPlatform', + redirect: redirectPath, hidden: true }, { diff --git a/src/views/trainRoom/index.vue b/src/views/trainRoom/index.vue index 3bddb02a6..6b33f5c9b 100644 --- a/src/views/trainRoom/index.vue +++ b/src/views/trainRoom/index.vue @@ -727,7 +727,11 @@ export default { this.loading = true; await putJointTrainingExit(this.$route.query.group); this.loading = false; - this.$router.push({ path: `/trainingPlatform/detail/${this.$route.query.subSystem}`, query: {mapId: this.mapId}}); + if (this.$route.query.subSystem) { + this.$router.push({ path: `/trainingPlatform/detail/${this.$route.query.subSystem}`, query: {mapId: this.mapId}}); + } else { + this.$router.go(-1); + } } catch (error) { this.messageInfo( this.$t('error.operationFailure'), 'error'); }