|
@@ -60,6 +60,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ entrustTimer:null,
|
|
|
roleName: localStorage.getItem("roleName").split(','),
|
|
|
dialogVisible: false,
|
|
|
loading: false,
|
|
@@ -287,6 +288,7 @@ export default {
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
this.map && this.map.destroy();
|
|
|
+ clearInterval(this.entrustTimer); //关闭
|
|
|
},
|
|
|
methods: {
|
|
|
//自定义列保存
|
|
@@ -503,6 +505,12 @@ export default {
|
|
|
},
|
|
|
init() {
|
|
|
this.getsalesTrend();
|
|
|
+ let this_ = this
|
|
|
+ this_.entrustTimer = setInterval(function () {
|
|
|
+ if (JSON.parse(localStorage.getItem("saber-token")).content) {
|
|
|
+ this_.getsalesTrend();
|
|
|
+ }
|
|
|
+ }, 60000)
|
|
|
},
|
|
|
query(data) {
|
|
|
this.getsalesTrend(data)
|
|
@@ -518,7 +526,7 @@ export default {
|
|
|
if (val) return val.replace(/\n/g, '<br/>')
|
|
|
},
|
|
|
refresh() {
|
|
|
- this.init()
|
|
|
+ this.getsalesTrend()
|
|
|
}
|
|
|
}
|
|
|
};
|