forked from github/dataease
feat: 增加默认刷新时间
This commit is contained in:
parent
a205bf46f5
commit
b85bd443e5
@ -20,6 +20,7 @@
|
||||
:style="getComponentStyleDefault(config.style)"
|
||||
:prop-value="config.propValue"
|
||||
:element="config"
|
||||
:search-count="searchCount"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -42,6 +43,11 @@ export default {
|
||||
type: Object,
|
||||
require: false,
|
||||
default: null
|
||||
},
|
||||
searchCount: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -7,6 +7,7 @@
|
||||
v-for="(item, index) in componentDataInfo"
|
||||
:key="index"
|
||||
:config="item"
|
||||
:search-count="searchCount"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -57,7 +58,8 @@ export default {
|
||||
timer: null,
|
||||
componentDataShow: [],
|
||||
mainWidth: '100%',
|
||||
mainHeight: '100%'
|
||||
mainHeight: '100%',
|
||||
searchCount: -1
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -108,10 +110,17 @@ export default {
|
||||
_this.restore()
|
||||
})
|
||||
})
|
||||
// 数据刷新计时器
|
||||
let refreshTime = 60000
|
||||
if (this.canvasStyleData.refreshTime && this.canvasStyleData.refreshTime > 0) {
|
||||
refreshTime = this.canvasStyleData.refreshTime * 1000
|
||||
}
|
||||
this.timer = setInterval(() => {
|
||||
this.searchCount++
|
||||
}, refreshTime)
|
||||
},
|
||||
created() {
|
||||
// 先清除查询条件
|
||||
// this.$store.dispatch('conditions/clear')
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
changeStyleWithScale,
|
||||
|
@ -54,6 +54,11 @@ export default {
|
||||
default: function() {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
searchCount: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -123,6 +128,12 @@ export default {
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
// 监听外部计时器变化
|
||||
searchCount: function(val1) {
|
||||
if (val1 > 0) {
|
||||
this.getData(this.element.propValue.viewId)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user