index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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="15"
  15. ref="treeList"
  16. />
  17. <!-- 1738160749383847938 -->
  18. </div>
  19. </div>
  20. <template v-slot:content>
  21. <data-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 DataList from './components/data-list.vue';
  34. export default {
  35. components: {
  36. AssetTree,
  37. DataList
  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. height: calc(100vh - 264px);
  64. box-sizing: border-box;
  65. border-width: 1px;
  66. border-style: solid;
  67. overflow: auto;
  68. }
  69. .sys-organization-list :deep(.el-tree-node__content) {
  70. height: 40px;
  71. & > .el-tree-node__expand-icon {
  72. margin-left: 10px;
  73. }
  74. }
  75. </style>