参数收集清单 定时器问题
This commit is contained in:
@@ -755,7 +755,9 @@
|
|||||||
NotSelectedRowKeysValue: [],
|
NotSelectedRowKeysValue: [],
|
||||||
NoEngineer: 1, // 下发收集的权限,0为没有接口人 1为由接口人 默认有
|
NoEngineer: 1, // 下发收集的权限,0为没有接口人 1为由接口人 默认有
|
||||||
NotSelectedNoEngineerValue: [],
|
NotSelectedNoEngineerValue: [],
|
||||||
paramsManifest: {}
|
paramsManifest: {},
|
||||||
|
timeBatch:'',
|
||||||
|
timer:'',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@@ -766,16 +768,44 @@
|
|||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.handleClick()
|
||||||
|
window.addEventListener('keyup',this.handleKeyup)
|
||||||
|
window.addEventListener('click',this.handleClick)
|
||||||
this.GetgetLoginUserType()
|
this.GetgetLoginUserType()
|
||||||
console.log(this.currentPersonRole)
|
|
||||||
if(this.$route.query.type == '1'){
|
if(this.$route.query.type == '1'){
|
||||||
this.handleOkRoleSwitching()
|
this.handleOkRoleSwitching()
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
// clearTimeout(this.timeBatch)
|
||||||
if (this.currentPersonRole == 'dre') {
|
// this.timeBatch = setTimeout(() => {
|
||||||
this.handlePreservation()
|
// if (this.currentPersonRole == 'dre') {
|
||||||
}
|
// this.handlePreservation()
|
||||||
}, 10000)
|
// }
|
||||||
|
// }, 10000)
|
||||||
|
// if (this.currentPersonRole == 'dre') {
|
||||||
|
// this.timeBatch = setInterval(() => {
|
||||||
|
// this.handlePreservation();
|
||||||
|
// }, 10000);
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// var interval = setInterval(this.handlePreservation(),10000);
|
||||||
|
// /* if 5 minutes no operation then logout */
|
||||||
|
// var maxTime = 120; // seconds
|
||||||
|
// var time = maxTime;
|
||||||
|
// $('body').on('keydown mousemove mousedown', function(e) {
|
||||||
|
// time = maxTime; // reset
|
||||||
|
// });
|
||||||
|
// var intervalId = setInterval(function() {
|
||||||
|
// time--;
|
||||||
|
// if (time <= 0) {
|
||||||
|
// ShowInvalidLoginMessage();
|
||||||
|
// clearInterval(intervalId);
|
||||||
|
// }
|
||||||
|
// }, 10000)
|
||||||
|
// function ShowInvalidLoginMessage() {
|
||||||
|
// // 停止定时器
|
||||||
|
// clearInterval(interval);
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
// this.paramsManifest = JSON.parse(localStorage.getItem('paramsManifest'))
|
// this.paramsManifest = JSON.parse(localStorage.getItem('paramsManifest'))
|
||||||
this.paramsManifest = this.$route.query
|
this.paramsManifest = this.$route.query
|
||||||
// document.title = `${this.paramsManifest.title}-` + this.$t('ParameteItemCollectionList')
|
// document.title = `${this.paramsManifest.title}-` + this.$t('ParameteItemCollectionList')
|
||||||
@@ -783,6 +813,37 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapGetters(['userInfo']),
|
...mapGetters(['userInfo']),
|
||||||
|
handleKeyup(){
|
||||||
|
clearTimeout(this.timer)
|
||||||
|
clearTimeout(this.timeBatch)
|
||||||
|
clearTimeout(this.timerOne)
|
||||||
|
this.timer = setTimeout(()=>{
|
||||||
|
if (this.currentPersonRole == 'dre') {
|
||||||
|
this.handlePreservation()
|
||||||
|
}
|
||||||
|
},10000)
|
||||||
|
this.timerOne = setTimeout(()=>{
|
||||||
|
clearTimeout(this.timer)
|
||||||
|
clearTimeout(this.timeBatch)
|
||||||
|
clearTimeout(this.timerOne)
|
||||||
|
},300000)
|
||||||
|
},
|
||||||
|
handleClick(){
|
||||||
|
clearTimeout(this.timer)
|
||||||
|
clearTimeout(this.timeBatch)
|
||||||
|
clearTimeout(this.timerOne)
|
||||||
|
this.timer = setTimeout(()=>{
|
||||||
|
if (this.currentPersonRole == 'dre') {
|
||||||
|
this.handlePreservation()
|
||||||
|
}
|
||||||
|
},10000)
|
||||||
|
this.timerOne = setTimeout(()=>{
|
||||||
|
clearTimeout(this.timer)
|
||||||
|
clearTimeout(this.timeBatch)
|
||||||
|
clearTimeout(this.timerOne)
|
||||||
|
},300000)
|
||||||
|
},
|
||||||
|
|
||||||
handleToggleSearch() {
|
handleToggleSearch() {
|
||||||
this.toggleSearchStatus = !this.toggleSearchStatus
|
this.toggleSearchStatus = !this.toggleSearchStatus
|
||||||
},
|
},
|
||||||
@@ -868,11 +929,35 @@
|
|||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.formInlineRoleSwitching.roleSwitchingCode = this.currentPersonRole
|
this.formInlineRoleSwitching.roleSwitchingCode = this.currentPersonRole
|
||||||
this.$refs.ruleFormRoleSwitching.clearValidate()
|
this.$refs.ruleFormRoleSwitching.clearValidate()
|
||||||
setTimeout(() => {
|
clearTimeout(this.timeBatch)
|
||||||
|
this.timeBatch = setTimeout(() => {
|
||||||
if (this.currentPersonRole == 'dre') {
|
if (this.currentPersonRole == 'dre') {
|
||||||
this.handlePreservation()
|
this.handlePreservation()
|
||||||
}
|
}
|
||||||
}, 10000)
|
}, 10000)
|
||||||
|
// if (this.currentPersonRole == 'dre') {
|
||||||
|
// this.timeBatch = setInterval(() => {
|
||||||
|
// this.handlePreservation();
|
||||||
|
// }, 10000);
|
||||||
|
// var interval = setInterval(this.handlePreservation(),10000);
|
||||||
|
// /* if 5 minutes no operation then logout */
|
||||||
|
// var maxTime = 120; // seconds
|
||||||
|
// var time = maxTime;
|
||||||
|
// $('body').on('keydown mousemove mousedown', function(e) {
|
||||||
|
// time = maxTime; // reset
|
||||||
|
// });
|
||||||
|
// var intervalId = setInterval(function() {
|
||||||
|
// time--;
|
||||||
|
// if (time <= 0) {
|
||||||
|
// ShowInvalidLoginMessage();
|
||||||
|
// clearInterval(intervalId);
|
||||||
|
// }
|
||||||
|
// }, 10000)
|
||||||
|
// function ShowInvalidLoginMessage() {
|
||||||
|
// // 停止定时器
|
||||||
|
// clearInterval(interval);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
GetgetLoginUserType() {
|
GetgetLoginUserType() {
|
||||||
@@ -1588,11 +1673,35 @@
|
|||||||
_this.$message.success(_this.$t('OperationSuccessful'))
|
_this.$message.success(_this.$t('OperationSuccessful'))
|
||||||
this.textLoading = false
|
this.textLoading = false
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
clearTimeout(this.timeBatch)
|
||||||
|
this.timeBatch = setTimeout(() => {
|
||||||
if (this.currentPersonRole == 'dre') {
|
if (this.currentPersonRole == 'dre') {
|
||||||
this.handlePreservation()
|
this.handlePreservation()
|
||||||
}
|
}
|
||||||
}, 10000)
|
}, 10000)
|
||||||
|
// if (this.currentPersonRole == 'dre') {
|
||||||
|
// this.timeBatch = setTimeout(() => {
|
||||||
|
// this.handlePreservation();
|
||||||
|
// }, 10000);
|
||||||
|
// var interval = setInterval(this.handlePreservation(),10000);
|
||||||
|
// /* if 5 minutes no operation then logout */
|
||||||
|
// var maxTime = 120; // seconds
|
||||||
|
// var time = maxTime;
|
||||||
|
// $('body').on('keydown mousemove mousedown', function(e) {
|
||||||
|
// time = maxTime; // reset
|
||||||
|
// });
|
||||||
|
// var intervalId = setInterval(function() {
|
||||||
|
// time--;
|
||||||
|
// if (time <= 0) {
|
||||||
|
// ShowInvalidLoginMessage();
|
||||||
|
// clearInterval(intervalId);
|
||||||
|
// }
|
||||||
|
// }, 10000)
|
||||||
|
// function ShowInvalidLoginMessage() {
|
||||||
|
// // 停止定时器
|
||||||
|
// clearInterval(interval);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
} else {
|
} else {
|
||||||
if (num && num == 1) {
|
if (num && num == 1) {
|
||||||
_this.$message.warning(_this.$t('operationFailed'))
|
_this.$message.warning(_this.$t('operationFailed'))
|
||||||
@@ -1905,6 +2014,10 @@
|
|||||||
SizeChange() {
|
SizeChange() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
destroyed() {
|
||||||
|
// 离开页面结束定时器
|
||||||
|
clearTimeout(this.timeBatch)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user