DWK_GDC.vue 19 KB

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