|
|
@@ -30,20 +30,10 @@
|
|
|
/>
|
|
|
</el-tabs>
|
|
|
</template>
|
|
|
- <el-result
|
|
|
+ <warning
|
|
|
v-if="!loading && !device"
|
|
|
- icon="warning"
|
|
|
- >
|
|
|
- <template #extra>
|
|
|
- <el-link
|
|
|
- class="u-pointer"
|
|
|
- type="warning"
|
|
|
- @click="getDevice"
|
|
|
- >
|
|
|
- 出错了,点击重试
|
|
|
- </el-link>
|
|
|
- </template>
|
|
|
- </el-result>
|
|
|
+ @retry="getDevice"
|
|
|
+ />
|
|
|
</div>
|
|
|
<div
|
|
|
v-if="device"
|
|
|
@@ -73,7 +63,7 @@ import DeviceInfo from './components/DeviceInfo'
|
|
|
import DeviceStatus from './components/DeviceStatus'
|
|
|
import DeviceAlarm from './components/DeviceAlarm'
|
|
|
import DeviceInvoke from './components/DeviceInvoke'
|
|
|
-import DeviceScreen from './components/DeviceScreen'
|
|
|
+// import ReceivingCard from './components/external/ReceivingCard'
|
|
|
|
|
|
export default {
|
|
|
name: 'DeviceDetail',
|
|
|
@@ -81,10 +71,11 @@ export default {
|
|
|
DeviceInfo,
|
|
|
DeviceStatus,
|
|
|
DeviceAlarm,
|
|
|
- DeviceInvoke,
|
|
|
- DeviceScreen
|
|
|
+ DeviceInvoke/* ,
|
|
|
+ ReceivingCard */
|
|
|
},
|
|
|
data () {
|
|
|
+ const canEdit = this.accessSet.has(this.Access.MANAGE_DEVICES) || this.accessSet.has(this.Access.MANAGE_DEVICE)
|
|
|
return {
|
|
|
loading: true,
|
|
|
device: null,
|
|
|
@@ -95,8 +86,8 @@ export default {
|
|
|
{ key: 'info', label: '设备信息' },
|
|
|
{ key: 'status', label: '运行状态' },
|
|
|
{ key: 'alarm', label: '设备告警' },
|
|
|
- this.accessSet.has(this.Access.MANAGE_DEVICES) || this.accessSet.has(this.Access.MANAGE_DEVICE) ? { key: 'invoke', label: '设备操控' } : null,
|
|
|
- { key: 'screen', label: '屏体状态监测' }
|
|
|
+ canEdit ? { key: 'invoke', label: '设备操控' } : null/* ,
|
|
|
+ { key: 'screen', label: '屏体状态监测' } */
|
|
|
].filter(val => val)
|
|
|
}
|
|
|
},
|
|
|
@@ -136,7 +127,7 @@ export default {
|
|
|
case 'invoke':
|
|
|
return 'DeviceInvoke'
|
|
|
case 'screen':
|
|
|
- return 'DeviceScreen'
|
|
|
+ return 'ReceivingCard'
|
|
|
default:
|
|
|
return ''
|
|
|
}
|
|
|
@@ -162,14 +153,25 @@ export default {
|
|
|
const id = this.deviceId
|
|
|
getDevice(id).then(({ data }) => {
|
|
|
if (this.deviceId === id) {
|
|
|
- this.device = data
|
|
|
- this.isActivated = data.activate === 2
|
|
|
- this.isOnline = this.isActivated && data.onlineStatus === 1
|
|
|
- if (!this.isOnline) {
|
|
|
- ScreenshotCache.remove(id)
|
|
|
+ if (data) {
|
|
|
+ this.device = data
|
|
|
+ this.isActivated = data.activate === 2
|
|
|
+ this.isOnline = this.isActivated && data.onlineStatus === 1
|
|
|
+ if (!this.isOnline) {
|
|
|
+ ScreenshotCache.remove(id)
|
|
|
+ }
|
|
|
+ start(this.device)
|
|
|
+ addListener('online', this.onUpdate)
|
|
|
+ } else {
|
|
|
+ // this.error = false
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '设备不存在'
|
|
|
+ })
|
|
|
+ this.$router.replace({
|
|
|
+ name: 'device-list'
|
|
|
+ })
|
|
|
}
|
|
|
- start(this.device)
|
|
|
- addListener('online', this.onUpdate)
|
|
|
}
|
|
|
}).finally(() => {
|
|
|
if (this.deviceId === id) {
|