赛事定时器

Branch_d40a2540
yujialong 2 years ago
parent 3c66cf33dd
commit b7747dcd9b
  1. 16
      src/pages/match/list/index.vue

@ -233,7 +233,7 @@ export default {
'setPage' 'setPage'
]), ]),
getList() { getList() {
const load = Loading.service() // const load = Loading.service()
const { form } = this const { form } = this
this.$post(this.api.competitionPageConditionQueryByOccupationlab, { this.$post(this.api.competitionPageConditionQueryByOccupationlab, {
pageNum: this.page, pageNum: this.page,
@ -245,7 +245,7 @@ export default {
startTime: form.startTime || null, startTime: form.startTime || null,
publishStatus: form.publishStatus === '' ? null : form.publishStatus publishStatus: form.publishStatus === '' ? null : form.publishStatus
}).then(({ data }) => { }).then(({ data }) => {
load.close() // load.close()
const list = data.records const list = data.records
// //
this.timer = setInterval(() => { this.timer = setInterval(() => {
@ -281,7 +281,7 @@ export default {
this.getData() this.getData()
} }
}).catch(res => { }).catch(res => {
load.close() // load.close()
}) })
}, },
getData() { getData() {
@ -291,12 +291,18 @@ export default {
this.page = 1; this.page = 1;
this.getData(); this.getData();
}, },
// redis
getRedis() {
this.$post(this.api.getRedisCacheCompetition).then(({ data }) => {
data && this.getList()
}).catch(res => {})
},
getData() { getData() {
this.getList() this.getList()
if (!Setting.isDev) { // if (!Setting.isDev) {
clearInterval(this.redisTimer) clearInterval(this.redisTimer)
this.redisTimer = setInterval(this.getRedis, 1000) this.redisTimer = setInterval(this.getRedis, 1000)
} // }
}, },
add() { add() {
this.$router.push("/match/add"); this.$router.push("/match/add");

Loading…
Cancel
Save