南京二号线列监操作调整

This commit is contained in:
fan 2021-10-14 15:34:52 +08:00
parent 5498a7e756
commit a53a4435d6
2 changed files with 49 additions and 16 deletions

View File

@ -7,7 +7,7 @@
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:z-index="2010"
:modal="false"
:close-on-click-modal="false"
append-to-body

View File

@ -162,7 +162,7 @@
<div>
<div style="margin-top: 20px;display: flex;justify-content: space-between;padding: 5px;align-items: center;">
<span>位置</span>
<el-select v-model="nowSectionCode" :popper-append-to-body="false" size="mini" style="width: 150px">
<el-select v-model="nowSectionCode" :disabled="true" :popper-append-to-body="false" size="mini" style="width: 150px">
<el-option
v-for="item in sectionList"
:key="item.code"
@ -177,7 +177,7 @@
</div>
<div style="display: flex;justify-content: space-between;padding: 5px;margin-top: 5px;">
<span>方向</span>
<el-select v-model="direction" :popper-append-to-body="false" size="mini" style="width: 80px">
<el-select v-model="direction" :disabled="true" :popper-append-to-body="false" size="mini" style="width: 80px">
<el-option
v-for="item in directionList"
:key="item.value"
@ -188,14 +188,14 @@
</div>
<div style="display: flex;justify-content: space-between;padding: 5px;margin-top: 5px;">
<span>设置该列车为自动排列</span>
<el-radio v-model="autoArrange" label="true">开启</el-radio>
<el-radio v-model="autoArrange" label="false">关闭</el-radio>
<el-radio v-model="autoArrange" :disabled="true" label="true">开启</el-radio>
<el-radio v-model="autoArrange" :disabled="true" label="false">关闭</el-radio>
</div>
<div style="display: flex;justify-content: space-between;padding: 5px;align-items: center;margin-top: 5px;">
<span>车组号</span>
<el-input v-model="groupNumber1" :maxlength="4" size="mini" style="width: 60px;" />
<el-input v-model="groupNumber1" :disabled="true" :maxlength="4" size="mini" style="width: 60px;" />
<div style="border: 1px solid #DCDFE6;padding: 4px 5px;border-radius: 3px;">&lt;&gt;</div>
<el-input v-model="groupNumber2" :maxlength="4" size="mini" style="width: 60px;" />
<el-input v-model="groupNumber2" :disabled="true" :maxlength="4" size="mini" style="width: 60px;" />
</div>
</div>
</div>
@ -239,7 +239,7 @@
</div>
<div style="display: flex;justify-content: space-between;padding: 5px;align-items: center;">
<span>当前位置</span>
<el-select v-model="nowSectionCode" size="mini" :popper-append-to-body="false" style="width: 150px">
<el-select v-model="nowSectionCode" :disabled="true" size="mini" :popper-append-to-body="false" style="width: 150px">
<el-option
v-for="item in sectionList"
:key="item.code"
@ -262,14 +262,15 @@
</div>
</div>
<div style="display: flex;justify-content: flex-end;margin-top: 10px;border-top: 1px solid #c0c0c0;padding-top: 10px;">
<el-button v-if="operationType === 'update'" size="mini" @click="trainCommit">修改</el-button>
<el-button v-if="operationType === 'update'" size="mini" :disabled="updateDisable" @click="trainCommit">修改</el-button>
<el-button v-if="operationType === 'create'" size="mini" :disabled="createDisable" @click="trainCommit">创建</el-button>
<el-button v-if="operationType === 'delete'" size="mini" @click="trainCommit">删除</el-button>
<el-button v-if="operationType === 'move'" size="mini" @click="trainCommit">步进</el-button>
<el-button v-if="operationType === 'move'" size="mini" :disabled="moveDisable" @click="trainCommit">步进</el-button>
<el-button size="mini" @click="doClose">关闭</el-button>
</div>
</div>
</div>
<notice-info ref="noticeInfo" pop-class="haerbin-01__systerm" />
</div>
<!--</el-dialog>-->
</template>
@ -278,9 +279,13 @@
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
export default {
name: 'RouteCreate',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
@ -314,7 +319,13 @@ export default {
return '列监';
},
createDisable() {
return !(this.groupNumber1 && this.groupNumber1.length === 4 && this.newSectionCode && this.newTrainCode && this.newTrainCode.length === 8);
return !(this.groupNumber1 && this.groupNumber1.length === 4 && this.nowSectionCode && this.newTrainCode && this.newTrainCode.length === 8);
},
updateDisable() {
return !(this.newTrainCode && this.newTrainCode.length === 8);
},
moveDisable() {
return !this.newSectionCode;
}
},
watch: {
@ -338,6 +349,8 @@ export default {
this.nowTrainCode = selected.destinationCode + selected.serviceNumber + (selected.tripNumber.substr(1, 2));
this.nowSectionCode = selected.sectionCode;
this.groupNumber1 = selected.code;
this.direction = selected.right ? 'right' : 'left';
this.operationType = 'show';
}
this.$nextTick(function () {
@ -354,10 +367,22 @@ export default {
this.activeIndex = tab;
},
trainFind() {
// this.$store.state.map.activeTrainList
this.tableData = [];
if (this.trainCode) {
const train = this.$store.getters['map/getDeviceByCode'](this.trainCode);
this.tableData = train ? [train] : [];
} else { this.tableData = []; }
this.$store.state.map.activeTrainList.forEach(item => {
const train = this.$store.getters['map/getDeviceByCode'](item);
const temp = train.destinationCode + train.serviceNumber + (train.tripNumber.substr(1, 2));
if (temp.includes(this.trainCode)) {
this.tableData.push(train);
}
});
} else {
this.$store.state.map.activeTrainList.forEach(item => {
const train = this.$store.getters['map/getDeviceByCode'](item);
this.tableData.push(train);
});
}
this.operationType = 'show';
},
resetTrainCode() {
@ -365,6 +390,9 @@ export default {
this.tableData = [];
},
changeOperationType(type) {
if (type === 'create') {
this.changeShowMode();
}
this.operationType = type;
},
trainCommit() {
@ -373,7 +401,7 @@ export default {
over: true
};
if (this.operationType === 'update') {
params.groupNumber = this.trainModel.groupNumber;
params.groupNumber = this.groupNumber1;
params.serviceNumber = this.newTrainCode.slice(3, 6);
params.tripNumber = '0' + this.newTrainCode.slice(6, 8);
step.cmdType = CMD.TrainWindow.CMD_TRAIN_SET_PLAN;
@ -403,10 +431,12 @@ export default {
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.changeShowMode('');
this.changeShowMode();
}
}).catch((error) => {
this.changeShowMode();
console.error(error);
this.$refs.noticeInfo.doShow(error.message);
});
},
changeShowMode() {
@ -414,6 +444,9 @@ export default {
this.nowSectionCode = '';
this.newSectionCode = '';
this.newTrainCode = '';
this.direction = '';
this.groupNumber1 = '';
this.tableData = [];
},
cancel() {
const operate = {