This commit is contained in:
sunzhenyu 2020-07-10 18:13:18 +08:00
commit 9cc69e471b
22 changed files with 129 additions and 1096 deletions

View File

@ -4,16 +4,16 @@ import router from './router/index_APP_TARGET';
import {PermissionParam} from '@/scripts/ProjectConfig'; import {PermissionParam} from '@/scripts/ProjectConfig';
import NProgress from 'nprogress'; import NProgress from 'nprogress';
import 'nprogress/nprogress.css'; import 'nprogress/nprogress.css';
import { admin } from './router/index_APP_TARGET'; // import { admin } from './router/index_APP_TARGET';
import { getToken, removeToken, getSessionStorage } from '@/utils/auth'; import { getToken, removeToken, getSessionStorage } from '@/utils/auth';
import localStore from 'storejs'; import localStore from 'storejs';
import { loginInfo } from '@/scripts/ProjectConfig'; import { loginInfo } from '@/scripts/ProjectConfig';
function hasPermission(roles, permissionRoles) { // function hasPermission(roles, permissionRoles) {
if (roles.indexOf(admin) >= 0) return true; // if (roles.indexOf(admin) >= 0) return true;
if (!permissionRoles) return true; // if (!permissionRoles) return true;
return roles.some(role => permissionRoles.indexOf(role) >= 0); // return roles.some(role => permissionRoles.indexOf(role) >= 0);
} // }
const whiteList = ['/login', '/design/login', '/gzzbxy/relay']; // 不重定向白名单 const whiteList = ['/login', '/design/login', '/gzzbxy/relay']; // 不重定向白名单
@ -59,7 +59,8 @@ function getRouteInfo(to) {
} }
function handleRoute(to, next, loginPath) { function handleRoute(to, next, loginPath) {
if (store.getters.roles.length === 0) { console.log(store.getters.roles, 'roles');
if (store.getters.roles.length == 0) {
store.dispatch('GetInfo', getToken()).then(res => { store.dispatch('GetInfo', getToken()).then(res => {
// 根据roles权限生成可访问的路由表 // 根据roles权限生成可访问的路由表
const roles = res.roles; const roles = res.roles;
@ -80,16 +81,16 @@ function handleRoute(to, next, loginPath) {
}); });
} 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 (to.path === '/404' && to.redirectedFrom === '/') {
const project = getSessionStorage('project'); const project = getSessionStorage('project');
next(localStore.get('trainingPlatformRoute' + store.getters.id + project) || '/trainingPlatform'); next(localStore.get('trainingPlatformRoute' + store.getters.id + project) || '/trainingPlatform');
} else {
next();
}
} else { } else {
next({ path: '/401', replace: true, query: { noGoBack: true } }); next();
} }
// } else {
// next({ path: '/401', replace: true, query: { noGoBack: true } });
// }
} }
} }

View File

@ -27,7 +27,7 @@ const TrainRoom = () => import('@/views/trainRoom/index');
const JointTraining = () => import('@/views/jointTraining/index'); const JointTraining = () => import('@/views/jointTraining/index');
const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index'); const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index');
const Error401 = () => import('@/views/error-page/401'); // const Error401 = () => import('@/views/error-page/401');
const Errpr404 = () => import('@/views/error-page/404'); const Errpr404 = () => import('@/views/error-page/404');
const Dictionary = () => import('@/views/system/dictionary/index'); const Dictionary = () => import('@/views/system/dictionary/index');
@ -232,11 +232,6 @@ export const constantRoutes = [
component: Jlmap3dTrain, component: Jlmap3dTrain,
hidden: true hidden: true
}, },
{
path: '/401',
component: Error401,
hidden: true
},
{ // 竞赛系统报名 { // 竞赛系统报名
path: '/jsxtApply', path: '/jsxtApply',
component: JsxtApply, component: JsxtApply,
@ -858,11 +853,6 @@ export const asyncRouter = [
meta: { meta: {
} }
} }
// { // 地图绘制
// path: 'map/draw/:mapId/:view',
// component: NewMapDraft,
// hidden: true
// }
] ]
}, },
{ // 新地图绘制 { // 新地图绘制

View File

@ -23,7 +23,7 @@ const TrainRoom = () => import('@/views/trainRoom/index');
const JointTraining = () => import('@/views/jointTraining/index'); const JointTraining = () => import('@/views/jointTraining/index');
const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index'); const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index');
const Error401 = () => import('@/views/error-page/401'); // const Error401 = () => import('@/views/error-page/401');
const Errpr404 = () => import('@/views/error-page/404'); const Errpr404 = () => import('@/views/error-page/404');
const Dictionary = () => import('@/views/system/dictionary/index'); const Dictionary = () => import('@/views/system/dictionary/index');
@ -194,12 +194,11 @@ export const constantRoutes = [
component: Jlmap3dTrain, component: Jlmap3dTrain,
hidden: true hidden: true
}, },
{ // {
path: '/401', // path: '/401',
component: Error401, // component: Error401,
hidden: true // hidden: true
}, // },
{ {
path: '/404', path: '/404',
component: Errpr404, component: Errpr404,

View File

@ -77,7 +77,6 @@ function resetAsyncRouter({ systemType }) {
} else if (systemType == projectTky) { } else if (systemType == projectTky) {
list = [...list, ...asyncRouter]; list = [...list, ...asyncRouter];
} }
console.log(list, '222222222222');
return list; return list;
} }

View File

