<!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>
|