From f13ba95407c1decb13e5bc8bbe3633f219d99da0 Mon Sep 17 00:00:00 2001
From: fan <18706759286@163.com>
Date: Tue, 28 Jul 2020 18:28:31 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E5=AE=81=E6=B3=A2=E8=8F=9C=E5=8D=95?=
=?UTF-8?q?=E5=9B=9E=E8=BD=A6=E5=BF=AB=E6=8D=B7=E9=94=AE=EF=BC=88=E5=8C=BA?=
=?UTF-8?q?=E6=AE=B5=E3=80=81=E4=BF=A1=E5=8F=B7=E6=9C=BA=E3=80=81=E8=BD=A6?=
=?UTF-8?q?=E7=AB=99=EF=BC=89&=E8=AE=BE=E5=A4=87=E7=99=BB=E5=BD=95?=
=?UTF-8?q?=E7=BB=BC=E5=90=88=E6=BC=94=E7=BB=83=E4=B8=8D=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?cctv=E8=A7=86=E5=9B=BE=E8=AE=BE=E5=A4=87=E8=A7=86=E5=9B=BE?=
=?UTF-8?q?=E4=B8=89=E7=BB=B4=E8=A7=86=E5=9B=BE&=E4=BC=9A=E8=AF=9D?=
=?UTF-8?q?=E5=88=87=E6=8D=A2=E5=85=AC=E5=85=B1=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/menus/dialog/routeControl.vue | 7 ++
.../components/menus/dialog/routeDetail.vue | 7 ++
.../menus/dialog/routeHandControl.vue | 5 ++
.../menus/dialog/stationCmdControl.vue | 11 ++++
.../menus/dialog/stationHumanControlAll.vue | 7 ++
.../dialog/stationSetRouteControlAll.vue | 7 ++
.../ningbo_01/menus/dialog/alxeEffective.vue | 9 +++
.../ningbo_01/menus/dialog/routeSelection.vue | 7 ++
.../ningbo_01/menus/dialog/routeUnLock.vue | 12 ++++
.../ningbo_01/menus/dialog/routerCommand.vue | 7 ++
.../menus/dialog/speedLimitControl.vue | 13 ++++
src/store/modules/map.js | 2 +-
.../jointTrainingNew/chatView/chatBox.vue | 65 ++++++++++++-------
.../newMap/jointTrainingNew/menuDemon.vue | 38 +++++------
14 files changed, 155 insertions(+), 42 deletions(-)
diff --git a/src/jmapNew/theme/components/menus/dialog/routeControl.vue b/src/jmapNew/theme/components/menus/dialog/routeControl.vue
index 511fe02e6..70ba9d83e 100644
--- a/src/jmapNew/theme/components/menus/dialog/routeControl.vue
+++ b/src/jmapNew/theme/components/menus/dialog/routeControl.vue
@@ -110,6 +110,13 @@ export default {
return '';
}
},
+ watch: {
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.show && this.popClass === 'ningbo-01__systerm') {
+ this.commit();
+ }
+ }
+ },
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
diff --git a/src/jmapNew/theme/components/menus/dialog/routeDetail.vue b/src/jmapNew/theme/components/menus/dialog/routeDetail.vue
index 2e4108377..59dbc82af 100644
--- a/src/jmapNew/theme/components/menus/dialog/routeDetail.vue
+++ b/src/jmapNew/theme/components/menus/dialog/routeDetail.vue
@@ -103,6 +103,13 @@ export default {
return '查询进路状态';
}
},
+ watch: {
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.show && this.systemName === 'ningbo-01__systerm') {
+ this.commit();
+ }
+ }
+ },
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
diff --git a/src/jmapNew/theme/components/menus/dialog/routeHandControl.vue b/src/jmapNew/theme/components/menus/dialog/routeHandControl.vue
index 04ff39def..825d9aa77 100644
--- a/src/jmapNew/theme/components/menus/dialog/routeHandControl.vue
+++ b/src/jmapNew/theme/components/menus/dialog/routeHandControl.vue
@@ -146,6 +146,11 @@ export default {
}
},
watch: {
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.show && this.systemName === 'ningbo-01__systerm' && !this.commitDisabled) {
+ this.commit();
+ }
+ }
},
mounted() {
this.$nextTick(() => {
diff --git a/src/jmapNew/theme/components/menus/dialog/stationCmdControl.vue b/src/jmapNew/theme/components/menus/dialog/stationCmdControl.vue
index 520c42e2c..592ad293e 100644
--- a/src/jmapNew/theme/components/menus/dialog/stationCmdControl.vue
+++ b/src/jmapNew/theme/components/menus/dialog/stationCmdControl.vue
@@ -194,6 +194,17 @@ export default {
});
},
deep: true
+ },
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.show && this.popClass === 'ningbo-01__systerm') {
+ if (!this.cmdDisabled[0]) {
+ this.command();
+ } else if (!this.cmdDisabled[1]) {
+ this.confirm1();
+ } else if (!this.cmdDisabled[2]) {
+ this.confirm2();
+ }
+ }
}
},
mounted() {
diff --git a/src/jmapNew/theme/components/menus/dialog/stationHumanControlAll.vue b/src/jmapNew/theme/components/menus/dialog/stationHumanControlAll.vue
index 973efd221..33bb492c3 100644
--- a/src/jmapNew/theme/components/menus/dialog/stationHumanControlAll.vue
+++ b/src/jmapNew/theme/components/menus/dialog/stationHumanControlAll.vue
@@ -64,6 +64,13 @@ export default {
return this.dialogShow ? OperationEvent.Station.humanControlALL.menu.domId : '';
}
},
+ watch: {
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.show && this.popClass === 'ningbo-01__systerm') {
+ this.commit();
+ }
+ }
+ },
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
diff --git a/src/jmapNew/theme/components/menus/dialog/stationSetRouteControlAll.vue b/src/jmapNew/theme/components/menus/dialog/stationSetRouteControlAll.vue
index d2715738e..600f50494 100644
--- a/src/jmapNew/theme/components/menus/dialog/stationSetRouteControlAll.vue
+++ b/src/jmapNew/theme/components/menus/dialog/stationSetRouteControlAll.vue
@@ -78,6 +78,13 @@ export default {
return this.dialogShow ? OperationEvent.Station.atsAutoControlALL.menu.domId : '';
}
},
+ watch: {
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.show && this.popClass === 'ningbo-01__systerm') {
+ this.commit();
+ }
+ }
+ },
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/alxeEffective.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/alxeEffective.vue
index 37e5e560b..662516d7b 100644
--- a/src/jmapNew/theme/ningbo_01/menus/dialog/alxeEffective.vue
+++ b/src/jmapNew/theme/ningbo_01/menus/dialog/alxeEffective.vue
@@ -183,6 +183,15 @@ export default {
}
},
watch: {
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.show) {
+ if (this.type !== 'password') {
+ this.commitOnce();
+ } else if (this.type !== 'text') {
+ this.commit();
+ }
+ }
+ }
},
mounted() {
this.$nextTick(() => {
diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue
index 4a8051f6c..d27e84ecc 100644
--- a/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue
+++ b/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue
@@ -90,6 +90,13 @@ export default {
return disabled;
}
},
+ watch: {
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.show && !this.commitDisabled) {
+ this.commit();
+ }
+ }
+ },
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/routeUnLock.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/routeUnLock.vue
index 671e435e6..bcaaf80ab 100644
--- a/src/jmapNew/theme/ningbo_01/menus/dialog/routeUnLock.vue
+++ b/src/jmapNew/theme/ningbo_01/menus/dialog/routeUnLock.vue
@@ -109,6 +109,18 @@ export default {
return '解除封锁';
}
},
+ watch: {
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.show) {
+ if (!this.disabledConfirm1) {
+ this.confirm1();
+ } else if (!this.disabledConfirm2) {
+ this.confirm2();
+ }
+
+ }
+ }
+ },
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/routerCommand.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/routerCommand.vue
index 96aebeafd..476a1f37e 100644
--- a/src/jmapNew/theme/ningbo_01/menus/dialog/routerCommand.vue
+++ b/src/jmapNew/theme/ningbo_01/menus/dialog/routerCommand.vue
@@ -70,6 +70,13 @@ export default {
return '';
}
},
+ watch: {
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.show) {
+ this.commit();
+ }
+ }
+ },
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/speedLimitControl.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/speedLimitControl.vue
index e7e79298c..e22db3748 100644
--- a/src/jmapNew/theme/ningbo_01/menus/dialog/speedLimitControl.vue
+++ b/src/jmapNew/theme/ningbo_01/menus/dialog/speedLimitControl.vue
@@ -265,6 +265,19 @@ export default {
},
'speed': function (val) {
if (val) this.cmdDisabled[0] = false;
+ },
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.show) {
+ if (this.$refs.confirmControlSpeed.show) {
+ this.$refs.confirmControlSpeed.commit();
+ } else if (!this.cmdDisabled[0]) {
+ this.command();
+ } else if (!this.cmdDisabled[1]) {
+ this.confirm1();
+ } else if (!this.cmdDisabled[2]) {
+ this.confirm2();
+ }
+ }
}
},
mounted() {
diff --git a/src/store/modules/map.js b/src/store/modules/map.js
index 14f8ffc7c..ad3952002 100644
--- a/src/store/modules/map.js
+++ b/src/store/modules/map.js
@@ -874,7 +874,7 @@ const map = {
};
},
setKeyboardEnter: (state) => {
- state.keyboardEnterCount++;
+ state.keyboardEnterCount++;
}
},
diff --git a/src/views/newMap/jointTrainingNew/chatView/chatBox.vue b/src/views/newMap/jointTrainingNew/chatView/chatBox.vue
index 917b3375a..57d183457 100644
--- a/src/views/newMap/jointTrainingNew/chatView/chatBox.vue
+++ b/src/views/newMap/jointTrainingNew/chatView/chatBox.vue
@@ -15,6 +15,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -50,6 +59,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -205,7 +226,7 @@ export default {
});
},
'$store.state.socket.createConversition':function(val) {
- const member = this.memberData[val.creatorId];
+ const member = this.memberData[val.creatorId];
if (member && member.userId == this.$store.state.user.id) {
const memberList = [];
val.memberIds.forEach(id=>{
@@ -369,23 +390,23 @@ export default {
this.form = data;
},
createCoversition() {
- if (this.memberIdList.length) {
- this.createLoading = true;
- startConversition(this.group, this.memberIdList).then(resp => {
- this.conversitionId = resp.data.id;
- this.messageList = [];
- this.privateMessageList = [];
- this.userString = '';
- this.isConversitionCreator = true;
- this.$message.success('创建会话成功!');
- this.createLoading = false;
- }).catch((error) => {
- this.$message.error(error.code == '3005' ? '创建会话失败:仿真会话成员忙线中!' : '创建仿真失败!');
- this.createLoading = false;
- });
- } else {
- this.userString = '群聊列表为空, 请选择人员';
- }
+ if (this.memberIdList.length) {
+ this.createLoading = true;
+ startConversition(this.group, this.memberIdList).then(resp => {
+ this.conversitionId = resp.data.id;
+ this.messageList = [];
+ this.privateMessageList = [];
+ this.userString = '';
+ this.isConversitionCreator = true;
+ this.$message.success('创建会话成功!');
+ this.createLoading = false;
+ }).catch((error) => {
+ this.$message.error(error.code == '3005' ? '创建会话失败:仿真会话成员忙线中!' : '创建仿真失败!');
+ this.createLoading = false;
+ });
+ } else {
+ this.userString = '群聊列表为空, 请选择人员';
+ }
},
// 语音录制开始
startRecording() {
diff --git a/src/views/newMap/jointTrainingNew/menuDemon.vue b/src/views/newMap/jointTrainingNew/menuDemon.vue
index 3346f471a..502e021c9 100644
--- a/src/views/newMap/jointTrainingNew/menuDemon.vue
+++ b/src/views/newMap/jointTrainingNew/menuDemon.vue
@@ -7,11 +7,11 @@
成员管理
生成二维码
-
+
{{ $t('display.demon.passengerflow') }}
-
+
{{ jl3dname }}
-
+
{{ $t('display.demon.deviceView') }}
@@ -98,27 +98,27 @@ export default {
chatShow: true,
jsStart: true,
isGoback: false,
- noQrcodeList: NoQrcodeList,
- isShow3dmodel :false,
- jl3dname: this.$t('display.demon.threeDimensionalView'),
+ noQrcodeList: NoQrcodeList,
+ isShow3dmodel :false,
+ jl3dname: this.$t('display.demon.threeDimensionalView')
};
},
computed: {
lineCode() {
return this.$route.query.lineCode;
- },
- isShowScheduling() {
- // 行调与管理员 可显示
- return this.$store.state.training.prdType == '02' || this.$store.state.training.prdType == '';
+ },
+ isShowScheduling() {
+ // 行调与管理员 可显示
+ return (this.$store.state.training.prdType == '02' || this.$store.state.training.prdType == '') && !this.$route.query.projectDevice;
},
isSpeaking() {
return this.userRole != 'DRIVER' && this.userRole != '';
},
isStationSupervisor() {
- return this.userRole == 'STATION_SUPERVISOR';
+ return this.userRole == 'STATION_SUPERVISOR' && !this.$route.query.projectDevice;
},
isDriver() {
- return this.userRole == 'DRIVER';
+ return this.userRole == 'DRIVER' && !this.$route.query.projectDevice;
},
project() {
return getSessionStorage('project');
@@ -156,7 +156,7 @@ export default {
}
},
async mounted() {
- this.change3dname();
+ this.change3dname();
},
beforeDestroy() {
this.$store.dispatch('training/setGroup', '');
@@ -303,11 +303,11 @@ export default {
},
jlmap3dcctv() {
this.$emit('hidejl3dcctv');
- },
- jumpjl3dpassflow() {
+ },
+ jumpjl3dpassflow() {
this.$emit('passflow');
- },
- jumpjlmap3dmodel() {
+ },
+ jumpjlmap3dmodel() {
this.$emit('devicemodel');
},
startCompetition() {
@@ -361,8 +361,8 @@ export default {
}).catch(() => {
this.$messageBox('仿真生成二维码失败!');
});
- },
- change3dname() {
+ },
+ change3dname() {
if (this.$route.query.prdType == '04') {
this.jl3dname = this.$t('display.demon.driverPerspective'); // 司机视角
} else {
From 9cc57c0a44473891bad7e4e4b9a74e28207f6039 Mon Sep 17 00:00:00 2001
From: joylink_cuiweidong <364937672@qq.com>
Date: Tue, 28 Jul 2020 18:29:56 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E5=AE=81=E6=B3=A2=E4=B8=80=E5=8F=B7?=
=?UTF-8?q?=E7=BA=BF=20=E9=94=AE=E7=9B=98=E6=93=8D=E4=BD=9C=E8=B0=83?=
=?UTF-8?q?=E6=95=B4=EF=BC=88=E5=9B=9E=E8=BD=A6=E4=BA=8B=E4=BB=B6=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/menus/dialog/setFault.vue | 7 ++
.../menus/dialog/trainSpeedLimit.vue | 111 +++++++++++-------
.../theme/haerbin_01/menus/menuBar.vue | 2 +-
.../ningbo_01/menus/dialog/trainSetHead.vue | 22 ++++
.../ningbo_01/menus/dialog/trainSetPlan.vue | 23 +++-
.../ningbo_01/menus/dialog/trainSetWork.vue | 7 ++
.../theme/ningbo_01/menus/menuTrain.vue | 58 ++++-----
7 files changed, 156 insertions(+), 74 deletions(-)
diff --git a/src/jmapNew/theme/components/menus/dialog/setFault.vue b/src/jmapNew/theme/components/menus/dialog/setFault.vue
index f23a68eed..0bdb2fb57 100644
--- a/src/jmapNew/theme/components/menus/dialog/setFault.vue
+++ b/src/jmapNew/theme/components/menus/dialog/setFault.vue
@@ -89,6 +89,13 @@ export default {
return '';
}
},
+ watch:{
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.dialogShow && this.popClass === 'ningbo-01__systerm') {
+ this.commit();
+ }
+ }
+ },
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
diff --git a/src/jmapNew/theme/components/menus/dialog/trainSpeedLimit.vue b/src/jmapNew/theme/components/menus/dialog/trainSpeedLimit.vue
index d773e5296..cdb5ced6d 100644
--- a/src/jmapNew/theme/components/menus/dialog/trainSpeedLimit.vue
+++ b/src/jmapNew/theme/components/menus/dialog/trainSpeedLimit.vue
@@ -11,10 +11,12 @@
:modal="false"
:close-on-click-modal="false"
>
-
+
+
@@ -50,23 +52,18 @@ export default {
},
data() {
return {
- selected: {},
+ selected: {},
addModel: {
speedLimit: '' // 限速值
},
- rules: {
- speedLimit: [
- { required: true, message: '请输入限速值', trigger: 'blur' },
- { validator: this.validateLimit, trigger: 'blur' }
- ]
- },
dialogShow: false,
- loading: false
+ loading: false,
+ messageTip:''
};
},
computed: {
- ...mapGetters('training', [
- 'memberList'
+ ...mapGetters('training', [
+ 'memberList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
@@ -75,26 +72,37 @@ export default {
return '输入限速值';
}
},
+ watch:{
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.dialogShow && this.popClass === 'ningbo-01__systerm') {
+ this.commit();
+ }
+ }
+ },
mounted() {
},
methods: {
- validateLimit(rule, value, callback) {
- const num = Number(value);
- if (num) {
- if (num >= 25 && num <= 65) {
- callback();
- } else {
- callback(new Error('限速值应该在25-65之间'));
- }
- } else {
- callback(new Error('请输入数值类型'));
- }
- },
+ // validateLimit(rule, value, callback) {
+ // if (value) {
+ // callback(new Error('请输入限速值'));
+ // } else {
+ // const num = Number(value);
+ // if (num) {
+ // if (num >= 25 && num <= 65) {
+ // callback();
+ // } else {
+ // callback(new Error('限速值应该在25-65之间'));
+ // }
+ // } else {
+ // callback(new Error('请输入数值类型'));
+ // }
+ // }
+ // },
doShow(selected) {
- this.selected = selected;
+ this.selected = selected;
this.addModel = {
speedLimit:''
- };
+ };
this.dialogShow = true;
this.$nextTick(function () {
@@ -108,26 +116,43 @@ export default {
this.$store.dispatch('map/setTrainWindowShow', false);
},
commit() {
- this.$refs['form'].validate((valid) => {
- if (valid) {
- const group = this.$route.query.group;
- const param = {
- commandType: 'Set_Speed_Limit',
- targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
- params: {
- speedLimit: this.addModel.speedLimit
- }
- };
- commitTrainSend(group, param).then(({valid, operate})=>{
- this.doClose();
- }).catch((error) => {
- this.$refs.noticeInfo.doShow();
- this.doClose();
- });
+ // this.$refs['form'].validate((valid) => {
+ // if (valid) {
+ const value = this.addModel.speedLimit;
+ if (!value) {
+ this.messageTip = '请输入限速值';
+ return;
+ } else {
+ const num = Number(value);
+ if (num) {
+ if (num < 25 || num > 65) {
+ this.messageTip = '限速值应该在25-65之间';
+ return;
+ }
} else {
- return false;
+ this.messageTip = '请输入数值类型';
+ return;
}
+ }
+ this.messageTip = '';
+ const group = this.$route.query.group;
+ const param = {
+ commandType: 'Set_Speed_Limit',
+ targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
+ params: {
+ speedLimit: this.addModel.speedLimit
+ }
+ };
+ commitTrainSend(group, param).then(({valid, operate})=>{
+ this.doClose();
+ }).catch((error) => {
+ this.$refs.noticeInfo.doShow();
+ this.doClose();
});
+ // } else {
+ // return false;
+ // }
+ // });
}
}
};
diff --git a/src/jmapNew/theme/haerbin_01/menus/menuBar.vue b/src/jmapNew/theme/haerbin_01/menus/menuBar.vue
index 9ea85a062..21d4f8b86 100644
--- a/src/jmapNew/theme/haerbin_01/menus/menuBar.vue
+++ b/src/jmapNew/theme/haerbin_01/menus/menuBar.vue
@@ -176,7 +176,7 @@ export default {
this.centralizedMap[ele] = item.code;
});
}
- });
+ });
centralizedStationList.forEach((item, index) => {
if (index < centralizedStationList.length / 2) {
this.centralizedStationList1.push(item);
diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetHead.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetHead.vue
index 58680ff7a..a0a07a248 100644
--- a/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetHead.vue
+++ b/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetHead.vue
@@ -20,6 +20,7 @@
+ {{ messageTip1 }}
@@ -28,6 +29,7 @@
+ {{ messageTip2 }}
@@ -63,6 +65,8 @@ export default {
destinationCode: '',
serviceNumber: ''
},
+ messageTip1:'',
+ messageTip2:'',
dialogShow: false,
trueValue: true,
loading: false
@@ -88,6 +92,13 @@ export default {
return '设置头码车';
}
},
+ watch:{
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.dialogShow) {
+ this.commit();
+ }
+ }
+ },
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
@@ -113,11 +124,22 @@ export default {
mouseCancelState(this.selected);
},
commit() {
+ if (!this.addModel.serviceNumber) {
+ this.messageTip1 = '请输入服务号';
+ return;
+ }
+ if (!this.addModel.destinationCode) {
+ this.messageTip1 = '';
+ this.messageTip2 = '请输入目的地号';
+ return;
+ }
const params = {
groupNumber: this.addModel.groupNumber,
destinationCode: this.addModel.destinationCode,
serviceNumber: this.addModel.serviceNumber
};
+ this.messageTip1 = '';
+ this.messageTip2 = '';
this.loading = true;
commitOperate(menuOperate.TrainWindow.destinationTrainId, params, 2).then(({valid})=>{
this.loading = false;
diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetPlan.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetPlan.vue
index 4847cfd94..e998a17a7 100644
--- a/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetPlan.vue
+++ b/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetPlan.vue
@@ -25,9 +25,11 @@
+ {{ messageTip1 }}
+ {{ messageTip2 }}
@@ -58,6 +60,8 @@ export default {
return {
trainNoList: [],
selected: null,
+ messageTip1:'',
+ messageTip2:'',
addModel: {
groupNumber: '',
tripNumber: '',
@@ -90,6 +94,13 @@ export default {
return '设置计划车';
}
},
+ watch:{
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.dialogShow) {
+ this.commit();
+ }
+ }
+ },
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
@@ -115,12 +126,22 @@ export default {
mouseCancelState(this.selected);
},
commit() {
+ if (!this.addModel.serviceNumber) {
+ this.messageTip1 = '请输入服务号';
+ return;
+ }
+ if (!this.addModel.tripNumber) {
+ this.messageTip1 = '';
+ this.messageTip2 = '请输入序列号';
+ return;
+ }
const params = {
groupNumber: this.addModel.groupNumber,
tripNumber: this.addModel.tripNumber,
serviceNumber: this.addModel.serviceNumber
};
-
+ this.messageTip1 = '';
+ this.messageTip2 = '';
this.loading = true;
commitOperate(menuOperate.TrainWindow.setPlanTrainId, params, 2).then(({valid})=>{
this.loading = false;
diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetWork.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetWork.vue
index b2bedb619..5dd137285 100644
--- a/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetWork.vue
+++ b/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetWork.vue
@@ -68,6 +68,13 @@ export default {
return '设置人工车';
}
},
+ watch:{
+ '$store.state.map.keyboardEnterCount': function (val) {
+ if (this.dialogShow) {
+ this.commit();
+ }
+ }
+ },
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
diff --git a/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue b/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue
index 68531ae95..da72604b2 100644
--- a/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue
+++ b/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue
@@ -12,7 +12,7 @@
-
+
@@ -28,7 +28,7 @@ import TrainSetPlan from './dialog/trainSetPlan';
import TrainSetHead from './dialog/trainSetHead';
import TrainSetWork from './dialog/trainSetWork';
import trainSetWorkATP from './dialog/trainSetWorkATP';
-import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit'
+import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
@@ -50,8 +50,8 @@ export default {
TrainSetHead,
TrainSetWork,
trainSetWorkATP,
- SetFault,
- SpeedLimit
+ SetFault,
+ SpeedLimit
},
props: {
selected: {
@@ -219,20 +219,20 @@ export default {
{
label: '进路闭塞法行车',
handler: this.routeBlockRun
- },
- {
+ },
+ {
label: '限速指令',
handler: this.handleSpeedLimit
},
- {
+ {
label: '越引导信号行驶',
handler: this.handleOverFuideSignal
},
{
label: '越红灯行驶',
handler: this.handleOverEedLight
- },
- {
+ },
+ {
label: '开/关门',
handler: this.handleOpenCloseDoor
}
@@ -248,8 +248,8 @@ export default {
computed: {
...mapGetters('training', [
'mode',
- 'operatemode',
- 'memberList'
+ 'operatemode',
+ 'memberList'
]),
...mapGetters('menuOperation', [
'buttonOperation'
@@ -313,8 +313,8 @@ export default {
// commitOperate(menuOperate.Train.nextStation, { groupNumber: this.selected.code }, 3).then(({valid, operate})=>{
// }).catch((error) => {
// this.$refs.noticeInfo.doShow(error.message);
- // });
- const group = this.$route.query.group;
+ // });
+ const group = this.$route.query.group;
const param = {
commandType: 'Drive_Ahead',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
@@ -329,8 +329,8 @@ export default {
// commitOperate(menuOperate.Train.routeBlockRun, { groupNumber: this.selected.code }, 3).then(({valid, operate})=>{
// }).catch((error) => {
// this.$refs.noticeInfo.doShow(error.message);
- // });
- const group = this.$route.query.group;
+ // });
+ const group = this.$route.query.group;
const param = {
commandType: 'Route_Block_Drive',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
@@ -340,9 +340,9 @@ export default {
}).catch((error) => {
this.$refs.noticeInfo.doShow(error.message);
});
- },
- handleOverFuideSignal() {
- const group = this.$route.query.group;
+ },
+ handleOverFuideSignal() {
+ const group = this.$route.query.group;
const param = {
commandType: 'Drive_Through_The_Guide_Signal',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
@@ -352,9 +352,9 @@ export default {
}).catch((error) => {
this.$refs.noticeInfo.doShow(error.message);
});
- },
- handleOverEedLight() {
- const group = this.$route.query.group;
+ },
+ handleOverEedLight() {
+ const group = this.$route.query.group;
const param = {
commandType: 'Drive_Through_The_Red_Light',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
@@ -364,13 +364,13 @@ export default {
}).catch((error) => {
this.$refs.noticeInfo.doShow(error.message);
});
- },
- handleSpeedLimit() { // 限速指令
- this.$refs.speedLimit.doShow(this.selected);
- },
- // 操作列车 开/关门
- handleOpenCloseDoor() {
- const group = this.$route.query.group;
+ },
+ handleSpeedLimit() { // 限速指令
+ this.$refs.speedLimit.doShow(this.selected);
+ },
+ // 操作列车 开/关门
+ handleOpenCloseDoor() {
+ const group = this.$route.query.group;
const param = {
commandType: 'Open_Or_Close_Door',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
@@ -380,7 +380,7 @@ export default {
}).catch((error) => {
this.$refs.noticeInfo.doShow(error.message);
});
- },
+ },
// 限速行驶
limitSpeed() {
const operate = {
From ed4b5047bdebe90bfce4c72c7275b98a07fe31d4 Mon Sep 17 00:00:00 2001
From: joylink_cuiweidong <364937672@qq.com>
Date: Tue, 28 Jul 2020 18:47:05 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../menus/dialog/trainSpeedLimit.vue | 92 ++++++++-----------
1 file changed, 37 insertions(+), 55 deletions(-)
diff --git a/src/jmapNew/theme/components/menus/dialog/trainSpeedLimit.vue b/src/jmapNew/theme/components/menus/dialog/trainSpeedLimit.vue
index cdb5ced6d..13ccf033e 100644
--- a/src/jmapNew/theme/components/menus/dialog/trainSpeedLimit.vue
+++ b/src/jmapNew/theme/components/menus/dialog/trainSpeedLimit.vue
@@ -11,12 +11,10 @@
:modal="false"
:close-on-click-modal="false"
>
-
-
+
@@ -56,9 +54,14 @@ export default {
addModel: {
speedLimit: '' // 限速值
},
+ rules: {
+ speedLimit: [
+ { required: true, message: '请输入限速值', trigger: 'blur' },
+ { validator: this.validateLimit, trigger: 'blur' }
+ ]
+ },
dialogShow: false,
- loading: false,
- messageTip:''
+ loading: false
};
},
computed: {
@@ -82,22 +85,18 @@ export default {
mounted() {
},
methods: {
- // validateLimit(rule, value, callback) {
- // if (value) {
- // callback(new Error('请输入限速值'));
- // } else {
- // const num = Number(value);
- // if (num) {
- // if (num >= 25 && num <= 65) {
- // callback();
- // } else {
- // callback(new Error('限速值应该在25-65之间'));
- // }
- // } else {
- // callback(new Error('请输入数值类型'));
- // }
- // }
- // },
+ validateLimit(rule, value, callback) {
+ const num = Number(value);
+ if (num) {
+ if (num >= 25 && num <= 65) {
+ callback();
+ } else {
+ callback(new Error('限速值应该在25-65之间'));
+ }
+ } else {
+ callback(new Error('请输入数值类型'));
+ }
+ },
doShow(selected) {
this.selected = selected;
this.addModel = {
@@ -116,43 +115,26 @@ export default {
this.$store.dispatch('map/setTrainWindowShow', false);
},
commit() {
- // this.$refs['form'].validate((valid) => {
- // if (valid) {
- const value = this.addModel.speedLimit;
- if (!value) {
- this.messageTip = '请输入限速值';
- return;
- } else {
- const num = Number(value);
- if (num) {
- if (num < 25 || num > 65) {
- this.messageTip = '限速值应该在25-65之间';
- return;
- }
+ this.$refs['form'].validate((valid) => {
+ if (valid) {
+ const group = this.$route.query.group;
+ const param = {
+ commandType: 'Set_Speed_Limit',
+ targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
+ params: {
+ speedLimit: this.addModel.speedLimit
+ }
+ };
+ commitTrainSend(group, param).then(({valid, operate})=>{
+ this.doClose();
+ }).catch((error) => {
+ this.$refs.noticeInfo.doShow();
+ this.doClose();
+ });
} else {
- this.messageTip = '请输入数值类型';
- return;
+ return false;
}
- }
- this.messageTip = '';
- const group = this.$route.query.group;
- const param = {
- commandType: 'Set_Speed_Limit',
- targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
- params: {
- speedLimit: this.addModel.speedLimit
- }
- };
- commitTrainSend(group, param).then(({valid, operate})=>{
- this.doClose();
- }).catch((error) => {
- this.$refs.noticeInfo.doShow();
- this.doClose();
});
- // } else {
- // return false;
- // }
- // });
}
}
};