@ -228,15 +228,17 @@ const training = {
setSimulationUserList: (state, simulationUserList) => { setSimulationUserList: (state, simulationUserList) => {
state.simulationUserList = simulationUserList; state.simulationUserList = simulationUserList;
}, },
updateMemberListInScript:(state, {oldMemberId, newMemberId, userId}) => { updateMemberListInScript:(state, {oldMemberId, newMemberId, userId, name}) => {
if (oldMemberId) { if (oldMemberId) {
// 重置旧数据 // 重置旧数据
state.memberData[oldMemberId].trust = false; state.memberData[oldMemberId].trust = false;
delete state.memberData[oldMemberId].userId; delete state.memberData[oldMemberId].userId;
delete state.memberData[oldMemberId].name;
state.memberData[oldMemberId].disabled = false; state.memberData[oldMemberId].disabled = false;
} }
// 更新新数据 // 更新新数据
state.memberData[newMemberId].userId = userId; state.memberData[newMemberId].userId = userId;
state.memberData[newMemberId].name = name;
state.memberData[newMemberId].disabled = true; state.memberData[newMemberId].disabled = true;
state.memberData[newMemberId].trust = true; state.memberData[newMemberId].trust = true;
}, },

View File

@ -1,175 +0,0 @@
<template>
<div :id="id" :style="{height: size.height+'px', width: size.width+'px'}" />
</template>
<script>
import echarts from 'echarts';
import { getRelevanceMapList, getSimulationPrdList } from '@/api/statistics';
export default {
props: {
id: {
type: String,
default: 'chart'
},
size: {
type: Object,
required: true
}
},
data() {
return {
option: {
backgroundColor: '#F0F2F5',
title: {
top: 20,
text: this.$t('dashboard.simulationStatistics'),
textStyle: {
fontWeight: 'normal',
fontSize: 18,
color: '#000000'
},
left: 'center'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
lineStyle: {
color: '#57617B'
}
}
},
legend: {
top: 20,
orient: 'vertical',
icon: 'rect',
itemWidth: 14,
itemHeight: 5,
itemGap: 13,
data: [],
right: '4%',
textStyle: {
fontSize: 12,
color: '#C0C0C0'
}
},
grid: {
top: 100,
left: '2%',
right: '2%',
bottom: '2%',
containLabel: true
},
xAxis: [{
type: 'category',
boundaryGap: true,
axisLine: {
lineStyle: {
color: '#57617B'
}
},
data: []
}],
yAxis: [{
type: 'value',
name: '(s)',
axisTick: {
show: false
},
axisLine: {
lineStyle: {
color: '#57617B'
}
},
axisLabel: {
margin: 10,
textStyle: {
fontSize: 14
}
},
splitLine: {
lineStyle: {
color: '#57617B'
}
}
}],
series: []
},
chart: null
};
},
watch: {
size() {
return this.chart.resize({...this.size, silent: false});
}
},
async created() {
await this.loadExamData();
},
mounted() {
this.initChart();
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
this.chart = echarts.init(document.getElementById(this.id));
this.chart.setOption(this.option);
},
async loadExamData() {
const data = [];
const resp = await getRelevanceMapList();
if (resp) {
const info = resp.data || [];
for (var i = 0; i < info.length; i++) {
const item = { ...info[i], data: []};
const rest = await getSimulationPrdList(info[i].id);
if (rest) {
item.data = rest.data || [];
}
data.push(item);
}
}
this.option.series = [];
this.option.legend.data = [];
this.option.xAxis[0].data = [this.$t('dashboard.comprehensiveExerciseCloudPlatform'),
this.$t('dashboard.driverSimulatedDrivingSystem'), this.$t('dashboard.ATSLineAdjustmentWorkstation'), this.$t('dashboard.ATSLocalWorkstation')];
data.forEach(elem => {
this.option.legend.data.push(elem.name);
this.option.series.push({
name: elem.name,
type: 'bar',
smooth: true,
symbol: 'circle',
symbolSize: 5,
showSymbol: false,
lineStyle: {
normal: {
width: 1
}
},
data: [0, 0, 0, 0]
});
});
data.forEach((elem, i) => {
elem.data.forEach(item => {
const index = this.option.xAxis[0].data.findIndex(name => { return name == item.statsProjectName; });
if (index >= 0) {
this.option.series[i].data[index] = item.duration;
}
});
});
this.chart.setOption(this.option);
}
}
};
</script>

View File

