fix(接口测试): mock期望设置中,请求体中的json-schema值输入框不提示mockJs的数据

mock期望设置中,请求体中的json-schema值输入框不提示mockJs的数据

Closes #23171
This commit is contained in:
song-tianyang 2023-03-27 19:25:21 +08:00 committed by 建国
parent cdb2c8b40e
commit 7d4082bc2e
1 changed files with 7 additions and 5 deletions

View File

@ -58,7 +58,7 @@ export default {
}; };
}, },
watch: { watch: {
"schema.type": { 'schema.type': {
handler() { handler() {
this.schema.mock = this.mock; this.schema.mock = this.mock;
}, },
@ -86,10 +86,12 @@ export default {
methods: { methods: {
funcSearch(queryString, cb) { funcSearch(queryString, cb) {
let results = []; let results = [];
if (!this.disabled && this.needMock) {
if (!this.showMockVars) { if (!this.showMockVars) {
let funcs = MOCKJS_FUNC.concat(JMETER_FUNC); let funcs = MOCKJS_FUNC.concat(JMETER_FUNC);
results = queryString ? funcs.filter(this.funcFilter(queryString)) : funcs; results = queryString ? funcs.filter(this.funcFilter(queryString)) : funcs;
} }
}
// callback // callback
cb(results); cb(results);
}, },