drag.less 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. .draggable-box {
  2. height: 100%;
  3. overflow: auto;
  4. :deep(.list-main) {
  5. position: relative;
  6. padding: 5px;
  7. overflow: hidden;
  8. .moving {
  9. position: relative;
  10. box-sizing: border-box;
  11. // 拖放移动中;
  12. min-height: 35px;
  13. padding: 0 !important;
  14. overflow: hidden;
  15. &::before {
  16. content: '';
  17. position: absolute;
  18. top: 0;
  19. right: 0;
  20. width: 100%;
  21. height: 5px;
  22. background-color: @primary-color;
  23. }
  24. }
  25. .drag-move-box {
  26. position: relative;
  27. box-sizing: border-box;
  28. min-height: 60px;
  29. padding: 8px;
  30. overflow: hidden;
  31. transition: all 0.3s;
  32. &:hover {
  33. background-color: @primary-hover-bg-color;
  34. }
  35. // 选择时 start
  36. &::before {
  37. content: '';
  38. position: absolute;
  39. top: 0;
  40. right: -100%;
  41. width: 100%;
  42. height: 5px;
  43. transition: all 0.3s;
  44. background-color: @primary-color;
  45. }
  46. &.active {
  47. outline-offset: 0;
  48. background-color: @primary-hover-bg-color;
  49. &::before {
  50. right: 0;
  51. }
  52. }
  53. // 选择时 end
  54. .form-item-box {
  55. position: relative;
  56. box-sizing: border-box;
  57. word-wrap: break-word;
  58. &::before {
  59. content: '';
  60. position: absolute;
  61. top: 0;
  62. left: 0;
  63. width: 100%;
  64. height: 100%;
  65. }
  66. .ant-form-item {
  67. // 修改ant form-item的margin为padding
  68. margin: 0;
  69. padding-bottom: 6px;
  70. }
  71. }
  72. .show-key-box {
  73. // 显示key
  74. position: absolute;
  75. right: 5px;
  76. bottom: 2px;
  77. // z-index: 999;
  78. color: @primary-color;
  79. font-size: 14px;
  80. }
  81. .copy,
  82. .delete {
  83. position: absolute;
  84. top: 0;
  85. width: 30px;
  86. height: 30px;
  87. // z-index: 989;
  88. transition: all 0.3s;
  89. color: #fff;
  90. line-height: 30px;
  91. text-align: center;
  92. &.unactivated {
  93. opacity: 0 !important;
  94. pointer-events: none;
  95. }
  96. &.active {
  97. opacity: 1 !important;
  98. }
  99. }
  100. .copy {
  101. right: 30px;
  102. border-radius: 0 0 0 8px;
  103. background-color: @primary-color;
  104. }
  105. .delete {
  106. right: 0;
  107. background-color: @primary-color;
  108. }
  109. }
  110. .grid-box {
  111. position: relative;
  112. box-sizing: border-box;
  113. width: 100%;
  114. padding: 5px;
  115. overflow: hidden;
  116. transition: all 0.3s;
  117. background-color: @layout-background-color;
  118. .form-item-box {
  119. position: relative;
  120. box-sizing: border-box;
  121. .ant-form-item {
  122. // 修改ant form-item的margin为padding
  123. margin: 0;
  124. padding-bottom: 15px;
  125. }
  126. }
  127. .grid-row {
  128. background-color: @layout-background-color;
  129. .grid-col {
  130. .draggable-box {
  131. min-width: 50px;
  132. min-height: 80px;
  133. border: 1px #ccc dashed;
  134. // background: #fff;
  135. .list-main {
  136. position: relative;
  137. min-height: 83px;
  138. border: 1px #ccc dashed;
  139. }
  140. }
  141. }
  142. }
  143. // 选择时 start
  144. &::before {
  145. content: '';
  146. position: absolute;
  147. top: 0;
  148. right: -100%;
  149. width: 100%;
  150. height: 5px;
  151. transition: all 0.3s;
  152. background: transparent;
  153. }
  154. &.active {
  155. outline-offset: 0;
  156. background-color: @layout-hover-bg-color;
  157. &::before {
  158. right: 0;
  159. background-color: @layout-color;
  160. }
  161. }
  162. // 选择时 end
  163. > .copy-delete-box {
  164. > .copy,
  165. > .delete {
  166. position: absolute;
  167. top: 0;
  168. width: 30px;
  169. height: 30px;
  170. // z-index: 989;
  171. transition: all 0.3s;
  172. color: #fff;
  173. line-height: 30px;
  174. text-align: center;
  175. &.unactivated {
  176. opacity: 0 !important;
  177. pointer-events: none;
  178. }
  179. &.active {
  180. opacity: 1 !important;
  181. }
  182. }
  183. > .copy {
  184. right: 30px;
  185. border-radius: 0 0 0 8px;
  186. background-color: @layout-color;
  187. }
  188. > .delete {
  189. right: 0;
  190. background-color: @layout-color;
  191. }
  192. }
  193. }
  194. }
  195. }