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 { diff --git a/sub-operation-service/src/assets/images/smartFarm/demo-list.png b/sub-operation-service/src/assets/images/smartFarm/demo-list.png new file mode 100644 index 0000000..e478a7d Binary files /dev/null and b/sub-operation-service/src/assets/images/smartFarm/demo-list.png differ diff --git a/sub-operation-service/src/router/index.js b/sub-operation-service/src/router/index.js index bd0a5f8..9280f6e 100644 --- a/sub-operation-service/src/router/index.js +++ b/sub-operation-service/src/router/index.js @@ -140,6 +140,18 @@ export const constantRoutes = [ name: 'intelligentFertilizer', meta: { title: '智能配肥' }, }, + { + path: '/sub-operation-service/smartFarm/IntelligentIrrigation', + component: () => import('@/views/smartFarm/inspection/IntelligentIrrigation.vue'), + name: 'IntelligentIrrigation', + meta: { title: '智能灌溉' }, + }, + { + path: '/sub-operation-service/smartFarm/IntelligentSeedSoaking', + component: () => import('@/views/smartFarm/inspection/IntelligentSeedSoaking.vue'), + name: 'IntelligentSeedSoaking', + meta: { title: '智能浸种' }, + }, { path: '/sub-operation-service/smartFarm/growSeedlings', component: () => import('@/views/smartFarm/manageControl/growSeedlings.vue'), diff --git a/sub-operation-service/src/views/ecommerce/components/leftMenu.vue b/sub-operation-service/src/views/ecommerce/components/leftMenu.vue index 4b2880e..3cd6bf4 100644 --- a/sub-operation-service/src/views/ecommerce/components/leftMenu.vue +++ b/sub-operation-service/src/views/ecommerce/components/leftMenu.vue @@ -25,7 +25,7 @@ const leftMenu = reactive([ { name: 'agricultural', title: '农资交易', icon: 'menu2.png', path: '/sub-operation-service/ecommerce-agricultural' }, { name: 'supplier', title: '供应商服务', icon: 'menu1.png', path: '/sub-operation-service/ecommerce-supplier' }, { name: 'purchaser', title: '采购商服务', icon: 'menu3.png', path: '/sub-operation-service/ecommerce-purchaser' }, - { name: 'land', title: '土地交易', icon: 'menu4.png', path: '/sub-operation-service/ecommerce-land' }, + // { name: 'land', title: '土地交易', icon: 'menu4.png', path: '/sub-operation-service/ecommerce-land' }, ]); let currentIndex = ref(0); diff --git a/sub-operation-service/src/views/smartFarm/components/dataDisplay.vue b/sub-operation-service/src/views/smartFarm/components/dataDisplay.vue new file mode 100644 index 0000000..863f282 --- /dev/null +++ b/sub-operation-service/src/views/smartFarm/components/dataDisplay.vue @@ -0,0 +1,347 @@ + + + + + diff --git a/sub-operation-service/src/views/smartFarm/components/devices.vue b/sub-operation-service/src/views/smartFarm/components/devices.vue index 8fb46b6..1a4ca56 100644 --- a/sub-operation-service/src/views/smartFarm/components/devices.vue +++ b/sub-operation-service/src/views/smartFarm/components/devices.vue @@ -37,6 +37,8 @@ const icons = [ { 雨量计: 'rainGauge' }, { 土壤传感器: 'soilSensor' }, { 积水传感器: 'waterLoggingSensor' }, + { 土壤温度: 'temperature' }, + { 土壤湿度: 'humidity' }, ]; const props = defineProps({ @@ -44,19 +46,6 @@ const props = defineProps({ type: Array, required: true, default: () => [], - validator: (items) => { - return items.every((item) => { - return ( - typeof item === 'object' && - item !== null && - typeof item.id === 'number' && - typeof item.name === 'string' && - typeof item.detail === 'string' && - typeof item.icon === 'string' && - (!item.status || typeof item.status === 'number') - ); - }); - }, }, title: { type: String, @@ -72,8 +61,8 @@ const props = defineProps({ @@ -99,10 +74,12 @@ diff --git a/sub-operation-service/src/views/smartFarm/inspection/intelligentFertilizer.vue b/sub-operation-service/src/views/smartFarm/inspection/intelligentFertilizer.vue index d940b37..440f165 100644 --- a/sub-operation-service/src/views/smartFarm/inspection/intelligentFertilizer.vue +++ b/sub-operation-service/src/views/smartFarm/inspection/intelligentFertilizer.vue @@ -7,7 +7,7 @@
- +
配肥分析
土壤酸碱度:
diff --git a/sub-operation-service/vite.config.js b/sub-operation-service/vite.config.js index 25a6e20..6345e9f 100644 --- a/sub-operation-service/vite.config.js +++ b/sub-operation-service/vite.config.js @@ -36,6 +36,7 @@ export default defineConfig(({ command, mode }) => { port: VITE_PORT, open: true, https: false, + origin: 'http://localhost:9526', headers: { 'Access-Control-Allow-Origin': '*', },