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

View File

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

View File

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

View File

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

View File

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