CloudHeader.vue 7.4 KB

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