liukx 2 лет назад
Родитель
Сommit
7f4e337cdf
15 измененных файлов с 183 добавлено и 109 удалено
  1. 6 4
      .gitignore
  2. 2 0
      jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/componts/ElasticSearchPartitionImpl.java
  3. 35 2
      jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/controllers/AlertPlatformController.java
  4. 16 2
      jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/controllers/AlertRuleController.java
  5. 1 1
      jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/controllers/crud/BaseSimpleCrudController.java
  6. 8 1
      jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/models/entity/es/AlertPlatformConfigIndex.java
  7. 4 0
      jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/models/entity/es/AlertRuleConfigIndex.java
  8. 2 62
      jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/models/request/alert/AlertRuleRequest.java
  9. 24 4
      jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/report/alert/AlertDataCacheImpl.java
  10. 32 0
      jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/report/alert/AlertDataService.java
  11. 6 2
      jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/store/es/AbstractCRUDElasticSearch.java
  12. 22 2
      jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/utils/ESUtils.java
  13. 4 1
      jay-monitor-data-server/src/main/resources/static/js/elab-common.js
  14. 2 22
      jay-monitor-data-server/src/main/resources/templates/alert/list.html
  15. 19 6
      jay-monitor-data-server/src/main/resources/templates/alertPlatform/list.html

+ 6 - 4
.gitignore

@@ -1,4 +1,6 @@
-/jay-monitor-data-server/target/
-/jay-monitor-data-client/target/
-/jay-monitor-data-api/target/
-*.iml
+!/jay-monitor-data-server/target/
+!/jay-monitor-data-client/target/
+!/jay-monitor-data-api/target/
+!*.iml
+!/.idea/
+!/jay-monitor-data-web.iml

+ 2 - 0
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/componts/ElasticSearchPartitionImpl.java

