Merge branch 'test'
This commit is contained in:
commit
c9849613fc
@ -110,3 +110,37 @@ export function delCacheList(key) {
|
|||||||
method: 'delete'
|
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
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -5,6 +5,7 @@ export default {
|
|||||||
tips: 'Tips',
|
tips: 'Tips',
|
||||||
confirm: 'Confirm',
|
confirm: 'Confirm',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
save: 'save',
|
||||||
reset: 'Reset',
|
reset: 'Reset',
|
||||||
coachingModel: 'Coaching model',
|
coachingModel: 'Coaching model',
|
||||||
normalMode: 'Normal mode',
|
normalMode: 'Normal mode',
|
||||||
@ -162,5 +163,6 @@ export default {
|
|||||||
city: 'City',
|
city: 'City',
|
||||||
simulationSystem: 'The simulation system',
|
simulationSystem: 'The simulation system',
|
||||||
lessonSystem: 'The lesson system',
|
lessonSystem: 'The lesson system',
|
||||||
examSystem: 'The exam system'
|
examSystem: 'The exam system',
|
||||||
|
personalDetails: 'information'
|
||||||
};
|
};
|
||||||
|
@ -142,6 +142,7 @@ export default {
|
|||||||
switchesCannot: 'Switches cannot be identical',
|
switchesCannot: 'Switches cannot be identical',
|
||||||
|
|
||||||
pleaseInputName: 'Please enter name',
|
pleaseInputName: 'Please enter name',
|
||||||
|
pleaseInputNickName: 'Please enter nickName',
|
||||||
pleaseSelectStatus: 'Please select state',
|
pleaseSelectStatus: 'Please select state',
|
||||||
pleaseInputCode: 'Please enter code',
|
pleaseInputCode: 'Please enter code',
|
||||||
strLength1To25: 'The length is between 1 and 25 characters',
|
strLength1To25: 'The length is between 1 and 25 characters',
|
||||||
|
@ -6,6 +6,7 @@ export default {
|
|||||||
reset: '重 置',
|
reset: '重 置',
|
||||||
confirm: '确 定',
|
confirm: '确 定',
|
||||||
cancel: '取 消',
|
cancel: '取 消',
|
||||||
|
save: '保 存',
|
||||||
coachingModel: '教练模式',
|
coachingModel: '教练模式',
|
||||||
normalMode: '正常模式',
|
normalMode: '正常模式',
|
||||||
operate: '操 作',
|
operate: '操 作',
|
||||||
@ -162,5 +163,6 @@ export default {
|
|||||||
city: '城市',
|
city: '城市',
|
||||||
simulationSystem: '仿真系统',
|
simulationSystem: '仿真系统',
|
||||||
lessonSystem: '教学系统',
|
lessonSystem: '教学系统',
|
||||||
examSystem: '考试系统'
|
examSystem: '考试系统',
|
||||||
|
personalDetails: '个人信息'
|
||||||
};
|
};
|
||||||
|
@ -141,6 +141,7 @@ export default {
|
|||||||
switchesCannot: '道岔不能为同一个',
|
switchesCannot: '道岔不能为同一个',
|
||||||
|
|
||||||
pleaseInputName: '请输入名称',
|
pleaseInputName: '请输入名称',
|
||||||
|
pleaseInputNickName: '请输入昵称',
|
||||||
pleaseSelectStatus: '请选择状态',
|
pleaseSelectStatus: '请选择状态',
|
||||||
pleaseInputCode: '请输入编码',
|
pleaseInputCode: '请输入编码',
|
||||||
strLength1To25: '长度在 1 到 25 个字符',
|
strLength1To25: '长度在 1 到 25 个字符',
|
||||||
|
@ -35,7 +35,7 @@ export default {
|
|||||||
{
|
{
|
||||||
name: 'global.quickEntry',
|
name: 'global.quickEntry',
|
||||||
handle: this.quickEntry
|
handle: this.quickEntry
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
stomp: null,
|
stomp: null,
|
||||||
header: null
|
header: null
|
||||||
@ -58,8 +58,8 @@ export default {
|
|||||||
this.$refs.qcode.doShow();
|
this.$refs.qcode.doShow();
|
||||||
},
|
},
|
||||||
goToDesign() {
|
goToDesign() {
|
||||||
let routeData = this.$router.resolve({
|
const routeData = this.$router.resolve({
|
||||||
path: "/design",
|
path: '/design'
|
||||||
});
|
});
|
||||||
window.open(routeData.href, '_blank');
|
window.open(routeData.href, '_blank');
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
<i class="el-icon-caret-bottom" style="color: #909399;" />
|
<i class="el-icon-caret-bottom" style="color: #909399;" />
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown" class="user-dropdown">
|
<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>
|
<el-dropdown-item>
|
||||||
<span style="display:block;" @click="language">{{ $t('global.language') }}</span>
|
<span style="display:block;" @click="language">{{ $t('global.language') }}</span>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
@ -20,27 +23,31 @@
|
|||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
<language ref="language" />
|
<language ref="language" />
|
||||||
|
<user-info ref="userInfo" />
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Language from './Language';
|
import Language from './Language';
|
||||||
|
import userInfo from './userInfo';
|
||||||
import { UrlConfig } from '@/router/index';
|
import { UrlConfig } from '@/router/index';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Logout',
|
name: 'Logout',
|
||||||
components: {
|
components: {
|
||||||
Language
|
Language,
|
||||||
|
userInfo
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
};
|
};
|
||||||
},
|
|
||||||
mounted(){
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
username() {
|
username() {
|
||||||
return this.$store.state.user.nickname;
|
return this.$store.state.user.nickname;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
language() {
|
language() {
|
||||||
@ -53,6 +60,9 @@ export default {
|
|||||||
},
|
},
|
||||||
selfPermission() {
|
selfPermission() {
|
||||||
this.$router.push({ path: `${UrlConfig.permission.prefix}/manage`});
|
this.$router.push({ path: `${UrlConfig.permission.prefix}/manage`});
|
||||||
|
},
|
||||||
|
handleDetail() {
|
||||||
|
this.$refs.userInfo.doShow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -70,8 +70,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<div class="rightGroup">
|
<div class="rightGroup">
|
||||||
<quick-entry v-if="isShow" ref="quickEntry" />
|
<quick-entry v-if="isShow" ref="quickEntry" />
|
||||||
<!-- style="right: 80px;" -->
|
<div v-if="!isShow" class="avatar-container" @click="goToTraining">
|
||||||
<div class="avatar-container" v-if="!isShow" @click="goToTraining">
|
|
||||||
<el-menu-item class="avatar-wrapper" index="">
|
<el-menu-item class="avatar-wrapper" index="">
|
||||||
<span style="color: white;">城市轨道交通实训平台</span>
|
<span style="color: white;">城市轨道交通实训平台</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
@ -159,8 +158,8 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
goToTraining() {
|
goToTraining() {
|
||||||
let routeData = this.$router.resolve({
|
const routeData = this.$router.resolve({
|
||||||
path: "/",
|
path: '/'
|
||||||
});
|
});
|
||||||
window.open(routeData.href, '_blank');
|
window.open(routeData.href, '_blank');
|
||||||
}
|
}
|
||||||
@ -202,26 +201,6 @@ export default {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-right:10px;
|
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>
|
</style>
|
||||||
|
248
src/layout/components/userInfo.vue
Normal file
248
src/layout/components/userInfo.vue
Normal 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>
|
@ -3,6 +3,9 @@
|
|||||||
<div class="main-container">
|
<div class="main-container">
|
||||||
<navbar />
|
<navbar />
|
||||||
<app-main :style="{width: width+'px', height: height+'px'}" />
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -37,7 +40,7 @@ export default {
|
|||||||
return this.$store.state.app.width;
|
return this.$store.state.app.width;
|
||||||
},
|
},
|
||||||
height() {
|
height() {
|
||||||
return this.$store.state.app.height - 60;
|
return this.$store.state.app.height - 60-30;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -5,9 +5,9 @@ import NProgress from 'nprogress'; // Progress 进度条
|
|||||||
import 'nprogress/nprogress.css';// Progress 进度条样式
|
import 'nprogress/nprogress.css';// Progress 进度条样式
|
||||||
import { admin, userDesign} from './router';
|
import { admin, userDesign} from './router';
|
||||||
import { getToken, getScreenToken, getDesignToken} from '@/utils/auth'; // 验权
|
import { getToken, getScreenToken, getDesignToken} from '@/utils/auth'; // 验权
|
||||||
// getPlanToken
|
|
||||||
import { LoginParams } from '@/utils/login';
|
import { LoginParams } from '@/utils/login';
|
||||||
import { getSessionStorage } from '@/utils/auth';
|
import { getSessionStorage } from '@/utils/auth';
|
||||||
|
import localStore from 'storejs';
|
||||||
|
|
||||||
function hasPermission(roles, permissionRoles) {
|
function hasPermission(roles, permissionRoles) {
|
||||||
if (roles.indexOf(admin) >= 0) return true;
|
if (roles.indexOf(admin) >= 0) return true;
|
||||||
@ -29,7 +29,6 @@ function getRouteInfo(to) {
|
|||||||
let getTokenInfo = () => { };
|
let getTokenInfo = () => { };
|
||||||
let clientId = '';
|
let clientId = '';
|
||||||
const toRoutePath = to.redirectedFrom || to.path;
|
const toRoutePath = to.redirectedFrom || to.path;
|
||||||
|
|
||||||
if (/^\/dp/.test(toRoutePath) || /^\/display\/dp/.test(toRoutePath)) {
|
if (/^\/dp/.test(toRoutePath) || /^\/display\/dp/.test(toRoutePath)) {
|
||||||
loginPath = loginScreenPage;
|
loginPath = loginScreenPage;
|
||||||
getTokenInfo = getScreenToken;
|
getTokenInfo = getScreenToken;
|
||||||
@ -88,7 +87,15 @@ function handleRoute(to, from, next, routeInfo) {
|
|||||||
} else {
|
} else {
|
||||||
// 除没有动态改变权限的需求可直接next() 删下方权限判断
|
// 除没有动态改变权限的需求可直接next() 删下方权限判断
|
||||||
if (hasPermission(store.getters.roles, to.meta.roles)) {
|
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();
|
next();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
next({ path: '/401', replace: true, query: { noGoBack: true } });
|
next({ path: '/401', replace: true, query: { noGoBack: true } });
|
||||||
}
|
}
|
||||||
|
@ -153,13 +153,13 @@ export const userPlan = '015'; // 计划系统
|
|||||||
export const userDesign='016'; // 设计系统
|
export const userDesign='016'; // 设计系统
|
||||||
const isDev = process.env.NODE_ENV === 'development';
|
const isDev = process.env.NODE_ENV === 'development';
|
||||||
|
|
||||||
const design = getSessionStorage('design');
|
// const design = getSessionStorage('design');
|
||||||
let redirectPath = '';
|
// let redirectPath = '';
|
||||||
if (design === 'true') {
|
// if (design === 'true') {
|
||||||
redirectPath = '/design/home';
|
// redirectPath = '/design/home';
|
||||||
} else {
|
// } else {
|
||||||
redirectPath = '/trainingPlatform';
|
// redirectPath = '/trainingPlatform';
|
||||||
}
|
// }
|
||||||
|
|
||||||
export const UrlConfig = {
|
export const UrlConfig = {
|
||||||
display: '/display',
|
display: '/display',
|
||||||
@ -321,11 +321,11 @@ export const constantRoutes = [
|
|||||||
component: Jlmap3dedit,
|
component: Jlmap3dedit,
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
path: '/',
|
// path: '/',
|
||||||
redirect: redirectPath,
|
// redirect: redirectPath,
|
||||||
hidden: true
|
// hidden: true
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
path: '/401',
|
path: '/401',
|
||||||
component: Error401,
|
component: Error401,
|
||||||
|
@ -11,6 +11,7 @@ const getters = {
|
|||||||
roles: state => state.user.roles,
|
roles: state => state.user.roles,
|
||||||
canvasWidth: state => state.config.width,
|
canvasWidth: state => state.config.width,
|
||||||
canvasHeight: state => state.config.height,
|
canvasHeight: state => state.config.height,
|
||||||
|
id: state => state.user.id,
|
||||||
permission_routes: state => state.permission.routes
|
permission_routes: state => state.permission.routes
|
||||||
};
|
};
|
||||||
export default getters;
|
export default getters;
|
||||||
|
@ -17,7 +17,8 @@ const menuOperation = {
|
|||||||
menuCount: 0, // 弹出菜单变更标识
|
menuCount: 0, // 弹出菜单变更标识
|
||||||
menuParam: '', // 弹出菜单参数
|
menuParam: '', // 弹出菜单参数
|
||||||
magnifyCount: 0, // 地图放大比例标识
|
magnifyCount: 0, // 地图放大比例标识
|
||||||
shrinkCount: 0 // 地图缩小比例标识
|
shrinkCount: 0, // 地图缩小比例标识
|
||||||
|
mapDrawSelectCount: 0 // 地图编辑点击标识
|
||||||
},
|
},
|
||||||
|
|
||||||
getters: {
|
getters: {
|
||||||
@ -92,6 +93,9 @@ const menuOperation = {
|
|||||||
},
|
},
|
||||||
setShrinkCount: (state) => {
|
setShrinkCount: (state) => {
|
||||||
state.shrinkCount += 1;
|
state.shrinkCount += 1;
|
||||||
|
},
|
||||||
|
setMapDrawSelectCount: (state) => {
|
||||||
|
state.mapDrawSelectCount += 1;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -161,6 +165,10 @@ const menuOperation = {
|
|||||||
*/
|
*/
|
||||||
setMenuPositionOffset: ({ commit }, offset) => {
|
setMenuPositionOffset: ({ commit }, offset) => {
|
||||||
commit('setMenuPositionOffset', offset);
|
commit('setMenuPositionOffset', offset);
|
||||||
|
},
|
||||||
|
|
||||||
|
setMapDrawSelectCount: ({ commit }) => {
|
||||||
|
commit('setMapDrawSelectCount');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
height() {
|
height() {
|
||||||
return this.$store.state.app.height - 50;
|
return this.$store.state.app.height - 50-30;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -40,7 +40,7 @@ export default {
|
|||||||
'lessonbar'
|
'lessonbar'
|
||||||
]),
|
]),
|
||||||
height() {
|
height() {
|
||||||
return this.$store.state.app.height - 50;
|
return this.$store.state.app.height - 50-30;
|
||||||
},
|
},
|
||||||
width() {
|
width() {
|
||||||
return this.$store.state.app.width;
|
return this.$store.state.app.width;
|
||||||
|
@ -281,7 +281,8 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.zoom-view {
|
.zoom-view {
|
||||||
position: fixed;
|
// position: fixed;
|
||||||
|
position: absolute;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,9 +31,9 @@ export default {
|
|||||||
const form = {
|
const form = {
|
||||||
labelWidth: '60px',
|
labelWidth: '60px',
|
||||||
items: [
|
items: [
|
||||||
{ prop: 'name', label: this.$t('system.name'), type: 'text', required: true, disabled: true },
|
{ prop: 'name', label: this.$t('system.name'), type: 'text', disabled: true },
|
||||||
// { prop: 'nickname', label: '昵称', type: 'text', required: true },
|
// { prop: 'nickname', label: '昵称', type: 'text' },
|
||||||
// { prop: 'mobile', label: '电话', type: 'text', required: true },
|
// { prop: 'mobile', label: '电话', type: 'number' },
|
||||||
// { prop: 'email', label: '邮箱', type: 'text' },
|
// { prop: 'email', label: '邮箱', type: 'text' },
|
||||||
{ prop: 'roles', label: this.$t('system.permission'), type: 'select', required: true, options: this.$ConstSelect.roleList, multiple: true }
|
{ prop: 'roles', label: this.$t('system.permission'), type: 'select', required: true, options: this.$ConstSelect.roleList, multiple: true }
|
||||||
]
|
]
|
||||||
@ -45,10 +45,14 @@ export default {
|
|||||||
name: [
|
name: [
|
||||||
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' },
|
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' },
|
||||||
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), 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;
|
return crules;
|
||||||
}
|
}
|
||||||
|
@ -159,6 +159,7 @@ export default {
|
|||||||
handleSelectControlPage (model) {
|
handleSelectControlPage (model) {
|
||||||
if (this.$refs && this.$refs.mapOperate) {
|
if (this.$refs && this.$refs.mapOperate) {
|
||||||
this.$refs.mapOperate.handleSelectControlPage(model);
|
this.$refs.mapOperate.handleSelectControlPage(model);
|
||||||
|
this.$store.dispatch('menuOperation/setMapDrawSelectCount');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSelectView(handle) {
|
handleSelectView(handle) {
|
||||||
|
@ -497,9 +497,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
selected(val) {
|
'$store.state.menuOperation.mapDrawSelectCount': function(val) {
|
||||||
this.deviceSelect(val);
|
this.deviceSelect(this.selected);
|
||||||
}
|
}
|
||||||
|
// selected(val) {
|
||||||
|
// this.deviceSelect(val);
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$Dictionary.sectionType().then(list => {
|
this.$Dictionary.sectionType().then(list => {
|
||||||
@ -547,7 +550,7 @@ export default {
|
|||||||
this.editModel = deepAssign(this.editModel, selected);
|
this.editModel = deepAssign(this.editModel, selected);
|
||||||
this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0];
|
this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0];
|
||||||
this.editModel.isSegmentation = selected.isSegmentation || false;
|
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.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz);
|
||||||
this.addModel.splitOffset = this.addModel.splitOffsetMax / 2;
|
this.addModel.splitOffset = this.addModel.splitOffsetMax / 2;
|
||||||
@ -579,9 +582,9 @@ export default {
|
|||||||
},
|
},
|
||||||
hover(field) {
|
hover(field) {
|
||||||
if (field == 'relStandCode') {
|
if (field == 'relStandCode') {
|
||||||
this.fieldS = field === this.fieldS ? '' : field;
|
this.fieldS = field == this.fieldS ? '' : field;
|
||||||
} else {
|
} else {
|
||||||
this.field = field === this.field ? '' : field;
|
this.field = field == this.field ? '' : field;
|
||||||
this.$emit('fieldSelect', this.field);
|
this.$emit('fieldSelect', this.field);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -888,8 +891,8 @@ export default {
|
|||||||
if (selected && selected._type === 'Section' && selected.type === '01') {
|
if (selected && selected._type === 'Section' && selected.type === '01') {
|
||||||
const remove = [];
|
const remove = [];
|
||||||
const models = [];
|
const models = [];
|
||||||
const modelX = (selected.points[selected.points.length - 1].x - selected.points[0].x) / 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;
|
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++) {
|
for (let index = 1; index <= this.addModel.splitNumber; index++) {
|
||||||
const model = {
|
const model = {
|
||||||
_type: 'Section',
|
_type: 'Section',
|
||||||
|
@ -75,7 +75,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
height() {
|
height() {
|
||||||
return this.$store.state.app.height - 50;
|
return this.$store.state.app.height - 50-30;
|
||||||
},
|
},
|
||||||
skinCode() {
|
skinCode() {
|
||||||
return this.$route.query.skinCode || '02';
|
return this.$route.query.skinCode || '02';
|
||||||
|
@ -116,7 +116,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
height() {
|
height() {
|
||||||
return this.$store.state.app.height - 50;
|
return this.$store.state.app.height - 50-30;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
Loading…
Reference in New Issue
Block a user