Browse Source

新增全局基础配置项

liukx 2 years ago
parent
commit
eb604fdcb0

+ 138 - 0
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/controllers/GlobalBaseConfigController.java

@@ -0,0 +1,138 @@
+package com.jay.monitor.data.server.controllers;//package com.jay.monitor.data.server.controllers;
+
+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.global.GlobalBaseConfigRequest;
+import com.jay.monitor.data.server.models.store.GlobalBaseConfig;
+import com.jay.monitor.data.server.report.alert.AlertDataService;
+import com.jay.monitor.data.server.store.IGlobalBaseConfigProcess;
+import com.jay.monitor.data.server.store.ISimpleCrudProcess;
+import com.jay.monitor.data.server.utils.HtmlComponentUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.List;
+
+import static com.jay.monitor.data.server.controllers.GlobalBaseConfigController.PREFIX_URL;
+
+/**
+ * 全局基础配置管理
+ *
+ * @author liukx
+ * @Date 2019-02-28 15:16
+ */
+@Controller
+@RequestMapping(value = PREFIX_URL)
+public class GlobalBaseConfigController extends BaseSimpleCrudController<GlobalBaseConfigRequest, GlobalBaseConfig> {
+
+    public final static String PREFIX_URL = "/global/base/config";
+    public final static String LIST_URL = PREFIX_URL + "/pageList";
+    public final static String ADD_URL = PREFIX_URL + "/add";
+    public final static String UPDATE_URL = PREFIX_URL + "/update";
+    public final static String DEL_URL = PREFIX_URL + "/del";
+    public static final String PAGE_PATH = "/global";
+
+    @Override
+    public String getViewPath() {
+        return PAGE_PATH;
+    }
+
+    @Autowired
+    private IGlobalBaseConfigProcess configProcess;
+
+    @Autowired
+    private AlertDataService alertDataService;
+
+    @Override
+    public ISimpleCrudProcess getCrudProcess() {
+        return configProcess;
+    }
+
+    @Override
+    protected String getAddHtmlPath() {
+        return "/update";
+    }
+
+    @Override
+    @RequestMapping(value = "/pageList",
+        method = RequestMethod.POST,
+        produces = "application/json;charset=UTF-8")
+    @ResponseBody
+    public PageResponseModel<GlobalBaseConfig> pageList(
+        @RequestBody
+            GlobalBaseConfigRequest request) throws Exception {
+        GlobalBaseConfig config = new GlobalBaseConfig();
+        BeanUtils.copyProperties(request, config);
+        // 将参数对应的全部匹配赋值
+        PageResponseModel pageResponseModel =
+            configProcess.searchDataByList(request.getPageNo(), request.getPageSize(), config);
+        return pageResponseModel;
+    }
+
+    @Override
+    protected void addBefore(GlobalBaseConfig req) {
+        checkExpression(req);
+    }
+
+    @Override
+    protected void addAfter(GlobalBaseConfig req, boolean result) {
+        refreshPlatformId(req.getId());
+    }
+
+    @Override
+    protected void addInModel(Model model, GlobalBaseConfig entity) {
+        model.addAttribute("apiService", ADD_URL);
+        GlobalBaseConfig globalBaseConfig = new GlobalBaseConfig();
+        globalBaseConfig.setStatus(1);
+        model.addAttribute("obj", globalBaseConfig);
+        modelAfter(model, globalBaseConfig);
+    }
+
+    @Override
+    protected void updateInModel(Model model, GlobalBaseConfig entity) {
+        model.addAttribute("apiService", UPDATE_URL);
+        super.updateInModel(model, entity);
+    }
+
+    @Override
+    protected void updateBefore(GlobalBaseConfig req) {
+        checkExpression(req);
+    }
+
+    @Override
+    protected void updateAfter(GlobalBaseConfig req, boolean result) {
+        refreshPlatformId(req.getId());
+    }
+
+    public void refreshPlatformId(String id) {
+        alertDataService.refreshPlatformId(id);
+    }
+
+    @Override
+    protected void deleteAfter(GlobalBaseConfig req, boolean result) {
+        refreshPlatformId(req.getId());
+    }
+
+    @Override
+    protected void modelAfter(Model model, GlobalBaseConfig entity) {
+        List<DefaultDataRender> alertPlatformList = HtmlComponentUtils.convertDataRender(AlertMsgEnums.class);
+        model.addAttribute("alertPlatformList", JsonHelper.toJsonString(alertPlatformList));
+    }
+
+    private void checkExpression(GlobalBaseConfig req) {
+        ResponseUtils.checkNull(req.getGroup(), "group不能为空!");
+        ResponseUtils.checkNull(req.getProject(), "project不能为空!");
+        ResponseUtils.checkNull(req.getCode(), "code不能为空!");
+        ResponseUtils.checkNull(req.getValue(), "value不能为空!");
+    }
+}

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

