Header.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <div class="header">
  3. <div class="left">
  4. <!-- <img class="first" src="../assets/three.png" alt="" />
  5. <div class="shu"></div> -->
  6. <img class="logo" src="../assets/white-logo.png" alt="" />
  7. <div
  8. class="ml20"
  9. style="color: #fff; font-size: 18px; height: 60px; padding-top: 50px"
  10. >
  11. version:{{ timelineData[0]?.version }}
  12. </div>
  13. </div>
  14. <div class="right">
  15. <img class="user-icon" src="../assets/user.png" alt="" />
  16. <div class="user">{{ contactName }}</div>
  17. <el-popover placement="bottom" trigger="hover" :width="280">
  18. <div
  19. style="
  20. width: 100%;
  21. height: 60vh;
  22. overflow-y: auto;
  23. padding-right: 10px;
  24. margin-right: 10px;
  25. "
  26. >
  27. <el-timeline>
  28. <el-timeline-item
  29. v-for="item in timelineData"
  30. center
  31. :timestamp="item.timer"
  32. placement="top"
  33. >
  34. <div class="log-card">
  35. <p style="margin-bottom: 10px">Version: {{ item.version }}</p>
  36. <div
  37. style="margin-bottom: 5px; font-size: 12px"
  38. v-for="(item1, index) in item.remarks"
  39. >
  40. {{ index + 1 }}. {{ item1.text }}
  41. </div>
  42. </div>
  43. </el-timeline-item>
  44. </el-timeline>
  45. </div>
  46. <template #reference>
  47. <el-badge value="new">
  48. <div class="log">新功能日志</div>
  49. </el-badge>
  50. </template>
  51. </el-popover>
  52. <div class="quit" @click="quit">[退出]</div>
  53. </div>
  54. </div>
  55. </template>
  56. <script>
  57. import store from "../store";
  58. import router from "../router";
  59. import { onMounted, ref } from "vue";
  60. import { AnonymousLogin, tcb } from "../apis/cloudLogin";
  61. const db = tcb.database();
  62. const v = db.collection("huihenduo_versions");
  63. const __ = db.command;
  64. export default {
  65. setup() {
  66. let contactName = localStorage.contactName;
  67. function quit() {
  68. localStorage.clear();
  69. store.commit("changeLogin", false);
  70. router.push({ path: "/login" });
  71. }
  72. let timelineData = ref([]);
  73. onMounted(() => {
  74. cloudLogin();
  75. });
  76. async function getAbledVersions() {
  77. let res = await v
  78. .aggregate()
  79. .match({ deleted: __.neq(true) })
  80. .sort({
  81. createTime: -1,
  82. })
  83. .limit(10)
  84. .end();
  85. timelineData.value = res.data;
  86. }
  87. async function cloudLogin() {
  88. await AnonymousLogin();
  89. getAbledVersions();
  90. }
  91. return {
  92. quit,
  93. contactName,
  94. timelineData,
  95. };
  96. },
  97. };
  98. </script>
  99. <style scoped>
  100. .header {
  101. width: 100%;
  102. height: 60px;
  103. background: #212029;
  104. display: flex;
  105. align-items: center;
  106. justify-content: space-between;
  107. }
  108. .left,
  109. .right {
  110. display: flex;
  111. align-items: center;
  112. }
  113. .first {
  114. width: 22px;
  115. height: 20px;
  116. margin: 0 22px;
  117. }
  118. .shu {
  119. width: 1px;
  120. height: 60px;
  121. background: #101015;
  122. margin-right: 22px;
  123. }
  124. .logo {
  125. width: 120px;
  126. height: 40px;
  127. margin-left: 20px;
  128. }
  129. .title {
  130. font-size: 21px;
  131. font-family: PingFangSC-Regular, PingFang SC;
  132. font-weight: 400;
  133. color: #ffffff;
  134. margin-left: 26px;
  135. }
  136. .user,
  137. .quit,
  138. .log {
  139. font-size: 14px;
  140. font-family: PingFangSC-Medium, PingFang SC;
  141. font-weight: 500;
  142. color: #ffffff;
  143. cursor: pointer;
  144. margin-right: 16px;
  145. }
  146. .log-card p {
  147. font-size: 10px;
  148. }
  149. .user-icon {
  150. width: 18px;
  151. height: 18px;
  152. margin-right: 16px;
  153. }
  154. .log {
  155. margin-right: 4px;
  156. }
  157. .quit {
  158. margin-left: 26px;
  159. }
  160. </style>