Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
joylink_zhangsai 2023-05-24 17:00:41 +08:00
commit c90da32501
3 changed files with 78 additions and 92 deletions

View File

@ -322,3 +322,10 @@ export function generateTrainingData(data) {
data: data data: data
}); });
} }
/** 根据mapId获取列车信息 */
export function getTrainListByMapId(mapId) {
return request({
url: `/api/map/${mapId}/trains`,
method: 'get'
});
}

View File

@ -56,14 +56,8 @@
</div> </div>
<div class="alarm-message-All"> <div class="alarm-message-All">
<el-card class="box-card"> <el-card class="box-card">
<el-collapse v-model="activeName" accordion>
<div v-for="(item, index) in alarmDetailMessageGroup" :key="index">
<el-collapse-item>
<template slot="title">
故障汇总{{ item[0].levelNew }}
</template>
<el-table <el-table
:data="item" :data="alarmDetailMessageListShow"
border border
:cell-style="{'text-align':'center'}" :cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}" :header-cell-style="{'text-align':'center'}"
@ -94,20 +88,21 @@
prop="descriptionNew" prop="descriptionNew"
label="信息" label="信息"
/> />
<!-- <el-table-column label="操作" width="90"> <el-table-column
<template slot-scope="scope"> prop="reason"
<el-button label="原因"
size="mini" width="105"
:type="dealAlarmMessage[scope.$index] ? 'success' : 'danger'" />
@click="handleAlarmMessage(scope.$index,scope.row)"
>{{ dealAlarmMessage[scope.$index] ? '已处理' : '未处理' }}</el-button>
</template>
</el-table-column> -->
</el-table> </el-table>
</el-collapse-item> <el-pagination
</div> :current-page="pagination.currentPage"
</el-collapse></el-card> :page-size="2"
</div> :pager-count="8"
layout="total, prev, pager, next"
:total="pagination.total"
@current-change="handleCurrentChange"
/>
</el-card></div>
</el-dialog> </el-dialog>
</div> </div>
@ -138,11 +133,14 @@ export default {
]), ]),
showDecisionMessage:{}, showDecisionMessage:{},
alarmDetailMessageList:[], alarmDetailMessageList:[],
alarmDetailMessageGroup:[], alarmDetailMessageListShow:[],
showAlarmImportantMessage:{}, showAlarmImportantMessage:{},
dealAlarmMessage:[true, false],
alarmReasonMap:[], alarmReasonMap:[],
oldShowAlarmMessage:{} oldShowAlarmMessage:{},
pagination:{
total:1,
currentPage: 1
}
}; };
}, },
computed: { computed: {
@ -157,7 +155,7 @@ export default {
alarmDetailMessage(newValue, oldValue) { alarmDetailMessage(newValue, oldValue) {
if (newValue.length > 0) { if (newValue.length > 0) {
const clone = JSON.parse(JSON.stringify(this.alarmDetailMessage)); const clone = JSON.parse(JSON.stringify(this.alarmDetailMessage));
this.alarmDetailMessageList.push(...clone); this.alarmDetailMessageList.unshift(...clone);
this.alarmDetailMessageList.forEach((item, i)=>{ this.alarmDetailMessageList.forEach((item, i)=>{
this.$set(item, 'show', true); this.$set(item, 'show', true);
}); });
@ -201,7 +199,7 @@ export default {
showAlarmMessage.showDecisionMessage = this.decisionMessage[1]; showAlarmMessage.showDecisionMessage = this.decisionMessage[1];
} }
}); });
const newAlarmMessage = this.alarmDetailMessageList.at(-1); const newAlarmMessage = this.alarmDetailMessageList[0];
if (this.oldShowAlarmMessage.level == undefined) { if (this.oldShowAlarmMessage.level == undefined) {
this.oldShowAlarmMessage = newAlarmMessage; this.oldShowAlarmMessage = newAlarmMessage;
this.showAlarmImportantMessage = newAlarmMessage; this.showAlarmImportantMessage = newAlarmMessage;
@ -211,38 +209,16 @@ export default {
} else { } else {
this.showAlarmImportantMessage = this.oldShowAlarmMessage; this.showAlarmImportantMessage = this.oldShowAlarmMessage;
} }
if (this.alarmDetailMessageGroup.length == 0) { this.alarmDetailMessageListShow = this.alarmDetailMessageList.slice(0, 2);
this.alarmDetailMessageGroup.push([newAlarmMessage]); this.pagination.total = this.alarmDetailMessageList.length;
this.alarmReasonMap.push(newAlarmMessage.reason);
} else if (this.alarmReasonMap.includes(newAlarmMessage.reason)) {
const index = this.alarmReasonMap.indexOf(newAlarmMessage.reason);
this.alarmDetailMessageGroup[index].push(newAlarmMessage);
} else {
this.alarmReasonMap.push(newAlarmMessage.reason);
this.alarmDetailMessageGroup.push([newAlarmMessage]);
}
this.showAlarmMessageList = true; this.showAlarmMessageList = true;
}, },
goToAlarmDetail() { goToAlarmDetail() {
},
handleCurrentChange(page) {
this.pagination.currentPage = page;
this.alarmDetailMessageListShow = this.alarmDetailMessageList.slice((page - 1) * 2, page * 2);
} }
/* handleAlarmMessage(index, row) {
this.$confirm('此操作将处理故障信息, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.dealAlarmMessage.splice(index, 1, !this.dealAlarmMessage[index]);
this.$message({
type: 'success',
message: '处理成功!'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消处理'
});
});
} */
} }
}; };
</script> </script>
@ -283,7 +259,7 @@ export default {
.alarm-message-All{ .alarm-message-All{
margin-top:10px; margin-top:10px;
.box-card{ .box-card{
padding: 0 10px; padding:10px;
} }
} }
.yellow{ .yellow{

View File

@ -33,7 +33,7 @@
</el-card> </el-card>
<div class="scheduling_body"> <div class="scheduling_body">
<div class="scheduling_body-table"> <div class="scheduling_body-table">
<edit-table ref="table" v-loading="loading" border stripe :table-data="tableData" :table-form="tableForm" :row-style="handleRowStyle" /> <edit-table ref="table" v-loading="loading" border stripe :height="maxHeight" :max-height="maxHeight" :table-data="tableData" :table-form="tableForm" :row-style="handleRowStyle" />
</div> </div>
</div> </div>
</div> </div>
@ -41,6 +41,7 @@
<script> <script>
import { querySechedulingNew, generateSchedulingNew, saveSchedulingNew } from '@/api/scheduling'; import { querySechedulingNew, generateSchedulingNew, saveSchedulingNew } from '@/api/scheduling';
import { getTrainListByMapId } from '@/api/jmap/map';
import { hexColor } from '@/jmapNew/theme/parser/util'; import { hexColor } from '@/jmapNew/theme/parser/util';
import EditTable from '@/views/components/editTable/index'; import EditTable from '@/views/components/editTable/index';
export default { export default {
@ -185,16 +186,18 @@ export default {
computed: { computed: {
group() { group() {
return this.$route.query.group; return this.$route.query.group;
},
maxHeight() {
return this.$store.state.app.height - 200;
} }
}, },
watch: { mounted() {
'$store.state.map.mapDataLoadedCount': function () { getTrainListByMapId(this.$route.query.mapId).then(resp => {
const trainList = this.$store.state.map.map.trainList || [];
this.groupNumberList = []; this.groupNumberList = [];
trainList.forEach(item => { resp.data.forEach(item => {
this.groupNumberList.push({value: item.code, label: item.groupNumber}); this.groupNumberList.push({value: item.code, label: item.groupNumber});
}); });
} }).catch(e => console.error(e));
}, },
methods: { methods: {
handleQuery(day) { handleQuery(day) {