index.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <script>
  2. import ScreenSwitch from './ScreenSwitch'
  3. import ScreenLight from './ScreenLight'
  4. import ScreenVolume from './ScreenVolume'
  5. import DeviceNetwork from './DeviceNetwork'
  6. import DeviceReboot from './DeviceReboot'
  7. import PLCSwitch from './PLCSwitch'
  8. import MultifunctionCardPowerSwitch from './MultifunctionCardPowerSwitch'
  9. export default {
  10. name: 'DeviceInvoke',
  11. components: {
  12. ScreenSwitch,
  13. ScreenLight,
  14. ScreenVolume,
  15. DeviceNetwork,
  16. DeviceReboot,
  17. PLCSwitch,
  18. MultifunctionCardPowerSwitch
  19. },
  20. props: {
  21. online: {
  22. type: [Boolean, String],
  23. default: false
  24. }
  25. },
  26. render (h) {
  27. if (!this.online) {
  28. return h(
  29. 'div',
  30. {
  31. staticClass: 'u-font-size--lg u-color--info u-text--center'
  32. },
  33. '设备当前未上线'
  34. )
  35. }
  36. return h(
  37. 'div',
  38. {
  39. staticClass: 'l-grid--info small'
  40. },
  41. __STAGING__
  42. ? [
  43. h('DeviceNetwork', { props: this.$attrs }),
  44. h('ScreenSwitch', { props: this.$attrs }),
  45. h('MultifunctionCardPowerSwitch', { props: this.$attrs }),
  46. h('PLCSwitch', { props: this.$attrs }),
  47. h('ScreenLight', { props: this.$attrs }),
  48. h('ScreenVolume', { props: this.$attrs }),
  49. h('DeviceReboot', { props: this.$attrs })
  50. ]
  51. : [
  52. h('DeviceNetwork', { props: this.$attrs }),
  53. h('MultifunctionCardPowerSwitch', { props: this.$attrs }),
  54. h('ScreenVolume', { props: this.$attrs }),
  55. h('DeviceReboot', { props: this.$attrs })
  56. ]
  57. )
  58. }
  59. }
  60. </script>