_mixin.scss 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. // 函数示例
  2. @function px2rem($px) {
  3. $rem: 14px;
  4. @return ($px/$rem) + rem;
  5. }
  6. @mixin dropdown-menu($width:auto, $min-width:auto, $submenu-min-width:auto) {
  7. z-index: 2050; /* 没有这行则 抽屉无法显示右键菜单 */
  8. width: $width;
  9. min-width: $min-width !important;
  10. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.15);
  11. background: #fff;
  12. border-radius: 4px;
  13. .ant-dropdown-menu {
  14. padding: 8px 0;
  15. border-radius: 4px;
  16. .ant-dropdown-menu-item {
  17. line-height: 25px;
  18. margin: 0;
  19. padding: 0 16px;
  20. font-size: 13px;
  21. outline: 0;
  22. display: flex;
  23. align-items: center;
  24. transition: 0.2s;
  25. border-bottom: 1px solid transparent;
  26. color: #606266 !important;
  27. background: #fff;
  28. .ant-dropdown-menu-title-content {
  29. width: 100%;
  30. }
  31. .menu-item-wrap {
  32. display: flex;
  33. flex-wrap: wrap;
  34. align-items: center;
  35. width: 100%;
  36. padding: 0 !important;
  37. .ant-input {
  38. width: 40px;
  39. height: 24px;
  40. margin: 0 5px;
  41. line-height: 1.4;
  42. padding: 1px 3px !important;
  43. font-size: 12px;
  44. text-align: center;
  45. }
  46. .ant-input-number {
  47. width: 40px;
  48. margin: 0 5px;
  49. font-size: 12px;
  50. vertical-align: middle;
  51. &.is-percent {
  52. width: 60px;
  53. }
  54. .ant-input-number-input-wrap {
  55. height: 24px;
  56. .ant-input-number-input {
  57. height: 100%;
  58. font-size: 12px;
  59. vertical-align: top;
  60. padding: 0 16px 0 0;
  61. text-align: center;
  62. }
  63. }
  64. .ant-input-number-handler-wrap {
  65. width: 16px;
  66. opacity: 1;
  67. &:hover {
  68. .ant-input-number-handler {
  69. height: 50%;
  70. }
  71. }
  72. .ant-input-number-handler-down {
  73. display: flex;
  74. align-items: center;
  75. justify-content: center;
  76. &:hover {
  77. height: 50% !important;
  78. }
  79. .ant-input-number-handler-down-inner {
  80. position: static;
  81. margin-top: 0;
  82. }
  83. }
  84. .ant-input-number-handler-up {
  85. display: flex;
  86. align-items: center;
  87. justify-content: center;
  88. &:hover {
  89. height: 50% !important;
  90. }
  91. .ant-input-number-handler-up-inner {
  92. position: static;
  93. margin-top: 0;
  94. }
  95. }
  96. }
  97. }
  98. }
  99. &:hover {
  100. background: #ecf5ff;
  101. color: #409eff !important;
  102. .iconfont {
  103. color: #409eff;
  104. }
  105. }
  106. &-disabled {
  107. color: #c0c4cc !important;
  108. &:hover {
  109. background: #fff;
  110. color: #c0c4cc !important;
  111. .iconfont {
  112. color: #c0c4cc !important;
  113. }
  114. }
  115. }
  116. .iconfont {
  117. display: inline-block;
  118. width: 14px;
  119. font-size: 13px;
  120. margin-right: 8px;
  121. }
  122. }
  123. }
  124. .ant-dropdown-menu-submenu {
  125. &-disabled {
  126. .ant-dropdown-menu-submenu-title {
  127. color: #c0c4cc !important;
  128. &:hover {
  129. background: #fff;
  130. color: #c0c4cc !important;
  131. .iconfont {
  132. color: #c0c4cc !important;
  133. }
  134. .ant-dropdown-menu-submenu-arrow-icon {
  135. color: #c0c4cc !important;
  136. }
  137. }
  138. .ant-dropdown-menu-submenu-arrow-icon {
  139. color: #c0c4cc !important;
  140. }
  141. }
  142. }
  143. &-title {
  144. line-height: 32px;
  145. margin: 0;
  146. outline: 0;
  147. padding: 0 16px !important;
  148. display: flex;
  149. align-items: center;
  150. font-size: 13px;
  151. color: #606266 !important;
  152. border-bottom: 1px solid transparent;
  153. transition: 0.2s;
  154. background: #fff;
  155. &:hover {
  156. background: #ecf5ff;
  157. color: #409eff !important;
  158. .iconfont {
  159. color: #409eff;
  160. }
  161. .ant-dropdown-menu-submenu-arrow-icon {
  162. color: #409eff !important;
  163. }
  164. }
  165. .iconfont {
  166. display: inline-block;
  167. width: 14px;
  168. font-size: 13px;
  169. margin-right: 8px;
  170. }
  171. .ant-dropdown-menu-submenu-arrow {
  172. &-icon {
  173. display: flex;
  174. align-items: center;
  175. margin-top: 1px;
  176. width: 14px;
  177. height: 14px;
  178. > svg {
  179. display: none;
  180. }
  181. &::after {
  182. font-family: 'iconfont';
  183. content: '\e605';
  184. font-size: 18px;
  185. }
  186. font-size: 14px;
  187. font-weight: 800;
  188. color: #606266 !important;
  189. }
  190. }
  191. }
  192. > .ant-dropdown-menu-submenu-content {
  193. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.15);
  194. }
  195. }
  196. .ant-dropdown-menu-submenu-popup {
  197. min-width: $submenu-min-width;
  198. .ant-dropdown-menu-sub {
  199. margin: 0;
  200. }
  201. }
  202. .ant-dropdown-menu-item-divider {
  203. margin: 0;
  204. }
  205. }