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%;