123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- // 函数示例
- @function px2rem($px) {
- $rem: 14px;
- @return ($px/$rem) + rem;
- }
- @mixin dropdown-menu($width:auto, $min-width:auto, $submenu-min-width:auto) {
- z-index: 2050; /* 没有这行则 抽屉无法显示右键菜单 */
- width: $width;
- min-width: $min-width !important;
- 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);
- background: #fff;
- border-radius: 4px;
- .ant-dropdown-menu {
- padding: 8px 0;
- border-radius: 4px;
- .ant-dropdown-menu-item {
- line-height: 25px;
- margin: 0;
- padding: 0 16px;
- font-size: 13px;
- outline: 0;
- display: flex;
- align-items: center;
- transition: 0.2s;
- border-bottom: 1px solid transparent;
- color: #606266 !important;
- background: #fff;
- .ant-dropdown-menu-title-content {
- width: 100%;
- }
- .menu-item-wrap {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- width: 100%;
- padding: 0 !important;
- .ant-input {
- width: 40px;
- height: 24px;
- margin: 0 5px;
- line-height: 1.4;
- padding: 1px 3px !important;
- font-size: 12px;
- text-align: center;
- }
- .ant-input-number {
- width: 40px;
- margin: 0 5px;
- font-size: 12px;
- vertical-align: middle;
- &.is-percent {
- width: 60px;
- }
- .ant-input-number-input-wrap {
- height: 24px;
- .ant-input-number-input {
- height: 100%;
- font-size: 12px;
- vertical-align: top;
- padding: 0 16px 0 0;
- text-align: center;
- }
- }
- .ant-input-number-handler-wrap {
- width: 16px;
- opacity: 1;
- &:hover {
- .ant-input-number-handler {
- height: 50%;
- }
- }
- .ant-input-number-handler-down {
- display: flex;
- align-items: center;
- justify-content: center;
- &:hover {
- height: 50% !important;
- }
- .ant-input-number-handler-down-inner {
- position: static;
- margin-top: 0;
- }
- }
- .ant-input-number-handler-up {
- display: flex;
- align-items: center;
- justify-content: center;
- &:hover {
- height: 50% !important;
- }
- .ant-input-number-handler-up-inner {
- position: static;
- margin-top: 0;
- }
- }
- }
- }
- }
- &:hover {
- background: #ecf5ff;
- color: #409eff !important;
- .iconfont {
- color: #409eff;
- }
- }
- &-disabled {
- color: #c0c4cc !important;
- &:hover {
- background: #fff;
- color: #c0c4cc !important;
- .iconfont {
- color: #c0c4cc !important;
- }
- }
- }
- .iconfont {
- display: inline-block;
- width: 14px;
- font-size: 13px;
- margin-right: 8px;
- }
- }
- }
- .ant-dropdown-menu-submenu {
- &-disabled {
- .ant-dropdown-menu-submenu-title {
- color: #c0c4cc !important;
- &:hover {
- background: #fff;
- color: #c0c4cc !important;
- .iconfont {
- color: #c0c4cc !important;
- }
- .ant-dropdown-menu-submenu-arrow-icon {
- color: #c0c4cc !important;
- }
- }
- .ant-dropdown-menu-submenu-arrow-icon {
- color: #c0c4cc !important;
- }
- }
- }
- &-title {
- line-height: 32px;
- margin: 0;
- outline: 0;
- padding: 0 16px !important;
- display: flex;
- align-items: center;
- font-size: 13px;
- color: #606266 !important;
- border-bottom: 1px solid transparent;
- transition: 0.2s;
- background: #fff;
- &:hover {
- background: #ecf5ff;
- color: #409eff !important;
- .iconfont {
- color: #409eff;
- }
- .ant-dropdown-menu-submenu-arrow-icon {
- color: #409eff !important;
- }
- }
- .iconfont {
- display: inline-block;
- width: 14px;
- font-size: 13px;
- margin-right: 8px;
- }
- .ant-dropdown-menu-submenu-arrow {
- &-icon {
- display: flex;
- align-items: center;
- margin-top: 1px;
- width: 14px;
- height: 14px;
- > svg {
- display: none;
- }
- &::after {
- font-family: 'iconfont';
- content: '\e605';
- font-size: 18px;
- }
- font-size: 14px;
- font-weight: 800;
- color: #606266 !important;
- }
- }
- }
- > .ant-dropdown-menu-submenu-content {
- 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);
- }
- }
- .ant-dropdown-menu-submenu-popup {
- min-width: $submenu-min-width;
- .ant-dropdown-menu-sub {
- margin: 0;
- }
- }
- .ant-dropdown-menu-item-divider {
- margin: 0;
- }
- }
|