Map.vue 16 KB

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