This commit is contained in:
joylink_cuiweidong 2020-07-10 17:33:55 +08:00
commit bf7ae6684e
20 changed files with 101 additions and 1044 deletions

View File

@ -4,16 +4,16 @@ import router from './router/index_APP_TARGET';
import {PermissionParam} from '@/scripts/ProjectConfig';
import NProgress from 'nprogress';
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 localStore from 'storejs';
import { loginInfo } from '@/scripts/ProjectConfig';
function hasPermission(roles, permissionRoles) {
if (roles.indexOf(admin) >= 0) return true;
if (!permissionRoles) return true;
return roles.some(role => permissionRoles.indexOf(role) >= 0);
}
// function hasPermission(roles, permissionRoles) {
// if (roles.indexOf(admin) >= 0) return true;
// if (!permissionRoles) return true;
// return roles.some(role => permissionRoles.indexOf(role) >= 0);
// }
const whiteList = ['/login', '/design/login', '/gzzbxy/relay']; // 不重定向白名单
@ -59,7 +59,8 @@ function getRouteInfo(to) {
}
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 => {
// 根据roles权限生成可访问的路由表
const roles = res.roles;
@ -80,16 +81,16 @@ function handleRoute(to, next, loginPath) {
});
} else {
// 除没有动态改变权限的需求可直接next() 删下方权限判断
if (hasPermission(store.getters.roles, to.meta.roles)) {
// if (hasPermission(store.getters.roles, to.meta.roles)) {
if (to.path === '/404' && to.redirectedFrom === '/') {
const project = getSessionStorage('project');
next(localStore.get('trainingPlatformRoute' + store.getters.id + project) || '/trainingPlatform');
} else {
next();
}
} else {
next({ path: '/401', replace: true, query: { noGoBack: true } });
}
// } 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 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 Dictionary = () => import('@/views/system/dictionary/index');
@ -232,11 +232,6 @@ export const constantRoutes = [
component: Jlmap3dTrain,
hidden: true
},
{
path: '/401',
component: Error401,
hidden: true
},
{ // 竞赛系统报名
path: '/jsxtApply',
component: JsxtApply,
@ -858,11 +853,6 @@ export const asyncRouter = [
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 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 Dictionary = () => import('@/views/system/dictionary/index');
@ -194,12 +194,11 @@ export const constantRoutes = [
component: Jlmap3dTrain,
hidden: true
},
{
path: '/401',
component: Error401,
hidden: true
},
// {
// path: '/401',
// component: Error401,
// hidden: true
// },
{
path: '/404',
component: Errpr404,

View File

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

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) {
this.point = {
x: em.clientX,
y: em.clientY
};
const point = { x: em.clientX, y: em.clientY };
if (!em.deviceType) {
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

@ -92,6 +92,14 @@ import axios from 'axios';
}
},
watch: {
'$store.state.training.memberData':{
handler(val){
if(this.tuoguanbutton == true){
console.log(val);
}
},
deep:true //true
}
},
onLoad(e) {
@ -160,6 +168,7 @@ import axios from 'axios';
posttrust = true;
}
tuoguan3ddrive(this.$route.query.group,posttrust,{}).then(netdata => {
// this.$store.dispatch('training/updateMemberListInScript', {oldMemberId:this.oldMemberId, newMemberId:role, userId:this.userId});
this.tuoguanstatus = posttrust;
if(this.tuoguanstatus){
this.tuoguanbuttonmsg = "取消托管";
@ -167,6 +176,7 @@ import axios from 'axios';
this.tuoguanbuttonmsg = "托管";
}
}).catch((error) => {
});
},
updatetrainlist(){
@ -226,24 +236,47 @@ import axios from 'axios';
});
//
if(this.tuoguanbutton == true){
getSimulationMembersNew(this.group).then(netdata => {
for(let i=0,leni=netdata.data.length;i<leni;i++){
if(netdata.data[i].userId){
if(netdata.data[i].userId == this.userId){
this.userrole = netdata.data[i].role;
if(netdata.data[i].trust){
this.tuoguanstatus = netdata.data[i].trust;
let netdata = this.$store.state.training.memberData;
console.log(netdata);
for(let k in netdata){
if(netdata[k].userId == this.userId){
console.log(this.$store.state.scriptRecord.userRole);
this.userrole = this.$store.state.scriptRecord.userRole;
console.log(netdata[k].trust);
if(netdata[k].trust){
this.tuoguanstatus = netdata[k].trust;
if(this.tuoguanstatus){
this.tuoguanbuttonmsg = "取消托管";
}else{
this.tuoguanbuttonmsg = "托管";
}
}
i=leni;
}
break;
}
}
// getSimulationMembersNew(this.group).then(netdata => {
// for(let i=0,leni=netdata.data.length;i<leni;i++){
// if(netdata.data[i].userId){
// if(netdata.data[i].userId == this.userId){
// this.userrole = netdata.data[i].role;
// if(netdata.data[i].trust){
// this.tuoguanstatus = netdata.data[i].trust;
// if(this.tuoguanstatus){
// this.tuoguanbuttonmsg = "";
// }else{
// this.tuoguanbuttonmsg = "";
// }
// }
// i=leni;
// }
// }
// }
// this.userrole = netdata.data.role;
// if(netdata.data.trust){
// this.tuoguanstatus = netdata.data.trust;
@ -253,7 +286,7 @@ import axios from 'axios';
// this.tuoguanbuttonmsg = "";
// }
// }
});
// });
}
}

View File

@ -21,7 +21,6 @@
@devicemodel="devicemodel"
@showScheduling="showScheduling"
/>
<!-- :training-obj="trainingObj" -->
<menu-lesson
v-if="isLesson"
ref="lessonMenu"

View File

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

View File

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

View File

@ -16,8 +16,6 @@
<div class="buttonList">
<el-button size="small" type="primary" class="eachButton uploadDemo " @click="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 size="small" type="primary" class="eachButton" @click="createMap">{{ $t('map.newConstruction') }}</el-button>
</div>
@ -68,13 +66,6 @@ export default {
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: {
filterText(val) {
this.$refs.tree.filter(val);

View File

@ -2,7 +2,7 @@
<el-dialog v-dialogDrag :title="$t('map.mapPublished')" :visible.sync="dialogShow" width="30%" :before-close="handleClose">
<div>
<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-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" />

View File

@ -2,7 +2,7 @@
<el-dialog v-dialogDrag :title="$t('map.mapPublished')" :visible.sync="dialogShow" width="30%" :before-close="handleClose">
<div>
<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-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" />
@ -23,7 +23,7 @@
<script>
import { publishMap3d } from '@/api/jmap/mapdraft';
import { checkMapName } from '@/api/jmap/map';
// import { checkMapName } from '@/api/jmap/map';
export default {
name: 'MapPublish3d',
props: {

View File

@ -3,7 +3,7 @@
<div>
<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">
<span>{{ this.map.name }}</span>
<span>{{ map.name }}</span>
</el-form-item>
<el-form-item label="另存为:" prop="name">
<el-input v-model="editModel.name" style="width: 180px;" />