index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <script lang="ts" setup>
  2. import VScaleScreen from "v-scale-screen";
  3. import Footer from "./footer.vue";
  4. import Popover from "@/components/Popover.vue";
  5. import { useCurrentTime } from "@/hooks";
  6. // import { getImg } from "@/utils";
  7. import { getList } from "@/api/strategy";
  8. import { ref } from "vue";
  9. import { useStrategy } from "@/hooks";
  10. // import { getImg } from "@/utils";
  11. const { currentTime, week, nowTime } = useCurrentTime();
  12. type strategy = {
  13. name: string;
  14. id: number;
  15. };
  16. const list = ref<strategy[]>([]);
  17. const show = ref<boolean>(false);
  18. const { setState, setFromState } = useStrategy();
  19. //strategyId
  20. function getData() {
  21. getList().then(({ data }: any) => {
  22. list.value = data;
  23. setState(data);
  24. });
  25. }
  26. const popoverRef = ref<any>(null);
  27. const open = () => {
  28. show.value = !show.value;
  29. show.value && getData();
  30. };
  31. const confirm = (data: any) => {
  32. console.log(data);
  33. setFromState(data);
  34. };
  35. const windowOpen = () => {
  36. window.open("http://172.192.13.78:9087");
  37. };
  38. </script>
  39. <template>
  40. <v-scale-screen
  41. width="1920"
  42. height="1080"
  43. :boxStyle="{ backgroundColor: 'transparent' }"
  44. >
  45. <div class="w-full h-full relative pointer-events-none">
  46. <div
  47. class="pointer-events-auto absolute right-[440px] top-[80px] z-50 flex flex-col items-center"
  48. >
  49. <div class="mb-2">
  50. <button
  51. @click="windowOpen"
  52. class="mb-2 flex items-center justify-center w-[118px] h-[37px] bg-[url('assets/images/layout/strategy/button.png')] pt-1"
  53. >
  54. 后台
  55. </button>
  56. <button
  57. class="flex items-center justify-center w-[118px] h-[37px] bg-[url('assets/images/layout/strategy/button.png')] pt-1"
  58. @click="open"
  59. >
  60. 策略管理
  61. </button>
  62. </div>
  63. <Popover v-model="show" @confirm="confirm" ref="popoverRef"></Popover>
  64. <!-- <div
  65. class="w-[96px] h-[320px] bg-[url('assets/images/layout/strategy/listBg.png')] space-y-2 text-center pt-3"
  66. v-show="show"
  67. > -->
  68. <!-- <button
  69. class="w-[87px] h-[25px] text-slate-300 hover:bg-[url('assets/images/layout/strategy/item_.png')_!important] bg-no-repeat hover:text-white"
  70. :style="{
  71. backgroundImage:
  72. ListIndex == item.id
  73. ? `url(${getImg('layout/strategy/item_.png')})`
  74. : `url(${getImg('layout/strategy/item.png')})`,
  75. color: ListIndex == item.id ? '#fff' : '#CBD5E1',
  76. }"
  77. v-for="(item, index) in list"
  78. name="popover"
  79. :key="index"
  80. @click="handleClick(item)"
  81. >
  82. {{ item.name }}
  83. </button> -->
  84. <!-- </div> -->
  85. </div>
  86. <div
  87. class="w-full z-40 absolute top-0 text-center h-[230px] leading-[90px] bg-[url('assets/images/layout/head.png')] bg-center bg-no-repeat"
  88. >
  89. <span
  90. class="text-4xl font-bold tracking-widest bg-gradient-to-b from-white from-30% via-[rabg(105, 193, 254,0.5)] via-50% to-[#75bfe9] to-100% bg-clip-text text-transparent before:absolute before:content-['智慧能源管理平台'] before:-z-[1] before:[text-shadow:0px_4px_4px_#333333]"
  91. >
  92. 智慧能源管理平台
  93. </span>
  94. </div>
  95. <div
  96. class="absolute z-50 top-0 left-0 w-[403px] h-[1081px] bg-[url('assets/images/layout/left.png')] bg-no-repeat pl-7 pr-6 pt-4 pb-20 pointer-events-auto"
  97. >
  98. <div class="h-[10%] space-y-2 text-sm">
  99. <div
  100. class="flex items-center pl-4 w-[234px] h-[38px] bg-[url('assets/images/layout/left_top.png')] bg-no-repeat"
  101. >
  102. <span class="text-[#A1CDD3]">辐照度:</span
  103. ><span
  104. ><span class="text-[#07E3F9] text-xl font-bold">789.04</span
  105. ><span class="text-[#85A2AA]">w/㎡</span></span
  106. >
  107. </div>
  108. <div
  109. class="flex items-center pl-4 ml-2 w-[326px] h-[39px] bg-[url('assets/images/layout/left_top2.png')] bg-no-repeat space-x-4"
  110. >
  111. <span>4°C~20°C</span><span>晴天</span
  112. ><span
  113. ><span class="text-[#9AB2D1]">空气质量:</span
  114. ><span>优</span></span
  115. >
  116. </div>
  117. </div>
  118. <router-view class="h-[90%]" name="LeftSidebar"></router-view>
  119. </div>
  120. <router-view class="w-full h-full pointer-events-auto"></router-view>
  121. <div
  122. class="absolute z-40 top-0 right-0 w-[403px] h-[1081px] bg-[url('assets/images/layout/right.png')] bg-no-repeat pl-6 pr-7 pt-4 pb-20 pointer-events-auto"
  123. >
  124. <div
  125. class="h-[10%] space-y-2 flex items-end flex-col text-left text-sm"
  126. >
  127. <div
  128. class="flex items-center w-[234px] h-[38px] bg-[url('assets/images/layout/right_top.png')] bg-no-repeat pl-16 whitespace-pre"
  129. >
  130. 风力:<span class="text-[#07E3F9] text-xl font-bold">10</span> 级
  131. </div>
  132. <div
  133. class="flex items-center mr-2 w-[328px] h-[38px] bg-[url('assets/images/layout/right_top2.png')] bg-no-repeat pl-16 text-[#9AB2D1]"
  134. >
  135. DATE:<span class="space-x-2">
  136. <span>{{ nowTime }}</span>
  137. <span>{{ week }}</span>
  138. <span>{{ currentTime }}</span>
  139. </span>
  140. </div>
  141. </div>
  142. <router-view class="h-[90%]" name="RightSidebar"></router-view>
  143. </div>
  144. <div
  145. class="flex items-end justify-center w-full absolute bottom-0 pointer-events-none h-[230px] bg-[url('assets/images/layout/footer.png')] bg-center bg-no-repeat"
  146. >
  147. <Footer></Footer>
  148. </div>
  149. </div>
  150. </v-scale-screen>
  151. </template>