LayoutView.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <a-layout class="layout">
  3. <sider-menu :menus="menus" :collapsed="collapsed" :collapsible="true"></sider-menu>
  4. <a-layout>
  5. <!-- layout header -->
  6. <s-layout-header :collapsed="collapsed" @toggle="toggle"></s-layout-header>
  7. <!-- layout content -->
  8. <a-layout-content :style="{ margin: '24px 24px 0', height: '100%' }">
  9. <page-content>
  10. <slot></slot>
  11. </page-content>
  12. </a-layout-content>
  13. <a-layout-footer style="padding: 0px">
  14. <s-layout-footer />
  15. </a-layout-footer>
  16. </a-layout>
  17. </a-layout>
  18. </template>
  19. <script>
  20. import SiderMenu from '@/components/menu/SiderMenu'
  21. import LayoutHeader from '@/components/LayoutHeader'
  22. import LayoutFooter from '@/components/LayoutFooter'
  23. import PageContent from '@/components/PageContent'
  24. import { asyncRouterMap } from '@/router/index'
  25. export default {
  26. name: "LayoutView",
  27. components: {
  28. SiderMenu,
  29. PageContent,
  30. "s-layout-header": LayoutHeader,
  31. "s-layout-footer": LayoutFooter
  32. },
  33. data() {
  34. return {
  35. collapsed: false,
  36. menus: []
  37. }
  38. },
  39. created () {
  40. this.menus = asyncRouterMap
  41. },
  42. methods: {
  43. toggle() {
  44. this.collapsed = !this.collapsed;
  45. },
  46. }
  47. }
  48. </script>
  49. <style lang="scss">
  50. html {
  51. // 打开滚动条固定显示
  52. overflow-y: scroll;
  53. }
  54. .layout {
  55. min-height: 100vh;
  56. overflow-x: hidden;
  57. &.ant-layout-has-sider {
  58. flex-direction: row;
  59. }
  60. .trigger {
  61. font-size: 18px;
  62. line-height: 64px;
  63. padding: 0 24px;
  64. cursor: pointer;
  65. transition: color .3s;
  66. &:hover {
  67. color: #1890ff;
  68. background: #e6f7ff;
  69. }
  70. }
  71. .logo {
  72. height: 64px;
  73. position: relative;
  74. line-height: 64px;
  75. padding-left: 24px;
  76. -webkit-transition: all .3s;
  77. transition: all .3s;
  78. background: #002140;
  79. overflow: hidden;
  80. img, h1 {
  81. display: inline-block;
  82. vertical-align: middle;
  83. }
  84. img {
  85. height: 32px;
  86. }
  87. h1 {
  88. color: #fff;
  89. font-size: 20px;
  90. margin: 0 0 0 12px;
  91. font-family: "Myriad Pro","Helvetica Neue",Arial,Helvetica,sans-serif;
  92. font-weight: 600;
  93. }
  94. }
  95. .sider {
  96. box-shadow: 2px 0 6px rgba(0,21,41,.35);
  97. }
  98. .header {
  99. height: 64px;
  100. padding: 0 12px 0 0;
  101. background: #fff;
  102. box-shadow: 0 1px 4px rgba(0,21,41,.08);
  103. position: relative;
  104. .user-wrapper {
  105. float: right;
  106. height: 100%;
  107. .action {
  108. cursor: pointer;
  109. padding: 0 12px;
  110. display: inline-block;
  111. transition: all .3s;
  112. height: 100%;
  113. &:hover {
  114. background: #e6f7ff;
  115. }
  116. .avatar {
  117. margin: 20px 8px 20px 0;
  118. color: #1890ff;
  119. background: hsla(0,0%,100%,.85);
  120. vertical-align: middle;
  121. }
  122. .icon {
  123. font-size: 16px;
  124. padding: 4px;
  125. }
  126. }
  127. }
  128. }
  129. // 内容区
  130. .layout-content {
  131. margin: 24px 24px 0px;
  132. height: 100%;
  133. }
  134. }
  135. // 外置的样式控制
  136. .user-dropdown-menu-wrapper.ant-dropdown-menu {
  137. padding: 4px 0;
  138. .ant-dropdown-menu-item {
  139. width: 160px;
  140. }
  141. .ant-dropdown-menu-item>.anticon:first-child,
  142. .ant-dropdown-menu-submenu-title>.anticon:first-child {
  143. min-width: 12px;
  144. margin-right: 8px;
  145. }
  146. }
  147. // 数据列表 样式
  148. .tableList {
  149. .table-search {
  150. &.open-more-condition {
  151. .more-condition {
  152. display: block;
  153. }
  154. }
  155. .more-condition {
  156. display: none;
  157. }
  158. .ant-form-item {
  159. display: flex;
  160. margin-bottom: 24px;
  161. &>.ant-form-item-label {
  162. flex: unset;
  163. }
  164. .ant-form-item-control-wrapper {
  165. flex: 1 1;
  166. }
  167. }
  168. }
  169. .ant-alert, .table-operator {
  170. margin-bottom: 16px;
  171. }
  172. }
  173. </style>