Header.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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="240">
  18. <div style="width: 100%; height: 80vh; overflow-y: scroll">
  19. <el-timeline>
  20. <el-timeline-item
  21. v-for="item in timelineData"
  22. center
  23. :timestamp="item.timer"
  24. placement="top"
  25. >
  26. <div class="log-card">
  27. <p style="margin-bottom: 10px">Version: {{ item.version }}</p>
  28. <div
  29. style="margin-bottom: 5px; font-size: 12px"
  30. v-for="(item1, index) in item.remarks"
  31. >
  32. {{ index + 1 }}. {{ item1.text }}
  33. </div>
  34. </div>
  35. </el-timeline-item>
  36. </el-timeline>
  37. </div>
  38. <template #reference>
  39. <el-badge value="new">
  40. <div class="log">新功能日志</div>
  41. </el-badge>
  42. </template>
  43. </el-popover>
  44. <div class="quit" @click="quit">[退出]</div>
  45. </div>
  46. </div>
  47. </template>
  48. <script>
  49. import store from "../store";
  50. import router from "../router";
  51. import { onMounted, ref } from "vue";
  52. import { AnonymousLogin, tcb } from "../apis/cloudLogin";
  53. const db = tcb.database();
  54. const v = db.collection("huihenduo_versions");
  55. const __ = db.command;
  56. export default {
  57. setup() {
  58. let contactName = localStorage.contactName;
  59. function quit() {
  60. localStorage.clear();
  61. store.commit("changeLogin", false);
  62. router.push({ path: "/login" });
  63. }
  64. let vs = [
  65. {
  66. version: "1.2.13.0",
  67. timer: " 2022/2/9",
  68. remarks: [
  69. "优化船舶轨迹测算算法",
  70. "优化船舶预计到港时间测算算法",
  71. "优化航次状态预测算法",
  72. ],
  73. },
  74. {
  75. version: "1.2.14.0",
  76. timer: " 2022/2/11",
  77. remarks: ["更新保险保单上传接口", "更新装卸单据展示方式"],
  78. },
  79. {
  80. version: "1.3.0.0 ",
  81. timer: "2022/2/11",
  82. remarks: [
  83. "发布浙江物产货主版管理平台",
  84. "发布货损数据采集接口",
  85. "发布货损智能分析报告",
  86. ],
  87. },
  88. {
  89. version: "1.3.4.0 ",
  90. timer: "2022/2/28",
  91. remarks: [
  92. "发布汽车装货记录功能",
  93. "发布单据识别算法功能",
  94. "单据车牌数据、吨位数据拆分功能、生成表报",
  95. "智能化数据自动匹配、自动修正算法",
  96. ],
  97. },
  98. ];
  99. let timelineData = ref([]);
  100. // timelineData.value = vs.reverse();
  101. onMounted(() => {
  102. cloudLogin();
  103. });
  104. async function getAbledVersions() {
  105. let res = await v.where({ disabled: false, deleted: __.neq(true) }).get();
  106. timelineData.value = res.data.reverse();
  107. }
  108. async function cloudLogin() {
  109. await AnonymousLogin();
  110. getAbledVersions();
  111. }
  112. return {
  113. quit,
  114. contactName,
  115. timelineData,
  116. };
  117. },
  118. };
  119. </script>
  120. <style scoped>
  121. .header {
  122. width: 100%;
  123. height: 60px;
  124. background: #212029;
  125. display: flex;
  126. align-items: center;
  127. justify-content: space-between;
  128. }
  129. .left,
  130. .right {
  131. display: flex;
  132. align-items: center;
  133. }
  134. .first {
  135. width: 22px;
  136. height: 20px;
  137. margin: 0 22px;
  138. }
  139. .shu {
  140. width: 1px;
  141. height: 60px;
  142. background: #101015;
  143. margin-right: 22px;
  144. }
  145. .logo {
  146. width: 120px;
  147. height: 40px;
  148. margin-left: 20px;
  149. }
  150. .title {
  151. font-size: 21px;
  152. font-family: PingFangSC-Regular, PingFang SC;
  153. font-weight: 400;
  154. color: #ffffff;
  155. margin-left: 26px;
  156. }
  157. .user,
  158. .quit,
  159. .log {
  160. font-size: 14px;
  161. font-family: PingFangSC-Medium, PingFang SC;
  162. font-weight: 500;
  163. color: #ffffff;
  164. cursor: pointer;
  165. margin-right: 16px;
  166. }
  167. .log-card p {
  168. font-size: 10px;
  169. }
  170. .user-icon {
  171. width: 18px;
  172. height: 18px;
  173. margin-right: 16px;
  174. }
  175. .log {
  176. margin-right: 4px;
  177. }
  178. .quit {
  179. margin-left: 26px;
  180. }
  181. </style>