宁波行调添加单锁&获取操作类型map调整

This commit is contained in:
fan 2020-07-27 15:22:26 +08:00
parent 8e6d424453
commit 7661d36ca4
8 changed files with 65 additions and 184 deletions

View File

@ -5,7 +5,7 @@
<switch-un-lock ref="switchUnLock" />
<speed-limit-control ref="speedLimitControl" />
<alxe-effective ref="alxeEffective" />
<switch-hook-lock ref="switchHookLock" pop-class="ningbo-01__systerm" />
<switch-hook-lock ref="switchHookLock" pop-class="ningbo-01__systerm" />
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
<set-fault ref="setFault" pop-class="ningbo-01__systerm" />
</div>
@ -36,8 +36,8 @@ export default {
SpeedLimitControl,
AlxeEffective,
NoticeInfo,
SetFault,
SwitchHookLock
SetFault,
SwitchHookLock
},
props: {
selected: {
@ -94,6 +94,11 @@ export default {
handler: this.reverse,
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
},
{
label: '道岔单锁',
handler: this.lock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
},
{
type: 'separator'
},
@ -141,7 +146,7 @@ export default {
handler: this.cancelStoppage,
cmdType: CMD.Fault.CMD_CANCEL_FAULT
},
{
{
label: '道岔钩锁',
handler: this.hookLock
}
@ -296,10 +301,10 @@ export default {
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
}
});
},
//
},
//
hookLock() {
this.$refs.switchHookLock.doShow(this.selected);
this.$refs.switchHookLock.doShow(this.selected);
}
}
};

View File

@ -2327,3 +2327,42 @@ export const UrlConfig = {
questionUpdate: '/design/race/questionUpdate'
}
};
import CMD from './cmdPlugin/CommandEnum';
export function getTrainingOperateTypeMap() {
const trainingOperateTypeMap = {
Switch: [],
Section: [],
Signal: [],
Stand: [],
Station: [],
ControlConvertMenu: [],
TrainWindow: [],
LimitControl: []
};
let val;
for ( val in CMD['Switch']) {
trainingOperateTypeMap['Switch'].push(CMD['Switch'][val]);
}
for ( val in CMD['Section']) {
trainingOperateTypeMap['Section'].push(CMD['Section'][val]);
}
for ( val in CMD['Signal']) {
trainingOperateTypeMap['Signal'].push(CMD['Signal'][val]);
}
for ( val in CMD['Stand']) {
trainingOperateTypeMap['Stand'].push(CMD['Stand'][val]);
}
for ( val in CMD['Station']) {
trainingOperateTypeMap['Station'].push(CMD['Station'][val]);
}
for ( val in CMD['LimitControl']) {
trainingOperateTypeMap['LimitControl'].push(CMD['LimitControl'][val]);
}
for ( val in CMD['ControlConvertMenu']) {
trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][val]);
}
for ( val in CMD['Train']) {
trainingOperateTypeMap['TrainWindow'].push(CMD['Train'][val]);
}
return trainingOperateTypeMap;
}

View File

