This commit is contained in:
zyy 2019-10-25 14:34:19 +08:00
commit 32d3983d70
25 changed files with 91 additions and 113 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -31,22 +31,22 @@ export default {
{
name: 'global.designPlatformEntrance',
handle: this.goToDesign,
hidden: getSessionStorage('design')
hidden: getSessionStorage('project') === 'design'
},
{
name: 'global.trainingPlatformEntrance',
handle: this.goToTraining,
hidden: !getSessionStorage('design')
hidden: getSessionStorage('project') !== 'design'
},
{
name: 'global.scan',
handle: this.qcodeEntry,
hidden: process.env.NODE_ENV != 'development' || getSessionStorage('design')
hidden: process.env.NODE_ENV != 'development' || getSessionStorage('project') === 'design'
},
{
name: 'global.quickEntry',
handle: this.quickEntry,
hidden: getSessionStorage('design')
hidden: getSessionStorage('project') === 'design'
},
{
name: LangStorage.getLang('zh')==='zh'?'English':'中文',

View File

@ -101,10 +101,10 @@ export default {
])
},
mounted() {
this.routes = this.$router.options.routes;
this.routes = this.$router.options.routes;
if (this.$route.fullPath.indexOf('design/userlist')>=0) {
this.activePath='/design/userlist/home';
} else if (this.$route.fullPath.indexOf('design/lesson')>=0 || this.$route.fullPath.indexOf('design/script')>=0 || this.$route.fullPath.indexOf('design/runPlan')>=0) {
this.activePath='/design/userlist/home';
} else if (this.$route.fullPath.includes('design/lesson') || this.$route.fullPath.includes('design/script') || this.$route.fullPath.includes('design/runPlan') || this.$route.fullPath.includes('design/mapPreview')) {
this.activePath='/design/home';
} else {
this.activePath=this.$route.path;

View File

@ -1,39 +1,30 @@
<template>
<div class="avatar-container" style="margin-left:40px;">
<img class="logo" :src="logoImg" @click="goToMain"/>
<div class="titleInner" style="margin-left:60px;" @click="goToMain">{{systemTitle}}</div>
</div>
<div class="avatar-container" style="margin-left:40px;">
<img class="logo" :src="logoImg" @click="goToMain">
<div class="titleInner" style="margin-left:60px;" @click="goToMain">{{ systemTitle }}</div>
</div>
</template>
<script>
import logoImg from '@/assets/logo_changan.png';
import { getSessionStorage } from '@/utils/auth';
import { UrlConfig } from '@/router/index';
import { loginTitle } from '@/scripts/ConstDic';
export default {
data() {
data() {
return {
logoImg: logoImg,
systemTitle:"城市轨道交通实训平台"
logoImg: logoImg,
systemTitle: '城市轨道交通实训平台'
};
},
mounted(){
if (getSessionStorage('design')) {
this.systemTitle="城市轨道交通设计平台";
}
else{
this.systemTitle=loginTitle[getSessionStorage('project')||'default'];
}
},
methods:{
goToMain(){
// if (getSessionStorage('design')) {
// this.$router.push({ path: `${UrlConfig.design.prefix}/home`});
// }
}
}
}
},
mounted() {
this.systemTitle=loginTitle[getSessionStorage('project')];
},
methods: {
goToMain() {
}
}
};
</script>
<style lang="scss" scoped>
.main-container .navbar .avatar-container {

View File

@ -32,8 +32,7 @@ function getRouteInfo(to) {
getTokenInfo = getDesignToken;
clientId = LoginParams.Design.clientId;
} else if (/^\/plan/.test(toRoutePath) || /^\/display\/plan/.test(toRoutePath)) {
const flag = getSessionStorage('design');
if (flag == 'true') {
if (getSessionStorage('project')==='design') {
loginPath = loginDesignPage;
getTokenInfo = getDesignToken;
clientId = LoginParams.Design.clientId;
@ -56,9 +55,8 @@ function handleRoute(to, from, next, routeInfo) {
// 拉取用户信息
store.dispatch('GetInfo', routeInfo.getTokenInfo).then(res => {
// 根据roles权限生成可访问的路由表
// debugger;
const roles = res.roles;
if (getSessionStorage('design')) {
if (getSessionStorage('project')==='design') {
roles.push(userDesign);
}
store.dispatch('GenerateRoutes', { roles, clientId: routeInfo.clientId }).then(() => {
@ -82,7 +80,7 @@ function handleRoute(to, from, next, routeInfo) {
// 除没有动态改变权限的需求可直接next() 删下方权限判断
if (hasPermission(store.getters.roles, to.meta.roles)) {
if (to.path==='/404' && to.redirectedFrom==='/') {
if (getSessionStorage('design') === 'true') {
if (getSessionStorage('project') === 'design') {
next('/design/home');
} else {
next(localStore.get('trainingPlatformRoute'+store.getters.id) ||'/trainingPlatform');

View File

@ -1065,7 +1065,7 @@ const router = createRouter();
router.beforeEach((to, from, next) => {
const project = getSessionStorage('project');
document.title = loginTitle[project];
document.title = loginTitle[project||'login'];
next();
});

View File

@ -1,6 +1,6 @@
module.exports = {
title: '城市轨道交通实训平台',
title: '',
/**
* @type {boolean} true | false

View File

@ -48,7 +48,7 @@ function hasPermission(roles, route, parentsRoles) {
// }
// }
// return roles.some(role => route.meta.roles.indexOf(role) >= 0);
if (getSessionStorage('design')) {
if (getSessionStorage('project')==='design') {
roles= roles.filter(function (role) {
return route.meta.roles.indexOf(role) >= 0;
});

View File

@ -1,4 +1,4 @@
import { setSessionStorage, removeSessionStorage } from '@/utils/auth';
import { setSessionStorage } from '@/utils/auth';
import { login, logout, getInfo } from '@/api/login';
import { getToken, setToken, removeToken, getDesignToken, setDesignToken, removeDesignToken, handleToken, handleRemoveToken } from '@/utils/auth';
import { getUserConfigInfo } from '@/api/management/user';
@ -88,12 +88,6 @@ const user = {
// 登录系统
login(params).then(resp => {
if (userInfo.type == 'design') {
removeSessionStorage('design');
setSessionStorage('design', true);
} else {
removeSessionStorage('design');
}
execFc(resp.data);
resolve();
}).catch(error => { reject(error); });
@ -104,7 +98,6 @@ const user = {
QrLoginSetting({ dispatch, commit }, token) {
return new Promise((resolve, reject) => {
// 设置user域token值
removeSessionStorage('design');
commit(token.key, token.value);
const header = { group: '', 'X-Token': token.value };
creatSubscribe(perpetualTopic, header);
@ -173,7 +166,6 @@ const user = {
commit('SET_TOKEN', '');
commit('SET_ROLES', []);
commit('SET_ID', '');
removeSessionStorage('design');
Cookies.remove('UserDesignName');
Cookies.remove('UserDesignToken');
Cookies.remove('UserName');

View File

@ -128,9 +128,7 @@ export default {
},
created() {
listPublishMap().then(response=>{
response.data.forEach(elem => {
this.mapList.push({ value: elem.id, label: elem.name });
});
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
this.queryForm.queryObject.mapId.config.data = this.mapList;
});
},

View File

@ -129,10 +129,8 @@
//
this.skinList = [];
const res = await getSkinCodeList();
res.data.forEach(elem => {
this.queryForm.queryObject.mapId.config.data.push({ value: elem.code, label: elem.name });
this.skinList.push({ value: elem.code, label: elem.name });
});
this.skinList = res.data.map(elem => { return { value: elem.code, label: elem.name } });
this.queryForm.queryObject.mapId.config.data=this.skinList;
} catch (error) {
console.error(error, '获取发布地图');
}

View File

@ -131,10 +131,8 @@
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 });
});
this.mapList = res.data.map(elem => { return { value: elem.id, label: elem.name } });
this.queryForm.queryObject.mapId.config.data=this.mapList;
} catch (error) {
console.error(error, '获取发布地图');
}

View File

@ -105,7 +105,7 @@ export default {
launchFullscreen();
await putJointTrainingSimulationEntrance(this.group);
const rest = await getPublishMapInfo(this.mapId);
const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.group };
const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.group, subSystem: this.$route.query.subSystem };
this.$router.push({ path: `/jointTraining`, query: query });
} else if (this.state == '01') {
const query = { group: this.group };

View File

@ -28,7 +28,6 @@
import { getGoodsTryUse } from '@/api/management/goods';
import { PermissionType } from '@/scripts/ConstDic';
import { launchFullscreen } from '@/utils/screen';
import { queryPermissionSimulation } from '@/api/management/author';
import { postCreateRoom, getjointTraining, checkRoomExist } from '@/api/chat';
import { UrlConfig } from '@/router/index';
import { simulationNotify, schedulingNotify } from '@/api/simulation';

View File

@ -15,7 +15,7 @@
@node-click="clickEvent"
>
<!-- @node-contextmenu="showContextMenu" -->
<span slot-scope="{ node:tnode, data }">
<span slot-scope="{ node:tnode, data }" >
<span
class="el-icon-tickets"
:style="{color: data.valid ? 'green':''}"
@ -132,6 +132,7 @@ export default {
this.treeData = this.treeList = [];
try {
const res = await listPublishMap({cityCode: filterSelect});
res.data.forEach(elem=>{
// debugger;
// elem.children.find(n => { return n.name.includes("")})
@ -140,35 +141,28 @@ export default {
id:'1',
name:'地图预览',
type:'mapPreview',
mapId: elem.id,
hidden:false
},
{
id: '2',
name: '课程设计',
type: 'lessonDesign',
mapId: elem.id,
skinCode: elem.skinCode,
hidden:this.isAdministrator()
},
mapId: elem.id
}
];
this.isAdministrator()?elem.children.push({id: '2',name: '课程设计',type: 'lessonDesign',mapId: elem.id,skinCode: elem.skinCode}):'';
elem.children.push(
{
id: '3',
name: '剧本设计',
type: 'scriptDesign',
mapId: elem.id,
skinCode: elem.skinCode,
hidden:false
skinCode: elem.skinCode
// code:elem.children.find(n => { return n.name.includes("")})
},
});
elem.children.push(
{
id: '4',
name: '运行图设计',
type: 'runPlanDesign',
mapId: elem.id,
skinCode: elem.skinCode,
hidden:false
skinCode: elem.skinCode
}
];
);
});
this.treeData = res.data;
this.treeList = this.filterText
@ -191,7 +185,7 @@ export default {
this.$store.dispatch('config/resize', { width: width, height: height });
},
isAdministrator() {
return this.$store.state.user.roles.indexOf(superAdmin) || this.$store.state.user.roles.indexOf(admin);
return this.$store.state.user.roles.includes(superAdmin) || this.$store.state.user.roles.includes(admin);
},
// createMap() {
// this.$emit("createMap");

View File

@ -77,6 +77,7 @@
await loadMapDataById(mapId);
await this.$store.dispatch('training/setMapDefaultState');
await this.$store.dispatch('map/setTrainWindowShow', false);
await this.$store.dispatch('map/clearJlmapTrainView');
} catch (error) {
this.$messageBox(`获取地图数据失败: ${error.message}`);
this.endViewLoading();

View File

@ -48,7 +48,7 @@ export default {
};
},
watch: {
$route(newVal) {
'$route.params.subSystem': function(newVal) {
this.loadInitPage();
}
},

View File

@ -298,7 +298,7 @@ export default {
back() {
this.$store.dispatch('training/over').then(() => {
putJointTrainingSimulationUser(this.group).then(() => {
this.$router.push({ path: `/trainroom`, query: { skinCode: this.$route.query.skinCode, group: this.group, subSystem: this.$route.query.subSystem } });
this.$router.replace({ path: `/trainroom`, query: { skinCode: this.$route.query.skinCode, group: this.group, subSystem: this.$route.query.subSystem } });
exitFullscreen();
});
});

View File

@ -173,7 +173,6 @@ export default {
model.type = this.modelType;
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('SetAccount', model.username);
this.setProjectSession();
this.handleLoginSucessRoute();
}).catch(error => {
if (error.code==='30001') {
@ -204,12 +203,6 @@ export default {
removeDesignToken();
setSessionStorage('project', this.project);
},
setProjectSession() {
if (this.project === 'design') {
removeSessionStorage('design');
setSessionStorage('design', true);
}
},
clearTimer(timer) {
if (timer) {
clearTimeout(timer);
@ -289,7 +282,6 @@ export default {
}
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('SetAccount', model.username);
this.setProjectSession();
this.handleLoginSucessRoute();
}).catch(error => {
if (error.code==='30001') {

View File

@ -3,7 +3,7 @@
<pop-menu ref="popMenu" :menu="menu" />
<map-edit ref="edit" :basic-info="true" :map="editModel" :skin-code="skinCode" @refresh="refresh" />
<!-- <map-edit ref="axisEdit" :basic-info="false" :map="editModel" :skin-code="skinCode" @refresh="refresh" /> -->
<!-- <map-save-as ref="saveAs" :map="editModel" @refresh="refresh" /> -->
<map-save-as ref="saveAs" :map="editModel" @refresh="refresh" />
<map-publish ref="publish" :map="editModel" />
</div>
</template>
@ -14,7 +14,7 @@ import { DeviceMenu } from '@/scripts/ConstDic';
import { UrlConfig } from '@/router/index';
import PopMenu from '@/components/PopMenu';
import MapEdit from './edit';
// import MapSaveAs from './saveAs';
import MapSaveAs from './saveAs';
import MapPublish from './publish';
import { mapGetters } from 'vuex';
@ -23,7 +23,7 @@ export default {
components: {
PopMenu,
MapEdit,
// MapSaveAs,
MapSaveAs,
MapPublish
},
props: {
@ -51,10 +51,10 @@ export default {
// label: this.$t('map.updateObjAxis'),
// handler: this.updateObjAxis
// },
// {
// label: this.$t('map.saveAs'),
// handler: this.saveAs
// },
{
label: this.$t('map.saveAs'),
handler: this.saveAs
},
{
label: this.$t('map.deleteObj'),
handler: this.deleteObj

View File

@ -106,7 +106,7 @@ export default {
name: this.$t('scriptRecord.preview'),
handleClick: this.previewScript,
type: 'success',
showControl:(row) => { return row.status==1 },
// showControl:(row) => { return row.status==1},
}
]
}
@ -289,8 +289,8 @@ export default {
.scriptList{
display:inline-block;padding:7px 0px
}
.el-button+.el-button {
margin-left: 10px;
/deep/.el-button+.el-button {
margin-left: 5px;
margin-top: 5px;
}
</style>

View File

@ -48,7 +48,7 @@ export default {
};
},
watch: {
$route(newVal) {
'$route.params.subSystem': function(newVal) {
this.loadInitPage();
}
},

View File

@ -462,7 +462,8 @@ export default {
};
if (data.state == '03') { //
this.$router.push({ path: `/trainingPlatform/detail/${this.$route.query.subSystem}`, query: {mapId: this.mapId}});
// this.$router.push({ path: `/trainingPlatform/detail/${this.$route.query.subSystem}`, query: {mapId: this.mapId}});
this.$router.go(-1);
} else if (data.state == '01') { //
this.starting = false;
} else if (data.state == '02') {
@ -470,7 +471,7 @@ export default {
await putJointTrainingSimulationEntrance(param.group);
const rest = await getPublishMapInfo(param.mapId);
const query = { skinCode: rest.data.skinCode, mapId: param.mapId, group: param.group, subSystem: this.$route.query.subSystem };
this.$router.push({ path: `/jointTraining`, query: query });
this.$router.replace({ path: `/jointTraining`, query: query });
launchFullscreen();
}
this.$store.dispatch('socket/setJointRoomInfo'); //
@ -492,7 +493,7 @@ export default {
await putJointTrainingSimulationEntrance(this.$route.query.group);
const rest = await getPublishMapInfo(this.mapId);
const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.$route.query.group, subSystem: this.$route.query.subSystem };
this.$router.push({ path: `/jointTraining`, query: query });
this.$router.replace({ path: `/jointTraining`, query: query });
launchFullscreen();
},
// 线/线

View File

@ -38,8 +38,9 @@
name=""
rows=""
cols=""
@keyup="changeText"
/>
<button class="sendBtn" @click="sendText()">{{$t('trainRoom.sendText')}}</button>
<button class="sendBtn" @click="sendText()" :disabled="disabled">{{$t('trainRoom.sendText')}}</button>
<div
class="sendBtn yuyin_start zIndex1"
:style="{background: background}"
@ -75,7 +76,8 @@ export default {
speak: this.$t('trainRoom.holdAndTalk'),
sending: false,
background: '',
userId: ''
userId: '',
disabled:true,
};
},
watch: {
@ -93,17 +95,25 @@ export default {
//
async sendText() {
if (!this.text.trim()) {
alert(this.$t('trainRoom.contentIsEmptyAndCannotBeSent'));
this.text = '';
// alert(this.$t('trainRoom.contentIsEmptyAndCannotBeSent'));
// this.text = '';
} else {
try {
await chatWithText(this.text, this.groupRoom);
this.text = '';
this.text = '';
this.disabled=true;
} catch (error) {
console.error(error);
}
}
},
},
changeText(){
if (!this.text.trim()){
this.disabled=true;
}else{
this.disabled=false;
}
},
//
startRecording() {
this.background = '#ccc';
@ -354,6 +364,10 @@ export default {
font-size: 12px;
line-height: 25px;
text-align: center;
&:disabled{
background: #6dbcff;
cursor: no-drop;
}
}
.yuyin_start {

View File

@ -142,8 +142,10 @@ export default {
// this.$router.push({ path: `${UrlConfig.trainingPlatform.runPlan}/${this.mapId}`, query: {skinCode: '02'} });
// break;
}
}).catch(() => {
this.$messageBox(this.$t('systemGenerate.getSubSystemInfoFail'));
}).catch((error) => {
if (error.code === '40004') {
this.$messageBox(this.$t('systemGenerate.getSubSystemInfoFail'));
}
});
}
},