代码调整

This commit is contained in:
joylink_cuiweidong 2022-06-09 11:31:02 +08:00
parent 9425ef8239
commit 36069ec68e

View File

@ -387,6 +387,23 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div v-show="rpMenuPopShow" class="rpMenuPopOut" @click="closeRpMenu">
<div class="rpMenuPop" :style="{'top':rpMenuPopTop+'px'}">
<div class="eachRpMenu">上报到达点</div>
<div class="eachRpMenu">上报出发点</div>
<div class="eachRpMenu">上报通过点</div>
<div class="eachRpMenu">为始发车</div>
<div class="eachRpMenu">为终到车</div>
<div class="eachRpSep" />
<div class="eachRpMenu">上报速报信息</div>
<div class="eachRpMenu">修改车次号</div>
<div class="eachRpMenu">修改相关邻站</div>
<div class="eachRpMenu">删除</div>
<div class="eachRpSep" />
<div class="eachRpMenu">清楚闪烁</div>
<div class="eachRpMenu">全体信息</div>
</div>
</div>
</div> </div>
</div> </div>
<div class="runplanBottom"> <div class="runplanBottom">
@ -471,6 +488,8 @@ export default {
data() { data() {
return { return {
isShow:false, isShow:false,
rpMenuPopShow:false,
rpMenuPopTop:0,
Rpd: Rpd, Rpd: Rpd,
Rpu: Rpu, Rpu: Rpu,
Rpdu: Rpdu, Rpdu: Rpdu,
@ -498,7 +517,7 @@ export default {
}, },
watch:{ watch:{
'$store.state.socket.railCtcRunplanInitMsg': function (val) { '$store.state.socket.railCtcRunplanInitMsg': function (val) {
// debugger; debugger;
const railCtcRunplanInitMsg = this.$store.state.socket.railCtcRunplanInitMsg; const railCtcRunplanInitMsg = this.$store.state.socket.railCtcRunplanInitMsg;
this.tableData = Object.values(railCtcRunplanInitMsg).filter(data=>{ return data.stationCode == this.$store.state.training.roleDeviceCode; }); this.tableData = Object.values(railCtcRunplanInitMsg).filter(data=>{ return data.stationCode == this.$store.state.training.roleDeviceCode; });
} }
@ -509,6 +528,7 @@ export default {
this.filterSectionList = this.sectionList.filter(section=>{ this.filterSectionList = this.sectionList.filter(section=>{
return section.standTrack && section.belongStation == this.$store.state.training.roleDeviceCode; return section.standTrack && section.belongStation == this.$store.state.training.roleDeviceCode;
}); });
this.tableData = [];
const railCtcRunplanInitMsg = JSON.parse(JSON.stringify(this.$store.state.socket.railCtcRunplanInitMsg)); const railCtcRunplanInitMsg = JSON.parse(JSON.stringify(this.$store.state.socket.railCtcRunplanInitMsg));
this.tableData = Object.values(railCtcRunplanInitMsg).filter(data=>{ this.tableData = Object.values(railCtcRunplanInitMsg).filter(data=>{
if (data.departRunPlan) { if (data.departRunPlan) {
@ -587,13 +607,27 @@ export default {
}, },
selectedTripNumber(row, column, cell, event) { selectedTripNumber(row, column, cell, event) {
if (column.property == 'tripNumber') { if (column.property == 'tripNumber') {
if (this.currentRow && this.currentRow.code == row.code) {
this.rpMenuPopShow = true;
const offsetTop = cell.offsetTop;
this.rpMenuPopTop = offsetTop - 202 > 0 ? offsetTop - 380 > 0 ? offsetTop - 202 + 100 : offsetTop - 202 + 190 : offsetTop + 180;
} else {
this.currentRow = row;
// this.rpMenuPopShow = false;
}
console.log(this.currentRow); console.log(this.currentRow);
} else { } else {
this.currentRow = null;
// this.rpMenuPopShow = false;
this.$refs.runplanContentTable.setCurrentRow(); this.$refs.runplanContentTable.setCurrentRow();
} }
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.currentRow = val; },
closeRpMenu() {
this.currentRow = null;
this.$refs.runplanContentTable.setCurrentRow();
this.rpMenuPopShow = false;
} }
} }
}; };
@ -656,6 +690,7 @@ export default {
border-left: 3px #818181 solid; border-left: 3px #818181 solid;
overflow-x: auto; overflow-x: auto;
overflow-y: hidden; overflow-y: hidden;
position: relative;
} }
.runplanBottom{height:261px;background: #efefef;display: inline-block;width: 100%;} .runplanBottom{height:261px;background: #efefef;display: inline-block;width: 100%;}
.runplanBottomL,.runplanBottomC,.runplanBottomR{width:33%;padding: 5px;position: relative;} .runplanBottomL,.runplanBottomC,.runplanBottomR{width:33%;padding: 5px;position: relative;}
@ -831,6 +866,27 @@ export default {
} }
.eachRpImage{display: inline-block;vertical-align: top;margin-top: 3px;} .eachRpImage{display: inline-block;vertical-align: top;margin-top: 3px;}
.eachRpImageIn{height:26px;cursor: pointer;} .eachRpImageIn{height:26px;cursor: pointer;}
.rpMenuPop{
position: absolute;
left: 0px;
background: #f4f4f4;
padding: 5px;
border: 1px #53868b solid;
}
.rpMenuPopOut{
position: absolute;
width:calc(100% - 100px);
height:100%;
left:100px;
top:0;
}
.eachRpMenu{
padding: 5px 20px;font-size:14px;cursor: pointer;
}
.eachRpMenu:hover{
background:#fff;
}
.eachRpSep{width:100%;height:0px;border-top:1px #80a6a9 solid}
</style> </style>
<style lang="scss"> <style lang="scss">
#runplanContentTable.el-table .cell, .el-table--border td:first-child .cell, .el-table--border th:first-child .cell{ #runplanContentTable.el-table .cell, .el-table--border td:first-child .cell, .el-table--border th:first-child .cell{