Map1.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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 @when="when" ref="arcgis" :data="arcgisData" @clickMap="clickMap">
  61. <template v-slot:test>
  62. <div class="panel-box">
  63. <!-- <div class="panel-item" v-for="index of 80" :key="index"></div> -->
  64. <img :src="tempImg" style="width: 800px; height: 700px;">
  65. </div>
  66. </template>
  67. </arcgis>
  68. </div>
  69. </div>
  70. </template>
  71. <script>
  72. import BtnGroup2 from "@com/coms/btn/btn-group-double.vue";
  73. import SvgIcon from "@com/coms/icon/svg-icon.vue";
  74. import arcgis from "@com/arcgis/arcgis.vue";
  75. export default {
  76. // 名称
  77. name: "Map1",
  78. // 使用组件
  79. components: {
  80. BtnGroup2,
  81. SvgIcon,
  82. arcgis,
  83. },
  84. // 数据
  85. data() {
  86. return {
  87. btnGroups: [
  88. {
  89. icon: "svg-wind-site",
  90. btns: [
  91. {
  92. text: "某某风场",
  93. code: "mmfdc1",
  94. },
  95. {
  96. text: "某某风场",
  97. code: "mhsfc",
  98. },
  99. {
  100. text: "某某风场",
  101. code: "mmfdc2",
  102. },
  103. {
  104. text: "某某风场",
  105. code: "mmfdc3",
  106. },
  107. {
  108. text: "某某风场",
  109. code: "mmfdc4",
  110. },
  111. ],
  112. },
  113. {
  114. icon: "svg-photovoltaic",
  115. btns: [
  116. {
  117. text: "某某风场",
  118. code: "mmgf1",
  119. },
  120. {
  121. text: "某某风场",
  122. code: "mmgf2",
  123. },
  124. {
  125. text: "某某风场",
  126. code: "mmgf3",
  127. },
  128. {
  129. text: "某某风场",
  130. code: "mmgf4",
  131. },
  132. ],
  133. },
  134. ],
  135. arcgisData: {
  136. mode: "2D", // 模式 2D 3D
  137. title: "宁夏地图", // 标题
  138. center: [106.60768412800003, 37.806672373000006], // 初始中心点
  139. height: 654, // 3D地图初始相机高度
  140. tilt: 65, // 俯视角
  141. scale: 15000,
  142. },
  143. tempImg: require("@assets/temp1.png"),
  144. };
  145. },
  146. // 函数
  147. methods: {
  148. when: function () {
  149. // this.$refs.arcgis.addImagePoint([106.60768412800003, 37.806672373000006], "@assets/temp1.png", "160px", "140px");
  150. this.$refs.arcgis.addHtmlPoint([106.60768412800003, 37.806672373000006], "test", 400, 350);
  151. },
  152. clickMap: function (info) {
  153. console.log(info)
  154. },
  155. },
  156. // 生命周期钩子
  157. beforeCreate() {
  158. // 创建前
  159. },
  160. created() {
  161. // 创建后
  162. },
  163. beforeMount() {
  164. // 渲染前
  165. },
  166. mounted() {
  167. // 渲染后
  168. },
  169. beforeUpdate() {
  170. // 数据更新前
  171. },
  172. updated() {
  173. // 数据更新后
  174. },
  175. };
  176. </script>
  177. <style lang="less" scoped>
  178. @titleHeight: 3.704vh;
  179. .map-1 {
  180. width: 100%;
  181. height: calc(100vh - 90px);
  182. display: flex;
  183. flex-direction: column;
  184. .btn-group-tabs {
  185. display: flex;
  186. flex-direction: row;
  187. }
  188. .panel-title {
  189. width: 100%;
  190. background-color: fade(@darkgray, 40%);
  191. margin-top: 1.481vh;
  192. padding: 6px;
  193. display: flex;
  194. align-items: center;
  195. .panel-title-name {
  196. color: @green;
  197. display: flex;
  198. align-items: center;
  199. line-height: 0;
  200. font-size: 0;
  201. i,
  202. span {
  203. margin: 0 0 0 1.481vh;
  204. line-height: 0;
  205. font-size: 13px;
  206. }
  207. }
  208. .sub-title-item {
  209. display: flex;
  210. align-items: center;
  211. margin-left: 16px;
  212. .sub-title {
  213. font-size: 13px;
  214. margin-left: 6px;
  215. }
  216. .sub-count {
  217. font-size: 13px;
  218. font-weight: 500;
  219. }
  220. img {
  221. height: 31px;
  222. }
  223. }
  224. }
  225. .panel-body {
  226. flex-grow: 1;
  227. background-color: fade(@darkgray, 20%);
  228. padding: 0.741vh;
  229. overflow: auto;
  230. position: relative;
  231. .map-popup-panel {
  232. width: 679px;
  233. position: absolute;
  234. left: 71px;
  235. top: 22px;
  236. .map-popup-panel-header {
  237. width: 100%;
  238. background: fade(#152221, 90%);
  239. display: flex;
  240. .map-popup-panel-title {
  241. padding: 17px 24px;
  242. font-size: @fontsize-s;
  243. position: relative;
  244. &::before,
  245. &::after {
  246. position: absolute;
  247. width: calc(50% - 6px);
  248. bottom: 0;
  249. border-bottom: 2px solid @green;
  250. }
  251. &::before {
  252. content: "";
  253. left: 0;
  254. }
  255. &::after {
  256. content: "";
  257. right: 0;
  258. }
  259. span {
  260. position: absolute;
  261. width: 11.3px;
  262. height: 11.3px;
  263. border-left: 2px solid @green;
  264. border-top: 2px solid @green;
  265. left: calc(50% - 5.65px);
  266. bottom: -3px;
  267. transform: rotate(45deg);
  268. }
  269. }
  270. .map-popup-panel-date {
  271. flex-grow: 1;
  272. padding: 17px 24px;
  273. font-size: @fontsize-s;
  274. text-align: right;
  275. border-bottom: 2px solid @green;
  276. }
  277. .map-popup-panel-back {
  278. margin-left: auto;
  279. width: 54px;
  280. display: flex;
  281. align-items: center;
  282. justify-content: center;
  283. position: relative;
  284. cursor: pointer;
  285. &::after {
  286. content: "";
  287. position: absolute;
  288. left: 0;
  289. height: 50%;
  290. border-left: 1px solid @gray;
  291. top: 25%;
  292. }
  293. }
  294. }
  295. .map-popup-panel-body {
  296. background: fade(#152221, 75%);
  297. border: 1px solid fade(@darkgray, 40);
  298. border-top: 0px;
  299. .table-form {
  300. .text,
  301. .unit {
  302. font-weight: 400;
  303. }
  304. .unit {
  305. min-width: auto;
  306. }
  307. .value,
  308. .unit {
  309. text-align: left;
  310. }
  311. }
  312. }
  313. }
  314. }
  315. .panel-box {
  316. width: 800px;
  317. display: flex;
  318. flex-wrap: wrap;
  319. .panel-item {
  320. width: 100px;
  321. height: 100px;
  322. padding: 20px;
  323. background: #536268B8;
  324. margin-top: -20px;
  325. margin-left: -20px;
  326. }
  327. }
  328. }
  329. </style>