Map.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  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. <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 PLGDC from "@com/arcgis/PL_GDC.vue";
  167. import dataService from "@/helper/data.js";
  168. export default {
  169. // 名称
  170. name: "Map",
  171. // 使用组件
  172. components: {
  173. BtnGroup2,
  174. MHSFDC,
  175. PLGDC
  176. },
  177. // 数据
  178. data() {
  179. return {
  180. timmer: undefined,
  181. wpId: undefined,
  182. wpnumMap: {}, //风机监视数量
  183. wpInfoMap: {}, //风机详情
  184. fjmap: [], // 风机名
  185. selectIndex: 0,
  186. rowIndex: 0,
  187. btnGroups: [
  188. {
  189. icon: "svg-wind-site",
  190. btns: [],
  191. },
  192. {
  193. icon: "svg-photovoltaic",
  194. btns: [],
  195. },
  196. ],
  197. arcgisData: {
  198. mode: "2D", // 模式 2D 3D
  199. title: "宁夏地图", // 标题
  200. center: [107.0391975, 37.31469028], // 初始中心点 106.230909, 38.487193
  201. height: 654, // 3D地图初始相机高度
  202. tilt: 65, // 俯视角
  203. scale: 30000,
  204. rotation: -45,
  205. ox: -600,
  206. oy: -50,
  207. },
  208. showPopup: false,
  209. mapToolIndex: 0,
  210. fans: [],
  211. colors: {
  212. "0": ["#05bb4c", "#4ad476", "#9fedb2"],
  213. "1": ["#4b55ae", "#959dc7", "#d3d6e0"],
  214. "2": ["#BA3237", "#d4807d", "#eddad8"],
  215. "3": ["#606769", "#757575", "#AFAFAF"],
  216. "4": ["#e17e23", "#fabf78", "#ffebcc"],
  217. "5": ["#c531c7", "#e080dc", "#fadef7"],
  218. "6": ["#c531c7", "#e080dc", "#fadef7"],
  219. },
  220. syzImg: require("@assets/png/booster-station.png"),
  221. };
  222. },
  223. created() {
  224. let that = this;
  225. that.wpId = that.$route.params.wpId;
  226. that.$nextTick(() => {
  227. that.getWp();
  228. that.requestData();
  229. });
  230. },
  231. // 函数
  232. methods: {
  233. select(res) {
  234. this.$router.replace({
  235. path: `/monitor/windsite/map/${res.code}`,
  236. });
  237. },
  238. getWp() {
  239. let that = this;
  240. that.API.requestData({
  241. method: "GET",
  242. subUrl: "powercompare/windfarmAllAjax",
  243. success(res) {
  244. let btnGroup = [
  245. {
  246. icon: "svg-wind-site",
  247. btns: [],
  248. },
  249. {
  250. icon: "svg-photovoltaic",
  251. btns: [],
  252. },
  253. ];
  254. res.data.forEach((ele, index) => {
  255. if (ele.id.indexOf("FDC") !== -1) {
  256. btnGroup[0].btns.push({
  257. text: ele.name,
  258. code: ele.id,
  259. });
  260. } else {
  261. btnGroup[1].btns.push({
  262. text: ele.name,
  263. code: ele.id,
  264. });
  265. }
  266. });
  267. that.btnGroups = btnGroup;
  268. that.renderBtnActiveIndex();
  269. },
  270. });
  271. },
  272. // 风机状态监视
  273. requestData() {
  274. let that = this;
  275. that.API.requestData({
  276. method: "POST",
  277. subUrl: "monitor/findGeneralAppearance",
  278. data: {
  279. wpId: that.wpId,
  280. },
  281. success(res) {
  282. if (res.code == 200) {
  283. that.wpnumMap = res.data.fczbmap.jczbmap;
  284. console.log(that.wpnumMap)
  285. that.wpInfoMap = res.data.wxssmap;
  286. that.fjmap = res.data.fjmap[0];
  287. }
  288. },
  289. });
  290. },
  291. renderBtnActiveIndex() {
  292. this.btnGroups.forEach((pEle, pIndex) => {
  293. pEle.btns.forEach((cEle, cIndex) => {
  294. if (cEle.code === this.wpId) {
  295. this.rowIndex = pIndex;
  296. this.selectIndex = cIndex;
  297. }
  298. });
  299. });
  300. },
  301. when: function () {
  302. let jsonObj = dataService.get("arcgis-nx-fc1");
  303. this.fans = jsonObj;
  304. jsonObj.forEach((item) => {
  305. let obj = this.fjmap.find((t) => {
  306. let wtid = t.wtId.replace("01_","");
  307. if (wtid == item.attributes.code) return t
  308. });
  309. if (obj) {
  310. item.attributes.state = String(obj.fjzt);
  311. } else {
  312. item.attributes.state = "4";
  313. }
  314. switch (item.attributes.state) {
  315. case "0": //待机
  316. item.attributes.rotate = false; // 转
  317. item.attributes.dur = 8; // 转一圈时间
  318. break;
  319. case "1": //运行
  320. item.attributes.rotate = true; // 转
  321. item.attributes.dur = 2; // 转一圈时间
  322. break;
  323. case "2": //故障
  324. item.attributes.rotate = false; // 不转
  325. item.attributes.dur = 8;
  326. break;
  327. case "3": //中断
  328. item.attributes.rotate = false; // 不转
  329. item.attributes.dur = 8;
  330. break;
  331. case "4": //维护
  332. item.attributes.rotate = false; // 不转
  333. item.attributes.dur = 8;
  334. break;
  335. case "5": //限电
  336. item.attributes.rotate = true; // 转
  337. item.attributes.dur = 6;
  338. break;
  339. case "6": //停机
  340. item.attributes.rotate = false; // 不转
  341. item.attributes.dur = 8;
  342. break;
  343. default:
  344. item.attributes.rotate = false;
  345. item.attributes.dur = 8;
  346. break;
  347. }
  348. this.$refs.arcgis.addHtmlPoint(
  349. [item.geometry.x, item.geometry.y],
  350. item.attributes.code,
  351. 33,
  352. 50,
  353. false
  354. );
  355. });
  356. let lineJsonObj = dataService.get("arcgis-nx-fc1-line");
  357. this.$refs.arcgis.addFanByJson(jsonObj, lineJsonObj);
  358. },
  359. clickMap: function (info) {
  360. console.log(info);
  361. // this.showPopup = true;
  362. },
  363. clickFan: function (code) {
  364. let wtId = code.replace("G", "G01_");
  365. this.$router.push(`/monitor/windsite/info/${this.wpId}/${wtId}`);
  366. // console.log(wtId);
  367. // this.showPopup = true;
  368. },
  369. popupBack: function () {
  370. this.showPopup = false;
  371. },
  372. clickMapTool: function (index) {
  373. // this.mapToolIndex = index;
  374. this.showPopup = !this.showPopup;
  375. },
  376. },
  377. watch: {
  378. $route(res) {
  379. this.wpId = res.params.wpId;
  380. if (res.params.wpId) {
  381. this.requestData();
  382. this.renderBtnActiveIndex();
  383. }
  384. },
  385. },
  386. };
  387. </script>
  388. <style lang="less" scoped>
  389. @titleHeight: 40px;
  390. .map-1 {
  391. width: 100%;
  392. height: calc(100vh - 90px);
  393. display: flex;
  394. flex-direction: column;
  395. .btn-group-tabs {
  396. display: flex;
  397. flex-direction: row;
  398. }
  399. .can-click {
  400. cursor: pointer;
  401. }
  402. .syz-img {
  403. width: 65px;
  404. height: 47px;
  405. img {
  406. width: 100%;
  407. height: 100%;
  408. }
  409. }
  410. .panel-title {
  411. width: 100%;
  412. background-color: fade(@darkgray, 40%);
  413. margin-top: 16px;
  414. padding: 6px;
  415. display: flex;
  416. align-items: center;
  417. .panel-title-name {
  418. color: @green;
  419. display: flex;
  420. align-items: center;
  421. line-height: 0;
  422. font-size: 0;
  423. i,
  424. span {
  425. margin: 0 0 0 16px;
  426. line-height: 0;
  427. font-size: 13px;
  428. }
  429. }
  430. .sub-title-item {
  431. display: flex;
  432. align-items: center;
  433. margin-left: 16px;
  434. .sub-title {
  435. font-size: 13px;
  436. margin-left: 6px;
  437. }
  438. .sub-count {
  439. font-size: 13px;
  440. font-weight: 500;
  441. }
  442. img {
  443. height: 31px;
  444. }
  445. }
  446. }
  447. .panel-body {
  448. flex-grow: 1;
  449. background-color: fade(@darkgray, 20%);
  450. padding: 8px;
  451. overflow: auto;
  452. position: relative;
  453. .arcgis-layer {
  454. z-index: 1;
  455. }
  456. .map-popup-panel {
  457. width: 760px;
  458. position: absolute;
  459. left: 71px;
  460. top: 22px;
  461. z-index: 2;
  462. .map-popup-panel-header {
  463. width: 100%;
  464. background: fade(#152221, 90%);
  465. display: flex;
  466. .map-popup-panel-title {
  467. padding: 17px 24px;
  468. font-size: @fontsize-s;
  469. position: relative;
  470. &::before,
  471. &::after {
  472. position: absolute;
  473. width: calc(50% - 6px);
  474. bottom: 0;
  475. border-bottom: 2px solid @green;
  476. }
  477. &::before {
  478. content: "";
  479. left: 0;
  480. }
  481. &::after {
  482. content: "";
  483. right: 0;
  484. }
  485. span {
  486. position: absolute;
  487. width: 11.3px;
  488. height: 11.3px;
  489. border-left: 2px solid @green;
  490. border-top: 2px solid @green;
  491. left: calc(50% - 5.65px);
  492. bottom: -3px;
  493. transform: rotate(45deg);
  494. }
  495. }
  496. .map-popup-panel-date {
  497. flex-grow: 1;
  498. padding: 17px 24px;
  499. font-size: @fontsize-s;
  500. text-align: right;
  501. border-bottom: 2px solid @green;
  502. }
  503. .map-popup-panel-back {
  504. margin-left: auto;
  505. width: 54px;
  506. display: flex;
  507. align-items: center;
  508. justify-content: center;
  509. position: relative;
  510. cursor: pointer;
  511. &::after {
  512. content: "";
  513. position: absolute;
  514. left: 0;
  515. height: 50%;
  516. border-left: 1px solid @gray;
  517. top: 25%;
  518. }
  519. }
  520. }
  521. .map-popup-panel-body {
  522. background: fade(#152221, 75%);
  523. border: 1px solid fade(@darkgray, 40);
  524. border-top: 0px;
  525. .table-form {
  526. .text,
  527. .unit {
  528. min-width: 60px;
  529. font-weight: 400;
  530. }
  531. .unit {
  532. min-width: auto;
  533. }
  534. .value,
  535. .unit {
  536. text-align: left;
  537. }
  538. }
  539. }
  540. }
  541. .map-tool {
  542. position: absolute;
  543. right: 22px;
  544. top: 22px;
  545. z-index: 2;
  546. background: #152221af;
  547. padding: 18px 14px;
  548. .m-btn {
  549. width: 124px;
  550. height: 44px;
  551. background: #152221bf;
  552. border: 1px solid #152221bf;
  553. color: #ffffff;
  554. transition: all 0.3s;
  555. display: flex;
  556. align-items: center;
  557. justify-content: center;
  558. cursor: pointer;
  559. &:hover,
  560. &.active {
  561. background: #05bb4c33;
  562. border: 1px solid #05bb4c;
  563. color: #05bb4c;
  564. }
  565. + .m-btn {
  566. margin-top: 16px;
  567. }
  568. }
  569. }
  570. }
  571. }
  572. </style>