Indoor.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <script lang="ts" setup>
  2. import { computed, ref, watch } from "vue";
  3. import { useStrategy } from "@/hooks";
  4. import Fun from "@/components/fun.vue";
  5. const props = defineProps({
  6. modelValue: {
  7. type: Boolean,
  8. default: false,
  9. },
  10. });
  11. const { getConditioner } = useStrategy();
  12. const emits = defineEmits(["update:modelValue"]);
  13. watch(
  14. () => props.modelValue,
  15. (val: boolean) => {
  16. if (val) {
  17. open();
  18. } else {
  19. if (show.value) {
  20. close();
  21. }
  22. }
  23. }
  24. );
  25. const speed = computed(() => {
  26. return getConditioner.value.fs ? 5 / getConditioner.value.fs : 0;
  27. });
  28. const show = ref<boolean>(false);
  29. const open = () => {
  30. show.value = true;
  31. };
  32. const close = () => {
  33. show.value = false;
  34. emits("update:modelValue", false);
  35. };
  36. </script>
  37. <template>
  38. <div
  39. v-bind="$attrs"
  40. class="popover fixed top-0 w-full h-full z-[999] pointer-events-auto"
  41. name="popover"
  42. v-if="show"
  43. @click="close"
  44. >
  45. <div
  46. class="relative left-[50%] top-[120px] translate-x-[-50%] w-[1523px] h-[761px] bg-[url('assets/images/indoor.jpg')] border-2 border-cyan-300 bg-sky-900/80"
  47. @click.stop=""
  48. >
  49. <Fun
  50. class="absolute top-[210px] right-[640px]"
  51. :speed="speed"
  52. :info="`
  53. <div>空调温度:${getConditioner.wd}℃</div>
  54. <div>空调风速:${getConditioner.fs}M/s</div>`"
  55. ></Fun>
  56. <Fun
  57. class="absolute top-[210px] right-[230px]"
  58. :speed="speed"
  59. :info="`
  60. <div>空调温度:${getConditioner.wd}℃</div>
  61. <div>空调风速:${getConditioner.fs}M/s</div>`"
  62. ></Fun>
  63. <Fun
  64. class="absolute bottom-[150px] right-[640px]"
  65. :speed="speed"
  66. :info="`
  67. <div>空调温度:${getConditioner.wd}℃</div>
  68. <div>空调风速:${getConditioner.fs}M/s</div>`"
  69. ></Fun>
  70. <Fun
  71. class="absolute bottom-[150px] right-[170px]"
  72. :speed="speed"
  73. :info="`
  74. <div>空调温度:${getConditioner.wd}℃</div>
  75. <div>空调风速:${getConditioner.fs}M/s</div>`"
  76. ></Fun>
  77. <!-- <div class="smallcircle1">
  78. <div class="tag">
  79. <div>空调温度:{{ getConditioner.wd }}℃</div>
  80. <div>空调风速:{{ getConditioner.fs }}M/s</div>
  81. </div>
  82. </div> -->
  83. <!-- <div class="smallcircle2"></div>
  84. <div class="smallcircle3"></div>
  85. <div class="smallcircle4"></div>
  86. <div class="smallcircle5"></div> -->
  87. </div>
  88. </div>
  89. </template>
  90. <style scoped>
  91. @keyframes scale {
  92. 0% {
  93. transform: scale(1);
  94. }
  95. 50%,
  96. 75% {
  97. transform: scale(3);
  98. }
  99. 78%,
  100. 100% {
  101. opacity: 0;
  102. }
  103. }
  104. .smallcircle1 {
  105. position: absolute;
  106. width: 18px;
  107. height: 18px;
  108. background-color: #ffffff;
  109. border-radius: 50%;
  110. top: 230px;
  111. left: 250px;
  112. }
  113. .tag {
  114. position: absolute;
  115. transform-origin: top left;
  116. top: 20px;
  117. }
  118. .tag > div {
  119. white-space: nowrap;
  120. }
  121. .smallcircle2 {
  122. position: absolute;
  123. width: 18px;
  124. height: 18px;
  125. background-color: #ffffff;
  126. border-radius: 50%;
  127. top: 230px;
  128. left: 350px;
  129. }
  130. .smallcircle3 {
  131. position: absolute;
  132. width: 18px;
  133. height: 18px;
  134. background-color: #ffffff;
  135. border-radius: 50%;
  136. top: 230px;
  137. left: 450px;
  138. }
  139. .smallcircle4 {
  140. position: absolute;
  141. width: 18px;
  142. height: 18px;
  143. background-color: #ffffff;
  144. border-radius: 50%;
  145. top: 230px;
  146. left: 550px;
  147. }
  148. .smallcircle5 {
  149. position: absolute;
  150. width: 18px;
  151. height: 18px;
  152. background-color: #ffffff;
  153. border-radius: 50%;
  154. top: 230px;
  155. left: 650px;
  156. }
  157. .smallcircle1:before {
  158. content: "";
  159. display: block;
  160. width: 18px;
  161. height: 18px;
  162. opacity: 0.2;
  163. border-radius: 50%;
  164. background-color: #ffffff;
  165. animation: scale 1s infinite cubic-bezier(0, 0, 0.49, 1.02);
  166. }
  167. .smallcircle2:before {
  168. content: "";
  169. display: block;
  170. width: 18px;
  171. height: 18px;
  172. opacity: 0.2;
  173. border-radius: 50%;
  174. background-color: #ffffff;
  175. animation: scale 1s infinite cubic-bezier(0, 0, 0.49, 1.02);
  176. }
  177. .smallcircle3:before {
  178. content: "";
  179. display: block;
  180. width: 18px;
  181. height: 18px;
  182. opacity: 0.2;
  183. border-radius: 50%;
  184. background-color: #ffffff;
  185. animation: scale 1s infinite cubic-bezier(0, 0, 0.49, 1.02);
  186. }
  187. .smallcircle4:before {
  188. content: "";
  189. display: block;
  190. width: 18px;
  191. height: 18px;
  192. opacity: 0.2;
  193. border-radius: 50%;
  194. background-color: #ffffff;
  195. animation: scale 1s infinite cubic-bezier(0, 0, 0.49, 1.02);
  196. }
  197. .smallcircle5:before {
  198. content: "";
  199. display: block;
  200. width: 18px;
  201. height: 18px;
  202. opacity: 0.2;
  203. border-radius: 50%;
  204. background-color: #ffffff;
  205. animation: scale 1s infinite cubic-bezier(0, 0, 0.49, 1.02);
  206. }
  207. </style>