Header.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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 vs = [
  73. {
  74. version: "1.2.13.0",
  75. timer: " 2022/2/9",
  76. remarks: [
  77. "优化船舶轨迹测算算法",
  78. "优化船舶预计到港时间测算算法",
  79. "优化航次状态预测算法",
  80. ],
  81. },
  82. {
  83. version: "1.2.14.0",
  84. timer: " 2022/2/11",
  85. remarks: ["更新保险保单上传接口", "更新装卸单据展示方式"],
  86. },
  87. {
  88. version: "1.3.0.0 ",
  89. timer: "2022/2/11",
  90. remarks: [
  91. "发布浙江物产货主版管理平台",
  92. "发布货损数据采集接口",
  93. "发布货损智能分析报告",
  94. ],
  95. },
  96. {
  97. version: "1.3.4.0 ",
  98. timer: "2022/2/28",
  99. remarks: [
  100. "发布汽车装货记录功能",
  101. "发布单据识别算法功能",
  102. "单据车牌数据、吨位数据拆分功能、生成表报",
  103. "智能化数据自动匹配、自动修正算法",
  104. ],
  105. },
  106. ];
  107. let timelineData = ref([]);
  108. // timelineData.value = vs.reverse();
  109. onMounted(() => {
  110. cloudLogin();
  111. });
  112. async function getAbledVersions() {
  113. let res = await v.where({ disabled: false, deleted: __.neq(true) }).get();
  114. timelineData.value = res.data.reverse();
  115. }
  116. async function cloudLogin() {
  117. await AnonymousLogin();
  118. getAbledVersions();
  119. }
  120. return {
  121. quit,
  122. contactName,
  123. timelineData,
  124. };
  125. },
  126. };
  127. </script>
  128. <style scoped>
  129. .header {
  130. width: 100%;
  131. height: 60px;
  132. background: #212029;
  133. display: flex;
  134. align-items: center;
  135. justify-content: space-between;
  136. }
  137. .left,
  138. .right {
  139. display: flex;
  140. align-items: center;
  141. }
  142. .first {
  143. width: 22px;
  144. height: 20px;
  145. margin: 0 22px;
  146. }
  147. .shu {
  148. width: 1px;
  149. height: 60px;
  150. background: #101015;
  151. margin-right: 22px;
  152. }
  153. .logo {
  154. width: 120px;
  155. height: 40px;
  156. margin-left: 20px;
  157. }
  158. .title {
  159. font-size: 21px;
  160. font-family: PingFangSC-Regular, PingFang SC;
  161. font-weight: 400;
  162. color: #ffffff;
  163. margin-left: 26px;
  164. }
  165. .user,
  166. .quit,
  167. .log {
  168. font-size: 14px;
  169. font-family: PingFangSC-Medium, PingFang SC;
  170. font-weight: 500;
  171. color: #ffffff;
  172. cursor: pointer;
  173. margin-right: 16px;
  174. }
  175. .log-card p {
  176. font-size: 10px;
  177. }
  178. .user-icon {
  179. width: 18px;
  180. height: 18px;
  181. margin-right: 16px;
  182. }
  183. .log {
  184. margin-right: 4px;
  185. }
  186. .quit {
  187. margin-left: 26px;
  188. }
  189. </style>