@ -2,10 +2,10 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -61,7 +61,7 @@ import { UrlConfig } from '@/scripts/ConstDic';
import LangStorage from '@/utils/lang';
import { getPublishMapInfo } from '@/api/jmap/map';
import ConstConfig from '@/scripts/ConstConfig';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { getTrainingOperateTypeMap } from '@/scripts/ConstDic';
export default {
name: 'ExamDetailView',
@ -107,41 +107,7 @@ export default {
for (const val in ConstConfig.ConstSelect.trainingDeviceType) {
this.typeList.push({name: LangStorage.getLang() == 'en' ? ConstConfig.ConstSelect.trainingDeviceType[val].enlabel : ConstConfig.ConstSelect.trainingDeviceType[val].label, code: val});
}
this.trainingOperateTypeMap = {
Switch: [],
Section: [],
Signal: [],
Stand: [],
Station: [],
ControlConvertMenu: [],
TrainWindow: [],
LimitControl: []
};
let ele;
for ( ele in CMD['Switch']) {
this.trainingOperateTypeMap['Switch'].push(CMD['Switch'][ele]);
}
for ( ele in CMD['Section']) {
this.trainingOperateTypeMap['Section'].push(CMD['Section'][ele]);
}
for ( ele in CMD['Signal']) {
this.trainingOperateTypeMap['Signal'].push(CMD['Signal'][ele]);
}
for ( ele in CMD['Stand']) {
this.trainingOperateTypeMap['Stand'].push(CMD['Stand'][ele]);
}
for ( ele in CMD['Station']) {
this.trainingOperateTypeMap['Station'].push(CMD['Station'][ele]);
}
for ( ele in CMD['LimitControl']) {
this.trainingOperateTypeMap['LimitControl'].push(CMD['LimitControl'][ele]);
}
for ( ele in CMD['ControlConvertMenu']) {
this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][ele]);
}
for ( ele in CMD['Train']) {
this.trainingOperateTypeMap['TrainWindow'].push(CMD['Train'][ele]);
}
this.trainingOperateTypeMap = getTrainingOperateTypeMap();
} else {
this.trainingOperateTypeMap = {};
this.$Dictionary.stationControl().then(list => {

View File

@ -18,8 +18,8 @@ import Cookies from 'js-cookie';
import { pageQueryTraining, pageQueryTrainingNew } from '@/api/jmap/training';
import { getPublishMapListOnline } from '@/api/jmap/map';
import localStore from 'storejs';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { getCmdList } from '@/api/management/dictionary';
import { getTrainingOperateTypeMap } from '@/scripts/ConstDic';
export default {
name: 'TrainList',
@ -181,46 +181,7 @@ export default {
this.mapIdList = response.data;
});
if (this.$route.query.drawWay + '' === 'true') {
this.trainingOperateTypeMap = {
Switch: [],
Section: [],
Signal: [],
Stand: [],
Station: [],
ControlConvertMenu: [],
TrainWindow: [],
LimitControl: []
};
let val;
for ( val in CMD['Switch']) {
this.trainingOperateTypeMap['Switch'].push(CMD['Switch'][val]);
}
for ( val in CMD['Section']) {
this.trainingOperateTypeMap['Section'].push(CMD['Section'][val]);
}
for ( val in CMD['Signal']) {
this.trainingOperateTypeMap['Signal'].push(CMD['Signal'][val]);
}
for ( val in CMD['Stand']) {
this.trainingOperateTypeMap['Stand'].push(CMD['Stand'][val]);
}
for ( val in CMD['Station']) {
this.trainingOperateTypeMap['Station'].push(CMD['Station'][val]);
}
for ( val in CMD['LimitControl']) {
this.trainingOperateTypeMap['LimitControl'].push(CMD['LimitControl'][val]);
}
for ( val in CMD['ControlConvertMenu']) {
this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][val]);
}
for ( val in CMD['Train']) {
this.trainingOperateTypeMap['TrainWindow'].push(CMD['Train'][val]);
}
// const trainingDeviceTypeList = ConstConfig.ConstSelect.trainingDeviceType || {};
// for (val in trainingDeviceTypeList) {
// this.trainingTypeList.push({code: val, name: Cookies.get('user_lang') == 'en' ? trainingDeviceTypeList[val].enlabel : trainingDeviceTypeList[val].label});
// this.queryForm.queryObject.type.config.data.push({value: val, label: Cookies.get('user_lang') == 'en' ? trainingDeviceTypeList[val].enlabel : trainingDeviceTypeList[val].label});
// }
this.trainingOperateTypeMap = getTrainingOperateTypeMap();
const lineCode = this.$route.query.lineCode;
const res = await getCmdList(lineCode, {});
const trainingOperateList = [];
@ -237,7 +198,7 @@ export default {
};
if (res && res.code === 200) {
res.data.forEach(item => {
this.trainingOperateTypeMap[item.operateObject].forEach(ele => {
(this.trainingOperateTypeMap[item.operateObject] || []).forEach(ele => {
if (ele.value == item.operate && !operateTypeMap[item.operateObject].includes(ele)) {
operateTypeMap[item.operateObject].push(ele);
}

View File

@ -22,7 +22,7 @@ import {
import TrainingEdit from './addEdit';
import AddBatch from './addBatch';
import SaveAs from './saveAs.vue';
import { UrlConfig } from '@/scripts/ConstDic';
import { UrlConfig, getTrainingOperateTypeMap } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
@ -151,7 +151,6 @@ export default {
actions: [
{ text: this.$t('global.add'), handler: this.handleAdd },
{ text: this.$t('lesson.generation'), handler: this.handleBatchAdd}
// { text: this.$t('lesson.copy'), handler: this.handleSaveAs }
]
},
currentModel: {}
@ -163,41 +162,8 @@ export default {
methods: {
init() {
if (this.$route.query.drawWay + '' === 'true') {
this.trainingOperateTypeMap = {
Switch: [],
Section: [],
Signal: [],
Stand: [],
Station: [],
ControlConvertMenu: [],
TrainWindow: [],
LimitControl: []
};
this.trainingOperateTypeMap = getTrainingOperateTypeMap();
let val;
for ( val in CMD['Switch']) {
this.trainingOperateTypeMap['Switch'].push(CMD['Switch'][val]);
}
for ( val in CMD['Section']) {
this.trainingOperateTypeMap['Section'].push(CMD['Section'][val]);
}
for ( val in CMD['Signal']) {
this.trainingOperateTypeMap['Signal'].push(CMD['Signal'][val]);
}
for ( val in CMD['Stand']) {
this.trainingOperateTypeMap['Stand'].push(CMD['Stand'][val]);
}
for ( val in CMD['Station']) {
this.trainingOperateTypeMap['Station'].push(CMD['Station'][val]);
}
for ( val in CMD['ControlConvertMenu']) {
this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][val]);
}
for ( val in CMD['LimitControl']) {
this.trainingOperateTypeMap['LimitControl'].push(CMD['LimitControl'][ele]);
}
for ( val in CMD['Train']) {
this.trainingOperateTypeMap['TrainWindow'].push(CMD['Train'][val]);
}
const trainingDeviceTypeList = ConstConfig.ConstSelect.trainingDeviceType || {};
for (val in trainingDeviceTypeList) {
this.trainingTypeList.push({code: val, name: Cookies.get('user_lang') == 'en' ? trainingDeviceTypeList[val].enlabel : trainingDeviceTypeList[val].label});

View File

@ -17,9 +17,8 @@ import { trainingNotify, trainingNotifyNew } from '@/api/simulation';
import { launchFullscreen } from '@/utils/screen';
import { getPublishMapListOnline } from '@/api/jmap/map';
import { getCmdList } from '@/api/management/dictionary';
import { UrlConfig } from '@/scripts/ConstDic';
import { UrlConfig, getTrainingOperateTypeMap } from '@/scripts/ConstDic';
import localStore from 'storejs';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'TrainingGeneration',
@ -170,33 +169,9 @@ export default {
this.mapIdList = response.data;
});
this.queryForm.queryObject.prdType.config.data = this.prdTypeList;
this.trainingOperateTypeMap = getTrainingOperateTypeMap();
//
let val;
for ( val in CMD['Switch']) {
this.trainingOperateTypeMap['Switch'].push(CMD['Switch'][val]);
}
for ( val in CMD['Section']) {
this.trainingOperateTypeMap['Section'].push(CMD['Section'][val]);
}
for ( val in CMD['Signal']) {
this.trainingOperateTypeMap['Signal'].push(CMD['Signal'][val]);
}
for ( val in CMD['Stand']) {
this.trainingOperateTypeMap['Stand'].push(CMD['Stand'][val]);
}
for ( val in CMD['Station']) {
this.trainingOperateTypeMap['Station'].push(CMD['Station'][val]);
}
for ( val in CMD['ControlConvertMenu']) {
this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][val]);
}
for ( val in CMD['LimitControl']) {
this.trainingOperateTypeMap['LimitControl'].push(CMD['LimitControl'][val]);
}
for ( val in CMD['Train']) {
this.trainingOperateTypeMap['TrainWindow'].push(CMD['Train'][val]);
}
await this.prdChoose(queryData);
this.reloadTable();

View File

@ -29,11 +29,10 @@
<script>
import { getExamLessonDetail, setCourseList, setCourseListGzb } from '@/api/management/exam';
import { getDetailList } from '@/api/management/dictionary';
import { UrlConfig } from '@/scripts/ConstDic';
import { UrlConfig, getTrainingOperateTypeMap } from '@/scripts/ConstDic';
import editRule from './editRule';
import LangStorage from '@/utils/lang';
import ConstConfig from '@/scripts/ConstConfig';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { getSessionStorage } from '@/utils/auth';
export default {
@ -89,37 +88,7 @@ export default {
},
async mounted() {
if (this.drawWay) {
this.trainingOperateTypeMap = {
Switch: [],
Section: [],
Signal: [],
Stand: [],
Station: [],
ControlConvertMenu: [],
TrainWindow: []
};
let ele;
for ( ele in CMD['Switch']) {
this.trainingOperateTypeMap['Switch'].push(CMD['Switch'][ele]);
}
for ( ele in CMD['Section']) {
this.trainingOperateTypeMap['Section'].push(CMD['Section'][ele]);
}
for ( ele in CMD['Signal']) {
this.trainingOperateTypeMap['Signal'].push(CMD['Signal'][ele]);
}
for ( ele in CMD['Stand']) {
this.trainingOperateTypeMap['Stand'].push(CMD['Stand'][ele]);
}
for ( ele in CMD['Station']) {
this.trainingOperateTypeMap['Station'].push(CMD['Station'][ele]);
}
for ( ele in CMD['ControlConvertMenu']) {
this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][ele]);
}
for ( ele in CMD['Train']) {
this.trainingOperateTypeMap['TrainWindow'].push(CMD['Train'][ele]);
}
this.trainingOperateTypeMap = getTrainingOperateTypeMap();
} else {
this.trainingOperateTypeMap = {};
this.$Dictionary.stationControl().then(list => {