Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly1

This commit is contained in:
fan 2023-02-06 14:15:38 +08:00
commit 639607e72a
3 changed files with 442 additions and 2 deletions

View File

@ -0,0 +1,340 @@
<template>
<div>
<table>
<tr>
<td colspan="10" align="center">非正常情况接发列车关键环节控制表</td>
</tr>
<tr>
<td colspan="2">
<div class="td-div">
<span>值班员</span>
<div class="td-div-input">
<el-input v-model="form.supervisor" size="mini" :disabled="!isCreat" />
</div>
</div>
</td>
<td colspan="2">
<div class="td-div">
<span>干部上岗是由</span>
<div class="td-div-input">
<el-input v-model="form.cadresPost" size="mini" :disabled="!isCreat" />
</div>
</div></td>
<td colspan="2">
<div class="td-div">
<span>监控干部</span>
<div class="td-div-input">
<el-input v-model="form.monitorCadres" size="mini" :disabled="!isCreat" />
</div>
</div></td>
<td colspan="2">
<div class="td-div">
<span>天气</span>
<div class="td-div-input">
<el-input v-model="form.weather" size="mini" :disabled="!isCreat" />
</div>
</div></td>
<td colspan="2">
<div class="td-div">
<span>日期</span>
<div class="td-div-input">
<!-- <el-input v-model="form.registerDate" size="mini" :disabled="!isCreat" /> -->
<el-date-picker v-model="form.registerDate" type="date" size="mini" format="yyyy年MM月dd日" value-format="yyyy年MM月dd日" placeholder="选择日期" class="autoWidth" :disabled="!isCreat" />
</div>
</div></td>
</tr>
<tr>
<td colspan="2" align="center">
<p>通知干部上岗
<br>
<el-input v-model="form.noticeCadresTime.hour" oninput="value=value.replace(/[^\d]/g,'')" size="mini" class="timeInput" :disabled="!isCreat" />
<el-input v-model="form.noticeCadresTime.minute" oninput="value=value.replace(/[^\d]/g,'')" size="mini" class="timeInput" :disabled="!isCreat" />
</p>
</td>
<td colspan="2" align="center">
<p>报告列车调度员
<br>
<el-input v-model="form.reportDispatcherTime.hour" oninput="value=value.replace(/[^\d]/g,'')" size="mini" class="timeInput" :disabled="!isCreat" />
<el-input v-model="form.reportDispatcherTime.minute" oninput="value=value.replace(/[^\d]/g,'')" size="mini" class="timeInput" :disabled="!isCreat" />
</p>
</td>
<td colspan="2" align="center">
<p>报告指挥中心
<br>
<el-input v-model="form.reportCommandCentreTime.hour" oninput="value=value.replace(/[^\d]/g,'')" size="mini" class="timeInput" :disabled="!isCreat" />
<el-input v-model="form.reportCommandCentreTime.minute" oninput="value=value.replace(/[^\d]/g,'')" size="mini" class="timeInput" :disabled="!isCreat" />
</p>
</td>
<td colspan="2" align="center">
<p>监控干部到岗
<br>
<el-input v-model="form.monitorArriveTime.hour" oninput="value=value.replace(/[^\d]/g,'')" size="mini" class="timeInput" :disabled="!isCreat" />
<el-input v-model="form.monitorArriveTime.minute" oninput="value=value.replace(/[^\d]/g,'')" size="mini" class="timeInput" :disabled="!isCreat" />
</p>
</td>
<td colspan="2" align="center">
<p>安排工作人员
<br>
<span style="display: inline-block; width: 50px; text-align-last: justify;">岗人</span>
</p>
</td>
</tr>
<tr>
<td align="center">登记单位</td>
<td align="center">运统46登记</td>
<td align="center">运统46签认</td>
<td align="center">报告列车调度员</td>
<td colspan="2" align="center">调度命令核对接收</td>
<td colspan="2" align="center">运统46到点签认</td>
<td align="center">运统46销记签认</td>
<td align="center">调度命令核对接收</td>
</tr>
<tr v-for="(item, index) in form.registerInfoList" :key="index">
<td><el-input v-model="item.departmentName" size="mini" :disabled="!isCreat" /></td>
<td><el-input v-model="item.registration" size="mini" :disabled="!isCreat" /></td>
<td>
<el-select v-model="item.reportSign" size="mini" class="autoWidth" :disabled="!isCreat">
<el-option
v-for="every in Whether"
:key="every.value"
:label="every.label"
:value="every.value"
/>
</el-select>
</td>
<td>
<el-select v-model="item.reportDispatcher" size="mini" class="autoWidth" :disabled="!isCreat">
<el-option
v-for="every in Whether"
:key="every.value"
:label="every.label"
:value="every.value"
/>
</el-select></td>
<td colspan="2">
<el-select v-model="item.centerDispatchCommandCheck" size="mini" class="autoWidth" :disabled="!isCreat">
<el-option
v-for="every in Whether"
:key="every.value"
:label="every.label"
:value="every.value"
/>
</el-select></td>
<td colspan="2">
<el-select v-model="item.monitorArrive" size="mini" class="autoWidth" :disabled="!isCreat">
<el-option
v-for="every in Whether"
:key="every.value"
:label="every.label"
:value="every.value"
/>
</el-select></td>
<td>
<el-select v-model="item.writeOff" size="mini" class="autoWidth" :disabled="!isCreat">
<el-option
v-for="every in Whether"
:key="every.value"
:label="every.label"
:value="every.value"
/>
</el-select></td>
<td>
<el-select v-model="item.workerDispatchCommandCheck" size="mini" class="autoWidth" :disabled="!isCreat">
<el-option
v-for="every in Whether"
:key="every.value"
:label="every.label"
:value="every.value"
/>
</el-select></td>
</tr>
<tr>
<td colspan="10">1.以上内容只对涉及的项目监控后划2.车务发现或接到报告设备故障时可立即报告列车调度员然后登记有关单位签认</td>
</tr>
<tr>
<td colspan="10">故障施工天窗维修作业内容<el-input v-model="form.faultContent" type="textarea" autosize size="mini" :disabled="!isCreat" /></td>
</tr>
<tr>
<td colspan="2">区间闭塞封闭情况</td>
<td colspan="8"><el-input v-model="form.sectionContent" size="mini" :disabled="!isCreat" /></td>
</tr>
<tr>
<td colspan="2">接车进路准备方式</td>
<td colspan="8"><el-input v-model="form.pickRoutePrepareContent" size="mini" :disabled="!isCreat" /></td>
</tr>
<tr>
<td colspan="2">接车信号</td>
<td colspan="8"><el-input v-model="form.pickSignal" size="mini" :disabled="!isCreat" /></td>
</tr>
<tr>
<td colspan="2">发车进路准备方式发车凭证</td>
<td colspan="8"><el-input v-model="form.departRoutePrepareContent" size="mini" :disabled="!isCreat" /></td>
</tr>
<tr>
<td colspan="2">其他关键环节</td>
<td colspan="8"><el-input v-model="form.otherKeyLinkContent" size="mini" :disabled="!isCreat" /></td>
</tr>
</table>
<div v-if="isCreat" class="footer">
<el-button type="primary" size="mini" @click="submit">提交</el-button>
</div>
</div>
</template>
<script>
import { deepAssign } from '@/utils/index';
export default {
name: 'ControlTable',
props: {
info:{
type: Object,
default() {
return {};
}
},
isCreat: {
type: Boolean,
default() {
return false;
}
}
},
data() {
return {
Whether: [{ label: '否', value: false }, { label: '是', value: true }],
form: {}
};
},
computed: {
stationCode() {
return this.$store.state.training.roleDeviceCode;
}
},
created() {
if (this.isCreat) {
this.initFormData();
} else {
this.getInfoData();
}
},
methods: {
inputLimit(value) {
console.log('🚀 ~ file: controlTable.vue:223 ~ inputLimit ~ value', value);
let val = value.replace(/[^\d]/g, '');
if (Number(val) > 23) { val = 23; } else if (Number(val) < 0) { val = 0; } value = `${val}`;
},
initRegisterInfoData() {
const list = [];
const nameArr = ['车务电工', '工 务', '供 电', '通 信', '', '其他()'];
nameArr.forEach(name => {
const obj = {
departmentName: name,
registration: '',
reportSign: '',
reportDispatcher: '',
centerDispatchCommandCheck: '',
monitorArrive: '',
writeOff: '',
workerDispatchCommandCheck: ''
};
list.push(obj);
});
return list;
},
getInfoData() {
Object.keys(this.info).forEach(key => {
this.form[key] = this.info[key];
});
},
submit() {
const obj = deepAssign({}, this.form);
const list = [];
delete obj.id;
obj.stationCode = this.stationCode;
obj.registerInfoList.forEach(item => {
const s = Object.values(item).every(ii => {
return ii == '';
});
if (!s) {
list.push(item);
}
});
obj.registerInfoList = list;
this.$emit('creat', obj);
this.initFormData();
},
initFormData() {
this.form = {
id: '',
stationCode: '',
supervisor: '',
cadresPost: '',
monitorCadres: '',
weather: '',
registerDate: '',
noticeCadresTime: { //
hour: '',
minute: ''
},
reportDispatcherTime: { //
hour: '',
minute: ''
},
reportCommandCentreTime: { //
hour: '',
minute: ''
},
monitorArriveTime: { //
hour: '',
minute: ''
},
registerInfoList: this.initRegisterInfoData(), //
faultContent: '',
sectionContent: '',
pickRoutePrepareContent: '',
pickSignal: '',
departRoutePrepareContent: '',
otherKeyLinkContent: ''
};
}
}
};
</script>
<style scoped lang="scss">
table {
table-layout: fixed;
border-collapse: collapse;
border-spacing: 0;
td {
padding: 5px;
border: 1px solid black !important;
}
}
.td-div {
white-space:nowrap;
display: flex;
align-items: center;
.td-div-input {
width: 100%;
}
}
.timeInput {
width: 40px;
/deep/ .el-input__inner {
padding: 0 10px !important;
border: none !important;
border-radius: 0px;
border-bottom: 1px solid #DCDFE6 !important;
}
}
.autoWidth {
width: 100%;
}
.footer {
height: 50px;
display: flex;
justify-content: center;
align-items: center;
}
</style>

