修改中建四局(双碳管理页面)

This commit is contained in:
yjl 2022-11-05 15:54:25 +08:00
parent a5a794855b
commit 12327ec2c1
4 changed files with 141 additions and 80 deletions

View File

@ -59,7 +59,7 @@ export default {
height: 25%; height: 25%;
} }
.center { .center {
height: 50%; height: 43%;
} }
.bottom { .bottom {
height: 25%; height: 25%;

View File

@ -3,30 +3,35 @@
<div class="containerBox"> <div class="containerBox">
<div class="dataBoardContent"> <div class="dataBoardContent">
<vue-scroll> <vue-scroll>
<table class="greenTable" v-if="sprayDevList.length > 0"> <table class="greenTable">
<thead> <thead>
<tr> <tr>
<th>设备名称</th>
<th>设备状态</th>
<th>报警类型</th> <th>报警类型</th>
<th>超标值</th> <th>报警名称</th>
<th>喷淋次数</th> <th>设备名称</th>
<th>报警值</th>
<th>阈值</th>
<th>超标时间</th>
<th>超标量</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody v-if="list.length > 0">
<tr v-for="(item, index) in sprayDevList" :key="index"> <tr v-for="(item, index) in list" :key="index">
<td>{{ item.type }}</td>
<td>{{ item.alarmTypeName }}</td>
<td>{{ item.deviceName }}</td> <td>{{ item.deviceName }}</td>
<td>离线</td> <td>{{ item.avgData }}</td>
<td>pm2.5</td> <td>{{ item.alarmValue }}</td>
<td>0.1μg/</td> <td>{{ item.tempAlarmTime }}</td>
<td>1</td> <td>{{ item.exceed }}</td>
</tr> </tr>
</tbody> </tbody>
</table> <div v-else class="noDataDiv">
<div v-else style="margin-top:60px; height: 70%;text-align: center">
<img src="@/assets/images/noData.png" alt="" /> <img src="@/assets/images/noData.png" alt="" />
<p>暂无数据</p> <p>暂无数据</p>
</div> </div>
</table>
<!-- <div class="placeholderBox placeholderBox2" v-if="alarmList.length == 0"> <!-- <div class="placeholderBox placeholderBox2" v-if="alarmList.length == 0">
<img src="@/assets/images/noData3.png" alt srcset /> <img src="@/assets/images/noData3.png" alt srcset />
<p> <p>
@ -41,17 +46,7 @@
</template> </template>
<script> <script>
import { import { environmentDevList, environmentAlarmList, environmentAlarmTypeList } from '@/assets/js/api/environmentManage'
environmentDevList,
selectNewEnvironmentAlarmListApi,
getRealTimeDustNoiseDataApi,
getAirQualityStatisticsApi,
sprayDevListApi,
selectDustNoiseDataApi,
getWeatherDataApi,
getCurrentDayAirQualityApi,
sprayOperateDataApi
} from '@/assets/js/api/environmentManage'
import Card from '../components/Card.vue' import Card from '../components/Card.vue'
export default { export default {
@ -60,66 +55,113 @@ export default {
return { return {
alarmList: [], alarmList: [],
sprayDevList: [], sprayDevList: [],
// alarmList: [ value: true,
// { // list: [{
// deviceName: "", // type:'222222',
// tempAlarmTime: "", // alarmTypeName:'2222222',
// show: true // deviceName:'deviceName',
// }, // avgData:'avgData',
// { // alarmValue:'alarmValue',
// deviceName: "", // tempAlarmTime:'tempAlarmTime',
// tempAlarmTime: "", // exceed:'exceed'
// show: false // }],
// }, list: [],
// { time: [],
// deviceName: "", alarmTypeIdArr: [],
// tempAlarmTime: "", deviceIdArr: [],
// show: false pagInfo: {
// }, pageNo: 1, //
// { pageSize: 10, //
// deviceName: "", total: 0 //
// tempAlarmTime: "", }
// show: true
// },
// {
// deviceName: "",
// tempAlarmTime: "",
// show: false
// },
// ],
value: true
} }
}, },
created() { mounted() {
this.getAlarmList() this.selectNowDate()
this.getSprayDevList() this.getEnvironmentAlarmTypeList()
this.sprayOperate() this.getDevice()
console.log('合并列表数据', dataListNew) this.getList()
}, },
methods: { methods: {
sprayOperate(deviceId, operateType) { // YYYY-MM-DD HH:mm:ss
sprayOperateDataApi({ projectSn: this.$store.state.projectSn, operateType: operateType, deviceId: deviceId }).then(res => { selectNowDate() {
this.sprayDevList = res.result var date = new Date(),
year = date.getFullYear(),
month = date.getMonth() + 1,
day = date.getDate(),
hours = date.getHours(), //(0-23)
minutes = date.getMinutes(), //(0-59)
seconds = date.getSeconds()
month >= 1 && month <= 9 ? (month = '0' + month) : ''
day >= 0 && day <= 9 ? (day = '0' + day) : ''
hours >= 0 && hours <= 9 ? (hours = '0' + hours) : ''
minutes >= 0 && minutes <= 9 ? (minutes = '0' + minutes) : ''
seconds >= 0 && seconds <= 9 ? (seconds = '0' + seconds) : ''
// var timer = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes+ ':' + seconds;
var timer = year + '-' + month + '-' + day
this.time = [timer, timer]
console.log(timer)
// return timer;
},
refresh() {
this.queryInfo = {}
this.time = []
this.pagInfo.pageNo = 1 //
this.pagInfo.pageSize = 10 //
this.getList()
},
query() {
this.queryInfo.startTime = this.time[0]
this.queryInfo.endTime = this.time[1]
this.pagInfo.pageNo = 1
console.log('query', this.queryInfo)
this.getList()
},
getDevice() {
environmentDevList({ projectSn: this.$store.state.projectSn }).then(result => {
if (result.success) {
this.deviceIdArr = result.result
console.log('get设备列表', this.deviceIdArr)
}
}) })
}, },
getSprayDevList() { getList() {
sprayDevListApi({ projectSn: this.$store.state.projectSn }).then(res => { let timeObj = {
this.sprayDevList = res.result startTime: this.time ? this.time[0] : '',
endTime: this.time ? this.time[1] : ''
}
environmentAlarmList(Object.assign(this.pagInfo, { projectSn: this.$store.state.projectSn }, timeObj)).then(result => {
if (result.success) {
this.List = result.result.records
this.pagInfo.total = result.result.total
console.log('报警列表', result)
}
}) })
}, },
// getEnvironmentAlarmTypeList() {
getAlarmList() { environmentAlarmTypeList().then(result => {
let data = { if (result.success) this.alarmTypeIdArr = result.result
projectSn: this.projectSn
}
selectNewEnvironmentAlarmListApi(data).then(res => {
if (res.code == 200) {
this.alarmList = res.result
console.log('报警列表----', this.alarmList)
}
}) })
},
SizeChange(val) {
this.pagInfo.pageSize = val
this.getList()
},
CurrentChange(val) {
this.pagInfo.pageNo = val
this.getList()
} }
//---------
// sprayOperate(deviceId, operateType) {
// sprayOperateDataApi({ projectSn: this.$store.state.projectSn, operateType: operateType, deviceId: deviceId }).then(res => {
// this.sprayDevList = res.result
// })
// },
// getSprayDevList() {
// sprayDevListApi({ projectSn: this.$store.state.projectSn }).then(res => {
// this.sprayDevList = res.result
// })
// },
} }
} }
</script> </script>
@ -135,6 +177,9 @@ export default {
margin-left: 5px; margin-left: 5px;
} }
.greenTable { .greenTable {
width: 100%;
height: 100%;
position: relative;
th { th {
color: #72bdc9; color: #72bdc9;
border-bottom: 1px solid rgba(31, 68, 86, 0.3); border-bottom: 1px solid rgba(31, 68, 86, 0.3);
@ -145,6 +190,22 @@ export default {
color: #fff; color: #fff;
line-height: 35px; line-height: 35px;
} }
margin-right: 15px;
margin-left: -6px;
.noDataDiv {
position: absolute;
width: 100%;
height: 100%;
margin-top: 100px;
img {
text-align: center;
margin-left: 180px;
}
p {
text-align: center;
}
}
} }
.alarmType { .alarmType {
position: relative; position: relative;

View File

@ -311,7 +311,7 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
width: 100%; width: 100%;
height: 35%; height: 37%;
margin:15px 0px 20px 10px; margin:15px 0px 20px 10px;
// margin-top: 5px; // margin-top: 5px;
.leftWaterDiv, .leftWaterDiv,

View File

@ -183,7 +183,7 @@ export default {
width: 99%; width: 99%;
height: 90%; height: 90%;
margin-left: 9px; margin-left: 9px;
margin-top: 4%; margin-top: 1.5%;
} }
::v-deep .el-tree-node__expand-icon { ::v-deep .el-tree-node__expand-icon {