Map.vue 17 KB

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