@ -1,191 +0,0 @@
<template>
<div>
<div :id="id" :style="{height: size.height+'px', width: size.width+'px'}" />
<div class="lesson-select">
<el-select v-model="lessonId" :placeholder="this.$t('rules.selectCourses')">
<el-option v-for="item in lessonList" :key="item.statsProjectId" :label="item.statsProjectName" :value="item.statsProjectId" />
</el-select>
</div>
</div>
</template>
<script>
import echarts from 'echarts';
import { getExamTree, getstatsExamList, getExamChart } from '@/api/statistics';
export default {
props: {
id: {
type: String,
default: 'chart'
},
size: {
type: Object,
required: true
}
},
data() {
return {
lessonId: '',
lessonList: [],
option: {
backgroundColor: '#F0F2F5',
title: {
top: 20,
text: this.$t('dashboard.testStatistics'),
textStyle: {
fontWeight: 'normal',
fontSize: 18,
color: '#000000'
},
left: 'center'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
lineStyle: {
color: '#57617B'
}
}
},
legend: {
top: 20,
orient: 'vertical',
icon: 'rect',
itemWidth: 14,
itemHeight: 5,
itemGap: 13,
data: [],
right: '4%',
textStyle: {
fontSize: 12,
color: '#C0C0C0'
}
},
grid: {
top: 100,
left: '2%',
right: '2%',
bottom: '2%',
containLabel: true
},
xAxis: [{
type: 'category',
boundaryGap: true,
axisLine: {
lineStyle: {
color: '#57617B'
}
},
data: []
}],
yAxis: [{
type: 'value',
name: '(score)',
axisTick: {
show: false
},
axisLine: {
lineStyle: {
color: '#57617B'
}
},
axisLabel: {
margin: 10,
textStyle: {
fontSize: 14
}
},
splitLine: {
lineStyle: {
color: '#57617B'
}
}
}],
series: []
},
chart: null
};
},
watch: {
size() {
return this.chart.resize({...this.size, silent: false});
},
async lessonId(val) {
await this.loadExamData(val);
}
},
mounted() {
this.initChart();
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
getExamTree().then(resp => {
this.lessonList = resp.data || [];
this.$nextTick(() => {
if (this.lessonList[0]) {
this.lessonId = this.lessonList[0].statsProjectId;
}
});
});
this.chart = echarts.init(document.getElementById(this.id));
this.chart.setOption(this.option);
},
async loadExamData(lessonId) {
const serieName = (this.lessonList[this.lessonList.findIndex(elem => { return elem.statsProjectId == lessonId; })] || {}).statsProjectName || '';
this.option.series = [];
this.option.xAxis[0].data = [];
this.option.legend.data = [serieName];
this.option.series = [{
name: serieName,
type: 'bar',
smooth: true,
symbol: 'circle',
symbolSize: 5,
showSymbol: false,
lineStyle: {
normal: {
width: 1
}
},
data: []
}];
if (lessonId) {
const resp = await getstatsExamList({lessonId});
if (resp) {
const info = resp.data || [];
for (var i = 0; i < info.length; i++) {
var scores = [];
const exam = info[i];
this.option.xAxis[0].data.push(exam.statsProjectName);
const rest = await getExamChart({examId: exam.statsProjectId});
if (rest) {
scores = (rest.data || []).map(elem => { return elem.score; });
}
this.option.series[0].data = scores;
}
}
}
this.chart.setOption(this.option);
}
}
};
</script>
<style scoped>
.lesson-select {
position: absolute;
display: flex;
top: 30px;
padding-left: 10px;
}
</style>

View File

@ -1,175 +0,0 @@
<template>
<div :id="id" :style="{height: size.height+'px', width: size.width+'px'}" />
</template>
<script>
import echarts from 'echarts';
import { getLessonList, getLessonTimeChart } from '@/api/statistics';
export default {
props: {
id: {
type: String,
default: 'chart'
},
size: {
type: Object,
required: true
}
},
data() {
return {
option: {
backgroundColor: '#F0F2F5',
title: {
top: 20,
text: this.$t('dashboard.courseStatistics'),
textStyle: {
fontWeight: 'normal',
fontSize: 18,
color: '#000000'
},
left: 'center'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
lineStyle: {
color: '#57617B'
}
}
},
legend: {
top: 20,
orient: 'vertical',
icon: 'rect',
itemWidth: 14,
itemHeight: 5,
itemGap: 13,
data: [],
right: '4%',
textStyle: {
fontSize: 12,
color: '#C0C0C0'
}
},
grid: {
top: 100,
left: '2%',
right: '2%',
bottom: '2%',
containLabel: true
},
xAxis: [{
type: 'category',
boundaryGap: true,
axisLine: {
lineStyle: {
color: '#57617B'
}
},
data: []
}],
yAxis: [{
type: 'value',
name: '(s)',
axisTick: {
show: false
},
axisLine: {
lineStyle: {
color: '#57617B'
}
},
axisLabel: {
margin: 10,
textStyle: {
fontSize: 14
}
},
splitLine: {
lineStyle: {
color: '#57617B'
}
}
}],
series: []
},
chart: null
};
},
watch: {
size() {
return this.chart.resize({...this.size, silent: false});
}
},
async created() {
await this.loadLessonData();
},
mounted() {
this.initChart();
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
this.chart = echarts.init(document.getElementById(this.id));
this.chart.setOption(this.option);
},
async loadLessonData() {
const data = [];
const resp = await getLessonList();
if (resp) {
const info = resp.data || [];
for (var i = 0; i < info.length; i++) {
const item = { ...info[i], data: []};
const rest = await getLessonTimeChart({id: info[i].statsProjectId});
if (rest) {
item.data = rest.data || [];
}
data.push(item);
}
}
this.option.series = [];
this.option.legend.data = [];
this.option.xAxis[0].data = [this.$t('dashboard.controlRightsTraining'),
this.$t('dashboard.signalTraining'), this.$t('dashboard.turnoutTraining'), this.$t('dashboard.sectionTraining'), this.$t('dashboard.stationTraining')];
data.forEach(elem => {
this.option.legend.data.push(elem.statsProjectName);
this.option.series.push({
name: elem.statsProjectName,
type: 'bar',
smooth: true,
symbol: 'circle',
symbolSize: 5,
showSymbol: false,
lineStyle: {
normal: {
width: 1
}
},
data: [0, 0, 0, 0, 0]
});
});
data.forEach((elem, i) => {
elem.data.forEach(item => {
const index = this.option.xAxis[0].data.findIndex(name => { return name == item.statsProjectName; });
if (index >= 0) {
this.option.series[i].data[index] = item.duration;
}
});
});
this.chart.setOption(this.option);
}
}
};
</script>

