From ae21aff20da458d761e972d5f99b69dda3a997a8 Mon Sep 17 00:00:00 2001 From: dengbf Date: Wed, 3 Dec 2025 17:50:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?-=20[=E4=BF=AE=E5=A4=8D]=20#[15675796912537?= =?UTF-8?q?63]if=E5=B7=A5=E5=85=B7=E4=B8=AD=E7=9A=84runner=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E7=9A=84=E5=B7=A5=E5=85=B7=E5=BC=95=E7=94=A8=E4=B8=8D?= =?UTF-8?q?=E4=BA=86if=E5=A4=96=E7=9A=84runner=E6=89=A7=E8=A1=8C=E7=9A=84?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E7=9A=84=E8=BE=93=E5=87=BA=E5=8F=82=E6=95=B0?= =?UTF-8?q?=20http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947?= =?UTF-8?q?543040/939050947543057/1567579691253763=20-=20[=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D]=20#[1567594421649411]if=E9=87=8C=E9=9D=A2=E5=A5=97if?= =?UTF-8?q?=EF=BC=8C=E7=AC=AC=E4=BA=8C=E5=B1=82=E4=B8=AD=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=AC=AC=E4=B8=80=E5=B1=82=E4=B8=AD=E7=9A=84?= =?UTF-8?q?json=E8=BE=93=E5=87=BA=20http://192.168.0.96:8090/demo/rdm.html?= =?UTF-8?q?#/bug-detail/939050947543040/939050947543057/1567594421649411?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/script/item/condition-tool.vue | 2 + .../components/script/item/condition/tool.vue | 7 +- .../components/script/item/loop-block.vue | 1 + .../script/item/param/inputparam.vue | 20 ++-- .../components/script/script-list.vue | 33 ++++++- .../detail/actionDetail/step/step-config.vue | 97 +++++++------------ .../pipeline/step/step-config.vue | 97 +++++++------------ 7 files changed, 114 insertions(+), 143 deletions(-) diff --git a/src/views/pages/autoexec/components/script/item/condition-tool.vue b/src/views/pages/autoexec/components/script/item/condition-tool.vue index aa711822..b6a9bbee 100644 --- a/src/views/pages/autoexec/components/script/item/condition-tool.vue +++ b/src/views/pages/autoexec/components/script/item/condition-tool.vue @@ -31,6 +31,7 @@ :config="config" :canEdit="canEdit" :stepIndex="prevStepList && prevStepList.length||0" + :prevList="prevList" :prevStepList="prevStepList" :combopConfig="combopConfig" :paramList="paramList" @@ -50,6 +51,7 @@ :config="config" :canEdit="canEdit" :stepIndex="prevStepList && prevStepList.length||0" + :prevList="prevList" :prevStepList="prevStepList" :combopConfig="combopConfig" :paramList="paramList" diff --git a/src/views/pages/autoexec/components/script/item/condition/tool.vue b/src/views/pages/autoexec/components/script/item/condition/tool.vue index eca01399..be7bcc72 100644 --- a/src/views/pages/autoexec/components/script/item/condition/tool.vue +++ b/src/views/pages/autoexec/components/script/item/condition/tool.vue @@ -18,6 +18,7 @@ :failPolicyOption="failPolicyOption" :inputTypeList="inputTypeList" :execMode="execMode" + :parentPrevOperationList="prevList" @sortList="sortList" > @@ -47,7 +48,11 @@ export default { }, props: { title: String, - list: Array // 工具列表 + list: Array, // 工具列表 + prevList: { + type: Array, + default: () => [] + } }, data() { return { diff --git a/src/views/pages/autoexec/components/script/item/loop-block.vue b/src/views/pages/autoexec/components/script/item/loop-block.vue index bd00eb93..d51e7ec7 100644 --- a/src/views/pages/autoexec/components/script/item/loop-block.vue +++ b/src/views/pages/autoexec/components/script/item/loop-block.vue @@ -43,6 +43,7 @@ :config="config" :canEdit="canEdit" :stepIndex="prevStepList && prevStepList.length||0" + :prevList="prevList" :prevStepList="prevStepList" :combopConfig="combopConfig" :paramList="paramList" diff --git a/src/views/pages/autoexec/components/script/item/param/inputparam.vue b/src/views/pages/autoexec/components/script/item/param/inputparam.vue index 39f2c88a..0f2d7888 100644 --- a/src/views/pages/autoexec/components/script/item/param/inputparam.vue +++ b/src/views/pages/autoexec/components/script/item/param/inputparam.vue @@ -32,20 +32,10 @@ - + - - - { return []; } + }, + parentPrevOperationList: { //父级上游工具列表 + type: Array, + default: () => { + return []; + } } }, data() { @@ -396,6 +402,25 @@ export default { this.currentStep = null; this.description = ''; this.showDialog = false; + }, + getPrevOperation(list) { + let operationList = []; + list.forEach(item => { + operationList.push(item); + if (item.config && !this.$utils.isEmpty(item.config.ifList)) { + operationList.push(...item.config.ifList); + operationList.push(...this.getPrevOperation(item.config.ifList)); + } + if (item.config && !this.$utils.isEmpty(item.config.elseList)) { + operationList.push(...item.config.elseList); + operationList.push(...this.getPrevOperation(item.config.elseList)); + } + if (item.config && !this.$utils.isEmpty(item.config.operations)) { + operationList.push(...item.config.elseList); + operationList.push(...this.getPrevOperation(item.config.operations)); + } + }); + return operationList; } }, computed: { @@ -406,6 +431,9 @@ export default { return function(index, prevStepList) { let list = []; let newList = []; + if (!this.$utils.isEmpty(this.parentPrevOperationList)) { + list.push(...this.parentPrevOperationList); + } //当前阶段的前面的所有输出参数 if (prevStepList && prevStepList.length) { list.push(...prevStepList); @@ -414,6 +442,7 @@ export default { newList = this.list.filter((l, lindex) => { return lindex < index; }); + newList = this.getPrevOperation(newList); newList.forEach(n => { if (n.operation && n.operation.outputParamList && n.operation.outputParamList.length) { let item = n.operation.outputParamList; @@ -435,8 +464,8 @@ export default { }, getFirstStatus() { return function(stepIndex, scriptIndex) { - //判断当前脚本是否第一个阶段的第一个脚本,此时没有选择上游输出参数的选项 - return !stepIndex && !scriptIndex; + //判断当前脚本是否第一个阶段的第一个脚本或者父级工具不存在上游工具,此时没有选择上游输出参数的选项 + return !stepIndex && !scriptIndex && this.$utils.isEmpty(this.parentPrevOperationList); }; }, typeText() { diff --git a/src/views/pages/autoexec/detail/actionDetail/step/step-config.vue b/src/views/pages/autoexec/detail/actionDetail/step/step-config.vue index fcfb42f2..d8143da8 100644 --- a/src/views/pages/autoexec/detail/actionDetail/step/step-config.vue +++ b/src/views/pages/autoexec/detail/actionDetail/step/step-config.vue @@ -258,6 +258,39 @@ export default { }, refreshProfile() { this.$refs.list && this.$refs.list.refreshProfile(); + }, + getPrevOutputParamList(list, l) { + let allPrevOutputList = []; + list.forEach(item => { + if (item.operation.outputParamList && item.operation.outputParamList.length > 0) { + let outputParamList = item.operation.outputParamList; + outputParamList.forEach(i => { + allPrevOutputList.push({ + ...i, + combopName: l.name, + combopId: l.id, + combopUuid: l.uuid, + operationId: item.operationId, + operationName: item.operationName, + operationUuid: item.uuid, + operationLetter: item.letter || null, + operationDes: item.description + }); + }); + } + if (item.config) { + if (item.config.ifList && item.config.ifList.length > 0) { + allPrevOutputList.push(...this.getPrevOutputParamList(item.config.ifList, l)); + } + if (item.config.elseList && item.config.elseList.length > 0) { + allPrevOutputList.push(...this.getPrevOutputParamList(item.config.elseList, l)); + } + if (item.config.operations && item.config.operations.length > 0) { + allPrevOutputList.push(...this.getPrevOutputParamList(item.config.operations, l)); + } + } + }); + return allPrevOutputList; } }, computed: { @@ -293,69 +326,7 @@ export default { if (list && list.length) { list.forEach(l => { if (l.config && l.config.phaseOperationList && l.config.phaseOperationList.length > 0) { - l.config.phaseOperationList.forEach(p => { - if (p.operation.outputParamList && p.operation.outputParamList.length > 0) { - let item = p.operation.outputParamList; - item.forEach(i => { - allPrevOutputList.push({ - ...i, - combopName: l.name, - combopId: l.id, - combopUuid: l.uuid, - operationId: p.operationId, - operationName: p.operationName, - operationUuid: p.uuid, - operationLetter: p.letter || null, - operationDes: p.description - }); - }); - } else if (p.operationName == 'native/IF-Block') { - if (p.config) { - if (p.config.ifList && p.config.ifList.length > 0) { - let ifList = p.config.ifList; - ifList.forEach(ifItem => { - if (ifItem.operation.outputParamList && ifItem.operation.outputParamList.length > 0) { - let item = ifItem.operation.outputParamList; - item.forEach(i => { - allPrevOutputList.push({ - ...i, - combopName: l.name, - combopId: l.id, - combopUuid: l.uuid, - operationId: ifItem.operationId, - operationName: ifItem.operationName, - operationUuid: ifItem.uuid, - operationLetter: ifItem.letter || null, - operationDes: ifItem.description - }); - }); - } - }); - } - if (p.config.elseList && p.config.elseList.length > 0) { - let elseList = p.config.elseList; - elseList.forEach(elseItem => { - if (elseItem.operation.outputParamList && elseItem.operation.outputParamList.length > 0) { - let item = elseItem.operation.outputParamList; - item.forEach(i => { - allPrevOutputList.push({ - ...i, - combopName: l.name, - combopId: l.id, - combopUuid: l.uuid, - operationId: elseItem.operationId, - operationName: elseItem.operationName, - operationUuid: elseItem.uuid, - operationLetter: elseItem.letter || null, - operationDes: elseItem.description - }); - }); - } - }); - } - } - } - }); + allPrevOutputList.push(...this.getPrevOutputParamList(l.config.phaseOperationList, l)); } }); } diff --git a/src/views/pages/deploy/application-config/pipeline/step/step-config.vue b/src/views/pages/deploy/application-config/pipeline/step/step-config.vue index e0bcbccc..877d8099 100644 --- a/src/views/pages/deploy/application-config/pipeline/step/step-config.vue +++ b/src/views/pages/deploy/application-config/pipeline/step/step-config.vue @@ -178,6 +178,39 @@ export default { return true; } } + }, + getPrevOutputParamList(list, l) { + let allPrevOutputList = []; + list.forEach(item => { + if (item.operation.outputParamList && item.operation.outputParamList.length > 0) { + let outputParamList = item.operation.outputParamList; + outputParamList.forEach(i => { + allPrevOutputList.push({ + ...i, + combopName: l.name, + combopId: l.id, + combopUuid: l.uuid, + operationId: item.operationId, + operationName: item.operationName, + operationUuid: item.uuid, + operationLetter: item.letter || null, + operationDes: item.description + }); + }); + } + if (item.config) { + if (item.config.ifList && item.config.ifList.length > 0) { + allPrevOutputList.push(...this.getPrevOutputParamList(item.config.ifList, l)); + } + if (item.config.elseList && item.config.elseList.length > 0) { + allPrevOutputList.push(...this.getPrevOutputParamList(item.config.elseList, l)); + } + if (item.config.operations && item.config.operations.length > 0) { + allPrevOutputList.push(...this.getPrevOutputParamList(item.config.operations, l)); + } + } + }); + return allPrevOutputList; } }, computed: { @@ -201,69 +234,7 @@ export default { if (list && list.length) { list.forEach(l => { if (l.config && l.config.phaseOperationList && l.config.phaseOperationList.length > 0) { - l.config.phaseOperationList.forEach(p => { - if (!this.$utils.isEmpty(p.operation) && p.operation.outputParamList && p.operation.outputParamList.length > 0) { - let item = p.operation.outputParamList; - item.forEach(i => { - allPrevOutputList.push({ - ...i, - combopName: l.name, - combopId: l.id, - combopUuid: l.uuid, - operationId: p.operationId, - operationName: p.operationName, - operationUuid: p.uuid, - operationLetter: p.letter || null, - operationDes: p.description - }); - }); - } else if (p.operationName == 'native/IF-Block') { - if (p.config) { - if (p.config.ifList && p.config.ifList.length > 0) { - let ifList = p.config.ifList; - ifList.forEach(ifItem => { - if (ifItem.operation.outputParamList && ifItem.operation.outputParamList.length > 0) { - let item = ifItem.operation.outputParamList; - item.forEach(i => { - allPrevOutputList.push({ - ...i, - combopName: l.name, - combopId: l.id, - combopUuid: l.uuid, - operationId: ifItem.operationId, - operationName: ifItem.operationName, - operationUuid: ifItem.uuid, - operationLetter: ifItem.letter || null, - operationDes: ifItem.description - }); - }); - } - }); - } - if (p.config.elseList && p.config.elseList.length > 0) { - let elseList = p.config.elseList; - elseList.forEach(elseItem => { - if (elseItem.operation.outputParamList && elseItem.operation.outputParamList.length > 0) { - let item = elseItem.operation.outputParamList; - item.forEach(i => { - allPrevOutputList.push({ - ...i, - combopName: l.name, - combopId: l.id, - combopUuid: l.uuid, - operationId: elseItem.operationId, - operationName: elseItem.operationName, - operationUuid: elseItem.uuid, - operationLetter: elseItem.letter || null, - operationDes: elseItem.description - }); - }); - } - }); - } - } - } - }); + allPrevOutputList.push(...this.getPrevOutputParamList(l.config.phaseOperationList, l)); } }); } -- Gitee From cfb9462420538694b82797897b8ed73f8412bd91 Mon Sep 17 00:00:00 2001 From: dengbf Date: Wed, 3 Dec 2025 18:07:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?-=20[=E5=85=B3=E8=81=94]=20#[15675796912537?= =?UTF-8?q?63]if=E5=B7=A5=E5=85=B7=E4=B8=AD=E7=9A=84runner=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E7=9A=84=E5=B7=A5=E5=85=B7=E5=BC=95=E7=94=A8=E4=B8=8D?= =?UTF-8?q?=E4=BA=86if=E5=A4=96=E7=9A=84runner=E6=89=A7=E8=A1=8C=E7=9A=84?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E7=9A=84=E8=BE=93=E5=87=BA=E5=8F=82=E6=95=B0?= =?UTF-8?q?=20http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947?= =?UTF-8?q?543040/939050947543057/1567579691253763?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../autoexec/components/script/item/param/argumentparam.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/pages/autoexec/components/script/item/param/argumentparam.vue b/src/views/pages/autoexec/components/script/item/param/argumentparam.vue index 3efdab1f..278db03e 100644 --- a/src/views/pages/autoexec/components/script/item/param/argumentparam.vue +++ b/src/views/pages/autoexec/components/script/item/param/argumentparam.vue @@ -326,7 +326,8 @@ export default { } else { subList[nameArr.indexOf(res.value)].children.push({ value: ele[level2], - label: ele['operationName'] + (ele.operationLetter ? ('_' + ele.operationLetter) : '') + (ele.operationDes ? '[' + ele.operationDes + ']' : ''), + // label: ele['operationName'] + (ele.operationLetter ? ('_' + ele.operationLetter) : '') + (ele.operationDes ? '[' + ele.operationDes + ']' : ''), //相同工具标识自增operationLetter + label: ele['operationName'] + (ele.operationDes ? '[' + ele.operationDes + ']' : ''), operationDes: ele.operationDes, children: [{ value: ele[level3], @@ -340,7 +341,8 @@ export default { label: res.label, children: [{ value: ele[level2], - label: ele['operationName'] + (ele.operationLetter ? ('_' + ele.operationLetter) : '') + (ele.operationDes ? '[' + ele.operationDes + ']' : ''), + // label: ele['operationName'] + (ele.operationLetter ? ('_' + ele.operationLetter) : '') + (ele.operationDes ? '[' + ele.operationDes + ']' : ''), + label: ele['operationName'] + (ele.operationDes ? '[' + ele.operationDes + ']' : ''), operationDes: ele.operationDes, children: [{ value: ele[level3], -- Gitee