top.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div id="logo">
  3. <el-col :span="24" class="top">
  4. <div class="w_1200">
  5. <el-col :span="12">
  6. <span class="date">{{ data }}</span>
  7. </el-col>
  8. <el-col :span="12" class="login">
  9. <span v-if="user.type == null">
  10. <el-button size="mini" @click="$router.push({ path: '/login' })">登录</el-button>
  11. <el-button size="mini" @click="$router.push({ path: '/register' })">注册</el-button>
  12. </span>
  13. <span v-else>
  14. <!-- <span style="padding:0 15px 0 0;">{{ user.name }}</span> -->
  15. <el-button @click="$router.push({ path: '/pcenter/index' })">个人中心</el-button>
  16. </span>
  17. </el-col>
  18. </div>
  19. </el-col>
  20. <el-col :span="24" class="logo">
  21. <div class="w_1200">
  22. <el-col :span="2" class="image" @click.native="clickBtn()">
  23. <el-image :src="src"></el-image>
  24. </el-col>
  25. <el-col :span="15" class="title" @click.native="clickBtn()">
  26. <p>吉林省计算中心</p>
  27. <p>JiLin province computing center</p>
  28. </el-col>
  29. <el-col :span="7" class="search">
  30. <el-input placeholder="关键词" v-model="input"></el-input>
  31. <el-button icon="el-icon-search"></el-button>
  32. </el-col>
  33. </div>
  34. </el-col>
  35. </div>
  36. </template>
  37. <script>
  38. import moment from 'moment';
  39. import { mapState, createNamespacedHelpers } from 'vuex';
  40. export default {
  41. name: 'logo',
  42. props: {},
  43. components: {},
  44. data: () => ({
  45. src: require('@/assets/logo.png'),
  46. newsrc: require('@/assets/123.jpg'),
  47. data: '',
  48. input: '',
  49. }),
  50. created() {
  51. this.searchdate();
  52. },
  53. computed: {
  54. ...mapState(['user']),
  55. },
  56. methods: {
  57. searchdate() {
  58. let date = moment().format('YYYY-MM-DD ');
  59. let week = moment().format('d');
  60. let newWeek = week == 1 ? '一' : week == 2 ? '二' : week == 3 ? '三' : week == 4 ? '四' : week == 5 ? '五' : week == 6 ? '六' : week == 7 ? '日' : '';
  61. let newDate = date + '星期' + newWeek;
  62. this.$set(this, `data`, newDate);
  63. },
  64. clickBtn() {
  65. this.$router.push({ path: '/' });
  66. },
  67. },
  68. };
  69. </script>
  70. <style lang="less" scoped>
  71. .w_1200 {
  72. width: 1200px;
  73. margin: 0 auto;
  74. }
  75. .top {
  76. height: 40px;
  77. overflow: hidden;
  78. background-color: rgba(11, 58, 125, 0.8);
  79. color: #fff;
  80. line-height: 40px;
  81. }
  82. .login {
  83. text-align: right;
  84. .el-button {
  85. background: transparent;
  86. color: #fff;
  87. border: none;
  88. font-size: 18px;
  89. padding: 0 0;
  90. }
  91. }
  92. .logo {
  93. height: 200px;
  94. overflow: hidden;
  95. .image {
  96. padding: 66px 0;
  97. }
  98. .title {
  99. padding: 66px 0;
  100. p:first-child {
  101. font-size: 40px;
  102. color: rgb(255, 255, 255);
  103. font-family: 黑体;
  104. }
  105. p:last-child {
  106. font-size: 16px;
  107. color: rgb(255, 255, 255);
  108. font-family: 黑体;
  109. text-transform: uppercase;
  110. }
  111. }
  112. .title:hover {
  113. cursor: pointer;
  114. }
  115. }
  116. .search {
  117. height: 40px;
  118. background: #2152994f;
  119. border-radius: 25px;
  120. color: #fff;
  121. padding: 0 0 0 16px;
  122. margin: 80px 0;
  123. .el-input {
  124. float: left;
  125. width: 85%;
  126. }
  127. .el-button {
  128. float: left;
  129. padding: 8px 8px;
  130. background: transparent;
  131. border: none;
  132. font-size: 25px;
  133. }
  134. }
  135. /deep/.el-input__inner {
  136. background: transparent;
  137. border: none;
  138. color: #fff;
  139. }
  140. </style>