View File

@ -1,204 +0,0 @@
<template>
<div>
<div :id="id" :style="{height: size.height+'px', width: size.width+'px'}" />
<div class="lesson-select">
<el-select v-model="mapName" :placeholder="this.$t('dashboard.selectTheMapRoute')" size="mini" style="width: 300px">
<el-option v-for="name in mapNameList" :key="name" :label="name" :value="name" />
</el-select>
</div>
</div>
</template>
<script>
import echarts from 'echarts';
import { listUserPermision } from '@/api/management/author';
export default {
props: {
id: {
type: String,
default: 'chart'
},
size: {
type: Object,
required: true
}
},
data() {
return {
option: {
backgroundColor: '#fefefe',
title: {
text: '',
subtext: '',
subtextStyle: {
color: '#909399'
},
y: 20,
left: 'center'
},
tooltip: {
},
grid: [{
top: '17%',
width: '45%',
bottom: '5%',
left: 50,
containLabel: true
}],
xAxis: {
type: 'category',
show: false,
axisLabel: {
interval: 0,
rotate: 60
},
splitLine: {
show: false
},
data: []
},
yAxis: {
type: 'value',
show: false,
minInterval: 1,
name: this.$t('dashboard.permissions')
},
series: [{
type: 'bar',
z: 3,
barWidth: 25,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0, 0, 0, 1,
[
{offset: 0, color: '#83bff6'},
{offset: 0.5, color: '#188df0'},
{offset: 1, color: '#188df0'}
]
)
},
emphasis: {
color: new echarts.graphic.LinearGradient(
0, 0, 0, 1,
[
{offset: 0, color: '#2378f7'},
{offset: 0.7, color: '#2378f7'},
{offset: 1, color: '#83bff6'}
]
)
}
},
tooltip: {
formatter: params => { return `${params.marker} ${params.name}: ${params.value}`; }
},
data: []
}, {
type: 'pie',
radius: [0, '72%'],
center: ['74%', '55%'],
tooltip: {
formatter: params => { return `${params.marker} ${params.name}: ${params.percent}% ${params.value}个)`; }
},
data: []
}]
},
mapName: null,
mapNameList: [],
permissionList: [],
chart: null
};
},
watch: {
size() {
return this.chart.resize({...this.size, silent: false});
},
async mapName(val) {
await this.loadExamData(val);
}
},
mounted() {
this.initChart();
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
listUserPermision({pageSize: 9000, pageNum: 1}).then(resp => {
this.permissionList = resp.data.list.filter(elem => { return parseInt(elem.status) > 0; });
this.mapNameList = [...new Set(this.permissionList.filter(elem => { return elem.mapName; }).map(elem => { return elem.mapName; }))];
this.$nextTick(() => { this.mapName = this.mapNameList[0] || ''; });
});
this.chart = echarts.init(document.getElementById(this.id));
this.chart.setOption(this.option);
},
async loadExamData(mapName) {
if (mapName) {
var permissionDict = {};
var permissionList = await this.$Dictionary.permissionType();
(permissionList || []).forEach(elem => {
permissionDict[elem.code] = elem.name;
});
var permissionMap = {
'ATS现地工作站-课程权限': 0,
'ATS行调工作站-课程权限': 0,
'ATS现地工作站-考试权限': 0,
'ATS行调工作站-考试权限': 0,
'ATS现地工作站-仿真权限': 0,
'ATS行调工作站-仿真权限': 0,
'综合演练云平台-仿真权限': 0,
'司机模拟驾驶系统-仿真权限': 0,
'大屏系统权限': 0
};
(this.permissionList.filter(elem => { return elem.mapName == mapName; }) || []).forEach(elem => {
if (elem.prdName == Object.keys(permissionMap)[Object.keys(permissionMap).length - 1]) {
permissionMap[`${elem.prdName}`] = elem.remains;
} else {
permissionMap[`${elem.prdName}-${permissionDict[elem.permissionType]}`] = elem.remains;
}
});
const keys = Object.keys(permissionMap);
const values = Object.values(permissionMap);
const sum = values.reduce((total, num) => { return total + num; });
this.option.title.text = this.$t('dashboard.residualPermissionDistributionMap') + ` —— ${mapName}`;
this.option.title.subtext = this.$t('dashboard.totalPermissions') + `${sum}` + this.$t('dashboard.individual');
this.option.xAxis.show = true;
this.option.yAxis.show = true;
this.option.xAxis.data = keys;
this.option.series[0].data = values;
this.option.series[1].data = keys.filter(name => { return permissionMap[name]; } ).map(name => { return {name, value: permissionMap[name]}; });
} else {
this.option.title.text = this.$t('dashboard.residualPermissionDistributionMap') + `` + this.$t('dashboard.noMapLineDataYetAvailable') + ``;
this.option.title.subtext = this.$t('dashboard.totalPermissions') + `0` + this.$t('dashboard.individual');
this.option.xAxis.show = false;
this.option.yAxis.show = false;
this.option.xAxis.data = [];
this.option.series[0].data = [];
this.option.series[1].data = [];
}
this.chart.setOption(this.option);
}
}
};
</script>
<style scoped>
.lesson-select {
position: absolute;
display: flex;
top: 20px;
right: 20px;
}
</style>

