monitorList.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div class="preinstall_box monitorList">
  3. <div class="title_box">摄像头</div>
  4. <el-tree
  5. :data="data"
  6. :props="defaultProps"
  7. @node-click="handleNodeClick"
  8. highlight-current
  9. default-expand-all
  10. />
  11. </div>
  12. </template>
  13. <script>
  14. import * as realTime from '@/api/isp/ispRealtime/monitor/index';
  15. // const realTime = {};
  16. export default {
  17. name: 'MonitorList',
  18. data() {
  19. return {
  20. data: [],
  21. defaultProps: {
  22. label: 'name'
  23. }
  24. };
  25. },
  26. mounted() {
  27. this.getCameraList();
  28. },
  29. methods: {
  30. async getCameraList() {
  31. const res = await realTime.listByType();
  32. this.data = res;
  33. this.$emit('getCameraList', this.data);
  34. },
  35. handleNodeClick(data) {
  36. console.log(data);
  37. this.$emit('getClickId', data);
  38. }
  39. }
  40. };
  41. </script>
  42. <style lang="scss" scoped>
  43. .preinstall_box {
  44. box-sizing: border-box;
  45. width: 100%;
  46. height: 100%;
  47. border: 1px solid rgb(227, 229, 230);
  48. .title_box {
  49. width: 100%;
  50. height: 32px;
  51. line-height: 32px;
  52. text-align: center;
  53. font-size: 14px;
  54. font-style: normal;
  55. font-weight: 500;
  56. color: #404446;
  57. background: #f2f4f5;
  58. font-family: 'albb', sans-serif;
  59. }
  60. }
  61. </style>