components_demo_vue.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  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_componentsDemo_Vue"></title>
  9. <script type="text/javascript" include="vue" src="../js/include-web.js"></script>
  10. <script
  11. include="echarts-vue,ant-design-vue,iclient-mapboxgl-vue,mapbox-gl-enhance"
  12. src="../../dist/mapboxgl/include-mapboxgl.js"
  13. ></script>
  14. <style>
  15. #main {
  16. margin: 0 auto;
  17. width: 100%;
  18. height: 100vh;
  19. overflow: hidden;
  20. padding-left: 2.08vw;
  21. box-sizing: border-box;
  22. }
  23. @media screen and (max-width: 992px) {
  24. #main {
  25. overflow: auto;
  26. }
  27. }
  28. @media screen and (max-height: 640px) {
  29. #main {
  30. overflow: auto;
  31. }
  32. }
  33. /* #contentText {
  34. position: absolute;
  35. width: 490px;
  36. height: 130px;
  37. top: 180px;
  38. left: 60px;
  39. } */
  40. </style>
  41. </head>
  42. <body style="margin: 0;background: #fff;">
  43. <div id="main">
  44. <a-row>
  45. <a-col :md="8" class="left-container">
  46. <a-row v-if="!showMap">
  47. <div class="map-wrap">
  48. <sm-web-map server-url="https://www.supermapol.com" map-id="2068226677">
  49. <sm-zoom></sm-zoom>
  50. <sm-scale position="bottom-left"></sm-scale>
  51. </sm-web-map>
  52. </div>
  53. </a-row>
  54. <a-row class="title-text-wrap">
  55. <sm-text
  56. id="titleText"
  57. :font-style="titleFontStyle"
  58. text-color="#5AB1EF"
  59. title="国土空间规划实时监测评估预警"
  60. ></sm-text>
  61. </a-row>
  62. <a-row class="time-text-wrap">
  63. <sm-time-text
  64. id="timeText"
  65. :font-style='{"fontFamily": "微软雅黑"}'
  66. text-color="#B7B2B2"
  67. time-type="date+second+week"
  68. ></sm-time-text>
  69. </a-row>
  70. <a-row class="monitor-wrap">
  71. <a-row class="block-title">
  72. <sm-text id="monitoringText" :font-style="categoryFontStyle" title="监测情况"></sm-text>
  73. </a-row>
  74. <a-row class="monitor-text">
  75. <sm-text
  76. id="contentText"
  77. :font-style='{"fontFamily": "微软雅黑","fontWeight": "bolder","textAlign": "left"}'
  78. text-color="#807B7B"
  79. title="截止2018年底,国土空间整体开发强度为2.5%,三类空间比例为50%:30%:20%。耕地保有量为300万亩,城镇建设用地规模为300km²,森林覆盖率达到64%,水功能水质达标率为80%,生态环境治理良好。"
  80. >
  81. </sm-text>
  82. </a-row>
  83. </a-row>
  84. <a-row class="control-wrap">
  85. <a-row class="block-title">
  86. <sm-text id="sanxianText" :font-style="categoryFontStyle" title="三线管控"></sm-text>
  87. </a-row>
  88. <a-row type="flex" justify="space-around">
  89. <a-col :md="8" :sm="6" :xs="6" class="control-title">
  90. <sm-text id="ecologyText" :font-style="textFontStyle" title="生态空间"></sm-text>
  91. <sm-liquid-fill
  92. id="liquidFill1"
  93. :value="0.32"
  94. :font-size="18"
  95. :wave-count="2"
  96. :wave-animation="true"
  97. wave-color="#2EC7C9"
  98. >
  99. </sm-liquid-fill>
  100. </a-col>
  101. <a-col :md="8" :sm="6" :xs="6" class="control-title">
  102. <sm-text id="townText" :font-style="textFontStyle" title="城镇空间"></sm-text>
  103. <sm-liquid-fill
  104. id="liquidFill2"
  105. :value="0.48"
  106. :font-size="18"
  107. :wave-count="2"
  108. :wave-animation="true"
  109. wave-color="#ffb980"
  110. >
  111. </sm-liquid-fill>
  112. </a-col>
  113. <a-col :md="8" :sm="6" :xs="6" class="control-title">
  114. <sm-text id="farmText" :font-style="textFontStyle" title="农业空间"></sm-text>
  115. <sm-liquid-fill
  116. id="liquidFill3"
  117. :value="0.17"
  118. :font-size="18"
  119. :wave-count="3"
  120. :wave-animation="true"
  121. wave-color="#d87a80"
  122. >
  123. </sm-liquid-fill>
  124. </a-col>
  125. </a-row>
  126. </a-row>
  127. <a-row class="resource-wrap">
  128. <a-row class="block-title">
  129. <sm-text id="naturalText" :font-style="categoryFontStyle" title="自然资源"></sm-text>
  130. </a-row>
  131. <a-row type="flex" justify="end" class="resource-year">
  132. <a-col :md="9" :sm="8" :xs="8">
  133. <sm-text id="yearText1" :font-style="textFontStyle" title="2017年"></sm-text>
  134. </a-col>
  135. <a-col :md="9" :sm="8" :xs="8">
  136. <sm-text id="yearText2" :font-style="textFontStyle" title="2018年"></sm-text>
  137. </a-col>
  138. </a-row>
  139. <a-row type="flex" align="middle" class="resource-item">
  140. <a-col :md="6" :sm="8" :xs="8">
  141. <sm-indicator
  142. id="woodlandIndicator"
  143. title="林地保有量"
  144. unit="km²"
  145. num="300"
  146. font-size="26"
  147. ></sm-indicator>
  148. </a-col>
  149. <a-col :md="18" :sm="16" :xs="16" class="resource-chart">
  150. <a-col :md="12" :sm="12" :xs="12">
  151. <div class="sm-progress-wrap">
  152. <sm-progress
  153. id="progress5"
  154. size="100"
  155. stroke-color="#b6a2de"
  156. percent="30"
  157. stroke-width="6"
  158. type="circle"
  159. >
  160. </sm-progress>
  161. </div>
  162. </a-col>
  163. <a-col :md="12" :sm="12" :xs="12">
  164. <div class="sm-progress-wrap">
  165. <sm-progress
  166. id="progress6"
  167. size="100"
  168. stroke-color="#5ab1ef"
  169. percent="50"
  170. stroke-width="6"
  171. type="circle"
  172. >
  173. </sm-progress>
  174. </div>
  175. </a-col>
  176. </a-col>
  177. </a-row>
  178. <a-row type="flex" align="middle" class="resource-item">
  179. <a-col :md="6" :sm="8" :xs="8">
  180. <sm-indicator
  181. id="farmlandIndicator"
  182. title="耕地保有量"
  183. unit="万亩"
  184. num="300"
  185. font-size="26"
  186. ></sm-indicator>
  187. </a-col>
  188. <a-col :md="18" :sm="16" :xs="16" class="resource-chart">
  189. <a-col :md="12" :sm="12" :xs="12">
  190. <div class="sm-progress-wrap">
  191. <sm-progress
  192. id="progress7"
  193. size="100"
  194. stroke-color="#2ec7c9"
  195. percent="60"
  196. stroke-width="6"
  197. type="circle"
  198. >
  199. </sm-progress>
  200. </div>
  201. </a-col>
  202. <a-col :md="12" :sm="12" :xs="12">
  203. <div class="sm-progress-wrap">
  204. <sm-progress
  205. id="progress8"
  206. size="100"
  207. stroke-color="#ffb980"
  208. percent="80"
  209. stroke-width="6"
  210. type="circle"
  211. >
  212. </sm-progress>
  213. </div>
  214. </a-col>
  215. </a-col>
  216. </a-row>
  217. </a-row>
  218. </a-col>
  219. <a-col :md="16" :xs="24">
  220. <a-row v-if="showMap">
  221. <div class="map-wrap">
  222. <sm-web-map server-url="https://www.supermapol.com" map-id="2068226677">
  223. <sm-zoom></sm-zoom>
  224. <sm-scale position="bottom-left"></sm-scale>
  225. </sm-web-map>
  226. </div>
  227. </a-row>
  228. <a-row>
  229. <a-col :md="12" :xs="24" class="environment-wrap">
  230. <a-row class="environment-title block-title">
  231. <sm-icon id="icon1" icon-class="marker-layer" size="18" color="red"></sm-icon>
  232. <sm-text id="ecologicalText" :font-style="categoryFontStyle" title="生态环境"></sm-text>
  233. </a-row>
  234. <a-row class="environment-progress-holder">
  235. <a-col class="progress-col" :md="24" :xs="24">
  236. <sm-progress
  237. id="progress1"
  238. stroke-color="#2ec7c9"
  239. percent="80"
  240. stroke-width="10"
  241. type="line"
  242. ></sm-progress>
  243. </a-col>
  244. <a-col class="progress-col" :md="24" :xs="24">
  245. <sm-progress
  246. id="progress2"
  247. stroke-color="#ffb980"
  248. percent="40"
  249. stroke-width="10"
  250. type="line"
  251. ></sm-progress>
  252. </a-col>
  253. <a-col class="progress-col" :md="24" :xs="24">
  254. <sm-progress
  255. id="progress3"
  256. stroke-color="#b6a2de"
  257. percent="60"
  258. stroke-width="10"
  259. type="line"
  260. ></sm-progress>
  261. </a-col>
  262. <a-col class="progress-col" :md="24" :xs="24">
  263. <sm-progress
  264. id="progress4"
  265. stroke-color="#5ab1ef"
  266. percent="20"
  267. stroke-width="10"
  268. type="line"
  269. ></sm-progress>
  270. </a-col>
  271. </a-row>
  272. </a-col>
  273. <a-col :md="12" :xs="24" class="chart-wrap">
  274. <a-row class="chart-title block-title">
  275. <sm-icon id="icon2" icon-class="marker-layer" size="18" color="#2EC7C9"></sm-icon>
  276. <sm-text
  277. id="developmentText"
  278. :font-style="categoryFontStyle"
  279. title="开发利用"
  280. ></sm-text>
  281. </a-row>
  282. <a-row>
  283. <a-col :md="24" :xs="24">
  284. <sm-chart
  285. icon-class=""
  286. :options="echartOption"
  287. :dataset="dataset"
  288. :dataset-options="datasetOptions"
  289. >
  290. </sm-chart>
  291. </a-col>
  292. </a-row>
  293. </a-col>
  294. </a-row>
  295. </a-col>
  296. </a-row>
  297. </div>
  298. <script>
  299. //本示例数据纯属虚构
  300. new Vue({
  301. el: '#main',
  302. data() {
  303. return {
  304. dataset: {
  305. type: 'iPortal', //iServer iPortal
  306. url: 'https://iportal.supermap.io/iportal/web/datas/676516522',
  307. queryInfo: {
  308. maxFeatures: 20
  309. }
  310. },
  311. datasetOptions: [
  312. {
  313. seriesType: 'bar', //图表类型
  314. isStastic: true, //是否统计, 默认不统计
  315. xField: '机场', //x坐标轴数据字段
  316. yField: '2016起降架次(架次)' //统计的数据,legned默认名字
  317. },
  318. {
  319. seriesType: 'bar', //图表类型
  320. isStastic: true, //是否统计, 默认不统计
  321. xField: '机场', //x坐标轴数据字段
  322. yField: '2017起降架次(架次)' //统计的数据,legned默认名字
  323. }
  324. ],
  325. echartOption: {
  326. legend: { data: ['2017起降架次(架次)', '2016起降架次(架次)'] }, //与 yField数据一致
  327. grid: {
  328. top: 30,
  329. bottom: 65,
  330. left: 55,
  331. right: 40
  332. }
  333. },
  334. titleFontStyle: {
  335. fontFamily: '微软雅黑',
  336. fontWeight: 'bolder'
  337. },
  338. categoryFontStyle: {
  339. fontFamily: '微软雅黑',
  340. fontWeight: 'bolder',
  341. textAlign: 'left'
  342. },
  343. textFontStyle: {
  344. fontFamily: '微软雅黑',
  345. fontWeight: 'bolder',
  346. textAlign: 'center'
  347. },
  348. showMap: true
  349. };
  350. },
  351. mounted() {
  352. let screenWidth = document.body.clientWidth;
  353. if (screenWidth <= 540) {
  354. this.showMap = false;
  355. }
  356. }
  357. });
  358. </script>
  359. <style>
  360. html {
  361. font-size: 10px;
  362. }
  363. .left-container {
  364. padding-top: 2.2vh;
  365. padding-right: 1.2vw;
  366. }
  367. .map-wrap {
  368. height: 63vh;
  369. }
  370. #titleText {
  371. font-size: 2rem;
  372. }
  373. .title-text-wrap .sm-component-text {
  374. width: 100%;
  375. font-size: 1.6rem;
  376. line-height: 1.5;
  377. }
  378. .time-text-wrap .sm-component-time-text {
  379. text-align: center;
  380. display: block;
  381. margin: 0 auto;
  382. font-size: 1.2rem;
  383. }
  384. .block-title .sm-component-text {
  385. width: 100%;
  386. font-size: 1.4rem;
  387. line-height: 1.5;
  388. }
  389. .monitor-wrap {
  390. margin: 0.93vh 0;
  391. }
  392. .monitor-wrap .block-title {
  393. margin-bottom: 1.85vh;
  394. }
  395. .monitor-wrap .monitor-text .sm-component-text {
  396. width: 100%;
  397. font-size: 1.1rem;
  398. line-height: 1.5;
  399. }
  400. .control-wrap .block-title,
  401. .resource-wrap .block-title {
  402. /* margin-bottom: 1.2vh; */
  403. padding-top: 2.78vh;
  404. }
  405. .control-wrap .control-title .sm-component-liquidFill {
  406. height: 13.89vh;
  407. }
  408. .control-wrap .control-title .sm-component-text,
  409. .resource-wrap .resource-year .sm-component-text {
  410. width: 100%;
  411. margin-bottom: 0.93vh;
  412. font-size: 1.1rem;
  413. }
  414. .resource-wrap .resource-item {
  415. margin-bottom: 3.2vh;
  416. }
  417. .resource-wrap .resource-item:last-of-type {
  418. margin-bottom: 0;
  419. }
  420. .resource-wrap .resource-item .sm-component-indicator .sm-component-indicator__title,
  421. .resource-wrap .resource-item .sm-component-indicator .sm-component-indicator__unit {
  422. font-size: 1rem;
  423. line-height: 1.5;
  424. }
  425. .resource-wrap .resource-item .sm-component-indicator .sm-component-indicator__num {
  426. font-size: 1.5rem;
  427. }
  428. .resource-wrap .resource-item .sm-component-indicator .sm-component-indicator__content {
  429. margin-bottom: 0;
  430. margin-right: 0;
  431. }
  432. .resource-wrap .resource-chart .sm-component-progress-wrap {
  433. height: 12.96vh;
  434. }
  435. .resource-wrap .resource-chart .sm-component-progress {
  436. text-align: center;
  437. }
  438. .environment-wrap {
  439. padding-right: 6.77vw;
  440. }
  441. .environment-wrap .environment-title .sm-component-icon,
  442. .environment-wrap .environment-title .sm-component-text,
  443. .chart-wrap .chart-title .sm-component-icon,
  444. .chart-wrap .chart-title .sm-component-text {
  445. width: auto;
  446. display: inline-block;
  447. vertical-align: middle;
  448. }
  449. .environment-wrap .environment-title,
  450. .chart-wrap .chart-title {
  451. padding-top: 0.93vh;
  452. }
  453. .environment-wrap .environment-title {
  454. margin-bottom: 2.78vh;
  455. }
  456. .environment-wrap,
  457. .environment-progress-holder .progress-col {
  458. margin-bottom: 3.7vh;
  459. }
  460. .environment-wrap,
  461. .environment-progress-holder .progress-col:last-child {
  462. margin-bottom: 0;
  463. }
  464. .chart-wrap .chart-title {
  465. margin-bottom: 1.39vh;
  466. }
  467. .chart-wrap .sm-component-chart {
  468. height: 30vh;
  469. }
  470. .sm-component-chart .sm-component-collapse-card__content {
  471. box-shadow: 0 0 0 #fff;
  472. width: 100%;
  473. height: 28vh;
  474. }
  475. @media (max-width: 540px) {
  476. html {
  477. font-size: 10px;
  478. }
  479. .left-container {
  480. padding-top: 0;
  481. }
  482. .map-wrap {
  483. margin-left: -2.08vw;
  484. width: 100vw;
  485. height: 90vh;
  486. }
  487. }
  488. @media (min-width: 1200px) {
  489. html {
  490. font-size: 16px;
  491. }
  492. }
  493. </style>
  494. </body>
  495. </html>