var vms = Vue.component("amplify-cjdwfb", {
template: `
`,
props: {
},
data() {
return {
//参见单位分布
seeUnitData: [],
seeUnitInterval: '',
show:false,
rowStyle: {
color: '#B6CFEF',
fontSize: '24px',
height: '64px'
},
headerStyle:{
color: '#B6CFEF',
fontSize: '24px',
height: '64px'
},
showTitle: ""
}
},
mounted(){
this.seeUnitInterval = setInterval(this.seeUnitScroll, 50);
},
methods: {
openAmplify(){
this.show = true
this.getUnitPeopleNum()
},
closeAmplify(){
this.show = false
},
closeAmplifyAll(e){
if(e.target.className == 'amplify-fixed'){
this.show = false
}
},
getUnitPeopleNum() {
axios.post("https://smz.makalu.cc/mkl/screenApi/getCqUnitPeopleNum?token=" + JSON.parse(localStorage.getItem("data")).smz_token + "&deptId=123&typtDeptId=" + JSON.parse(localStorage.getItem("data")).dept_id + "&typtProjectId=" + JSON.parse(localStorage.getItem("data")).id, {}).then(res => {
if (res.data.state == "OK") {
let n = 0
for(let da of res.data.data){
n += da.rs
}
this.showTitle = "人数(" + n +")"
this.seeUnitData = res.data.data
} else {
this.seeUnitData = [];
}
}).catch(err => {
})
},
seeUnitScroll() {
let maxHeight = this.$refs.seeUnit.$el.querySelectorAll('.el-table__body')[0].offsetHeight;
let clientHeight = this.$refs.seeUnit.bodyWrapper.clientHeight;
if (Math.abs(this.$refs.seeUnit.bodyWrapper.scrollTop - (maxHeight - clientHeight)) < 5) { //预留5像素误差
this.$refs.seeUnit.bodyWrapper.scrollTop = 0;
} else {
this.$refs.seeUnit.bodyWrapper.scrollTop += 1;//32是每一行表格的高度,每秒滚一行
}
},
seeUnitMouseEnter() {//鼠标移入停止滚动
clearInterval(this.seeUnitInterval);
},
seeUnitMouseLeave() {//鼠标离开继续滚动
this.seeUnitInterval = setInterval(this.seeUnitScroll, 50);
}
},
watch:{
},
})