BigMap.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <div class="big-map">
  3. <button
  4. class="close"
  5. @click="$router.go(-1)"
  6. >
  7. <img
  8. class=""
  9. src="@/assets/images/close.png"
  10. alt=""
  11. draggable="false"
  12. >
  13. </button>
  14. <div class="map-wrapper">
  15. <img
  16. src="@/assets/images/map.png"
  17. alt=""
  18. class="map"
  19. draggable="false"
  20. >
  21. <div
  22. v-for="(item) in areaListForMap"
  23. :key="item.id"
  24. class="area"
  25. :style="{
  26. ...{
  27. top: item.top + 'vw',
  28. left: item.left + 'vw',
  29. width: item.width + 'vw',
  30. height: item.height + 'vw',
  31. },
  32. ...item.style
  33. }"
  34. @click="onClickRegion(item)"
  35. v-html="item.nameCn"
  36. />
  37. </div>
  38. <div class="button-wrapper">
  39. <button
  40. v-for="(item) in areaListForBtn"
  41. :key="item.id"
  42. @click="onClickRegion(item)"
  43. >
  44. {{ item.nameCn }}
  45. </button>
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import areaPosInfo from "@/areaPosInfo.js"
  51. export default {
  52. data() {
  53. return {
  54. areaListForMap: [
  55. { id: '1', nameCn: '速霸CX 104-8+LYYL', nameEn: 'Speedmaster CX 104-8+LYYL', left: 20.3, top: 6.3, width: 49.4, height: 13, reportType: 'speedMasterCx', },
  56. { id: '2', nameCn: '速霸XL 75-7+L ', nameEn: 'Speed&hyphen;<br>master XL 75-7+L ', left: 5.5, top: 22.5, width: 12.4, height: 34.8, reportType: 'speedMasterXl', },
  57. { id: '3', nameCn: '速霸SX102-4-P', nameEn: 'Speed&hyphen;<br>master SX 102-4-P', left: 70.7, top: 6.3, width: 10.5, height: 29.7, reportType: 'speedMasterSx', },
  58. { id: '4', nameCn: '数字工厂', nameEn: 'Digital<br>Factory', left: 48.6, top: 23.6, width: 13.6, height: 16.6, style: { justifyContent: 'flex-start', alignItems: 'flex-start', paddingTop: '1vw', paddingLeft: '2vw', }, reportType: 'digitalFactory', },
  59. { id: '5', nameCn: '印通工作流程中心', nameEn: 'Prinect Center', left: 40.9, top: 43.4, width: 9.4, height: 4.9, reportType: 'prinectCenter', },
  60. { id: '6', nameCn: '波拉自动裁切系统300 ', nameEn: 'Polar <br> Cutting <br> System 300 ', left: 5.5, top: 6.3, width: 12.4, height: 13, reportType: 'polarCuttingSystem', },
  61. { id: '7', nameCn: '斯塔尔折页机KH 82-P', nameEn: 'Stahlfolder KH 82-P', left: 21.3, top: 40.1, width: 11.6, height: 11.6, reportType: 'stahlfolderKh', },
  62. { id: '8', nameCn: 'Versa&hyphen;<br>fire EP', nameEn: 'Versa&hyphen;<br>fire EP', left: 35.6, top: 49.2, width: 6.2, height: 12.3, reportType: 'versafireEp', },
  63. { id: '9', nameCn: 'Versa&hyphen;<br>fire EV', nameEn: 'Versa&hyphen;<br>fire EV', left: 42.7, top: 49.2, width: 6.2, height: 12.3, reportType: 'versafireEv', },
  64. { id: '10', nameCn: '超霸106计算机直接制版机', nameEn: 'Supra&hyphen;<br>setter<br> 106', left: 51.8, top: 51.2, width: 11.2, height: 11.2, reportType: 'suprasetter', },
  65. { id: '11', nameCn: '海德堡效能管家', nameEn: 'Lifecycle', left: 29, top: 31.5, width: 13.3, height: 8, reportType: 'lifecycle', },
  66. { id: '12', nameCn: '培训', nameEn: 'Training', left: 52.8, top: 42.5, width: 10.5, height: 3.6, reportType: 'training', },
  67. { id: '13', nameCn: '咨询', nameEn: 'Consultancy', left: 51.6, top: 46.8, width: 13, height: 3.6, reportType: 'consultancy', },
  68. { id: '14', nameCn: '捷拉斯', nameEn: 'Gallus', left: 64.5, top: 29.3, width: 5.5, height: 9.2, reportType: 'gallus', },
  69. { id: '15', nameCn: '海德堡金融服务', nameEn: 'Financial Service', left: 57, top: 29.3, width: 6.9, height: 9.2, reportType: 'financialService', },
  70. { id: '16', nameCn: '直播间', nameEn: 'Live&hyphen;<br>streaming Room', left: 55.4, top: 66.5, width: 9.8, height: 12.2, reportType: 'livestreamingRoom', },
  71. ],
  72. areaListForBtn: [
  73. { id: '1', nameCn: '速霸CX 104-8+LYYL', nameEn: 'Speedmaster CX 104-8+LYYL', reportType: 'speedMasterCx', },
  74. { id: '2', nameCn: '速霸XL 75-7+L ', nameEn: 'Speedmaster XL 75-7+L ', reportType: 'speedMasterXl', },
  75. { id: '3', nameCn: '速霸SX 102-4-P', nameEn: 'Speedmaster SX 102-4-P', reportType: 'speedMasterSx', },
  76. { id: '4', nameCn: '数字工厂', nameEn: 'Digital Factory', reportType: 'digitalFactory', },
  77. { id: '5', nameCn: '印通工作流程中心', nameEn: 'Prinect Center', reportType: 'prinectCenter', },
  78. { id: '6', nameCn: '波拉自动裁切系统300 ', nameEn: 'Polar Cutting System 300 ', reportType: 'polarCuttingSystem', },
  79. { id: '7', nameCn: '斯塔尔折页机KH 82-P', nameEn: 'Stahlfolder KH 82-P', reportType: 'stahlfolderKh', },
  80. { id: '8', nameCn: 'Versafire EP', nameEn: 'Versafire EP', reportType: 'versafireEp', },
  81. { id: '9', nameCn: 'Versafire EV', nameEn: 'Versafire EV', reportType: 'versafireEv', },
  82. { id: '10', nameCn: '超霸106计算机直接制版机', nameEn: 'Suprasetter 106', reportType: 'suprasetter', },
  83. { id: '11', nameCn: '海德堡效能管家', nameEn: 'Lifecycle', reportType: 'lifecycle', },
  84. { id: '12', nameCn: '培训', nameEn: 'Training', reportType: 'training', },
  85. { id: '13', nameCn: '咨询', nameEn: 'Consultancy', reportType: 'consultancy', },
  86. { id: '14', nameCn: '捷拉斯', nameEn: 'Gallus', reportType: 'gallus', },
  87. { id: '15', nameCn: '海德堡金融服务', nameEn: 'Financial Service', reportType: 'financialService', },
  88. { id: '16', nameCn: '直播间', nameEn: 'Livestreaming Room', reportType: 'livestreamingRoom', },
  89. ],
  90. isFlying: false,
  91. checkingIntervalId: null,
  92. }
  93. },
  94. beforeDestroy() {
  95. clearInterval(this.checkingIntervalId)
  96. },
  97. methods: {
  98. onClickRegion(regionItem) {
  99. if (this.isFlying) {
  100. return
  101. }
  102. this.$router.go(-1)
  103. this.isFlying = true
  104. globalApi.reportRegionClick(regionItem.reportType)
  105. const posInfo = areaPosInfo[Number(regionItem.id) - 1]
  106. // 判断移动到点位结束之后,才允许再次点击
  107. this.checkingIntervalId = window.setInterval(() => {
  108. if (window.player.currentPano.id === posInfo.id) {
  109. this.isFlying = false
  110. clearInterval(this.checkingIntervalId)
  111. }
  112. }, 300)
  113. console.assert(posInfo, '没有找到点击的区域所对应的点位数据')
  114. window.player.flyToPano({
  115. // 移动到点位
  116. pano: window.player.model.panos.index[posInfo.id],
  117. // 移动视角
  118. quaternion: new window.THREE.Quaternion(
  119. posInfo.x,
  120. posInfo.y,
  121. posInfo.z,
  122. posInfo.w
  123. ),
  124. })
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang="less" scoped>
  130. .big-map {
  131. position: fixed;
  132. background-color: rgba(21, 52, 115, 0.80);
  133. backdrop-filter: blur(1.8vw);
  134. z-index: 10005;
  135. top: 0;
  136. left: 0;
  137. height: 100%;
  138. width: 100%;
  139. > button.close {
  140. position: absolute;
  141. top: 4.4vw;
  142. right: 4.4vw;
  143. width: 9vw;
  144. height: 9vw;
  145. z-index: 10001;
  146. > img {
  147. position: absolute;
  148. left: 0;
  149. top: 0;
  150. width: 100%;
  151. height: 100%;
  152. }
  153. }
  154. > .map-wrapper {
  155. position: absolute;
  156. top: 16vw;
  157. left: 5.5vw;
  158. right: 5.5vw;
  159. height: 89.2vw;
  160. > img {
  161. position: absolute;
  162. left: 0;
  163. top: 0;
  164. width: 100%;
  165. height: 100%;
  166. }
  167. > .area {
  168. background: rgba(255,255,255,0.6);
  169. box-shadow: 0px 3px 3px 0px rgba(0,0,0,0.2);
  170. font-size: 1.8vw;
  171. color: #1F3E7C;
  172. display: flex;
  173. justify-content: center;
  174. align-items: center;
  175. position: absolute;
  176. text-align: center;
  177. hyphens: auto;
  178. }
  179. }
  180. > .button-wrapper {
  181. position: absolute;
  182. top: calc(16vw + 89.2vw + 4vw);
  183. bottom: 0;
  184. left: 4.2vw;
  185. right: 1vw;
  186. overflow: auto;
  187. > button {
  188. margin-right: 1.9vw;
  189. margin-bottom: 4.4vw;
  190. width: 45vw;
  191. height: 8vw;
  192. border-radius: 4vw;
  193. border: 1px solid #FFFFFF;
  194. background: transparent;
  195. font-size: 3.2vw;
  196. font-weight: bold;
  197. color: #FFFFFF;
  198. }
  199. }
  200. }
  201. </style>