t-c-c-contacts-info.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view class="box">
  3. <view class="headers">
  4. <view class="height"></view>
  5. <view class="headers_input">
  6. <image src="./icon/searc1.png" mode=""></image>
  7. <input type="filter" placeholder="搜索" v-model="filterText" />
  8. </view>
  9. </view>
  10. <view class="box_info_nengyuan">
  11. <image src="./icon/ICE.png" mode=""></image>
  12. <text>国家能源集团枣泉煤矿</text>
  13. </view>
  14. <ly-tree :tree-data="treeData" :ready="ready" node-key="id" ref="tree" :filter-node-method="filterNodeMethod">
  15. </ly-tree>
  16. </view>
  17. </template>
  18. <script>
  19. import LyTree from '@/components/ly-tree/ly-tree.vue'
  20. export default {
  21. components: {
  22. LyTree
  23. },
  24. data() {
  25. return {
  26. ready: false,
  27. treeData: [
  28. ],
  29. searchVal: "",
  30. filterText: ""
  31. };
  32. },
  33. created() {
  34. this.ready = true;
  35. this.getcontactsinfo()
  36. },
  37. watch: {
  38. filterText(val) {
  39. this.$refs.tree.filter(val);
  40. }
  41. },
  42. methods: {
  43. getcontactsinfo() {
  44. this.$api.section_getlisttree({
  45. txl: "txl"
  46. }).then((res) => {
  47. this.treeData = res.data.data
  48. })
  49. },
  50. filterNodeMethod(value, data) {
  51. if (!value) return true;
  52. return data.label.indexOf(value) !== -1;
  53. },
  54. },
  55. }
  56. </script>
  57. <style>
  58. page {
  59. background-color: #f5f5f5;
  60. }
  61. .box_info_nengyuan {
  62. width: 100%;
  63. height: 60px;
  64. line-height: 60px;
  65. margin: auto;
  66. display: flex;
  67. border-bottom: 1px solid #f5f5f5;
  68. background-color: #fff;
  69. /* margin-top: 10px; */
  70. }
  71. .box_info_nengyuan>image {
  72. margin-top: 10px;
  73. margin-left: 15px;
  74. width: 40px;
  75. height: 40px;
  76. }
  77. .box_info_nengyuan>text {
  78. font-size: 18px;
  79. font-weight: 500;
  80. margin-left: 10px;
  81. }
  82. .headers {
  83. width: 100%;
  84. height: 120rpx;
  85. background-color: #FFF;
  86. margin-bottom: 20rpx;
  87. }
  88. .headers_input {
  89. width: 80%;
  90. background-color: #f5f5f5;
  91. margin: 0 auto;
  92. border-radius: 40rpx;
  93. position: relative;
  94. margin-top: 30rpx;
  95. }
  96. .headers_input>input {
  97. width: 80%;
  98. margin-left: 50rpx;
  99. height: 60rpx;
  100. }
  101. .headers_input>image {
  102. width: 40rpx;
  103. height: 40rpx;
  104. position: absolute;
  105. z-index: 99999;
  106. left: 1%;
  107. top: 16%;
  108. }
  109. .height {
  110. height: 1rpx;
  111. }
  112. /deep/.ly-tree-node__label {
  113. color: #000000;
  114. font-size: 34rpx;
  115. }
  116. >>>.ly-icon-caret-right:before {
  117. background: url("./icon/zk1.png") no-repeat 0 0px;
  118. content: '';
  119. display: block;
  120. width: 16px;
  121. height: 16px;
  122. font-size: 16px;
  123. background-size: 16px;
  124. }
  125. >>>.ly-tree-node__expand-icon.expanded{
  126. transform: rotate(0deg);
  127. }
  128. >>>.ly-tree-node__expand-icon.expanded:before {
  129. background: url("./icon/zk2.png") no-repeat 0 0px;
  130. content: '';
  131. display: block;
  132. width: 16px;
  133. height: 16px;
  134. font-size: 16px;
  135. background-size: 16px;
  136. }
  137. >>>.ly-tree-node__expand-icon.is-leaf::before {
  138. background: url("") no-repeat 0 0px;
  139. content: '';
  140. display: block;
  141. width: 16px;
  142. height: 16px;
  143. font-size: 16px;
  144. background-size: 16px;
  145. }
  146. </style>