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') }} @@ -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" > - - +
-
{{ messageTip }}
@@ -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; - // } - // }); } } };