Merge branch 'test'

This commit is contained in:
zyy 2019-10-24 09:50:31 +08:00
commit c9849613fc
22 changed files with 386 additions and 81 deletions

View File

@ -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
});
}

View File

@ -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'
};

View File

@ -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',

View File

@ -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: '个人信息'
};

View File

@ -141,6 +141,7 @@ export default {
switchesCannot: '道岔不能为同一个',
pleaseInputName: '请输入名称',
pleaseInputNickName: '请输入昵称',
pleaseSelectStatus: '请选择状态',
pleaseInputCode: '请输入编码',
strLength1To25: '长度在 1 到 25 个字符',

View File

@ -35,7 +35,7 @@ export default {
{
name: 'global.quickEntry',
handle: this.quickEntry
},
}
],
stomp: null,
header: null
@ -57,9 +57,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');
}

View File

@ -7,6 +7,9 @@
<i class="el-icon-caret-bottom" style="color: #909399;" />
</div>
<el-dropdown-menu slot="dropdown" class="user-dropdown">
<!-- <el-dropdown-item>
<span style="display:block;" @click="handleDetail">{{ $t('global.personalDetails') }}</span>
</el-dropdown-item> -->
<el-dropdown-item>
<span style="display:block;" @click="language">{{ $t('global.language') }}</span>
</el-dropdown-item>
@ -20,27 +23,31 @@
</el-dropdown-item>
</el-dropdown-menu>
<language ref="language" />
<user-info ref="userInfo" />
</el-dropdown>
</template>
<script>
import Language from './Language';
import userInfo from './userInfo';
import { UrlConfig } from '@/router/index';
export default {
name: 'Logout',
components: {
Language
Language,
userInfo
},
data() {
return {
};
},
mounted(){
},
computed: {
username() {
return this.$store.state.user.nickname;
}
},
mounted() {
},
methods: {
language() {
@ -51,8 +58,11 @@ export default {
location.reload(); // vue-router bug
});
},
selfPermission(){
selfPermission() {
this.$router.push({ path: `${UrlConfig.permission.prefix}/manage`});
},
handleDetail() {
this.$refs.userInfo.doShow();
}
}
};

View File

@ -70,8 +70,7 @@
</template>
<div class="rightGroup">
<quick-entry v-if="isShow" ref="quickEntry" />
<!-- style="right: 80px;" -->
<div class="avatar-container" v-if="!isShow" @click="goToTraining">
<div v-if="!isShow" class="avatar-container" @click="goToTraining">
<el-menu-item class="avatar-wrapper" index="">
<span style="color: white;">城市轨道交通实训平台</span>
</el-menu-item>
@ -158,9 +157,9 @@ export default {
}
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;
}
}
}
}
</style>

View File

