diff --git a/backend/src/main/java/io/metersphere/base/domain/Notice.java b/backend/src/main/java/io/metersphere/base/domain/Notice.java index 572407b455..3a66172eec 100644 --- a/backend/src/main/java/io/metersphere/base/domain/Notice.java +++ b/backend/src/main/java/io/metersphere/base/domain/Notice.java @@ -6,15 +6,17 @@ import java.io.Serializable; @Data public class Notice implements Serializable { + private String id; + private String event; private String testId; private String name; - private String email; - private String enable; + private String type; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/NoticeExample.java b/backend/src/main/java/io/metersphere/base/domain/NoticeExample.java index faee41158a..b762ddfbf3 100644 --- a/backend/src/main/java/io/metersphere/base/domain/NoticeExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/NoticeExample.java @@ -104,6 +104,76 @@ public class NoticeExample { criteria.add(new Criterion(condition, value1, value2)); } + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(String value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(String value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(String value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(String value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(String value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(String value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLike(String value) { + addCriterion("id like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotLike(String value) { + addCriterion("id not like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(String value1, String value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(String value1, String value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + public Criteria andEventIsNull() { addCriterion("EVENT is null"); return (Criteria) this; @@ -314,76 +384,6 @@ public class NoticeExample { return (Criteria) this; } - public Criteria andEmailIsNull() { - addCriterion("EMAIL is null"); - return (Criteria) this; - } - - public Criteria andEmailIsNotNull() { - addCriterion("EMAIL is not null"); - return (Criteria) this; - } - - public Criteria andEmailEqualTo(String value) { - addCriterion("EMAIL =", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailNotEqualTo(String value) { - addCriterion("EMAIL <>", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailGreaterThan(String value) { - addCriterion("EMAIL >", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailGreaterThanOrEqualTo(String value) { - addCriterion("EMAIL >=", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailLessThan(String value) { - addCriterion("EMAIL <", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailLessThanOrEqualTo(String value) { - addCriterion("EMAIL <=", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailLike(String value) { - addCriterion("EMAIL like", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailNotLike(String value) { - addCriterion("EMAIL not like", value, "email"); - return (Criteria) this; - } - - public Criteria andEmailIn(List values) { - addCriterion("EMAIL in", values, "email"); - return (Criteria) this; - } - - public Criteria andEmailNotIn(List values) { - addCriterion("EMAIL not in", values, "email"); - return (Criteria) this; - } - - public Criteria andEmailBetween(String value1, String value2) { - addCriterion("EMAIL between", value1, value2, "email"); - return (Criteria) this; - } - - public Criteria andEmailNotBetween(String value1, String value2) { - addCriterion("EMAIL not between", value1, value2, "email"); - return (Criteria) this; - } - public Criteria andEnableIsNull() { addCriterion("`ENABLE` is null"); return (Criteria) this; @@ -453,6 +453,76 @@ public class NoticeExample { addCriterion("`ENABLE` not between", value1, value2, "enable"); return (Criteria) this; } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("`type` like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("`type` not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/src/main/java/io/metersphere/base/mapper/NoticeMapper.java b/backend/src/main/java/io/metersphere/base/mapper/NoticeMapper.java index 4ca41aabdf..c1cba6f589 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/NoticeMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/NoticeMapper.java @@ -2,21 +2,30 @@ package io.metersphere.base.mapper; import io.metersphere.base.domain.Notice; import io.metersphere.base.domain.NoticeExample; -import java.util.List; import org.apache.ibatis.annotations.Param; +import java.util.List; + public interface NoticeMapper { long countByExample(NoticeExample example); int deleteByExample(NoticeExample example); + int deleteByPrimaryKey(String id); + int insert(Notice record); int insertSelective(Notice record); List selectByExample(NoticeExample example); + Notice selectByPrimaryKey(String id); + int updateByExampleSelective(@Param("record") Notice record, @Param("example") NoticeExample example); int updateByExample(@Param("record") Notice record, @Param("example") NoticeExample example); + + int updateByPrimaryKeySelective(Notice record); + + int updateByPrimaryKey(Notice record); } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/NoticeMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/NoticeMapper.xml index 9e59138b2c..89aba89f3a 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/NoticeMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/NoticeMapper.xml @@ -2,11 +2,12 @@ + - + @@ -67,7 +68,7 @@ - EVENT, TEST_ID, `NAME`, EMAIL, `ENABLE` + id, EVENT, TEST_ID, `NAME`, `ENABLE`, `type` + + + DELETE FROM notice + WHERE id = #{id,jdbcType=VARCHAR} + delete from notice @@ -90,14 +101,17 @@ - insert into notice (EVENT, TEST_ID, `NAME`, - EMAIL, `ENABLE`) - values (#{event,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{email,jdbcType=VARCHAR}, #{enable,jdbcType=VARCHAR}) + INSERT INTO notice (id, EVENT, TEST_ID, + `NAME`, `ENABLE`, `type`) + VALUES (#{id,jdbcType=VARCHAR}, #{event,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR}, + #{name,jdbcType=VARCHAR}, #{enable,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}) insert into notice + + id, + EVENT, @@ -107,14 +121,17 @@ `NAME`, - - EMAIL, - `ENABLE`, + + `type`, + + + #{id,jdbcType=VARCHAR}, + #{event,jdbcType=VARCHAR}, @@ -124,12 +141,12 @@ #{name,jdbcType=VARCHAR}, - - #{email,jdbcType=VARCHAR}, - #{enable,jdbcType=VARCHAR}, + + #{type,jdbcType=VARCHAR}, + @@ -19,6 +19,7 @@ show-word-limit/> + @@ -42,7 +43,6 @@ keyPlaceholder: String, valuePlaceholder: String, description: String, - isShowEnable: Boolean, items: Array, isReadOnly: { type: Boolean, @@ -52,7 +52,6 @@ }, data() { return { - // checkedValues: [] } }, computed: { @@ -66,11 +65,6 @@ methods: { remove: function (index) { - if (this.isShowEnable) { - // 移除勾选内容 - let checkIndex = this.checkedValues.indexOf(this.items[index].uuid); - checkIndex != -1 ? this.checkedValues.splice(checkIndex, 1) : this.checkedValues; - } // 移除整行输入控件及内容 this.items.splice(index, 1); this.$emit('change', this.items); diff --git a/frontend/src/business/components/api/test/components/ApiScenarioForm.vue b/frontend/src/business/components/api/test/components/ApiScenarioForm.vue index 63177173ca..636b65b6f7 100644 --- a/frontend/src/business/components/api/test/components/ApiScenarioForm.vue +++ b/frontend/src/business/components/api/test/components/ApiScenarioForm.vue @@ -29,7 +29,7 @@ - diff --git a/frontend/src/business/components/api/test/components/ApiScenarioVariables.vue b/frontend/src/business/components/api/test/components/ApiScenarioVariables.vue index 6725d8fc30..236b3b2555 100644 --- a/frontend/src/business/components/api/test/components/ApiScenarioVariables.vue +++ b/frontend/src/business/components/api/test/components/ApiScenarioVariables.vue @@ -5,8 +5,8 @@
- - + @@ -41,10 +41,6 @@ type: Boolean, default: false }, - isShowEnable: { - type: Boolean, - default: false - }, showVariable: { type: Boolean, default: true @@ -52,16 +48,10 @@ }, data() { return { - checkedValues: [] } }, methods: { remove: function (index) { - if (this.isShowEnable) { - // 移除勾选内容 - let checkIndex = this.checkedValues.indexOf(this.items[index].uuid); - checkIndex != -1 ? this.checkedValues.splice(checkIndex, 1) : this.checkedValues; - } this.items.splice(index, 1); this.$emit('change', this.items); }, @@ -69,10 +59,6 @@ let isNeedCreate = true; let removeIndex = -1; this.items.forEach((item, index) => { - // 启用行赋值 - if (this.isShowEnable) { - item.enable = this.checkedValues.indexOf(item.uuid) != -1 ? true : false; - } if (!item.name && !item.value) { // 多余的空行 if (index !== this.items.length - 1) { @@ -83,20 +69,11 @@ } }); if (isNeedCreate) { - // 往后台送入的复选框值布尔值 - if (this.isShowEnable) { - this.items[this.items.length - 1].enable = true; - // v-model 选中状态 - this.checkedValues.push(this.items[this.items.length - 1].uuid); - } - this.items.push(new KeyValue()); + this.items.push(new KeyValue({enable: true})); } this.$emit('change', this.items); // TODO 检查key重复 }, - uuid: function () { - return (((1 + Math.random()) * 0x100000) | 0).toString(16).substring(1); - }, isDisable: function (index) { return this.items.length - 1 === index; } @@ -104,15 +81,7 @@ created() { if (this.items.length === 0) { - this.items.push(new KeyValue()); - }else if (this.isShowEnable) { - this.items.forEach((item, index) => { - let uuid = this.uuid(); - item.uuid = uuid; - if (item.enable) { - this.checkedValues.push(uuid); - } - }) + this.items.push(new KeyValue({enable: true})); } } } diff --git a/frontend/src/business/components/common/components/MsScheduleEdit.vue b/frontend/src/business/components/common/components/MsScheduleEdit.vue index 0fcddf2e4e..05faf10a2f 100644 --- a/frontend/src/business/components/common/components/MsScheduleEdit.vue +++ b/frontend/src/business/components/common/components/MsScheduleEdit.vue @@ -1,5 +1,5 @@