fix(接口自动化): 修复参数设置中提取参数无法获取 jsonpath 数据问题

This commit is contained in:
junhong 2022-01-12 14:56:20 +08:00 committed by jianxing
parent e93296167e
commit 330dfa0f2e
1 changed files with 14 additions and 1 deletions

View File

@ -128,12 +128,13 @@
<!-- 步骤组件--> <!-- 步骤组件-->
<ms-component-config <ms-component-config
:isMax="true" :isMax="true"
:node="node"
:project-list="projectList" :project-list="projectList"
:if-from-variable-advance="ifFromVariableAdvance" :if-from-variable-advance="ifFromVariableAdvance"
:type="data.type" :type="data.type"
:scenario="data" :scenario="data"
:env-map="projectEnvMap" :env-map="projectEnvMap"
:node="node"/> />
</span> </span>
</el-tree> </el-tree>
</div> </div>
@ -161,8 +162,10 @@
:type="item.type" :type="item.type"
:scenario="item" :scenario="item"
:env-map="projectEnvMap" :env-map="projectEnvMap"
:response="response"
:draggable="false" :draggable="false"
@savePreParams="savePreParams" @savePreParams="savePreParams"
@suggestClick="suggestClick"
v-if="selectedTreeNode && selectedNode && filterSonNode(item)"/> v-if="selectedTreeNode && selectedNode && filterSonNode(item)"/>
</div> </div>
</div> </div>
@ -315,6 +318,7 @@
asideHidden: false, asideHidden: false,
scenarioRootTree: undefined, scenarioRootTree: undefined,
insideClick: false, insideClick: false,
response: {},
} }
}, },
computed: { computed: {
@ -655,6 +659,15 @@
// //
this.getAllExtractDataByNode(); this.getAllExtractDataByNode();
}, },
// jsonpath
suggestClick(node) {
this.response = {};
if (node && node.parent && node.parent.data.requestResult) {
this.response = node.parent.data.requestResult[0];
} else if (this.selectedNode) {
this.response = this.selectedNode.data.requestResult[0];
}
},
} }
} }
</script> </script>