This commit is contained in:
fan 2020-07-29 11:14:57 +08:00
commit a18c84f684
12 changed files with 181 additions and 130 deletions

View File

@ -137,6 +137,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');

View File

@ -50,8 +50,8 @@ export default {
name: 'SwitchHookLock',
components: {
NoticeInfo
},
props: {
},
props: {
popClass: {
type: String,
default() {
@ -67,18 +67,25 @@ export default {
operation: '',
stationName: '',
switchName: '',
normal:false,
targetMemberId: ''
normal:false,
targetMemberId: ''
};
},
computed: {
...mapGetters('training', [
...mapGetters('training', [
'memberList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
}
},
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');
@ -91,10 +98,10 @@ export default {
this.switchName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
this.switchName = selected.name;
this.switchName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.targetMemberId = this.memberList.find(ele => ele.deviceCode == station.code).id;
this.targetMemberId = this.memberList.find(ele => ele.deviceCode == station.code).id;
this.stationName = station.name;
}
}
@ -116,20 +123,20 @@ export default {
},
commit() {
this.loading = true;
const group = this.$route.query.group;
const group = this.$route.query.group;
const param = {
commandType: 'Switch_Hook_Lock',
targetMemberId: this.targetMemberId,
params: {
switchCode: this.selected.code,
normal: this.normal
}
switchCode: this.selected.code,
normal: this.normal
}
};
commitTrainSend(group, param).then(({valid, operate})=>{
this.doClose();
this.doClose();
}).catch((error) => {
this.$refs.noticeInfo.doShow(error.message);
this.doClose();
this.$refs.noticeInfo.doShow(error.message);
this.doClose();
});
}
}

View File

@ -11,12 +11,10 @@
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="80px" :model="addModel">
<!-- :rules="rules" -->
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules" @submit.native.prevent>
<div style="width: 96%;">
<el-form-item label="限速值:" label-width="95px" prop="speedLimit">
<el-input v-model="addModel.speedLimit" size="small" />
<div>{{ messageTip }}</div>
</el-form-item>
</div>
</el-form>
@ -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;
// }
// });
}
}
};

View File

