标签项管理
This commit is contained in:
@@ -164,7 +164,9 @@
|
||||
confirmLoading: false,
|
||||
selectedIds:'', //选择行id
|
||||
record:{},
|
||||
accept:'application/pdf'
|
||||
accept:'application/pdf',
|
||||
today:'',
|
||||
timer:''
|
||||
}
|
||||
},
|
||||
props:{
|
||||
@@ -173,6 +175,20 @@
|
||||
mounted() {
|
||||
// this.loadData()
|
||||
},
|
||||
created() {
|
||||
const date = new Date(),
|
||||
year = date.getFullYear(),
|
||||
month = date.getMonth()+1,
|
||||
myDate = date.getDate()
|
||||
this.today = `${year}/${month < 10 ? '0'+month : month}/${myDate < 10 ? '0'+myDate : myDate}`
|
||||
if(this.timer){
|
||||
clearInterval(this.timer)
|
||||
}else{
|
||||
eventBUs.$emit('searchReset')
|
||||
this.initSetTimeout(this.today)//调用每隔10秒刷新数据
|
||||
}
|
||||
},
|
||||
|
||||
methods:{
|
||||
//上传
|
||||
handleUpload(){
|
||||
@@ -325,8 +341,17 @@
|
||||
},
|
||||
addFormClick() {
|
||||
this.fileVisible = false
|
||||
}
|
||||
}
|
||||
},
|
||||
//10秒刷新页面
|
||||
initSetTimeout(today) {//每隔10秒刷新数据,也就是每隔10秒向后台请求一次数据
|
||||
this.timer=setInterval( () => {
|
||||
eventBUs.$emit('searchReset')
|
||||
}, 10000)
|
||||
},
|
||||
},
|
||||
beforeDestroy(){
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user