diff --git a/src/components/PenForm.vue b/src/components/PenForm.vue new file mode 100644 index 00000000..cf02a697 --- /dev/null +++ b/src/components/PenForm.vue @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + 取消 + 确定 + + + + + + + + diff --git a/src/components/PigHouseForm.vue b/src/components/PigHouseForm.vue new file mode 100644 index 00000000..08ad205a --- /dev/null +++ b/src/components/PigHouseForm.vue @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + 取消 + 确定 + + + + + + + + diff --git a/src/components/PigHouseList.vue b/src/components/PigHouseList.vue new file mode 100644 index 00000000..da0900e5 --- /dev/null +++ b/src/components/PigHouseList.vue @@ -0,0 +1,136 @@ + + + + + + 猪舍: {{ house.name }} + 描述: {{ house.description }} + + + 增加猪栏 + 编辑 + 删除 + + + + + + + + 该猪舍下没有猪栏信息。 + + + + + + + + + diff --git a/src/components/PigPenInfoCard.vue b/src/components/PigPenInfoCard.vue new file mode 100644 index 00000000..bb916ae2 --- /dev/null +++ b/src/components/PigPenInfoCard.vue @@ -0,0 +1,107 @@ + + + + 猪栏: {{ pen.pen_number }} + 状态: {{ pen.status || '未知' }} + 容量: {{ pen.capacity }} + 批次ID: {{ pen.pig_batch_id || '未分配' }} + + + 编辑 + 删除 + + + + + + + diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 71f3e430..ac65d043 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -15,7 +15,7 @@ :collapse="isCollapse" :collapse-transition="false" router - :default-openeds="['/device-management', '/monitor']" + :default-openeds="['/device-management', '/monitor', '/pms']" > @@ -38,6 +38,18 @@ + + + + + 猪场管理 + + + + 栏舍管理 + + + 计划管理 @@ -167,14 +179,14 @@ import { ref, computed, onMounted, onUnmounted } from 'vue'; import { useRoute, useRouter } from 'vue-router'; import { House, Monitor, Calendar, ArrowDown, Menu, Fold, Expand, Setting, Tickets, DataAnalysis, Document, Food, - FirstAidKit, Clock, Files, ShoppingCart, SoldOut, Warning, Switch, List, Shop, Coin, DataLine, Finished, User, ScaleToOriginal + FirstAidKit, Clock, Files, ShoppingCart, SoldOut, Warning, Switch, List, Shop, Coin, DataLine, Finished, User, ScaleToOriginal, OfficeBuilding } from '@element-plus/icons-vue'; export default { name: 'MainLayout', components: { House, Monitor, Calendar, ArrowDown, Menu, Fold, Expand, Setting, Tickets, DataAnalysis, Document, Food, - FirstAidKit, Clock, Files, ShoppingCart, SoldOut, Warning, Switch, List, Shop, Coin, DataLine, Finished, User, ScaleToOriginal + FirstAidKit, Clock, Files, ShoppingCart, SoldOut, Warning, Switch, List, Shop, Coin, DataLine, Finished, User, ScaleToOriginal, OfficeBuilding }, setup() { const route = useRoute(); @@ -199,11 +211,9 @@ export default { }; const activeMenu = computed(() => { - if (route.path.startsWith('/monitor')) { - return route.path; - } - if (route.path === '/devices' || route.path === '/device-templates') { - return route.path; + const path = route.path; + if (path.startsWith('/monitor') || path.startsWith('/pms') || path.startsWith('/devices') || path.startsWith('/device-templates')) { + return path; } return route.path; }); @@ -213,6 +223,7 @@ export default { '/': '系统首页', '/devices': '设备管理', '/device-templates': '设备模板管理', + '/pms/farm-management': '栏舍管理', '/plans': '计划管理', '/monitor/device-command-logs': '设备命令日志', '/monitor/feed-usage-records': '饲料使用记录', @@ -338,4 +349,4 @@ export default { font-size: 14px; border-top: 1px solid #eee; } - \ No newline at end of file + diff --git a/src/main.js b/src/main.js index 3685ac93..b69151e1 100644 --- a/src/main.js +++ b/src/main.js @@ -10,6 +10,7 @@ import DeviceList from './views/device/DeviceList.vue'; import PlanList from './views/plan/PlanList.vue'; import LoginForm from './views/home/LoginForm.vue'; import DeviceTemplateList from './views/device/DeviceTemplateList.vue'; +import PigFarmManagementView from './views/pms/PigFarmManagementView.vue'; // 导入栏舍管理视图 // --- 统一导入所有监控视图 --- import DeviceCommandLogView from './views/monitor/DeviceCommandLogView.vue'; @@ -41,6 +42,7 @@ const routes = [ {path: '/device-templates', component: DeviceTemplateList, meta: {requiresAuth: true}}, {path: '/plans', component: PlanList, meta: {requiresAuth: true}}, {path: '/login', component: LoginForm}, + {path: '/pms/farm-management', name: 'PigFarmManagement', component: PigFarmManagementView, meta: { requiresAuth: true }}, // --- 统一注册所有监控路由 --- {path: '/monitor/device-command-logs', component: DeviceCommandLogView, meta: {requiresAuth: true}}, diff --git a/src/views/pms/PigFarmManagementView.vue b/src/views/pms/PigFarmManagementView.vue new file mode 100644 index 00000000..f2bb6195 --- /dev/null +++ b/src/views/pms/PigFarmManagementView.vue @@ -0,0 +1,263 @@ + + + + + + + 栏舍管理 + + + + + 添加猪舍 + + + + + + + + + + + + 重新加载 + + + + + + + + + + + + + + + + + + + + +
该猪舍下没有猪栏信息。