var vms = Vue.component("amplify-dkgk", {
template: `
`,
props: {
},
data() {
return {
show:false,
//打卡管控提示
abnormalNav:0,
//打卡管控提示 表格数据
interval:'',
intervalOne:'',
rowStyle:{
color:'#ffffff',
fontSize:'24px',
height:'64px'
},
tableData:[],
tableTile:[],
showTableData:[],
showTableTile: [],
headerRow:{
fontSize: '20px'
}
}
},
mounted(){
// //打卡管控提示 自动滚动
this.interval = setInterval(this.scroll,50);
},
methods: {
openAmplify(){
this.show = true
this.getClockInException()
},
closeAmplify(){
this.show = false
},
closeAmplifyAll(e){
if(e.target.className == 'amplify-fixed'){
this.show = false
}
},
//打卡管控提示
onAbnormalNav(n){
this.abnormalNav = n;
this.showTableData = this.tableData[n];
this.showTableTile = this.tableTile[n];
},
//打卡管控提示
getClockInException(){
axios.post(requestUrl+"getClockInException?deptId="+deptId+"&projectId="+JSON.parse(localStorage.getItem("data")).jzgj+"&pageSize=50", {
}).then(res => {
this.tableData = [
res.data.data.signExceptionList,
res.data.data.workTimeExceptionList,
res.data.data.certExceptionList
]
this.tableTile = [
[{name:"项目名称",value:"projectName"},{name:"姓名",value:"userName"},{name:"打卡设备",value:"deviceName"},{name:"打卡时间",value:"dataTime"}],
[{name:"项目名称",value:"projectName"},{name:"设备名称",value:"deviceName"},{name:"异常原因",value:"errorReason"},{name:"打卡时间",value:"date"}],
[{name:"项目名称",value:"projectAbbreviation"},{name:"姓名",value:"certificateName"},{name:"过期天数",value:"date"},{name:"到期时间",value:"validityDate"}]
];
let num = 0;
if(res.data.data.signExceptionList.length > 0){
num = 0;
}else if(res.data.data.workTimeExceptionList.length > 0){
num = 1;
}else if(res.data.data.certExceptionList.length >0){
num = 2
}else{
num = 0;
}
this.abnormalNav = num;
this.showTableData = this.tableData[num];
this.showTableTile = this.tableTile[num];
}).catch(err => {
})
},
// 表格滚动 方法 --------- 开始
scroll(){
let maxHeight=this.$refs.wgzp.$el.querySelectorAll ('.el-table__body')[0].offsetHeight;
let clientHeight=this.$refs.wgzp.bodyWrapper.clientHeight;
if(Math.abs(this.$refs.wgzp.bodyWrapper.scrollTop-(maxHeight-clientHeight))<5){ //预留5像素误差
this.$refs.wgzp.bodyWrapper.scrollTop=0;
}else{
this.$refs.wgzp.bodyWrapper.scrollTop+= 1;//32是每一行表格的高度,每秒滚一行
}
},
MouseEnter(){//鼠标移入停止滚动
clearInterval(this.interval);
},
MouseLeave(){//鼠标离开继续滚动
this.interval=setInterval(this.scroll,30);
},
// 表格滚动 方法 ------ 结束
},
watch:{
},
})