From 7661d36ca43c3dba4b30797d240437547093ba9c Mon Sep 17 00:00:00 2001
From: fan <18706759286@163.com>
Date: Mon, 27 Jul 2020 15:22:26 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=81=E6=B3=A2=E8=A1=8C=E8=B0=83=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E5=8D=95=E9=94=81&=E8=8E=B7=E5=8F=96=E6=93=8D?=
=?UTF-8?q?=E4=BD=9C=E7=B1=BB=E5=9E=8Bmap=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../theme/ningbo_01/menus/menuSwitch.vue | 19 +++++---
src/scripts/ConstDic.js | 39 ++++++++++++++++
src/utils/baseUrl.js | 4 +-
src/views/exam/detail/examDetail.vue | 38 +---------------
.../lessoncategory/edit/chapter/list.vue | 45 ++-----------------
src/views/lesson/trainingRule/list.vue | 38 +---------------
src/views/lesson/trainingmanage/index.vue | 31 ++-----------
src/views/publish/examRule/draft/rule.vue | 35 +--------------
8 files changed, 65 insertions(+), 184 deletions(-)
diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue
index 4e1c1e2d9..163670045 100644
--- a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue
+++ b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue
@@ -5,7 +5,7 @@
-
+
@@ -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);
}
}
};
diff --git a/src/scripts/ConstDic.js b/src/scripts/ConstDic.js
index 7587e0ee9..ad72ecc77 100644
--- a/src/scripts/ConstDic.js
+++ b/src/scripts/ConstDic.js
@@ -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;
+}
diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js
index 55d352581..778caeb7b 100644
--- a/src/utils/baseUrl.js
+++ b/src/utils/baseUrl.js
@@ -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'; // 杜康
diff --git a/src/views/exam/detail/examDetail.vue b/src/views/exam/detail/examDetail.vue
index 4c96c9524..7f6e959a7 100644
--- a/src/views/exam/detail/examDetail.vue
+++ b/src/views/exam/detail/examDetail.vue
@@ -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 => {
diff --git a/src/views/lesson/lessoncategory/edit/chapter/list.vue b/src/views/lesson/lessoncategory/edit/chapter/list.vue
index 06df1b83f..4e03be9f6 100644
--- a/src/views/lesson/lessoncategory/edit/chapter/list.vue
+++ b/src/views/lesson/lessoncategory/edit/chapter/list.vue
@@ -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);
}
diff --git a/src/views/lesson/trainingRule/list.vue b/src/views/lesson/trainingRule/list.vue
index 1d7fadf88..334a958c4 100644
--- a/src/views/lesson/trainingRule/list.vue
+++ b/src/views/lesson/trainingRule/list.vue
@@ -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});
diff --git a/src/views/lesson/trainingmanage/index.vue b/src/views/lesson/trainingmanage/index.vue
index a9c5143d2..de0dd1a72 100644
--- a/src/views/lesson/trainingmanage/index.vue
+++ b/src/views/lesson/trainingmanage/index.vue
@@ -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();
diff --git a/src/views/publish/examRule/draft/rule.vue b/src/views/publish/examRule/draft/rule.vue
index 6dc0e1b7e..d076d8a49 100644
--- a/src/views/publish/examRule/draft/rule.vue
+++ b/src/views/publish/examRule/draft/rule.vue
@@ -29,11 +29,10 @@