PL_GDC.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  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: [106.2850, 38.5528], // 初始中心点
  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:
  299. [{"id":"00","type":"top","code":1,"state":"deepblue","line":"top left"},
  300. {"id":"01","type":"top","code":2,"state":"deepblue","line":"top right"},
  301. {"id":"02","type":"top","code":3,"state":"deepblue","line":"top"},
  302. {"id":"03","type":"top","code":4,"state":"deepblue","line":"top right"},
  303. {"id":"04","type":"top","code":5,"state":"deepblue","line":"top"},
  304. {"id":"05","type":"top","code":6,"state":"deepblue","line":"top right"},
  305. {"id":"06","type":"top","code":7,"state":"deepblue","line":"top"},
  306. {"id":"07","type":"top","code":8,"state":"deepblue","line":"top right"},
  307. {"id":"08","type":"top","code":9,"state":"deepblue","line":"top"},
  308. {"id":"09","type":"top","code":10,"state":"deepblue","line":"top right"},
  309. {"id":"10","type":"top","code":11,"state":"deepblue","line":"top left"},
  310. {"id":"11","type":"top","code":12,"state":"deepblue","line":"top right"},
  311. {"id":"12","type":"top","code":13,"state":"deepblue","line":"top"},
  312. {"id":"13","type":"top","code":14,"state":"deepblue","line":"top right"},
  313. {"id":"14","type":"top","code":15,"state":"deepblue","line":"top"},
  314. {"id":"15","type":"top","code":16,"state":"deepblue","line":"top right"},
  315. {"id":"16","type":"top","code":17,"state":"deepblue","line":"top"},
  316. {"id":"17","type":"top","code":18,"state":"deepblue","line":"top right"},
  317. {"id":"18","type":"top","code":19,"state":"deepblue","line":"top right"}]
  318. };
  319. },
  320. created() {
  321. let that = this;
  322. that.sourceId = this.wpId;
  323. that.$nextTick(() => {});
  324. },
  325. // 函数
  326. methods: {
  327. when: function () {
  328. this.$refs.arcgis.addHtmlPoint(
  329. [106.48638888888888, 38.924166666666665],
  330. "content",
  331. 400,
  332. 350
  333. );
  334. },
  335. clickMap: function (info) {
  336. console.log(info);
  337. },
  338. clickEl: function (item) {
  339. let wpId = this.$route.path.split('/').pop(),
  340. wtId = wpId.split('_')[0] +'01_'+ item.id;
  341. this.$router.push({
  342. path: `/monitor/windsite/inverter-info/`+wpId+`/`+wtId,
  343. });
  344. },
  345. },
  346. watch: {
  347. wpId(res) {
  348. this.sourceId = res;
  349. },
  350. },
  351. };
  352. </script>
  353. <style lang="less">
  354. @titleHeight: 40px;
  355. .map-1 {
  356. width: 100%;
  357. height: calc(100vh - 90px);
  358. display: flex;
  359. flex-direction: column;
  360. .btn-group-tabs {
  361. display: flex;
  362. flex-direction: row;
  363. }
  364. .panel-box {
  365. width: 840px;
  366. padding: 20px;
  367. display: flex;
  368. flex-wrap: wrap;
  369. background: #536268B8;
  370. .panel-item {
  371. width: 80px;
  372. height: 80px;
  373. position: relative;
  374. // margin-top: -20px;
  375. // margin-left: -20px;
  376. &.top {
  377. &::after {
  378. top: -3px;
  379. opacity: 1;
  380. }
  381. }
  382. &.bottom {
  383. &::after {
  384. bottom: -3px;
  385. opacity: 1;
  386. }
  387. }
  388. &.left {
  389. &::before {
  390. left: -3px;
  391. opacity: 1;
  392. }
  393. }
  394. &.right {
  395. &::before {
  396. right: -3px;
  397. opacity: 1;
  398. }
  399. }
  400. &::after {
  401. content: '';
  402. width: 100%;
  403. height: 6px;
  404. position: absolute;
  405. left: 0;
  406. background: @green;
  407. opacity: 0;
  408. }
  409. &::before {
  410. content: '';
  411. width: 6px;
  412. height: 100%;
  413. position: absolute;
  414. top: 0;
  415. background: @green;
  416. opacity: 0;
  417. }
  418. svg {
  419. width: 80px;
  420. height: 80px;
  421. }
  422. .panel-syz {
  423. width: 100%;
  424. height: 100%;
  425. position: relative;
  426. .syz-img {
  427. position: absolute;
  428. height: 70px;
  429. top: -35px;
  430. left: -10px;
  431. }
  432. .syz-text {
  433. position: absolute;
  434. color: @green;
  435. font-size: @fontsize-l;
  436. width: 100%;
  437. text-align: center;
  438. left: 0;
  439. top: -55px;
  440. font-weight: bold;
  441. }
  442. }
  443. }
  444. }
  445. .can-click {
  446. cursor: pointer;
  447. }
  448. .syz-img {
  449. width: 65px;
  450. height: 47px;
  451. img {
  452. width: 100%;
  453. height: 100%;
  454. }
  455. }
  456. .panel-title {
  457. width: 100%;
  458. background-color: fade(@darkgray, 40%);
  459. margin-top: 16px;
  460. padding: 6px;
  461. display: flex;
  462. align-items: center;
  463. .panel-title-name {
  464. color: @green;
  465. display: flex;
  466. align-items: center;
  467. line-height: 0;
  468. font-size: 0;
  469. i,
  470. span {
  471. margin: 0 0 0 16px;
  472. line-height: 0;
  473. font-size: 13px;
  474. }
  475. }
  476. .sub-title-item {
  477. display: flex;
  478. align-items: center;
  479. margin-left: 16px;
  480. .sub-title {
  481. font-size: 13px;
  482. margin-left: 6px;
  483. }
  484. .sub-count {
  485. font-size: 13px;
  486. font-weight: 500;
  487. }
  488. img {
  489. height: 31px;
  490. }
  491. }
  492. }
  493. .panel-body {
  494. flex-grow: 1;
  495. background-color: fade(@darkgray, 20%);
  496. padding: 8px;
  497. overflow: auto;
  498. position: relative;
  499. .arcgis-layer {
  500. z-index: 1;
  501. }
  502. .map-popup-panel {
  503. width: 760px;
  504. position: absolute;
  505. left: 71px;
  506. top: 22px;
  507. z-index: 2;
  508. .map-popup-panel-header {
  509. width: 100%;
  510. background: fade(#152221, 90%);
  511. display: flex;
  512. .map-popup-panel-title {
  513. padding: 17px 24px;
  514. font-size: @fontsize-s;
  515. position: relative;
  516. &::before,
  517. &::after {
  518. position: absolute;
  519. width: calc(50% - 6px);
  520. bottom: 0;
  521. border-bottom: 2px solid @green;
  522. }
  523. &::before {
  524. content: "";
  525. left: 0;
  526. }
  527. &::after {
  528. content: "";
  529. right: 0;
  530. }
  531. span {
  532. position: absolute;
  533. width: 11.3px;
  534. height: 11.3px;
  535. border-left: 2px solid @green;
  536. border-top: 2px solid @green;
  537. left: calc(50% - 5.65px);
  538. bottom: -3px;
  539. transform: rotate(45deg);
  540. }
  541. }
  542. .map-popup-panel-date {
  543. flex-grow: 1;
  544. padding: 17px 24px;
  545. font-size: @fontsize-s;
  546. text-align: right;
  547. border-bottom: 2px solid @green;
  548. }
  549. .map-popup-panel-back {
  550. margin-left: auto;
  551. width: 54px;
  552. display: flex;
  553. align-items: center;
  554. justify-content: center;
  555. position: relative;
  556. cursor: pointer;
  557. &::after {
  558. content: "";
  559. position: absolute;
  560. left: 0;
  561. height: 50%;
  562. border-left: 1px solid @gray;
  563. top: 25%;
  564. }
  565. }
  566. }
  567. .map-popup-panel-body {
  568. background: fade(#152221, 75%);
  569. border: 1px solid fade(@darkgray, 40);
  570. border-top: 0px;
  571. .table-form {
  572. .text,
  573. .unit {
  574. font-weight: 400;
  575. }
  576. .unit {
  577. min-width: auto;
  578. }
  579. .value,
  580. .unit {
  581. text-align: left;
  582. }
  583. }
  584. }
  585. }
  586. .map-tool {
  587. position: absolute;
  588. right: 22px;
  589. top: 22px;
  590. z-index: 2;
  591. background: #152221af;
  592. padding: 18px 14px;
  593. .m-btn {
  594. width: 124px;
  595. height: 44px;
  596. background: #152221bf;
  597. border: 1px solid #152221bf;
  598. color: #ffffff;
  599. transition: all 0.3s;
  600. display: flex;
  601. align-items: center;
  602. justify-content: center;
  603. cursor: pointer;
  604. &:hover,
  605. &.active {
  606. background: #05bb4c33;
  607. border: 1px solid #05bb4c;
  608. color: #05bb4c;
  609. }
  610. + .m-btn {
  611. margin-top: 16px;
  612. }
  613. }
  614. }
  615. }
  616. }
  617. </style>