MCH_GDC.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. <template>
  2. <div class="map-1" style="width: 100%; height: 100%">
  3. <arcgis @when="when" ref="arcgis" :data="arcgisData" @clickMap="clickMap">
  4. <template v-slot:content>
  5. <div class="panel-box">
  6. <div
  7. class="panel-item"
  8. :class="panel.line"
  9. v-for="(panel, index) of panels"
  10. :key="index"
  11. >
  12. <svg
  13. v-show="panel.type != 'none' && panel.type != 'syz'"
  14. viewBox="0 0 800 800"
  15. version="1.1"
  16. xmlns="http://www.w3.org/2000/svg"
  17. xmlns:xlink="http://www.w3.org/1999/xlink"
  18. xml:space="preserve"
  19. >
  20. <defs>
  21. <rect
  22. id="fill-rect"
  23. x="5"
  24. y="5"
  25. rx="8"
  26. ry="8"
  27. width="90"
  28. height="340"
  29. fill="#303B6F"
  30. />
  31. <rect
  32. id="none-rect"
  33. x="5"
  34. y="5"
  35. rx="8"
  36. ry="8"
  37. width="90"
  38. height="120"
  39. fill="#303B6F"
  40. />
  41. <g id="panel-deepblue">
  42. <polygon
  43. fill="#FFFFFF"
  44. points="300 13.73 60.07 13.73 60.07 13.73 22.48 13.73 0 109.84 0 109.84 0 109.84 0 109.84 0 109.84 22.48 205.95 272.88 205.95 272.88 205.61 300 205.61 300 13.73"
  45. />
  46. <polygon
  47. fill="#5C9BAF"
  48. points="250.4 109.84 3.26 109.84 29 0 276.14 0 250.4 109.84"
  49. />
  50. <polygon
  51. fill="#00486B"
  52. points="29 219.68 276.14 219.68 250.4 109.84 3.26 109.84 29 219.68"
  53. />
  54. </g>
  55. <g id="panel-blue">
  56. <polygon
  57. fill="#FFFFFF"
  58. points="300 13.73 60.07 13.73 60.07 13.73 22.48 13.73 0 109.84 0 109.84 0 109.84 0 109.84 0 109.84 22.48 205.95 272.88 205.95 272.88 205.61 300 205.61 300 13.73"
  59. />
  60. <polygon
  61. fill="#23ABFF"
  62. points="250.4 109.84 3.26 109.84 29 0 276.14 0 250.4 109.84"
  63. />
  64. <polygon
  65. fill="#0E6BBB"
  66. points="29 219.68 276.14 219.68 250.4 109.84 3.26 109.84 29 219.68"
  67. />
  68. </g>
  69. <g id="panel-red">
  70. <polygon
  71. fill="#FFFFFF"
  72. points="290 13.27 58.07 13.27 58.07 13.27 21.73 13.27 0 106.18 0 106.18 0 106.18 0 106.18 0 106.18 21.73 199.09 263.79 199.09 263.79 198.75 290 198.75 290 13.27"
  73. />
  74. <polygon
  75. fill="#EC1208"
  76. points="242.05 106.18 3.15 106.18 28.04 0 266.94 0 242.05 106.18"
  77. />
  78. <polygon
  79. fill="#AA0607"
  80. points="28.04 212.36 266.94 212.36 242.05 106.18 3.15 106.18 28.04 212.36"
  81. />
  82. </g>
  83. </defs>
  84. <!-- 底图 左右两列矩形 -->
  85. <g>
  86. <use xlink:href="#fill-rect" x="50" y="50" />
  87. <use xlink:href="#fill-rect" x="150" y="50" />
  88. <use xlink:href="#fill-rect" x="550" y="50" />
  89. <use xlink:href="#fill-rect" x="650" y="50" />
  90. <use xlink:href="#fill-rect" x="50" y="400" />
  91. <use xlink:href="#fill-rect" x="150" y="400" />
  92. <use xlink:href="#fill-rect" x="550" y="400" />
  93. <use xlink:href="#fill-rect" x="650" y="400" />
  94. </g>
  95. <!-- 中间上矩形 全部 -->
  96. <g
  97. :style="
  98. 'display: ' +
  99. (panel.type == 'fill' || panel.type == 'bottom'
  100. ? 'block'
  101. : 'none')
  102. "
  103. >
  104. <use xlink:href="#fill-rect" x="250" y="50" />
  105. <use xlink:href="#fill-rect" x="350" y="50" />
  106. <use xlink:href="#fill-rect" x="450" y="50" />
  107. </g>
  108. <!-- 中间上矩形 一半 -->
  109. <g
  110. :style="'display: ' + (panel.type == 'top' ? 'block' : 'none')"
  111. >
  112. <use xlink:href="#none-rect" x="250" y="270" />
  113. <use xlink:href="#none-rect" x="350" y="270" />
  114. <use xlink:href="#none-rect" x="450" y="270" />
  115. </g>
  116. <!-- 中间上逆变器 深蓝色 -->
  117. <g
  118. :style="
  119. 'display: ' +
  120. (panel.type == 'top' && panel.state == 'deepblue'
  121. ? 'block'
  122. : 'none')
  123. "
  124. class="can-click esri-component"
  125. @click.prevent="clickEl(panel)"
  126. >
  127. <use xlink:href="#panel-deepblue" x="250" y="50" />
  128. </g>
  129. <!-- 中间上逆变器 蓝色 -->
  130. <g
  131. :style="
  132. 'display: ' +
  133. (panel.type == 'top' && panel.state == 'blue'
  134. ? 'block'
  135. : 'none')
  136. "
  137. class="can-click esri-component"
  138. @click.prevent="clickEl(panel)"
  139. >
  140. <use xlink:href="#panel-blue" x="250" y="50" />
  141. </g>
  142. <!-- 中间上逆变器 红色 -->
  143. <g
  144. :style="
  145. 'display: ' +
  146. (panel.type == 'top' && panel.state == 'red'
  147. ? 'block'
  148. : 'none')
  149. "
  150. class="can-click esri-component"
  151. @click.prevent="clickEl(panel)"
  152. >
  153. <use xlink:href="#panel-red" x="250" y="50" />
  154. </g>
  155. <!-- 中间上文字 -->
  156. <g
  157. :style="'display: ' + (panel.type == 'top' ? 'block' : 'none')"
  158. class="can-click esri-component"
  159. @click.prevent="clickEl(panel)"
  160. >
  161. <text
  162. x="365"
  163. y="220"
  164. fill="#ffffff"
  165. font-size="150"
  166. text-anchor="middle"
  167. >
  168. {{ panel.code }}
  169. </text>
  170. </g>
  171. <!-- 中间下矩形 全部 -->
  172. <g
  173. :style="
  174. 'display: ' +
  175. (panel.type == 'fill' || panel.type == 'top'
  176. ? 'block'
  177. : 'none')
  178. "
  179. >
  180. <use xlink:href="#fill-rect" x="250" y="400" />
  181. <use xlink:href="#fill-rect" x="350" y="400" />
  182. <use xlink:href="#fill-rect" x="450" y="400" />
  183. </g>
  184. <!-- 中间下矩形 一半 -->
  185. <g
  186. :style="
  187. 'display: ' + (panel.type == 'bottom' ? 'block' : 'none')
  188. "
  189. >
  190. <use xlink:href="#none-rect" x="250" y="400" />
  191. <use xlink:href="#none-rect" x="350" y="400" />
  192. <use xlink:href="#none-rect" x="450" y="400" />
  193. </g>
  194. <!-- 中间下逆变器 深蓝色 -->
  195. <g
  196. :style="
  197. 'display: ' +
  198. (panel.type == 'bottom' && panel.state == 'deepblue'
  199. ? 'block'
  200. : 'none')
  201. "
  202. class="can-click esri-component"
  203. @click.prevent="clickEl(panel)"
  204. >
  205. <use xlink:href="#panel-deepblue" x="250" y="530" />
  206. </g>
  207. <!-- 中间下逆变器 蓝色 -->
  208. <g
  209. :style="
  210. 'display: ' +
  211. (panel.type == 'bottom' && panel.state == 'blue'
  212. ? 'block'
  213. : 'none')
  214. "
  215. class="can-click esri-component"
  216. @click.prevent="clickEl(panel)"
  217. >
  218. <use xlink:href="#panel-blue" x="250" y="530" />
  219. </g>
  220. <!-- 中间下逆变器 红色 -->
  221. <g
  222. :style="
  223. 'display: ' +
  224. (panel.type == 'bottom' && panel.state == 'red'
  225. ? 'block'
  226. : 'none')
  227. "
  228. class="can-click esri-component"
  229. @click.prevent="clickEl(panel)"
  230. >
  231. <use xlink:href="#panel-red" x="250" y="530" />
  232. </g>
  233. <!-- 中间下文字 -->
  234. <g
  235. :style="
  236. 'display: ' + (panel.type == 'bottom' ? 'block' : 'none')
  237. "
  238. class="can-click"
  239. @click.prevent="clickEl(panel)"
  240. >
  241. <text
  242. x="460"
  243. y="740"
  244. fill="#ffffff"
  245. font-size="150"
  246. text-anchor="middle"
  247. >
  248. {{ panel.code }}
  249. </text>
  250. </g>
  251. </svg>
  252. <div v-show="panel.type == 'syz'" class="panel-syz">
  253. <img :src="syzImg" class="syz-img" />
  254. <div class="syz-text">升压站</div>
  255. </div>
  256. </div>
  257. <!-- <img :src="tempImg" style="width: 800px; height: 700px;"> -->
  258. </div>
  259. </template>
  260. </arcgis>
  261. </div>
  262. </template>
  263. <script>
  264. import arcgis from "./arcgis.vue";
  265. import dataService from "@/helper/data.js";
  266. export default {
  267. // 名称
  268. name: "Map",
  269. // 使用组件
  270. components: {
  271. arcgis,
  272. },
  273. props: {
  274. wpId: {
  275. type: String,
  276. default: "",
  277. },
  278. },
  279. // 数据
  280. data() {
  281. return {
  282. wpnumMap: {}, //风机监视数量
  283. wpInfoMap: {}, //风机详情
  284. fjmap: [], // 风机名
  285. sourceId: "",
  286. arcgisData: {
  287. mode: "2D", // 模式 2D 3D
  288. title: "宁夏地图", // 标题
  289. center: [105.424419, 37.3127912], // 初始中心点
  290. height: 654, // 3D地图初始相机高度
  291. tilt: 65, // 俯视角
  292. scale: 15000,
  293. rotation: 180,
  294. },
  295. tempImg: require("@assets/temp1.png"),
  296. syzImg: require("@assets/png/booster-station.png"),
  297. showPopup: true,
  298. panels: [{"id":"00","type":"top","code":1,"state":"deepblue","line":"top left"},{"id":"01","type":"top","code":2,"state":"deepblue","line":"top right"},{"id":"02","type":"top","code":3,"state":"deepblue","line":"top"},{"id":"03","type":"top","code":4,"state":"deepblue","line":"top right"},{"id":"04","type":"top","code":5,"state":"deepblue","line":"top"},{"id":"05","type":"top","code":6,"state":"deepblue","line":"top right"},{"id":"06","type":"top","code":7,"state":"deepblue","line":"top"},{"id":"07","type":"top","code":8,"state":"deepblue","line":"top right"},{"id":"08","type":"top","code":9,"state":"deepblue","line":"top"},{"id":"09","type":"top","code":10,"state":"deepblue","line":"top right"},{"id":10,"type":"top","code":11,"state":"deepblue","line":"top left"},{"id":11,"type":"top","code":12,"state":"deepblue","line":"top right"},{"id":12,"type":"top","code":13,"state":"deepblue","line":"top"},{"id":13,"type":"top","code":14,"state":"deepblue","line":"top right"},{"id":14,"type":"top","code":15,"state":"deepblue","line":"top"},{"id":15,"type":"top","code":16,"state":"deepblue","line":"top right"},{"id":16,"type":"top","code":17,"state":"deepblue","line":"top left"},{"id":17,"type":"top","code":18,"state":"deepblue","line":"top right"},
  299. {"id":'',type: "none","code":'',"state":"","line":""},
  300. {"id":18,"type":"top","code":19,"state":"deepblue","line":"top left"},{"id":19,"type":"top","code":20,"state":"deepblue","line":"top"},{"id":20,"type":"top","code":21,"state":"deepblue","line":"top"},{"id":21,"type":"top","code":22,"state":"deepblue","line":"top"},{"id":22,"type":"top","code":23,"state":"deepblue","line":"top"},{"id":23,"type":"top","code":24,"state":"deepblue","line":"top"},{"id":24,"type":"top","code":25,"state":"deepblue","line":"top right"}]
  301. };
  302. },
  303. created() {
  304. let that = this;
  305. that.sourceId = this.wpId;
  306. that.$nextTick(() => {});
  307. },
  308. // 函数
  309. methods: {
  310. when: function () {
  311. this.$refs.arcgis.addHtmlPoint(
  312. [105.424419, 37.3127912],
  313. "content",
  314. 400,
  315. 350
  316. );
  317. },
  318. clickMap: function (info) {
  319. console.log(info);
  320. },
  321. clickEl: function (item) {
  322. let wpId = this.$route.path.split('/').pop(),
  323. wtId = wpId.split('_')[0] +'01_'+ item.id;
  324. this.$router.push({
  325. path: `/monitor/windsite/inverter-info/`+wpId+`/`+wtId,
  326. });
  327. },
  328. },
  329. watch: {
  330. wpId(res) {
  331. this.sourceId = res;
  332. },
  333. },
  334. };
  335. </script>
  336. <style lang="less">
  337. @titleHeight: 40px;
  338. .map-1 {
  339. width: 100%;
  340. height: calc(100vh - 90px);
  341. display: flex;
  342. flex-direction: column;
  343. .btn-group-tabs {
  344. display: flex;
  345. flex-direction: row;
  346. }
  347. .panel-box {
  348. width: 840px;
  349. padding: 20px;
  350. display: flex;
  351. flex-wrap: wrap;
  352. background: #536268B8;
  353. .panel-item {
  354. width: 80px;
  355. height: 80px;
  356. position: relative;
  357. // margin-top: -20px;
  358. // margin-left: -20px;
  359. &.top {
  360. &::after {
  361. top: -3px;
  362. opacity: 1;
  363. }
  364. }
  365. &.bottom {
  366. &::after {
  367. bottom: -3px;
  368. opacity: 1;
  369. }
  370. }
  371. &.left {
  372. &::before {
  373. left: -3px;
  374. opacity: 1;
  375. }
  376. }
  377. &.right {
  378. &::before {
  379. right: -3px;
  380. opacity: 1;
  381. }
  382. }
  383. &::after {
  384. content: '';
  385. width: 100%;
  386. height: 6px;
  387. position: absolute;
  388. left: 0;
  389. background: @green;
  390. opacity: 0;
  391. }
  392. &::before {
  393. content: '';
  394. width: 6px;
  395. height: 100%;
  396. position: absolute;
  397. top: 0;
  398. background: @green;
  399. opacity: 0;
  400. }
  401. svg {
  402. width: 80px;
  403. height: 80px;
  404. }
  405. .panel-syz {
  406. width: 100%;
  407. height: 100%;
  408. position: relative;
  409. .syz-img {
  410. position: absolute;
  411. height: 70px;
  412. top: -35px;
  413. left: -10px;
  414. }
  415. .syz-text {
  416. position: absolute;
  417. color: @green;
  418. font-size: @fontsize-l;
  419. width: 100%;
  420. text-align: center;
  421. left: 0;
  422. top: -55px;
  423. font-weight: bold;
  424. }
  425. }
  426. }
  427. }
  428. .can-click {
  429. cursor: pointer;
  430. }
  431. .syz-img {
  432. width: 65px;
  433. height: 47px;
  434. img {
  435. width: 100%;
  436. height: 100%;
  437. }
  438. }
  439. .panel-title {
  440. width: 100%;
  441. background-color: fade(@darkgray, 40%);
  442. margin-top: 16px;
  443. padding: 6px;
  444. display: flex;
  445. align-items: center;
  446. .panel-title-name {
  447. color: @green;
  448. display: flex;
  449. align-items: center;
  450. line-height: 0;
  451. font-size: 0;
  452. i,
  453. span {
  454. margin: 0 0 0 16px;
  455. line-height: 0;
  456. font-size: 13px;
  457. }
  458. }
  459. .sub-title-item {
  460. display: flex;
  461. align-items: center;
  462. margin-left: 16px;
  463. .sub-title {
  464. font-size: 13px;
  465. margin-left: 6px;
  466. }
  467. .sub-count {
  468. font-size: 13px;
  469. font-weight: 500;
  470. }
  471. img {
  472. height: 31px;
  473. }
  474. }
  475. }
  476. .panel-body {
  477. flex-grow: 1;
  478. background-color: fade(@darkgray, 20%);
  479. padding: 8px;
  480. overflow: auto;
  481. position: relative;
  482. .arcgis-layer {
  483. z-index: 1;
  484. }
  485. .map-popup-panel {
  486. width: 760px;
  487. position: absolute;
  488. left: 71px;
  489. top: 22px;
  490. z-index: 2;
  491. .map-popup-panel-header {
  492. width: 100%;
  493. background: fade(#152221, 90%);
  494. display: flex;
  495. .map-popup-panel-title {
  496. padding: 17px 24px;
  497. font-size: @fontsize-s;
  498. position: relative;
  499. &::before,
  500. &::after {
  501. position: absolute;
  502. width: calc(50% - 6px);
  503. bottom: 0;
  504. border-bottom: 2px solid @green;
  505. }
  506. &::before {
  507. content: "";
  508. left: 0;
  509. }
  510. &::after {
  511. content: "";
  512. right: 0;
  513. }
  514. span {
  515. position: absolute;
  516. width: 11.3px;
  517. height: 11.3px;
  518. border-left: 2px solid @green;
  519. border-top: 2px solid @green;
  520. left: calc(50% - 5.65px);
  521. bottom: -3px;
  522. transform: rotate(45deg);
  523. }
  524. }
  525. .map-popup-panel-date {
  526. flex-grow: 1;
  527. padding: 17px 24px;
  528. font-size: @fontsize-s;
  529. text-align: right;
  530. border-bottom: 2px solid @green;
  531. }
  532. .map-popup-panel-back {
  533. margin-left: auto;
  534. width: 54px;
  535. display: flex;
  536. align-items: center;
  537. justify-content: center;
  538. position: relative;
  539. cursor: pointer;
  540. &::after {
  541. content: "";
  542. position: absolute;
  543. left: 0;
  544. height: 50%;
  545. border-left: 1px solid @gray;
  546. top: 25%;
  547. }
  548. }
  549. }
  550. .map-popup-panel-body {
  551. background: fade(#152221, 75%);
  552. border: 1px solid fade(@darkgray, 40);
  553. border-top: 0px;
  554. .table-form {
  555. .text,
  556. .unit {
  557. font-weight: 400;
  558. }
  559. .unit {
  560. min-width: auto;
  561. }
  562. .value,
  563. .unit {
  564. text-align: left;
  565. }
  566. }
  567. }
  568. }
  569. .map-tool {
  570. position: absolute;
  571. right: 22px;
  572. top: 22px;
  573. z-index: 2;
  574. background: #152221af;
  575. padding: 18px 14px;
  576. .m-btn {
  577. width: 124px;
  578. height: 44px;
  579. background: #152221bf;
  580. border: 1px solid #152221bf;
  581. color: #ffffff;
  582. transition: all 0.3s;
  583. display: flex;
  584. align-items: center;
  585. justify-content: center;
  586. cursor: pointer;
  587. &:hover,
  588. &.active {
  589. background: #05bb4c33;
  590. border: 1px solid #05bb4c;
  591. color: #05bb4c;
  592. }
  593. + .m-btn {
  594. margin-top: 16px;
  595. }
  596. }
  597. }
  598. }
  599. }
  600. </style>