var vms = Vue.component("Company-amplify-yjfx", {
template: `
{{scope.row.overage}}
{{scope.row.fifteenDays}}
{{scope.row.thirtyDays}}
`,
props: {
},
data() {
return {
show:false,
//预警分析
warningInterval:'',
clTotal:0,
qqTotal:0,
warningTableData:[],
cellStyle:{
color:'#B6CFEF',
fontSize:'24px',
height:'64px',
},
headerStyle:{
color: '#B6CFEF',
fontSize: '20px',
height: '64px'
},
}
},
mounted(){
},
methods: {
openAmplify(){
this.show = true
this.getWarnList()
//预警分析
this.warningInterval = setInterval(this.warningScroll,50);
},
closeAmplify(){
this.show = false
},
closeAmplifyAll(e){
if(e.target.className == 'amplify-fixed'){
this.show = false
}
},
getWarnList(){
var that = this
axios.post("https://smz.makalu.cc/mkl/screenApi/getYichangData?token=00e650bb50854f54b146e83f73500ca8&deptId=123&typtDeptId="+JSON.parse(localStorage.getItem("data")).dept_id, {
}).then(res => {
var data = res.data.yichangData
var clTotal = 0;
var qqTotal = 0;
data.map(x => {
clTotal+=x.clnum;
qqTotal+=x.shiwuDay;
x.projectName = x.project_shorthand;
x.overage = x.clnum;
x.fifteenDays = x.shiwuDay;
x.thirtyDays = x.sanshiDay;
return x;
})
that.clTotal = clTotal;
that.qqTotal = qqTotal;
that.warningTableData = data;
}).catch(err => {
})
},
// 表格滚动 方法 --------- 开始
warningScroll(){
let maxHeight=this.$refs.warning.$el.querySelectorAll ('.el-table__body')[0].offsetHeight;
let clientHeight=this.$refs.warning.bodyWrapper.clientHeight;
if(Math.abs(this.$refs.warning.bodyWrapper.scrollTop-(maxHeight-clientHeight))<5){ //预留5像素误差
this.$refs.warning.bodyWrapper.scrollTop=0;
}else{
this.$refs.warning.bodyWrapper.scrollTop+= 1;//32是每一行表格的高度,每秒滚一行
}
},
warningMouseEnter(){//鼠标移入停止滚动
clearInterval(this.warningInterval);
},
warningMouseLeave(){//鼠标离开继续滚动
this.warningInterval=setInterval(this.warningScroll,30);
},
// 表格滚动 方法 ------ 结束
},
watch:{
},
})