@lambo-design/workflow-approve 1.0.0-beta.124 → 1.0.0-beta.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/workflow-diagram.vue +29 -3
package/package.json
CHANGED
package/src/workflow-diagram.vue
CHANGED
|
@@ -745,7 +745,8 @@ export default {
|
|
|
745
745
|
const sourceParentDone = sourceParent && doneNodeSet.has(sourceParent.id);
|
|
746
746
|
const targetIsDoneTask = target && doneNodeSet.has(target.id) || targetParentDone;
|
|
747
747
|
const sourceIsDoneTask = source && doneNodeSet.has(source.id) || sourceParentDone;
|
|
748
|
-
|
|
748
|
+
// 修改:严格判断连线是否已办,只有连线本身在doneLightSet中才视为已办
|
|
749
|
+
const isDoneLine = doneLightSet.has(element.id);
|
|
749
750
|
|
|
750
751
|
const edgeFutureVisible = edgeData.hasOwnProperty('futureVisible')
|
|
751
752
|
? edgeData.futureVisible
|
|
@@ -780,16 +781,36 @@ export default {
|
|
|
780
781
|
? nodeData.futureVisible
|
|
781
782
|
: !hiddenNodeSet.has(element.id);
|
|
782
783
|
|
|
783
|
-
//
|
|
784
|
+
// 检查是否有已办连线连接
|
|
784
785
|
const hasConnectedDone = element.incoming?.some(conn => {
|
|
785
786
|
const source = conn.source;
|
|
787
|
+
//连线本身已办或者连线的来源节点
|
|
786
788
|
return doneLightSet.has(conn.id) || (source && doneNodeSet.has(source.id));
|
|
787
789
|
}) || element.outgoing?.some(conn => {
|
|
788
790
|
const target = conn.target;
|
|
791
|
+
//连线本身已办或者连线的目标节点已办
|
|
789
792
|
return doneLightSet.has(conn.id) || (target && doneNodeSet.has(target.id));
|
|
790
793
|
});
|
|
791
794
|
|
|
792
|
-
|
|
795
|
+
// 检查是否同时连接到已办节点和预测路径上的节点
|
|
796
|
+
// 确保网关既连接了已办部分又连接了预测路径部分
|
|
797
|
+
// 只有同时满足这两个条件的网关才应该显示(除非它本身在预测路径中或已办)
|
|
798
|
+
const hasIncomingDone = element.incoming?.some(conn => {
|
|
799
|
+
const source = conn.source;
|
|
800
|
+
return doneLightSet.has(conn.id) || (source && doneNodeSet.has(source.id));
|
|
801
|
+
});
|
|
802
|
+
|
|
803
|
+
const hasOutgoingFuture = element.outgoing?.some(conn => {
|
|
804
|
+
const target = conn.target;
|
|
805
|
+
const connData = edgeMap.get(conn.id) || {};
|
|
806
|
+
return connData.futureVisible || (target && nodeMap.get(target.id)?.futureVisible);
|
|
807
|
+
});
|
|
808
|
+
|
|
809
|
+
// 严格网关显示条件,只有以下情况才显示网关:
|
|
810
|
+
// 1. 网关在预测路径中
|
|
811
|
+
// 2. 网关本身已办
|
|
812
|
+
// 3. 网关同时连接了已办节点和预测路径节点(双向连接,确保不是孤立网关)
|
|
813
|
+
const shouldDisplay = nodeFutureVisible || doneNodeSet.has(element.id) || (hasIncomingDone && hasOutgoingFuture);
|
|
793
814
|
if (!shouldDisplay) {
|
|
794
815
|
gfx.style.display = 'none';
|
|
795
816
|
return;
|
|
@@ -952,3 +973,8 @@ export default {
|
|
|
952
973
|
text-overflow: ellipsis;
|
|
953
974
|
}
|
|
954
975
|
</style>
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
|