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 aa7118224808a6ab974fbf7186ffc6b58f91b3cb..b6a9bbee7b87e146f9d6a33145859b21cd006fd8 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 eca01399757c46b4c41221458f91731c73b923c1..be7bcc7218ea68f6b2b672465dcc203d30917b1e 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 bd00eb9310da07018aac11133c7d060a7df12785..d51e7ec7b0e70fdee5b80b3ea256d4b306435001 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/argumentparam.vue b/src/views/pages/autoexec/components/script/item/param/argumentparam.vue index 3efdab1ff6be6e7f2d2e2885e8db46299a3e6d96..278db03ee119be111a1eaadeb26f99e7bd88a24c 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], 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 39f2c88ad99932aeeb2b93eed7eb37fc217164b9..0f2d7888107f35db06f8e66576a875613d15e01d 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 fcfb42f261bc922a1ada3c918800f6f3a69198eb..d8143da840cb6ef8435af51638804d5f3a473656 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 e0bcbccc8295d896bbbbb22305b8a181856044db..877d8099a8f1b117cb893d06f8f58d9d53377ff5 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)); } }); }