Map.vue 11 KB

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