CloudHeader.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <template>
  2. <header class="header">
  3. <nav class="navbar">
  4. <div class="navbar-container container">
  5. <div class="navbar-header">
  6. <a href="http://www.ubtob.com" class="item navbar-link">
  7. <img src="/images/logo/uas.png" class="navbar-logo">
  8. </a>
  9. <a href=""><span class="navbar-slogan">云中心</span></a>
  10. </div>
  11. <ul class="nav nav-pills f-nav">
  12. <li>
  13. <nuxt-link to="/cloudcenter" class="menu-item" exact>基本信息</nuxt-link>
  14. </li>
  15. <li>
  16. <nuxt-link to="/cloudcenter/enterprise" class="menu-item">企业管理</nuxt-link>
  17. </li>
  18. </ul>
  19. </div>
  20. </nav>
  21. </header>
  22. </template>
  23. <script>
  24. export default {
  25. name: 'cloudHeader',
  26. data () {
  27. return {}
  28. },
  29. computed: {
  30. // user () {
  31. // return this.$store.state.option.user
  32. // },
  33. // enterprise () {
  34. // let ens = this.user.data.enterprises
  35. // if (ens && ens.length) {
  36. // return ens.find(item => item.current) || {enName: '个人账户'}
  37. // } else {
  38. // return {enName: '个人账户'}
  39. // }
  40. // },
  41. // sortEnterprises () {
  42. // let ens = this.user.data.enterprises
  43. // if (ens && ens.length) {
  44. // ens.sort(function (a, b) {
  45. // return b.lastLoginTime - a.lastLoginTime
  46. // })
  47. // }
  48. // return ens
  49. // },
  50. // url () {
  51. // return this.$store.state.option.url
  52. // }
  53. },
  54. methods: {
  55. // logout () {
  56. // this.$http.get('/logout/crossBefore').then(response => {
  57. // if (response.data) {
  58. // window.location.href = response.data.logoutUrl + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
  59. // }
  60. // })
  61. // },
  62. // onLoginClick () {
  63. // this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
  64. // if (response.data) {
  65. // window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
  66. // }
  67. // })
  68. // },
  69. // onRegisterClick () {
  70. // this.$http.get('/register/page').then(response => {
  71. // if (response.data) {
  72. // window.location.href = response.data.content
  73. // }
  74. // })
  75. // },
  76. // // 切换当前企业
  77. // switchEnterprise (en) {
  78. // this.showEnterpriseToggle = false
  79. // this.$http.get(`/user/authentication/${en.uu}`).then(() => {
  80. // this.$store.dispatch('loadUserInfo')
  81. // window.location.href = '/'
  82. // })
  83. // },
  84. // toVendor: function () {
  85. // let isSelf = true
  86. // let tempEnterprise = {}
  87. // let ens = this.user.data.enterprises
  88. // if (ens && ens.length) {
  89. // ens.forEach(function (item) {
  90. // if (item.current) {
  91. // isSelf = false
  92. // tempEnterprise = item
  93. // }
  94. // })
  95. // } else {
  96. // isSelf = true
  97. // }
  98. // if (isSelf) {
  99. // window.location.href = '/register-saler'
  100. // } else {
  101. // if (tempEnterprise.isVendor === 313) {
  102. // window.location.href = '/vendor#/index'
  103. // } else {
  104. // window.location.href = '/register-saler'
  105. // }
  106. // }
  107. // }
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped type="text/scss">
  112. @import '~assets/scss/mixins';
  113. @import '~assets/scss/variables';
  114. $nav-height: 60px;
  115. $nav-boxshadow: 2px 2px 5px rgba(0,0,0,.12);
  116. $nav-color: #3c3c3c;
  117. .f-nav{
  118. display:inline-block;
  119. margin-left:30px;
  120. padding-top:15px;
  121. }
  122. .menu-item{
  123. font-size: 14px;
  124. color:#999!important;
  125. }
  126. .menu-item.nuxt-link-active, .menu-item:hover{
  127. color:#333!important;
  128. background: #eeeeee;
  129. }
  130. .header .navbar{
  131. min-height: inherit;
  132. border-radius: 0;
  133. }
  134. .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu li span,.header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu li a{
  135. font-size: 12px;
  136. }
  137. .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu .menu-item a{
  138. width: 100%;
  139. display: inline-block;
  140. overflow: hidden;
  141. text-overflow: ellipsis;
  142. white-space: nowrap;
  143. height: 25px;
  144. }
  145. .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu .menu-item{
  146. height: 30px;
  147. }
  148. .dropdown-menu>li>a{
  149. padding: 0;
  150. line-height: 30px;
  151. }
  152. .dropdown-menu>li a:hover{
  153. background: none;
  154. text-decoration: underline !important;
  155. }
  156. .header {
  157. height: $nav-height;
  158. .navbar {
  159. width: 100%;
  160. height: 100%;
  161. font-size: $font-size-small;
  162. background-color: $black-light;
  163. box-shadow: $nav-boxshadow;
  164. -o-box-shadow: $nav-boxshadow;
  165. -moz-box-shadow: $nav-boxshadow;
  166. -webkit-box-shadow: $nav-boxshadow;
  167. .navbar-container {
  168. .item-wrap {
  169. display: inline-block;
  170. }
  171. .item {
  172. color: $nav-color;
  173. display: inline-block;
  174. height: $nav-height;
  175. line-height: $nav-height;
  176. }
  177. a {
  178. position: relative;
  179. color: $nav-color;
  180. font-weight: bold;
  181. font-size: 16px;
  182. > span:before{
  183. content: '';
  184. position: absolute;
  185. top: 5px;
  186. left: 16px;
  187. width: 1px;
  188. height: 14px;
  189. background: #bfbfbf;
  190. }
  191. }
  192. .navbar-header {
  193. float: left;
  194. .navbar-logo {
  195. margin-bottom: 2px;
  196. }
  197. .navbar-slogan {
  198. margin-left: $sm-pad;
  199. }
  200. }
  201. .navbar-right {
  202. float: right;
  203. .item {
  204. padding: 0 $pad;
  205. }
  206. .dropdown {
  207. .dropdown-toggle {
  208. line-height: $nav-height;
  209. border-left: 1px solid $black-light;
  210. border-right: 1px solid $black-light;
  211. height: 35px;
  212. a {
  213. margin-left: 15px;
  214. float: right;
  215. &:hover {
  216. color: $red !important;
  217. }
  218. }
  219. &:hover {
  220. border-left: 1px solid #999;
  221. border-right: 1px solid #999;
  222. }
  223. span {
  224. display: inline-block;
  225. max-width: 190px;
  226. overflow: hidden;
  227. text-overflow: ellipsis;
  228. white-space: nowrap;
  229. float: right;
  230. }
  231. }
  232. .menu-item-first {
  233. background: #eee;
  234. padding: 0 12px;
  235. line-height: 30px;
  236. font-size: 12px;
  237. >span:nth-child(1) {
  238. cursor: default;
  239. font-weight: bold;
  240. }
  241. input {
  242. width: 174px;
  243. height: 24px;
  244. margin-left: 35px;
  245. background: #fff;
  246. border: 1px solid #5078cb;
  247. padding-left: 4px;
  248. }
  249. .search-enterprise {
  250. display: inline-block;
  251. width: 36px;
  252. height: 24px;
  253. color: #fff;
  254. background: #5078cb;
  255. text-align: center;
  256. line-height: 24px;
  257. cursor: pointer;
  258. }
  259. }
  260. .dropdown-menu {
  261. padding: 0 6px 13px;
  262. margin:0;
  263. border-radius: 0;
  264. right: unset;
  265. background: #fff;
  266. border: 1px solid #999999;
  267. border-top: none;
  268. -webkit-box-shadow: none;
  269. -moz-box-shadow: none;
  270. box-shadow: none;
  271. ::-webkit-scrollbar {
  272. background: #f6f6f6;
  273. }
  274. ul {
  275. max-height: 300px;
  276. overflow-y: auto;
  277. background: #f6f6f6;
  278. }
  279. .menu-item {
  280. padding: 0 12px;
  281. a {
  282. color: #333;
  283. max-width: 300px;
  284. line-height: 30px;
  285. width: auto;
  286. &:hover {
  287. color: #5078cb;
  288. text-decoration: none!important;
  289. }
  290. }
  291. }
  292. }
  293. &:hover {
  294. background-color: $white;
  295. .dropdown-toggle {
  296. color: $text;
  297. }
  298. a {
  299. color: $text
  300. }
  301. }
  302. }
  303. }
  304. }
  305. }
  306. }
  307. </style>