代码调整
This commit is contained in:
parent
fee759e83b
commit
d0421ff9fe
@ -159,7 +159,7 @@ export default {
|
|||||||
const deviceList = [];
|
const deviceList = [];
|
||||||
|
|
||||||
// 信号机
|
// 信号机
|
||||||
let nameShow = this.nameLevels.indexOf(1) !== -1;
|
let nameShow = this.nameLevels.includes(1);
|
||||||
const signalList = this.$store.getters['map/signalList'];
|
const signalList = this.$store.getters['map/signalList'];
|
||||||
if (signalList && signalList.length > 0) {
|
if (signalList && signalList.length > 0) {
|
||||||
signalList.forEach(elem => {
|
signalList.forEach(elem => {
|
||||||
@ -168,11 +168,11 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 按钮名称
|
// 按钮名称
|
||||||
nameShow = this.nameLevels.indexOf(3) !== -1;
|
nameShow = this.nameLevels.includes(3);
|
||||||
|
|
||||||
// 道岔
|
// 道岔
|
||||||
nameShow = this.nameLevels.indexOf(7) !== -1; // 道岔名称
|
nameShow = this.nameLevels.includes(7); // 道岔名称
|
||||||
const switchSectionNameShow = this.nameLevels.indexOf(9) !== -1; // 道岔轨名称
|
const switchSectionNameShow = this.nameLevels.includes(9); // 道岔轨名称
|
||||||
const switchList = this.$store.getters['map/switchList'];
|
const switchList = this.$store.getters['map/switchList'];
|
||||||
if (switchList && switchList.length > 0) {
|
if (switchList && switchList.length > 0) {
|
||||||
switchList.forEach(elem => {
|
switchList.forEach(elem => {
|
||||||
@ -181,7 +181,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 控制模式
|
// 控制模式
|
||||||
const indicatorShow = this.nameLevels.indexOf(8) !== -1;
|
const indicatorShow = this.nameLevels.includes(8);
|
||||||
const control = this.$store.getters['map/stationControlList'];
|
const control = this.$store.getters['map/stationControlList'];
|
||||||
if (control && control.length > 0) {
|
if (control && control.length > 0) {
|
||||||
control.forEach(elem => {
|
control.forEach(elem => {
|
||||||
@ -204,28 +204,28 @@ export default {
|
|||||||
nameShow = false;
|
nameShow = false;
|
||||||
} else if (elem.type === '01') {
|
} else if (elem.type === '01') {
|
||||||
// 计轴区段名称
|
// 计轴区段名称
|
||||||
nameShow = this.nameLevels.indexOf(11) !== -1;
|
nameShow = this.nameLevels.includes(11);
|
||||||
} else if (elem.type === '02') {
|
} else if (elem.type === '02') {
|
||||||
// 轨道轨名称
|
// 轨道轨名称
|
||||||
nameShow = this.nameLevels.indexOf(5) !== -1;
|
nameShow = this.nameLevels.includes(5);
|
||||||
} else if (elem.type === '04') {
|
} else if (elem.type === '04') {
|
||||||
// 道岔区段名称
|
// 道岔区段名称
|
||||||
nameShow = this.nameLevels.indexOf(9) !== -1;
|
nameShow = this.nameLevels.includes(9);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 站台轨名称
|
// 站台轨名称
|
||||||
if (elem.standTrack) {
|
if (elem.standTrack) {
|
||||||
standTrackNameShow = this.nameLevels.indexOf(2) !== -1;
|
standTrackNameShow = this.nameLevels.includes(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 折返轨名称
|
// 折返轨名称
|
||||||
if (elem.reentryTrack) {
|
if (elem.reentryTrack) {
|
||||||
reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1;
|
reentryTrackNameShow = this.nameLevels.includes(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转换轨名称
|
// 转换轨名称
|
||||||
if (elem.transferTrack) {
|
if (elem.transferTrack) {
|
||||||
transferTrackNameShow = this.nameLevels.indexOf(6) !== -1;
|
transferTrackNameShow = this.nameLevels.includes(6);
|
||||||
}
|
}
|
||||||
|
|
||||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
|
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
|
||||||
@ -233,7 +233,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 停车点
|
// 停车点
|
||||||
const destCodeShow = this.nameLevels.indexOf(10) !== -1;
|
const destCodeShow = this.nameLevels.includes(10);
|
||||||
const stopPointList = this.$store.getters['map/stopPointList'];
|
const stopPointList = this.$store.getters['map/stopPointList'];
|
||||||
if (stopPointList && stopPointList.length > 0) {
|
if (stopPointList && stopPointList.length > 0) {
|
||||||
stopPointList.forEach(elem => {
|
stopPointList.forEach(elem => {
|
||||||
@ -242,7 +242,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 车站
|
// 车站
|
||||||
const kmPostShow = this.nameLevels.indexOf(12) !== -1;
|
const kmPostShow = this.nameLevels.includes(12);
|
||||||
const stationList = this.$store.getters['map/stationList'];
|
const stationList = this.$store.getters['map/stationList'];
|
||||||
if (stationList && stationList.length > 0) {
|
if (stationList && stationList.length > 0) {
|
||||||
stationList.forEach(elem => {
|
stationList.forEach(elem => {
|
||||||
|
@ -158,8 +158,8 @@ export default {
|
|||||||
],
|
],
|
||||||
actions: [
|
actions: [
|
||||||
{ text: '地图排序', handler: this.mapSort },
|
{ text: '地图排序', handler: this.mapSort },
|
||||||
{ text: '导出', handler: this.localExport, show: () => { return this.$store.state.user.roles.indexOf(superAdmin) > 0; }},
|
{ text: '导出', handler: this.localExport, show: () => { return this.$store.state.user.roles.includes(superAdmin); }},
|
||||||
{ text: '导入', handler: this.localImport, fileType: 'file', show: () => { return this.$store.state.user.roles.indexOf(superAdmin) > 0; }}
|
{ text: '导入', handler: this.localImport, fileType: 'file', show: () => { return this.$store.state.user.roles.includes(superAdmin); }}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ export default {
|
|||||||
type: 'button',
|
type: 'button',
|
||||||
title: this.$t('global.operate'),
|
title: this.$t('global.operate'),
|
||||||
width: '450',
|
width: '450',
|
||||||
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
|
hide: () => { return !this.$store.state.user.roles.includes(superAdmin); },
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: this.$t('global.preview'),
|
name: this.$t('global.preview'),
|
||||||
|
@ -66,7 +66,7 @@ export default {
|
|||||||
type: 'button',
|
type: 'button',
|
||||||
title: this.$t('global.operate'),
|
title: this.$t('global.operate'),
|
||||||
width: '250',
|
width: '250',
|
||||||
hide: (row) => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
|
hide: (row) => { return !this.$store.state.user.roles.includes(superAdmin); },
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: this.$t('global.preview'),
|
name: this.$t('global.preview'),
|
||||||
|
@ -66,7 +66,7 @@ export default {
|
|||||||
type: 'button',
|
type: 'button',
|
||||||
title: this.$t('global.operate'),
|
title: this.$t('global.operate'),
|
||||||
width: '550',
|
width: '550',
|
||||||
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
|
hide: () => { return !this.$store.state.user.roles.includes(superAdmin); },
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: this.$t('publish.generateRunPlan'),
|
name: this.$t('publish.generateRunPlan'),
|
||||||
|
@ -80,7 +80,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
filterNode(value, data) {
|
filterNode(value, data) {
|
||||||
return data.label.indexOf(value) !== -1;
|
return data.label.includes(value);
|
||||||
},
|
},
|
||||||
changeRole(member) {
|
changeRole(member) {
|
||||||
if (member) {
|
if (member) {
|
||||||
|
@ -249,7 +249,7 @@ export default {
|
|||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
covertButtonname() {
|
covertButtonname() {
|
||||||
if (this.$store.getters.roles.indexOf(admin) >= 0 || this.$store.getters.roles.indexOf(superAdmin) >= 0) {
|
if (this.$store.getters.roles.includes(admin) || this.$store.getters.roles.includes(superAdmin)) {
|
||||||
return this.$t('scriptRecord.publish');
|
return this.$t('scriptRecord.publish');
|
||||||
} else {
|
} else {
|
||||||
return this.$t('scriptRecord.applyPublish');
|
return this.$t('scriptRecord.applyPublish');
|
||||||
|
@ -178,7 +178,7 @@ export default {
|
|||||||
},
|
},
|
||||||
filterNode(value, data) {
|
filterNode(value, data) {
|
||||||
if (!value) return true;
|
if (!value) return true;
|
||||||
return data.name.indexOf(value) !== -1;
|
return data.name.includes(value);
|
||||||
},
|
},
|
||||||
buy() {
|
buy() {
|
||||||
// this.disabled = true;
|
// this.disabled = true;
|
||||||
|
@ -95,7 +95,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
filterNode(value, data) {
|
filterNode(value, data) {
|
||||||
if (!value) return true;
|
if (!value) return true;
|
||||||
return data.name.indexOf(value) !== -1;
|
return data.name.includes(value);
|
||||||
},
|
},
|
||||||
showContextMenu(e, obj, node, vueElem) {
|
showContextMenu(e, obj, node, vueElem) {
|
||||||
if (obj) {
|
if (obj) {
|
||||||
|
Loading…
Reference in New Issue
Block a user