@@ -0,0 +1,140 @@
+package com.jay.monitor.data.server.models.entity.es;
+
+import org.zxp.esclientrhl.annotation.ESMetaData;
+
+import java.util.Date;
+
+/**
+ * 全局基础配置管理
+ *
+ * @author liukaixiong
+ * @date 2022/7/25 - 10:07
+ */
+@ESMetaData(indexName = "jay_global_base_config",
+    number_of_shards = 5,
+    number_of_replicas = 0,
+    printLog = true)
+public class GlobalBaseConfigIndex {
+    private String id;
+    /**
+     * 组名
+     */
+    private String group;
+    /**
+     * 描述
+     */
+    private String describe;
+    /**
+     * 项目名称
+     */
+    private String project;
+    /**
+     * 编码
+     */
+    private String code;
+    /**
+     * 值
+     */
+    private String value;
+
+    /**
+     * 状态
+     */
+    private Integer status;
+
+    private String creator;
+
+    private Date createDate;
+
+    private String updator;
+
+    private Date updated;
+
+    public String getDescribe() {
+        return describe;
+    }
+
+    public void setDescribe(String describe) {
+        this.describe = describe;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getGroup() {
+        return group;
+    }
+
+    public void setGroup(String group) {
+        this.group = group;
+    }
+
+    public String getProject() {
+        return project;
+    }
+
+    public void setProject(String project) {
+        this.project = project;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+
+    public String getUpdator() {
+        return updator;
+    }
+
+    public void setUpdator(String updator) {
+        this.updator = updator;
+    }
+
+    public Date getUpdated() {
+        return updated;
+    }
+
+    public void setUpdated(Date updated) {
+        this.updated = updated;
+    }
+}

+ 111 - 0
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/models/request/global/GlobalBaseConfigRequest.java

@@ -0,0 +1,111 @@
+package com.jay.monitor.data.server.models.request.global;
+
+import com.jay.monitor.data.server.models.request.trace.PageRequest;
+
+import java.util.Date;
+
+/**
+ * 全局基础配置管理
+ *
+ * @author liukaixiong
+ * @date 2022/7/25 - 10:07
+ */
+public class GlobalBaseConfigRequest  extends PageRequest {
+    private String id;
+    /**
+     * 组名
+     */
+    private String group;
+    /**
+     * 键名
+     */
+    private String project;
+    /**
+     * 编码
+     */
+    private String code;
+    /**
+     * 值
+     */
+    private String value;
+
+    private String creator;
+
+    private Date createDate;
+
+    private String updator;
+
+    private Date updated;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getGroup() {
+        return group;
+    }
+
+    public void setGroup(String group) {
+        this.group = group;
+    }
+
+    public String getProject() {
+        return project;
+    }
+
+    public void setProject(String project) {
+        this.project = project;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+
+    public String getUpdator() {
+        return updator;
+    }
+
+    public void setUpdator(String updator) {
+        this.updator = updator;
+    }
+
+    public Date getUpdated() {
+        return updated;
+    }
+
+    public void setUpdated(Date updated) {
+        this.updated = updated;
+    }
+}

+ 0 - 2
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/models/store/AlertPlatformConfig.java

@@ -1,7 +1,6 @@
 package com.jay.monitor.data.server.models.store;
 
 import com.jay.monitor.data.server.enums.AlertMsgEnums;
-import org.zxp.esclientrhl.annotation.ESMetaData;
 
 import java.util.Date;
 
@@ -12,7 +11,6 @@ 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)
 public class AlertPlatformConfig {
 
     private String id;

+ 134 - 0
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/models/store/GlobalBaseConfig.java

@@ -0,0 +1,134 @@
+package com.jay.monitor.data.server.models.store;
+
+import java.util.Date;
+
+/**
+ * 全局基础配置管理
+ *
+ * @author liukaixiong
+ * @date 2022/7/25 - 10:07
+ */
+public class GlobalBaseConfig {
+    private String id;
+    /**
+     * 组名
+     */
+    private String group;
+    /**
+     * 描述
+     */
+    private String describe;
+    /**
+     * 项目名称
+     */
+    private String project;
+    /**
+     * 编码
+     */
+    private String code;
+    /**
+     * 值
+     */
+    private String value;
+
+    /**
+     * 状态
+     */
+    private Integer status;
+
+    private String creator;
+
+    private Date createDate;
+
+    private String updator;
+
+    private Date updated;
+
+    public String getDescribe() {
+        return describe;
+    }
+
+    public void setDescribe(String describe) {
+        this.describe = describe;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getGroup() {
+        return group;
+    }
+
+    public void setGroup(String group) {
+        this.group = group;
+    }
+
+    public String getProject() {
+        return project;
+    }
+
+    public void setProject(String project) {
+        this.project = project;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+
+    public String getUpdator() {
+        return updator;
+    }
+
+    public void setUpdator(String updator) {
+        this.updator = updator;
+    }
+
+    public Date getUpdated() {
+        return updated;
+    }
+
+    public void setUpdated(Date updated) {
+        this.updated = updated;
+    }
+}

+ 14 - 0
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/store/IGlobalBaseConfigProcess.java

@@ -0,0 +1,14 @@
+package com.jay.monitor.data.server.store;
+
+import com.jay.monitor.data.server.models.store.GlobalBaseConfig;
+
+/**
+ * 告警平台增删改查
+ *
+ * @author liukaixiong
+ * @Email liukx@elab-plus.com
+ * @date 2021/9/7 - 14:48
+ */
+public interface IGlobalBaseConfigProcess extends ISimpleCrudProcess<GlobalBaseConfig> {
+
+}

+ 29 - 0
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/store/es/ElasticGlobalBaseConfigProcess.java

@@ -0,0 +1,29 @@
+package com.jay.monitor.data.server.store.es;
+
+import com.jay.monitor.data.server.models.entity.es.GlobalBaseConfigIndex;
+import com.jay.monitor.data.server.models.store.GlobalBaseConfig;
+import com.jay.monitor.data.server.store.IGlobalBaseConfigProcess;
+import org.springframework.stereotype.Component;
+
+/**
+ * 通用的增删改查配置
+ *
+ * @author liukaixiong
+ * @Email liukx@elab-plus.com
+ * @date 2021/9/7 - 14:49
+ */
+@Component
+public class ElasticGlobalBaseConfigProcess extends AbstractCRUDElasticSearch<GlobalBaseConfigIndex, GlobalBaseConfig>
+    implements IGlobalBaseConfigProcess {
+
+    @Override
+    public Class<GlobalBaseConfigIndex> getEntityClazz() {
+        return GlobalBaseConfigIndex.class;
+    }
+
+    @Override
+    public Class<GlobalBaseConfig> getReqClazz() {
+        return GlobalBaseConfig.class;
+    }
+
+}

+ 8 - 0
jay-monitor-data-server/src/main/resources/static/js/elab-service-config.js

@@ -29,5 +29,13 @@ var urlConfig = {
         "updateService": "/alert/rule/update",
         "addService": "/alert/rule/add",
         "delService": "/alert/rule/del"
+    },
+    "globalBaseConfig": {
+        "pageList": "/global/base/config/pageList",
+        "updateHtml": "/global/base/config/update.html",
+        "addHtml": "/global/base/config/add.html",
+        "updateService": "/global/base/config/update",
+        "addService": "/global/base/config/add",
+        "delService": "/global/base/config/del"
     }
 }

+ 196 - 0
jay-monitor-data-server/src/main/resources/templates/global/list.html

@@ -0,0 +1,196 @@
+<html xmlns:th="http://www.thymeleaf.org"
+      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorator="~{/base/main}">
+<head>
+    <meta charset="UTF-8"/>
+    <title>全局基础配置管理</title>
+    <script src="/lib/json-viewer/jquery.json-viewer.js"></script>
+    <link href="/lib/json-viewer/jquery.json-viewer.css" type="text/css" rel="stylesheet">
+</head>
+
+<body>
+<div layout:fragment="content">
+</div>
+<div class="x-nav">
+      <span class="layui-breadcrumb">
+        <a href="">全局基础配置管理</a>
+        <a>
+          <cite>查询列表</cite></a>
+      </span>
+    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
+       href="javascript:location.replace(location.href);" title="刷新">
+        <i class="layui-icon" style="line-height:30px"></i></a>
+</div>
+<div class="x-body">
+    <div class="layui-row">
+        <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">
+
+                        </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="project" id="q_project" value=""/>
+                    </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="code" id="q_code" value=""/>
+                    </div>
+                </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 name="status" id="valid_status" lay-verify="required">
+                        </select>
+                    </div>
+                </div>
+            </div>
+            <div class="layui-form-item">
+                <div class="layui-col-xs6 layui-col-md12 " style="text-align: center">
+                    <a class="layui-btn" id="q_submit" lay-submit="" lay-filter="submit_from">查询</a>
+                    <button id="q_reset" code="reset" class="layui-btn layui-btn-primary">重置</button>
+                </div>
+            </div>
+            <!--<button class="layui-btn" lay-submit="" lay-filter="submit_from"><i class="layui-icon"></i>增加</button>-->
+        </form>
+    </div>
+    <table class="layui-table" id="list_table" lay-filter="list_table"></table>
+
+    <pre id="json-renderer"></pre>
+
+</div>
+<input type="hidden" th:value="${alertPlatformList}" id="alertPlatformList"/>
+
+<div class="layui-btn-container" id="toolbarDemo">
+    <button class="layui-btn layui-btn-sm" lay-event="addData">添加</button>
+</div>
+
+<script>
+    layui.use(['laydate', 'layer', 'table', 'form', 'element'], function () {
+        var laydate = layui.laydate, layer = layui.layer, table = layui.table, form = layui.form;
+        var title = "全局基础配置列表";
+        var method = "post";
+
+        // ======================== 参数构建阶段 =========================
+        var dataColumn = [
+            {field: 'id', title: '主键', hide: true, sort: false}
+            ,
+            {
+                field: 'group', title: '配置组', align: 'center'
+            }
+            , {
+                field: 'describe', title: '配置组描述'
+            }
+            , {
+                field: 'project', title: '项目名称'
+            }, {
+                field: 'code', title: '配置编码'
+            }, {
+                field: 'value', title: '配置值'
+            },
+            {
+                field: 'status', title: '是否有效', rowspan: 1, templet: function (res) {
+                    var styleString = "style=\"color: red;\"";
+                    if (res.status === 1) {
+                        styleString = "style=\"color: #5fb878;\"";
+                    }
+                    return '<em ' + styleString + '>' + (res.status === 1 ? "有效" : "无效") + '</em>'
+                }
+            }
+            ,
+            {
+                field: 'createDate', title: '创建时间', width: 160, templet: function (res) {
+                    return '<em>' + elab_common.longConvertDateTime(res.createDate) + '</em>'
+                }
+            }
+            , {
+                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>'
+                }
+            }
+        ];
+
+        // ======================== 初始化表格阶段 ========================
+        var layDMLConfig = {};
+        layDMLConfig["layer"] = layer;
+        layDMLConfig["table"] = table;
+        layDMLConfig["title"] = title;
+        layDMLConfig["method"] = method;
+        layDMLConfig["dataColumn"] = dataColumn;
+        layDMLConfig["routeConfig"] = urlConfig.globalBaseConfig;
+
+        elab_common.renderLayUIDMLTable(layDMLConfig);
+
+        // ============================================ 特殊操作阶段 ===================================
+        table.on('rowDouble(list_table)', function (obj) {
+            $('#json-renderer').jsonViewer(obj.data, {collapsed: false, withQuotes: true, withLinks: false});
+            layer.open({
+                type: 1
+                , title: false //不显示标题栏
+                , closeBtn: false
+                , area: '500px;'
+                , shade: 0.8
+                , id: 'LAY_layuipro' //设定一个id,防止重复弹出
+                , btnAlign: 'c'
+                , shadeClose: true
+                , moveType: 1 //拖拽模式,0或者1
+                , content: $('#json-renderer').show()
+            });
+        });
+
+        form.on('submit(submit_from)', function (data) {
+            //执行重载
+            table.reload('tableList', {
+                page: {
+                    curr: 1 //重新从第 1 页开始
+                }
+                , where: data.field
+            });
+            return false;
+        });
+
+        laydate.render({
+            elem: '#d_date'
+            , format: 'yyyy-MM-dd'
+            , isInitValue: true
+            , min: -100
+            , max: 0
+            , value: new Date()
+        });
+
+        laydate.render({
+            elem: '#d_s_date'
+            , type: 'time'
+            , isInitValue: true
+            , range: ['#']
+            , value: '00:00:00 # 23:59:59'
+        });
+
+
+        // ============================ 数据初始化阶段 ===============================
+        init();
+
+        function init() {
+            elab_common.initSelectDataRender("#q_platformType", "#alertPlatformList", "")
+            elab_common.getConfigTypeBySelect("#valid_status", "route_valid_status", "1");
+            form.render('select');
+        }
+
+    });
+</script>
+</body>
+
+</html>

+ 141 - 0
jay-monitor-data-server/src/main/resources/templates/global/update.html

@@ -0,0 +1,141 @@
+<html xmlns:th="http://www.thymeleaf.org"
+      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorator="~{/base/main}">
+
+<head>
+    <script src="/lib/json-viewer/jquery.json-viewer.js"></script>
+    <link href="/lib/json-viewer/jquery.json-viewer.css" type="text/css" rel="stylesheet">
+    <script src="/lib/jsoneditor/dist/jsoneditor.js"></script>
+    <link href="/lib/jsoneditor/dist/jsoneditor.css" type="text/css" rel="stylesheet">
+</head>
+<body class="layui-layout-body">
+<div layout:fragment="content"></div>
+<!-- 表单页面编写 -->
+<div class="layui-layout layui-layout-admin">
+    <div class="layui-body">
+
+        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
+            <legend>平台组配置</legend>
+        </fieldset>
+
+        <form class="layui-form layui-form-pane" action="" lay-filter="projectForm">
+            <input type="hidden" name="id" th:value="${obj?.id}"/>
+
+            <div class="layui-form-item layui-form-text">
+                <label class="layui-form-label">配置组名称</label>
+                <div class="layui-input-block">
+                    <input code="text" name="group" th:value="${obj?.group}" lay-verify="required"
+                           autocomplete="off" class="layui-input">
+                </div>
+            </div>
+
+            <div class="layui-form-item layui-form-text">
+                <label class="layui-form-label">配置组描述</label>
+                <div class="layui-input-block">
+                    <input code="text" name="describe" th:value="${obj?.describe}"
+                           autocomplete="off" class="layui-input">
+                </div>
+            </div>
+
+            <div class="layui-form-item layui-form-text">
+                <label class="layui-form-label">项目名称</label>
+                <div class="layui-input-block">
+                    <input code="text" name="project" th:value="${obj?.project}"
+                           autocomplete="off" class="layui-input">
+                </div>
+            </div>
+
+            <div class="layui-form-item layui-form-text">
+                <label class="layui-form-label">配置编码</label>
+                <div class="layui-input-block">
+                    <input code="text" name="code" th:value="${obj?.code}"
+                           autocomplete="off" class="layui-input">
+                </div>
+            </div>
+            <div class="layui-form-item layui-form-text">
+                <label class="layui-form-label">配置值</label>
+                <div class="layui-input-block">
+                    <input code="text" name="value" th:value="${obj?.value}"
+                           autocomplete="off" class="layui-input">
+                </div>
+            </div>
+
+            <div class="layui-form-item layui-form-text">
+                <label class="layui-form-label">是否可用</label>
+                <div class="layui-input-block">
+                    <select name="status" id="valid_status" lay-verify="required">
+                    </select>
+                </div>
+            </div>
+
+            <div class="layui-form-item">
+                <div class="layui-input-block">
+                    <button class="layui-btn" lay-submit="javascript:void(0)" lay-filter="submit">立即提交</button>
+                    <button code="reset" class="layui-btn layui-btn-primary">重置</button>
+                </div>
+            </div>
+        </form>
+    </div>
+</div>
+<!-- 后台参数暂存路径 -->
+<!--<input type="hidden" th:value="${alertPlatformConfigList}" id="alertPlatformConfigList"/>-->
+
+<!-- 注意:如果你直接复制所有代码到本地,上述js路径需要改成你本地的 -->
+<script th:inline="javascript" code="text/javascript">
+    var form;
+    layui.use(['form', 'layedit', 'jquery', 'laydate'], function () {
+        form = layui.form;
+        var layer = layui.layer;
+        var apiService = [[${apiService}]];
+        var $ = layui.jquery;
+
+        // 参数校验阶段
+        form.verify({
+            url_verify: function (value) {
+                if (!value.startsWith("http://") && !value.startsWith("https://")) {
+                    return '请填写合法的链接地址';
+                }
+            }
+        });
+
+        // 提交前的数据格式化准备
+        form.on('submit(submit)', function (data) {
+            elab_common.postReq(apiService, data.field, function (data) {
+                var success = data.success;
+                if (success) {
+                    layer.alert("操作成功!", function (i) {
+                        var index = parent.layer.getFrameIndex(window.name);
+                        parent.layer.close(index);
+                        parent.$("#q_submit").click();
+                    });
+                } else {
+                    layer.alert(data.message);
+                }
+            }, true);
+            return false;
+        });
+
+        // 初始化数据内容
+        init();
+
+        function init() {
+            elab_common.getConfigTypeBySelect("#valid_status", "route_valid_status", "[(${obj?.status})]");
+            refreshComponent();
+        }
+
+        function refreshComponent() {
+            form.render('select');
+            form.render('checkbox');
+        }
+    });
+
+</script>
+
+<style type="text/css">
+    * {
+        margin: 0px;
+        padding: 0px;
+        font-family: unset;
+    }
+</style>
+</body>
+</html>

+ 4 - 47
jay-monitor-data-server/src/main/resources/templates/index.html

@@ -56,62 +56,19 @@
             <li>
                 <a href="javascript:;">
                     <i class="iconfont">&#xe6b8;</i>
-                    <cite>路由管理</cite>
+                    <cite>全局配置管理</cite>
                     <i class="iconfont nav_right">&#xe697;</i>
                 </a>
                 <ul class="sub-menu">
                     <li date-refresh="1">
-                        <a _href="/backstageRoute/list.html">
+                        <a _href="/global/base/config/list.html">
                             <i class="iconfont">&#xe6a7;</i>
-                            <cite>路由列表</cite>
+                            <cite>基础配置管理</cite>
                         </a>
                     </li>
-                    <!--                    <li>-->
-                    <!--                        <a _href="member-list1.html">-->
-                    <!--                            <i class="iconfont">&#xe6a7;</i>-->
-                    <!--                            <cite>会员列表(动态表格)</cite>-->
-                    <!--                        </a>-->
-                    <!--                    </li>-->
-                    <!--                    <li date-refresh="1">-->
-                    <!--                        <a _href="member-del.html">-->
-                    <!--                            <i class="iconfont">&#xe6a7;</i>-->
-                    <!--                            <cite>会员删除</cite>-->
-
-                    <!--                        </a>-->
-                    <!--                    </li>-->
-                    <!--                    <li>-->
-                    <!--                        <a href="javascript:;">-->
-                    <!--                            <i class="iconfont">&#xe70b;</i>-->
-                    <!--                            <cite>会员管理</cite>-->
-                    <!--                            <i class="iconfont nav_right">&#xe697;</i>-->
-                    <!--                        </a>-->
-                    <!--                        <ul class="sub-menu">-->
-                    <!--                            <li>-->
-                    <!--                                <a _href="xxx.html">-->
-                    <!--                                    <i class="iconfont">&#xe6a7;</i>-->
-                    <!--                                    <cite>会员列表</cite>-->
-
-                    <!--                                </a>-->
-                    <!--                            </li>-->
-                    <!--                            <li>-->
-                    <!--                                <a _href="xx.html">-->
-                    <!--                                    <i class="iconfont">&#xe6a7;</i>-->
-                    <!--                                    <cite>会员删除</cite>-->
-
-                    <!--                                </a>-->
-                    <!--                            </li>-->
-                    <!--                            <li>-->
-                    <!--                                <a _href="xx.html">-->
-                    <!--                                    <i class="iconfont">&#xe6a7;</i>-->
-                    <!--                                    <cite>等级管理</cite>-->
-
-                    <!--                                </a>-->
-                    <!--                            </li>-->
-
-                    <!--                        </ul>-->
-                    <!--                    </li>-->
                 </ul>
             </li>
+
             <li>
                 <a href="javascript:;">
                     <i class="iconfont">&#xe723;</i>