|
|
@@ -16,10 +16,6 @@
|
|
|
:ratio="ratio"
|
|
|
@choosen="onChoosen"
|
|
|
/>
|
|
|
- <bind-device-dialog
|
|
|
- ref="bindDeviceDialog"
|
|
|
- @choosen="onBindDeviceChoosen"
|
|
|
- />
|
|
|
</wrapper>
|
|
|
</template>
|
|
|
|
|
|
@@ -32,7 +28,6 @@ import {
|
|
|
getProducts
|
|
|
} from '@/api/device'
|
|
|
import { publish } from '@/api/platform'
|
|
|
-import { bind as bindDevice } from '@/api/external'
|
|
|
import {
|
|
|
Access,
|
|
|
EventPriority,
|
|
|
@@ -102,8 +97,7 @@ export default {
|
|
|
: '未激活'
|
|
|
}
|
|
|
}, on: this.onTagClick },
|
|
|
- { type: 'invoke', width: canEdit ? 160 + 40 : 120 + 40, render: [
|
|
|
- { label: '绑定设备', render ({ empty }) { return !empty }, on: this.onBindDevice },
|
|
|
+ { 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) }
|
|
|
@@ -201,23 +195,6 @@ export default {
|
|
|
}
|
|
|
this.$refs.eventTargetDialog.show()
|
|
|
},
|
|
|
- onBindDevice (device) {
|
|
|
- this.$device = {
|
|
|
- id: device.id,
|
|
|
- name: device.name
|
|
|
- }
|
|
|
- this.$refs.bindDeviceDialog.show()
|
|
|
- },
|
|
|
- onBindDeviceChoosen ({ value, done }) {
|
|
|
- console.log(bindDevice)
|
|
|
- this.$confirm(
|
|
|
- `确定绑定设备 ?`,
|
|
|
- { type: 'warning' }
|
|
|
- ).then(() => {
|
|
|
- console.log(bindDevice)
|
|
|
- bindDevice(this.$device.id, value.deviceType, value.id).then(done)
|
|
|
- })
|
|
|
- },
|
|
|
onChoosen ({ value, done }) {
|
|
|
this.$confirm(
|
|
|
`将设备 ${this.$device.name} 的默认播放设置为 ${value.name} ?`,
|