SpatialAnalysis.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <div>空间分析</div>
  3. <div class="analyze-data-container">
  4. <div class="item">
  5. <div class="item-label">行政镇(个)</div>
  6. <div class="item-value">{{ analysisSpatialData.townName }}</div>
  7. </div>
  8. <div class="item">
  9. <div class="item-label">行政村(个)</div>
  10. <div class="item-value">{{ analysisSpatialData.townName }}</div>
  11. </div>
  12. <div class="item">
  13. <div class="item-label">面积(km²)</div>
  14. <div class="item-value">{{ analysisSpatialData.area }}</div>
  15. </div>
  16. <div class="item">
  17. <div class="item-label">常住人口(万)</div>
  18. <div class="item-value">{{ analysisSpatialData.populationNum }}</div>
  19. </div>
  20. <div class="item">
  21. <div class="item-label">GDP(万元)</div>
  22. <div class="item-value">{{ analysisSpatialData.expert }}</div>
  23. </div>
  24. <div class="flex" style="margin: 20px 0; width: 100%">
  25. <el-input v-model="keyword" size="large" style="flex: 1;" />
  26. <el-button type="primary" size="large">搜索</el-button>
  27. </div>
  28. </div>
  29. </template>
  30. <script lang="ts" setup name="AnalyzeDataDialog">
  31. import BigNumber from 'bignumber.js';
  32. interface AnalysisSpatialData {
  33. townName: string;
  34. area: number;
  35. populationNum: number;
  36. gdp: number;
  37. easyFloodPoint: number;
  38. medicalInstitutionNum: number;
  39. expert: number;
  40. }
  41. interface Props {
  42. selectedScope: any;
  43. }
  44. const props = withDefaults(defineProps<Props>(), {});
  45. const keyword = ref('');
  46. const analysisSpatialData = computed(() => {
  47. const data: AnalysisSpatialData = {
  48. townName: '',
  49. area: 0,
  50. populationNum: '',
  51. gdp: '',
  52. easyFloodPoint: '',
  53. medicalInstitutionNum: '',
  54. expert: 0
  55. };
  56. for (let key in props.selectedScope) {
  57. data.area = new BigNumber(data.area).plus(props.selectedScope[key].area);
  58. data.expert = new BigNumber(data.expert).plus(props.selectedScope[key].expert);
  59. // selectedScope[key] = '';
  60. }
  61. return data;
  62. });
  63. </script>
  64. <style lang="scss" scoped>
  65. .analyze-data-container {
  66. width: 100%;
  67. font-size: 16px;
  68. padding: 15px;
  69. display: flex;
  70. flex-wrap: wrap;
  71. .item {
  72. width: calc(33.333333%);
  73. height: 100px;
  74. background-color: #fff;
  75. border-left: 1px solid #000;
  76. border-top: 1px solid #000;
  77. display: flex;
  78. flex-direction: column;
  79. justify-content: center;
  80. align-items: center;
  81. font-size: 36px;
  82. &:nth-child(3), &:nth-child(4), &:nth-child(5) {
  83. border-bottom: 1px solid #000;
  84. }
  85. &:nth-child(5) {
  86. border-right: 1px solid #000;
  87. }
  88. .item-label {
  89. margin-bottom: 18px;
  90. }
  91. }
  92. }
  93. </style>