View File

@ -1,95 +0,0 @@
<template>
<div class="dashboard-container">
<!-- <div class="item-row" style="margin-top: 20px">
<div class="item-col">
<echarts-lesson id="lesson" ref="lesson" :size="{width: size.width, height: size.height}" />
</div>
<div class="item-col">
<echarts-exam id="exam" ref="exam" :size="{width: size.width, height: size.height}" />
</div>
</div>
<div class="item-flex">
<echarts-demon id="demon" ref="demon" :size="{width: size.width * 2 + 4, height: size.height}" />
</div> -->
<echarts-permission ref="permission" class="perssmin-card" :size="{ width: size.width, height: size.height }" />
</div>
</template>
<script>
// import EchartsExam from './echarts/exam';
// import EchartsLesson from './echarts/lesson';
// import EchartsDemon from './echarts/demonstration';
import EchartsPermission from './echarts/permission';
export default {
name: 'Dashboard',
components: {
// EchartsExam,
// EchartsLesson,
// EchartsDemon,
EchartsPermission
},
data() {
return {
size: {
width: 0,
height: 0
}
};
},
watch: {
'$store.state.app.windowSizeCount': function() {
this.resize();
}
},
mounted() {
this.resize();
},
methods: {
resize() {
// this.size = {
// width: (this.$store.state.app.width - 60) / 2,
// height: (this.$store.state.app.height - 100) / 2
// };
this.size = {
width: (this.$store.state.app.width),
height: (this.$store.state.app.height - 60)
};
}
}
};
</script>
<style lang="scss" scoped>
.dashboard {
&-container {
margin: 0px;
}
&-text {
font-size: 30px;
line-height: 46px;
}
}
.item-col {
display: inline-block;
}
.item-row {
left: 50%;
right: 50%;
text-align: center;
}
.item-flex {
display: flex;
justify-content: center;
}
.perssmin-card {
display: flex;
justify-content: center;
}
</style>

View File

@ -84,13 +84,10 @@ export default {
} }
}, },
onContextmenu(em) { onContextmenu(em) {
this.point = { const point = { x: em.clientX, y: em.clientY };
x: em.clientX,
y: em.clientY
};
if (!em.deviceType) { if (!em.deviceType) {
var menu = getDeviceMenuByDeviceType('Cancel'); var menu = getDeviceMenuByDeviceType('Cancel');
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu }); this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
} }
}, },
// //

View File

