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
});
}
/** 根据mapId获取列车信息 */
export function getTrainListByMapId(mapId) {
return request({
url: `/api/map/${mapId}/trains`,
method: 'get'
});
}

View File

@ -56,58 +56,53 @@
</div>
<div class="alarm-message-All">
<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
:data="item"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
style="width: 100%"
max-height="250"
>
<el-table-column
prop="time"
label="时间"
width="100"
/>
<el-table-column
prop="levelNew"
label="级别"
width="70"
/>
<el-table-column
prop="deviceCodeNew"
label="设备"
width="105"
/>
<el-table-column
prop="typeNew"
label="类型"
width="80"
/>
<el-table-column
prop="descriptionNew"
label="信息"
/>
<!-- <el-table-column label="操作" width="90">
<template slot-scope="scope">
<el-button
size="mini"
:type="dealAlarmMessage[scope.$index] ? 'success' : 'danger'"
@click="handleAlarmMessage(scope.$index,scope.row)"
>{{ dealAlarmMessage[scope.$index] ? '已处理' : '未处理' }}</el-button>
</template>
</el-table-column> -->
</el-table>
</el-collapse-item>
</div>
</el-collapse></el-card>
</div>
<el-table
:data="alarmDetailMessageListShow"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
style="width: 100%"
max-height="250"
>
<el-table-column
prop="time"
label="时间"
width="100"
/>
<el-table-column
prop="levelNew"
label="级别"
width="70"
/>
<el-table-column
prop="deviceCodeNew"
label="设备"
width="105"
/>
<el-table-column
prop="typeNew"
label="类型"
width="80"
/>
<el-table-column
prop="descriptionNew"
label="信息"
/>
<el-table-column
prop="reason"
label="原因"
width="105"
/>
</el-table>
<el-pagination
:current-page="pagination.currentPage"
:page-size="2"
:pager-count="8"
layout="total, prev, pager, next"
:total="pagination.total"
@current-change="handleCurrentChange"
/>
</el-card></div>
</el-dialog>
</div>
@ -138,11 +133,14 @@ export default {
]),
showDecisionMessage:{},
alarmDetailMessageList:[],
alarmDetailMessageGroup:[],
alarmDetailMessageListShow:[],
showAlarmImportantMessage:{},
dealAlarmMessage:[true, false],
alarmReasonMap:[],
oldShowAlarmMessage:{}
oldShowAlarmMessage:{},
pagination:{
total:1,
currentPage: 1
}
};
},
computed: {
@ -157,7 +155,7 @@ export default {
alarmDetailMessage(newValue, oldValue) {
if (newValue.length > 0) {
const clone = JSON.parse(JSON.stringify(this.alarmDetailMessage));
this.alarmDetailMessageList.push(...clone);
this.alarmDetailMessageList.unshift(...clone);
this.alarmDetailMessageList.forEach((item, i)=>{
this.$set(item, 'show', true);
});
@ -201,7 +199,7 @@ export default {
showAlarmMessage.showDecisionMessage = this.decisionMessage[1];
}
});
const newAlarmMessage = this.alarmDetailMessageList.at(-1);
const newAlarmMessage = this.alarmDetailMessageList[0];
if (this.oldShowAlarmMessage.level == undefined) {
this.oldShowAlarmMessage = newAlarmMessage;
this.showAlarmImportantMessage = newAlarmMessage;
@ -211,38 +209,16 @@ export default {
} else {
this.showAlarmImportantMessage = this.oldShowAlarmMessage;
}
if (this.alarmDetailMessageGroup.length == 0) {
this.alarmDetailMessageGroup.push([newAlarmMessage]);
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.alarmDetailMessageListShow = this.alarmDetailMessageList.slice(0, 2);
this.pagination.total = this.alarmDetailMessageList.length;
this.showAlarmMessageList = true;
},
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>
@ -283,7 +259,7 @@ export default {
.alarm-message-All{
margin-top:10px;
.box-card{
padding: 0 10px;
padding:10px;
}
}
.yellow{

View File

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