components_estateMonitoringPlatform_vue.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. <!--********************************************************************
  2. * Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  3. *********************************************************************-->
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <meta charset="UTF-8" />
  8. <title data-i18n="resources.title_componentsEstateMonitoringPlatform_Vue"></title>
  9. <script type="text/javascript" include="vue" src="../js/include-web.js"></script>
  10. <script
  11. include="echarts-vue,iclient-mapboxgl-vue,mapbox-gl-enhance,ant-design-vue"
  12. src="../../dist/mapboxgl/include-mapboxgl.js"
  13. ></script>
  14. <script type="text/javascript" src="../data/estateMonitoringPlatformData.js"></script>
  15. <style>
  16. body {
  17. margin: 0px;
  18. background: #fff;
  19. }
  20. #main {
  21. margin: 0 auto;
  22. width: 100%;
  23. height: 100vh;
  24. overflow: hidden;
  25. box-sizing: border-box;
  26. background: #000;
  27. position: relative;
  28. }
  29. @media screen and (max-width: 992px) {
  30. #main {
  31. overflow: auto;
  32. }
  33. }
  34. </style>
  35. </head>
  36. <body>
  37. <div id="main">
  38. <a-row id="map-row">
  39. <a-col v-if="!showMap" :md="12" id="map-col">
  40. <div class="map-holder">
  41. <sm-web-map :map-options="mapOptions">
  42. <sm-geojson-layer v-if="!showMap" :data="data" :layer-style="layerStyle"></sm-geojson-layer>
  43. </sm-web-map>
  44. </div>
  45. </a-col>
  46. <a-col :md="12" v-if="!showMap">
  47. <sm-text
  48. :font-style="{fontSize: '2.4rem', lineHeight: '2.6rem'}"
  49. title="房产项目可视化监控平台"
  50. ></sm-text>
  51. <div class="indicator-holder">
  52. <sm-indicator title="土地出让金" unit="亿元" num="12320"> </sm-indicator>
  53. <sm-indicator title="回款金额" unit="元" num="12320"> </sm-indicator>
  54. <sm-indicator title="净利润" unit="元" num="12320"> </sm-indicator>
  55. </div>
  56. </a-col>
  57. <a-col :md="6">
  58. <sm-time-text timeType="date"> </sm-time-text>
  59. <div class="year-plan-wrap">
  60. <sm-text :font-style="{lineHeight: '1.67vw'}" title="年度计划"></sm-text>
  61. <div class="progress-holder">
  62. <div class="progress-item">
  63. <sm-progress type="circle" :percent="55" :stroke-width="8"> </sm-progress>
  64. <sm-text title="销售金额"></sm-text>
  65. </div>
  66. <div class="progress-item">
  67. <sm-progress type="circle" :stroke-width="8" :percent="35"> </sm-progress>
  68. <sm-text title="销售回款"></sm-text>
  69. </div>
  70. <div class="progress-item">
  71. <sm-progress type="circle" :stroke-width="8" :percent="60"> </sm-progress>
  72. <sm-text title="营业收入"></sm-text>
  73. </div>
  74. <div class="progress-item">
  75. <sm-progress type="circle" :stroke-width="8" :percent="40"></sm-progress>
  76. <sm-text title="净利润"></sm-text>
  77. </div>
  78. </div>
  79. </div>
  80. </a-col>
  81. <a-col :md="12" v-if="showMap">
  82. <sm-text
  83. :font-style="{fontSize: '2.4rem', lineHeight: '2.6rem'}"
  84. title="房产项目可视化监控平台"
  85. ></sm-text>
  86. <div class="indicator-holder">
  87. <sm-indicator title="土地出让金" unit="亿元" num="12320"> </sm-indicator>
  88. <sm-indicator title="回款金额" unit="元" num="12320"> </sm-indicator>
  89. <sm-indicator title="净利润" unit="元" num="12320"> </sm-indicator>
  90. </div>
  91. </a-col>
  92. <a-col :md="6">
  93. <sm-text title="常规项目指标"></sm-text>
  94. <div class="normal-index-progress-holder">
  95. <div class="progress-item">
  96. <sm-progress type="circle" :percent="20" :stroke-width="10"> </sm-progress>
  97. <sm-text title="施工类型"></sm-text>
  98. </div>
  99. <div class="progress-item">
  100. <sm-progress type="circle" :percent="60" :stroke-width="10"> </sm-progress>
  101. <sm-text title="施工总进度"></sm-text>
  102. </div>
  103. </div>
  104. </a-col>
  105. </a-row>
  106. <a-row>
  107. <a-col :md="6">
  108. <div class="chart-item">
  109. <sm-text title="销售金额统计"></sm-text>
  110. <sm-chart icon-class="" :options="saleAmountOption"> </sm-chart>
  111. </div>
  112. <div class="chart-item">
  113. <sm-text title="销售回款趋势"></sm-text>
  114. <sm-chart icon-class="" :options="saleReturnOption"> </sm-chart>
  115. </div>
  116. </a-col>
  117. <a-col v-if="showMap" :md="12" id="map-col">
  118. <div class="map-holder">
  119. <sm-web-map :map-options="mapOptions">
  120. <sm-geojson-layer v-if="showMap" :data="data" :layer-style="layerStyle"></sm-geojson-layer>
  121. </sm-web-map>
  122. </div>
  123. </a-col>
  124. <a-col :md="6">
  125. <div class="chart-item">
  126. <sm-text title="库存指标"></sm-text>
  127. <sm-chart icon-class="" :options="stockIndexOption"> </sm-chart>
  128. </div>
  129. <div class="chart-item">
  130. <sm-text title="项目价值指标"></sm-text>
  131. <sm-progress type="circle" :percent="80" :stroke-width="10"> </sm-progress>
  132. </div>
  133. </a-col>
  134. </a-row>
  135. <a-row>
  136. <a-col :md="6">
  137. <div class="chart-item">
  138. <sm-text title="项目成本表"></sm-text>
  139. <sm-chart icon-class="" :options="projectCostOption"> </sm-chart>
  140. </div>
  141. </a-col>
  142. <a-col :md="12">
  143. <div class="chart-holder">
  144. <div class="chart-item">
  145. <sm-text title="营业收入情况"></sm-text>
  146. <sm-chart icon-class="" :options="revenueOption"> </sm-chart>
  147. </div>
  148. <div class="chart-item">
  149. <sm-text title="投资盈利情况"></sm-text>
  150. <sm-chart icon-class="" :options="investProfitOption"> </sm-chart>
  151. </div>
  152. </div>
  153. </a-col>
  154. <a-col :md="6">
  155. <div class="chart-item">
  156. <sm-text title="库存情况"></sm-text>
  157. <sm-chart icon-class="" :options="stockSituationOption"> </sm-chart>
  158. </div>
  159. </a-col>
  160. </a-row>
  161. <a-button @click="changeTheme" class="theme-btn">{{ resources.btn_switchTheme }}</a-button>
  162. </div>
  163. <script>
  164. //本示例数据纯属虚构
  165. new Vue({
  166. el: '#main',
  167. data() {
  168. var mergeData = Object.assign(
  169. {
  170. theme: 'custom',
  171. mapOptions: {
  172. pitch: 60,
  173. container: 'map', // container id
  174. style: {
  175. version: 8,
  176. sources: {},
  177. layers: []
  178. },
  179. center: [116.47, 39.92], // starting position
  180. zoom: 16 // starting zoom
  181. },
  182. data: '../data/buildings.json',
  183. layerStyle: {
  184. paint: {
  185. 'fill-extrusion-color': [
  186. 'case',
  187. ['<', ['get', 'height'], 2],
  188. '#fbb03b',
  189. ['<', ['get', 'height'], 4],
  190. '#223b53',
  191. ['<', ['get', 'height'], 8],
  192. '#15D1F2',
  193. ['<', ['get', 'height'], 16],
  194. '#15D1F2',
  195. '#3bb2d0'
  196. ],
  197. 'fill-extrusion-height': ['*', ['get', 'height'], 5],
  198. 'fill-extrusion-opacity': 0.6
  199. }
  200. },
  201. colorGroup: ['#15D1F2', '#499BFF', '#2C61FF', '#243BCC', '#67A9FF']
  202. },
  203. estatePlatformDatas
  204. );
  205. return { ...mergeData, showMap: false };
  206. },
  207. beforeMount() {
  208. let screenWidth = document.body.clientWidth;
  209. if (screenWidth <= 540) {
  210. this.showMap = false;
  211. } else {
  212. this.showMap = true;
  213. }
  214. SuperMap.Components.setTheme({
  215. background: 'transparent',
  216. textColor: '#fff',
  217. colorGroup: this.colorGroup
  218. });
  219. },
  220. methods: {
  221. changeTheme() {
  222. this.theme = this.theme === 'custom' ? 'dark' : 'custom';
  223. var themeInfo = {
  224. dark: {
  225. typeInfo: 'dark',
  226. themeColor: ['#dd6b66', ['<', ['get', 'height'], 16], '#dd6b66', '#3bb2d0']
  227. },
  228. custom: {
  229. typeInfo: {
  230. background: 'transparent',
  231. textColor: '#fff',
  232. colorGroup: this.colorGroup
  233. },
  234. themeColor: ['#15D1F2', ['<', ['get', 'height'], 16], '#15D1F2', '#3bb2d0']
  235. }
  236. };
  237. this.layerStyle.paint['fill-extrusion-color'] = [
  238. 'case',
  239. ['<', ['get', 'height'], 2],
  240. '#fbb03b',
  241. ['<', ['get', 'height'], 4],
  242. '#223b53',
  243. ['<', ['get', 'height'], 8]
  244. ].concat(themeInfo[this.theme].themeColor);
  245. SuperMap.Components.setTheme(themeInfo[this.theme].typeInfo);
  246. }
  247. }
  248. });
  249. </script>
  250. <style>
  251. html {
  252. font-size: 10px;
  253. }
  254. #main .sm-component-text {
  255. display: block;
  256. font-weight: bold;
  257. text-align: center;
  258. font-size: 1.4rem;
  259. line-height: 1.4rem;
  260. }
  261. .ant-row .sm-component-time-text {
  262. display: block;
  263. }
  264. .progress-holder .progress-item {
  265. width: 23%;
  266. display: inline-block;
  267. vertical-align: top;
  268. }
  269. .progress-holder .progress-item .sm-component-text,
  270. .normal-index-progress-holder .progress-item .sm-component-text {
  271. margin-top: 1.07vh;
  272. }
  273. .progress-holder .progress-item .sm-component-progress {
  274. height: 11.34vh;
  275. }
  276. .indicator-holder {
  277. padding: 0 1.2vw;
  278. margin-top: 2vh;
  279. display: flex;
  280. justify-content: space-around;
  281. }
  282. .sm-component-indicator__content {
  283. align-items: center;
  284. }
  285. .indicator-holder .sm-component-indicator {
  286. margin-right: 1.56vw;
  287. }
  288. .indicator-holder .sm-component-indicator .sm-component-indicator__title {
  289. font-size: 1.6rem;
  290. }
  291. .indicator-holder .sm-component-indicator .sm-component-indicator__num {
  292. font-size: 1.8rem;
  293. text-indent: 0.26vw;
  294. }
  295. .indicator-holder .sm-component-indicator .sm-component-indicator__unit {
  296. font-size: 1.3rem;
  297. }
  298. .normal-index-progress-holder {
  299. margin: 1.07vh auto 0;
  300. }
  301. .normal-index-progress-holder .progress-item {
  302. width: 48%;
  303. display: inline-block;
  304. }
  305. .normal-index-progress-holder .progress-item .sm-component-progress,
  306. .chart-item .sm-component-progress {
  307. height: 13.9vh;
  308. }
  309. .chart-item .sm-component-text {
  310. margin: 0.6vh 0;
  311. }
  312. .ant-row .chart-item .sm-component-chart {
  313. height: 20.86vh;
  314. }
  315. .ant-row .chart-item .sm-component-collapse-card__content {
  316. width: 100%;
  317. height: 100%;
  318. }
  319. .map-holder {
  320. height: 50vh;
  321. padding: 0 0.78vw;
  322. }
  323. .chart-holder .chart-item {
  324. width: 49%;
  325. display: inline-block;
  326. }
  327. .theme-btn {
  328. position: fixed;
  329. left: 15px;
  330. bottom: 15px;
  331. }
  332. @media (max-width: 540px) {
  333. html {
  334. font-size: 10px;
  335. }
  336. .map-holder {
  337. height: 90vh;
  338. }
  339. .ant-row .chart-item .sm-component-chart {
  340. height: 25.86vh;
  341. }
  342. }
  343. @media (min-width: 1200px) {
  344. html {
  345. font-size: 12px;
  346. }
  347. }
  348. </style>
  349. </body>
  350. </html>