@@ -184,6 +184,8 @@ public class ElasticSearchPartitionImpl<T, M> extends ElasticsearchTemplateImpl<
         if (indexResponse.getResult() == DocWriteResponse.Result.CREATED) {
             this.logger.info("INDEX CREATE SUCCESS");
             this.elasticsearchIndex.rollover(indexEntity.getClass(), true);
+            String idResult = indexResponse.getId();
+            ESUtils.setId(indexEntity, idResult);
         } else {
             if (indexResponse.getResult() != DocWriteResponse.Result.UPDATED) {
                 return false;

+ 35 - 2
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/controllers/AlertPlatformController.java

@@ -2,11 +2,13 @@ package com.jay.monitor.data.server.controllers;//package com.jay.monitor.data.s
 
 import com.jay.monitor.data.core.model.response.PageResponseModel;
 import com.jay.monitor.data.core.utils.JsonHelper;
+import com.jay.monitor.data.core.utils.ResponseUtils;
 import com.jay.monitor.data.server.componts.html.DefaultDataRender;
 import com.jay.monitor.data.server.controllers.crud.BaseSimpleCrudController;
 import com.jay.monitor.data.server.enums.AlertMsgEnums;
 import com.jay.monitor.data.server.models.request.alert.AlertPlatformConfigRequest;
 import com.jay.monitor.data.server.models.store.AlertPlatformConfig;
+import com.jay.monitor.data.server.report.alert.AlertDataService;
 import com.jay.monitor.data.server.store.IAlertPlatformProcess;
 import com.jay.monitor.data.server.store.ISimpleCrudProcess;
 import com.jay.monitor.data.server.utils.HtmlComponentUtils;
@@ -23,8 +25,6 @@ import java.util.List;
 
 import static com.jay.monitor.data.server.controllers.AlertPlatformController.PREFIX_URL;
 
-//import com.jay.monitor.data.server.services.impl.DefaultBackstageRouteService;
-
 /**
  * 后台路由管理
  *
@@ -51,6 +51,9 @@ public class AlertPlatformController extends BaseSimpleCrudController<AlertPlatf
     @Autowired
     private IAlertPlatformProcess alertPlatformProcess;
 
+    @Autowired
+    private AlertDataService alertDataService;
+
     @Override
     public ISimpleCrudProcess getCrudProcess() {
         return alertPlatformProcess;
@@ -87,7 +90,12 @@ public class AlertPlatformController extends BaseSimpleCrudController<AlertPlatf
 
     @Override
     protected void addBefore(AlertPlatformConfig req) {
+        checkExpression(req);
+    }
 
+    @Override
+    protected void addAfter(AlertPlatformConfig req, boolean result) {
+        refreshPlatformId(req.getId());
     }
 
     @Override
@@ -99,9 +107,34 @@ public class AlertPlatformController extends BaseSimpleCrudController<AlertPlatf
         modelAfter(model, alertPlatformConfig);
     }
 
+    @Override
+    protected void updateBefore(AlertPlatformConfig req) {
+        checkExpression(req);
+    }
+
+    @Override
+    protected void updateAfter(AlertPlatformConfig req, boolean result) {
+        refreshPlatformId(req.getId());
+    }
+
+    public void refreshPlatformId(String id) {
+        alertDataService.refreshPlatformId(id);
+    }
+
+    @Override
+    protected void deleteAfter(AlertPlatformConfig req, boolean result) {
+        refreshPlatformId(req.getId());
+    }
+
     @Override
     protected void modelAfter(Model model, AlertPlatformConfig entity) {
         List<DefaultDataRender> alertPlatformList = HtmlComponentUtils.convertDataRender(AlertMsgEnums.class);
         model.addAttribute("alertPlatformList", JsonHelper.toJsonString(alertPlatformList));
     }
+
+    private void checkExpression(AlertPlatformConfig req) {
+        ResponseUtils.checkNull(req.getAlertName(), "告警组名称不能为空!");
+        ResponseUtils.checkNull(req.getPlatformType(), "告警类型不能为空!");
+        ResponseUtils.checkNull(req.getUrl(), "告警url不能为空!");
+    }
 }

+ 16 - 2
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/controllers/AlertRuleController.java

@@ -2,6 +2,7 @@ package com.jay.monitor.data.server.controllers;//package com.jay.monitor.data.s
 
 import com.jay.monitor.data.core.model.response.PageResponseModel;
 import com.jay.monitor.data.core.utils.JsonHelper;
+import com.jay.monitor.data.core.utils.ResponseUtils;
 import com.jay.monitor.data.server.componts.html.DefaultDataRender;
 import com.jay.monitor.data.server.controllers.crud.BaseSimpleCrudController;
 import com.jay.monitor.data.server.enums.AlertMsgEnums;
@@ -107,7 +108,7 @@ public class AlertRuleController extends BaseSimpleCrudController<AlertRuleReque
 
     @Override
     protected void addAfter(AlertRuleConfig req, boolean result) {
-        alertDataService.refreshRuleId(req.getId());
+        refreshId(req.getId());
     }
 
     @Override
@@ -133,12 +134,25 @@ public class AlertRuleController extends BaseSimpleCrudController<AlertRuleReque
         modelAfter(model, entity);
     }
 
+    @Override
+    protected void deleteAfter(AlertRuleConfig req, boolean result) {
+        refreshId(req.getId());
+    }
+
     @Override
     protected void updateAfter(AlertRuleConfig req, boolean result) {
-        alertDataService.refreshRuleId(req.getId());
+        refreshId(req.getId());
+    }
+
+    private void refreshId(String id) {
+        alertDataService.refreshRuleId(id);
     }
 
     private void checkExpression(AlertRuleConfig req) {
+        ResponseUtils.checkNull(req.getRuleName(), "规则名称不能为空!");
+        ResponseUtils.checkNull(req.getProject(), "项目名称不能为空!");
+        ResponseUtils.checkNull(req.getAlertPlatformList(), "告警平台组不能为空!");
+        ResponseUtils.checkNull(req.getRuleNodes(), "告警规则不能为空!");
         //        CommonDataDTO commonDataDTO = new CommonDataDTO(MsgTypeEnums.MQ);
         //        MatchRuleEnums ruleType = req.getRuleType();
         //        if (MatchRuleEnums.expression == ruleType) {

+ 1 - 1
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/controllers/crud/BaseSimpleCrudController.java

@@ -65,7 +65,6 @@ public abstract class BaseSimpleCrudController<REQ, T> {
         return "/add";
     }
 
-
     protected void modelAfter(Model model, T entity) {
 
     }
@@ -138,6 +137,7 @@ public abstract class BaseSimpleCrudController<REQ, T> {
         deleteBefore(request);
         Object id = BeanUtil.getFieldValue(request, "id");
         boolean update = getCrudProcess().delete(id.toString());
+        deleteAfter(request, update);
         return ResponseUtils.trues();
     }
 }

+ 8 - 1
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/models/entity/es/AlertPlatformConfigIndex.java

@@ -1,6 +1,8 @@
 package com.jay.monitor.data.server.models.entity.es;
 
+import com.jay.monitor.data.server.anno.ESSearch;
 import com.jay.monitor.data.server.enums.AlertMsgEnums;
+import com.jay.monitor.data.server.enums.ESQuerySyntax;
 import org.zxp.esclientrhl.annotation.ESID;
 import org.zxp.esclientrhl.annotation.ESMetaData;
 
@@ -13,7 +15,10 @@ import java.util.Date;
  * @Email liukx@elab-plus.com
  * @date 2021/9/6 - 19:47
  */
-@ESMetaData(indexName = "jay_monitor_alert_platform", number_of_shards = 5, number_of_replicas = 0, printLog = true)
+@ESMetaData(indexName = "jay_monitor_alert_platform",
+    number_of_shards = 5,
+    number_of_replicas = 0,
+    printLog = true)
 public class AlertPlatformConfigIndex {
 
     @ESID
@@ -27,6 +32,8 @@ public class AlertPlatformConfigIndex {
     /**
      * 告警名称
      */
+    @ESSearch(fieldName = "alertName",
+        value = ESQuerySyntax.like)
     private String alertName;
 
     /**

+ 4 - 0
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/models/entity/es/AlertRuleConfigIndex.java

@@ -1,5 +1,7 @@
 package com.jay.monitor.data.server.models.entity.es;
 
+import com.jay.monitor.data.server.anno.ESSearch;
+import com.jay.monitor.data.server.enums.ESQuerySyntax;
 import com.jay.monitor.data.server.enums.MatchRuleEnums;
 import com.jay.monitor.data.server.models.store.AlertPlatformNode;
 import com.jay.monitor.data.server.models.store.AlertRuleNode;
@@ -22,10 +24,12 @@ public class AlertRuleConfigIndex {
     /**
      * 规则名称
      */
+    @ESSearch(fieldName = "ruleName", value = ESQuerySyntax.like)
     private String ruleName;
     /**
      * 项目名称 , ALL 应用所有项目
      */
+    @ESSearch(fieldName = "project", value = ESQuerySyntax.like)
     private String project;
     /**
      * 规则类型, 该类型会基于字段值去做计算

+ 2 - 62
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/models/request/alert/AlertRuleRequest.java

@@ -1,6 +1,7 @@
 package com.jay.monitor.data.server.models.request.alert;
 
-import com.jay.monitor.data.server.enums.MatchRuleEnums;
+import com.jay.monitor.data.server.anno.ESSearch;
+import com.jay.monitor.data.server.enums.ESQuerySyntax;
 import com.jay.monitor.data.server.models.request.trace.PageRequest;
 
 import java.util.Date;
@@ -22,33 +23,12 @@ public class AlertRuleRequest extends PageRequest {
      * 项目名称 , ALL 应用所有项目
      */
     private String project;
-    /**
-     * 规则描述
-     */
-    private String title;
-    /**
-     * 字段名称
-     */
-    private String fieldName;
-    /**
-     * 字段值
-     */
-    private String fieldValue;
-    /**
-     * 规则类型, 该类型会基于字段值去做计算
-     */
-    private MatchRuleEnums ruleType;
 
     /**
      * 告警编号
      */
     private String alertPlatformId;
 
-    /**
-     * 状态
-     */
-    private Integer status;
-
     private String creator;
 
     private Date created;
@@ -57,14 +37,6 @@ public class AlertRuleRequest extends PageRequest {
 
     private Date updated;
 
-    public Integer getStatus() {
-        return status;
-    }
-
-    public void setStatus(Integer status) {
-        this.status = status;
-    }
-
     public String getCreator() {
         return creator;
     }
@@ -105,38 +77,6 @@ public class AlertRuleRequest extends PageRequest {
         this.alertPlatformId = alertPlatformId;
     }
 
-    public MatchRuleEnums getRuleType() {
-        return ruleType;
-    }
-
-    public void setRuleType(MatchRuleEnums ruleType) {
-        this.ruleType = ruleType;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public String getFieldName() {
-        return fieldName;
-    }
-
-    public void setFieldName(String fieldName) {
-        this.fieldName = fieldName;
-    }
-
-    public String getFieldValue() {
-        return fieldValue;
-    }
-
-    public void setFieldValue(String fieldValue) {
-        this.fieldValue = fieldValue;
-    }
-
     public String getId() {
         return id;
     }

+ 24 - 4
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/report/alert/AlertDataCacheImpl.java

@@ -10,6 +10,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
 
 import java.util.HashSet;
 import java.util.List;
@@ -73,6 +74,14 @@ public class AlertDataCacheImpl implements AlertDataService {
         return getCacheAlertPlatform(id);
     }
 
+    @Override
+    public void refreshPlatformId(String id) {
+        if (StringUtils.isEmpty(id)) {
+            return;
+        }
+        refreshAlertPlatformCache(id);
+    }
+
     private void removeRuleIdCache(String ruleId) {
         AlertRuleConfig alertRule = getCacheRuleId(ruleId);
         if (alertRule != null) {
@@ -139,7 +148,7 @@ public class AlertDataCacheImpl implements AlertDataService {
      * @param id
      * @return
      */
-    public AlertRuleConfig getCacheRuleId(String id) {
+    private AlertRuleConfig getCacheRuleId(String id) {
         // 查找相关的项目
         return (AlertRuleConfig)cacheMap.computeIfAbsent(PREFIX_RULE_ID + id, k -> searchRuleCacheId(id));
     }
@@ -150,7 +159,7 @@ public class AlertDataCacheImpl implements AlertDataService {
      * @param project
      * @return
      */
-    public List<AlertRuleConfig> getCacheRuleList(String project) {
+    private List<AlertRuleConfig> getCacheRuleList(String project) {
         Set<String> projectRuleList =
             (Set<String>)cacheMap.getOrDefault(PREFIX_RULE_PROJECT + project, new HashSet<>());
         return projectRuleList.stream().map(this::getCacheRuleId).collect(Collectors.toList());
@@ -162,7 +171,7 @@ public class AlertDataCacheImpl implements AlertDataService {
      * @param id
      * @return
      */
-    public AlertPlatformConfig searchForceAlertPlatform(String id) {
+    private AlertPlatformConfig searchForceAlertPlatform(String id) {
         return alertPlatformProcess.queryById(id);
     }
 
@@ -172,11 +181,22 @@ public class AlertDataCacheImpl implements AlertDataService {
      * @param id
      * @return
      */
-    public AlertPlatformConfig getCacheAlertPlatform(String id) {
+    private AlertPlatformConfig getCacheAlertPlatform(String id) {
         return (AlertPlatformConfig)cacheMap
             .computeIfAbsent(PREFIX_PLATFORM + id, k -> this.searchForceAlertPlatform(id));
     }
 
+    private void refreshAlertPlatformCache(String id) {
+        AlertPlatformConfig config = this.searchForceAlertPlatform(id);
+        if (config == null) {
+            cacheMap.remove(PREFIX_PLATFORM + id);
+            logger.debug("平台编号:{} 清理完成!", id);
+        } else {
+            cacheMap.put(PREFIX_PLATFORM + id, config);
+            logger.debug("平台编号:{} -> {} 刷新完成!", id, config.getAlertName());
+        }
+    }
+
     public void refreshAlertPlatformCache(Map<String, Object> cacheMap) {
         AlertPlatformConfig config = new AlertPlatformConfig();
         config.setStatus(1);

+ 32 - 0
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/report/alert/AlertDataService.java

@@ -20,14 +20,46 @@ public interface AlertDataService {
      */
     public List<AlertRuleConfig> getRuleList(String project);
 
+    /**
+     * 获取规则编号获取规则配置
+     *
+     * @param id
+     * @return
+     */
     public AlertRuleConfig getRuleId(String id);
 
+    /**
+     * 根据平台组编号获取平台组配置
+     *
+     * @param id
+     * @return
+     */
     public AlertPlatformConfig getAlertPlatform(String id);
 
+    /**
+     * 刷新平台编号
+     *
+     * @param id
+     */
+    public void refreshPlatformId(String id);
+
+    /**
+     * 强制关闭规则
+     *
+     * @param ruleId
+     */
     public void forceCloseRule(String ruleId);
 
+    /**
+     * 刷新规则编号
+     *
+     * @param ruleId
+     */
     public void refreshRuleId(String ruleId);
 
+    /**
+     * 刷新当前缓存
+     */
     public void refreshCache();
 
 }

+ 6 - 2
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/store/es/AbstractCRUDElasticSearch.java

@@ -56,8 +56,9 @@ public abstract class AbstractCRUDElasticSearch<ENTITY, REQ> {
             // 初始化值
             BeanUtil.setFieldValue(entity, "createDate", new Date());
             BeanUtil.setFieldValue(entity, "id", null);
-
-            return elasticSearchPartition.save(entity);
+            boolean save = elasticSearchPartition.save(entity);
+            ESUtils.setId(req, entity);
+            return save;
         } catch (Exception e) {
             logger.error("es 保存失败", e);
         }
@@ -96,6 +97,9 @@ public abstract class AbstractCRUDElasticSearch<ENTITY, REQ> {
     }
 
     protected REQ convertReq(ENTITY entity) throws Exception {
+        if (entity == null) {
+            return null;
+        }
         REQ req = getReqClazz().newInstance();
         BeanUtils.copyProperties(entity, req);
         return req;

+ 22 - 2
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/utils/ESUtils.java

@@ -5,10 +5,13 @@ import com.jay.monitor.data.server.anno.ESSearch;
 import com.jay.monitor.data.server.enums.ESQuerySyntax;
 import com.jay.monitor.data.server.models.entity.es.JayMonitorMQIndex;
 import jdk.nashorn.internal.ir.annotations.Ignore;
+import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.lang3.reflect.FieldUtils;
 import org.elasticsearch.index.query.BoolQueryBuilder;
 import org.elasticsearch.index.query.QueryBuilder;
 import org.elasticsearch.index.query.QueryBuilders;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.core.annotation.AnnotationUtils;
 import org.springframework.util.ObjectUtils;
 
@@ -18,7 +21,7 @@ import java.util.Date;
 import java.util.List;
 
 public class ESUtils {
-
+    private static final Logger LOGGER = LoggerFactory.getLogger(ESUtils.class);
     private static List<Class> typeList =
         Arrays.asList(Integer.class, String.class, Date.class, Double.class, Long.class);
 
@@ -41,7 +44,7 @@ public class ESUtils {
                     continue;
                 }
 
-                if(value instanceof Date){
+                if (value instanceof Date) {
                     value = ((Date)value).getTime();
                 }
 
@@ -67,6 +70,23 @@ public class ESUtils {
         return boolQueryBuilder;
     }
 
+    public static void setId(Object target, Object idSource) {
+        try {
+            String id = BeanUtils.getProperty(idSource, "id");
+            setId(target, id);
+        } catch (Exception e) {
+            LOGGER.warn("填充ID对象失败:{} -> {}", idSource.toString(), target.toString());
+        }
+    }
+
+    public static void setId(Object obj, String id) {
+        try {
+            BeanUtils.setProperty(obj, "id", id);
+        } catch (Exception e) {
+            LOGGER.warn("没有对象:{}找到对应的id属性 : {}", obj.toString(), e.getMessage());
+        }
+    }
+
     public static void main(String[] args) throws Exception {
         JayMonitorMQIndex index = new JayMonitorMQIndex();
         index.setRequestTime(11111L);

+ 4 - 1
jay-monitor-data-server/src/main/resources/static/js/elab-common.js

@@ -368,14 +368,17 @@ var elab_common = function () {
         table.on('tool(list_table)', function (obj) {
             var field = obj.data;
             if (obj.event === 'del') {
-                layer.confirm('确定删除此行?', function () {
+                layer.confirm('确定删除此行?', function (index) {
                     obj.del();
                     // 向服务端发送删除指令
                     var requestData = {id: field.id, status: -1, updated: new Date()};
                     elab_common.postReq(delServiceUrl, requestData, function (data) {
                         if (!data.success) {
                             layer.alert(data.message);
+                        }else{
+                            layer.msg("操作成功!")
                         }
+                        layer.close(index);
                     });
                 });
             } else if (obj.event === 'edit') {

+ 2 - 22
jay-monitor-data-server/src/main/resources/templates/alert/list.html

@@ -23,28 +23,7 @@
 <div class="x-body">
     <div class="layui-row">
         <form class="layui-form layui-col-md12">
-            <!--            <div class="layui-form-item">-->
-            <!--                <label class="layui-form-label">单行选择框</label>-->
-            <!--                <div class="layui-input-block">-->
-            <!--                    <select name="interest" lay-filter="aihao">-->
-            <!--                        <option value=""></option>-->
-            <!--                        <option value="0">写作</option>-->
-            <!--                        <option value="1" selected="">阅读</option>-->
-            <!--                        <option value="2">游戏</option>-->
-            <!--                        <option value="3">音乐</option>-->
-            <!--                        <option value="4">旅行</option>-->
-            <!--                    </select>-->
-            <!--                </div>-->
-            <!--            </div>-->
             <div class="layui-form-item layui-col-md12">
-<!--                <div class="layui-col-md4">-->
-<!--                    <label class="layui-form-label">平台告警类型</label>-->
-<!--                    <div class="layui-input-block">-->
-<!--                        <select id="q_platformType" name="platformType">-->
-
-<!--                        </select>-->
-<!--                    </div>-->
-<!--                </div>-->
                 <div class="layui-col-md4">
                     <label class="layui-form-label">告警组</label>
                     <div class="layui-input-block">
@@ -127,10 +106,11 @@
                 }
             }
             , {
-                fixed: 'right', title: '操作', width: 100, templet: function (res) {
+                fixed: 'right', title: '操作', width: 150, templet: function (res) {
                     return '<em>' +
                         '<a className="layui-btn layui-btn-xs" lay-event="edit"><i class="layui-icon" style="font-size: 30px; color: #1E9FFF;">&#xe642;</i></a>' +
                         '<a className="layui-btn layui-btn-xs" lay-event="del_status_btn"><i class="layui-icon" style="font-size: 30px; color: #1E9FFF;">&#xe60b;</i></a>' +
+                        '<a className="layui-btn layui-btn-xs" lay-event="del"><i class="layui-icon" style="font-size: 30px; color: palevioletred;">&#x1007;</i></a>' +
                         '</em>'
                 }
             }

+ 19 - 6
jay-monitor-data-server/src/main/resources/templates/alertPlatform/list.html

@@ -22,9 +22,9 @@
 </div>
 <div class="x-body">
     <div class="layui-row">
-        <form class="layui-form layui-col-md12 x-so layui-form-pane">
-            <div class="layui-form-item">
-                <div class="layui-inline">
+        <form class="layui-form layui-col-md12">
+            <div class="layui-form-item layui-col-md12">
+                <div class="layui-col-md4">
                     <label class="layui-form-label">平台类型</label>
                     <div class="layui-input-block">
                         <select id="q_platformType" name="platformType">
@@ -32,7 +32,19 @@
                         </select>
                     </div>
                 </div>
-
+                <div class="layui-col-md4">
+                    <label class="layui-form-label">平台标题</label>
+                    <div class="layui-input-block">
+                        <input code="text" class="layui-input" name="alertName" id="q_alertName" value=""/>
+                    </div>
+                </div>
+                <div class="layui-col-md4">
+                    <label class="layui-form-label">是否可用</label>
+                    <div class="layui-input-block">
+                        <select name="status" id="valid_status" lay-verify="required">
+                        </select>
+                    </div>
+                </div>
             </div>
             <!--            <div class="layui-form-item">-->
             <!--                <label class="layui-form-label">请求关键字</label>-->
@@ -101,10 +113,11 @@
                 }
             }
             , {
-                fixed: 'right', title: '操作', width: 100, templet: function (res) {
+                fixed: 'right', title: '操作', width: 150, templet: function (res) {
                     return '<em>' +
                         '<a className="layui-btn layui-btn-xs" lay-event="edit"><i class="layui-icon" style="font-size: 30px; color: #1E9FFF;">&#xe642;</i></a>' +
                         '<a className="layui-btn layui-btn-xs" lay-event="del_status_btn"><i class="layui-icon" style="font-size: 30px; color: #1E9FFF;">&#xe60b;</i></a>' +
+                        '<a className="layui-btn layui-btn-xs" lay-event="del"><i class="layui-icon" style="font-size: 30px; color: palevioletred;">&#x1007;</i></a>' +
                         '</em>'
                 }
             }
@@ -172,7 +185,7 @@
 
         function init() {
             elab_common.initSelectDataRender("#q_platformType", "#alertPlatformList", "")
-            elab_common.getConfigTypeBySelect("#valid_status", "common_status", "");
+            elab_common.getConfigTypeBySelect("#valid_status", "route_valid_status", "1");
             form.render('select');
         }