Map.vue 17 KB

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