Map.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. <template>
  2. <div class="map-1">
  3. <div class="btn-group-tabs">
  4. <BtnGroup2
  5. :btnGroups="btnGroups"
  6. :rowIndex="0"
  7. :index="1"
  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 white">256</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">56</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">256</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">3</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">5</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">20</span>
  46. </div>
  47. <div class="sub-title-item">
  48. <img src="../../../assets/map/fan/white.png" />
  49. <span class="sub-title white">受累台数</span>
  50. <span class="sub-count font-num white">256</span>
  51. </div>
  52. <div class="sub-title-item">
  53. <img src="../../../assets/map/fan/black.png" />
  54. <span class="sub-title gray">离线台数</span>
  55. <span class="sub-count font-num gray">2</span>
  56. </div>
  57. </div>
  58. </div>
  59. <div class="panel-body">
  60. <arcgis class="arcgis-layer" @when="when" ref="arcgis" :data="arcgisData" @clickMap="clickMap"></arcgis>
  61. <div class="map-popup-panel" v-show="showPopup">
  62. <div class="map-popup-panel-header">
  63. <div class="map-popup-panel-title green">
  64. 某某风电场总貌<span></span>
  65. </div>
  66. <div class="map-popup-panel-date gray">2020年5月10日</div>
  67. <div class="map-popup-panel-back" @click="popupBack">
  68. <span class="svg-icon svg-icon-white svg-icon-sm">
  69. <SvgIcon svgid="svg-arrow-dpwn-1"></SvgIcon>
  70. </span>
  71. </div>
  72. </div>
  73. <div class="map-popup-panel-body">
  74. <table class="table-form">
  75. <tr>
  76. <td class="text white">装机容量</td>
  77. <td class="value green">49.5</td>
  78. <td class="unit white">M/W</td>
  79. <td class="text white">装机台数</td>
  80. <td class="value green">33</td>
  81. <td class="unit white">台</td>
  82. <td class="text white">风机型号</td>
  83. <td class="value green" colspan="2">UP82/77-1500</td>
  84. </tr>
  85. <tr>
  86. <td class="text white">实时功率</td>
  87. <td class="value green">50.81</td>
  88. <td class="unit white">M/W</td>
  89. <td class="text white">平均风速</td>
  90. <td class="value green">14.66</td>
  91. <td class="unit white">m/s</td>
  92. <td class="text white">运行台数</td>
  93. <td class="value green">33</td>
  94. <td class="unit white">台</td>
  95. </tr>
  96. <tr>
  97. <td class="text white">待机台数</td>
  98. <td class="value green">0</td>
  99. <td class="unit white">台</td>
  100. <td class="text white">故障台数</td>
  101. <td class="value green">0</td>
  102. <td class="unit white">台</td>
  103. <td class="text white">维护台数</td>
  104. <td class="value green">0</td>
  105. <td class="unit white">台</td>
  106. </tr>
  107. <tr>
  108. <td class="text white">离线台数</td>
  109. <td class="value green">0</td>
  110. <td class="unit white">台</td>
  111. <td class="text white"></td>
  112. <td class="value green"></td>
  113. <td class="unit white"></td>
  114. <td class="text white"></td>
  115. <td class="value green"></td>
  116. <td class="unit white"></td>
  117. </tr>
  118. <tr>
  119. <td class="text white">日发电量</td>
  120. <td class="value green">49.5</td>
  121. <td class="unit white">万kWh</td>
  122. <td class="text white">月发电量</td>
  123. <td class="value green">49.5</td>
  124. <td class="unit white">万kWh</td>
  125. <td class="text white"></td>
  126. <td class="value green"></td>
  127. <td class="unit white"></td>
  128. </tr>
  129. <tr>
  130. <td class="text white">年发电量</td>
  131. <td class="value green">49.5</td>
  132. <td class="unit white">万kWh</td>
  133. <td class="text white">总发电量</td>
  134. <td class="value green">49.5</td>
  135. <td class="unit white">万kWh</td>
  136. <td class="text white"></td>
  137. <td class="value green"></td>
  138. <td class="unit white"></td>
  139. </tr>
  140. </table>
  141. </div>
  142. </div>
  143. <div class="map-tool">
  144. <div class="m-btn" :class="{'active': mapToolIndex == 0}" @click="clickMapTool(0)">风机排布</div>
  145. <div class="m-btn" :class="{'active': mapToolIndex == 1}" @click="clickMapTool(1)">巡检路线</div>
  146. </div>
  147. </div>
  148. </div>
  149. </template>
  150. <script>
  151. import BtnGroup2 from "@com/coms/btn/btn-group-double.vue";
  152. import SvgIcon from "@com/coms/icon/svg-icon.vue";
  153. import arcgis from "@com/arcgis/arcgis.vue";
  154. import dataService from "@/helper/data.js";
  155. export default {
  156. // 名称
  157. name: "Map",
  158. // 使用组件
  159. components: {
  160. BtnGroup2,
  161. SvgIcon,
  162. arcgis,
  163. },
  164. // 数据
  165. data() {
  166. return {
  167. btnGroups: [
  168. {
  169. icon: "svg-wind-site",
  170. btns: [
  171. {
  172. text: "某某风场",
  173. code: "mmfdc1",
  174. },
  175. {
  176. text: "某某风场",
  177. code: "mhsfc",
  178. },
  179. {
  180. text: "某某风场",
  181. code: "mmfdc2",
  182. },
  183. {
  184. text: "某某风场",
  185. code: "mmfdc3",
  186. },
  187. {
  188. text: "某某风场",
  189. code: "mmfdc4",
  190. },
  191. ],
  192. },
  193. {
  194. icon: "svg-photovoltaic",
  195. btns: [
  196. {
  197. text: "某某风场",
  198. code: "mmgf1",
  199. },
  200. {
  201. text: "某某风场",
  202. code: "mmgf2",
  203. },
  204. {
  205. text: "某某风场",
  206. code: "mmgf3",
  207. },
  208. {
  209. text: "某某风场",
  210. code: "mmgf4",
  211. },
  212. ],
  213. },
  214. ],
  215. arcgisData: {
  216. mode: "2D", // 模式 2D 3D
  217. title: "宁夏地图", // 标题
  218. center: [107.0391975, 37.31469028], // 初始中心点 106.230909, 38.487193
  219. height: 654, // 3D地图初始相机高度
  220. tilt: 65, // 俯视角
  221. scale: 30000,
  222. rotation: -45,
  223. ox: -600,
  224. oy: -50,
  225. },
  226. showPopup: true,
  227. mapToolIndex: 0,
  228. };
  229. },
  230. // 函数
  231. methods: {
  232. when: function () {
  233. let jsonObj = dataService.get("arcgis-nx-fc1");
  234. let data = [{id: "MG13", state: "yx"},{id: "MG12", state: "xd"},{id: "MG34", state: "gz"},{id: "MG39", state: "jc"},
  235. {id: "MG02", state: "lx"}, {id: "MG19", state: "sl"}]
  236. jsonObj.forEach(item => {
  237. let obj = data.find(t => t.id == item.attributes.code);
  238. if (obj) {
  239. item.attributes.state = obj.state;
  240. } else {
  241. item.attributes.state = "dj";
  242. }
  243. });
  244. let lineJsonObj = dataService.get("arcgis-nx-fc1-line");
  245. this.$refs.arcgis.addFanByJson(jsonObj, lineJsonObj);
  246. },
  247. clickMap: function (info) {
  248. console.log(info)
  249. this.showPopup = true;
  250. },
  251. popupBack: function () {
  252. this.showPopup = false;
  253. },
  254. clickMapTool: function (index) {
  255. this.mapToolIndex = index;
  256. },
  257. },
  258. // 生命周期钩子
  259. beforeCreate() {
  260. // 创建前
  261. },
  262. created() {
  263. // 创建后
  264. },
  265. beforeMount() {
  266. // 渲染前
  267. },
  268. mounted() {
  269. // 渲染后
  270. },
  271. beforeUpdate() {
  272. // 数据更新前
  273. },
  274. updated() {
  275. // 数据更新后
  276. },
  277. };
  278. </script>
  279. <style lang="less" scoped>
  280. @titleHeight: 40px;
  281. .map-1 {
  282. width: 100%;
  283. height: calc(100vh - 90px);
  284. display: flex;
  285. flex-direction: column;
  286. .btn-group-tabs {
  287. display: flex;
  288. flex-direction: row;
  289. }
  290. .panel-title {
  291. width: 100%;
  292. background-color: fade(@darkgray, 40%);
  293. margin-top: 16px;
  294. padding: 6px;
  295. display: flex;
  296. align-items: center;
  297. .panel-title-name {
  298. color: @green;
  299. display: flex;
  300. align-items: center;
  301. line-height: 0;
  302. font-size: 0;
  303. i,
  304. span {
  305. margin: 0 0 0 16px;
  306. line-height: 0;
  307. font-size: 13px;
  308. }
  309. }
  310. .sub-title-item {
  311. display: flex;
  312. align-items: center;
  313. margin-left: 16px;
  314. .sub-title {
  315. font-size: 13px;
  316. margin-left: 6px;
  317. }
  318. .sub-count {
  319. font-size: 13px;
  320. font-weight: 500;
  321. }
  322. img {
  323. height: 31px;
  324. }
  325. }
  326. }
  327. .panel-body {
  328. flex-grow: 1;
  329. background-color: fade(@darkgray, 20%);
  330. padding: 8px;
  331. overflow: auto;
  332. position: relative;
  333. .arcgis-layer {
  334. z-index: 1;
  335. }
  336. .map-popup-panel {
  337. width: 760px;
  338. position: absolute;
  339. left: 71px;
  340. top: 22px;
  341. z-index: 2;
  342. .map-popup-panel-header {
  343. width: 100%;
  344. background: fade(#152221, 90%);
  345. display: flex;
  346. .map-popup-panel-title {
  347. padding: 17px 24px;
  348. font-size: @fontsize-s;
  349. position: relative;
  350. &::before,
  351. &::after {
  352. position: absolute;
  353. width: calc(50% - 6px);
  354. bottom: 0;
  355. border-bottom: 2px solid @green;
  356. }
  357. &::before {
  358. content: "";
  359. left: 0;
  360. }
  361. &::after {
  362. content: "";
  363. right: 0;
  364. }
  365. span {
  366. position: absolute;
  367. width: 11.3px;
  368. height: 11.3px;
  369. border-left: 2px solid @green;
  370. border-top: 2px solid @green;
  371. left: calc(50% - 5.65px);
  372. bottom: -3px;
  373. transform: rotate(45deg);
  374. }
  375. }
  376. .map-popup-panel-date {
  377. flex-grow: 1;
  378. padding: 17px 24px;
  379. font-size: @fontsize-s;
  380. text-align: right;
  381. border-bottom: 2px solid @green;
  382. }
  383. .map-popup-panel-back {
  384. margin-left: auto;
  385. width: 54px;
  386. display: flex;
  387. align-items: center;
  388. justify-content: center;
  389. position: relative;
  390. cursor: pointer;
  391. &::after {
  392. content: "";
  393. position: absolute;
  394. left: 0;
  395. height: 50%;
  396. border-left: 1px solid @gray;
  397. top: 25%;
  398. }
  399. }
  400. }
  401. .map-popup-panel-body {
  402. background: fade(#152221, 75%);
  403. border: 1px solid fade(@darkgray, 40);
  404. border-top: 0px;
  405. .table-form {
  406. .text,
  407. .unit {
  408. font-weight: 400;
  409. }
  410. .unit {
  411. min-width: auto;
  412. }
  413. .value,
  414. .unit {
  415. text-align: left;
  416. }
  417. }
  418. }
  419. }
  420. .map-tool {
  421. position: absolute;
  422. right: 22px;
  423. top: 22px;
  424. z-index: 2;
  425. background: #152221AF;
  426. padding: 18px 14px;
  427. .m-btn {
  428. width: 124px;
  429. height: 44px;
  430. background: #152221BF;
  431. border: 1px solid #152221BF;
  432. color: #FFFFFF;
  433. transition: all .3s;
  434. display: flex;
  435. align-items: center;
  436. justify-content: center;
  437. cursor: pointer;
  438. &:hover,
  439. &.active {
  440. background: #05BB4C33;
  441. border: 1px solid #05BB4C;
  442. color: #05BB4C;
  443. }
  444. +.m-btn {
  445. margin-top: 16px;
  446. }
  447. }
  448. }
  449. }
  450. }
  451. </style>