CloudHeader.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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.usoftchina.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. .navbar-slogan{
  118. font-size: 14px;
  119. }
  120. .f-nav{
  121. display:inline-block;
  122. margin-left:30px;
  123. padding-top:15px;
  124. li{
  125. margin-right:25px;
  126. }
  127. }
  128. .menu-item{
  129. font-size: 14px!important;
  130. color:#666!important;
  131. }
  132. .menu-item.nuxt-link-active, .menu-item:hover{
  133. color:#333!important;
  134. background: #eeeeee;
  135. }
  136. .header .navbar{
  137. min-height: inherit;
  138. border-radius: 0;
  139. }
  140. .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu li span,.header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu li a{
  141. font-size: 12px;
  142. }
  143. .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu .menu-item a{
  144. width: 100%;
  145. display: inline-block;
  146. overflow: hidden;
  147. text-overflow: ellipsis;
  148. white-space: nowrap;
  149. height: 25px;
  150. }
  151. .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu .menu-item{
  152. height: 30px;
  153. }
  154. .dropdown-menu>li>a{
  155. padding: 0;
  156. line-height: 30px;
  157. }
  158. .dropdown-menu>li a:hover{
  159. background: none;
  160. text-decoration: underline !important;
  161. }
  162. .header {
  163. height: $nav-height;
  164. .navbar {
  165. width: 100%;
  166. height: 100%;
  167. font-size: $font-size-small;
  168. background-color: $black-light;
  169. box-shadow: $nav-boxshadow;
  170. -o-box-shadow: $nav-boxshadow;
  171. -moz-box-shadow: $nav-boxshadow;
  172. -webkit-box-shadow: $nav-boxshadow;
  173. .navbar-container {
  174. .item-wrap {
  175. display: inline-block;
  176. }
  177. .item {
  178. color: $nav-color;
  179. display: inline-block;
  180. height: $nav-height;
  181. line-height: $nav-height;
  182. }
  183. a {
  184. position: relative;
  185. color: $nav-color;
  186. font-weight: bold;
  187. font-size: 16px;
  188. > span:before{
  189. content: '';
  190. position: absolute;
  191. top: 5px;
  192. left: 16px;
  193. width: 1px;
  194. height: 14px;
  195. background: #bfbfbf;
  196. }
  197. }
  198. .navbar-header {
  199. float: left;
  200. .navbar-logo {
  201. margin-bottom: 2px;
  202. }
  203. .navbar-slogan {
  204. margin-left: $sm-pad;
  205. }
  206. }
  207. .navbar-right {
  208. float: right;
  209. .item {
  210. padding: 0 $pad;
  211. }
  212. .dropdown {
  213. .dropdown-toggle {
  214. line-height: $nav-height;
  215. border-left: 1px solid $black-light;
  216. border-right: 1px solid $black-light;
  217. height: 35px;
  218. a {
  219. margin-left: 15px;
  220. float: right;
  221. &:hover {
  222. color: $red !important;
  223. }
  224. }
  225. &:hover {
  226. border-left: 1px solid #999;
  227. border-right: 1px solid #999;
  228. }
  229. span {
  230. display: inline-block;
  231. max-width: 190px;
  232. overflow: hidden;
  233. text-overflow: ellipsis;
  234. white-space: nowrap;
  235. float: right;
  236. }
  237. }
  238. .menu-item-first {
  239. background: #eee;
  240. padding: 0 12px;
  241. line-height: 30px;
  242. font-size: 12px;
  243. >span:nth-child(1) {
  244. cursor: default;
  245. font-weight: bold;
  246. }
  247. input {
  248. width: 174px;
  249. height: 24px;
  250. margin-left: 35px;
  251. background: #fff;
  252. border: 1px solid #5078cb;
  253. padding-left: 4px;
  254. }
  255. .search-enterprise {
  256. display: inline-block;
  257. width: 36px;
  258. height: 24px;
  259. color: #fff;
  260. background: #5078cb;
  261. text-align: center;
  262. line-height: 24px;
  263. cursor: pointer;
  264. }
  265. }
  266. .dropdown-menu {
  267. padding: 0 6px 13px;
  268. margin:0;
  269. border-radius: 0;
  270. right: unset;
  271. background: #fff;
  272. border: 1px solid #999999;
  273. border-top: none;
  274. -webkit-box-shadow: none;
  275. -moz-box-shadow: none;
  276. box-shadow: none;
  277. ::-webkit-scrollbar {
  278. background: #f6f6f6;
  279. }
  280. ul {
  281. max-height: 300px;
  282. overflow-y: auto;
  283. background: #f6f6f6;
  284. }
  285. .menu-item {
  286. padding: 0 12px;
  287. a {
  288. color: #333;
  289. max-width: 300px;
  290. line-height: 30px;
  291. width: auto;
  292. &:hover {
  293. color: #5078cb;
  294. text-decoration: none!important;
  295. }
  296. }
  297. }
  298. }
  299. &:hover {
  300. background-color: $white;
  301. .dropdown-toggle {
  302. color: $text;
  303. }
  304. a {
  305. color: $text
  306. }
  307. }
  308. }
  309. }
  310. }
  311. }
  312. }
  313. </style>