@ -1,107 +0,0 @@
<template>
<div class="errPage-container">
<el-button icon="arrow-left" class="pan-back-btn" @click="back">
{{ $t('global.back') }}
</el-button>
<el-row>
<el-col :span="12">
<h1 class="text-jumbo text-ginormous">
Oops!
</h1>
{{ $t('error.gifSource') }}<a href="https://zh.airbnb.com/" target="_blank">airbnb</a> {{ $t('error.page') }}
<h2>{{ $t('error.noPermissionToGoToThisPage') }}</h2>
<h6>{{ $t('error.dissatisfied') }}</h6>
<ul class="list-unstyled">
<li>{{ $t('error.orYouCanGo') }}</li>
<li class="link-type">
<router-link to="/dashboard">
{{ $t('error.backToHome') }}
</router-link>
</li>
<li class="link-type">
<a href="https://www.taobao.com/">{{ $t('error.justLookingAround') }}</a>
</li>
<li><a href="#" @click.prevent="dialogVisible=true">{{ $t('error.pointMeToSeeThePicture') }}</a></li>
</ul>
</el-col>
<el-col :span="12">
<img :src="errGif" width="313" height="428" alt="Girl has dropped her ice cream.">
</el-col>
</el-row>
<el-dialog v-dialogDrag :visible.sync="dialogVisible" :title="this.$t('error.casualLook')">
<img :src="ewizardClap" class="pan-img">
</el-dialog>
</div>
</template>
<script>
import errGif from '@/assets/401_images/401.gif';
export default {
name: 'Page401',
data() {
return {
errGif: errGif + '?' + +new Date(),
ewizardClap: 'https://wpimg.wallstcn.com/007ef517-bafd-4066-aae4-6883632d9646',
dialogVisible: false
};
},
methods: {
back() {
if (this.$route.query.noGoBack) {
this.$router.push({ path: '/dashboard' });
} else {
this.$router.go(-1);
}
}
}
};
</script>
<style lang="scss" scoped>
.errPage-container {
width: 800px;
max-width: 100%;
margin: 100px auto;
.pan-back-btn {
background: #008489;
color: #fff;
border: none !important;
}
.pan-gif {
margin: 0 auto;
display: block;
}
.pan-img {
display: block;
margin: 0 auto;
width: 100%;
}
.text-jumbo {
font-size: 60px;
font-weight: 700;
color: #484848;
}
.list-unstyled {
font-size: 14px;
li {
padding-bottom: 5px;
}
a {
color: #008489;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}
}
</style>

View File

@ -55,7 +55,7 @@ import ChatCreateGroup from './chatCreateGroup';
import ChatMemberList from './chatMemberList'; import ChatMemberList from './chatMemberList';
import ChatTooltip from './chatTooltip'; import ChatTooltip from './chatTooltip';
import RecordRTC from 'recordrtc'; import RecordRTC from 'recordrtc';
import {sendSimulationConversition, overSimulationConversition, getSimulationMembersNew, getAllConversition, getSimulationConversition} from '@/api/chat'; import {sendSimulationConversition, overSimulationConversition, getAllConversition, getSimulationConversition} from '@/api/chat';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
export default { export default {
@ -135,7 +135,6 @@ export default {
const objectBottom = parseInt(object.style.bottom) || 0; const objectBottom = parseInt(object.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom; this.bottom = this.bottom + object.offsetHeight + objectBottom;
} }
this.getSimulationMembers();
}, },
'userRole':function(val) { 'userRole':function(val) {
this.isHasCoversition = false; this.isHasCoversition = false;
@ -196,77 +195,78 @@ export default {
}, },
// //
getSimulationMembers() { getSimulationMembers() {
getSimulationMembersNew(this.$route.query.group).then(resp => { const memberList = this.$store.state.training.memberData;
let lastData = JSON.stringify(resp.data); let lastData = JSON.stringify(memberList);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew; const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) { roleTypeList.forEach(function(element) {
const rolename = element.value; const rolename = element.value;
if (Cookies.get('user_lang') == 'en') { if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel); lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else { } else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label); lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
} }
}); });
lastData = JSON.parse(lastData); lastData = JSON.parse(lastData);
const activeList = this.$store.state.map.activeTrainList; const activeList = this.$store.state.map.activeTrainList;
const memberList = []; lastData = Object.values(lastData);
// lastData = lastData.filter(memberIn=>{ return memberIn.role != ''; }); const lastMemberList = [];
lastData.forEach((member, index)=>{ lastData.forEach((member, index)=>{
if (member.type != '观众') { if (member.type != '观众') {
const name = member.name == undefined ? '' : '-' + member.name; const name = member.name == undefined ? '' : '-' + member.name;
if (member.deviceCode) { if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode); const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (device) { if (device) {
if (device._type == 'Train') { if (device._type == 'Train') {
member.memberName = member.type + device.groupNumber + name; member.memberName = member.type + device.groupNumber + name;
if (activeList.length > 0 && activeList.includes(device.groupNumber)) { if (activeList.length > 0 && activeList.includes(device.groupNumber)) {
memberList.push(member); lastMemberList.push(member);
}
} else {
member.memberName = member.type + device.name + name;
memberList.push(member);
} }
} else { } else {
member.memberName = member.type + member.deviceCode + name; member.memberName = member.type + device.name + name;
memberList.push(member); lastMemberList.push(member);
} }
} else { } else {
member.memberName = member.type + name; member.memberName = member.type + member.deviceCode + name;
memberList.push(member); lastMemberList.push(member);
} }
}
});
this.memberList = memberList;
if (this.recordSending) {
this.cancleRecording();
}
//
getAllConversition(this.$route.query.group).then(resp=>{
if (resp.data && resp.data.length && resp.data.length > 0) {
this.isCreate = false;
const coversitionList = resp.data;
let memberListCoversition = {};
coversitionList.forEach(coversition=>{
if (!coversition.over) {
const memberList = coversition.memberList;
memberList.forEach(member=>{
if (member.memberId == this.$store.state.scriptRecord.updateRoleId) {
memberListCoversition = {id:coversition.id, all:null};
if (member.memberId == coversition.creatorId) {
this.isCreate = true;
}
}
});
}
});
this.memberListCoversition = memberListCoversition;
} else { } else {
this.isCreate = false; member.memberName = member.type + name;
this.memberListCoversition = {}; lastMemberList.push(member);
} }
this.getSimulationConverMembers(); }
}); });
this.memberList = lastMemberList;
this.getAllConversition();
},
getAllConversition() {
if (this.recordSending) {
this.cancleRecording();
}
//
getAllConversition(this.$route.query.group).then(resp=>{
if (resp.data && resp.data.length && resp.data.length > 0) {
this.isCreate = false;
const coversitionList = resp.data;
let memberListCoversition = {};
coversitionList.forEach(coversition=>{
if (!coversition.over) {
const memberList = coversition.memberList;
memberList.forEach(member=>{
if (member.memberId == this.$store.state.scriptRecord.updateRoleId) {
memberListCoversition = {id:coversition.id, all:null};
if (member.memberId == coversition.creatorId) {
this.isCreate = true;
}
}
});
}
});
this.memberListCoversition = memberListCoversition;
} else {
this.isCreate = false;
this.memberListCoversition = {};
}
this.getSimulationConverMembers();
}); });
}, },
// //

View File

@ -21,7 +21,6 @@
@devicemodel="devicemodel" @devicemodel="devicemodel"
@showScheduling="showScheduling" @showScheduling="showScheduling"
/> />
<!-- :training-obj="trainingObj" -->
<menu-lesson <menu-lesson
v-if="isLesson" v-if="isLesson"
ref="lessonMenu" ref="lessonMenu"
@ -47,7 +46,7 @@
/> />
<menu-schema <menu-schema
v-if="isDemon || isScript " v-if="isDemon || isScript"
ref="menuSchema" ref="menuSchema"
:offset="offset" :offset="offset"
:data-error="dataError" :data-error="dataError"

View File

