index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <div class="container">
  3. <div class="left-pane">
  4. <el-input placeholder="请输入关键字" suffix-icon="el-icon-search" v-model="filterText"></el-input>
  5. <el-tree ref="tree" :data="data" :props="defaultProps" node-key="id" default-expand-all
  6. :filter-node-method="filterNode" @node-click="handleNodeClick">
  7. </el-tree>
  8. <el-button><i class="el-icon-s-order"></i>添加公司</el-button>
  9. </div>
  10. <div class="right-pane">
  11. <overView></overView>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. import overView from './tables/corporationOverview';
  17. export default {
  18. components: { overView },
  19. data() {
  20. return {
  21. filterText: '',
  22. activeName: 'group',
  23. data: [{
  24. label: '中讯邮电咨询设计院',
  25. children: [{
  26. label: '北京电信规划设计院',
  27. children: [{
  28. label: '天津办事处'
  29. }]
  30. }]
  31. }],
  32. defaultProps: {
  33. children: 'children',
  34. label: 'label'
  35. }
  36. }
  37. },
  38. watch: {
  39. filterText(val) {
  40. this.$refs.tree.filter(val);
  41. }
  42. },
  43. methods: {
  44. handleNodeClick() {
  45. //
  46. },
  47. filterNode(value, data) {
  48. if (!value) return true;
  49. return data.label.indexOf(value) !== -1;
  50. },
  51. handleClick() {
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="less" scoped>
  57. .container {
  58. position: relative;
  59. height: 100%;
  60. line-height: 20px;
  61. background-color: rgba(255, 255, 255, 1);
  62. color: rgba(16, 16, 16, 1);
  63. font-size: 14px;
  64. text-align: center;
  65. box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.15);
  66. .left-pane {
  67. width: 300px;
  68. padding: 15px;
  69. .el-tree {
  70. height: 700px;
  71. margin-top: 15px;
  72. background-color: rgb(247, 245, 243);
  73. }
  74. .el-button {
  75. position: absolute;
  76. left: 35px;
  77. bottom: 40px;
  78. width: 250px;
  79. background-color: rgb(131, 208, 243);
  80. text-align: center;
  81. font-size: 16px;
  82. }
  83. }
  84. .right-pane {
  85. width: 1340px;
  86. position: absolute;
  87. margin-left: 330px;
  88. top: 0;
  89. height: -webkit-fill-available;
  90. margin-right: 20px;
  91. }
  92. }
  93. </style>