admin
2025-02-20 f537abe9f3646c739beaf15076246a2f71a347e9
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<html lang="zh-cn">
 
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="referrer" content="never">
        <title>设置-TOP通知栏</title>
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link href="css/maincontent.css" rel="stylesheet">
        <style type="text/css">
            .appname .checkbox input {
                margin-left: 0 !important;
            }
            
            .appname label input {
                margin-right: 50px;
            }
            
            .appname label span {
                margin-left: 20px;
            }
        </style>
    </head>
 
    <body>
        <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
        </nav>
        <div id="mainbody">
            <div id="sidebar">
                <dl>
                </dl>
            </div>
            <div id="neirong">
                <div class="erjidh">
                    <table class="table">
                        <tbody>
                            <tr>
                                <td class="xiala">
                                    <select name="select" class="form-control select-detailsystem">
                                    </select>
                                </td>
                                <td>
                                    <form class="form-inline" role="form">
                                        <div class="form-group" role="search">
                                            <input type="text" class="form-control searchText" style="width:200px;" placeholder="搜索">
                                        </div>
                                        <button type="button" class="btn btn-default search">搜索</button>
                                    </form>
                                </td>
                                <td>
                                    <div class="tianjia">
                                        <a href="add-toptongzhi.html" class="btn btn-primary" role="button">添加内容&nbsp;+</a>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="zhuti">
                    <div class="zhutisousuo">
                        <table class="table">
                            <thead>
                                <tr>
                                    <th width="7%">选择</th>
                                    <th width="7%">编号</th>
                                    <th width="18%">内容</th>
                                    <th width="18%">链接</th>
                                    <th width="21%">APP名称</th>
                                    <th width="15%">创建时间</th>
                                    <th width="7%">删除</th>
                                    <th width="7%">编辑</th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="liebiao">
                        <table class="table">
                            <tbody>
                                <tr>
                                    <td width="7%">
                                        <div class="xuanze">
                                            <label>
                            <input type="checkbox" value="">
                          </label>
                                        </div>
                                    </td>
                                    <td width="7%">
                                        <div class="bianhao"></div>
                                    </td>
                                    <td width="18%">
                                        <form role="form">
                                            <div class="form-group">
                                                <textarea class="form-control content" rows="4" readonly="readonly"></textarea>
                                            </div>
                                        </form>
                                    </td>
                                    <td width="18%">
                                        <form role="form">
                                            <div class="form-group">
                                                <textarea class="form-control url" rows="4" readonly="resdonly"></textarea>
                                            </div>
                                        </form>
                                    </td>
                                    <td width="21%">
                                        <div class="appname">
                                            <div class="checkbox">
                                                <label>
                              <input type="checkbox" value="#" style="margin-right: 50px;">
                              <span style="margin-left: 20px;"></span>
                                                </label>
                                            </div>
                                        </div>
                                    </td>
                                    <td width="15%" style="text-align:center; line-height:105px;">
                                        <span class="time"></span>
                                    </td>
                                    <td width="7%" style="padding-top: 35px;">
                                        <a class="anniu shanchu"><img src="image/dustbin.png"></a></td>
                                    <td width="7%" style="padding-top: 35px;">
                                        <a class="anniu bianji"><img src="image/bianji.png" /></a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <div class="bottom">
                            <div class="page">
                                <ul class="pagination">
                                    <li class="disabled pre">
                                        <a href="#">&laquo;</a>
                                    </li>
                                    <li>
                                        <a href="#" class="next">&raquo;</a>
                                    </li>
                                </ul>
                                <div class="form-group">
                                    <div class="tzan">
                                        <button type="button" class="btn btn-primary">跳转</button>
                                    </div>
                                    <div class="tz">
                                        <input class="form-control" type="text" placeholder="页数">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <script src="js/jquery.min.js"></script>
                <script src="js/bootstrap.min.js"></script>
                <script src="js/nav.js"></script>
                <script src="js/common.js"></script>
                <script src="js/page.js"></script>
                <script src="layer/layer.js"></script>
    </body>
    <script>
        var apphtml = $(".liebiao tbody .appname").html();
        $(".liebiao tbody .appname").empty();
        var html = $(".liebiao tbody").html();
 
        $(function() {
            $(".liebiao tbody").empty();
            getHomeNotice(1);
            $(".search").bind("click", function() {
                getHomeNotice(1);
            });
 
        });
 
        function getHomeNotice(page) {
            var key = $(".searchText").val();
            var sys = $(".xiala .select-detailsystem > option:checked").val();
            if(sys == undefined) {
                sys = 0;
            }
            $.post("api/homeNotice/getHomeNoticeList", { "key": key, "page": page, "detailSystem": sys }, function(data) {
                if(data.code == 0) {
                    setHomeNotice(data);
                    fillPage(data.pageEntity, function(pageIndex) {
                        getHomeNotice(pageIndex);
                    });
                } else {
                    alert("加载失败");
                }
            }, 'json')
        }
 
        function setHomeNotice(data) {
            $(".liebiao tbody").empty();
            for(var ii = 0; ii < data.homeNoticeAdminList.length; ii++) {
                $(".liebiao tbody").append(html);
                var homeAdmin = data.homeNoticeAdminList[ii];
                var id = homeAdmin.homeNotice.homeNotice.id;
                var content = homeAdmin.homeNotice.homeNotice.content;
                var url = homeAdmin.homeNotice.homeNotice.url;
                var time = homeAdmin.homeNotice.homeNotice.createtime;
                var $curTr = $(".liebiao tbody tr").eq(ii);
                $curTr.find(".xuanze input").val(id);
                $curTr.find(".bianhao").text(id);
                $curTr.find(".content").val(content);
                $curTr.find(".url").val(url);
                $curTr.find(".time").text(time);
                $curTr.find(".bianji").attr("href", "edit-toptongzhi.html?key=" + id);
                $curTr.find(".shanchu").attr("key",id);
                var sysList = homeAdmin.detailSystemList;
                for(var nn = 0; nn < sysList.length; nn++) {
                    $curTr.find(".appname").append(apphtml);
                    var sys = sysList[nn];
                    var appName = sys.detailSystem.appName;
                    var appId = sys.detailSystem.id;
                    var isSelect = sys.selected;
                    var $app = $curTr.find(".appname .checkbox").eq(nn);
                    $app.find("span").text(appName);
                    $app.find("input").val(appId);
                    $app.find("input").attr("key",id);
                    $app.find("input").attr("checked", isSelect);
                }
            }
            $(".appname .checkbox input").bind("click",function(){
                        var ck = this.checked;
                        var type = ck?1:2;
                        var id = $(this).attr("key");
                        var detailSystem = $(this).val();
                        $.post("api/homeNotice/setSupertHomeNotice",{"id":id,"detailSystem":detailSystem,"type":type},function(data){
                            if(data.code==0){
                                layer.msg("操作成功");
                            }else{
                                layer.msg("操作失败");
                            }
                        },'json')
                })
            $(".shanchu").bind("click",function(){
                    var id =$(this).attr("key");
                    layer.confirm('是不是要删除?', {
                    btn: ['否','是'] //按钮
                    }, function(index){
                    layer.close(index);
                    return false;
                    }, function(){
                            $.post("api/homeNotice/deleteHomeNotice",{"id":id},function(data){
                            if(data.code==0){
                                layer.msg("删除成功!");
                                getHomeNotice(1);
                            }else{
                                layer.msg("删除失败!");
                            }
                        },'json')
                    });
            });
        }
    </script>
 
</html>