fei.wang
2024-04-15 61747a14819075bf6da2c1597b6c22e22e026686
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<%--
  Created by IntelliJ IDEA.
  User: Dell
  Date: 2023/6/26
  Time: 11:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link href="/HxzkFlow/images/favicon.ico" rel="icon" type="image/x-icon"/>
    <title>短信记录</title>
 
</head>
<link rel="stylesheet" href="/HxzkFlow/css/layui.css" media="all">
 
<body style="width: 100%;text-align: center;overflow:hidden;">
<div style="width: 100%;">
    <div style="margin-top: -10px;width: 100%;overflow:hidden;">
<%--        <script type="text/html" id="toolbarDemo" >--%>
            <div  id="toolbarDemo">
<%--                <button class="layui-btn "  lay-event="getadd">新增</button>--%>
<%--                <button class="layui-btn   layui-btn-warm"  lay-event="getUpdate">修改</button>--%>
                <button class="layui-btn  layui-btn-danger" id="btnde" lay-event="getDelete" style="display: none;margin-left: -1400px;">删除</button>
 
 
            </div>
<%--        </script>--%>
        <div style="margin-top: -40px;width:55%;display: inline-block" id="userWidth">
            <table id="demo"  lay-filter="demo"></table>
        </div>
<%--        <div style="width: 40%;height: 600px;display: inline-block;" class="userNo">--%>
<%--            <div id="main" style="width: 100%;height: 600px;"></div>--%>
<%--        </div>--%>
    </div>
</div>
<h3 style="position: absolute;top: 210px;left: 400px;z-index: 9999;font-weight: bolder;color: black;display:none" class="userNo">短信记录信息</h3>
</div>
</body>
<script src="/HxzkFlow/js/layui.js" charset="utf-8"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="/HxzkFlow/js/echarts.min.js"></script>
<script>
 
    var juese = localStorage.getItem("getjuese")
 
    if (juese=="超级管理员"){
        var button = document.getElementById('btnde');
        // 设置样式属性来隐藏按钮
        button.style.display = '';
    }
    //浏览器关闭事件
 
    /**
     * 判断用户在规定的时间内没有操作系统,则刷新浏览器
     * 参数:时间(单位分钟)
     * */
    function timeUserFun(time){
        var time = time || 2;
        var userTime = 3600;
        var objTime = {
            init:0,
            time:function(){
                objTime.init += 1;
                if(objTime.init === userTime){// 达到限制时间时,用户未操作事件,则刷新整个页面
                    localStorage.removeItem("gsjc")
                    sessionStorage.removeItem("admin")
                    alert("您长时间未操作当前页面,请重新登录")
                    var data = "Zong="+sessionStorage.getItem("admin");
                    //获取该用户最新时间
                    $.post("/HxzkFlow/hxzk/userdate",data,function (data){
 
                    })
                    parent.location.reload()
                    //达到限制时间没操作,所要执行的动作
                }
            },
            eventFun:function(){
                //清除上次监听,重新开始新的监听
                clearInterval(testUser);
                objTime.init = 0;
                testUser = setInterval(objTime.time,1000);
            }
        };
        //监听当前时间流动
        var testUser = setInterval(objTime.time,1000);
 
        //监听相应事件
        var body = document.querySelector('html');
        body.addEventListener("click",objTime.eventFun);
        body.addEventListener("keydown",objTime.eventFun);
        body.addEventListener("mousemove",objTime.eventFun);
        body.addEventListener("mousewheel",objTime.eventFun);
    }
    (function () {
        timeUserFun(1);
 
    }(0));
 
    layui.use('table', function() {
        var table = layui.table;
        //第一个实例
        var Zong = localStorage.getItem("gsjc")
 
        var data ="Zong="+Zong
        if(Zong == null){
 
        }else{
            $.post("/HxzkFlow/hxzk/jiemi",data,function (data){
                if(data == "1"){
                    $(".userNo").hide();
                    $("#userWidth").css("width","100%")
                    table.render({
                        elem: '#demo'
                        , layEvent: 'LAYTABLE_TIPS'
                        , height: 830
                        // ,cellMinWidth: 80
                        , url: '/HxzkFlow/hxzk/findDuanxinlog' //数据接口
                        // , page: true //开启分页
                        , toolbar: '#toolbarDemo'
                        , defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
                            title: '提示'
                            , layEvent: 'LAYTABLE_TIPS'
                            , icon: 'layui-icon-tips'
                        }]
                        , cols: [[ //表头
                            {type:'checkbox',sort: true,fixed: "left"}
                            ,{field: 'id', title: '序号',  sort: true,width:'5%'}
                            ,{field: 'receiver', title: '接收人', }
                            ,{field: 'number', title: '号码',  sort: true}
                            ,{field: 'content', title: '发送内容发', sort: true}
                            ,{field: 'dispatchdate', title: '发送日期', sort: true}
 
                        ]],
                        // done: function (res, curr, count) {
                        //     $("table").css("width", "100%")
                        // },
                        limit: 500,
                        // limits: [10, 20, 30, 40, 50, 60, 70, 80, 90],
                    });
 
                }
            })
        }
        //头工具栏事件
        table.on('toolbar(demo)', function(obj){
            var checkStatus = table.checkStatus(obj.config.id);
 
            switch(obj.event) {
                case 'getDelete':
                    var data = checkStatus.data;
                        if (data.length == 0) {
                            layer.alert("请选中一条数据")
                        } else {
                            var nums = [];
                            for (var i = 0; i < data.length; i++) {
                                nums.push(JSON.stringify(data[i].id))
                                var datas = "num=" + JSON.stringify(data[i].id)
                                $.post("/HxzkFlow/hxzk/DeleteDuanxinlog", datas, function (data) {
 
                                });
                            }
                            layer.alert("删除成功")
                        }
 
                    layui.table.reload('demo')
                    break;
                case 'getUpdate':
                    var data = checkStatus.data;
                    if (up!=2){
                        layer.alert("您无权限操作")
                    }else {
                        if (data.length > 1) {
                            layer.alert("一次只能选中一个进行修改")
                        } else if (data.length == 0) {
                            layer.alert("请选中一条数据")
                        } else {
                            $("#companynameup").val(data[0].companyname)
                            $("#companyabbnameup").val(data[0].companyabbname)
                            $("#loginphoneup").val(data[0].loginphone)
                            $("#shuinumup").val(data[0].shuinum);
                            $("#addressup").val(data[0].address);
                            $("#phoneup").val(data[0].phone)
                            $("#accountbankup").val(data[0].accountbank)
                            $("#accountup").val(data[0].account)
                            $(".update").show();
                            $(".heimu").show();
                            $(".gongsiid").val(data[0].companyid);
                            $("#companyidup").val(data[0].companyid);
                        }
                    }
                    break;
                case 'getadd':
                    if (add1!=2){
                        layer.alert("您无权限操作")
                    }else {
                        var data = checkStatus.data;
                        add();
                    }
                    break;
            };
            layui.table.reload('demo')
        });
    })
</script>
</html>