index.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. :type="'2'"
  15. :paramsType="'type'"
  16. ref="treeList"
  17. />
  18. </div>
  19. </div>
  20. <template v-slot:content>
  21. <boat-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 BoatList from './components/boat-list.vue';
  34. import {
  35. getBoatList
  36. } from '@/api/ledgerAssets/boat.js';
  37. export default {
  38. components: {
  39. AssetTree ,
  40. BoatList
  41. },
  42. data () {
  43. return {
  44. // 加载状态
  45. loading: false,
  46. // 表格选中数据
  47. selection: [],
  48. current:null,
  49. rootId:null,
  50. };
  51. },
  52. computed: {
  53. },
  54. methods: {
  55. handleNodeClick (info) {
  56. this.current = info
  57. },
  58. // 获取根节点id
  59. setRootId(id){
  60. this.rootId = id
  61. }
  62. }
  63. };
  64. </script>
  65. <style lang="scss" scoped>
  66. .sys-organization-list {
  67. height: calc(100vh - 264px);
  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>