fix(接口测试): 接口自动化中场景SQL添加变量,采用mock加函数保存不了,控制台报错

【场景变量添加常量及SQL添加变量,采用mock加函数保存不了,控制台报错】https://www.tapd.cn/33805590/bugtrace/bugs/view?bug_id=1133805590001008481
This commit is contained in:
wxg0103 2021-12-06 13:41:48 +08:00 committed by 刘瑞斌
parent cb6f8f716c
commit ebdf1a34f6
2 changed files with 14 additions and 5 deletions

View File

@ -30,7 +30,7 @@
:placeholder="$t('api_test.value')"
value-key="name"
highlight-first-item style="width: 100%">
<i slot="suffix" class="el-input__icon el-icon-edit pointer" @click="advanced"></i>
<i slot="suffix" class="el-input__icon el-icon-edit pointer" @click="advanced(item)"></i>
</el-autocomplete>
</el-col>
<el-col>
@ -48,7 +48,7 @@
</el-col>
</el-row>
</div>
<ms-api-variable-advance ref="variableAdvance"/>
<ms-api-variable-advance ref="variableAdvance" :current-item="currentItem" @advancedRefresh="reload"/>
</div>
</template>
@ -78,7 +78,9 @@ export default {
},
},
data() {
return {}
return {
currentItem: null
}
},
methods: {
remove: function (index) {
@ -115,8 +117,10 @@ export default {
isDisable: function (index) {
return this.items.length - 1 === index;
},
advanced() {
advanced(item) {
this.currentItem = item;
this.$refs.variableAdvance.open();
},
createFilter(queryString) {
return (variable) => {
@ -134,6 +138,12 @@ export default {
// callback
cb(results);
},
reload() {
this.isActive = false;
this.$nextTick(() => {
this.isActive = true;
});
},
},
created() {

View File

@ -167,7 +167,6 @@ export default {
methods: {
open() {
this.itemValueVisible = true;
this.itemValue = this.currentItem.value;
},
prepareData() {
if (this.scenario) {