index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <ele-split-layout
  5. width="266px"
  6. allow-collapse
  7. :right-style="{ overflow: 'hidden' }"
  8. >
  9. <div>
  10. <div class="ele-border-lighter sys-organization-list">
  11. <AssetTree
  12. @handleNodeClick="handleNodeClick"
  13. @setRootId="setRootId"
  14. id="4"
  15. :paramsType="'type'"
  16. ref="treeList"
  17. />
  18. </div>
  19. </div>
  20. <template v-slot:content>
  21. <equipment-list
  22. v-if="current"
  23. :category-id="current.id"
  24. :root-id="rootId"
  25. />
  26. </template>
  27. </ele-split-layout>
  28. </el-card>
  29. </div>
  30. </template>
  31. <script>
  32. import AssetTree from '@/components/AssetTree';
  33. import EquipmentList from './components/equipment-list.vue';
  34. export default {
  35. components: {
  36. AssetTree,
  37. EquipmentList
  38. },
  39. data () {
  40. return {
  41. // 加载状态
  42. loading: false,
  43. // 表格选中数据
  44. selection: [],
  45. current: null,
  46. rootId: null
  47. };
  48. },
  49. computed: {},
  50. methods: {
  51. handleNodeClick (info) {
  52. this.current = info;
  53. },
  54. // 获取根节点id
  55. setRootId (id) {
  56. this.rootId = id;
  57. }
  58. }
  59. };
  60. </script>
  61. <style lang="scss" scoped>
  62. .sys-organization-list {
  63. position: absolute;
  64. top: 0;
  65. bottom: 0;
  66. left: 0;
  67. right: 0;
  68. box-sizing: border-box;
  69. border-width: 1px;
  70. border-style: solid;
  71. overflow: auto;
  72. }
  73. .sys-organization-list :deep(.el-tree-node__content) {
  74. height: 40px;
  75. & > .el-tree-node__expand-icon {
  76. margin-left: 10px;
  77. }
  78. }
  79. </style>