|
|
@@ -140,7 +140,7 @@
|
|
|
v-else
|
|
|
class="has-padding--h"
|
|
|
>
|
|
|
- 当前时段暂无节目
|
|
|
+ {{ item.activate === 2 ? '当前时段暂无节目' : '设备未初始化' }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -328,9 +328,9 @@ export default {
|
|
|
this.getDevices()
|
|
|
},
|
|
|
transform (device) {
|
|
|
- const { id, name } = device
|
|
|
+ const { id, name, activate } = device
|
|
|
return {
|
|
|
- id, name,
|
|
|
+ id, name, activate,
|
|
|
options: {
|
|
|
loading: true,
|
|
|
error: false,
|
|
|
@@ -359,16 +359,20 @@ export default {
|
|
|
getTimeline (device) {
|
|
|
const options = device.options
|
|
|
options.error = false
|
|
|
- options.loading = true
|
|
|
- getTimeline(device.id).finally(() => {
|
|
|
+ if (device.activate === 2) {
|
|
|
+ options.loading = true
|
|
|
+ getTimeline(device.id).finally(() => {
|
|
|
+ options.loading = false
|
|
|
+ }).then(({ data }) => {
|
|
|
+ options.programs = (JSON.parse(data.eventDetail) || []).map(this.createProgram)
|
|
|
+ this._calcPrograms(options)
|
|
|
+ }, () => {
|
|
|
+ options.error = true
|
|
|
+ options.list = []
|
|
|
+ })
|
|
|
+ } else {
|
|
|
options.loading = false
|
|
|
- }).then(({ data }) => {
|
|
|
- options.programs = (JSON.parse(data.eventDetail) || []).map(this.createProgram)
|
|
|
- this._calcPrograms(options)
|
|
|
- }, () => {
|
|
|
- options.error = true
|
|
|
- options.list = []
|
|
|
- })
|
|
|
+ }
|
|
|
},
|
|
|
createProgram ({ programCalendarId, type, startTimestamp, endTimestamp }) {
|
|
|
const startDateTime = new Date(Number(startTimestamp))
|
|
|
@@ -429,7 +433,7 @@ export default {
|
|
|
},
|
|
|
chooseProgram (device, program) {
|
|
|
this.device = device
|
|
|
- this.program = program.origin
|
|
|
+ this.program = program ? program.origin : null
|
|
|
},
|
|
|
onTimeChange (val) {
|
|
|
this.initTimes(val)
|