Browse Source

档案树数据录入 完善
档案管理
解决刷新token导致 请求失败问题修改

liuchanglan 4 years ago
parent
commit
7c454e1e41

+ 34 - 2
src/main/java/com/gz/controller/archive/ArchiveController.java

@@ -1,7 +1,13 @@
 package com.gz.controller.archive;
 
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import com.github.pagehelper.PageInfo;
+import com.gz.dto.archive.ArchiveDTO;
+import com.gz.service.archive.ArchiveService;
+import com.gz.vo.archive.SearchArchiveVO;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
 
 /**
  * 档案管理控制器
@@ -12,5 +18,31 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("archive/archive")
 public class ArchiveController {
 
+    @Resource
+    private ArchiveService service;
+
+    @PostMapping("insert")
+    Integer insert(@RequestBody ArchiveDTO dto) {
+        return service.insert(dto);
+    }
+
+    @DeleteMapping("delete")
+    Integer delete(Integer id) {
+        return service.delete(id);
+    }
+
+    @PostMapping("update")
+    Integer update(@RequestBody ArchiveDTO dto) {
+        return service.update(dto);
+    }
+
+    @GetMapping("selectAll")
+    List<ArchiveDTO> selectAll() {
+        return service.selectAll();
+    }
 
+    @GetMapping("selectByPage")
+    PageInfo<ArchiveDTO> selectByPage(SearchArchiveVO vo) {
+        return service.selectByPage(vo);
+    }
 }

+ 16 - 0
src/main/java/com/gz/dto/archive/ArchiveDTO.java

@@ -15,6 +15,21 @@ public class ArchiveDTO extends BaseDTO {
     // 档号
     private String dh;
 
+    // 全宗号
+    private String qzh;
+
+    // 目录号
+    private String mlh;
+
+    // 门类code
+    private String ml;
+
+    // 保管期限code
+    private String bgqx;
+
+    // 件号
+    private Integer jh;
+
     // 档案馆代码
     private String dagdm;
 
@@ -63,4 +78,5 @@ public class ArchiveDTO extends BaseDTO {
     // 附件
     private String fj;
 
+
 }

+ 2 - 2
src/main/java/com/gz/jwt/JwtConfig.java

@@ -35,6 +35,6 @@ public class JwtConfig {
     public static Long REFRESH_TOKEN_EXPIRE_TIME = 7 * 24 * 60 * 60L;
 
     /** accessToken有效期 单位秒*/
-//    public static final long ACCESS_TOKEN_EFFECTIVE = 30 * 60L;
-    public static final long ACCESS_TOKEN_EFFECTIVE = 1L;
+    public static final long ACCESS_TOKEN_EFFECTIVE = 30 * 60L;
+//    public static final long ACCESS_TOKEN_EFFECTIVE = 1L;
 }

+ 2 - 2
src/main/java/com/gz/service/archive/ArchiveService.java

@@ -2,7 +2,7 @@ package com.gz.service.archive;
 
 import com.github.pagehelper.PageInfo;
 import com.gz.dto.archive.ArchiveDTO;
-import com.gz.vo.PageVO;
+import com.gz.vo.archive.SearchArchiveVO;
 
 import java.util.List;
 
