2
13693261870
2022-09-16 653761a31dfeb50dd3d007e892d69c90bf0cdafc
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8" />
    <script th:src="@{${pubzyWebRoot} + 'media/js/jquery-1.11.1.js'}"></script>
    <script th:src="@{${pubzyWebRoot} + 'media/js/winPro.js'}"></script>
    <script src="/js/MenHuMore.js"></script>
    <script type="text/javascript" th:inline="javascript">
        /*<![CDATA[*/
        var backstageWebRoot = [[${backstageWebRoot}]];
        var id = [[${id}]];
        var otherids = "";
        var moreURL = "/res/systeminfo/index?Menu=DTFW&menuId=10";
        $(function () {
            loadSysList();
            // more("更多", "http://" + window.location.host + "/res/systeminfo/index?Menu=DTFW&menuId=10", window.location.href);  //增加“更多”
            more("更多", "http://" + window.location.host + "/res/systeminfo/index?Menu=DTFW&menuId=10", "http://www.nmsmp.com:8082/login?oldurl=%2Fres%2FPingTaiMenHu%2FLianJie");  //增加“更多”
        });
        // 加载应用程序列表
        function loadSysList() {
            var thistype = getType("type");
            var num = 8;
            $.ajax({
                type: "GET",
                url: backstageWebRoot + 'api/sys/systeminfo/queryTopList',
                data:{
                    userid:id,
                    num:num,
                    type:thistype!=null?thistype:""
                },
                success: function (result) {
                    var html = "";
                    var uploadFileResource = backstageWebRoot + 'uploadFile/';
                    var data = eval(result);
                    otherids = "";
                    // 从后台获取数据
                    if (data.length > 0) {
                        for (var i = 0; i < data.length; i++) {
                            var id = data[i].id != null ? data[i].id :0;
                            // html += "<div class='div_app'><div class='div_img'><img onclick=\"openSysWin('"
                            //     + data[i].sysaddress + "')\" src='" + uploadFileResource
                            //     + data[i].sysimgurl + "' title='" + data[i].appfullname + "'></div>"
                            //     +"<div class='div_delete' onclick=\"deleteUserApp("
                            //     +data[i].appid+","+id+")\" style='display: none;'>X</div></div>";
 
 
                            html += "<div class='div_app'  onclick=\"openSysWin('"
                                 + data[i].sysaddress + "')\"  title='" + data[i].appfullname + "' >";
                            var imgurl = "/image/NewMenHu/sys.png";
                            if(data[i].sysimgurl != null && data[i].sysimgurl != undefined && data[i].sysimgurl != "") {
                                imgurl =  uploadFileResource + data[i].sysimgurl;
                            }
                            html += "<div class='div_img'><img src='" + imgurl + "'></div>";
                            html += "<div class='div_title'><span>"+ data[i].appname +"</span></div>";
                            html += "</div>";
                            if(otherids != ""){
                                otherids += ","+data[i].appid;
                            }else{
                                otherids += data[i].appid;
                            }
                        }
                    }
                    //数据少于10笔时显示添加按钮
                    if(data.length < num) {
                        html += "<div><div class='div_img'><img onclick='showsysteminfoList()' src='/image/MenHuIndex/addPic.gif' title='添加'></div></div>";
                        for (var i = 0; i < 10-data.length-1; i++) {
                            html+="<div><div class='div_img'><div style='background-color: #BDEAEB;margin: 0 auto;height:100%;width: 92%;'></div></div></div>";
                        }
                    }
                    else {
                        html += "<div class='btn_more'  onclick=\"openSysWin('"
                            + moreURL + "')\"  title='更多' >";
                        html += "<div class='div_img'><img src='"
                            + '/image/NewMenHu/more.png' + "'></div>";
                        html += "<div class='div_title'><span>更多</span></div>";
                        html += "</div>";
                    }
                    $(".div_main").html(html);
                    $(".div_app").mouseenter(function () {
                        $(this).find(".div_delete").css("display","");
                    })
                    $(".div_app").mouseleave(function () {
                        $(this).find(".div_delete").css("display","none");
                    })
                }
            });
        }
 
        function openSysWin(url) {
            window.open(url, "_blank");
        }
 
        //弹出应用程序选择列表
        function showsysteminfoList() {
            winPro.openFullwin("/res/PingTaiMenHu/SystemInfoList", "应用程序", "false", 545, 630);
        }
 
        function deleteUserApp(appid,sid) {
            var type = getType("type")
            $.ajax({
                type:"post",
                url: backstageWebRoot + "/api/sys/app/deleteByUseridAndAppid",
                data:{
                    userid:id,
                    appid:appid,
                    otherids:otherids,
                    type:type,
                    id:sid
                },
                success: function (result) {
                    alert("删除成功!");
                    loadSysList();
                },
                error: function (e) {
                    console.log(e)
                    alert("删除失败!错误提示:" + e.message);
                }
            });
        }
 
        //获取地址栏参数
        function getType(name) {
            var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if(r!=null)return r[2]; return null;
        }
        /*]]>*/
    </script>
    <style>
        body {
            margin: 0;
            height: 100%;
            background-color: transparent;
            font-family: '微软雅黑','Roboto',sans-serif !important;
            font-size: 18px;
            color: #454545;
        }
 
        .div_main {
            text-align: center;
            padding: 5px;
        }
        .div_app {
            width: 138px;
            height: 138px;
            float: left;
            padding: 6px 9px;
            cursor: pointer;
            border-radius: 6px;
        }
 
        .div_img {
            width: 92px;
            height: 96px;
            margin: 0 auto;
        }
 
        .div_main div img {
            height: 100%;
        }
 
        .div_delete{
            float:left;
            margin-left: -20px;
            margin-top: 20px;
            cursor: pointer;
            position:relative;
        }
 
        .div_app:hover {
            background-color: #CADAFB;
        }
 
        .div_app:hover .div_title {
            border-radius: 15px;
            color: white;
            background-color: #1D51E3;
            width: 125px;
        }
 
        .div_title {
            width: 80%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            padding: 2px 6px 3px;
            margin: 0 auto;
            margin-top: 8px;
        }
 
        .btn_more {
            padding: 6px 9px;
            float: left;
            cursor: pointer;
        }
    </style>
</head>
<body>
<div class="div_main"></div>
</body>
</html>