sbyxjc.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <script setup>
  2. import {
  3. inject
  4. } from "vue";
  5. const getMapInstance = inject("getMapInstance");
  6. jt3d = getMapInstance();
  7. </script>
  8. <template>
  9. <div id="main5">
  10. <div class="chushuikou">
  11. <div class="chushuikou1">
  12. <div class="chushuikou1-1">
  13. <label>区域</label>
  14. <label>水泵电流</label>
  15. <label>机井压力</label>
  16. <label>实时流量</label>
  17. <label>运行状态</label>
  18. </div>
  19. </div>
  20. <div class="chushuikou2">
  21. <div class="chushuikou2-1">
  22. <label>1号机井</label>
  23. <label style="color:'#ecec66';">200A</label>
  24. <label>150kpa</label>
  25. <label>80m³/h</label>
  26. <button @click="flyto(1)" class="bluebutton">正常</button>
  27. </div>
  28. </div>
  29. <div class="chushuikou3">
  30. <div class="chushuikou2-1">
  31. <label>2号机井</label>
  32. <label style="color:'#ecec66';">10A</label>
  33. <label>100kpa</label>
  34. <label>10m³/h</label>
  35. <button @click="flyto(2)" class="redbutton">异常</button>
  36. </div>
  37. </div>
  38. <div class="chushuikou4">
  39. <div class="chushuikou2-1">
  40. <label>3号机井</label>
  41. <label style="color:'#ecec66';">200A</label>
  42. <label>150kpa</label>
  43. <label>80m³/h</label>
  44. <button @click="flyto(3)" class="bluebutton">正常</button>
  45. </div>
  46. </div>
  47. <div class="chushuikou5">
  48. <div class="chushuikou2-1">
  49. <label>4号机井</label>
  50. <label style="color:'#ecec66';">200A</label>
  51. <label>150kpa</label>
  52. <label>80m³/h</label>
  53. <button @click="flyto(4)" class="bluebutton">正常</button>
  54. </div>
  55. </div>
  56. <div class="chushuikou4">
  57. <div class="chushuikou2-1">
  58. <label>5号机井</label>
  59. <label style="color:'#ecec66';">200A</label>
  60. <label>150kpa</label>
  61. <label>80m³/h</label>
  62. <button @click="flyto(5)" class="bluebutton">正常</button>
  63. </div>
  64. </div>
  65. <div class="chushuikou5">
  66. <div class="chushuikou2-1">
  67. <label>6号机井</label>
  68. <label style="color:'#ecec66';">200A</label>
  69. <label>150kpa</label>
  70. <label>80m³/h</label>
  71. <button @click="flyto(6)" class="bluebutton">正常</button>
  72. </div>
  73. </div>
  74. <div class="chushuikou4">
  75. <div class="chushuikou2-1">
  76. <label>7号机井</label>
  77. <label style="color:'#ecec66';">200A</label>
  78. <label>150kpa</label>
  79. <label>80m³/h</label>
  80. <button @click="flyto(7)" class="bluebutton">正常</button>
  81. </div>
  82. </div>
  83. <div class="chushuikou5">
  84. <div class="chushuikou2-1">
  85. <label>8号机井</label>
  86. <label style="color:'#ecec66';">20A</label>
  87. <label>10kpa</label>
  88. <label>10m³/h</label>
  89. <button @click="flyto(8)" class="redbutton">异常</button>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </template>
  95. <script>
  96. let jt3d = undefined;
  97. import map_xzqh_zj from '@/assets/dataFile/map_xzqh_zj.json';
  98. import {
  99. Store
  100. } from '@/store/index'
  101. let store = Store();
  102. export default {
  103. data() {
  104. return {
  105. entity1: '',
  106. }
  107. },
  108. methods: {
  109. flyto(num) {
  110. let that = this
  111. let PointObject = new this.jt3dSDK.PointObject(window.viewer);
  112. var LocateUtil = new this.jt3dSDK.LocateUtil(window["viewer"]);
  113. let Drawtools = new this.jt3dSDK.DrawTools(window.viewer)
  114. //_createCircle
  115. PointObject.addBillboard([117.47349486,36.33949225, 0], {
  116. billboard: {
  117. imgUrl: 'jt3dSDK/imgs/jijing1.png',
  118. scale: 0.2,
  119. }
  120. }).then(res1 => {
  121. var LocateUtil = new this.jt3dSDK.LocateUtil(window["viewer"]);
  122. LocateUtil.flyToEntity(res1).then(res2 => {
  123. let html = "";
  124. html +=
  125. "<div style='text-align: left;backfround-color:rgba(61, 198, 205, 0.6);width:300rem;height:150rem;font-family: TTTGB-Medium, sans-serif !important;'>";
  126. html +=
  127. "<div style='background-color: rgba(61, 198, 255, 0.4);line-height:30rem;height:30rem;margin:0;'>" +
  128. "<span style='width:100rem'>设备名称:</span>" + "<span>机井</span>" +
  129. "</div>";
  130. html +=
  131. "<div style='background-color: rgba(0, 37, 98, 0.4);line-height:30rem;height:30rem;margin:0'>" +
  132. "<span style='width:100rem'>设备编号:</span>" + "<span>05</span>" +
  133. "</div>";
  134. html +=
  135. "<div style='background-color: rgba(61, 198, 255, 0.4);line-height:30rem;height:30rem;margin:0'>" +
  136. "<span style='width:100rem'>电流:</span>" + "<span>10A</span>" +
  137. "</div>";
  138. html +=
  139. "<div style='background-color: rgba(0, 37, 98, 0.4);line-height:30rem;height:30rem;margin:0'>" +
  140. "<span style='width:100rem'>压力:</span>" + "<span>20Kpa</span>" +
  141. "</div>";
  142. html +=
  143. "<div style='background-color: rgba(61, 198, 255, 0.4);line-height:30rem;height:30rem;margin:0'>" +
  144. "<span style='width:100rem'>流量:</span>" + "<span>80m³/h</span>" +
  145. "</div>";
  146. html += "</div>";
  147. let popup = new that.jt3dSDK.PopupWindow.HtmlWindow(window["viewer"], [117.47349486,36.33949225], "设备信息", html, 50);
  148. let circleObject = new this.jt3dSDK.CircleObject(jt3d._viewer);
  149. circleObject.drawCircle([117.47349486,36.33949225], 50, {
  150. // color: [255, 255, 0, 0.8]
  151. color: [255, 0, 0, 1],
  152. outline: true,
  153. outlineColor: [255, 255, 255, 1],
  154. outlineWidth: 20,
  155. CircleType: 'DynamicCircle',
  156. count: 2,
  157. duration: 4000
  158. })
  159. })
  160. })
  161. //====实现
  162. /* let PointObject = new this.jt3dSDK.PointObject(window.viewer);
  163. var LocateUtil = new this.jt3dSDK.LocateUtil(window["viewer"]);
  164. PointObject.addPoint([120.623, 36.9157, 1800]).then(res1 => {
  165. console.log('res',res1)
  166. LocateUtil.flyToEntity(res1).then(res2 => {
  167. console.log('定位成功', res2)
  168. })
  169. }) */
  170. },
  171. //创建动态圆
  172. createCircle() {
  173. //定义中心和半径
  174. // let entity = jt3d._viewer.entities.add({
  175. // position: Cesium.Cartesian3.fromDegrees(120.623, 36.9157),
  176. // name: 'Dynamic Circle',
  177. // description: 'A dynamic circle.',
  178. // });
  179. // // // 添加动态圆形
  180. // // 添加静态圆形
  181. // var radius = 100;
  182. // var vertexFormat = Cesium.VertexFormat.POSITION_ONLY;
  183. // var circleGeometry = new Cesium.CircleGeometry({
  184. // center: entity.position.getValue(), // 圆心位置
  185. // radius: radius,
  186. // vertexFormat: vertexFormat
  187. // });
  188. // var geometry = Cesium.CircleGeometry.createGeometry(circleGeometry);
  189. // entity.polygon = new Cesium.PolygonGraphics();
  190. // entity.polygon.hierarchy = new Cesium.PolygonHierarchy(geometry);
  191. // entity.polygon.material = Cesium.Material.fromType(Cesium.Material.ColorType);
  192. // entity.polygon.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 0.5);
  193. }
  194. },
  195. mounted() {
  196. // jt3d.PolylineObject.drawPolylineByGeoJson(map_xzqh_zj, {
  197. // width: 5,
  198. // color: '#04FFFF',
  199. // isImageAlpha: true, //用图片自带颜色
  200. // duration: 3000,
  201. // imgUrl: "/jt3dSDK/imgs/polylinematerial/spriteline1.png"
  202. // });
  203. }
  204. }
  205. </script>
  206. <style lang="scss" scoped>
  207. .redbutton {
  208. background-color: rgb(238, 80, 80);
  209. width: 50rem;
  210. height: 20rem;
  211. color: #fff;
  212. font-size: 14rem;
  213. border: 0;
  214. font-weight: 500;
  215. margin-top: -4rem
  216. }
  217. .bluebutton {
  218. background-color: rgb(40, 170, 230);
  219. width: 50rem;
  220. height: 20rem;
  221. color: #fff;
  222. font-size: 14rem;
  223. border: 0;
  224. font-weight: 500;
  225. margin-top: -4rem
  226. }
  227. #main5 {
  228. width: calc(100% - 20rem);
  229. height: calc(100% - 20rem);
  230. margin: 10rem;
  231. .chushuikou {
  232. width: 100%;
  233. height: 175rem;
  234. margin-top: 10rem;
  235. // margin-left: 5rem;
  236. }
  237. .chushuikou1 {
  238. width: 100%;
  239. height: 35rem;
  240. background-color: rgba(61, 198, 255, 0.4);
  241. display: flex;
  242. align-items: center;
  243. }
  244. .chushuikou1-1 {
  245. font-family: SimHei;
  246. font-size: 14rem;
  247. color: #C8daf5;
  248. width: 100%;
  249. height: 13rem;
  250. display: flex;
  251. justify-content: space-around;
  252. margin: auto;
  253. }
  254. .chushuikou2-1 {
  255. font-family: SimHei;
  256. font-size: 13rem;
  257. color: #C8daf5;
  258. width: 100%;
  259. height: 13rem;
  260. display: flex;
  261. justify-content: space-around;
  262. margin: auto;
  263. // margin-left: 30rem;
  264. }
  265. .chushuikou2-2 {
  266. font-family: SimHei;
  267. font-size: 13rem;
  268. color: #C8daf5;
  269. width: 100%;
  270. height: 13rem;
  271. display: flex;
  272. justify-content: space-between;
  273. margin: auto;
  274. // margin-left: 30rem;
  275. }
  276. .chushuikou2 {
  277. width: 100%;
  278. height: 35rem;
  279. display: flex;
  280. align-items: center;
  281. }
  282. .chushuikou3 {
  283. width: 100%;
  284. height: 35rem;
  285. background-color: rgba(0, 37, 98, 0.4);
  286. display: flex;
  287. align-items: center;
  288. }
  289. .chushuikou4 {
  290. width: 100%;
  291. height: 35rem;
  292. display: flex;
  293. align-items: center;
  294. }
  295. .chushuikou5 {
  296. width: 100%;
  297. height: 35rem;
  298. background-color: rgba(0, 37, 98, 0.4);
  299. display: flex;
  300. align-items: center;
  301. }
  302. }
  303. </style>