Skip to content

Commit 64b713d

Browse files
authored
feat: 子流程节点高亮 #ignore (#527)
* feat: 子流程节点高亮 #ignore # Reviewed, transaction id: 67547 * feat: 子流程节点高亮 #ignore # Reviewed, transaction id: 67548
1 parent 624a8a7 commit 64b713d

File tree

5 files changed

+40
-14
lines changed

5 files changed

+40
-14
lines changed

frontend/src/components/canvas/StageCanvas/SubStageCanvas.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,14 @@
6262
type: Boolean,
6363
default: false,
6464
},
65+
activeNodeId: {
66+
type: String,
67+
default: null,
68+
},
6569
},
6670
data() {
6771
return {
68-
activeNode: null,
72+
6973
loadedTemplate: false,
7074
pluginsDetail: { component: {}, uniform_api: {}, blueking: {} },
7175
};
@@ -77,6 +81,12 @@
7781
activities() {
7882
return this.pipelineTree.activities || {};
7983
},
84+
activeNode() {
85+
if (this.activeNodeId) {
86+
return this.activities[this.activeNodeId];
87+
}
88+
return null;
89+
},
8090
},
8191
watch: {
8292
async templateId() {
@@ -111,8 +121,8 @@
111121
onUpdateNodeInfo() {
112122
// 外部依赖不能删
113123
},
114-
setActiveItem(node) {
115-
this.activeNode = node;
124+
setActiveItem() {
125+
// this.activeNode = node;
116126
},
117127
cancelJobAndStageEidtSld() {
118128
this.setActiveItem(null);

frontend/src/components/canvas/StageCanvas/components/JobNode.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
:nodes="job.nodes"
6464
:plugins-detail="pluginsDetail"
6565
:editable="editable"
66+
:active-node="activeNode"
6667
:show-not-allow-move="notAllowMoveIndex === nodeIndex"
6768
:is-execute="isExecute"
6869
:activities="activities"

frontend/src/components/canvas/StageCanvas/components/StepNode.vue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div
33
class="node"
4-
:class="{ active:activeNode?.id === node.id,isPreview:!editable,isExecute,[ETaskStatusTypeMap[status].class]:true, isSkip }"
4+
:class="{ active:activeNode?.id === currentNode?.id,isPreview:!editable,isExecute,[ETaskStatusTypeMap[status].class]:true, isSkip }"
55
@click="handleNode(currentNode)">
66
<div class="node-icon">
77
<span
@@ -139,7 +139,6 @@
139139
</div>
140140
</template>
141141
<script>
142-
import { mapState } from 'vuex';
143142
import { ETaskStatusType, ETaskStatusTypeMap } from '../data';
144143
import { SYSTEM_GROUP_ICON } from '@/constants/index.js';
145144
import { getDurationTime } from '../utils';
@@ -177,6 +176,10 @@ export default {
177176
type: Boolean,
178177
default: true,
179178
},
179+
activeNode: {
180+
type: Object,
181+
default: null,
182+
},
180183
},
181184
data() {
182185
return {
@@ -214,9 +217,6 @@ export default {
214217
};
215218
},
216219
computed: {
217-
...mapState({
218-
activeNode: state => state.stageCanvas.activeNode,
219-
}),
220220
status() {
221221
return this.node.state || ETaskStatusType.PENDING;
222222
},
@@ -248,6 +248,7 @@ export default {
248248
this.node.state === ETaskStatusType.RUNNING ? new Date().toString() : this.node.finish_time,
249249
);
250250
},
251+
251252
},
252253
methods: {
253254
handleNode(node) {
@@ -327,8 +328,11 @@ export default {
327328
}
328329
}
329330
&.active {
330-
border: 1px solid #3A83FF;
331-
background-color: rgba(58, 131, 255, 0.05);
331+
// border: 1px solid #3A83FF;
332+
// background-color: rgba(58, 131, 255, 0.05);
333+
.node-title {
334+
color: #2050d2;
335+
}
332336
}
333337
.info-icon{
334338
.info-icon-item{

frontend/src/views/task/TaskExecute/SideDrawerExecuteInfo.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
:is-stage-canvas-task-execute="!!currentSubflowTaskId"
100100
:space-id="spaceId"
101101
:gateways="processGateway"
102+
:active-node-id="defaultActiveId"
102103
:instance-id="currentSubflowTaskId"
103104
:pipeline-tree="subCanvasData"
104105
:template-id="subTemplateId"

frontend/src/views/task/TaskExecute/TaskOperationHeader.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,18 @@
8282
class="sub-task-btns">
8383
<i class="common-icon-box-top-right-corner icon-link-to-father" />
8484
<p
85-
class="view-father-process"
86-
@click="onViewFatherProcessExecute">
87-
{{ $t('查看父流程') }}
85+
class="view-father-process">
86+
<JumpLinkBKFlowOrExternal
87+
:get-target-url="onViewFatherProcessExecute"
88+
:query="{
89+
id:parentTaskInfo.task_id,
90+
type:'jumpParentTask'
91+
}">
92+
{{ $t('查看父流程') }}
93+
</JumpLinkBKFlowOrExternal>
8894
</p>
95+
96+
8997
<span class="dividing-line" />
9098
<span :class="statusMap[parentTaskInfo.state].icon" />
9199
<span class="state-text">{{ statusMap[parentTaskInfo.state].text }}</span>
@@ -140,11 +148,13 @@
140148
// import PageHeader from '@/components/layout/PageHeader.vue'
141149
import { mapState } from 'vuex';
142150
import i18n from '@/config/i18n/index.js';
151+
import JumpLinkBKFlowOrExternal from '@/components/common/JumpLinkBKFlowOrExternal.vue';
143152
144153
export default {
145154
name: 'TaskOperationHeader',
146155
components: {
147156
// PageHeader,
157+
JumpLinkBKFlowOrExternal,
148158
},
149159
mixins: [permission],
150160
props: {
@@ -315,7 +325,7 @@
315325
instanceId: this.parentTaskInfo.task_id,
316326
},
317327
});
318-
window.open(href, '_blank');
328+
return href;
319329
},
320330
},
321331
};

0 commit comments

Comments
 (0)