|
|
@@ -341,11 +341,13 @@ export default {
|
|
|
},
|
|
|
getTimeline () {
|
|
|
this.loadingTimeline = true
|
|
|
- getTimeline(this.device.id).then(({ data }) => {
|
|
|
+ getTimeline(this.device.id, { custom: true }).then(({ data }) => {
|
|
|
this.timeline = (JSON.parse(data.eventDetail) || []).map(this.createItem)
|
|
|
this.checkTimeline()
|
|
|
- }).catch(() => {
|
|
|
- this.$timer = setTimeout(this.getTimeline, 2000)
|
|
|
+ }).catch(({ isCancel }) => {
|
|
|
+ if (!isCancel) {
|
|
|
+ this.$timer = setTimeout(this.getTimeline, 2000)
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
checkTimeline () {
|
|
|
@@ -374,7 +376,7 @@ export default {
|
|
|
if (item.name) {
|
|
|
return Promise.resolve(item.name)
|
|
|
}
|
|
|
- return (item.type === 1 ? getProgram : getSchedule)(item.id).then(({ name }) => name)
|
|
|
+ return (item.type === 1 ? getProgram : getSchedule)(item.id, { custom: true }).then(({ name }) => name)
|
|
|
}
|
|
|
return Promise.resolve('未知')
|
|
|
},
|
|
|
@@ -383,8 +385,10 @@ export default {
|
|
|
this.getName(this.current).then(name => {
|
|
|
this.current.name = name
|
|
|
this.finishTimeline()
|
|
|
- }).catch(() => {
|
|
|
- this.$timer = setTimeout(this.getDetail, 2000)
|
|
|
+ }).catch(({ isCancel }) => {
|
|
|
+ if (!isCancel) {
|
|
|
+ this.$timer = setTimeout(this.getDetail, 2000)
|
|
|
+ }
|
|
|
})
|
|
|
} else {
|
|
|
this.finishTimeline()
|