Map.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. <template>
  2. <div class="map-1">
  3. <div class="btn-group-tabs">
  4. <BtnGroup2
  5. :btnGroups="btnGroups"
  6. :rowIndex="rowIndex"
  7. :index="selectIndex"
  8. @select="select"
  9. ></BtnGroup2>
  10. </div>
  11. <div class="panel-title">
  12. <div class="panel-title-name">
  13. <div class="sub-title-item">
  14. <img src="../../../assets/map/fan/black.png" />
  15. <span class="sub-title gray">接入台数</span>
  16. <span class="sub-count font-num gray">{{
  17. wpnumMap.djts +
  18. wpnumMap.yxts +
  19. wpnumMap.xdts +
  20. wpnumMap.gzts +
  21. wpnumMap.whts +
  22. wpnumMap.lxts
  23. }}</span>
  24. </div>
  25. <div class="sub-title-item">
  26. <img src="../../../assets/map/fan/green.png" />
  27. <span class="sub-title green">待机台数</span>
  28. <span class="sub-count font-num green">{{ wpnumMap.djts }}</span>
  29. </div>
  30. <div class="sub-title-item">
  31. <img src="../../../assets/map/fan/blue.png" />
  32. <span class="sub-title blue">并网台数</span>
  33. <span class="sub-count font-num blue">{{ wpnumMap.yxts }}</span>
  34. </div>
  35. <div class="sub-title-item">
  36. <img src="../../../assets/map/fan/purple.png" />
  37. <span class="sub-title pink">限电台数</span>
  38. <span class="sub-count font-num pink">{{ wpnumMap.xdts }}</span>
  39. </div>
  40. <div class="sub-title-item">
  41. <img src="../../../assets/map/fan/red.png" />
  42. <span class="sub-title red">故障台数</span>
  43. <span class="sub-count font-num red">{{ wpnumMap.gzts }}</span>
  44. </div>
  45. <div class="sub-title-item">
  46. <img src="../../../assets/map/fan/orange.png" />
  47. <span class="sub-title orange">检修台数</span>
  48. <span class="sub-count font-num orange">{{ wpnumMap.whts }}</span>
  49. </div>
  50. <div class="sub-title-item">
  51. <img src="../../../assets/map/fan/black.png" />
  52. <span class="sub-title gray">离线台数</span>
  53. <span class="sub-count font-num gray">{{ wpnumMap.lxts }}</span>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="panel-body">
  58. <MHSFDC wpId="MHS_FDC" v-if="wpId.indexOf('MHS_FDC') !== -1" />
  59. <NSSFDC wpId="NSS_FDC" v-if="wpId.indexOf('NSS_FDC') !== -1" />
  60. <QSFDC wpId="QS_FDC" v-if="wpId.indexOf('QS_FDC') !== -1" />
  61. <SBQFDC wpId="SBQ_FDC" v-if="wpId.indexOf('SBQ_FDC') !== -1" />
  62. <XSFDC wpId="XS_FDC" v-if="wpId.indexOf('XS_FDC') !== -1" />
  63. <PLGDC wpId="PL_GDC" v-if="wpId.indexOf('PL_GDC') !== -1" />
  64. <DWKGDC wpId="DWK_GDC" v-if="wpId.indexOf('DWK_GDC') !== -1" />
  65. <XHGDC wpId="XH_GDC" v-if="wpId.indexOf('XH_GDC') !== -1" />
  66. <MCHGDC wpId="MCH_GDC" v-if="wpId.indexOf('MCH_GDC') !== -1" />
  67. <HZJGDC wpId="HZJ_GDC" v-if="wpId.indexOf('HZJ_GDC') !== -1" />
  68. <AKGDC wpId="AK_GDC" v-if="wpId.indexOf('AK_GDC') !== -1" />
  69. <div class="map-popup-panel" v-show="showPopup">
  70. <!-- <div class="map-popup-panel-header">
  71. <div class="map-popup-panel-title green">
  72. 某某风电场总貌<span></span>
  73. </div>
  74. <div class="map-popup-panel-date gray">2020年5月10日</div>
  75. <div class="map-popup-panel-back" @click="popupBack">
  76. <span class="svg-icon svg-icon-white svg-icon-sm">
  77. <SvgIcon svgid="svg-arrow-dpwn-1"></SvgIcon>
  78. </span>
  79. </div>
  80. </div> -->
  81. <div class="map-popup-panel-body">
  82. <table class="table-form">
  83. <tr>
  84. <td class="text white">预测功率</td>
  85. <td class="value green">{{ wpnumMap.ycgl }}</td>
  86. <td class="unit white">MW</td>
  87. <td class="text white">保证功率</td>
  88. <td class="value green">{{ wpnumMap.bzgl }}</td>
  89. <td class="unit white">MW</td>
  90. <td class="text white">应发功率</td>
  91. <td class="value green">{{ wpnumMap.yfgl }}</td>
  92. <td class="unit white">MW</td>
  93. </tr>
  94. <tr>
  95. <!-- <td class="text white">实际风速</td>
  96. <td class="value green">{{ wpnumMap.ssfs }}</td>
  97. <td class="unit white">m/s</td> -->
  98. <td class="text white">日性能损失</td>
  99. <td class="value green">{{ wpInfoMap.rqfssdl }}</td>
  100. <td class="unit white">万kWh</td>
  101. <td class="text white">月性能损失</td>
  102. <td class="value green">{{ wpInfoMap.yqfssdl }}</td>
  103. <td class="unit white">万kWh</td>
  104. <td class="text white">年性能损失</td>
  105. <td class="value green">{{ wpInfoMap.nqfssdl }}</td>
  106. <td class="unit white">万kWh</td>
  107. </tr>
  108. <tr>
  109. <td class="text white">日故障损失</td>
  110. <td class="value green">{{ wpInfoMap.rgzssdl }}</td>
  111. <td class="unit white">万kWh</td>
  112. <td class="text white">月故障损失</td>
  113. <td class="value green">{{ wpInfoMap.ygzssdl }}</td>
  114. <td class="unit white">万kWh</td>
  115. <td class="text white">年故障损失</td>
  116. <td class="value green">{{ wpInfoMap.ngzssdl }}</td>
  117. <td class="unit white">万kWh</td>
  118. </tr>
  119. <tr>
  120. <td class="text white">日检修损失</td>
  121. <td class="value green">{{ wpInfoMap.rjxssdl }}</td>
  122. <td class="unit white">万kWh</td>
  123. <td class="text white">月检修损失</td>
  124. <td class="value green">{{ wpInfoMap.yjxssdl }}</td>
  125. <td class="unit white">万kWh</td>
  126. <td class="text white">年检修损失</td>
  127. <td class="value green">{{ wpInfoMap.njxssdl }}</td>
  128. <td class="unit white">万kWh</td>
  129. </tr>
  130. <tr>
  131. <td class="text white">日限电损失</td>
  132. <td class="value green">{{ wpInfoMap.rxdssdl }}</td>
  133. <td class="unit white">万kWh</td>
  134. <td class="text white">月限电损失</td>
  135. <td class="value green">{{ wpInfoMap.yxdssdl }}</td>
  136. <td class="unit white">万kWh</td>
  137. <td class="text white">年限电损失</td>
  138. <td class="value green">{{ wpInfoMap.nxdssdl }}</td>
  139. <td class="unit white">万kWh</td>
  140. </tr>
  141. <tr>
  142. <td class="text white">日受累损失</td>
  143. <td class="value green">{{ wpInfoMap.rslssdl }}</td>
  144. <td class="unit white">万kWh</td>
  145. <td class="text white">月受累损失</td>
  146. <td class="value green">{{ wpInfoMap.yslssdl }}</td>
  147. <td class="unit white">万kWh</td>
  148. <td class="text white">年受累损失</td>
  149. <td class="value green">{{ wpInfoMap.nslssdl }}</td>
  150. <td class="unit white">万kWh</td>
  151. </tr>
  152. </table>
  153. </div>
  154. </div>
  155. <div class="map-tool">
  156. <div
  157. class="m-btn"
  158. :class="{ active: mapToolIndex == 0 }"
  159. @click="clickMapTool(0)"
  160. >
  161. 场站详情
  162. </div>
  163. <!-- <div
  164. class="m-btn"
  165. :class="{ active: mapToolIndex == 1 }"
  166. @click="clickMapTool(1)"
  167. >
  168. 巡检路线
  169. </div> -->
  170. </div>
  171. </div>
  172. </div>
  173. </template>
  174. <script>
  175. import BtnGroup2 from "@com/coms/btn/btn-group-double.vue";
  176. // import SvgIcon from "@com/coms/icon/svg-icon.vue";
  177. import MHSFDC from "@com/arcgis/MHS_FDC.vue";
  178. import NSSFDC from "@com/arcgis/NSS_FDC.vue";
  179. import QSFDC from "@com/arcgis/QS_FDC.vue";
  180. import SBQFDC from "@com/arcgis/SBQ_FDC.vue";
  181. import XSFDC from "@com/arcgis/XS_FDC.vue";
  182. import PLGDC from "@com/arcgis/PL_GDC.vue";
  183. import DWKGDC from "@com/arcgis/DWK_GDC.vue";
  184. import XHGDC from "@com/arcgis/XH_GDC.vue";
  185. import MCHGDC from "@com/arcgis/MCH_GDC.vue";
  186. import HZJGDC from "@com/arcgis/HZJ_GDC.vue";
  187. import AKGDC from '@com/arcgis/AK_GDC.vue'
  188. import dataService from "@/helper/data.js";
  189. export default {
  190. // 名称
  191. name: "Map",
  192. // 使用组件
  193. components: {
  194. BtnGroup2,
  195. MHSFDC,
  196. NSSFDC,
  197. QSFDC,
  198. SBQFDC,
  199. XSFDC,
  200. PLGDC,
  201. DWKGDC,
  202. XHGDC,
  203. MCHGDC,
  204. HZJGDC,
  205. AKGDC,
  206. },
  207. // 数据
  208. data() {
  209. return {
  210. timmer: undefined,
  211. wpId: undefined,
  212. wpnumMap: {}, //风机监视数量
  213. wpInfoMap: {}, //风机详情
  214. fjmap: [], // 风机名
  215. selectIndex: 0,
  216. rowIndex: 0,
  217. btnGroups: [
  218. {
  219. icon: "svg-wind-site",
  220. btns: [],
  221. },
  222. {
  223. icon: "svg-photovoltaic",
  224. btns: [],
  225. },
  226. ],
  227. arcgisData: {
  228. mode: "2D", // 模式 2D 3D
  229. title: "宁夏地图", // 标题
  230. center: [107.0391975, 37.31469028], // 初始中心点 106.230909, 38.487193
  231. height: 654, // 3D地图初始相机高度
  232. tilt: 65, // 俯视角
  233. scale: 30000,
  234. rotation: -45,
  235. ox: -600,
  236. oy: -50,
  237. },
  238. showPopup: false,
  239. mapToolIndex: 0,
  240. fans: [],
  241. colors: {
  242. 0: ["#05bb4c", "#4ad476", "#9fedb2"],
  243. 1: ["#4b55ae", "#959dc7", "#d3d6e0"],
  244. 2: ["#BA3237", "#d4807d", "#eddad8"],
  245. 3: ["#606769", "#757575", "#AFAFAF"],
  246. 4: ["#e17e23", "#fabf78", "#ffebcc"],
  247. 5: ["#c531c7", "#e080dc", "#fadef7"],
  248. 6: ["#c531c7", "#e080dc", "#fadef7"],
  249. },
  250. syzImg: require("@assets/png/booster-station.png"),
  251. };
  252. },
  253. created() {
  254. let that = this;
  255. that.wpId = that.$route.params.wpId;
  256. that.$nextTick(() => {
  257. that.getWp();
  258. that.requestData();
  259. });
  260. },
  261. // 函数
  262. methods: {
  263. select(res) {
  264. this.$router.replace({
  265. path: `/monitor/windsite/map/${res.code}`,
  266. });
  267. },
  268. getWp() {
  269. let that = this;
  270. that.API.requestData({
  271. method: "GET",
  272. subUrl: "powercompare/windfarmAllAjax",
  273. success(res) {
  274. let btnGroup = [
  275. {
  276. icon: "svg-wind-site",
  277. btns: [],
  278. },
  279. // {
  280. // icon: "svg-photovoltaic",
  281. // btns: [],
  282. // },
  283. ];
  284. res.data.forEach((ele, index) => {
  285. if (ele.id.indexOf("FDC") !== -1) {
  286. btnGroup[0].btns.push({
  287. text: ele.name,
  288. code: ele.id,
  289. });
  290. } else {
  291. // btnGroup[1].btns.push({
  292. // text: ele.name,
  293. // code: ele.id,
  294. // });
  295. }
  296. });
  297. that.btnGroups = btnGroup;
  298. that.renderBtnActiveIndex();
  299. },
  300. });
  301. },
  302. // 风机状态监视
  303. requestData() {
  304. let that = this;
  305. that.API.requestData({
  306. method: "POST",
  307. subUrl: "monitor/findGeneralAppearance",
  308. data: {
  309. wpId: that.wpId,
  310. },
  311. success(res) {
  312. if (res.code == 200) {
  313. console.log(res)
  314. that.wpnumMap = res.data.fczbmap.jczbmap;
  315. that.wpInfoMap = res.data.wxssmap;
  316. that.fjmap = res.data.fjmap[0];
  317. }
  318. },
  319. });
  320. },
  321. renderBtnActiveIndex() {
  322. this.btnGroups.forEach((pEle, pIndex) => {
  323. pEle.btns.forEach((cEle, cIndex) => {
  324. if (cEle.code === this.wpId) {
  325. this.rowIndex = pIndex;
  326. this.selectIndex = cIndex;
  327. }
  328. });
  329. });
  330. },
  331. clickMap: function (info) {
  332. // this.showPopup = true;
  333. },
  334. clickFan: function (code) {
  335. let wtId = code.replace("G", "G01_");
  336. this.$router.push(`/monitor/windsite/info/${this.wpId}/${wtId}`);
  337. // this.showPopup = true;
  338. },
  339. popupBack: function () {
  340. this.showPopup = false;
  341. },
  342. clickMapTool: function (index) {
  343. // this.mapToolIndex = index;
  344. this.showPopup = !this.showPopup;
  345. },
  346. },
  347. watch: {
  348. $route(res) {
  349. this.wpId = res.params.wpId;
  350. if (res.params.wpId) {
  351. this.requestData();
  352. this.renderBtnActiveIndex();
  353. }
  354. },
  355. },
  356. };
  357. </script>
  358. <style lang="less" scoped>
  359. @titleHeight: 40px;
  360. .map-1 {
  361. width: 100%;
  362. height: calc(100vh - 90px);
  363. display: flex;
  364. flex-direction: column;
  365. .btn-group-tabs {
  366. display: flex;
  367. flex-direction: row;
  368. }
  369. .can-click {
  370. cursor: pointer;
  371. }
  372. .syz-img {
  373. width: 65px;
  374. height: 47px;
  375. img {
  376. width: 100%;
  377. height: 100%;
  378. }
  379. }
  380. .panel-title {
  381. width: 100%;
  382. background-color: fade(@darkgray, 40%);
  383. margin-top: 16px;
  384. padding: 6px;
  385. display: flex;
  386. align-items: center;
  387. .panel-title-name {
  388. color: @green;
  389. display: flex;
  390. align-items: center;
  391. line-height: 0;
  392. font-size: 0;
  393. i,
  394. span {
  395. margin: 0 0 0 16px;
  396. line-height: 0;
  397. font-size: 13px;
  398. }
  399. }
  400. .sub-title-item {
  401. display: flex;
  402. align-items: center;
  403. margin-left: 16px;
  404. width: 140px;
  405. .sub-title {
  406. font-size: 13px;
  407. margin-left: 6px;
  408. }
  409. .sub-count {
  410. font-size: 13px;
  411. font-weight: 500;
  412. }
  413. img {
  414. height: 31px;
  415. }
  416. }
  417. }
  418. .panel-body {
  419. flex-grow: 1;
  420. background-color: fade(@darkgray, 20%);
  421. padding: 8px;
  422. overflow: auto;
  423. position: relative;
  424. .arcgis-layer {
  425. z-index: 1;
  426. }
  427. .map-popup-panel {
  428. width: 760px;
  429. position: absolute;
  430. left: 71px;
  431. top: 22px;
  432. z-index: 2;
  433. .map-popup-panel-header {
  434. width: 100%;
  435. background: fade(#152221, 90%);
  436. display: flex;
  437. .map-popup-panel-title {
  438. padding: 17px 24px;
  439. font-size: @fontsize-s;
  440. position: relative;
  441. &::before,
  442. &::after {
  443. position: absolute;
  444. width: calc(50% - 6px);
  445. bottom: 0;
  446. border-bottom: 2px solid @green;
  447. }
  448. &::before {
  449. content: "";
  450. left: 0;
  451. }
  452. &::after {
  453. content: "";
  454. right: 0;
  455. }
  456. span {
  457. position: absolute;
  458. width: 11.3px;
  459. height: 11.3px;
  460. border-left: 2px solid @green;
  461. border-top: 2px solid @green;
  462. left: calc(50% - 5.65px);
  463. bottom: -3px;
  464. transform: rotate(45deg);
  465. }
  466. }
  467. .map-popup-panel-date {
  468. flex-grow: 1;
  469. padding: 17px 24px;
  470. font-size: @fontsize-s;
  471. text-align: right;
  472. border-bottom: 2px solid @green;
  473. }
  474. .map-popup-panel-back {
  475. margin-left: auto;
  476. width: 54px;
  477. display: flex;
  478. align-items: center;
  479. justify-content: center;
  480. position: relative;
  481. cursor: pointer;
  482. &::after {
  483. content: "";
  484. position: absolute;
  485. left: 0;
  486. height: 50%;
  487. border-left: 1px solid @gray;
  488. top: 25%;
  489. }
  490. }
  491. }
  492. .map-popup-panel-body {
  493. background: fade(#152221, 75%);
  494. border: 1px solid fade(@darkgray, 40);
  495. border-top: 0px;
  496. .table-form {
  497. .text,
  498. .unit {
  499. min-width: 60px;
  500. font-weight: 400;
  501. }
  502. .unit {
  503. min-width: auto;
  504. }
  505. .value,
  506. .unit {
  507. text-align: left;
  508. }
  509. }
  510. }
  511. }
  512. .map-tool {
  513. position: absolute;
  514. right: 22px;
  515. top: 22px;
  516. z-index: 2;
  517. background: #152221af;
  518. padding: 18px 14px;
  519. .m-btn {
  520. width: 124px;
  521. height: 44px;
  522. background: #152221bf;
  523. border: 1px solid #152221bf;
  524. color: #ffffff;
  525. transition: all 0.3s;
  526. display: flex;
  527. align-items: center;
  528. justify-content: center;
  529. cursor: pointer;
  530. &:hover,
  531. &.active {
  532. background: #05bb4c33;
  533. border: 1px solid #05bb4c;
  534. color: #05bb4c;
  535. }
  536. + .m-btn {
  537. margin-top: 16px;
  538. }
  539. }
  540. }
  541. }
  542. }
  543. </style>