index.vue 1.6 KB

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