From ebdf1a34f6d6a1841905a5dce7d1d9c2ca746d21 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Mon, 6 Dec 2021 13:41:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8=E5=8C=96=E4=B8=AD=E5=9C=BA?= =?UTF-8?q?=E6=99=AFSQL=E6=B7=BB=E5=8A=A0=E5=8F=98=E9=87=8F=EF=BC=8C?= =?UTF-8?q?=E9=87=87=E7=94=A8mock=E5=8A=A0=E5=87=BD=E6=95=B0=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E4=B8=8D=E4=BA=86=EF=BC=8C=E6=8E=A7=E5=88=B6=E5=8F=B0?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【场景变量添加常量及SQL添加变量,采用mock加函数保存不了,控制台报错】https://www.tapd.cn/33805590/bugtrace/bugs/view?bug_id=1133805590001008481 --- .../components/ApiScenarioVariables.vue | 18 ++++++++++++++---- .../api/test/components/ApiVariableAdvance.vue | 1 - 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/frontend/src/business/components/api/definition/components/ApiScenarioVariables.vue b/frontend/src/business/components/api/definition/components/ApiScenarioVariables.vue index c6654488a1..48e8704907 100644 --- a/frontend/src/business/components/api/definition/components/ApiScenarioVariables.vue +++ b/frontend/src/business/components/api/definition/components/ApiScenarioVariables.vue @@ -30,7 +30,7 @@ :placeholder="$t('api_test.value')" value-key="name" highlight-first-item style="width: 100%"> - + @@ -48,7 +48,7 @@ - + @@ -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() { diff --git a/frontend/src/business/components/api/test/components/ApiVariableAdvance.vue b/frontend/src/business/components/api/test/components/ApiVariableAdvance.vue index 2621d1af93..4be9f71876 100644 --- a/frontend/src/business/components/api/test/components/ApiVariableAdvance.vue +++ b/frontend/src/business/components/api/test/components/ApiVariableAdvance.vue @@ -167,7 +167,6 @@ export default { methods: { open() { this.itemValueVisible = true; - this.itemValue = this.currentItem.value; }, prepareData() { if (this.scenario) {