index.vue 2.6 KB

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