@@ -40,7 +40,7 @@ public interface ArchiveService {
      * @author LiuChangLan
      * @since 2020/9/4 14:46
      */
-    PageInfo<ArchiveDTO> selectByPage(PageVO vo);
+    PageInfo<ArchiveDTO> selectByPage(SearchArchiveVO vo);
 
     /**
      * @description 根据主键查询

+ 5 - 3
src/main/java/com/gz/service/archive/impl/ArchiveServiceImpl.java

@@ -1,12 +1,13 @@
 package com.gz.service.archive.impl;
 
+import cn.hutool.core.bean.BeanUtil;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.gz.dto.archive.ArchiveDTO;
 import com.gz.mapper.archive.ArchiveMapper;
 import com.gz.service.archive.ArchiveService;
 import com.gz.utils.JwtUtils;
-import com.gz.vo.PageVO;
+import com.gz.vo.archive.SearchArchiveVO;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -45,9 +46,10 @@ public class ArchiveServiceImpl implements ArchiveService {
     }
 
     @Override
-    public PageInfo<ArchiveDTO> selectByPage(PageVO vo) {
+    public PageInfo<ArchiveDTO> selectByPage(SearchArchiveVO vo) {
         PageHelper.startPage(vo.getPageNum(),vo.getPageSize());
-        return new PageInfo<>(selectAll());
+        ArchiveDTO param = BeanUtil.copyProperties(vo, ArchiveDTO.class);
+        return new PageInfo<>(mapper.select(param));
     }
 
     @Override

+ 2 - 0
src/main/java/com/gz/service/system/impl/ArchivesTreeServiceImpl.java

@@ -76,6 +76,8 @@ public class ArchivesTreeServiceImpl implements ArchivesTreeService {
                     tree.setParentId(treeNode.getParentId().toString());
                     tree.setName(treeNode.getTitle());
                     tree.putExtra("title", treeNode.getTitle());
+                    tree.putExtra("code", treeNode.getCode());
+                    tree.putExtra("spread",true);
                 });
         return treeNodes;
     }

+ 0 - 15
src/main/java/com/gz/vo/archive/ArchiveVO.java

@@ -1,15 +0,0 @@
-package com.gz.vo.archive;
-
-import com.gz.vo.PageVO;
-import lombok.Data;
-
-/**
- * 档案数据查询入参VO
- * @author LiuchangLan
- * @date 2021/2/23 18:29
- */
-@Data
-public class ArchiveVO extends PageVO {
-    // 档案树id
-    private String archivesTreeId;
-}

+ 24 - 0
src/main/java/com/gz/vo/archive/SearchArchiveVO.java

@@ -0,0 +1,24 @@
+package com.gz.vo.archive;
+
+import com.gz.vo.PageVO;
+import lombok.Data;
+
+/**
+ * 档案数据查询入参VO
+ * @author LiuchangLan
+ * @date 2021/2/23 18:29
+ */
+@Data
+public class SearchArchiveVO extends PageVO {
+    // 档案树id
+    private String dh;
+
+    // 目录号
+    private String mlh;
+
+    // 门类code
+    private String ml;
+
+    // 保管期限code
+    private String bgqx;
+}

+ 3 - 3
src/main/resources/static/index.html

@@ -156,9 +156,9 @@
             iniUrl: "system/auth/getLoginMenus",    // 初始化接口
             clearUrl: "api/clear.json", // 缓存清理接口
             urlHashLocation: false,      // 是否打开hash定位
-            bgColorDefault: 4,      // 主题默认配置
-            multiModule: true,          // 是否开启多模块
-            menuChildOpen: false,       // 是否默认展开菜单
+            bgColorDefault: 3,      // 主题默认配置
+            multiModule: false,          // 是否开启多模块
+            menuChildOpen: true,       // 是否默认展开菜单
             loadingTime: 0,             // 初始化加载时间
             pageAnim: true,             // iframe窗口动画
             maxTabNum: 20,              // 最大的tab打开数量

+ 9 - 4
src/main/resources/static/js/lay-module/request/http.js

@@ -12,11 +12,13 @@ layui.define(['jquery', 'layer'], function (exports) {
         let headers = {
             accessToken: (layui.data('auth').data ? layui.data('auth').data.accessToken : '') || ''
         }
-
+        let dataObj = data
+        // post请求 传参不是fromdata 则使用Json传值
         if (type == 'POST' && !(data instanceof FormData)) {
             data = JSON.stringify(data)
         }
-        if (type != 'DELETE') {
+        // 非delete设置请求头为json
+        if (type != 'DELETE' && !(data instanceof FormData)) {
             headers['Content-Type'] = 'application/json;charset=utf-8;'
         }
 
@@ -34,7 +36,7 @@ layui.define(['jquery', 'layer'], function (exports) {
                     callback(res)
                 } else if (res.code == 303) {
                     // 过期需要刷新Token
-                    refreshToken(method, type, data, async, callback)
+                    refreshToken(method, type, dataObj, async, callback)
                 } else {
                     layer.msg(res.msg, {
                         icon: 2,
@@ -51,7 +53,10 @@ layui.define(['jquery', 'layer'], function (exports) {
                     });
                 }
             },
-            error: function () {
+            error: function (e) {
+                layer.msg('请求出错' + e,{
+                    icon: 2
+                })
             }
         });
     }

+ 160 - 0
src/main/resources/static/page/archive/edit.html

@@ -0,0 +1,160 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>layui</title>
+    <link rel="stylesheet" href="../../lib/layui-v2.5.5/css/layui.css" media="all">
+    <link rel="stylesheet" href="../../css/public.css" media="all">
+    <link rel="stylesheet" href="../../lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
+    <style>
+        body {
+            background-color: #ffffff;
+        }
+    </style>
+</head>
+<body>
+<div class="layui-form layuimini-form" lay-filter="addDict">
+    <div class="layui-form-item">
+        <label class="layui-form-label required">门类名称</label>
+        <div class="layui-input-block">
+            <input type="hidden" name="id" id="id" class="layui-input">
+            <input type="text" name="title" lay-verify="required" lay-reqtext="门类名称不能为空" placeholder="请输入门类名称" value="" class="layui-input">
+        </div>
+    </div>
+
+
+    <div class="layui-form-item">
+        <label class="layui-form-label required">门类代码</label>
+        <div class="layui-input-block">
+            <input type="text" name="code" placeholder="请输入门类代码" value="" lay-verify="" lay-reqtext="门类代码不能为空" class="layui-input">
+        </div>
+    </div>
+
+
+
+    <div class="layui-form-item">
+        <label class="layui-form-label">父级门类</label>
+        <div class="layui-input-block">
+<!--            <select name="parentId" id="parentId" lay-filter="parentId">-->
+<!--                <option value="-1">请选择父级菜单</option>-->
+<!--            </select>-->
+            <input type="text" id="parentId" name="parentId" lay-filter="parentId" class="layui-input">
+        </div>
+    </div>
+
+    <div class="layui-form-item">
+        <label class="layui-form-label">排序</label>
+        <div class="layui-input-block">
+            <input type="number" name="sort" class="layui-input" lay-verify="" lay-reqtext="排序不能为空">
+        </div>
+    </div>
+
+
+    <div class="layui-form-item">
+        <div class="layui-input-block">
+            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
+        </div>
+    </div>
+</div>
+<script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
+<script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
+<script>
+
+    layui.use(['form','http','iconPickerFa','treeSelect'], function () {
+        /**变-------------------------------量-------------------------------定-------------------------------义*/
+        var form = layui.form,
+            layer = layui.layer,
+            http = layui.http,
+            $ = layui.$,
+            treeSelect = layui.treeSelect;
+        let id = $('#id').val()
+        let parentId;
+        /**方-------------------------------法-------------------------------定-------------------------------义*/
+        // 保存方法
+        let save = function (data) {
+                var selectedNodes = treeSelect.zTree('parentId').getSelectedNodes();
+                if (selectedNodes.length > 0){
+                    data.parentId = selectedNodes[0].id
+                }else {
+                    data.parentId = -1
+                }
+            http.post(id == '' ? 'system/archivesTree/insert': 'system/archivesTree/update',data,true,function (res) {
+                if (res.code == 200){
+                    let index = layer.alert('保存成功!', {
+                        title: id == '' ? '添加':'修改' + '信息'
+                    }, function () {
+                        // 关闭弹出层
+                        layer.close(index);
+                        let iframeIndex = parent.layer.getFrameIndex(window.name);
+                        parent.layer.close(iframeIndex);
+                    });
+                }
+            })
+        }
+
+        // 加载下拉框
+        let loadDictSelect = function () {
+            // http.get('/system/menu/select',null,false,function (res) {
+            //     let html = ''
+            //     for (let index in res.data) {
+            //         html += '<option value="'+res.data[index].id+'">'+res.data[index].title+'</option>'
+            //     }
+            //     $('#parentId').append(html)
+            //     form.render();//菜单渲染 把内容加载进去
+            // })
+            treeSelect.render({
+                // 选择器
+                elem: '#parentId',
+                // 数据
+                data: 'system/archivesTree/selectTree',
+                // 异步加载方式:get/post,默认get
+                type: 'get',
+                // 占位符
+                placeholder: '请选择父节点',
+                // 是否开启搜索功能:true/false,默认false
+                search: true,
+                // 一些可定制的样式
+                style: {
+                    folder: {
+                        enable: true
+                    },
+                    line: {
+                        enable: true
+                    }
+                },
+                success: function (res) {
+                    if(id != '' && parentId != '' && parentId != -1){
+                        treeSelect.checkNode('parentId', parentId);
+                    }
+                }
+            });
+        }
+
+        // 加载数据
+        let initData = function () {
+            if(id != ''){
+                http.get('/system/archivesTree/selectByPrimaryKey',{
+                    id: id
+                },false,function (res) {
+                    form.val("addDict", res.data);
+                    parentId = res.data.parentId
+                    form.render();
+                })
+            }
+        }
+        /**事-------------------------------件-------------------------------绑-------------------------------定*/
+
+        initData()
+        loadDictSelect()
+        //监听提交
+        form.on('submit(saveBtn)', function (data) {
+            let icon = 'fa '
+            icon += data.field.icon
+            data.field.icon = icon
+            save(data.field)
+        });
+
+    });
+</script>
+</body>
+</html>

+ 106 - 114
src/main/resources/static/page/archive/list.html

@@ -21,23 +21,21 @@
             <div class="layui-form toolbar">
                 <div class="layui-form-item">
                     <div class="layui-inline">
-                        <input type="text" id="name" name="name" lay-filter="name" placeholder="请输入标题" class="layui-input">
+                        <input type="text" id="dh" name="dh" lay-filter="dh" placeholder="请输入档号" class="layui-input">
                     </div>
                     <div class="layui-inline">
-                        <input type="text" id="name" name="name" lay-filter="name" placeholder="请输入档案名称" class="layui-input">
+                        <input type="text" id="mlh" name="mlh" lay-filter="mlh" placeholder="请输入目录号"
+                               class="layui-input">
                     </div>
-                    <div class="layui-input-inline">
-                        <select name="duty" id="duty">
-                            <option value="">请选择职级</option>
-                        </select>
-                    </div>
-                    <div class="layui-input-inline">
-                        <select name="political" id="political">
-                            <option value="">请选择政治面貌</option>
+                    <div class="layui-inline">
+                        <select name="bgqx" id="bgqx">
+                            <option value="">请选择保管期限</option>
                         </select>
                     </div>
                     <div class="layui-inline">
-                        <button id="btnSearch" lay-submit lay-filter="search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button>
+                        <button id="btnSearch" lay-submit lay-filter="search" class="layui-btn icon-btn"><i
+                                class="layui-icon"></i>搜索
+                        </button>
                     </div>
                 </div>
             </div>
@@ -62,7 +60,7 @@
 <script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
-    layui.use(['table', 'http', 'laydate','form','tree','upload','url'], function () {
+    layui.use(['table', 'http', 'laydate', 'form', 'tree', 'upload', 'url'], function () {
         /**变-------------------------------量-------------------------------定-------------------------------义*/
 
         var table = layui.table,
@@ -74,15 +72,15 @@
             url = layui.url,
             $ = layui.jquery;
 
-        let parentId = '',
-            deptId = '',
-            name = '',
-            duty = '',
-            political = '',
-            param = -1
+        let searchParam = {
+            dh: '',
+            mlh: '',
+            bgqx: '',
+            ml: ''
+        }
         /**方-------------------------------法-------------------------------定-------------------------------义*/
 
-        http.getRoleButton(28)
+        http.getRoleButton(158)
         let initUpload = function () {
             var loading;
             upload.render({
@@ -94,7 +92,7 @@
                 , accept: 'file' //普通文件
                 , acceptMime: '.xls,.xlsx'
                 , multiple: false
-                ,before: function () {
+                , before: function () {
                     loading = layer.load(0, {shade: [0.3, '#000']});
                 }
                 , done: function (res) {
@@ -102,8 +100,8 @@
                         layer.msg('导入成功');
                         renderTable();
                         // partyTable = res.data.path
-                    }else {
-                        layer.alert(res.msg,{icon: 2,title: '导入错误'})
+                    } else {
+                        layer.alert(res.msg, {icon: 2, title: '导入错误'})
                     }
                     layer.close(loading);
                 }
@@ -112,7 +110,7 @@
         }
 
 
-        let initSelect = function (){
+        let initSelect = function () {
             //职级
             http.get('system/dict/selectDictByCode', {code: 'ZHIJI'}, false, function (res) {
                 let html = '';
@@ -136,85 +134,70 @@
 
         // 加载组织架构
         let loadTree = function () {
-            http.get('system/archivesTree/selectTree',{},false,function (res) {
-                res.data.unshift({
-                    id: '',
-                    parentId: "-1",
-                    title: "全部",
-                    spread: true
-                })
+            http.get('system/archivesTree/selectTree', {}, false, function (res) {
+                // res.data.unshift({
+                //     id: '',
+                //     parentId: "-1",
+                //     title: "全部",
+                //     spread: true
+                // })
                 // parentId = res.data[0].parentId
                 // deptId = res.data[0].id
+                searchParam.ml = res.data[0].code
                 //基本演示
                 tree.render({
                     elem: '#tree'
-                    ,data: res.data
-                    ,showCheckbox: false  //是否显示复选框
-                    ,onlyIconControl: true
-                    ,id: 'tree'
-                    ,isJump: true //是否允许点击节点时弹出新窗口跳转
-                    ,click: function(obj){
+                    , data: res.data
+                    , showCheckbox: false  //是否显示复选框
+                    , onlyIconControl: true
+                    , id: 'tree'
+                    , isJump: true //是否允许点击节点时弹出新窗口跳转
+                    , click: function (obj) {
                         //节点高亮
                         var nodes = document.getElementsByClassName("layui-tree-txt");
-                        for(var i=0;i<nodes.length;i++){
-                            if(nodes[i].innerHTML === obj.data.title)
-                                nodes[i].style.color = "red";
-                            else
-                                nodes[i].style.color= "#555";
+                        for (var i = 0; i < nodes.length; i++) {
+                            if (nodes[i].innerHTML === obj.data.title) {
+                                if (nodes[i].style.color === 'red') {
+                                    // 当前节点已经选中 跳过
+                                    return
+                                }
+                                nodes[i].style.color = "red"
+                            } else {
+                                nodes[i].style.color = "#555"
+                            }
                         }
                         var data = obj.data;  //获取当前点击的节点数据
-                        parentId = data.parentId
-                        deptId = data.id
-                        name = ''
-                        $('#name').val('')
+                        searchParam.ml = data.code
                         renderTable()
                     }
                 });
-                // 默认展示一个大组的数据
+                // 设置默认第一项红色
                 var nodes = document.getElementsByClassName("layui-tree-txt");
-                for(var i=0;i<nodes.length;i++){
-                    if(nodes[i].innerHTML === res.data[0].title)
+                for (var i = 0; i < nodes.length; i++) {
+                    if (nodes[i].innerHTML === res.data[0].title)
                         nodes[i].style.color = "red";
                     else
-                        nodes[i].style.color= "#555";
+                        nodes[i].style.color = "#555";
                 }
             })
         }
 
         //数据加载方法
         let renderTable = function () {
-            // 统计图传过来的职级
-            if (param != undefined){
-                param = url();
-                // 回显
-                $('#duty').val(param.duty);
-                $('#political').val(param.political);
-                duty = param.duty
-                political = param.political
-                // 重新渲染下拉框
-                form.render('select');
-                param = undefined;
-            }
             // 加载表格数据
             table.render({
                 elem: '#user-table',
-                url: 'archives/user/selectByPage',
+                url: 'archive/archive/selectByPage',
                 toolbar: '#toolbar', //开启头部工具栏,并为其绑定左侧模板
                 defaultToolbar: ['filter', 'exports', 'print'],
                 title: '用户数据表',
                 toolbar: '#toolbar',
                 page: true,
                 request: {
-                    pageName: 'pageIndex',
+                    pageName: 'pageNum',
                     limitName: 'pageSize'
                 },
-                where: {
-                    parentId: parentId,
-                    deptId: deptId,
-                    name: name,
-                    duty: duty,
-                    political: political
-                },
+                where: searchParam,
                 response: {
                     statusCode: 200 //重新规定成功的状态码为 200,table 组件默认为 0
                 },
@@ -226,22 +209,19 @@
                         "data": res.data.list
                     }
                 },
-                done: function(res, curr, count) {
-                    $('th').css({'background-color': '#1aa094', 'color': '#fff','font-weight':'bold'})
+                done: function (res, curr, count) {
+                    $('th').css({'background-color': '#1aa094', 'color': '#fff', 'font-weight': 'bold'})
                 },
                 cols: [[
-                    {type: 'checkbox', fixed: 'left'},
+                    // {type: 'checkbox', fixed: 'left'},
                     {type: 'numbers'},
-                    {field: 'name', width:100,title: '姓名'},
-                    {field: 'bureaus', title: '局办'},
-                    {field: 'department', title: '科室'},
-                    {field: 'dutyName',width:100, title: '职级'},
-                    {field: 'propertiesName', width: 100,title: '人员性质'},
-                    {field: 'gender', width: 60, title: '性别',templet: function(d){if(d.gender == 0){return '男'}else{return '女'}}},
-                    {field: 'nationName',width: 60, title: '民族'},
-                    {field: 'idCard', width:180,title: '身份证号'},
-                    {field: 'politicalName', title: '政治面貌'},
-                    {field: 'phone', title: '手机号'},
+                    {field: 'name', title: '档号'},
+                    {field: 'bureaus', title: '题名'},
+                    {field: 'department', title: '类别'},
+                    {field: 'dutyName', title: '所属部门'},
+                    {field: 'propertiesName', title: '状态'},
+                    {field: 'nationName', title: '开始时间'},
+                    {field: 'nationName', title: '结束时间'},
                     {templet: '#operating', width: 240, align: 'center', title: '操作'}
                 ]]
             });
@@ -254,10 +234,10 @@
                 title: '添加监督对象',
                 type: 2,
                 shade: 0.2,
-                maxmin:true,
+                maxmin: true,
                 shadeClose: true,
                 area: ['100%', '100%'],
-                content: './editPage.html',
+                content: './edit.html',
                 end: function () {
                     renderTable()
                 }
@@ -267,13 +247,13 @@
         //删除方法
         let deleteDict = function (id) {
             layer.confirm('真的删除行么', function (index) {
-                http.delete('archives/user/delete',{id: id},true,function (res) {
-                    if (res.code == 200){
+                http.delete('archive/archive/delete', {id: id}, true, function (res) {
+                    if (res.code == 200) {
                         layer.msg('删除成功', {
                             icon: 1,
                             time: 2000
                         })
-                    }else {
+                    } else {
                         layer.msg(res.msg, {
                             icon: 2,
                             time: 2000
@@ -291,12 +271,12 @@
                 title: '修改监督对象',
                 type: 2,
                 shade: 0.2,
-                maxmin:true,
+                maxmin: true,
                 shadeClose: true,
                 area: ['100%', '100%'],
-                content: './editPage.html',
-                success: function(layero, index){
-                    var body=layer.getChildFrame('body',index);
+                content: './edit.html',
+                success: function (layero, index) {
+                    var body = layer.getChildFrame('body', index);
                     body.find("#id").val(id);
                 },
                 end: function () {
@@ -307,14 +287,14 @@
 
         let batchDel = function () {
             var data = layui.table.checkStatus('user-table').data;
-            if (data.length > 0){
+            if (data.length > 0) {
                 layer.confirm('真的删除行么', function (index) {
                     let ids = []
                     for (let i in data) {
                         ids.push(data[i].id)
                     }
-                    http.delete('archives/user/batchDelete',{ids: ids.join(',')},true,function (res) {
-                        if (res.code == 200){
+                    http.delete('archives/user/batchDelete', {ids: ids.join(',')}, true, function (res) {
+                        if (res.code == 200) {
                             layer.msg('删除成功', {
                                 icon: 1,
                                 time: 2000
@@ -324,13 +304,12 @@
                     })
                     layer.close(index);
                 });
-            }else {
+            } else {
                 layer.msg('请选择要删除的数据', {
                     icon: 3,
                     time: 2000
                 })
             }
-
         }
 
         let join = function (id) {
@@ -338,12 +317,12 @@
                 title: '监督对象',
                 type: 2,
                 shade: 0.2,
-                maxmin:true,
+                maxmin: true,
                 shadeClose: true,
                 area: ['100%', '100%'],
                 content: './editPage.html',
-                success: function(layero, index){
-                    var body=layer.getChildFrame('body',index);
+                success: function (layero, index) {
+                    var body = layer.getChildFrame('body', index);
                     body.find("#id").val(id);
                     body.find("#showAll").val('true');
                 },
@@ -353,7 +332,7 @@
             });
         }
 
-        let exportUser = function(data){
+        let exportUser = function (data) {
             var url = http.requestUrl + 'archives/user/exportWord?userId=' + data.id;
             var xhr = new XMLHttpRequest();
             xhr.open('POST', url, true);    // 也可以使用POST方式,根据接口
@@ -386,17 +365,25 @@
         // initSelect()
         // initUpload()
         loadTree()
-        // renderTable()
+        renderTable()
 
 
         //表格操作栏
         table.on('tool(table)', function (obj) {
             let data = obj.data;
             switch (obj.event) {
-                case 'delete': deleteDict(data.id); break;
-                case 'update': updateDict(data.id); break;
-                case 'show': join(data.id); break;
-                case 'export': exportUser(data);break;
+                case 'delete':
+                    deleteDict(data.id);
+                    break;
+                case 'update':
+                    updateDict(data.id);
+                    break;
+                case 'show':
+                    join(data.id);
+                    break;
+                case 'export':
+                    exportUser(data);
+                    break;
             }
         });
 
@@ -404,17 +391,22 @@
         //头部工具栏监听
         table.on('toolbar(table)', function (obj) {
             switch (obj.event) {
-                case 'add': addDict(); break;
-                case 'batchDel': batchDel(); break;
-                case 'import':  $("#importFile").click(); break;
-                case 'download': window.open("/template/1、个人基本事项报告.xlsx","_blank"); break;
+                case 'add':
+                    addDict();
+                    break;
+                case 'batchDel':
+                    batchDel();
+                    break;
+                case 'import':
+                    $("#importFile").click();
+                    break;
             }
         })
 
-        form.on('submit(search)', function(data){
-            name = data.field.name
-            duty = data.field.duty
-            political = data.field.political
+        form.on('submit(search)', function (data) {
+            searchParam.dh = data.field.dh
+            searchParam.mlh = data.field.mlh
+            searchParam.bgqx = data.field.bgqx
             renderTable()
         })
     });

+ 31 - 28
src/main/resources/static/page/menu/addMenu.html

@@ -18,7 +18,8 @@
         <label class="layui-form-label required">菜单名称</label>
         <div class="layui-input-block">
             <input type="hidden" name="id" id="id" class="layui-input">
-            <input type="text" name="title" lay-verify="required" lay-reqtext="菜单名称不能为空" placeholder="请输入菜单名称" value="" class="layui-input">
+            <input type="text" name="title" lay-verify="required" lay-reqtext="菜单名称不能为空" placeholder="请输入菜单名称" value=""
+                   class="layui-input">
         </div>
     </div>
 
@@ -37,9 +38,9 @@
     <div class="layui-form-item">
         <label class="layui-form-label">父级菜单</label>
         <div class="layui-input-block">
-<!--            <select name="parentId" id="parentId" lay-filter="parentId">-->
-<!--                <option value="-1">请选择父级菜单</option>-->
-<!--            </select>-->
+            <!--            <select name="parentId" id="parentId" lay-filter="parentId">-->
+            <!--                <option value="-1">请选择父级菜单</option>-->
+            <!--            </select>-->
             <input type="text" id="parentId" name="parentId" lay-filter="parentId" class="layui-input">
         </div>
     </div>
@@ -47,14 +48,16 @@
     <div class="layui-form-item">
         <label class="layui-form-label">菜单图标</label>
         <div class="layui-input-block">
-            <input type="text" id="selectIcon" name="icon" lay-filter="iconPicker"  lay-verify="" lay-reqtext="菜单图标不能为空" class="hide">
+            <input type="text" id="selectIcon" name="icon" lay-filter="iconPicker" lay-verify="" lay-reqtext="菜单图标不能为空"
+                   class="hide">
         </div>
     </div>
 
     <div class="layui-form-item">
         <label class="layui-form-label">菜单地址</label>
         <div class="layui-input-block">
-            <input type="text" name="href" placeholder="请输入菜单地址" value="" lay-verify="" lay-reqtext="菜单地址不能为空" class="layui-input">
+            <input type="text" name="href" placeholder="请输入菜单地址" value="" lay-verify="" lay-reqtext="菜单地址不能为空"
+                   class="layui-input">
         </div>
     </div>
 
@@ -76,7 +79,7 @@
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
 
-    layui.use(['form','http','iconPickerFa','treeSelect'], function () {
+    layui.use(['form', 'http', 'iconPickerFa', 'treeSelect'], function () {
         /**变-------------------------------量-------------------------------定-------------------------------义*/
         var form = layui.form,
             layer = layui.layer,
@@ -87,27 +90,27 @@
         let id = $('#id').val()
         let parentId;
         /**方-------------------------------法-------------------------------定-------------------------------义*/
-        // 保存方法
+            // 保存方法
         let save = function (data) {
                 var selectedNodes = treeSelect.zTree('parentId').getSelectedNodes();
-                if (selectedNodes.length > 0){
+                if (selectedNodes.length > 0) {
                     data.parentId = selectedNodes[0].id
-                }else {
+                } else {
                     data.parentId = -1
                 }
-            http.post(id == '' ? 'system/menu/insert': 'system/menu/update',data,true,function (res) {
-                if (res.code == 200){
-                    let index = layer.alert('保存成功!', {
-                        title: id == '' ? '添加':'修改' + '信息'
-                    }, function () {
-                        // 关闭弹出层
-                        layer.close(index);
-                        let iframeIndex = parent.layer.getFrameIndex(window.name);
-                        parent.layer.close(iframeIndex);
-                    });
-                }
-            })
-        }
+                http.post(id == '' ? 'system/menu/insert' : 'system/menu/update', data, true, function (res) {
+                    if (res.code == 200) {
+                        let index = layer.alert('保存成功!', {
+                            title: id == '' ? '添加' : '修改' + '信息'
+                        }, function () {
+                            // 关闭弹出层
+                            layer.close(index);
+                            let iframeIndex = parent.layer.getFrameIndex(window.name);
+                            parent.layer.close(iframeIndex);
+                        });
+                    }
+                })
+            }
 
         // 加载下拉框
         let loadDictSelect = function () {
@@ -140,7 +143,7 @@
                     }
                 },
                 success: function (res) {
-                    if(id != '' && parentId != '' && parentId != -1){
+                    if (id != '' && parentId != '' && parentId != -1) {
                         treeSelect.checkNode('parentId', parentId);
                     }
                 }
@@ -149,10 +152,10 @@
 
         // 加载数据
         let initData = function () {
-            if(id != ''){
-                http.get('/system/menu/selectByPrimaryKey',{
+            if (id != '') {
+                http.get('/system/menu/selectByPrimaryKey', {
                     id: id
-                },false,function (res) {
+                }, false, function (res) {
                     form.val("addDict", res.data);
                     iconPickerFa.checkIcon('iconPicker', res.data.icon);
                     parentId = res.data.parentId
@@ -162,7 +165,7 @@
         }
 
         // 加载图标选择器
-        let initialIconSelct = function (){
+        let initialIconSelct = function () {
             iconPickerFa.render({
                 // 选择器,推荐使用input
                 elem: '#selectIcon',