@ -0,0 +1,248 @@
<template>
<el-dialog v-dialogDrag :title="$t('global.personalDetails')" :visible.sync="visible" width="470px" :before-close="doClose" class="userInfo_box">
<div>
<div class="form_box">
<div class="title">名称:</div>
<div class="content">
<div v-show="nameShow" class="show_box">
<span>{{ userInfo.name }}</span>
<i class="el-icon-edit" @click="switcherName" />
</div>
<div v-show="!nameShow" class="flex_box">
<el-input v-model="editInfo.name" placeholder="请输入名称" size="mini" class="input_box" />
<div class="button_box">
<el-button size="mini" class="button_box" @click="saveName">{{ $t('global.save') }}</el-button>
<el-button size="mini" class="button_box" type="text" @click="switcherName">{{ $t('global.cancel') }}</el-button>
</div>
</div>
</div>
</div>
<div class="form_box">
<div class="title">昵称:</div>
<div class="content">
<div v-show="nickNameShow" class="show_box">
<span>{{ userInfo.nickname }}</span>
<i class="el-icon-edit" @click="switcherNickname" />
</div>
<div v-show="!nickNameShow" class="flex_box">
<el-input v-model="editInfo.nickname" placeholder="请输入昵称" size="mini" class="input_box" />
<div class="button_box">
<el-button size="mini" class="button_box" @click="saveNickName">{{ $t('global.save') }}</el-button>
<el-button size="mini" class="button_box" type="text" @click="switcherNickname">{{ $t('global.cancel') }}</el-button>
</div>
</div>
</div>
</div>
<div class="form_box">
<div class="title">手机号:</div>
<div class="content">
<div v-show="mobileShow" class="show_box">
<span>{{ userInfo.mobile }}</span>
<i class="el-icon-edit" @click="switcherMobile" />
</div>
<div v-show="!mobileShow" class="flex_box">
<el-input v-model="editInfo.mobile" placeholder="请输入手机号" size="mini" class="input_box" />
<el-input v-model="editInfo.mobile" placeholder="验证码" size="mini" class="code_box" style="margin-top: 10px;" />
<el-button size="mini" style="margin-top: 10px; margin-right: 10px;" @click="sendMobileCode">发送验证码</el-button>
<div class="button_box" style="margin-top: 10px;">
<el-button size="mini" class="button_box" @click="saveMobile">{{ $t('global.save') }}</el-button>
<el-button size="mini" class="button_box" type="text" @click="switcherMobile">{{ $t('global.cancel') }}</el-button>
</div>
</div>
</div>
</div>
<div class="form_box">
<div class="title">邮箱:</div>
<div class="content">
<div v-show="emailShow" class="show_box">
<span>{{ userInfo.email }}</span>
<i class="el-icon-edit" @click="switcherEmail" />
</div>
<div v-show="!emailShow" class="flex_box">
<el-input v-model="editInfo.email" placeholder="请输入邮箱" size="mini" class="input_box" />
<el-input v-model="editInfo.mobile" placeholder="验证码" size="mini" class="code_box" style="margin-top: 10px;" />
<el-button size="mini" style="margin-top: 10px; margin-right: 10px;" @click="sendMobileCode">发送验证码</el-button>
<div class="button_box" style="margin-top: 10px;">
<el-button size="mini" class="button_box" @click="saveEmail">{{ $t('global.save') }}</el-button>
<el-button size="mini" class="button_box" type="text" @click="switcherEmail">{{ $t('global.cancel') }}</el-button>
</div>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doClose">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
// import getUserinfoName from '@/api/management/user';
export default {
data() {
return {
visible: false,
userInfo: {
name: '周渊远',
nickname: 'zyy',
mobile: '15691852838',
email: '1787816799@qq.com'
},
editInfo: {
name: '周渊远',
nickname: 'zyy',
mobile: '15691852838',
email: '1787816799@qq.com'
},
nameShow: true,
nickNameShow: true,
mobileShow: true,
emailShow: true,
mobileCodeTime: 0,
emailCodeTime: 0
};
},
computed: {
info() {
return this.$store.state.user;
}
},
methods: {
doShow() {
this.visible = true;
},
doClose() {
this.visible = false;
},
switcherName() {
this.nameShow = !this.nameShow;
},
async saveName() {
if (this.editInfo.name) {
// try {
// const res = await getUserinfoName(this.info.id, this.name);
// console.log(res);
this.userInfo.name = this.editInfo.name;
this.nameShow = !this.nameShow;
// } catch (error) {
// console.log(error, '');
// }
}
},
switcherNickname() {
this.nickNameShow = !this.nickNameShow;
},
async saveNickName() {
if (this.editInfo.nickname) {
// try {
// const res = await getUserinfoNickname(this.info.id, this.name);
// console.log(res);
this.userInfo.name = this.editInfo.nickname;
this.nickNameShow = !this.nickNameShow;
// this.nameShow = !this.nameShow;
// } catch (error) {
// console.log(error, '');
// }
}
},
switcherMobile() {
this.mobileShow = !this.mobileShow;
},
async saveMobile() {
if (this.editInfo.mobile) {
// try {
// const res = await getUserinfoMobile(this.info.id, this.name);
// console.log(res);
this.userInfo.name = this.editInfo.mobile;
this.mobileShow = !this.mobileShow;
// } catch (error) {
// console.log(error, '');
// }
}
},
sendMobileCode() {
},
switcherEmail() {
this.emailShow = !this.emailShow;
},
async saveEmail() {
if (this.editInfo.email) {
// try {
// const res = await getUserinfoEmail(this.info.id, this.name);
// console.log(res);
this.userInfo.name = this.editInfo.email;
this.emailShow = !this.emailShow;
// } catch (error) {
// console.log(error, '');
// }
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scope>
.flex_box{
display: flex;
align-items: center;
flex-wrap: wrap;
}
.form_box{
width: 100%;
overflow: hidden;
margin-bottom: 10px;
// display: flex;
// align-items: center;
// flex-wrap: wrap;
.title{
width: 60px;
text-align: left;
font-size: 14px;
height: 28px;
line-height: 28px;
float: left;
}
.content{
width: calc(100% - 60px);
float: left;
.el-icon-edit{
cursor: pointer;
}
}
.show_box{
height: 28px;
line-height: 28px;
}
.input_box{
font-size: 14px;
width: 200px;
margin-right: 10px;
flex: none;
line-height: 0;
}
.code_box{
font-size: 14px;
width: 150px;
margin-right: 15px;
flex: none;
line-height: 0;
}
.button_box{
line-height: 0;
height: 28px;
}
}
</style>
<style rel="stylesheet/scss" lang="scss">
.userInfo_box{
.el-dialog__body{
padding: 0 20px;
}
}
</style>

View File

@ -3,6 +3,9 @@
<div class="main-container">
<navbar />
<app-main :style="{width: width+'px', height: height+'px'}" />
<el-footer style="height:30px;text-align:right;line-height: 30px;">
<span style="font-size:14px;">Copyright ©2018 北京玖琏科技有限公司 京ICP备18028522号</span>
</el-footer>
</div>
</div>
</template>
@ -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() {

View File

@ -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)) {
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 } });
}

View File

@ -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,

View File

@ -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;

View File

@ -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');
}
}
};

View File

@ -44,7 +44,7 @@
},
computed: {
height() {
return this.$store.state.app.height - 50;
return this.$store.state.app.height - 50-30;
}
}
};

View File

@ -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;

View File

@ -281,7 +281,8 @@ export default {
}
.zoom-view {
position: fixed;
// position: fixed;
position: absolute;
height: 28px;
}

View File

@ -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;
}

View File

@ -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) {

View File

@ -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',

View File

@ -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';

View File

@ -116,7 +116,7 @@ export default {
},
computed: {
height() {
return this.$store.state.app.height - 50;
return this.$store.state.app.height - 50-30;
}
},
watch: {