feat: 增加默认刷新时间

This commit is contained in:
wangjiahao 2021-06-22 12:40:29 +08:00
parent a205bf46f5
commit b85bd443e5
3 changed files with 30 additions and 4 deletions

View File

@ -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: {

View File

@ -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,

View File

@ -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)
}
}
},