对外暴露接口层
具体后台页面接口实现层
resource/templates
base文件夹代表公共页面,由于主页面是采用Iframe构造,所以只需要关心中间页面的开发。
中心页面的公共JS和CSS被独立出来放在了base文件夹下。
引用公共页面参考
<html xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorator="~{/base/main}">
案例参考 : routeList.html
存放位置 : resources/static/js
elab-common.js : 封装了前端操作LayUI的一些方法以及文本值的转换工具类。
elab-config.js : 后端参数枚举值解码,调用方式参考elab-common.js
elab-service-config.js : 后端服务地址定义
// 将后端传过来的数字进行转义成文本,到对应的elab-config中定义
elab_common.getConfigTypeText("route_valid_status", res.isValid)
// 获取枚举值中request_method的所有值,渲染到页面id为methodSelect中,展现成下拉框
elab_common.getConfigTypeBySelect("#methodSelect", "request_method", "");
// 获取枚举值中checkRule的所有值,渲染到页面id为checkRuleDiv中,展现成checkbox,第三个参数是默认选中的数组
elab_common.getConfigTypeByCheckBox("#checkRuleDiv", "route_check_rule", "checkRule", checkRule)
// 将后端传过来的数据为时间戳的转换成时分秒
elab_common.longConvertDateTime(res.created)
// post请求后端地址
elab_common.postReq(urlConfig.route.refreshService, data.field, function (data) {})