西藏巴青项目

养殖产业数据前端技术方案.md 3.5KB

养殖产业数据 — 前端技术方案

依据:养殖产业数据功能需求.md养殖产业数据技术方案.md;布局对齐原型 Snipaste_2026-05-19_12-33-09.jpg。字段 小驼峰,与接口 §3.1.2 一致。


1. 页面与路由

说明
Vue 路径 ruoyi-ui/src/views/livestockIndustry/breedingIndustry/index.vue
组件名 BreedingIndustry
菜单配置 组件路径:livestockIndustry/breedingIndustry/index
权限前缀 dataModel:breedingIndustry:query(查看与刷新共用)

本期表单增删改、无子路由。


2. API 模块

说明
文件 ruoyi-ui/src/api/livestockIndustry/breedingIndustry.js
Base /dataModel/breedingIndustry
方法 HTTP 说明
getBreedingDashboard GET /dashboard,Query:statYear(默认当前年)、可选 forceRefresh=true

3. 页面结构(单页四块)

纵向滚动,块标题与需求 §5.1 一致。

区块 组件建议 数据节点
工具栏 年份 el-select(默认当前年)+「刷新」el-buttonv-hasPermi query statYear
产业总览 6 个 el-card 或指标条 data.overview
牦牛存栏变动 公/母数字 + ECharts 折线 data.inventoryChange
牦牛存栏结构 ECharts 双层饼图 data.yakInventoryStructure
草场类型占比 可用/使用中数字 + 退化占比图 data.grassland

页脚或总览区展示 统计日 statDate统计年 statYear(可选小字)。


4. 图表与展示规则

规则 实现
首次进入 mounted 调用 getBreedingDashboard({ statYear });默认当前年;全页 v-loading
刷新 forceRefresh=truerefreshing 防重复点击
失败 msg 提示;清空本地 dashboardData,不保留上一用户数据
空数据 数字 0;图表 emptyChart 文案
月趋势 monthlyTrend 为所选年 1~填报最大月;横轴显示月份,悬停显示年月
存栏结构 yakInventoryStructure 双层饼:内环大类、外环细分;ratio 展示加 %
退化占比 degradationStats 固定 5 项;ratio 展示加 %
单位 头、个、亩、户,与卡片文案一致

折线图:公牛/母牛两系列;最大月点应与存栏变动 header 公母一致(联调校验)。

双层饼图:内环 BULL/COW/INSURED,外环种公牛、阉畜、幼畜、成畜、保险。

退化五档degradationStats 固定 5 项;图例用 degradationLabel


5. 国际化(可选)

说明
语言包 livestockIndustry.breedingIndustrylang/zh/livestockIndustry.jslang/bo/livestockIndustry.js
Mixin 与同目录其他产业页一致;块标题、按钮、空态、单位

指标名称可与中文需求原文一致,藏文包按产品补译。


6. 权限与菜单

  • 菜单进入需 dataModel:breedingIndustry:query
  • 无数据时仍可见页面;刷新按钮同权限。
  • 导出、同步、编辑按钮。

7. 交付清单

  • api/livestockIndustry/breedingIndustry.js
  • views/livestockIndustry/breedingIndustry/index.vue
  • 菜单 SQL / 后台菜单配置(见后端技术方案 §5
  • Playwright:进入页、刷新、四块有数据/空态(见测试用例 UI 章节)