conflict fix
This commit is contained in:
commit
381a1af149
@ -1,111 +1,88 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="xian-01__systerm psl-panel"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="500px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="psl-title">
|
||||
<div>{{ title }}</div>
|
||||
</div>
|
||||
<div class="psl-content">
|
||||
<!-- <div class="content-row">
|
||||
<div class="btn">
|
||||
<div class="btn-text">
|
||||
有滑动门/应急门未关闭且锁紧指示灯
|
||||
</div>
|
||||
<img
|
||||
:src="getIcon('top', indicators.lock ? 'on' : 'off')"
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="content-row">
|
||||
<div class="cell">
|
||||
<div class="btn-text">PSL操作指示灯</div>
|
||||
<img
|
||||
:src="
|
||||
getIcon('red', indicators.pslczLight ? 'on' : 'off')
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="btn-text">互锁解除指示灯</div>
|
||||
<img
|
||||
:src="
|
||||
getIcon('red', indicators.hsjcLight ? 'on' : 'off')
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-row">
|
||||
<div class="cell">
|
||||
<div class="btn-text">开门状态指示灯</div>
|
||||
<img
|
||||
:src="getIcon('red', indicators.kmLight ? 'on' : 'off')"
|
||||
/>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="btn-text">关门状态指示灯</div>
|
||||
<img
|
||||
:src="
|
||||
getIcon('green', indicators.gmLight ? 'on' : 'off')
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-row">
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">禁止</div>
|
||||
<img
|
||||
:src="getIcon('key')"
|
||||
:class="['key', { 'key-on': indicators.yxjzKey }]"
|
||||
@click="btnClickHandler('YXJZ')"
|
||||
/>
|
||||
<div class="btn-text-opt">允许</div>
|
||||
</div>
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">禁止</div>
|
||||
<img
|
||||
:src="getIcon('key')"
|
||||
:class="['key', { 'key-on': indicators.hsjcKey }]"
|
||||
@click="btnClickHandler('HSJC')"
|
||||
/>
|
||||
<div class="btn-text-opt">互锁解除</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-row">
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">开门按钮</div>
|
||||
<img
|
||||
:src="getIcon('red', 'btn')"
|
||||
@click="btnClickHandler('KM')"
|
||||
/>
|
||||
</div>
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">关门按钮</div>
|
||||
<img
|
||||
:src="getIcon('green', 'btn')"
|
||||
@click="btnClickHandler('GM')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-row">
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">试灯按钮</div>
|
||||
<img class="btn-sd btn-img"
|
||||
:src="getIcon('green', 'btn')"
|
||||
@mousedown.left="btnClickHandler('SD')"
|
||||
@mouseup.left="btnClickHandler('SD')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="xian-01__systerm psl-panel"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="500px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="psl-title">
|
||||
<div>{{ title }}</div>
|
||||
</div>
|
||||
<div class="psl-content">
|
||||
<div class="content-row">
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">所有滑动门/应急门关闭且锁紧指示灯</div>
|
||||
<img :src="getIcon('top', indicators.qbgmLight ? 'on' : 'off')" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-row">
|
||||
<div class="cell">
|
||||
<div class="btn-text">PSL操作指示灯</div>
|
||||
<img :src="getIcon('red', indicators.pslczLight ? 'on' : 'off')" />
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="btn-text">互锁解除指示灯</div>
|
||||
<img :src="getIcon('red', indicators.hsjcLight ? 'on' : 'off')" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-row">
|
||||
<div class="cell">
|
||||
<div class="btn-text">开门状态指示灯</div>
|
||||
<img :src="getIcon('red', indicators.kmLight ? 'on' : 'off')" />
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="btn-text">关门状态指示灯</div>
|
||||
<img :src="getIcon('green', indicators.gmLight ? 'on' : 'off')" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-row">
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">禁止</div>
|
||||
<img
|
||||
:src="getIcon('key')"
|
||||
:class="['key', { 'key-on': indicators.yxjzKey }]"
|
||||
@click="btnClickHandler('YXJZ')"
|
||||
/>
|
||||
<div class="btn-text-opt">允许</div>
|
||||
</div>
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">禁止</div>
|
||||
<img
|
||||
:src="getIcon('key')"
|
||||
:class="['key', { 'key-on': indicators.hsjcKey }]"
|
||||
@click="btnClickHandler('HSJC')"
|
||||
/>
|
||||
<div class="btn-text-opt">互锁解除</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-row">
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">开门按钮</div>
|
||||
<img :src="getIcon('red', 'btn')" @click="btnClickHandler('KM')" />
|
||||
</div>
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">关门按钮</div>
|
||||
<img :src="getIcon('green', 'btn')" @click="btnClickHandler('GM')" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-row">
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">试灯按钮</div>
|
||||
<img
|
||||
class="btn-sd btn-img"
|
||||
:src="getIcon('green', 'btn')"
|
||||
@mousedown.left="btnClickHandler('SD')"
|
||||
@mouseup.left="btnClickHandler('SD')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -113,111 +90,109 @@ import icons from "@/assets/psl_images/psl_icons";
|
||||
import { getPslStatus, pressPslButton } from "@/api/simulation";
|
||||
let standCode, group;
|
||||
export default {
|
||||
name: "PSL",
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
indicators: {
|
||||
// lock: false,
|
||||
pslczLight: false,
|
||||
hsjcLight: false,
|
||||
kmLight: false,
|
||||
gmLight: false,
|
||||
yxjzKey: false,
|
||||
hsjcKey: false
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return "PSL";
|
||||
},
|
||||
name: "PSL",
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
indicators: {
|
||||
qbgmLight: true,
|
||||
pslczLight: false,
|
||||
hsjcLight: false,
|
||||
kmLight: false,
|
||||
gmLight: false,
|
||||
yxjzKey: false,
|
||||
hsjcKey: false
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return "PSL";
|
||||
},
|
||||
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(selected) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function() {
|
||||
this.$store.dispatch("training/emitTipFresh");
|
||||
});
|
||||
standCode = selected.code;
|
||||
group = this.$route.query.group;
|
||||
this.initData(group, standCode);
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(selected) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function() {
|
||||
this.$store.dispatch("training/emitTipFresh");
|
||||
});
|
||||
standCode = selected.code;
|
||||
group = this.$route.query.group;
|
||||
this.initData(group, standCode);
|
||||
},
|
||||
|
||||
initData(group, standCode) {
|
||||
getPslStatus(group, standCode)
|
||||
.then(resp => {
|
||||
if (resp.data) {
|
||||
this.indicators = resp.data;
|
||||
}
|
||||
})
|
||||
.catch(err => {});
|
||||
},
|
||||
initData(group, standCode) {
|
||||
getPslStatus(group, standCode)
|
||||
.then(resp => {
|
||||
if (resp.data) {
|
||||
this.indicators = resp.data;
|
||||
}
|
||||
})
|
||||
.catch(err => {});
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch("training/emitTipFresh");
|
||||
},
|
||||
getIcon(type, status) {
|
||||
return status !== undefined
|
||||
? icons[`${type}_${status}`]
|
||||
: icons[type];
|
||||
},
|
||||
btnClickHandler(btnType) {
|
||||
pressPslButton(group, standCode, btnType);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
"$store.state.socket.simulationPslStatus": function(val) {
|
||||
if (val && val[standCode]) {
|
||||
Object.assign(this.indicators, val[standCode])
|
||||
}
|
||||
}
|
||||
}
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch("training/emitTipFresh");
|
||||
},
|
||||
getIcon(type, status) {
|
||||
return status !== undefined ? icons[`${type}_${status}`] : icons[type];
|
||||
},
|
||||
btnClickHandler(btnType) {
|
||||
pressPslButton(group, standCode, btnType);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
"$store.state.socket.simulationPslStatus": function(val) {
|
||||
if (val && val[standCode]) {
|
||||
Object.assign(this.indicators, val[standCode]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.psl-title {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
color: #000;
|
||||
font-size: 18px;
|
||||
margin: 30px 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
color: #000;
|
||||
font-size: 18px;
|
||||
margin: 30px 0;
|
||||
}
|
||||
.psl-content {
|
||||
.content-row {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
margin: 10px 0;
|
||||
.cell {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 120px;
|
||||
height: 100px;
|
||||
.key {
|
||||
transition: 0.1s;
|
||||
}
|
||||
.key-on {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
.btn-text-opt {
|
||||
position: absolute;
|
||||
left: 80%;
|
||||
top: 35%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.content-row {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
margin: 10px 0;
|
||||
.cell {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 120px;
|
||||
height: 100px;
|
||||
.key {
|
||||
transition: 0.1s;
|
||||
}
|
||||
.key-on {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
.btn-text-opt {
|
||||
position: absolute;
|
||||
left: 80%;
|
||||
top: 35%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,102 +1,133 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :class="popClass + ' train-control'" :title="title" :visible.sync="show" width="370px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-form ref="form" size="small" label-width="120px" :model="formModel" :rules="rules">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" prop="groupNumber">
|
||||
<el-select
|
||||
:id="domIdTrainNumber"
|
||||
v-model="formModel.groupNumber"
|
||||
filterable
|
||||
:disabled="trainNumberIsDisabled"
|
||||
@change="trainNumberChange"
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
:class="popClass + ' train-control'"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="370px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form
|
||||
ref="form"
|
||||
size="small"
|
||||
label-width="120px"
|
||||
:model="formModel"
|
||||
:rules="rulesComputed"
|
||||
>
|
||||
<el-option
|
||||
v-for="train in trainList"
|
||||
:key="train.groupNumber"
|
||||
:label="train.groupNumber"
|
||||
:value="train.groupNumber"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="type" label-width="0px">
|
||||
<el-radio-group
|
||||
:id="domIdTrainType"
|
||||
v-model="formModel.type"
|
||||
style="margin-left: 45px;"
|
||||
@change="trainTypeChange"
|
||||
>
|
||||
<el-radio :label="'PLAN'">{{ $t('menu.planTrain') }}</el-radio>
|
||||
<el-radio :label="'HEAD'">{{ $t('menu.headCodeTrain') }}</el-radio>
|
||||
<el-radio :label="'MANUAL'" style="margin-top:5px;">{{ $t('menu.artificialTrain') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="this.$t('menu.groupNumber') + this.$t('global.colon')"
|
||||
prop="groupNumber"
|
||||
>
|
||||
<el-select
|
||||
:id="domIdTrainNumber"
|
||||
v-model="formModel.groupNumber"
|
||||
filterable
|
||||
:disabled="trainNumberIsDisabled"
|
||||
@change="trainNumberChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="train in trainList"
|
||||
:key="train.groupNumber"
|
||||
:label="train.groupNumber"
|
||||
:value="train.groupNumber"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="type" label-width="0px">
|
||||
<el-radio-group
|
||||
:id="domIdTrainType"
|
||||
v-model="formModel.type"
|
||||
style="margin-left: 45px;"
|
||||
@change="trainTypeChange"
|
||||
>
|
||||
<el-radio :label="'PLAN'">{{ $t("menu.planTrain") }}</el-radio>
|
||||
<el-radio :label="'HEAD'">{{ $t("menu.headCodeTrain") }}</el-radio>
|
||||
<el-radio :label="'MANUAL'" style="margin-top:5px;">{{
|
||||
$t("menu.artificialTrain")
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 表号 -->
|
||||
<el-form-item v-if="formModel.type == 'PLAN'" prop="serviceNumber">
|
||||
<span slot="label">{{ $t('menu.serviceNumber') + ':' }}</span>
|
||||
<el-input
|
||||
:id="domIdServerNo"
|
||||
v-model="formModel.serviceNumber"
|
||||
:disabled="serverNoIsDisabled"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 表号 -->
|
||||
<el-form-item v-if="formModel.type == 'PLAN'" prop="serviceNumber">
|
||||
<span slot="label">{{ $t("menu.serviceNumber") + ":" }}</span>
|
||||
<el-input
|
||||
:id="domIdServerNo"
|
||||
v-model="formModel.serviceNumber"
|
||||
:disabled="serverNoIsDisabled"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 车次号 -->
|
||||
<el-form-item v-if="formModel.type == 'PLAN'|| formModel.type == 'HEAD'" :label="this.$t('menu.tripNumber')+this.$t('global.colon')" prop="tripNumber">
|
||||
<el-input
|
||||
:id="domIdTrainNo"
|
||||
v-model="formModel.tripNumber"
|
||||
maxlength="4"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 车次号 -->
|
||||
<el-form-item
|
||||
v-if="formModel.type == 'PLAN' || formModel.type == 'HEAD'"
|
||||
:label="this.$t('menu.tripNumber') + this.$t('global.colon')"
|
||||
prop="tripNumber"
|
||||
>
|
||||
<el-input :id="domIdTrainNo" v-model="formModel.tripNumber" maxlength="4" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 目的地号 -->
|
||||
<el-form-item v-if="formModel.type == 'PLAN' || formModel.type == 'HEAD'" :label="this.$t('menu.targetCode')+this.$t('global.colon')" prop="destinationCode">
|
||||
<el-input
|
||||
:id="domIdTargetCode"
|
||||
v-model="formModel.destinationCode"
|
||||
:disabled="formModel.type !== 'HEAD'"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 目的地号 -->
|
||||
<el-form-item
|
||||
v-if="formModel.type == 'PLAN' || formModel.type == 'HEAD'"
|
||||
:label="this.$t('menu.targetCode') + this.$t('global.colon')"
|
||||
prop="destinationCode"
|
||||
>
|
||||
<el-input
|
||||
:id="domIdTargetCode"
|
||||
v-model="formModel.destinationCode"
|
||||
:disabled="formModel.type !== 'HEAD'"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 类别 -->
|
||||
<el-form-item v-if="formModel.type == 'MANUAL'" :label="this.$t('menu.category')+this.$t('global.colon')" prop="category">
|
||||
<el-select
|
||||
:id="domIdTrainNumber"
|
||||
v-model="formModel.category"
|
||||
filterable
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in categoryList"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" :pop-class="popClass" />
|
||||
</el-dialog>
|
||||
<!-- 类别 -->
|
||||
<el-form-item
|
||||
v-if="formModel.type == 'MANUAL'"
|
||||
:label="this.$t('menu.category') + this.$t('global.colon')"
|
||||
prop="category"
|
||||
>
|
||||
<el-select
|
||||
:id="domIdTrainNumber"
|
||||
v-model="formModel.category"
|
||||
filterable
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in categoryList"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{
|
||||
$t("global.confirm")
|
||||
}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t("global.cancel") }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" :pop-class="popClass" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import Handler from '@/scripts/cmdPlugin/Handler';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import {getTrainDetailBytripNumber, getTrainDetailByStNumber} from '@/api/simulation';
|
||||
import NoticeInfo from '../childDialog/noticeInfo';
|
||||
import { mapGetters } from "vuex";
|
||||
import { OperationEvent } from "@/scripts/cmdPlugin/OperationHandler";
|
||||
import Handler from "@/scripts/cmdPlugin/Handler";
|
||||
import { menuOperate, commitOperate } from "@/jmapNew/theme/components/utils/menuOperate";
|
||||
import { getTrainDetailBytripNumber, getTrainDetailByStNumber } from "@/api/simulation";
|
||||
import NoticeInfo from "../childDialog/noticeInfo";
|
||||
|
||||
export default {
|
||||
name: 'TrainControl',
|
||||
name: "TrainControl",
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
@ -104,48 +135,23 @@ export default {
|
||||
popClass: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
var validateTripNum = (rule, value, callback) => {
|
||||
const trip = Number.parseInt(value.substring(1));
|
||||
if (this.formModel.type === 'HEAD' && this.popClass === 'xian-01__systerm' && (trip < 701 || trip > 749)) {
|
||||
callback(new Error('头码车车次编号为701至749'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
trainList: [],
|
||||
serviceNumber:'',
|
||||
serviceNumber: "",
|
||||
formModel: {
|
||||
tripNumber: '',
|
||||
groupNumber: '',
|
||||
type: 'PLAN',
|
||||
serviceNumber: '',
|
||||
destinationCode: '',
|
||||
category: 'MM'
|
||||
},
|
||||
categoryList: [
|
||||
{ name: 'MM', value: '01' }
|
||||
],
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: '请选择车组号', trigger: 'change' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '请选择列车类型', trigger: 'change' }
|
||||
],
|
||||
tripNumber: [
|
||||
{ required: true, message: '请输入车次号', trigger: 'blur' },
|
||||
{ validator: validateTripNum, trigger: 'blur' }
|
||||
],
|
||||
destinationCode: [
|
||||
{ required: true, message: '请输入目的地号', trigger: 'blur' }
|
||||
]
|
||||
tripNumber: "",
|
||||
groupNumber: "",
|
||||
type: "PLAN",
|
||||
serviceNumber: "",
|
||||
destinationCode: "",
|
||||
category: "MM"
|
||||
},
|
||||
categoryList: [{ name: "MM", value: "01" }],
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
@ -154,11 +160,36 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
...mapGetters("map", ["map"]),
|
||||
rulesComputed() {
|
||||
const validateTripNum = (rule, value, callback) => {
|
||||
const trip = Number.parseInt(value.substring(1));
|
||||
if (
|
||||
this.formModel.type === "HEAD" &&
|
||||
this.popClass === "xian-01__systerm" &&
|
||||
(trip < 701 || trip > 749)
|
||||
) {
|
||||
callback(new Error("头码车车次编号为701至749"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
groupNumber: [{ required: true, message: "请选择车组号", trigger: "change" }],
|
||||
type: [{ required: true, message: "请选择列车类型", trigger: "change" }],
|
||||
tripNumber: [
|
||||
{
|
||||
required: !(this.formModel.type === "HEAD" && this.popClass === "xian-01__systerm"),
|
||||
message: "请输入车次号",
|
||||
trigger: "blur"
|
||||
},
|
||||
{ validator: validateTripNum, trigger: "blur" }
|
||||
],
|
||||
destinationCode: [{ required: true, message: "请输入目的地号", trigger: "blur" }]
|
||||
};
|
||||
},
|
||||
serverNoIsDisabled() {
|
||||
if (this.popClass === 'foshan-01__systerm' && this.formModel.type === 'PLAN') {
|
||||
if (this.popClass === "foshan-01__systerm" && this.formModel.type === "PLAN") {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
@ -168,7 +199,7 @@ export default {
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
@ -183,7 +214,7 @@ export default {
|
||||
return OperationEvent.Train.editTrainId.trainNumberChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
},
|
||||
domIdTrainNo() {
|
||||
if (this.dialogShow) {
|
||||
@ -195,7 +226,7 @@ export default {
|
||||
return OperationEvent.Train.editTrainId.trainNoChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
},
|
||||
domIdTrainType() {
|
||||
if (this.dialogShow) {
|
||||
@ -207,7 +238,7 @@ export default {
|
||||
return OperationEvent.Train.editTrainId.trainTypeChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
},
|
||||
domIdServerNo() {
|
||||
if (this.dialogShow) {
|
||||
@ -219,7 +250,7 @@ export default {
|
||||
return OperationEvent.Train.editTrainId.serverNoChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
},
|
||||
domIdTargetCode() {
|
||||
if (this.dialogShow) {
|
||||
@ -231,7 +262,7 @@ export default {
|
||||
return OperationEvent.Train.editTrainId.targetCodeChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
@ -243,36 +274,45 @@ export default {
|
||||
return OperationEvent.Train.editTrainId.menu.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : "";
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return '添加列车识别号';
|
||||
return "添加列车识别号";
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
return '修改列车识别号';
|
||||
return "修改列车识别号";
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'formModel.tripNumber': function(val) {
|
||||
if (this.popClass !== 'foshan-01__systerm' && val.length === 4 && this.formModel.type !== 'HEAD') {
|
||||
"formModel.tripNumber": function(val) {
|
||||
if (
|
||||
this.popClass !== "foshan-01__systerm" &&
|
||||
val.length === 4 &&
|
||||
this.formModel.type !== "HEAD"
|
||||
) {
|
||||
this.trainNoChange(val);
|
||||
} else if (this.popClass !== 'foshan-01__systerm' && this.formModel.type !== 'HEAD') {
|
||||
} else if (this.popClass !== "foshan-01__systerm" && this.formModel.type !== "HEAD") {
|
||||
this.formModel = {
|
||||
groupNumber: this.formModel.groupNumber,
|
||||
tripNumber: val,
|
||||
type: this.formModel.type,
|
||||
serviceNumber: '',
|
||||
targetCode: '',
|
||||
category: 'MM'
|
||||
serviceNumber: "",
|
||||
targetCode: "",
|
||||
category: "MM"
|
||||
};
|
||||
} else if (this.popClass === 'foshan-01__systerm' && val.length === 2 && this.formModel.serviceNumber.length === 3 && this.formModel.type !== 'HEAD') {
|
||||
} else if (
|
||||
this.popClass === "foshan-01__systerm" &&
|
||||
val.length === 2 &&
|
||||
this.formModel.serviceNumber.length === 3 &&
|
||||
this.formModel.type !== "HEAD"
|
||||
) {
|
||||
this.trainNoChange(val, this.formModel.serviceNumber);
|
||||
} else if (this.popClass === 'foshan-01__systerm' && this.formModel.type !== 'HEAD') {
|
||||
} else if (this.popClass === "foshan-01__systerm" && this.formModel.type !== "HEAD") {
|
||||
const serviceNumber = this.formModel.serviceNumber;
|
||||
const destinationCode = this.formModel.destinationCode;
|
||||
this.formModel = {
|
||||
@ -281,15 +321,19 @@ export default {
|
||||
tripNumber: val,
|
||||
type: this.formModel.type,
|
||||
serviceNumber: serviceNumber,
|
||||
targetCode: '',
|
||||
category: 'MM'
|
||||
targetCode: "",
|
||||
category: "MM"
|
||||
};
|
||||
}
|
||||
},
|
||||
'formModel.serviceNumber': function(val) {
|
||||
if (this.popClass === 'foshan-01__systerm' && val.length === 3 && this.formModel.tripNumber.length === 2) {
|
||||
"formModel.serviceNumber": function(val) {
|
||||
if (
|
||||
this.popClass === "foshan-01__systerm" &&
|
||||
val.length === 3 &&
|
||||
this.formModel.tripNumber.length === 2
|
||||
) {
|
||||
this.trainNoChange(this.formModel.tripNumber, val);
|
||||
} else if (this.popClass === 'foshan-01__systerm') {
|
||||
} else if (this.popClass === "foshan-01__systerm") {
|
||||
const tripNumber = this.formModel.tripNumber;
|
||||
const destinationCode = this.formModel.destinationCode;
|
||||
this.formModel = {
|
||||
@ -298,8 +342,8 @@ export default {
|
||||
destinationCode: destinationCode,
|
||||
type: this.formModel.type,
|
||||
serviceNumber: val,
|
||||
targetCode: '',
|
||||
category: 'MM'
|
||||
targetCode: "",
|
||||
category: "MM"
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -307,40 +351,40 @@ export default {
|
||||
methods: {
|
||||
loadInitData(map) {},
|
||||
doShow(operate, selected) {
|
||||
this.$root.$emit('dialogOpen', selected);
|
||||
this.$root.$emit("dialogOpen", selected);
|
||||
this.selected = selected;
|
||||
// 如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
const model = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||
const model = this.$store.getters["map/getDeviceByCode"](selected.code);
|
||||
this.serviceNumber = model.serviceNumber;
|
||||
this.formModel = {
|
||||
groupNumber: model.groupNumber,
|
||||
tripNumber: model.tripNumber,
|
||||
type: model.type ? model.type : 'PLAN',
|
||||
type: model.type ? model.type : "PLAN",
|
||||
serviceNumber: model.serviceNumber,
|
||||
destinationCode: model.destinationCode,
|
||||
category: 'MM'
|
||||
category: "MM"
|
||||
};
|
||||
/** 加载列车数据*/
|
||||
this.loadInitData(this.map);
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$nextTick(function() {
|
||||
this.$store.dispatch("training/emitTipFresh");
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$root.$emit('dialogClose', this.selected);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
this.$root.$emit("dialogClose", this.selected);
|
||||
this.$store.dispatch("training/emitTipFresh");
|
||||
this.$store.dispatch("map/setTrainWindowShow", false);
|
||||
},
|
||||
trainNumberChange(groupNumber) {
|
||||
const operate = {
|
||||
groupNumber: groupNumber,
|
||||
operation: ''
|
||||
operation: ""
|
||||
};
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
|
||||
@ -348,37 +392,37 @@ export default {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch("training/nextNew", operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch("menuOperation/handleBreakFlag", { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
trainTypeChange(trainType) {
|
||||
if (trainType === 'HEAD') {
|
||||
this.formModel.serviceNumber = '';
|
||||
} else if (trainType === 'PLAN' && this.serviceNumber) {
|
||||
if (trainType === "HEAD") {
|
||||
this.formModel.serviceNumber = "";
|
||||
} else if (trainType === "PLAN" && this.serviceNumber) {
|
||||
this.formModel.serviceNumber = this.serviceNumber;
|
||||
}
|
||||
const operate = {
|
||||
type: trainType,
|
||||
operation: ''
|
||||
operation: ""
|
||||
};
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
|
||||
}
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch("training/nextNew", operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch("menuOperation/handleBreakFlag", { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
trainNoChange(tripNumber, serviceNumber) {
|
||||
const operate = {
|
||||
tripNumber: tripNumber,
|
||||
operation: ''
|
||||
operation: ""
|
||||
};
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
|
||||
@ -387,30 +431,35 @@ export default {
|
||||
}
|
||||
Handler.undo(1);
|
||||
try {
|
||||
if (this.popClass === 'foshan-01__systerm') {
|
||||
getTrainDetailByStNumber(this.$route.query.group, {tripNumber: tripNumber, serviceNumber: serviceNumber}).then(resp => {
|
||||
if (this.popClass === "foshan-01__systerm") {
|
||||
getTrainDetailByStNumber(this.$route.query.group, {
|
||||
tripNumber: tripNumber,
|
||||
serviceNumber: serviceNumber
|
||||
}).then(resp => {
|
||||
if (resp.data) {
|
||||
this.formModel.destinationCode = resp.data.destinationCode;
|
||||
} else {
|
||||
this.$message.error('未找到输入列车信息!');
|
||||
this.$message.error("未找到输入列车信息!");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
getTrainDetailBytripNumber(this.$route.query.group, {tripNumber:tripNumber}).then(resp => {
|
||||
getTrainDetailBytripNumber(this.$route.query.group, {
|
||||
tripNumber: tripNumber
|
||||
}).then(resp => {
|
||||
if (resp.data) {
|
||||
this.formModel.serviceNumber = resp.data.serviceNumber;
|
||||
this.formModel.destinationCode = resp.data.destinationCode;
|
||||
} else {
|
||||
this.$message.error('未找到输入列车信息!');
|
||||
this.$message.error("未找到输入列车信息!");
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
this.$message.error('获取列车信息失败!');
|
||||
this.$message.error("获取列车信息失败!");
|
||||
}
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch("training/nextNew", operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch("menuOperation/handleBreakFlag", { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -425,33 +474,35 @@ export default {
|
||||
},
|
||||
// 增加列车识别号
|
||||
addTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
const params = {
|
||||
groupNumber: this.formModel.groupNumber,
|
||||
type: this.formModel.type,
|
||||
serviceNumber: '',
|
||||
tripNumber: '',
|
||||
destinationCode: ''
|
||||
serviceNumber: "",
|
||||
tripNumber: "",
|
||||
destinationCode: ""
|
||||
};
|
||||
if (this.formModel.type === 'PLAN') {
|
||||
if (this.formModel.type === "PLAN") {
|
||||
params.serviceNumber = this.formModel.serviceNumber;
|
||||
params.tripNumber = this.formModel.tripNumber;
|
||||
params.destinationCode = this.formModel.destinationCode;
|
||||
} else if (this.formModel.type === 'HEAD') {
|
||||
} else if (this.formModel.type === "HEAD") {
|
||||
params.tripNumber = this.formModel.tripNumber;
|
||||
params.destinationCode = this.formModel.destinationCode;
|
||||
}
|
||||
commitOperate(menuOperate.TrainWindow.addTrainId, params, 2).then(({valid})=>{
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
commitOperate(menuOperate.TrainWindow.addTrainId, params, 2)
|
||||
.then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@ -459,33 +510,35 @@ export default {
|
||||
},
|
||||
// 修改列车识别号
|
||||
editTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
const params = {
|
||||
groupNumber: this.formModel.groupNumber,
|
||||
type: this.formModel.type,
|
||||
serviceNumber: '',
|
||||
tripNumber: '',
|
||||
destinationCode: ''
|
||||
serviceNumber: "",
|
||||
tripNumber: "",
|
||||
destinationCode: ""
|
||||
};
|
||||
if (this.formModel.type === 'PLAN') {
|
||||
if (this.formModel.type === "PLAN") {
|
||||
params.serviceNumber = this.formModel.serviceNumber;
|
||||
params.tripNumber = this.formModel.tripNumber;
|
||||
params.destinationCode = this.formModel.destinationCode;
|
||||
} else if (this.formModel.type === 'HEAD') {
|
||||
} else if (this.formModel.type === "HEAD") {
|
||||
params.tripNumber = this.formModel.tripNumber;
|
||||
params.destinationCode = this.formModel.destinationCode;
|
||||
}
|
||||
commitOperate(menuOperate.TrainWindow.editTrainId, params, 2).then(({valid})=>{
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
commitOperate(menuOperate.TrainWindow.editTrainId, params, 2)
|
||||
.then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@ -495,13 +548,16 @@ export default {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store
|
||||
.dispatch("training/nextNew", operate)
|
||||
.then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -142,6 +142,8 @@ export const IbpOperation = {
|
||||
AXLE_PRE_RESET: {operate: '13', event: 'AXLE_PRE_RESET', name: '计轴预复位'},
|
||||
PRERESET_Z: {operate: '14', event: 'PRERESET_Z', name: '计轴预复零'},
|
||||
SD: {operate: '15', event: 'SD', name: '试灯'},
|
||||
XXGM: {operate: '16', event: 'XXGM', name: '下行屏蔽门开门'},
|
||||
SXGM: {operate: '17', event: 'SXGM', name: '上行屏蔽门开门'},
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -4,7 +4,7 @@ export function getBaseUrl() {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
|
||||
BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线
|
||||
BASE_API = 'http://192.168.3.250:9000'; // 旭强 有线
|
||||
// BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线
|
||||
// BASE_API = 'http://192.168.3.120:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
|
||||
|
@ -1,122 +1,114 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
|
||||
<el-form-item :label="this.$t('ibp.buttonCode')" prop="code">
|
||||
<el-input v-model="form.code" :disabled="true">
|
||||
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{ $t('ibp.generateCode') }}</el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('ibp.buttonColor')" prop="buttonColor">
|
||||
<el-select v-model="form.buttonColor" :placeholder="this.$t('ibp.selectTheButtonColor')">
|
||||
<el-option :label="this.$t('ibp.redButton')" value="red" />
|
||||
<el-option :label="this.$t('ibp.yellowButton')" value="yellow" />
|
||||
<el-option :label="this.$t('ibp.greenButton')" value="green" />
|
||||
<el-option :label="this.$t('ibp.blueButton')" value="blue" />
|
||||
<el-option :label="this.$t('ibp.grayButton')" value="gray" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('ibp.buttonWidth')" prop="buttonWidth">
|
||||
<el-input-number v-model="form.buttonWidth" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('ibp.xCoordinate')">
|
||||
<el-input-number v-model="form.x" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('ibp.yCoordinate')">
|
||||
<el-input-number v-model="form.y" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="操作">
|
||||
<el-select v-model="form.mean" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in operateMeanList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="'AXLE_PRE_RESET' === form.mean" label="关联区段" prop="sectionCode">
|
||||
<el-select v-model="form.sectionCode" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in sectionList"
|
||||
:key="item.code"
|
||||
:label="item.name + '(' + item.code +')'"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="needDirectionItem" label="方向">
|
||||
<el-select v-model="form.direction" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(item, i) in directions"
|
||||
:key="i"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
|
||||
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div>
|
||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
|
||||
<el-form-item :label="this.$t('ibp.buttonCode')" prop="code">
|
||||
<el-input v-model="form.code" :disabled="true">
|
||||
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{
|
||||
$t("ibp.generateCode")
|
||||
}}</el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('ibp.buttonColor')" prop="buttonColor">
|
||||
<el-select v-model="form.buttonColor" :placeholder="this.$t('ibp.selectTheButtonColor')">
|
||||
<el-option :label="this.$t('ibp.redButton')" value="red" />
|
||||
<el-option :label="this.$t('ibp.yellowButton')" value="yellow" />
|
||||
<el-option :label="this.$t('ibp.greenButton')" value="green" />
|
||||
<el-option :label="this.$t('ibp.blueButton')" value="blue" />
|
||||
<el-option :label="this.$t('ibp.grayButton')" value="gray" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('ibp.buttonWidth')" prop="buttonWidth">
|
||||
<el-input-number v-model="form.buttonWidth" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('ibp.xCoordinate')">
|
||||
<el-input-number v-model="form.x" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('ibp.yCoordinate')">
|
||||
<el-input-number v-model="form.y" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="操作">
|
||||
<el-select v-model="form.mean" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in operateMeanList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="'AXLE_PRE_RESET' === form.mean" label="关联区段" prop="sectionCode">
|
||||
<el-select v-model="form.sectionCode" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in sectionList"
|
||||
:key="item.code"
|
||||
:label="item.name + '(' + item.code + ')'"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="needDirectionItem" label="方向">
|
||||
<el-select v-model="form.direction" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(item, i) in directions"
|
||||
:key="i"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{
|
||||
$t("global.delete")
|
||||
}}</el-button>
|
||||
<el-button v-show="showDeleteButton" @click="initPage">{{ $t("global.cancel") }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getSectionListByCenStationCode, getSectionListByMapId } from '@/api/jmap/map';
|
||||
import { getSectionListByCenStationCode, getSectionListByMapId } from "@/api/jmap/map";
|
||||
export default {
|
||||
name: 'ButtonDraft',
|
||||
components: {
|
||||
},
|
||||
name: "ButtonDraft",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
isUpdate: false,
|
||||
buttonText: this.$t('ibp.createNow'),
|
||||
buttonText: this.$t("ibp.createNow"),
|
||||
showDeleteButton: false,
|
||||
operateMeanList: [
|
||||
{ label: '扣车', value: 'KC' },
|
||||
{ label: '终止扣车', value: 'ZZKC' },
|
||||
{ label: '紧急停车', value: 'JJTC' },
|
||||
{ label: '取消紧急停车', value: 'QXJJTC' },
|
||||
{ label: '报警切除', value: 'BJQC' },
|
||||
{ label: '屏蔽门开门', value: 'KM' },
|
||||
{ label: '计轴复位', value: 'AXLE_RESET' },
|
||||
{ label: '计轴预复位', value: 'AXLE_PRE_RESET' },
|
||||
{ label: '计轴预复零', value: 'PRERESET_Z' },
|
||||
{ label: '试灯', value: 'SD' },
|
||||
{ label: "扣车", value: "KC" },
|
||||
{ label: "终止扣车", value: "ZZKC" },
|
||||
{ label: "紧急停车", value: "JJTC" },
|
||||
{ label: "取消紧急停车", value: "QXJJTC" },
|
||||
{ label: "报警切除", value: "BJQC" },
|
||||
{ label: "屏蔽门开门", value: "KM" },
|
||||
{ label: "屏蔽门关门", value: "GM" },
|
||||
{ label: "计轴复位", value: "AXLE_RESET" },
|
||||
{ label: "计轴预复位", value: "AXLE_PRE_RESET" },
|
||||
{ label: "计轴预复零", value: "PRERESET_Z" },
|
||||
{ label: "试灯", value: "SD" }
|
||||
],
|
||||
operateWithoutDirections: ['AXLE_RESET', 'AXLE_PRE_RESET', 'PRERESET_Z', 'SD'],
|
||||
operateWithoutDirections: ["AXLE_RESET", "AXLE_PRE_RESET", "PRERESET_Z", "SD"],
|
||||
form: {
|
||||
code: '',
|
||||
buttonColor: 'red',
|
||||
code: "",
|
||||
buttonColor: "red",
|
||||
buttonWidth: 25,
|
||||
x: 10,
|
||||
y: 10,
|
||||
sectionCode: '',
|
||||
mean: '',
|
||||
direction: null,
|
||||
sectionCode: "",
|
||||
mean: "",
|
||||
direction: null
|
||||
},
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: this.$t('ibp.enterTheButtonCode'), trigger: 'blur' }
|
||||
],
|
||||
buttonColor: [
|
||||
{ required: true, message: this.$t('ibp.selectTheButtonColor'), trigger: 'change'}
|
||||
],
|
||||
buttonWidth: [
|
||||
{ required: true, message: this.$t('ibp.enterTheButtonWidth'), trigger: 'blur' }
|
||||
],
|
||||
sectionCode: [
|
||||
{ required: true, message: '请选择关联区段', trigger: 'blur' }
|
||||
],
|
||||
code: [{ required: true, message: this.$t("ibp.enterTheButtonCode"), trigger: "blur" }],
|
||||
buttonColor: [{ required: true, message: this.$t("ibp.selectTheButtonColor"), trigger: "change" }],
|
||||
buttonWidth: [{ required: true, message: this.$t("ibp.enterTheButtonWidth"), trigger: "blur" }],
|
||||
sectionCode: [{ required: true, message: "请选择关联区段", trigger: "blur" }]
|
||||
},
|
||||
sectionList: [],
|
||||
directions: [
|
||||
{ name: '全部', value: null},
|
||||
{ name: '上行', value: true},
|
||||
{ name: '下行', value: false},
|
||||
],
|
||||
directions: [{ name: "全部", value: null }, { name: "上行", value: true }, { name: "下行", value: false }]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -125,10 +117,10 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.ibp.rightClickCount': function (val) {
|
||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||
if (model._type === 'SquareButton' ) {
|
||||
this.buttonText = this.$t('global.modify');
|
||||
"$store.state.ibp.rightClickCount": function(val) {
|
||||
const model = this.$store.getters["ibp/updateDeviceData"];
|
||||
if (model._type === "SquareButton") {
|
||||
this.buttonText = this.$t("global.modify");
|
||||
this.showDeleteButton = true;
|
||||
this.isUpdate = true;
|
||||
this.form.code = model.code;
|
||||
@ -144,40 +136,44 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
if (this.$route.query.stationCode) {
|
||||
getSectionListByCenStationCode(this.$route.query.mapId, this.$route.query.stationCode).then(resp => {
|
||||
this.sectionList = resp.data;
|
||||
// console.log(resp.data);
|
||||
}).catch(() => {
|
||||
this.$message.error('获取区段列表失败!');
|
||||
});
|
||||
getSectionListByCenStationCode(this.$route.query.mapId, this.$route.query.stationCode)
|
||||
.then(resp => {
|
||||
this.sectionList = resp.data;
|
||||
// console.log(resp.data);
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error("获取区段列表失败!");
|
||||
});
|
||||
} else {
|
||||
getSectionListByMapId(this.$route.query.mapId).then(resp => {
|
||||
this.sectionList = resp.data;
|
||||
console.log(resp.data);
|
||||
}).catch(() => {
|
||||
this.$message.error('获取区段列表失败!');
|
||||
});
|
||||
getSectionListByMapId(this.$route.query.mapId)
|
||||
.then(resp => {
|
||||
this.sectionList = resp.data;
|
||||
console.log(resp.data);
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error("获取区段列表失败!");
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(form) {
|
||||
this.$refs[form].validate((valid) => {
|
||||
this.$refs[form].validate(valid => {
|
||||
if (valid) {
|
||||
const buttonModel = {
|
||||
point: {
|
||||
x: this.form.x,
|
||||
y: this.form.y
|
||||
},
|
||||
_type: 'SquareButton',
|
||||
_type: "SquareButton",
|
||||
code: this.form.code,
|
||||
color: this.form.buttonColor,
|
||||
status: 'off',
|
||||
status: "off",
|
||||
width: this.form.buttonWidth,
|
||||
mean: this.form.mean,
|
||||
sectionCode: this.form.sectionCode,
|
||||
direction: this.form.direction,
|
||||
direction: this.form.direction
|
||||
};
|
||||
this.$emit('createData', buttonModel);
|
||||
this.$emit("createData", buttonModel);
|
||||
this.initPage();
|
||||
} else {
|
||||
return false;
|
||||
@ -190,40 +186,45 @@ export default {
|
||||
x: this.form.x,
|
||||
y: this.form.y
|
||||
},
|
||||
_type: 'SquareButton',
|
||||
_type: "SquareButton",
|
||||
code: this.form.code,
|
||||
color: this.form.buttonColor,
|
||||
status: 'off',
|
||||
status: "off",
|
||||
width: this.form.buttonWidth,
|
||||
mean: this.form.mean,
|
||||
sectionCode: this.form.sectionCode,
|
||||
direction: this.form.direction,
|
||||
direction: this.form.direction
|
||||
};
|
||||
this.$emit('deleteDataModel', buttonModel );
|
||||
this.$emit("deleteDataModel", buttonModel);
|
||||
this.initPage();
|
||||
},
|
||||
initPage() {
|
||||
this.isUpdate = false;
|
||||
this.buttonText = this.$t('ibp.createNow');
|
||||
this.buttonText = this.$t("ibp.createNow");
|
||||
this.showDeleteButton = false;
|
||||
this.form = {
|
||||
code: '',
|
||||
buttonColor: 'red',
|
||||
code: "",
|
||||
buttonColor: "red",
|
||||
buttonWidth: 25,
|
||||
x: 10,
|
||||
y: 10,
|
||||
mean: '',
|
||||
sectionCode: '',
|
||||
direction: null,
|
||||
mean: "",
|
||||
sectionCode: "",
|
||||
direction: null
|
||||
};
|
||||
},
|
||||
generateCode() {
|
||||
const mydate = new Date();
|
||||
this.form.code = 'sButton_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
|
||||
this.form.code =
|
||||
"sButton_" +
|
||||
mydate.getDay() +
|
||||
mydate.getHours() +
|
||||
mydate.getMinutes() +
|
||||
mydate.getSeconds() +
|
||||
mydate.getMilliseconds() +
|
||||
Math.round(Math.random() * 10000);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped></style>
|
||||
|
Loading…
Reference in New Issue
Block a user