refactor(接口测试): 修改操作符

This commit is contained in:
q4speed 2020-09-23 17:00:19 +08:00
parent 7e0f378938
commit 777dfa18fe
5 changed files with 19 additions and 19 deletions

View File

@ -12,7 +12,7 @@
</el-select>
</el-col>
<el-col :span="6">
<el-input size="small" v-model="controller.value" :placeholder="$t('api_test.value')" v-if="!hasNullOperator"/>
<el-input size="small" v-model="controller.value" :placeholder="$t('api_test.value')" v-if="!hasEmptyOperator"/>
</el-col>
<el-col :span="4">
<el-switch v-model="controller.enable" :inactive-text="$t('api_test.scenario.enable_disable')"/>
@ -60,13 +60,13 @@ export default {
label: "commons.adv_search.operators.lt",
value: "<"
},
IS_NULL: {
label: "commons.adv_search.operators.is_null",
value: "is null"
IS_EMPTY: {
label: "commons.adv_search.operators.is_empty",
value: "is empty"
},
IS_NOT_NULL: {
label: "commons.adv_search.operators.is_not_null",
value: "is not null"
IS_NOT_EMPTY: {
label: "commons.adv_search.operators.is_not_empty",
value: "is not empty"
}
}
}
@ -89,14 +89,14 @@ export default {
this.visible = false;
},
change(value) {
if (value.indexOf("null") > 0 && !!this.controller.value) {
if (value.indexOf("empty") > 0 && !!this.controller.value) {
this.controller.value = "";
}
}
},
computed: {
hasNullOperator() {
return !!this.controller.operator && this.controller.operator.indexOf("null") > 0;
hasEmptyOperator() {
return !!this.controller.operator && this.controller.operator.indexOf("empty") > 0;
}
}
}

View File

@ -872,7 +872,7 @@ export class IfController extends Controller {
}
isValid() {
if (!!this.operator && this.operator.indexOf("null") > 0) {
if (!!this.operator && this.operator.indexOf("empty") > 0) {
return !!this.variable && !!this.operator;
}
return !!this.variable && !!this.operator && !!this.value;
@ -1240,13 +1240,13 @@ class JMXGenerator {
value = "\".*" + value + ".*\"";
}
if (operator === "is null") {
if (operator === "is empty") {
variable = "empty(\"" + variable + "\")";
operator = "";
value = "";
}
if (operator === "is not null") {
if (operator === "is not empty") {
variable = "!empty(\"" + variable + "\")";
operator = "";
value = "";

View File

@ -142,8 +142,8 @@ export default {
and: 'All',
or: 'any one',
operators: {
is_null: "Is null",
is_not_null: "Is not null",
is_empty: "Is empty",
is_not_empty: "Is not empty",
like: "Contains",
not_like: "Not included",
in: "Belong to",

View File

@ -142,8 +142,8 @@ export default {
and: '所有',
or: '任意一个',
operators: {
is_null: "空",
is_not_null: "非空",
is_empty: "空",
is_not_empty: "非空",
like: "包含",
not_like: "不包含",
in: "属于",

View File

@ -142,8 +142,8 @@ export default {
and: '所有',
or: '任意壹個',
operators: {
is_null: "空",
is_not_null: "非空",
is_empty: "空",
is_not_empty: "非空",
like: "包含",
not_like: "不包含",
in: "屬於",