index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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="5"
  15. ref="treeList"
  16. />
  17. </div>
  18. </div>
  19. <template v-slot:content>
  20. <mould-list
  21. v-if="current"
  22. :category-id="current.id"
  23. :root-id="rootId"
  24. />
  25. </template>
  26. </ele-split-layout>
  27. </el-card>
  28. </div>
  29. </template>
  30. <script>
  31. import AssetTree from '@/components/AssetTree';
  32. import MouldList from './components/mould-list.vue';
  33. export default {
  34. components: {
  35. AssetTree,
  36. MouldList
  37. },
  38. data() {
  39. return {
  40. // 加载状态
  41. loading: false,
  42. // 表格选中数据
  43. selection: [],
  44. current: null,
  45. rootId: null
  46. };
  47. },
  48. computed: {},
  49. methods: {
  50. handleNodeClick(info) {
  51. this.current = info;
  52. },
  53. // 获取根节点id
  54. setRootId(id) {
  55. this.rootId = id;
  56. }
  57. }
  58. };
  59. </script>
  60. <style lang="scss" scoped>
  61. .sys-organization-list {
  62. height: calc(100vh - 264px);
  63. box-sizing: border-box;
  64. border-width: 1px;
  65. border-style: solid;
  66. overflow: auto;
  67. }
  68. .sys-organization-list :deep(.el-tree-node__content) {
  69. height: 40px;
  70. & > .el-tree-node__expand-icon {
  71. margin-left: 10px;
  72. }
  73. }
  74. </style>