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