Commit f19f3ae2 authored by 李苏's avatar 李苏 💬

定时刷新

parent 9f993c59
<template>
<BasePage :power="power" class="min_full" :config="config">
<BasePage ref='basepage' :power="power" class="min_full" :config="config">
<template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template>
......@@ -9,6 +9,12 @@
<el-button @click="execute(ctx.basePage)" size='mini' type="primary">手动执行</el-button>
<el-button @click="complete(ctx.basePage)" size='mini' type="primary">完成</el-button>
<el-button @click="close(ctx.basePage)" size='mini' type="primary">关闭</el-button>
<div style="float:right;line-height: 28px;font-size: 12px;" > 定时刷新:<el-switch
v-model="doQuery"
active-color="#13ce66"
inactive-color="#eee">
</el-switch></div>
</template>
</BasePage>
......@@ -17,8 +23,25 @@
<script>
// import Edit from './edit.vue'
export default {
watch:{
doQuery(val){
// console.log(this.timer,this)
if(val){
this.timer=setInterval(()=>{
this.$refs.basepage.refresh()
},20000)
}else{
clearInterval(this.timer)
}
}
},
beforeDestroy(){
clearInterval(this.timer)
},
data() {
return {
timer:null,
doQuery:false,
power: {
add: false,
copy: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment