移除旧接口和界面

This commit is contained in:
2025-11-21 16:00:37 +08:00
parent 1169381f7a
commit 98252c2b71
8 changed files with 56 additions and 905 deletions

View File

@@ -51,13 +51,13 @@
},
{
"enum": [
"Debug",
"Info",
"Warn",
"Error",
"DPanic",
"Panic",
"Fatal"
"debug",
"info",
"warn",
"error",
"dpanic",
"panic",
"fatal"
],
"type": "string",
"x-enum-varnames": [
@@ -167,13 +167,13 @@
},
{
"enum": [
"Debug",
"Info",
"Warn",
"Error",
"DPanic",
"Panic",
"Fatal"
"debug",
"info",
"warn",
"error",
"dpanic",
"panic",
"fatal"
],
"type": "string",
"x-enum-varnames": [
@@ -448,13 +448,13 @@
},
{
"enum": [
"Debug",
"Info",
"Warn",
"Error",
"DPanic",
"Panic",
"Fatal"
"debug",
"info",
"warn",
"error",
"dpanic",
"panic",
"fatal"
],
"type": "string",
"x-enum-varnames": [
@@ -735,13 +735,13 @@
"parameters": [
{
"enum": [
"Debug",
"Info",
"Warn",
"Error",
"DPanic",
"Panic",
"Fatal"
"debug",
"info",
"warn",
"error",
"dpanic",
"panic",
"fatal"
],
"type": "string",
"x-enum-varnames": [
@@ -1714,85 +1714,6 @@
}
}
},
"/api/v1/monitor/feed-usage-records": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据提供的过滤条件,分页获取饲料使用记录",
"produces": [
"application/json"
],
"tags": [
"数据监控"
],
"summary": "获取饲料使用记录列表",
"parameters": [
{
"type": "string",
"name": "end_time",
"in": "query"
},
{
"type": "integer",
"name": "feed_formula_id",
"in": "query"
},
{
"type": "integer",
"name": "operator_id",
"in": "query"
},
{
"type": "string",
"name": "order_by",
"in": "query"
},
{
"type": "integer",
"name": "page",
"in": "query"
},
{
"type": "integer",
"name": "page_size",
"in": "query"
},
{
"type": "integer",
"name": "pen_id",
"in": "query"
},
{
"type": "string",
"name": "start_time",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/dto.ListFeedUsageRecordResponse"
}
}
}
]
}
}
}
}
},
"/api/v1/monitor/medication-logs": {
"get": {
"security": [
@@ -2583,159 +2504,6 @@
}
}
},
"/api/v1/monitor/raw-material-purchases": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据提供的过滤条件,分页获取原料采购记录",
"produces": [
"application/json"
],
"tags": [
"数据监控"
],
"summary": "获取原料采购记录列表",
"parameters": [
{
"type": "string",
"name": "end_time",
"in": "query"
},
{
"type": "string",
"name": "order_by",
"in": "query"
},
{
"type": "integer",
"name": "page",
"in": "query"
},
{
"type": "integer",
"name": "page_size",
"in": "query"
},
{
"type": "integer",
"name": "raw_material_id",
"in": "query"
},
{
"type": "string",
"name": "start_time",
"in": "query"
},
{
"type": "string",
"name": "supplier",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/dto.ListRawMaterialPurchaseResponse"
}
}
}
]
}
}
}
}
},
"/api/v1/monitor/raw-material-stock-logs": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据提供的过滤条件,分页获取原料库存日志",
"produces": [
"application/json"
],
"tags": [
"数据监控"
],
"summary": "获取原料库存日志列表",
"parameters": [
{
"type": "string",
"name": "end_time",
"in": "query"
},
{
"type": "string",
"name": "order_by",
"in": "query"
},
{
"type": "integer",
"name": "page",
"in": "query"
},
{
"type": "integer",
"name": "page_size",
"in": "query"
},
{
"type": "integer",
"name": "raw_material_id",
"in": "query"
},
{
"type": "integer",
"name": "source_id",
"in": "query"
},
{
"type": "string",
"name": "source_type",
"in": "query"
},
{
"type": "string",
"name": "start_time",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/dto.ListRawMaterialStockLogResponse"
}
}
}
]
}
}
}
}
},
"/api/v1/monitor/sensor-data": {
"get": {
"security": [
@@ -5640,49 +5408,6 @@
}
}
},
"dto.FeedFormulaDTO": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
},
"dto.FeedUsageRecordDTO": {
"type": "object",
"properties": {
"amount": {
"type": "number"
},
"feed_formula": {
"$ref": "#/definitions/dto.FeedFormulaDTO"
},
"feed_formula_id": {
"type": "integer"
},
"id": {
"type": "integer"
},
"operator_id": {
"type": "integer"
},
"pen": {
"$ref": "#/definitions/dto.PenDTO"
},
"pen_id": {
"type": "integer"
},
"recorded_at": {
"type": "string"
},
"remarks": {
"type": "string"
}
}
},
"dto.HistoricalAlarmDTO": {
"type": "object",
"properties": {
@@ -5777,20 +5502,6 @@
}
}
},
"dto.ListFeedUsageRecordResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.FeedUsageRecordDTO"
}
},
"pagination": {
"$ref": "#/definitions/dto.PaginationDTO"
}
}
},
"dto.ListHistoricalAlarmResponse": {
"type": "object",
"properties": {
@@ -5946,34 +5657,6 @@
}
}
},
"dto.ListRawMaterialPurchaseResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.RawMaterialPurchaseDTO"
}
},
"pagination": {
"$ref": "#/definitions/dto.PaginationDTO"
}
}
},
"dto.ListRawMaterialStockLogResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.RawMaterialStockLogDTO"
}
},
"pagination": {
"$ref": "#/definitions/dto.PaginationDTO"
}
}
},
"dto.ListSensorDataResponse": {
"type": "object",
"properties": {
@@ -6211,17 +5894,6 @@
}
}
},
"dto.PenDTO": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
},
"dto.PenResponse": {
"type": "object",
"properties": {
@@ -6728,75 +6400,6 @@
}
}
},
"dto.RawMaterialDTO": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
},
"dto.RawMaterialPurchaseDTO": {
"type": "object",
"properties": {
"amount": {
"type": "number"
},
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
},
"purchase_date": {
"type": "string"
},
"raw_material": {
"$ref": "#/definitions/dto.RawMaterialDTO"
},
"raw_material_id": {
"type": "integer"
},
"supplier": {
"type": "string"
},
"total_price": {
"type": "number"
},
"unit_price": {
"type": "number"
}
}
},
"dto.RawMaterialStockLogDTO": {
"type": "object",
"properties": {
"change_amount": {
"type": "number"
},
"happened_at": {
"type": "string"
},
"id": {
"type": "integer"
},
"raw_material_id": {
"type": "integer"
},
"remarks": {
"type": "string"
},
"source_id": {
"type": "integer"
},
"source_type": {
"$ref": "#/definitions/models.StockLogSourceType"
}
}
},
"dto.ReclassifyPenToNewBatchRequest": {
"type": "object",
"required": [
@@ -7955,32 +7558,24 @@
"models.PigBatchStatus": {
"type": "string",
"enum": [
"保育",
"生长",
"育肥",
"生产中",
"待售",
"已出售",
"已归档"
],
"x-enum-comments": {
"BatchStatusActive": "饲养中",
"BatchStatusArchived": "批次结束(如全群淘汰等)",
"BatchStatusFinishing": "最后的育肥阶段",
"BatchStatusForSale": "达到出栏标准",
"BatchStatusGrowing": "生长育肥阶段",
"BatchStatusWeaning": "从断奶到保育结束"
"BatchStatusForSale": "达到出栏标准"
},
"x-enum-descriptions": [
"从断奶到保育结束",
"生长育肥阶段",
"最后的育肥阶段",
"饲养中",
"达到出栏标准",
"",
"批次结束(如全群淘汰等)"
],
"x-enum-varnames": [
"BatchStatusWeaning",
"BatchStatusGrowing",
"BatchStatusFinishing",
"BatchStatusActive",
"BatchStatusForSale",
"BatchStatusSold",
"BatchStatusArchived"
@@ -8135,13 +7730,13 @@
"models.SeverityLevel": {
"type": "string",
"enum": [
"Debug",
"Info",
"Warn",
"Error",
"DPanic",
"Panic",
"Fatal"
"debug",
"info",
"warn",
"error",
"dpanic",
"panic",
"fatal"
],
"x-enum-varnames": [
"DebugLevel",
@@ -8153,25 +7748,6 @@
"FatalLevel"
]
},
"models.StockLogSourceType": {
"type": "string",
"enum": [
"采购入库",
"饲喂出库",
"变质出库",
"售卖出库",
"杂用领取",
"手动盘点"
],
"x-enum-varnames": [
"StockLogSourcePurchase",
"StockLogSourceFeeding",
"StockLogSourceDeteriorate",
"StockLogSourceSale",
"StockLogSourceMiscellaneous",
"StockLogSourceManual"
]
},
"models.TaskType": {
"type": "string",
"enum": [
@@ -8180,6 +7756,7 @@
"下料",
"全量采集",
"告警通知",
"通知刷新",
"设备阈值检查",
"区域阈值检查"
],
@@ -8189,6 +7766,7 @@
"TaskTypeAreaCollectorThresholdCheck": "区域阈值检查任务",
"TaskTypeDeviceThresholdCheck": "设备阈值检查任务",
"TaskTypeFullCollection": "新增的全量采集任务",
"TaskTypeNotificationRefresh": "通知刷新任务",
"TaskTypeReleaseFeedWeight": "下料口释放指定重量任务",
"TaskTypeWaiting": "等待任务"
},
@@ -8198,6 +7776,7 @@
"下料口释放指定重量任务",
"新增的全量采集任务",
"告警通知任务",
"通知刷新任务",
"设备阈值检查任务",
"区域阈值检查任务"
],
@@ -8207,6 +7786,7 @@
"TaskTypeReleaseFeedWeight",
"TaskTypeFullCollection",
"TaskTypeAlarmNotification",
"TaskTypeNotificationRefresh",
"TaskTypeDeviceThresholdCheck",
"TaskTypeAreaCollectorThresholdCheck"
]

View File

@@ -1,11 +1,10 @@
import http from '../utils/http';
import {
PaginationDTO, DeviceCommandLogDTO, FeedFormulaDTO, PenDTO, FeedUsageRecordDTO, MedicationReasonType,
PaginationDTO, DeviceCommandLogDTO, MedicationReasonType,
MedicationDTO, MedicationLogDTO, NotifierType, NotificationStatus, NotificationDTO, PendingCollectionStatus,
PendingCollectionDTO, LogChangeType, PigBatchLogDTO, PigPurchaseDTO, PigSaleDTO, PigBatchSickPigReasonType,
PigBatchSickPigTreatmentLocation, PigSickLogDTO, PigTransferType, PigTransferLogDTO, ExecutionStatus,
PlanExecutionLogDTO, RawMaterialDTO, RawMaterialPurchaseDTO, StockLogSourceType, RawMaterialStockLogDTO,
SensorType, SensorDataDTO, TaskDTO, TaskExecutionLogDTO, AuditStatus, UserActionLogDTO, WeighingBatchDTO,
PlanExecutionLogDTO, SensorType, SensorDataDTO, TaskDTO, TaskExecutionLogDTO, AuditStatus, UserActionLogDTO, WeighingBatchDTO,
WeighingRecordDTO, ZapcoreLevel, SeverityLevel
} from '../enums';
@@ -37,37 +36,6 @@ import {
* @property {boolean} [received_success]
*/
/**
* @typedef {object} FeedUsageRecordDTO
* @property {number} id
* @property {number} pen_id
* @property {PenDTO} pen
* @property {number} feed_formula_id
* @property {FeedFormulaDTO} feed_formula
* @property {number} amount
* @property {string} recorded_at
* @property {string} remarks
* @property {number} operator_id
*/
/**
* @typedef {object} ListFeedUsageRecordResponse
* @property {Array<FeedUsageRecordDTO>} list
* @property {PaginationDTO} pagination
*/
/**
* @typedef {object} FeedUsageRecordsParams
* @property {number} [page]
* @property {number} [page_size]
* @property {string} [order_by]
* @property {number} [pen_id]
* @property {number} [feed_formula_id]
* @property {string} [start_time]
* @property {string} [end_time]
* @property {number} [operator_id]
*/
/**
* @typedef {object} MedicationLogDTO
* @property {number} id
@@ -364,65 +332,6 @@ import {
* @property {string} [end_time]
*/
/**
* @typedef {object} RawMaterialPurchaseDTO
* @property {number} id
* @property {number} raw_material_id
* @property {RawMaterialDTO} raw_material
* @property {number} amount
* @property {number} unit_price
* @property {number} total_price
* @property {string} supplier
* @property {string} purchase_date
* @property {string} created_at
*/
/**
* @typedef {object} ListRawMaterialPurchaseResponse
* @property {Array<RawMaterialPurchaseDTO>} list
* @property {PaginationDTO} pagination
*/
/**
* @typedef {object} RawMaterialPurchasesParams
* @property {number} [page]
* @property {number} [page_size]
* @property {string} [order_by]
* @property {number} [raw_material_id]
* @property {string} [supplier]
* @property {string} [start_time]
* @property {string} [end_time]
*/
/**
* @typedef {object} RawMaterialStockLogDTO
* @property {number} id
* @property {number} raw_material_id
* @property {number} change_amount
* @property {StockLogSourceType} source_type
* @property {number} source_id
* @property {string} remarks
* @property {string} happened_at
*/
/**
* @typedef {object} ListRawMaterialStockLogResponse
* @property {Array<RawMaterialStockLogDTO>} list
* @property {PaginationDTO} pagination
*/
/**
* @typedef {object} RawMaterialStockLogsParams
* @property {number} [page]
* @property {number} [page_size]
* @property {string} [order_by]
* @property {number} [raw_material_id]
* @property {string} [source_type]
* @property {number} [source_id]
* @property {string} [start_time]
* @property {string} [end_time]
*/
/**
* @typedef {object} SensorDataDTO
* @property {number} area_controller_id
@@ -594,17 +503,6 @@ export const getDeviceCommandLogs = async (params) => {
return processResponse(responseData);
};
/**
* 获取饲料使用记录列表
* @param {FeedUsageRecordsParams} params - 查询参数
* @returns {Promise<{list: Array<FeedUsageRecordDTO>, total: number}>}
*/
export const getFeedUsageRecords = async (params) => {
const newParams = { ...params, page_size: params.page_size };
const responseData = await http.get('/api/v1/monitor/feed-usage-records', { params: newParams });
return processResponse(responseData);
};
/**
* 获取用药记录列表
* @param {MedicationLogsParams} params - 查询参数
@@ -704,28 +602,6 @@ export const getPlanExecutionLogs = async (params) => {
return processResponse(responseData);
};
/**
* 获取原料采购记录列表
* @param {RawMaterialPurchasesParams} params - 查询参数
* @returns {Promise<{list: Array<RawMaterialPurchaseDTO>, total: number}>}
*/
export const getRawMaterialPurchases = async (params) => {
const newParams = { ...params, page_size: params.page_size };
const responseData = await http.get('/api/v1/monitor/raw-material-purchases', { params: newParams });
return processResponse(responseData);
};
/**
* 获取原料库存日志列表
* @param {RawMaterialStockLogsParams} params - 查询参数
* @returns {Promise<{list: Array<RawMaterialStockLogDTO>, total: number}>}
*/
export const getRawMaterialStockLogs = async (params) => {
const newParams = { ...params, page_size: params.page_size };
const responseData = await http.get('/api/v1/monitor/raw-material-stock-logs', { params: newParams });
return processResponse(responseData);
};
/**
* 获取传感器数据列表
* @param {SensorDataParams} params - 查询参数
@@ -783,7 +659,6 @@ export const getWeighingRecords = async (params) => {
export const MonitorApi = {
getDeviceCommandLogs,
getFeedUsageRecords,
getMedicationLogs,
getNotifications,
getPendingCollections,
@@ -793,11 +668,9 @@ export const MonitorApi = {
getPigSickLogs,
getPigTransferLogs,
getPlanExecutionLogs,
getRawMaterialPurchases,
getRawMaterialStockLogs,
getSensorData,
getTaskExecutionLogs,
getUserActionLogs,
getWeighingBatches,
getWeighingRecords,
};
};

View File

@@ -144,9 +144,7 @@ export const PigBatchSickPigTreatmentLocation = {
* @enum {string}
*/
export const PigBatchStatus = {
WEANING: '保育', // 从断奶到保育结束
GROWING: '生长', // 生长育肥阶段
FINISHING: '育肥', // 最后的育肥阶段
ACTIVE: '生产中', // 饲养中
FOR_SALE: '待售', // 达到出栏标准
SOLD: '已出售',
ARCHIVED: '已归档', // 批次结束(如全群淘汰等)
@@ -216,19 +214,6 @@ export const SensorType = {
WEIGHT: '重量',
};
/**
* 库存日志来源类型
* @enum {string}
*/
export const StockLogSourceType = {
PURCHASE: '采购入库',
FEEDING: '饲喂出库',
DETERIORATE: '变质出库',
SALE: '售卖出库',
MISCELLANEOUS: '杂用领取',
MANUAL: '手动盘点',
};
/**
* 任务类型
* @enum {string}
@@ -239,6 +224,7 @@ export const TaskType = {
RELEASE_FEED_WEIGHT: '下料', // 下料口释放指定重量任务
FULL_COLLECTION: '全量采集', // 新增的全量采集任务
ALARM_NOTIFICATION: '告警通知', // 告警通知任务
NOTIFICATION_REFRESH: '通知刷新', // 通知刷新任务
DEVICE_THRESHOLD_CHECK: '设备阈值检查', // 设备阈值检查任务
AREA_COLLECTOR_THRESHOLD_CHECK: '区域阈值检查', // 区域阈值检查任务
};
@@ -321,11 +307,11 @@ export const Operator = {
* @enum {string}
*/
export const SeverityLevel = {
DEBUG: 'Debug',
INFO: 'Info',
WARN: 'Warn',
ERROR: 'Error',
DPANIC: 'DPanic',
PANIC: 'Panic',
FATAL: 'Fatal',
DEBUG: 'debug',
INFO: 'info',
WARN: 'warn',
ERROR: 'error',
DPANIC: 'dpanic',
PANIC: 'panic',
FATAL: 'fatal',
};

View File

@@ -113,12 +113,6 @@
</el-icon>
<template #title>设备命令日志</template>
</el-menu-item>
<el-menu-item index="/monitor/feed-usage-records">
<el-icon>
<Food/>
</el-icon>
<template #title>饲料使用记录</template>
</el-menu-item>
<el-menu-item index="/monitor/medication-logs">
<el-icon>
<FirstAidKit/>
@@ -167,18 +161,6 @@
</el-icon>
<template #title>猪只迁移日志</template>
</el-menu-item>
<el-menu-item index="/monitor/raw-material-purchases">
<el-icon>
<Shop/>
</el-icon>
<template #title>原料采购记录</template>
</el-menu-item>
<el-menu-item index="/monitor/raw-material-stock-logs">
<el-icon>
<Coin/>
</el-icon>
<template #title>原料库存日志</template>
</el-menu-item>
<el-menu-item index="/monitor/sensor-data">
<el-icon>
<DataLine/>
@@ -284,7 +266,6 @@ import {
Tickets,
DataAnalysis,
Document,
Food,
FirstAidKit,
Clock,
Files,
@@ -293,8 +274,6 @@ import {
Warning,
Switch,
List,
Shop,
Coin,
DataLine,
Finished,
User,
@@ -319,7 +298,6 @@ export default {
Tickets,
DataAnalysis,
Document,
Food,
FirstAidKit,
Clock,
Files,
@@ -328,8 +306,6 @@ export default {
Warning,
Switch,
List,
Shop,
Coin,
DataLine,
Finished,
User,

View File

@@ -7,7 +7,6 @@ import DeviceTemplateList from '../views/device/DeviceTemplateList.vue';
import PigFarmManagementView from '../views/pms/PigFarmManagementView.vue';
import PigBatchManagementView from '../views/pms/PigBatchManagementView.vue';
import DeviceCommandLogView from '../views/monitor/DeviceCommandLogView.vue';
import FeedUsageRecordsView from '../views/monitor/FeedUsageRecordsView.vue';
import MedicationLogsView from '../views/monitor/MedicationLogsView.vue';
import NotificationLogView from '../views/monitor/NotificationLogView.vue';
import PendingCollectionsView from '../views/monitor/PendingCollectionsView.vue';
@@ -17,8 +16,6 @@ import PigSalesView from '../views/monitor/PigSalesView.vue';
import PigSickLogsView from '../views/monitor/PigSickLogsView.vue';
import PigTransferLogsView from '../views/monitor/PigTransferLogsView.vue';
import PlanExecutionLogsView from '../views/monitor/PlanExecutionLogsView.vue';
import RawMaterialPurchasesView from '../views/monitor/RawMaterialPurchasesView.vue';
import RawMaterialStockLogsView from '../views/monitor/RawMaterialStockLogsView.vue';
import SensorDataView from '../views/monitor/SensorDataView.vue';
import TaskExecutionLogsView from '../views/monitor/TaskExecutionLogsView.vue';
import UserActionLogsView from '../views/monitor/UserActionLogsView.vue';
@@ -38,7 +35,6 @@ const routes = [
{path: '/pms/farm-management', name: 'PigFarmManagement', component: PigFarmManagementView, meta: { requiresAuth: true, title: '栏舍管理' }},
{path: '/pms/batch-management', name: 'PigBatchManagement', component: PigBatchManagementView, meta: { requiresAuth: true, title: '猪群管理' }},
{path: '/monitor/device-command-logs', component: DeviceCommandLogView, meta: {requiresAuth: true, title: '设备命令日志'}},
{path: '/monitor/feed-usage-records', component: FeedUsageRecordsView, meta: {requiresAuth: true, title: '饲料使用记录'}},
{path: '/monitor/medication-logs', component: MedicationLogsView, meta: {requiresAuth: true, title: '用药记录'}},
{path: '/monitor/notifications', component: NotificationLogView, meta: {requiresAuth: true, title: '通知记录'}},
{path: '/monitor/pending-collections', component: PendingCollectionsView, meta: {requiresAuth: true, title: '待采集请求'}},
@@ -48,8 +44,6 @@ const routes = [
{path: '/monitor/pig-sick-logs', component: PigSickLogsView, meta: {requiresAuth: true, title: '病猪日志'}},
{path: '/monitor/pig-transfer-logs', component: PigTransferLogsView, meta: {requiresAuth: true, title: '猪只迁移日志'}},
{path: '/monitor/plan-execution-logs', component: PlanExecutionLogsView, meta: {requiresAuth: true, title: '计划执行日志'}},
{path: '/monitor/raw-material-purchases', component: RawMaterialPurchasesView, meta: {requiresAuth: true, title: '原料采购记录'}},
{path: '/monitor/raw-material-stock-logs', component: RawMaterialStockLogsView, meta: {requiresAuth: true, title: '原料库存日志'}},
{path: '/monitor/sensor-data', component: SensorDataView, meta: {requiresAuth: true, title: '传感器数据'}},
{path: '/monitor/task-execution-logs', component: TaskExecutionLogsView, meta: {requiresAuth: true, title: '任务执行日志'}},
{path: '/monitor/user-action-logs', component: UserActionLogsView, meta: {requiresAuth: true, title: '用户操作日志'}},

View File

@@ -1,92 +0,0 @@
<template>
<div class="feed-usage-record-view">
<GenericMonitorList
:fetchData="fetchFeedUsageRecords"
:columnsConfig="feedUsageRecordColumns"
/>
</div>
</template>
<script setup>
import GenericMonitorList from '../../components/GenericMonitorList.vue';
import { getFeedUsageRecords } from '../../api/monitor.js';
import { formatRFC3339 } from '../../utils/format.js';
// 适配通用组件的 fetchData prop
const fetchFeedUsageRecords = async (params) => {
return await getFeedUsageRecords(params);
};
// 定义表格的列配置
// 根据 swagger, 支持的筛选参数有: feed_formula_id, operator_id, pen_id, start_time, end_time
const feedUsageRecordColumns = [
{
title: '记录ID',
dataIndex: 'id',
key: 'id',
sorter: true,
minWidth: 100,
},
{
title: '用量(kg)',
dataIndex: 'amount',
key: 'amount',
sorter: true,
minWidth: 120,
},
{
title: '饲料配方',
dataIndex: ['feed_formula', 'name'], // 访问嵌套属性
key: 'feed_formula_name',
minWidth: 150,
},
{
title: '配方ID (筛选)',
dataIndex: 'feed_formula_id',
key: 'feed_formula_id',
filterType: 'number',
minWidth: 150,
},
{
title: '猪栏',
dataIndex: ['pen', 'name'], // 访问嵌套属性
key: 'pen_name',
minWidth: 120,
},
{
title: '猪栏ID (筛选)',
dataIndex: 'pen_id',
key: 'pen_id',
filterType: 'number',
minWidth: 150,
},
{
title: '操作员ID',
dataIndex: 'operator_id',
key: 'operator_id',
filterType: 'number',
minWidth: 120,
},
{
title: '记录时间',
dataIndex: 'recorded_at',
key: 'recorded_at',
sorter: true,
filterType: 'dateRange',
formatter: (row, column, cellValue) => formatRFC3339(cellValue),
minWidth: 180,
},
{
title: '备注',
dataIndex: 'remarks',
key: 'remarks',
minWidth: 200,
},
];
</script>
<style scoped>
.feed-usage-record-view {
/* 视图容器样式 */
}
</style>

View File

@@ -1,85 +0,0 @@
<template>
<div class="raw-material-purchases-view">
<GenericMonitorList
:fetchData="fetchRawMaterialPurchases"
:columnsConfig="rawMaterialPurchaseColumns"
/>
</div>
</template>
<script setup>
import GenericMonitorList from '../../components/GenericMonitorList.vue';
import { getRawMaterialPurchases } from '../../api/monitor.js';
import { formatRFC3339 } from '../../utils/format.js';
// 适配通用组件的 fetchData prop
const fetchRawMaterialPurchases = async (params) => {
return await getRawMaterialPurchases(params);
};
// 定义表格的列,依据 swagger.json
const rawMaterialPurchaseColumns = [
{
title: '采购ID',
dataIndex: 'id',
key: 'id',
sorter: true,
minWidth: 100,
},
{
title: '原料名称',
dataIndex: ['raw_material', 'name'], // 嵌套属性
key: 'raw_material_name',
minWidth: 150,
},
{
title: '原料ID',
dataIndex: 'raw_material_id',
key: 'raw_material_id',
filterType: 'number',
sorter: true,
minWidth: 120,
},
{
title: '供应商',
dataIndex: 'supplier',
key: 'supplier',
filterType: 'text',
minWidth: 150,
},
{
title: '数量',
dataIndex: 'amount',
key: 'amount',
sorter: true,
minWidth: 120,
},
{
title: '单价',
dataIndex: 'unit_price',
key: 'unit_price',
sorter: true,
minWidth: 120,
},
{
title: '总价',
dataIndex: 'total_price',
key: 'total_price',
sorter: true,
minWidth: 120,
},
{
title: '采购日期',
dataIndex: 'purchase_date',
key: 'purchase_date',
sorter: true,
filterType: 'dateRange',
formatter: (row, column, cellValue) => formatRFC3339(cellValue),
minWidth: 180,
},
];
</script>
<style scoped>
/* 视图容器样式 */
</style>

View File

@@ -1,81 +0,0 @@
<template>
<div class="raw-material-stock-logs-view">
<GenericMonitorList
:fetchData="fetchRawMaterialStockLogs"
:columnsConfig="rawMaterialStockLogColumns"
/>
</div>
</template>
<script setup>
import GenericMonitorList from '../../components/GenericMonitorList.vue';
import { getRawMaterialStockLogs } from '../../api/monitor.js';
import { formatRFC3339 } from '../../utils/format.js';
import { StockLogSourceType } from '../../enums.js';
// 适配通用组件的 fetchData prop
const fetchRawMaterialStockLogs = async (params) => {
return await getRawMaterialStockLogs(params);
};
// 定义表格的列,依据 swagger.json
const rawMaterialStockLogColumns = [
{
title: '记录ID',
dataIndex: 'id',
key: 'id',
sorter: true,
minWidth: 100,
},
{
title: '原料ID',
dataIndex: 'raw_material_id',
key: 'raw_material_id',
filterType: 'number',
sorter: true,
minWidth: 120,
},
{
title: '来源类型',
dataIndex: 'source_type',
key: 'source_type',
filterType: 'select',
filterOptions: Object.values(StockLogSourceType).map(value => ({ text: value, value: value })),
minWidth: 130,
},
{
title: '来源ID',
dataIndex: 'source_id',
key: 'source_id',
filterType: 'number',
sorter: true,
minWidth: 120,
},
{
title: '变更数量',
dataIndex: 'change_amount',
key: 'change_amount',
sorter: true,
minWidth: 120,
},
{
title: '发生时间',
dataIndex: 'happened_at',
key: 'happened_at',
sorter: true,
filterType: 'dateRange',
formatter: (row, column, cellValue) => formatRFC3339(cellValue),
minWidth: 180,
},
{
title: '备注',
dataIndex: 'remarks',
key: 'remarks',
minWidth: 200,
},
];
</script>
<style scoped>
/* 视图容器样式 */
</style>