@ -189,7 +189,7 @@ export default {
this.setCenter(code); this.setCenter(code);
} }
}, },
'$store.state.socket.simulationReset': function (val) { '$store.state.socket.simulationReset': function (val) { // 仿
if (val) { if (val) {
this.simulationReset(val); this.simulationReset(val);
} }

View File

@ -9,7 +9,6 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { getDeviceMenuByDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { getDeviceMenuByDeviceType, OperationEvent } from '@/scripts/ConstDic';
// import { letfMouseSelectDevice } from '@/api/simulation';
import deviceType from '@/jmap/constant/deviceType'; import deviceType from '@/jmap/constant/deviceType';
import JlmapVisual from '@/views/newMap/jlmapNew/index'; import JlmapVisual from '@/views/newMap/jlmapNew/index';
import TrainingTips from '@/views/newMap/mapsystemNew/plugin/trainingtip'; import TrainingTips from '@/views/newMap/mapsystemNew/plugin/trainingtip';
@ -23,11 +22,7 @@ export default {
data() { data() {
return { return {
selected: null, selected: null,
menus: null, menus: null
point: {
x: 0,
y: 0
}
}; };
}, },
computed: { computed: {
@ -85,11 +80,11 @@ export default {
}, },
clickEvent(em) { clickEvent(em) {
var device = { _type: em.deviceType, _code: em.deviceCode }; var device = { _type: em.deviceType, _code: em.deviceCode };
var CanClickDeviceList = [ // var CanClickDeviceList = [
deviceType.Switch, // deviceType.Switch,
deviceType.Signal, // deviceType.Signal,
deviceType.StationStand // deviceType.StationStand
]; // ];
const lineCode = this.$store.getters['map/lineCode']; const lineCode = this.$store.getters['map/lineCode'];
if (em.deviceType === 'StationStand' && lineCode === '01') { if (em.deviceType === 'StationStand' && lineCode === '01') {
const menu = getDeviceMenuByDeviceType(device._type) || []; const menu = getDeviceMenuByDeviceType(device._type) || [];
@ -98,13 +93,13 @@ export default {
if (em.deviceCode) { if (em.deviceCode) {
device = this.getDeviceByEm(em); device = this.getDeviceByEm(em);
if (CanClickDeviceList.includes(em.deviceType)) { // if (CanClickDeviceList.includes(em.deviceType)) {
try { // try {
// letfMouseSelectDevice(em.deviceCode, this.group); // // letfMouseSelectDevice(em.deviceCode, this.group);
} catch (error) { // } catch (error) {
console.log('send left mouse click error.'); // console.log('send left mouse click error.');
} // }
} // }
} }
this.selected = device; this.selected = device;
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType}); this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
@ -118,7 +113,7 @@ export default {
contextmenu(em) { contextmenu(em) {
var menu = null; var menu = null;
var device = null; var device = null;
this.point = { x: em.clientX, y: em.clientY }; const point = { x: em.clientX, y: em.clientY };
const lineCode = this.$store.getters['map/lineCode']; const lineCode = this.$store.getters['map/lineCode'];
if (em.subType === 'TrainWindow') { if (em.subType === 'TrainWindow') {
device = { _type: deviceType.TrainWindow, code: em.deviceCode }; device = { _type: deviceType.TrainWindow, code: em.deviceCode };
@ -127,16 +122,16 @@ export default {
const equipment = this.getDeviceByEm(em); const equipment = this.getDeviceByEm(em);
this.$store.dispatch('menuOperation/setSelected', {device:equipment, subType: em.subType}); this.$store.dispatch('menuOperation/setSelected', {device:equipment, subType: em.subType});
menu = getDeviceMenuByDeviceType('StationControl'); menu = getDeviceMenuByDeviceType('StationControl');
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu }); this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
return; return;
} else if (em.subType == 'enabled' && em.deviceType == 'Switch') { } else if (em.subType == 'enabled' && em.deviceType == 'Switch') {
menu = getDeviceMenuByDeviceType('Enabled'); menu = getDeviceMenuByDeviceType('Enabled');
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu }); this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
return; return;
} else if (em.subType === 'enabled' && em.deviceType === 'Signal') { } else if (em.subType === 'enabled' && em.deviceType === 'Signal') {
menu = getDeviceMenuByDeviceType('Enabled'); menu = getDeviceMenuByDeviceType('Enabled');
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu}); this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu});
return; return;
} else if (em.deviceCode && !this.isScreen) { } else if (em.deviceCode && !this.isScreen) {
device = this.getDeviceByEm(em); device = this.getDeviceByEm(em);
@ -146,18 +141,18 @@ export default {
if (!this.buttonOperation) { if (!this.buttonOperation) {
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType}); this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
if (!this.checkShouldPop(device)) { if (!this.checkShouldPop(device)) {
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: null }); this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: null });
} else { } else {
if (em.deviceType === 'StationStand' && lineCode === '01') { if (em.deviceType === 'StationStand' && lineCode === '01') {
return; return;
} }
menu = getDeviceMenuByDeviceType(device._type); menu = getDeviceMenuByDeviceType(device._type);
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu }); this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
} }
} }
} else { } else {
menu = getDeviceMenuByDeviceType('Cancel'); menu = getDeviceMenuByDeviceType('Cancel');
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu }); this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
} }
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },

View File

