var vms = Vue.component("amplify-jkycyj", {
template: `
`,
props: {
},
data() {
return {
show:false,
//监控异常预警
showTableDataOne:[],
showTableTileOne: [],
rowStyleOne:{
color:'#ffffff',
fontSize:'24px',
height:'64px'
},
headerRowOne:{
fontSize: '20px'
}
}
},
mounted(){
this.intervalOne = setInterval(this.scrollOne,50);
},
methods: {
openAmplify(){
this.show = true
this.getExceptionAlert()
this.getDeviceWarnData()
},
closeAmplify(){
this.show = false
},
closeAmplifyAll(e){
if(e.target.className == 'amplify-fixed'){
this.show = false
}
},
getExceptionAlert(){
axios.get(requestUrl+"getExceptionAlert?deptId="+deptId+"&projectId="+JSON.parse(localStorage.getItem("data")).jzgj+"&size=10", {
}).then(res => {
this.showTableDataOne = res.data;
this.showTableTileOne = [{name:"归属项目",value:"project_abbreviation"},{name:"机械名称",value:"device_name"},{name:"预警类型",value:"alarm_type_name"},{name:"预警地址",value:"address"}];
this.getDeviceWarnData();
}).catch(err => {
})
},
getDeviceWarnData(){
//安全预警
axios.get("https://aqzg.makalu.cc/api/statistics/getDeviceWarnData",{params:{"deptId":131,"projectId":JSON.parse(localStorage.getItem("data")).aqzg}}
).then(res => {
if(res.data.length>0){
let objArray = [];
for(let i = 0;i {
});
},
//表格滚动
scrollOne(){
let maxHeight=this.$refs.wgzpOne.$el.querySelectorAll ('.el-table__body')[0].offsetHeight;
let clientHeight=this.$refs.wgzpOne.bodyWrapper.clientHeight;
if(Math.abs(this.$refs.wgzpOne.bodyWrapper.scrollTop-(maxHeight-clientHeight))<5){ //预留5像素误差
this.$refs.wgzpOne.bodyWrapper.scrollTop=0;
}else{
this.$refs.wgzpOne.bodyWrapper.scrollTop+= 1;//32是每一行表格的高度,每秒滚一行
}
},
MouseEnterOne(){//鼠标移入停止滚动
clearInterval(this.intervalOne);
},
MouseLeaveOne(){//鼠标离开继续滚动
this.intervalOne=setInterval(this.scrollOne,50);
}
},
watch:{
},
})