global.less 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. @import './index.less';
  2. body {
  3. }
  4. #app {
  5. height: 100%;
  6. &.colorWeak {
  7. filter: invert(80%);
  8. }
  9. &.userLayout {
  10. overflow: auto;
  11. }
  12. }
  13. .layout.ant-layout {
  14. height: auto;
  15. overflow-x: hidden;
  16. &.mobile,
  17. &.tablet {
  18. .ant-layout-content {
  19. .content {
  20. margin: 24px 0 0;
  21. }
  22. }
  23. /**
  24. * ant-table-wrapper
  25. * 覆盖的表格手机模式样式,如果想修改在手机上表格最低宽度,可以在这里改动
  26. */
  27. .ant-table-wrapper {
  28. .ant-table-content {
  29. overflow-y: auto;
  30. }
  31. .ant-table-body {
  32. min-width: 800px;
  33. }
  34. }
  35. .topmenu {
  36. /* 必须为 topmenu 才能启用流式布局 */
  37. &.content-width-Fluid {
  38. .header-index-wide {
  39. margin-left: 0;
  40. }
  41. }
  42. }
  43. }
  44. &.mobile {
  45. .sidemenu {
  46. .ant-header-fixedHeader {
  47. &.ant-header-side-opened,
  48. &.ant-header-side-closed {
  49. width: 100%;
  50. }
  51. }
  52. }
  53. }
  54. &.ant-layout-has-sider {
  55. flex-direction: row;
  56. }
  57. .trigger {
  58. font-size: 20px;
  59. line-height: 64px;
  60. padding: 0 24px;
  61. cursor: pointer;
  62. transition: color 0.3s;
  63. &:hover {
  64. background: rgba(0, 0, 0, 0.025);
  65. }
  66. }
  67. .topmenu {
  68. .ant-header-fixedHeader {
  69. position: fixed;
  70. top: 0;
  71. right: 0;
  72. z-index: 9;
  73. width: 100%;
  74. transition: width 0.2s;
  75. &.ant-header-side-opened {
  76. width: 100%;
  77. }
  78. &.ant-header-side-closed {
  79. width: 100%;
  80. }
  81. }
  82. /* 必须为 topmenu 才能启用流式布局 */
  83. &.content-width-Fluid {
  84. .header-index-wide {
  85. max-width: unset;
  86. .header-index-left {
  87. flex: 1 1 1000px;
  88. .logo{
  89. margin-left: 25px;
  90. }
  91. .ant-menu.ant-menu-horizontal{
  92. max-width: calc(100vw - 190px - 238px - 25px);
  93. flex: 1 1 calc(100vw - 190px - 238px - 25px);
  94. }
  95. }
  96. .header-index-right{
  97. margin-right:25px;
  98. }
  99. }
  100. .page-header-index-wide {
  101. max-width: unset;
  102. }
  103. }
  104. }
  105. .sidemenu {
  106. .ant-header-fixedHeader {
  107. position: fixed;
  108. top: 0;
  109. right: 0;
  110. z-index: 9;
  111. width: 100%;
  112. transition: width 0.2s;
  113. &.ant-header-side-opened {
  114. width: calc(100% - 256px);
  115. }
  116. &.ant-header-side-closed {
  117. width: calc(100% - 80px);
  118. }
  119. }
  120. }
  121. .header {
  122. height: 64px;
  123. padding: 0 12px 0 0;
  124. background: #fff;
  125. box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  126. position: relative;
  127. }
  128. .header,
  129. .top-nav-header-index {
  130. .user-wrapper {
  131. float: right;
  132. height: 100%;
  133. .action {
  134. cursor: pointer;
  135. padding: 0 12px;
  136. display: inline-block;
  137. transition: all 0.3s;
  138. height: 100%;
  139. color: rgba(0, 0, 0, 0.65);
  140. &:hover {
  141. background: rgba(0, 0, 0, 0.025);
  142. }
  143. .avatar {
  144. margin: 20px 8px 20px 0;
  145. color: #1890ff;
  146. background: hsla(0, 0%, 100%, 0.85);
  147. vertical-align: middle;
  148. }
  149. .icon {
  150. font-size: 16px;
  151. padding: 4px;
  152. }
  153. }
  154. }
  155. &.dark {
  156. .user-wrapper {
  157. .action {
  158. color: rgba(255, 255, 255, 0.85);
  159. a {
  160. color: rgba(255, 255, 255, 0.85);
  161. }
  162. &:hover {
  163. background: rgba(255, 255, 255, 0.16);
  164. }
  165. }
  166. }
  167. }
  168. }
  169. &.mobile,
  170. &.tablet {
  171. .top-nav-header-index {
  172. .header-index-wide {
  173. .header-index-left {
  174. .trigger {
  175. color: rgba(255, 255, 255, 0.85);
  176. padding: 0 12px;
  177. }
  178. .logo.top-nav-header {
  179. flex: 0 0 56px;
  180. text-align: center;
  181. line-height: 58px;
  182. h1 {
  183. display: none;
  184. }
  185. }
  186. }
  187. }
  188. &.light {
  189. .header-index-wide {
  190. .header-index-left {
  191. .trigger {
  192. color: rgba(0, 0, 0, 0.65);
  193. }
  194. }
  195. }
  196. //
  197. }
  198. }
  199. }
  200. &.tablet {
  201. // overflow: hidden; text-overflow:ellipsis; white-space: nowrap;
  202. .top-nav-header-index {
  203. .header-index-wide {
  204. .header-index-left {
  205. .logo > a {
  206. overflow: hidden;
  207. text-overflow: ellipsis;
  208. white-space: nowrap;
  209. }
  210. }
  211. .ant-menu.ant-menu-horizontal {
  212. flex: 1 1 auto;
  213. white-space: normal;
  214. }
  215. }
  216. }
  217. }
  218. .top-nav-header-index {
  219. box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  220. position: relative;
  221. transition: background 0.3s, width 0.2s;
  222. .header-index-wide {
  223. max-width: 1200px;
  224. margin: auto;
  225. padding-left: 0;
  226. display: flex;
  227. height: 64px;
  228. .ant-menu.ant-menu-horizontal {
  229. max-width: 835px;
  230. flex: 0 1 835px;
  231. border: none;
  232. height: 64px;
  233. line-height: 64px;
  234. }
  235. .header-index-left {
  236. flex: 0 1 1000px;
  237. display: flex;
  238. .logo.top-nav-header {
  239. flex: 0 0 165px;
  240. width: 165px;
  241. height: 64px;
  242. position: relative;
  243. line-height: 64px;
  244. transition: all 0.3s;
  245. overflow: hidden;
  246. img,
  247. svg {
  248. display: inline-block;
  249. vertical-align: middle;
  250. height: 32px;
  251. width: 32px;
  252. }
  253. h1 {
  254. color: #fff;
  255. display: inline-block;
  256. vertical-align: top;
  257. font-size: 16px;
  258. margin: 0 0 0 12px;
  259. font-weight: 400;
  260. }
  261. }
  262. }
  263. .header-index-right {
  264. flex: 0 0 238px;
  265. align-self: flex-end;
  266. height: 64px;
  267. overflow: hidden;
  268. .content-box {
  269. float: right;
  270. .action {
  271. max-width: 140px;
  272. overflow: hidden;
  273. text-overflow:ellipsis;
  274. white-space:nowrap;
  275. }
  276. }
  277. }
  278. }
  279. &.light {
  280. background-color: #fff;
  281. .header-index-wide {
  282. .header-index-left {
  283. .logo {
  284. h1 {
  285. color: #002140;
  286. }
  287. }
  288. }
  289. }
  290. }
  291. }
  292. // 内容区
  293. .layout-content {
  294. margin: 24px 24px 0px;
  295. height: 100%;
  296. height: 64px;
  297. padding: 0 12px 0 0;
  298. }
  299. // footer
  300. .ant-layout-footer {
  301. padding: 0;
  302. }
  303. }
  304. .topmenu {
  305. .page-header-index-wide {
  306. max-width: 1200px;
  307. margin: 0 auto;
  308. }
  309. }
  310. // drawer-sider 自定义
  311. .ant-drawer.drawer-sider {
  312. .sider {
  313. box-shadow: none;
  314. }
  315. &.dark {
  316. .ant-drawer-content {
  317. background-color: rgb(0, 21, 41);
  318. }
  319. }
  320. &.light {
  321. box-shadow: none;
  322. .ant-drawer-content {
  323. background-color: #fff;
  324. }
  325. }
  326. .ant-drawer-body {
  327. padding: 0;
  328. }
  329. }
  330. // 菜单样式
  331. .sider {
  332. box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
  333. position: relative;
  334. z-index: @ant-global-sider-zindex;
  335. min-height: 100vh;
  336. .ant-layout-sider-children {
  337. overflow-y: hidden;
  338. &:hover {
  339. overflow-y: auto;
  340. }
  341. }
  342. &.ant-fixed-sidemenu {
  343. position: fixed;
  344. height: 100%;
  345. }
  346. .logo {
  347. position: relative;
  348. height: 64px;
  349. padding-left: 24px;
  350. overflow: hidden;
  351. line-height: 64px;
  352. background: #002140;
  353. transition: all .3s;
  354. img,
  355. svg,
  356. h1 {
  357. display: inline-block;
  358. vertical-align: middle;
  359. }
  360. img,
  361. svg {
  362. height: 32px;
  363. width: 32px;
  364. }
  365. h1 {
  366. color: #fff;
  367. font-size: 20px;
  368. margin: 0 0 0 12px;
  369. font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
  370. font-weight: 600;
  371. vertical-align: middle;
  372. }
  373. }
  374. &.light {
  375. background-color: #fff;
  376. box-shadow: 2px 0px 8px 0px rgba(29, 35, 41, 0.05);
  377. .logo {
  378. background: #fff;
  379. box-shadow: 1px 1px 0px 0px #e8e8e8;
  380. h1 {
  381. color: unset;
  382. }
  383. }
  384. .ant-menu-light {
  385. border-right-color: transparent;
  386. }
  387. }
  388. }
  389. // 外置的样式控制
  390. .user-dropdown-menu {
  391. span {
  392. user-select: none;
  393. }
  394. }
  395. .user-dropdown-menu-wrapper.ant-dropdown-menu {
  396. padding: 4px 0;
  397. .ant-dropdown-menu-item {
  398. width: 160px;
  399. }
  400. .ant-dropdown-menu-item > .anticon:first-child,
  401. .ant-dropdown-menu-item > a > .anticon:first-child,
  402. .ant-dropdown-menu-submenu-title > .anticon:first-child .ant-dropdown-menu-submenu-title > a > .anticon:first-child {
  403. min-width: 12px;
  404. margin-right: 8px;
  405. }
  406. }
  407. // 数据列表 样式
  408. .table-alert {
  409. margin-bottom: 16px;
  410. }
  411. .table-page-search-wrapper {
  412. .ant-form-inline {
  413. .ant-form-item {
  414. display: flex;
  415. margin-bottom: 24px;
  416. margin-right: 0;
  417. .ant-form-item-control-wrapper {
  418. flex: 1 1;
  419. display: inline-block;
  420. vertical-align: middle;
  421. }
  422. > .ant-form-item-label {
  423. line-height: 32px;
  424. padding-right: 8px;
  425. width: auto;
  426. }
  427. .ant-form-item-control {
  428. height: 32px;
  429. line-height: 32px;
  430. }
  431. }
  432. }
  433. .table-page-search-submitButtons {
  434. display: block;
  435. margin-bottom: 24px;
  436. white-space: nowrap;
  437. }
  438. }
  439. .content {
  440. .table-operator {
  441. margin-bottom: 18px;
  442. button {
  443. margin-right: 8px;
  444. }
  445. }
  446. }