@ -16,8 +16,6 @@
<div class="buttonList"> <div class="buttonList">
<el-button size="small" type="primary" class="eachButton uploadDemo " @click="importMap"> <el-button size="small" type="primary" class="eachButton uploadDemo " @click="importMap">
{{ $t('map.importMap') }} {{ $t('map.importMap') }}
<!-- <input ref="files" type="file" class="file_box" accept=".json, application/json" @change="importf">
{{ $t('map.importMap') }} -->
</el-button> </el-button>
<el-button size="small" type="primary" class="eachButton" @click="createMap">{{ $t('map.newConstruction') }}</el-button> <el-button size="small" type="primary" class="eachButton" @click="createMap">{{ $t('map.newConstruction') }}</el-button>
</div> </div>
@ -68,13 +66,6 @@ export default {
lineCode: '' lineCode: ''
}; };
}, },
computed: {
// role() {
// return this.$store.state.user.roles.includes('04') ||
// this.$store.state.user.roles.includes('05') ||
// this.$store.state.user.roles.includes('01');
// }
},
watch: { watch: {
filterText(val) { filterText(val) {
this.$refs.tree.filter(val); this.$refs.tree.filter(val);

View File

@ -261,7 +261,7 @@ export default {
this.$refs.publish3d.show(); this.$refs.publish3d.show();
} }
}, },
assetmanager3d(){ assetmanager3d() {
this.$emit('assetmanager3d'); this.$emit('assetmanager3d');
}, },
jlmap3d() { jlmap3d() {

View File

@ -2,7 +2,7 @@
<el-dialog v-dialogDrag :title="$t('map.mapPublished')" :visible.sync="dialogShow" width="30%" :before-close="handleClose"> <el-dialog v-dialogDrag :title="$t('map.mapPublished')" :visible.sync="dialogShow" width="30%" :before-close="handleClose">
<div> <div>
<el-form ref="form" label-position="right" :model="editModel" label-width="120px" :rules="editRules" size="mini" @submit.native.prevent> <el-form ref="form" label-position="right" :model="editModel" label-width="120px" :rules="editRules" size="mini" @submit.native.prevent>
<el-form-item label="地图名称:" prop="mapName"><span>{{ this.map.name }}</span></el-form-item> <el-form-item label="地图名称:" prop="mapName"><span>{{ map.name }}</span></el-form-item>
<el-form-item :label="$t('map.publishingAssociatedCity')" prop="cityCode"> <el-form-item :label="$t('map.publishingAssociatedCity')" prop="cityCode">
<el-select v-model="editModel.cityCode" :placeholder="$t('map.pleaseSelect')"> <el-select v-model="editModel.cityCode" :placeholder="$t('map.pleaseSelect')">
<el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.code" /> <el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.code" />

View File

@ -2,7 +2,7 @@
<el-dialog v-dialogDrag :title="$t('map.mapPublished')" :visible.sync="dialogShow" width="30%" :before-close="handleClose"> <el-dialog v-dialogDrag :title="$t('map.mapPublished')" :visible.sync="dialogShow" width="30%" :before-close="handleClose">
<div> <div>
<el-form ref="form" label-position="right" :model="editModel" label-width="120px" :rules="editRules" size="mini" @submit.native.prevent> <el-form ref="form" label-position="right" :model="editModel" label-width="120px" :rules="editRules" size="mini" @submit.native.prevent>
<el-form-item label="地图名称:" prop="mapName"><span>{{ this.map.name }}</span></el-form-item> <el-form-item label="地图名称:" prop="mapName"><span>{{ map.name }}</span></el-form-item>
<el-form-item :label="$t('map.publishingAssociatedCity')" prop="cityCode"> <el-form-item :label="$t('map.publishingAssociatedCity')" prop="cityCode">
<el-select v-model="editModel.cityCode" :placeholder="$t('map.pleaseSelect')"> <el-select v-model="editModel.cityCode" :placeholder="$t('map.pleaseSelect')">
<el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.code" /> <el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.code" />
@ -23,7 +23,7 @@
<script> <script>
import { publishMap3d } from '@/api/jmap/mapdraft'; import { publishMap3d } from '@/api/jmap/mapdraft';
import { checkMapName } from '@/api/jmap/map'; // import { checkMapName } from '@/api/jmap/map';
export default { export default {
name: 'MapPublish3d', name: 'MapPublish3d',
props: { props: {

View File

@ -3,7 +3,7 @@
<div> <div>
<el-form ref="form" label-position="right" :model="editModel" label-width="100px" :rules="editRules" size="mini" @submit.native.prevent> <el-form ref="form" label-position="right" :model="editModel" label-width="100px" :rules="editRules" size="mini" @submit.native.prevent>
<el-form-item :label="$t('map.mapName')" prop="oldName"> <el-form-item :label="$t('map.mapName')" prop="oldName">
<span>{{ this.map.name }}</span> <span>{{ map.name }}</span>
</el-form-item> </el-form-item>
<el-form-item label="另存为:" prop="name"> <el-form-item label="另存为:" prop="name">
<el-input v-model="editModel.name" style="width: 180px;" /> <el-input v-model="editModel.name" style="width: 180px;" />

View File

@ -176,7 +176,14 @@ export default {
prdType = ''; prdType = '';
} }
} }
this.$store.dispatch('training/updateMemberListInScript', {oldMemberId:this.oldMemberId, newMemberId:role, userId:this.$store.state.user.id}); this.$store.dispatch('training/updateMemberListInScript',
{
oldMemberId:this.oldMemberId,
newMemberId:role,
userId:this.$store.state.user.id,
name:this.$store.state.user.nickname
}
);
this.oldMemberId = role; this.oldMemberId = role;
this.$store.dispatch('training/setPrdType', prdType); this.$store.dispatch('training/setPrdType', prdType);
ConstConfig.ConstSelect.roleTypeNew.forEach(each=>{ ConstConfig.ConstSelect.roleTypeNew.forEach(each=>{