From 160527a3ac5bc38da8601ba43fd20a4b658916c1 Mon Sep 17 00:00:00 2001 From: lixiaolong <702156524@qq.com> Date: Thu, 20 Aug 2026 13:36:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(flow):=20=E6=B7=BB=E5=8A=A0=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86=E5=92=8C?= =?UTF-8?q?=E8=8D=89=E7=A8=BF=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 flowSaveDraft、flowVersionList、flowVersionDetail 等API接口 - 添加工作流草稿保存和版本历史记录功能 - 实现版本预览、恢复为草稿和回退版本功能 - 在界面添加版本标签显示当前发布版本信息 - 集成版本历史抽屉组件展示发布记录列表 - 添加发布说明输入框和确认对话框 - 实现版本比较和状态跟踪功能 --- src/api/flow/flow.js | 20 +++ src/views/flow/index.vue | 278 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 295 insertions(+), 3 deletions(-) diff --git a/src/api/flow/flow.js b/src/api/flow/flow.js index f8e7878..572a89b 100644 --- a/src/api/flow/flow.js +++ b/src/api/flow/flow.js @@ -9,6 +9,26 @@ export function flowDeploy(data) { }) } +export function flowSaveDraft(data) { + return request({ url: '/flow/draft', method: 'put', data }) +} + +export function flowVersionList(itemId) { + return request({ url: `/flow/versions/${itemId}`, method: 'get' }) +} + +export function flowVersionDetail(versionId) { + return request({ url: `/flow/version/${versionId}`, method: 'get' }) +} + +export function flowRestoreDraft(versionId, data) { + return request({ url: `/flow/version/${versionId}/restore-draft`, method: 'post', data }) +} + +export function flowRollbackVersion(versionId, data) { + return request({ url: `/flow/version/${versionId}/rollback`, method: 'post', data }) +} + export function flowExecute(data) { return request({ url: '/flow/execute', diff --git a/src/views/flow/index.vue b/src/views/flow/index.vue index 2df0c93..76f4bb2 100644 --- a/src/views/flow/index.vue +++ b/src/views/flow/index.vue @@ -12,8 +12,14 @@ {{ stateMap[flowState] }} + + 当前发布 V{{ publishedVersionNo }} + + + 正在查看 V{{ previewingVersionNo }} + -
+
{{ totalRunningTime }}ms @@ -47,6 +53,16 @@
+ + 保存 + + + 发布记录 +
+
+ 退出预览 +
@@ -310,6 +329,33 @@
+ + +
+ +
+
+
+ V{{ version.versionNo }} + 当前发布 + 回退版本 +
+
+ {{ version.createBy || '未知用户' }} · {{ version.createTime || '-' }} +
+
{{ version.publishNote }}
+
+
+ 查看 + 恢复为草稿 + + 回退 + +
+
+
+
+