@ -28,7 +28,7 @@
<div style="overflow: hidden;">
<div>道岔</div>
<el-col :span="11">
<el-select :id="domIdChoose" v-model="messageText2" filterable size="mini" :disabled="disabledConfirm2" @change="SelectChange">
<el-select :id="domIdChoose" ref="selectSwitch" v-model="messageText2" filterable size="mini" :disabled="disabledConfirm2" @change="SelectChange">
<el-option v-for="option in filterSwitchList" :key="option.code" :label="option.name" :value="option.code" />
</el-select>
</el-col>
@ -140,6 +140,17 @@ export default {
return '';
}
},
watch:{
'$store.state.map.keyboardEnterCount': function (val) {
if (this.dialogShow) {
if (this.disabledConfirm2 && !this.disabledConfirm1) {
this.confirm1();
} else if (this.disabledConfirm1 && !this.disabledConfirm2 ) {
this.confirm2();
}
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
@ -180,7 +191,6 @@ export default {
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
SelectChange() {
const operate = {
operation: '',
@ -197,6 +207,7 @@ export default {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.selectSwitch.blur();
}
}).catch(() => {
this.$refs.noticeInfo.doShow();

View File

@ -94,11 +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
},
// {
// label: '',
// handler: this.lock,
// cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
// },
{
type: 'separator'
},

View File

@ -1,17 +1,14 @@
<template>
<div>
<el-dialog
title="设备管理"
:visible.sync="show"
custom-class="dialog_box"
top="0px"
width="800px"
:modal="false"
:before-do-close="doClose"
:close-on-click-modal="false"
:z-index="2000"
>
<div style="margin-bottom: 3px; overflow: hidden;">
<el-drawer
title="设备管理"
:visible.sync="show"
direction="ltr"
:before-close="doClose"
custom-class="dialog_box"
size="43%"
>
<div style="margin-bottom: 3px; overflow: hidden; padding: 0 10px;">
<div class="plc_box">名称: {{ plcInfo.name }}</div>
<div class="plc_box">状态: <span :style="{'color': plcInfo.status ? 'green' : 'red'}">{{ plcInfo.status ? '在线' : '不在线' }}</span></div>
<el-button type="text" size="small" class="freshen_box" @click="getList">刷新</el-button>
@ -32,7 +29,7 @@
</template>
</el-table-column>
</el-table>
</el-dialog>
</el-drawer>
</div>
</template>

View File

@ -6,26 +6,26 @@
<span v-if="countTime" class="display-score">{{ $t('display.demon.trialTime') }} {{ countTime }}</span>
</el-row>
</div>
<div class="display-draft" :style="{bottom: offsetBottom + 'px'}">
<div class="display-draft" :class="{'haerbin_btn_box': $route.query.lineCode == '07'}" :style="{bottom: offsetBottom + 'px'}">
<el-button-group>
<!-- 排班计划 -->
<el-button v-if="isShowScheduling && !dataError" type="primary" @click="jumpScheduling">{{ $t('display.demon.dispatchingPlan') }}</el-button>
<el-button v-if="isShowScheduling && !dataError" type="primary" @click="jumpScheduling" size="small">{{ $t('display.demon.dispatchingPlan') }}</el-button>
<!-- cctv视图 -->
<el-button v-if="!isShowScheduling && !dataError" type="jl3dpassflow" @click="jumpjl3dpassflow">{{ jl3dpassflow }}</el-button>
<!-- <el-button v-if="!isShowScheduling && !dataError" type="jl3dstation" @click="jumpjl3dstation">{{ jl3dstation }}</el-button> -->
<el-button v-if="!isShowScheduling && !dataError" @click="jumpjl3dpassflow" size="small">{{ jl3dpassflow }}</el-button>
<!-- <el-button v-if="!isShowScheduling && !dataError" @click="jumpjl3dstation">{{ jl3dstation }}</el-button> -->
<!-- 三维视图 -->
<el-button v-if="!isShowScheduling && !dataError" type="jumpjlmap3d" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
<el-button v-if="!isShowScheduling && !dataError" @click="jumpjlmap3d" size="small">{{ jl3dname }}</el-button>
<!-- 设备视图 -->
<el-button v-if="isShow3dmodel && !isShowScheduling && !dataError" type="jumpjlmap3dmodel" @click="jumpjlmap3dmodel">{{ jl3dmodel }}</el-button>
<el-button v-if="isShow3dmodel && !isShowScheduling && !dataError" @click="jumpjlmap3dmodel" size="small">{{ jl3dmodel }}</el-button>
<template v-if="isShowQuest">
<!-- && !isDesignPlatform -->
<el-button v-if="!isDesignPlatform && !dataError" type="danger" @click="handleQuitQuest">{{ $t('display.demon.exitScript') }}</el-button>
<el-button v-if="!isDesignPlatform && !dataError" type="danger" @click="handleQuitQuest" size="small">{{ $t('display.demon.exitScript') }}</el-button>
</template>
<template v-else-if="!projectDevice">
<el-button type="success" :disabled="isDisable || dataError" @click="selectBeginTime">{{ $t('display.demon.drivingByPlan') }}</el-button>
<el-button type="danger" :disabled="dataError" @click="end">{{ $t('display.demon.initialize') }}</el-button>
<el-button type="success" :disabled="isDisable || dataError" @click="selectBeginTime" size="small">{{ $t('display.demon.drivingByPlan') }}</el-button>
<el-button type="danger" :disabled="dataError" @click="end" size="small">{{ $t('display.demon.initialize') }}</el-button>
</template>
<el-button type="primary" @click="back">{{ projectDevice?'退出':$t('display.demon.back') }}</el-button>
<el-button type="primary" @click="back" size="small">{{ projectDevice?'退出':$t('display.demon.back') }}</el-button>
</el-button-group>
</div>
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
@ -352,12 +352,16 @@ export default {
font-size: 18px !important;
color: #fff;
}
.haerbin_btn_box{
width: 450px;
bottom: 15px!important;
}
</style>
<style lang="scss">
.display-draft {
position: absolute;
float: right;
right: 20px;
right: 5px;
bottom: 15px;
}
</style>

View File

@ -265,7 +265,7 @@ export default {
z-index: 9;
display: inline;
position: absolute;
right: 15px;
right: 5px;
}
/deep/ .el-button+.el-button {

View File

@ -21,7 +21,7 @@ export default {
},
data() {
return {
offset: 15
offset: 10
};
},
watch: {
@ -67,7 +67,7 @@ export default {
.zoom-box {
z-index: 7;
position: absolute;
left: 20px;
left: 5px;
width: 120px;
height: 32px;
background: rgb(224, 223, 223);

View File

@ -516,10 +516,6 @@ export default {
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
hidepanel() { //
// this.panelShow = false;
// this.drivingShow = true;
// this.ibpShow = false;
// this.$refs.Jl3dDrive.show(this.mapId, this.group);
if (this.$store.state.training.prdType == '04') {
this.panelShow = false;
this.drivingShow = true;

View File

@ -1,31 +1,33 @@
<template>
<div>
<chat-box :group="group" :user-role="userRole" />
<div class="display-draft" :class="{'display-type-hb': $route.query.lineCode == '07' && $store.state.training.prdType=='01'}" :style="{bottom: offsetBottom + 'px'}">
<!-- <div class="btn_hover" @mouseenter="btnHover"><i class="el-icon-s-promotion" /></div> -->
<!-- @mouseenter="btnBoxEnter" @mouseleave.stop="btnBoxLeave" -->
<div class="display-draft" :class="{'display-type-hb': $route.query.lineCode == '07' && $store.state.training.prdType=='01', 'haerbin_btn_box': $route.query.lineCode == '07'}" :style="{bottom: offsetBottom + 'px'}">
<el-button-group>
<el-button v-if="isAdmin && isProject" @click="handleEquipment">设备管理</el-button>
<el-button v-if="isAdmin" @click="memberManage">成员管理</el-button>
<el-button v-if="isAdmin && !noQrcodeList.includes(project)" type="primary" @click="generateQrCode">生成二维码</el-button>
<el-button v-if="isAdmin && isProject" @click="handleEquipment" size="small">设备管理</el-button>
<el-button v-if="isAdmin" @click="memberManage" size="small">成员管理</el-button>
<el-button v-if="isAdmin && !noQrcodeList.includes(project)" type="primary" @click="generateQrCode" size="small">生成二维码</el-button>
<!-- cctv视图 -->
<el-button v-if="(isShowScheduling && !dataError) || (isStationSupervisor && !dataError)" @click="jumpjl3dpassflow">{{ $t('display.demon.passengerflow') }}</el-button>
<el-button v-if="(isShowScheduling && !dataError) || (isStationSupervisor && !dataError)" @click="jumpjl3dpassflow" size="small">{{ $t('display.demon.passengerflow') }}</el-button>
<!-- 三维视图 / 司机视角 -->
<el-button v-if="(isShowScheduling && !dataError) || (isDriver && !dataError)" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
<el-button v-if="(isShowScheduling && !dataError) || (isDriver && !dataError)" @click="jumpjlmap3d" size="small">{{ jl3dname }}</el-button>
<!-- 设备视图 -->
<el-button v-if="isShow3dmodel && isShowScheduling && !dataError" @click="jumpjlmap3dmodel">{{ $t('display.demon.deviceView') }}</el-button>
<el-button v-if="isShow3dmodel && isShowScheduling && !dataError" @click="jumpjlmap3dmodel" size="small">{{ $t('display.demon.deviceView') }}</el-button>
<template v-if="isAdmin && project != 'refereeJsxt'">
<el-button type="success" :disabled="isDisable || dataError" @click="selectBeginTime">{{ $t('joinTraining.drivingByPlan') }}</el-button>
<el-button type="danger" :disabled="dataError" @click="end">{{ $t('joinTraining.initialize') }}</el-button>
<el-button type="success" :disabled="isDisable || dataError" @click="selectBeginTime" size="small">{{ $t('joinTraining.drivingByPlan') }}</el-button>
<el-button type="danger" :disabled="dataError" @click="end" size="small">{{ $t('joinTraining.initialize') }}</el-button>
</template>
<template v-if="project==='jsxt'">
<div style="background: #FFF;display: inline-block;height: 40px;line-height: 40px;padding: 0 5px;border: 2px solid #F00;border-radius: 6px;margin-right: 8px;">{{ '剩余时间:' + countdownTime }}</div>
<el-button :disabled="!jsStart" type="success" @click="startCompetition" size="small">开始</el-button>
<el-button :disabled="jsStart" type="danger" @click="endCompetition" size="small">提交</el-button>
</template>
<el-button v-if="project==='refereeJsxt'" type="success" @click="refeeEndCompetition" size="small">退出</el-button>
<el-button v-if="project!=='jsxt'&&project!=='refereeJsxt'" type="primary" :loading="backLoading" @click="back" size="small">退出</el-button>
</el-button-group>
<template v-if="project==='jsxt'">
<div style="background: #FFF;display: inline-block;height: 40px;line-height: 40px;padding: 0 5px;border: 2px solid #F00;border-radius: 6px;margin-right: 8px;">{{ '剩余时间:' + countdownTime }}</div>
<el-button :disabled="!jsStart" type="success" @click="startCompetition">开始</el-button>
<el-button :disabled="jsStart" type="danger" @click="endCompetition">提交</el-button>
</template>
<el-button v-if="project==='refereeJsxt'" type="success" @click="refeeEndCompetition">退出</el-button>
<el-button v-if="project!=='jsxt'&&project!=='refereeJsxt'" type="primary" :loading="backLoading" @click="back">退出</el-button>
</div>
<qr-code ref="qrCode" />
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
@ -98,9 +100,10 @@ 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'),
hoverBtn: false
};
},
computed: {
@ -372,7 +375,32 @@ export default {
this.jl3dname = this.$t('display.demon.threeDimensionalView'); //
this.isShow3dmodel = true;
}
}
}
// btnHover() {
// if (!this.btnHoverTime) {
// this.btnHoverTime = setTimeout(() => {
// this.hoverBtn = false;
// }, 8000)
// }
// this.hoverBtn = true;
// },
// btnBoxEnter() {
// if (this.btnHoverTime) {
// clearTimeout(this.btnHoverTime);
// this.btnHoverTime = null;
// }
// if (this.btnBoxLeaveTime) {
// clearTimeout(this.btnBoxLeaveTime);
// this.btnBoxLeaveTime = null;
// }
// },
// btnBoxLeave() {
// if (!this.btnBoxLeaveTime) {
// this.btnBoxLeaveTime = setTimeout(() => {
// this.hoverBtn = false;
// }, 5000)
// }
// }
}
};
</script>
@ -459,11 +487,30 @@ export default {
}
}
.btn_hover{
position: absolute;
right: -2px;
bottom: 15px;
color: #fff;
font-size: 24px;
background: #1756e4;
padding: 8px 2px;
border-radius: 5px;
}
.display-draft {
position: absolute;
float: right;
right: 40px;
// float: right;
right: 5px;
bottom: 28px;
// transform: translateX(calc(100% + 40px));
// transition: all 0.5s;
// &.active{
// transform: translateX(0);
// }
}
.haerbin_btn_box{
width: 450px;
bottom: 15px!important;
}
.display-type-hb{
bottom: 105px;

View File

@ -182,7 +182,7 @@ export default {
z-index: 9;
display: inline;
position: absolute;
right: 20px;
right: 5px;
}
.schema .el-radio-group .el-radio-button__inner {