pageHead.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <div class="horHead horSty">
  3. <div class="horHead-content">
  4. <div>
  5. <div class="firtitle">{{ projectObj.localName }}</div>
  6. <div class="sectitle">懂空间,更懂办公</div>
  7. </div>
  8. <!-- <img :src="title" v-else /> -->
  9. </div>
  10. <div class="horHead-left">
  11. <img
  12. :src="logo"
  13. alt=""
  14. style="height: 48px"
  15. />
  16. </div>
  17. <div class="horHead-right">
  18. <div class="right-item">
  19. <span class="item-time">{{ nowStr }}</span>
  20. </div>
  21. <div class="right-item">{{ weatherCont.text }}</div>
  22. <div
  23. class="right-item"
  24. @click="changeScreen"
  25. >
  26. <img
  27. class="firstImg"
  28. alt=""
  29. :src="nowScreen == 'vertical' ? changeHor : changeVer"
  30. />
  31. </div>
  32. <div
  33. class="right-item"
  34. style="display: none"
  35. >退出</div>
  36. </div>
  37. </div>
  38. </template>
  39. <script lang="ts">
  40. import { ref, defineComponent, reactive, toRefs, onMounted } from "vue";
  41. import { useRoute, useRouter } from "vue-router";
  42. import moment from "moment";
  43. import { storeToRefs } from "pinia";
  44. import useProjectStore from "@/store/useProjectStore";
  45. import { dapingImage } from "@/utils/dapingImage";
  46. import { setRem } from "@/utils/rem";
  47. export default defineComponent({
  48. props: {
  49. navigateItem: {
  50. type: String,
  51. },
  52. },
  53. setup(props, contx) {
  54. const { persagyLogo, zhijiangLogo, changeHor, changeVer } = dapingImage;
  55. const route: any = useRoute();
  56. const router = useRouter();
  57. const projectStore = useProjectStore();
  58. const { weatherCont, projectObj, projectId } = storeToRefs(
  59. projectStore
  60. );
  61. const allData = reactive({
  62. // logo: new URL(
  63. // "../assets/image/horImg/zhijianglogo.png",
  64. // import.meta.url
  65. // ).href,
  66. logo: projectId == "Pj3301100002" ? zhijiangLogo : persagyLogo,
  67. changeHor: changeHor,
  68. changeVer: changeVer,
  69. nowScreen:
  70. route.path.indexOf("horiScreen") > -1
  71. ? "horizontal"
  72. : "vertical",
  73. nowStr: moment().format("YYYY.MM.DD HH:mm"),
  74. setNowInterval() {
  75. setInterval(() => {
  76. var nowTimeStr2 = moment().format("YYYY.MM.DD HH:mm");
  77. allData.nowStr = nowTimeStr2;
  78. }, 30000);
  79. },
  80. changeScreen() {
  81. if (allData.nowScreen == "vertical") {
  82. allData.nowScreen = "horizontal";
  83. //setRem("horizontal");
  84. router.push({ path: "/horiScreen" });
  85. } else {
  86. allData.nowScreen = "vertical";
  87. //setRem("vertical");
  88. router.push({ path: "/verScreen" });
  89. }
  90. },
  91. });
  92. onMounted(() => {
  93. allData.setNowInterval();
  94. });
  95. return { ...toRefs(allData), weatherCont, projectObj };
  96. },
  97. });
  98. </script>
  99. <style scoped lang="scss">
  100. .horHead {
  101. // display: flex;
  102. // justify-content: space-between;
  103. // align-items: center;
  104. position: relative;
  105. &.horSty {
  106. height: 74px;
  107. }
  108. .horHead-content {
  109. width: 100%;
  110. height: 100%;
  111. color: #efdec6;
  112. text-align: center;
  113. .firtitle {
  114. font-weight: 700;
  115. font-size: 38px;
  116. font-family: Alibaba PuHuiTi;
  117. }
  118. .sectitle {
  119. font-weight: 500;
  120. font-size: 16px;
  121. letter-spacing: 8px;
  122. }
  123. }
  124. .horHead-left {
  125. position: absolute;
  126. top: 0;
  127. left: 0;
  128. font-size: 0;
  129. }
  130. .horHead-right {
  131. position: absolute;
  132. top: 0;
  133. right: 0;
  134. display: flex;
  135. // justify-content: space-between;
  136. height: 46px;
  137. // width: 396px;
  138. .right-item {
  139. display: flex;
  140. justify-content: center;
  141. align-items: center;
  142. cursor: pointer;
  143. // padding: 12px 16px;
  144. font-size: 20px;
  145. color: #efdec6;
  146. font-weight: 400;
  147. line-height: 22px;
  148. margin-left: 18px;
  149. // background: #ffffff99;
  150. // border: 2px solid #ffffffcc;
  151. box-sizing: border-box;
  152. // border-radius: 8px;
  153. .firstImg {
  154. margin-right: 6px;
  155. width: 28px;
  156. }
  157. .item-time {
  158. font-family: Persagy;
  159. font-weight: 400;
  160. }
  161. }
  162. }
  163. }
  164. </style>