From 62de921294e5ba699c16c7670eb05b62f38f13f7 Mon Sep 17 00:00:00 2001
From: fan <18706759286@163.com>
Date: Wed, 23 Oct 2019 19:00:35 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E9=97=AE=E9=A2=98=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 | 16 ++++++++--------
src/layout/components/Navbar.vue | 33 ++++++--------------------------
src/permission.js | 13 ++++++++++---
src/router/index.js | 24 +++++++++++------------
src/store/getters.js | 1 +
5 files changed, 37 insertions(+), 50 deletions(-)
diff --git a/src/layout/components/Logout.vue b/src/layout/components/Logout.vue
index 79b08b345..c212eefcc 100644
--- a/src/layout/components/Logout.vue
+++ b/src/layout/components/Logout.vue
@@ -34,13 +34,13 @@ export default {
data() {
return {
};
- },
- mounted(){
- },
+ },
computed: {
username() {
return this.$store.state.user.nickname;
- },
+ }
+ },
+ mounted() {
},
methods: {
language() {
@@ -50,10 +50,10 @@ export default {
this.$store.dispatch('LogOut').then(() => {
location.reload(); // 为了重新实例化vue-router对象 避免bug
});
- },
- selfPermission(){
- this.$router.push({ path: `${UrlConfig.permission.prefix}/manage`});
- }
+ },
+ selfPermission() {
+ this.$router.push({ path: `${UrlConfig.permission.prefix}/manage`});
+ }
}
};
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 6dd8b02eb..54949c87f 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -70,8 +70,7 @@
-
-
+
城市轨道交通实训平台
@@ -157,13 +156,13 @@ export default {
return true;
}
return false;
- },
- goToTraining(){
- let routeData = this.$router.resolve({
- path: "/",
+ },
+ goToTraining() {
+ const routeData = this.$router.resolve({
+ path: '/'
});
window.open(routeData.href, '_blank');
- }
+ }
}
};
@@ -202,26 +201,6 @@ export default {
display: inline-block;
position: relative;
margin-right:10px;
- // position: absolute;
- // right: 35px;
-
- .avatar-wrapper {
- cursor: pointer;
- position: relative;
-
- .user-avatar {
- width: 40px;
- height: 40px;
- border-radius: 10px;
- }
-
- .el-icon-caret-bottom {
- position: absolute;
- right: -20px;
- top: 25px;
- font-size: 12px;
- }
- }
}
}
diff --git a/src/permission.js b/src/permission.js
index f26e99c7d..f26236303 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -5,9 +5,9 @@ import NProgress from 'nprogress'; // Progress 进度条
import 'nprogress/nprogress.css';// Progress 进度条样式
import { admin, userDesign} from './router';
import { getToken, getScreenToken, getDesignToken} from '@/utils/auth'; // 验权
-// getPlanToken
import { LoginParams } from '@/utils/login';
import { getSessionStorage } from '@/utils/auth';
+import localStore from 'storejs';
function hasPermission(roles, permissionRoles) {
if (roles.indexOf(admin) >= 0) return true;
@@ -29,7 +29,6 @@ function getRouteInfo(to) {
let getTokenInfo = () => { };
let clientId = '';
const toRoutePath = to.redirectedFrom || to.path;
-
if (/^\/dp/.test(toRoutePath) || /^\/display\/dp/.test(toRoutePath)) {
loginPath = loginScreenPage;
getTokenInfo = getScreenToken;
@@ -88,7 +87,15 @@ function handleRoute(to, from, next, routeInfo) {
} else {
// 除没有动态改变权限的需求可直接next() 删下方权限判断
if (hasPermission(store.getters.roles, to.meta.roles)) {
- next();
+ if (to.path==='/404' && to.redirectedFrom==='/') {
+ if (getSessionStorage('design') === 'true') {
+ next('/design/home');
+ } else {
+ next(localStore.get('trainingPlatformRoute'+store.getters.id) ||'/trainingPlatform');
+ }
+ } else {
+ next();
+ }
} else {
next({ path: '/401', replace: true, query: { noGoBack: true } });
}
diff --git a/src/router/index.js b/src/router/index.js
index 5199ad88b..1898707c2 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -153,13 +153,13 @@ 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';
-}
+// const design = getSessionStorage('design');
+// let redirectPath = '';
+// if (design === 'true') {
+// redirectPath = '/design/home';
+// } else {
+// redirectPath = '/trainingPlatform';
+// }
export const UrlConfig = {
display: '/display',
@@ -321,11 +321,11 @@ export const constantRoutes = [
component: Jlmap3dedit,
hidden: true
},
- {
- path: '/',
- redirect: redirectPath,
- hidden: true
- },
+ // {
+ // path: '/',
+ // redirect: redirectPath,
+ // hidden: true
+ // },
{
path: '/401',
component: Error401,
diff --git a/src/store/getters.js b/src/store/getters.js
index 843d1289b..a1071dd74 100644
--- a/src/store/getters.js
+++ b/src/store/getters.js
@@ -11,6 +11,7 @@ const getters = {
roles: state => state.user.roles,
canvasWidth: state => state.config.width,
canvasHeight: state => state.config.height,
+ id: state => state.user.id,
permission_routes: state => state.permission.routes
};
export default getters;
From a1761fd2fcfe5858b346b2e78b03bdfabf9e9f0c Mon Sep 17 00:00:00 2001
From: joylink_cuiweidong <364937672@qq.com>
Date: Wed, 23 Oct 2019 19:15:02 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0copyRight?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/layout/index.vue | 5 ++++-
src/views/designPlatform/home.vue | 2 +-
src/views/designPlatform/index.vue | 2 +-
src/views/jlmap/index.vue | 3 ++-
src/views/planMonitor/detail.vue | 2 +-
src/views/scriptManage/home.vue | 2 +-
6 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/layout/index.vue b/src/layout/index.vue
index edf1684bd..d1669aa3d 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -3,6 +3,9 @@
+
+ Copyright ©2018 北京玖琏科技有限公司 京ICP备18028522号
+
@@ -37,7 +40,7 @@ export default {
return this.$store.state.app.width;
},
height() {
- return this.$store.state.app.height - 60;
+ return this.$store.state.app.height - 60-30;
}
},
created() {
diff --git a/src/views/designPlatform/home.vue b/src/views/designPlatform/home.vue
index 76c1054a8..d4c5d5fd9 100644
--- a/src/views/designPlatform/home.vue
+++ b/src/views/designPlatform/home.vue
@@ -44,7 +44,7 @@
},
computed: {
height() {
- return this.$store.state.app.height - 50;
+ return this.$store.state.app.height - 50-30;
}
}
};
diff --git a/src/views/designPlatform/index.vue b/src/views/designPlatform/index.vue
index 2c903257f..b3e427ad1 100644
--- a/src/views/designPlatform/index.vue
+++ b/src/views/designPlatform/index.vue
@@ -40,7 +40,7 @@ export default {
'lessonbar'
]),
height() {
- return this.$store.state.app.height - 50;
+ return this.$store.state.app.height - 50-30;
},
width() {
return this.$store.state.app.width;
diff --git a/src/views/jlmap/index.vue b/src/views/jlmap/index.vue
index 3ba5e7984..3ad9b9580 100644
--- a/src/views/jlmap/index.vue
+++ b/src/views/jlmap/index.vue
@@ -281,7 +281,8 @@ export default {
}
.zoom-view {
- position: fixed;
+ // position: fixed;
+ position: absolute;
height: 28px;
}
diff --git a/src/views/planMonitor/detail.vue b/src/views/planMonitor/detail.vue
index 3b148e9b8..d6e5dc512 100644
--- a/src/views/planMonitor/detail.vue
+++ b/src/views/planMonitor/detail.vue
@@ -75,7 +75,7 @@ export default {
},
computed: {
height() {
- return this.$store.state.app.height - 50;
+ return this.$store.state.app.height - 50-30;
},
skinCode() {
return this.$route.query.skinCode || '02';
diff --git a/src/views/scriptManage/home.vue b/src/views/scriptManage/home.vue
index 661db766e..9d778d905 100644
--- a/src/views/scriptManage/home.vue
+++ b/src/views/scriptManage/home.vue
@@ -116,7 +116,7 @@ export default {
},
computed: {
height() {
- return this.$store.state.app.height - 50;
+ return this.$store.state.app.height - 50-30;
}
},
watch: {
From f24259c76db84f7b5797db4005e3c76a3bd18dc3 Mon Sep 17 00:00:00 2001
From: zyy <1787816799@qq.com>
Date: Thu, 24 Oct 2019 09:46:58 +0800
Subject: [PATCH 3/3] =?UTF-8?q?desc:=20=E4=B8=AA=E4=BA=BA=E4=BF=A1?=
=?UTF-8?q?=E6=81=AF=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/management/user.js | 34 +++
src/i18n/langs/en/global.js | 4 +-
src/i18n/langs/en/rules.js | 1 +
src/i18n/langs/zh/global.js | 4 +-
src/i18n/langs/zh/rules.js | 3 +-
src/layout/components/Entry.vue | 10 +-
src/layout/components/Logout.vue | 28 +-
src/layout/components/userInfo.vue | 248 ++++++++++++++++++
src/store/modules/menuoperation.js | 10 +-
src/views/jlmap/index.vue | 4 +-
src/views/management/userControl/edit.vue | 16 +-
src/views/map/mapdraft/mapedit/index.vue | 1 +
.../mapdraft/mapedit/mapoperate/section.vue | 17 +-
13 files changed, 347 insertions(+), 33 deletions(-)
create mode 100644 src/layout/components/userInfo.vue
diff --git a/src/api/management/user.js b/src/api/management/user.js
index f2a0dd297..151d576cd 100644
--- a/src/api/management/user.js
+++ b/src/api/management/user.js
@@ -110,3 +110,37 @@ export function delCacheList(key) {
method: 'delete'
});
}
+
+// 更新用户真实姓名
+export function getUserinfoName(id, name) {
+ return request({
+ url: `/api/userinfo/${id}/name?name=${name}`,
+ method: 'put'
+ });
+}
+
+// 更新用户昵称
+export function getUserinfoNickname(id, nickname) {
+ return request({
+ url: `/api/userinfo/${id}/nickname?nickname=${nickname}`,
+ method: 'put'
+ });
+}
+
+// 更新用户手机号
+export function getUserinfoMobile(id, data) {
+ return request({
+ url: `/api/userinfo/${id}/mobile`,
+ method: 'put',
+ data: data
+ });
+}
+
+// 更新用户邮箱
+export function getUserinfoEmail(id, data) {
+ return request({
+ url: `/api/userinfo/${id}/email`,
+ method: 'put',
+ data: data
+ });
+}
diff --git a/src/i18n/langs/en/global.js b/src/i18n/langs/en/global.js
index 630ba7ee0..e08c0b7c1 100644
--- a/src/i18n/langs/en/global.js
+++ b/src/i18n/langs/en/global.js
@@ -5,6 +5,7 @@ export default {
tips: 'Tips',
confirm: 'Confirm',
cancel: 'Cancel',
+ save: 'save',
reset: 'Reset',
coachingModel: 'Coaching model',
normalMode: 'Normal mode',
@@ -162,5 +163,6 @@ export default {
city: 'City',
simulationSystem: 'The simulation system',
lessonSystem: 'The lesson system',
- examSystem: 'The exam system'
+ examSystem: 'The exam system',
+ personalDetails: 'information'
};
diff --git a/src/i18n/langs/en/rules.js b/src/i18n/langs/en/rules.js
index fc4e61559..a4d534c45 100644
--- a/src/i18n/langs/en/rules.js
+++ b/src/i18n/langs/en/rules.js
@@ -142,6 +142,7 @@ export default {
switchesCannot: 'Switches cannot be identical',
pleaseInputName: 'Please enter name',
+ pleaseInputNickName: 'Please enter nickName',
pleaseSelectStatus: 'Please select state',
pleaseInputCode: 'Please enter code',
strLength1To25: 'The length is between 1 and 25 characters',
diff --git a/src/i18n/langs/zh/global.js b/src/i18n/langs/zh/global.js
index be258d559..3b4e73a2e 100644
--- a/src/i18n/langs/zh/global.js
+++ b/src/i18n/langs/zh/global.js
@@ -6,6 +6,7 @@ export default {
reset: '重 置',
confirm: '确 定',
cancel: '取 消',
+ save: '保 存',
coachingModel: '教练模式',
normalMode: '正常模式',
operate: '操 作',
@@ -162,5 +163,6 @@ export default {
city: '城市',
simulationSystem: '仿真系统',
lessonSystem: '教学系统',
- examSystem: '考试系统'
+ examSystem: '考试系统',
+ personalDetails: '个人信息'
};
diff --git a/src/i18n/langs/zh/rules.js b/src/i18n/langs/zh/rules.js
index 022b62002..52f05f749 100644
--- a/src/i18n/langs/zh/rules.js
+++ b/src/i18n/langs/zh/rules.js
@@ -141,6 +141,7 @@ export default {
switchesCannot: '道岔不能为同一个',
pleaseInputName: '请输入名称',
+ pleaseInputNickName: '请输入昵称',
pleaseSelectStatus: '请选择状态',
pleaseInputCode: '请输入编码',
strLength1To25: '长度在 1 到 25 个字符',
@@ -309,5 +310,5 @@ export default {
selectTheKeyDirection: '请选择钥匙朝向',
enterTheUpperText: '请输入上侧文字',
enterTheLowerText: '请输入下侧文字',
- enterRejectReason: '请输入驳回说明'
+ enterRejectReason: '请输入驳回说明'
};
diff --git a/src/layout/components/Entry.vue b/src/layout/components/Entry.vue
index 7f6ffa29d..717d6e5aa 100644
--- a/src/layout/components/Entry.vue
+++ b/src/layout/components/Entry.vue
@@ -27,14 +27,14 @@ export default {
handle: this.goToDesign
},
{
- name: 'global.scan',
+ name: 'global.scan',
handle: this.qcodeEntry,
hidden: process.env.NODE_ENV != 'development'
},
{
name: 'global.quickEntry',
handle: this.quickEntry
- },
+ }
],
stomp: null,
header: null
@@ -56,9 +56,9 @@ export default {
qcodeEntry() {
this.$refs.qcode.doShow();
},
- goToDesign(){
- let routeData = this.$router.resolve({
- path: "/design",
+ goToDesign() {
+ const routeData = this.$router.resolve({
+ path: '/design'
});
window.open(routeData.href, '_blank');
}
diff --git a/src/layout/components/Logout.vue b/src/layout/components/Logout.vue
index 8fe4be3e7..12383c33c 100644
--- a/src/layout/components/Logout.vue
+++ b/src/layout/components/Logout.vue
@@ -7,6 +7,9 @@
+
{{ $t('global.language') }}
@@ -20,27 +23,31 @@
+
diff --git a/src/layout/components/userInfo.vue b/src/layout/components/userInfo.vue
new file mode 100644
index 000000000..27090320d
--- /dev/null
+++ b/src/layout/components/userInfo.vue
@@ -0,0 +1,248 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/store/modules/menuoperation.js b/src/store/modules/menuoperation.js
index 5c93007e7..03676bdd8 100644
--- a/src/store/modules/menuoperation.js
+++ b/src/store/modules/menuoperation.js
@@ -17,7 +17,8 @@ const menuOperation = {
menuCount: 0, // 弹出菜单变更标识
menuParam: '', // 弹出菜单参数
magnifyCount: 0, // 地图放大比例标识
- shrinkCount: 0 // 地图缩小比例标识
+ shrinkCount: 0, // 地图缩小比例标识
+ mapDrawSelectCount: 0 // 地图编辑点击标识
},
getters: {
@@ -92,6 +93,9 @@ const menuOperation = {
},
setShrinkCount: (state) => {
state.shrinkCount += 1;
+ },
+ setMapDrawSelectCount: (state) => {
+ state.mapDrawSelectCount += 1;
}
},
@@ -161,6 +165,10 @@ const menuOperation = {
*/
setMenuPositionOffset: ({ commit }, offset) => {
commit('setMenuPositionOffset', offset);
+ },
+
+ setMapDrawSelectCount: ({ commit }) => {
+ commit('setMapDrawSelectCount');
}
}
};
diff --git a/src/views/jlmap/index.vue b/src/views/jlmap/index.vue
index 3ba5e7984..76a77a7c9 100644
--- a/src/views/jlmap/index.vue
+++ b/src/views/jlmap/index.vue
@@ -240,9 +240,9 @@ export default {
mapViewLoaded(loading) {
this.loading = loading;
if (loading) {
- this.$refs.progressBar&&this.$refs.progressBar.start();
+ this.$refs.progressBar&&this.$refs.progressBar.start();
} else {
- this.$refs.progressBar&&this.$refs.progressBar.end(true);
+ this.$refs.progressBar&&this.$refs.progressBar.end(true);
}
},
// 设置地图加载进度
diff --git a/src/views/management/userControl/edit.vue b/src/views/management/userControl/edit.vue
index cf133840b..7b4f6f9d5 100644
--- a/src/views/management/userControl/edit.vue
+++ b/src/views/management/userControl/edit.vue
@@ -31,9 +31,9 @@ export default {
const form = {
labelWidth: '60px',
items: [
- { prop: 'name', label: this.$t('system.name'), type: 'text', required: true, disabled: true },
- // { prop: 'nickname', label: '昵称', type: 'text', required: true },
- // { prop: 'mobile', label: '电话', type: 'text', required: true },
+ { prop: 'name', label: this.$t('system.name'), type: 'text', disabled: true },
+ // { prop: 'nickname', label: '昵称', type: 'text' },
+ // { prop: 'mobile', label: '电话', type: 'number' },
// { prop: 'email', label: '邮箱', type: 'text' },
{ prop: 'roles', label: this.$t('system.permission'), type: 'select', required: true, options: this.$ConstSelect.roleList, multiple: true }
]
@@ -45,10 +45,14 @@ export default {
name: [
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' },
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
- ],
- status: [
- { required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
]
+ // nickname: [
+ // { required: true, message: this.$t('rules.pleaseInputNickName'), trigger: 'blur' },
+ // { min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
+ // ],
+ // mobile: [
+ // { required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'blur' }
+ // ]
};
return crules;
}
diff --git a/src/views/map/mapdraft/mapedit/index.vue b/src/views/map/mapdraft/mapedit/index.vue
index b2a6d1f41..d2498f7ef 100644
--- a/src/views/map/mapdraft/mapedit/index.vue
+++ b/src/views/map/mapdraft/mapedit/index.vue
@@ -159,6 +159,7 @@ export default {
handleSelectControlPage (model) {
if (this.$refs && this.$refs.mapOperate) {
this.$refs.mapOperate.handleSelectControlPage(model);
+ this.$store.dispatch('menuOperation/setMapDrawSelectCount');
}
},
handleSelectView(handle) {
diff --git a/src/views/map/mapdraft/mapedit/mapoperate/section.vue b/src/views/map/mapdraft/mapedit/mapoperate/section.vue
index 3703d119c..2d0ac1f7d 100644
--- a/src/views/map/mapdraft/mapedit/mapoperate/section.vue
+++ b/src/views/map/mapdraft/mapedit/mapoperate/section.vue
@@ -497,9 +497,12 @@ export default {
}
},
watch: {
- selected(val) {
- this.deviceSelect(val);
+ '$store.state.menuOperation.mapDrawSelectCount': function(val) {
+ this.deviceSelect(this.selected);
}
+ // selected(val) {
+ // this.deviceSelect(val);
+ // }
},
mounted() {
this.$Dictionary.sectionType().then(list => {
@@ -547,7 +550,7 @@ export default {
this.editModel = deepAssign(this.editModel, selected);
this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0];
this.editModel.isSegmentation = selected.isSegmentation || false;
- this.editModel.points = selected.points.slice();
+ this.editModel.points = JSON.parse(JSON.stringify(selected.points));
this.addModel.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz);
this.addModel.splitOffset = this.addModel.splitOffsetMax / 2;
@@ -579,9 +582,9 @@ export default {
},
hover(field) {
if (field == 'relStandCode') {
- this.fieldS = field === this.fieldS ? '' : field;
+ this.fieldS = field == this.fieldS ? '' : field;
} else {
- this.field = field === this.field ? '' : field;
+ this.field = field == this.field ? '' : field;
this.$emit('fieldSelect', this.field);
}
},
@@ -888,8 +891,8 @@ export default {
if (selected && selected._type === 'Section' && selected.type === '01') {
const remove = [];
const models = [];
- const modelX = (selected.points[selected.points.length - 1].x - selected.points[0].x) / this.addModel.splitNumber;
- const modelY = (selected.points[selected.points.length - 1].y - selected.points[0].y) / this.addModel.splitNumber;
+ const modelX = (selected.points[selected.points.length - 1].x - selected.points[0].x) / this.addModel.splitNumber; // x 平均值
+ const modelY = (selected.points[selected.points.length - 1].y - selected.points[0].y) / this.addModel.splitNumber; // y 平均值
for (let index = 1; index <= this.addModel.splitNumber; index++) {
const model = {
_type: 'Section',