|
|
@@ -47,6 +47,8 @@ export default {
|
|
|
label: 'name'
|
|
|
}
|
|
|
|
|
|
+ const canEdit = this.accessSet.has(Access.MANAGE_DEVICE)
|
|
|
+
|
|
|
return {
|
|
|
ratio: null,
|
|
|
schema: {
|
|
|
@@ -60,53 +62,43 @@ export default {
|
|
|
{ key: 'name', type: 'search', placeholder: '设备名称' }
|
|
|
],
|
|
|
cols: [
|
|
|
- {
|
|
|
- type: 'refresh',
|
|
|
- render (data, h) {
|
|
|
- return data.isMaster
|
|
|
- ? h('i', {
|
|
|
- staticClass: `o-expand-icon u-pointer ${data.loading ? 'el-icon-loading' : 'el-icon-arrow-right'}`,
|
|
|
- class: { expand: data.expand }
|
|
|
- })
|
|
|
- : null
|
|
|
- }
|
|
|
- },
|
|
|
- { label: '设备名称', 'min-width': 120,
|
|
|
- render (data, h) {
|
|
|
- return data.empty ? h('span', { staticClass: 'u-color--info' }, '暂无备份设备') : data.name
|
|
|
- }
|
|
|
- },
|
|
|
- { prop: 'productName', label: '产品', 'min-width': 80 },
|
|
|
+ { type: 'refresh', render (data, h) {
|
|
|
+ return data.isMaster
|
|
|
+ ? h('i', {
|
|
|
+ staticClass: `o-expand-icon u-pointer ${data.loading ? 'el-icon-loading' : 'el-icon-arrow-right'}`,
|
|
|
+ class: { expand: data.expand }
|
|
|
+ })
|
|
|
+ : null
|
|
|
+ } },
|
|
|
+ { label: '设备名称', 'min-width': 120, render (data, h) {
|
|
|
+ return data.empty ? h('span', { staticClass: 'u-color--info' }, '暂无备份设备') : data.name
|
|
|
+ } },
|
|
|
+ { prop: 'productName', label: '产品' },
|
|
|
{ prop: 'serialNumber', label: '序列号', 'min-width': 100 },
|
|
|
{ prop: 'mac', label: 'MAC', 'min-width': 100 },
|
|
|
- { prop: 'remark', label: '地址', 'min-width': 80 },
|
|
|
- {
|
|
|
- type: 'tag', 'width': 100, render ({ empty, activate, onlineStatus }) {
|
|
|
- return empty ? null : {
|
|
|
- type: activate
|
|
|
- ? activate === 1
|
|
|
- ? void 0
|
|
|
- : onlineStatus === 1
|
|
|
- ? 'success'
|
|
|
- : 'danger'
|
|
|
- : 'warning',
|
|
|
- label: activate
|
|
|
- ? activate === 1
|
|
|
- ? '已激活'
|
|
|
- : onlineStatus === 1
|
|
|
- ? '在线'
|
|
|
- : '离线'
|
|
|
- : '未激活'
|
|
|
- }
|
|
|
- },
|
|
|
- on: this.onTagClick
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'invoke', width: 160, render: [
|
|
|
- { label: '查看', render ({ empty }) { return !empty }, on: this.onViewDevice },
|
|
|
- this.accessSet.has(Access.MANAGE_DEVICE) ? { label: '默认播放', render ({ isMaster, activate }) { return isMaster && activate }, on: this.onSetDefaultProgram } : null
|
|
|
- ].filter(val => val)
|
|
|
- }
|
|
|
+ { prop: 'remark', label: '地址' },
|
|
|
+ { type: 'tag', 'width': 100, render ({ empty, activate, onlineStatus }) {
|
|
|
+ return empty ? null : {
|
|
|
+ type: activate
|
|
|
+ ? activate === 1
|
|
|
+ ? void 0
|
|
|
+ : onlineStatus === 1
|
|
|
+ ? 'success'
|
|
|
+ : 'danger'
|
|
|
+ : 'warning',
|
|
|
+ label: activate
|
|
|
+ ? activate === 1
|
|
|
+ ? '已激活'
|
|
|
+ : onlineStatus === 1
|
|
|
+ ? '在线'
|
|
|
+ : '离线'
|
|
|
+ : '未激活'
|
|
|
+ }
|
|
|
+ }, on: this.onTagClick },
|
|
|
+ { type: 'invoke', width: canEdit ? 160 : 120, render: [
|
|
|
+ { label: '查看', render ({ empty }) { return !empty }, on: this.onViewDevice },
|
|
|
+ canEdit ? { label: '默认播放', render ({ isMaster, activate }) { return isMaster && activate }, on: this.onSetDefaultProgram } : null
|
|
|
+ ].filter(val => val) }
|
|
|
]
|
|
|
}
|
|
|
}
|