View File

@ -0,0 +1,96 @@
<template>
<div>
<el-tabs v-model="activeName" type="card">
<el-tab-pane label="填写" name="write">
<div class="write-box">
<ControlTable :is-creat="true" @creat="creatData" />
</div>
</el-tab-pane>
<el-tab-pane label="查询" name="search">
<div v-if="activeName == 'search'" class="search-box">
<div v-for="(item, index) in searchList" :key="index" class="search-item">
<ControlTable :is-creat="false" :info="item" />
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import ControlTable from './controlTable';
import { sendCommandNew } from '@/api/jmap/training';
import { UserOperationType } from '@/scripts/ConstDic';
export default {
name: 'AbnormalTrain',
components: {
ControlTable
},
data() {
return {
activeName: 'write',
searchList: []
};
},
computed: {
group() {
return this.$route.query.group;
}
},
watch: {
activeName() {
if (this.activeName == 'search') {
this.getSearchList();
}
}
},
created() {
},
methods: {
creatData(obj) {
const operate = {
param: obj,
userOperationType: UserOperationType.LEFTCLICK
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
sendCommandNew(this.group, 'KEY_LINK_CONTROL_INFO_SAVE', obj).then((res) => {
console.log(res, '---res');
}).catch(error => {
console.log('🚀 ~ file: index.vue:51 ~ sendCommandNew ~ error', error);
this.$messageBox('提交失败:' + error.message);
});
}
});
},
getSearchList() {
const params = { stationCode: this.$store.state.training.roleDeviceCode};
sendCommandNew(this.group, 'KEY_LINK_CONTROL_INFO_QUERY', params).then((res) => {
console.log(res, '-QUERY--res');
this.searchList = res.data;
}).catch(error => {
console.log('查询失败!', error);
});
}
}
};
</script>
<style scoped >
.write-box {
height: 760px;
overflow: auto;
display: flex;
justify-content: center;
}
.search-box {
height: 760px;
overflow: auto;
display: flex;
flex-direction: column;
align-items: center;
}
.search-item {
margin: 10px;
}
</style>

View File

@ -101,7 +101,9 @@
<el-tab-pane label="防洪安全上岗签到表">
<flood-control-safety-table />
</el-tab-pane>
<el-tab-pane label="非正常情况接发列车关键环节控制表">非正常情况接发列车关键环节控制表</el-tab-pane>
<el-tab-pane label="非正常情况接发列车关键环节控制表">
<AbnormalTrain />
</el-tab-pane>
</el-tabs>
</div>
</template>
@ -111,13 +113,15 @@ import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuO
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import FloodControlSafetyTable from './floodControlSafetyTable';
import EquipmentConstructionTable from './equipmentConstructionTable';
import AbnormalTrain from './abnormalTrain/index';
// key-link-control-table
export default {
name: 'Index',
components:{
EquipmentConstructionTable,
FloodControlSafetyTable
FloodControlSafetyTable,
AbnormalTrain
},
data() {
return {