Commit fe56148befadb96a7cbfd9e2393f8603cd31a7f1

Authored by xqs
1 parent 1bf9fbb5

增加系统接口配置

src/main/java/com/huaheng/pc/config/address/controller/AddressController.java
... ... @@ -41,6 +41,10 @@ public class AddressController extends BaseController {
41 41 @Resource
42 42 private AddressService addressService;
43 43  
  44 +
  45 +
  46 +
  47 +
44 48 @RequiresPermissions("config:address:view")
45 49 @GetMapping()
46 50 public String address() {
... ...
src/main/resources/templates/config/address/add.html 0 → 100644
  1 +<!DOCTYPE HTML>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3 +<meta charset="utf-8">
  4 +<head th:include="include :: header"></head>
  5 +<body class="white-bg">
  6 + <div class="wrapper wrapper-content animated fadeInRight ibox-content">
  7 + <form class="form-horizontal m" id="form-address-add">
  8 + <div class="form-group">
  9 + <label class="col-sm-3 control-label">参数方法名:</label>
  10 + <div class="col-sm-8">
  11 + <input id="param" name="param" class="form-control" type="text">
  12 + </div>
  13 + </div>
  14 + <div class="form-group">
  15 + <label class="col-sm-3 control-label">URL地址:</label>
  16 + <div class="col-sm-8">
  17 + <input id="url" name="url" class="form-control" type="text">
  18 + </div>
  19 + </div>
  20 + <div class="form-group">
  21 + <div class="form-control-static col-sm-offset-9">
  22 + <button type="submit" class="btn btn-primary">提交</button>
  23 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  24 + </div>
  25 + </div>
  26 + </form>
  27 + </div>
  28 + <div th:include="include::footer"></div>
  29 + <script type="text/javascript">
  30 + var prefix = ctx + "config/address"
  31 + $("#form-address-add").validate({
  32 + rules:{
  33 + param:{
  34 + required:true,
  35 + },
  36 + url:{
  37 + required:true,
  38 + },
  39 + },
  40 + /*submitHandler: function(form) {
  41 + // $.operate.save(prefix + "/add", $('#form-zone-add').serialize());
  42 + var tableValue = $.common.getTableValue("#form-address-add");
  43 + $.operate.save(prefix + "/add", tableValue);
  44 + }*/
  45 + submitHandler: function(form) {
  46 + $.ajax({
  47 + cache : true,
  48 + type : "POST",
  49 + url : prefix + "/add",
  50 + data : {
  51 + "param": $("input[name='param']").val(),
  52 + "url": $("input[name='url']").val(),
  53 + },
  54 + async : false,
  55 + error : function(request) {
  56 + $.modal.alertError("请求失败!");
  57 + },
  58 + success : function(data) {
  59 + $.operate.saveSuccess(data);
  60 + }
  61 + });
  62 + }
  63 + });
  64 + </script>
  65 +</body>
  66 +</html>
... ...
src/main/resources/templates/config/address/address.html 0 → 100644
  1 +<!DOCTYPE HTML>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3 +<meta charset="utf-8">
  4 +<head th:include="include :: header"></head>
  5 +<body class="gray-bg">
  6 + <div class="container-div">
  7 + <div class="row">
  8 + <div class="col-sm-12 select-info">
  9 + <form id="address-form">
  10 + <div class="select-list">
  11 + <ul>
  12 + <li>
  13 + 仓库:<input type="text" name="warehouseCode"/>
  14 + </li>
  15 + <li>
  16 + 参数方法名:<input type="text" name="param"/>
  17 + </li>
  18 + <!--<li class="time">
  19 + <label>创建时间: </label>
  20 + <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[createdBegin]"/>
  21 + <span>-</span>
  22 + <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[createdEnd]"/>
  23 + </li>-->
  24 + <li>
  25 + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  26 + </li>
  27 + </ul>
  28 + </div>
  29 + </form>
  30 + </div>
  31 +
  32 + <div class="btn-group hidden-xs" id="toolbar" role="group">
  33 + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="config:address:add">
  34 + <i class="fa fa-plus"></i> 新增
  35 + </a>
  36 + </div>
  37 +
  38 + <div class="col-sm-12 select-info">
  39 + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
  40 + </div>
  41 + </div>
  42 + </div>
  43 + <div th:include="include :: footer"></div>
  44 + <script th:inline="javascript">
  45 + var editFlag = [[${@permission.hasPermi('config:address:edit')}]];
  46 + var removeFlag = [[${@permission.hasPermi('config:address:remove')}]];
  47 + var prefix = ctx + "config/address"
  48 + var datas = [[${@dict.getType('sys_normal_disable')}]];
  49 + $(function() {
  50 + var options = {
  51 + url: prefix + "/list",
  52 + createUrl: prefix + "/add",
  53 + updateUrl: prefix + "/edit/{id}",
  54 + removeUrl: prefix + "/remove",
  55 + modalName: "接口地址",
  56 + search: false,
  57 + columns: [{
  58 + checkbox: true
  59 + },
  60 + {
  61 + field : 'id',
  62 + title : 'ID'
  63 + },
  64 +
  65 + {
  66 + field : 'warehouseCode',
  67 + title : '仓库编码'
  68 + },
  69 + {
  70 + field : 'param',
  71 + title : '参数名称'
  72 + },
  73 + {
  74 + field : 'url',
  75 + title : 'URL地址'
  76 + },
  77 + {
  78 + title: '操作',
  79 + align: 'center',
  80 + formatter: function(value, row, index) {
  81 + var actions = [];
  82 + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\' )"><i class="fa fa-edit"></i>编辑</a> ');
  83 + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>');
  84 + return actions.join('');
  85 + }
  86 + }
  87 + ]
  88 + };
  89 + $.table.init(options);
  90 + });
  91 + </script>
  92 +</body>
  93 +</html>
0 94 \ No newline at end of file
... ...
src/main/resources/templates/config/address/edit.html 0 → 100644
  1 +<!DOCTYPE HTML>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3 +<meta charset="utf-8">
  4 +<head th:include="include :: header"></head>
  5 +<body class="white-bg">
  6 + <div class="wrapper wrapper-content animated fadeInRight ibox-content">
  7 + <form class="form-horizontal m" id="form-address-edit" th:object="${address}">
  8 + <input id="id" name="id" th:field="*{id}" type="hidden">
  9 + <div class="form-group">
  10 + <label class="col-sm-3 control-label">参数方法名:</label>
  11 + <div class="col-sm-8">
  12 + <input id="param" name="param" th:field="*{param}" class="form-control" type="text">
  13 + </div>
  14 + </div>
  15 + <div class="form-group">
  16 + <label class="col-sm-3 control-label">URL地址:</label>
  17 + <div class="col-sm-8">
  18 + <input id="url" name="url" th:field="*{url}" class="form-control" type="text">
  19 + </div>
  20 + </div>
  21 + <div class="form-group">
  22 + <div class="form-control-static col-sm-offset-9">
  23 + <button type="submit" class="btn btn-primary">提交</button>
  24 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  25 + </div>
  26 + </div>
  27 + </form>
  28 + </div>
  29 + <div th:include="include::footer"></div>
  30 + <script type="text/javascript">
  31 + var prefix = ctx + "config/address"
  32 + $("#form-address-edit").validate({
  33 + rules:{
  34 + param:{
  35 + required:true,
  36 + },
  37 + url:{
  38 + required:true,
  39 + },
  40 + },
  41 + submitHandler: function(form) {
  42 + $.ajax({
  43 + cache : true,
  44 + type : "POST",
  45 + url : prefix + "/edit",
  46 + data : {
  47 + "id": $("input[name='id']").val(),
  48 + "param": $("input[name='param']").val(),
  49 + "url": $("input[name='url']").val(),
  50 + },
  51 + async : false,
  52 + error : function(request) {
  53 + $.modal.alertError("请求失败!");
  54 + },
  55 + success : function(data) {
  56 + $.operate.saveSuccess(data);
  57 + }
  58 + });
  59 + }
  60 + });
  61 + </script>
  62 +</body>
  63 +</html>
... ...