From 478876ddc1c4baf79a3e1dbde6ee5d6b471b1219 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Tue, 20 Jan 2026 01:55:00 +0000 Subject: [PATCH] =?UTF-8?q?feat(workflow):=20=E5=9C=A8=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E9=85=8D=E7=BD=AE=E4=B8=AD=E6=B7=BB=E5=8A=A0=E8=A7=84?= =?UTF-8?q?=E5=88=99=E6=91=98=E8=A6=81=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在工作流展开后的配置表格上方添加规则摘要区块,根据实际配置动态展示: - 状态负责人规则:区分添加模式、流转模式、剔除模式的不同描述 - 限制负责人规则:显示仅限任务负责人和项目管理员修改状态 - 关联列表规则:显示流转时自动移动至指定列表 Co-Authored-By: Claude Opus 4.5 --- .../manage/components/ProjectWorkflow.vue | 77 +++++++++++++++++++ .../pages/components/project-workflow.scss | 68 ++++++++++++++++ 2 files changed, 145 insertions(+) diff --git a/resources/assets/js/pages/manage/components/ProjectWorkflow.vue b/resources/assets/js/pages/manage/components/ProjectWorkflow.vue index 5ccd80f9c..a70c272f4 100644 --- a/resources/assets/js/pages/manage/components/ProjectWorkflow.vue +++ b/resources/assets/js/pages/manage/components/ProjectWorkflow.vue @@ -30,6 +30,36 @@
+
+
+ + {{$L('工作流规则')}} +
+
+
+ + + +
+
+
{{$L('配置项')}}
@@ -269,6 +299,52 @@ export default { name: item.name, } }); + }, + + flowRulesMap() { + const map = {}; + const columnMap = {}; + this.columnList.forEach(col => { + columnMap[col.id] = col.name; + }); + + this.list.forEach(data => { + const rules = []; + data.project_flow_item.forEach(item => { + // 状态负责人规则 + if (item.userids && item.userids.length > 0) { + rules.push({ + type: 'owner', + name: item.name, + status: item.status, + userids: item.userids, + usertype: item.usertype + }); + } + + // 限制负责人规则(不依赖状态负责人) + if (item.userlimit === 1) { + rules.push({ + type: 'limit', + name: item.name, + status: item.status + }); + } + + // 关联列表规则 + if (item.columnid && columnMap[item.columnid]) { + rules.push({ + type: 'column', + name: item.name, + status: item.status, + columnName: columnMap[item.columnid] + }); + } + }); + map[data.id] = rules; + }); + + return map; } }, @@ -573,6 +649,7 @@ export default { } }); }, + } } diff --git a/resources/assets/sass/pages/components/project-workflow.scss b/resources/assets/sass/pages/components/project-workflow.scss index d4ba88359..c46324e5f 100644 --- a/resources/assets/sass/pages/components/project-workflow.scss +++ b/resources/assets/sass/pages/components/project-workflow.scss @@ -127,8 +127,76 @@ .taskflow-config { display: flex; + flex-direction: column; max-height: 100%; + .taskflow-config-rules { + flex-shrink: 0; + padding: 12px 20px; + margin-bottom: 12px; + background-color: #f7f8fa; + border-radius: 4px; + .rules-title { + display: flex; + align-items: center; + margin-bottom: 8px; + font-size: 13px; + font-weight: 500; + color: $primary-title-color; + > i { + margin-right: 4px; + font-size: 16px; + color: #1890ff; + } + } + .rules-list { + display: flex; + flex-direction: column; + gap: 8px; + } + .rules-item { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 4px; + font-size: 13px; + color: #666; + line-height: 24px; + .rule-status { + flex-shrink: 0; + padding: 2px 8px; + border-radius: 3px; + font-size: 12px; + &.start { + background-color: rgba($flow-status-start-color, 0.1); + color: $flow-status-start-color; + } + &.progress { + background-color: rgba($flow-status-progress-color, 0.1); + color: $flow-status-progress-color; + } + &.test { + background-color: rgba($flow-status-test-color, 0.1); + color: $flow-status-test-color; + } + &.end { + background-color: rgba($flow-status-end-color, 0.1); + color: $flow-status-end-color; + } + } + .rule-column { + padding: 2px 8px; + background-color: rgba(#1890ff, 0.1); + color: #1890ff; + border-radius: 3px; + font-size: 12px; + } + .common-avatar { + margin: 0 2px; + } + } + } + .taskflow-config-table { display: flex; width: 100%;