index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <div class="attribTemplate">
  3. <div class="attribContent1">
  4. <div style="display: flex">
  5. <el-input
  6. placeholder="选择站点"
  7. v-model="filterText"
  8. class="attContentInput"
  9. style="width: 100%"
  10. >
  11. <template #suffix>
  12. <i class="el-icon-search el-input__icon"></i>
  13. </template>
  14. </el-input>
  15. </div>
  16. <div class="attSwitch">
  17. <el-tree
  18. :data="data"
  19. show-checkbox
  20. node-key="id"
  21. :default-expanded-keys="[2, 3]"
  22. :props="defaultProps"
  23. />
  24. </div>
  25. </div>
  26. <div class="attribContent2">
  27. <el-tabs
  28. v-model="activeName"
  29. type="card"
  30. @tab-click="handleClick"
  31. style="background-color: #fff; height: 100%"
  32. class="tabsSizeColor"
  33. v-if="activeBool"
  34. >
  35. <el-tab-pane label="模板1" name="first"> </el-tab-pane>
  36. <!-- <el-tab-pane label="视频监测设备" name="second"> </el-tab-pane>
  37. <el-tab-pane label="通信设备" name="third"> </el-tab-pane>
  38. <el-tab-pane label="通道列表" name="five"> </el-tab-pane> -->
  39. </el-tabs>
  40. </div>
  41. </div>
  42. </template>
  43. <script lang="ts">
  44. import { defineComponent, ref, Ref } from "vue";
  45. interface PowerEquipData {
  46. activeName: Ref;
  47. filterText: Ref;
  48. }
  49. export default defineComponent({
  50. name: "attribTemplate",
  51. components: {},
  52. props: {},
  53. data() {
  54. return {
  55. data: [
  56. {
  57. id: 1,
  58. label: "Level one 1",
  59. children: [
  60. {
  61. id: 4,
  62. label: "Level two 1-1",
  63. },
  64. ],
  65. },
  66. {
  67. id: 2,
  68. label: "Level one 2",
  69. children: [
  70. {
  71. id: 5,
  72. label: "Level two 2-1",
  73. },
  74. {
  75. id: 6,
  76. label: "Level two 2-2",
  77. },
  78. ],
  79. },
  80. {
  81. id: 3,
  82. label: "Level one 3",
  83. children: [
  84. {
  85. id: 7,
  86. label: "Level two 3-1",
  87. },
  88. {
  89. id: 8,
  90. label: "Level two 3-2",
  91. },
  92. ],
  93. },
  94. ],
  95. defaultProps: {
  96. children: "children",
  97. label: "label",
  98. },
  99. };
  100. },
  101. setup(): PowerEquipData {
  102. const activeName = ref("first");
  103. const filterText = ref("");
  104. return {
  105. activeName,
  106. filterText,
  107. };
  108. },
  109. methods: {
  110. handleClick(tab, event) {
  111. console.log(tab, event);
  112. },
  113. },
  114. });
  115. </script>
  116. <style lang="scss" scoped>
  117. .attribTemplate {
  118. display: flex;
  119. height: calc(100vh - 100px);
  120. padding: 30px;
  121. margin-top: 50px;
  122. .attribContent1 {
  123. background-color: #fff;
  124. width: 15%;
  125. height: 100%;
  126. margin-right: 25px;
  127. padding: 20px;
  128. .el-input__icon {
  129. color: #409eff;
  130. }
  131. .el-input__inner:hover {
  132. border-color: #409eff;
  133. }
  134. .el-input__inner:focus {
  135. border-color: #409eff;
  136. }
  137. .attContentInput {
  138. margin: 0;
  139. }
  140. .attSwitch {
  141. margin-top: 20px;
  142. width: 100%;
  143. height: 20px;
  144. cursor: pointer;
  145. .attSwitchOne {
  146. display: flex;
  147. border: 0.5px solid silver;
  148. padding: 8px;
  149. font-size: 13px;
  150. div:nth-child(1) {
  151. width: 100%;
  152. }
  153. }
  154. .attSwitchOne:hover {
  155. background-color: #409eff;
  156. }
  157. .attSwitchOne:focus {
  158. background-color: #409eff;
  159. }
  160. }
  161. }
  162. .attribContent2 {
  163. background-color: #fff;
  164. width: 85%;
  165. height: 100%;
  166. }
  167. }
  168. </style>