addDevice.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <template>
  2. <div>
  3. <el-dialog
  4. v-dialog-drag
  5. class="dialog"
  6. title="添加设备"
  7. :visible.sync="dialogVisible"
  8. width="460px"
  9. left
  10. >
  11. <el-divider></el-divider>
  12. <div class="container">
  13. <div class="leftpane">
  14. <el-tree
  15. ref="tree"
  16. :data="data"
  17. :props="defaultProps"
  18. node-key="id"
  19. default-expand-all
  20. @node-click="handleNodeClick"
  21. >
  22. </el-tree>
  23. </div>
  24. <div class="rightpane">
  25. <el-input
  26. class="search"
  27. v-model="filter"
  28. placeholder="请输入"
  29. suffix-icon="el-icon-search"
  30. ></el-input>
  31. <el-table
  32. ref="multipleTable"
  33. :data="tableData"
  34. tooltip-effect="dark"
  35. :header-cell-style="{ textAlign: 'center' }"
  36. :cell-style="{ textAlign: 'center' }"
  37. style="width: 100%"
  38. @selection-change="handleSelectionChange"
  39. >
  40. <el-table-column
  41. type="selection"
  42. width="50"
  43. > </el-table-column>
  44. <el-table-column
  45. prop="deviceID"
  46. label="设备ID"
  47. > </el-table-column>
  48. <el-table-column
  49. prop="devicePosition"
  50. label="设备位置"
  51. >
  52. </el-table-column>
  53. </el-table>
  54. </div>
  55. </div>
  56. <div
  57. slot="footer"
  58. class="dialog-footer"
  59. >
  60. <el-button
  61. @click="dialogVisible = false"
  62. style="background: #2ea8e6; color: #fff"
  63. >取消</el-button>
  64. <el-button
  65. type="primary"
  66. style="background: #2ea8e6"
  67. >确认</el-button>
  68. </div>
  69. </el-dialog>
  70. </div>
  71. </template>
  72. <script>
  73. export default {
  74. data() {
  75. return {
  76. dialogVisible: false,
  77. filter: "",
  78. data: [
  79. {
  80. label: "设备种类",
  81. children: [
  82. {
  83. label: "摄像头",
  84. },
  85. {
  86. label: "门禁设备",
  87. },
  88. {
  89. label: "水浸设备",
  90. },
  91. {
  92. label: "电表设备",
  93. },
  94. {
  95. label: "其他设备",
  96. },
  97. ],
  98. },
  99. ],
  100. defaultProps: {
  101. children: "children",
  102. label: "label",
  103. },
  104. tableData: [
  105. {
  106. deviceID: "111",
  107. devicePosition: "1F-101",
  108. },
  109. {
  110. deviceID: "112",
  111. devicePosition: "1F-101",
  112. },
  113. {
  114. deviceID: "113",
  115. devicePosition: "1F-101",
  116. },
  117. ],
  118. };
  119. },
  120. methods: {
  121. handleNodeClick() {},
  122. handleSelectionChange() {},
  123. },
  124. };
  125. </script>
  126. <style lang="less" scoped>
  127. .container {
  128. height: 400px;
  129. width: calc(100% - 40px);
  130. border: 0.5px solid rgb(247, 245, 243);
  131. display: flex;
  132. padding: 0 0;
  133. margin: 20px 20px;
  134. .leftpane {
  135. width: 120px;
  136. .el-tree {
  137. width: 120px;
  138. height: 100%;
  139. background-color: rgb(247, 245, 243);
  140. }
  141. }
  142. .rightpane {
  143. .search {
  144. width: 224.8px;
  145. margin-left: 60px;
  146. margin-top: 10px;
  147. /deep/.el-input__inner {
  148. height: 35px;
  149. }
  150. }
  151. .el-table {
  152. margin-top: 10px;
  153. width: 95% !important;
  154. margin-left: 5%;
  155. border: 1px solid #f0f2f2;
  156. font-size: 0.95rem;
  157. font-family: PingFang SC;
  158. font-weight: 500;
  159. color: #b2b2b2;
  160. background: rgba(255, 255, 255, 0.8);
  161. /deep/th {
  162. background: #f7fbff;
  163. }
  164. /deep/.el-checkbox {
  165. color: #b2b2b2;
  166. .el-checkbox__input.is-checked + .el-checkbox__label {
  167. color: #2ea8e6;
  168. }
  169. .el-checkbox__input.is-checked .el-checkbox__inner::after {
  170. width: 70%;
  171. height: 70%;
  172. background: #2ea8e6;
  173. border-radius: 0;
  174. transform: rotate(0deg) scaleY(1);
  175. position: static;
  176. // border: 1px solid #8DD9FF;
  177. }
  178. .el-checkbox__inner {
  179. border: 1px solid #8dd9ff;
  180. background: rgba(0, 170, 255, 0);
  181. display: flex;
  182. align-items: center;
  183. justify-content: center;
  184. position: static;
  185. &::after {
  186. transition: 0ms;
  187. }
  188. }
  189. .el-checkbox__label {
  190. padding-left: 0;
  191. font-size: 15px;
  192. position: absolute;
  193. top: 1px;
  194. left: 25px;
  195. }
  196. }
  197. }
  198. }
  199. }
  200. /deep/.el-dialog {
  201. height: 600px !important;
  202. }
  203. .el-select {
  204. width: 280px;
  205. }
  206. /deep/.el-dialog__header {
  207. padding-bottom: 0;
  208. color: #333333;
  209. }
  210. /deep/.el-dialog__headerbtn {
  211. font-size: 25px;
  212. }
  213. /deep/.el-dialog__body {
  214. padding: 0;
  215. }
  216. /deep/.el-divider--horizontal {
  217. display: block;
  218. height: 1px;
  219. width: 95%;
  220. margin: 0;
  221. margin-left: 2.5%;
  222. }
  223. /deep/.el-dialog__footer {
  224. text-align: center;
  225. }
  226. .el-button {
  227. width: 100px;
  228. height: 30px;
  229. text-align: center;
  230. margin: 30px;
  231. padding: 5px;
  232. }
  233. </style>