From 0ff82657ab05596bed8da1af688d02901d9c4e2f Mon Sep 17 00:00:00 2001
From: huang <1724659546@qq.com>
Date: Wed, 29 Oct 2025 19:42:48 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8F=A3=E5=92=8C?=
=?UTF-8?q?=E8=B0=83=E7=94=A8=E6=96=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/swagger.json | 109 +++++++++++++++++---
src/api/plan.js | 44 ++++++--
src/components/PlanDetail.vue | 28 ++---
src/views/monitor/PlanExecutionLogsView.vue | 6 ++
src/views/plan/PlanList.vue | 31 ++++--
5 files changed, 180 insertions(+), 38 deletions(-)
diff --git a/docs/swagger.json b/docs/swagger.json
index 41154569..30072e07 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -3595,7 +3595,7 @@
"BearerAuth": []
}
],
- "description": "获取所有计划的列表",
+ "description": "获取所有计划的列表,支持按类型过滤和分页",
"produces": [
"application/json"
],
@@ -3603,6 +3603,36 @@
"计划管理"
],
"summary": "获取计划列表",
+ "parameters": [
+ {
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页大小",
+ "name": "pageSize",
+ "in": "query"
+ },
+ {
+ "enum": [
+ "所有任务",
+ "自定义任务",
+ "系统任务"
+ ],
+ "type": "string",
+ "x-enum-varnames": [
+ "PlanTypeFilterAll",
+ "PlanTypeFilterCustom",
+ "PlanTypeFilterSystem"
+ ],
+ "description": "计划类型",
+ "name": "planType",
+ "in": "query"
+ }
+ ],
"responses": {
"200": {
"description": "业务码为200代表成功获取列表",
@@ -3615,10 +3645,7 @@
"type": "object",
"properties": {
"data": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/dto.PlanResponse"
- }
+ "$ref": "#/definitions/dto.ListPlansResponse"
}
}
}
@@ -3728,7 +3755,7 @@
"BearerAuth": []
}
],
- "description": "根据计划ID更新计划的详细信息。",
+ "description": "根据计划ID更新计划的详细信息。系统计划不允许修改。",
"consumes": [
"application/json"
],
@@ -3784,7 +3811,7 @@
"BearerAuth": []
}
],
- "description": "根据计划ID删除计划。(软删除)",
+ "description": "根据计划ID删除计划。(软删除)系统计划不允许删除。",
"produces": [
"application/json"
],
@@ -3818,7 +3845,7 @@
"BearerAuth": []
}
],
- "description": "根据计划ID启动一个计划的执行。",
+ "description": "根据计划ID启动一个计划的执行。系统计划不允许手动启动。",
"produces": [
"application/json"
],
@@ -3852,7 +3879,7 @@
"BearerAuth": []
}
],
- "description": "根据计划ID停止一个正在执行的计划。",
+ "description": "根据计划ID停止一个正在执行的计划。系统计划不能被停止。",
"produces": [
"application/json"
],
@@ -4149,6 +4176,7 @@
2001,
4000,
4001,
+ 4003,
4004,
4009,
5000,
@@ -4158,6 +4186,7 @@
"CodeBadRequest": "请求参数错误",
"CodeConflict": "资源冲突",
"CodeCreated": "创建成功",
+ "CodeForbidden": "禁止访问",
"CodeInternalError": "服务器内部错误",
"CodeNotFound": "资源未找到",
"CodeServiceUnavailable": "服务不可用",
@@ -4169,6 +4198,7 @@
"创建成功",
"请求参数错误",
"未授权",
+ "禁止访问",
"资源未找到",
"资源冲突",
"服务器内部错误",
@@ -4179,6 +4209,7 @@
"CodeCreated",
"CodeBadRequest",
"CodeUnauthorized",
+ "CodeForbidden",
"CodeNotFound",
"CodeConflict",
"CodeInternalError",
@@ -4739,6 +4770,21 @@
}
}
},
+ "dto.ListPlansResponse": {
+ "type": "object",
+ "properties": {
+ "plans": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/dto.PlanResponse"
+ }
+ },
+ "total": {
+ "type": "integer",
+ "example": 100
+ }
+ }
+ },
"dto.ListRawMaterialPurchaseResponse": {
"type": "object",
"properties": {
@@ -5434,6 +5480,9 @@
"plan_id": {
"type": "integer"
},
+ "plan_name": {
+ "type": "string"
+ },
"started_at": {
"type": "string"
},
@@ -5488,6 +5537,14 @@
"type": "string",
"example": "猪舍温度控制计划"
},
+ "plan_type": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/models.PlanType"
+ }
+ ],
+ "example": "自定义任务"
+ },
"status": {
"allOf": [
{
@@ -6732,6 +6789,17 @@
"PlanStatusFailed"
]
},
+ "models.PlanType": {
+ "type": "string",
+ "enum": [
+ "自定义任务",
+ "系统任务"
+ ],
+ "x-enum-varnames": [
+ "PlanTypeCustom",
+ "PlanTypeSystem"
+ ]
+ },
"models.SensorType": {
"type": "string",
"enum": [
@@ -6787,22 +6855,26 @@
"enum": [
"计划分析",
"等待",
- "下料"
+ "下料",
+ "全量采集"
],
"x-enum-comments": {
"TaskPlanAnalysis": "解析Plan的Task列表并添加到待执行队列的特殊任务",
+ "TaskTypeFullCollection": "新增的全量采集任务",
"TaskTypeReleaseFeedWeight": "下料口释放指定重量任务",
"TaskTypeWaiting": "等待任务"
},
"x-enum-descriptions": [
"解析Plan的Task列表并添加到待执行队列的特殊任务",
"等待任务",
- "下料口释放指定重量任务"
+ "下料口释放指定重量任务",
+ "新增的全量采集任务"
],
"x-enum-varnames": [
"TaskPlanAnalysis",
"TaskTypeWaiting",
- "TaskTypeReleaseFeedWeight"
+ "TaskTypeReleaseFeedWeight",
+ "TaskTypeFullCollection"
]
},
"models.ValueDescriptor": {
@@ -6836,6 +6908,19 @@
"NotifierTypeLog"
]
},
+ "repository.PlanTypeFilter": {
+ "type": "string",
+ "enum": [
+ "所有任务",
+ "自定义任务",
+ "系统任务"
+ ],
+ "x-enum-varnames": [
+ "PlanTypeFilterAll",
+ "PlanTypeFilterCustom",
+ "PlanTypeFilterSystem"
+ ]
+ },
"zapcore.Level": {
"type": "integer",
"format": "int32",
diff --git a/src/api/plan.js b/src/api/plan.js
index bd37a776..fe7ea8fd 100644
--- a/src/api/plan.js
+++ b/src/api/plan.js
@@ -1,7 +1,7 @@
import http from '../utils/http';
/**
- * @typedef {('计划分析'|'等待'|'下料')} TaskType
+ * @typedef {('计划分析'|'等待'|'下料'|'全量采集')} TaskType
*/
/**
@@ -67,6 +67,10 @@ import http from '../utils/http';
* @typedef {('子计划'|'任务')} PlanContentType
*/
+/**
+ * @typedef {('自定义任务'|'系统任务')} PlanType
+ */
+
/**
* @typedef {object} PlanResponse
* @property {number} id
@@ -78,17 +82,41 @@ import http from '../utils/http';
* @property {number} execute_count
* @property {PlanStatus} status
* @property {PlanContentType} content_type
+ * @property {PlanType} plan_type
* @property {Array