From efa30129c50d3d8b0766c8b8d0d84b125c31564a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E4=BF=8A=E6=97=AD?= <398847134@qq.com> Date: Thu, 22 May 2025 09:09:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E5=9C=9F=E5=9C=B0=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/land/components/basicInfo.vue | 60 +++++++++ .../src/views/land/components/landOne.vue | 9 +- .../src/views/land/components/warning.vue | 118 ++++++++++++++++++ .../src/views/land/index.vue | 83 ++++++------ 4 files changed, 220 insertions(+), 50 deletions(-) create mode 100644 new-digital-agriculture-screen/src/views/land/components/basicInfo.vue create mode 100644 new-digital-agriculture-screen/src/views/land/components/warning.vue diff --git a/new-digital-agriculture-screen/src/views/land/components/basicInfo.vue b/new-digital-agriculture-screen/src/views/land/components/basicInfo.vue new file mode 100644 index 0000000..ae246de --- /dev/null +++ b/new-digital-agriculture-screen/src/views/land/components/basicInfo.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/new-digital-agriculture-screen/src/views/land/components/landOne.vue b/new-digital-agriculture-screen/src/views/land/components/landOne.vue index 51e5bf3..8c7cf27 100644 --- a/new-digital-agriculture-screen/src/views/land/components/landOne.vue +++ b/new-digital-agriculture-screen/src/views/land/components/landOne.vue @@ -13,6 +13,7 @@ const props = defineProps({ }); const state = reactive({ + total: 0, // 存储所有乡镇面积总和 option: { grid: { left: '5%', @@ -31,11 +32,12 @@ const state = reactive({ borderRadius: 8, formatter: (data) => { const params = data[0]; - let str = `
+ const percentage = ((params.value / state.total) * 100).toFixed(2); + return `
${params.name}
- ${params.marker} ${params.data} 万亩 + ${params.marker} ${params.data} km²
+ 占比 ${percentage}%
`; - return str; }, extraCssText: 'backdrop-filter: blur(8px);', }, @@ -85,6 +87,7 @@ watch( (val) => { if (!isEmpty(val)) { state.data = val; + state.total = val.reduce((sum, item) => sum + item.value, 0); // 计算总和 } }, { diff --git a/new-digital-agriculture-screen/src/views/land/components/warning.vue b/new-digital-agriculture-screen/src/views/land/components/warning.vue new file mode 100644 index 0000000..e4d5a91 --- /dev/null +++ b/new-digital-agriculture-screen/src/views/land/components/warning.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/new-digital-agriculture-screen/src/views/land/index.vue b/new-digital-agriculture-screen/src/views/land/index.vue index 3b72863..98be3c9 100644 --- a/new-digital-agriculture-screen/src/views/land/index.vue +++ b/new-digital-agriculture-screen/src/views/land/index.vue @@ -2,46 +2,20 @@
- + + + +
+
+
-
- - - -
-
- - - -
@@ -79,9 +53,10 @@
- +
@@ -100,6 +75,8 @@ import landSix from './components/landSix.vue'; import { useApp } from '@/hooks'; import { sleep } from '@/utils'; import { GetLandInfo } from '@/apis/land'; +import BasicInfo from './components/basicInfo.vue'; +import Warning from '@/views/land/components/warning.vue'; const state = reactive({ loading: false, @@ -122,15 +99,15 @@ const loadData = async () => { await sleep(500); state.data = { one: [ - { value: 20, name: '耿马镇' }, - { value: 15, name: '勐撒镇' }, - { value: 12, name: '勐永镇' }, - { value: 16, name: '孟定镇' }, - { value: 8, name: '勐简乡' }, - { value: 12, name: '贺派乡' }, - { value: 10, name: '四排山乡' }, - { value: 9, name: '芒洪乡' }, - { value: 8, name: '大兴乡' }, + { value: 441.96, name: '耿马镇' }, + { value: 515.11, name: '勐撒镇' }, + { value: 399.6, name: '勐永镇' }, + { value: 1069.15, name: '孟定镇' }, + { value: 281.19, name: '勐简乡' }, + { value: 251.74, name: '贺派乡' }, + { value: 349.86, name: '四排山乡' }, + { value: 314, name: '芒洪乡' }, + { value: 456, name: '大兴乡' }, ], two: [ { name: '耿马镇', value: 87.84 }, @@ -200,6 +177,18 @@ const loadData = async () => { value: 32.1, }, ], + basic: [ + { value: '3837km²', title: '政区域面积' }, + { value: '9个乡(镇),3个农场', title: '下辖地区' }, + { value: '27.88万人', title: '常住人口' }, + { value: '18.8℃ - 19.2℃', title: '年均气温' }, + { value: '946.2毫米(山区)', title: '年降水量' }, + { value: '优越,适宜农业发展', title: '光热水土条件' }, + ], + warnings: [ + { value: 2, title: '当前风险预警数量' }, + { value: 30, title: '已处理土地违规案件' }, + ], }; state.loading = false; }; @@ -240,7 +229,7 @@ const handleCommand = (data) => { } .left-charts-item { width: calc(100% - 5px); - height: calc((100% - 30px) / 3); + height: calc((100% - 30px) / 2); } .right-charts {