<!DOCTYPE html>
|
<html lang="zh-cn" xmlns:th=http://www.thymeleaf.org>
|
<head>
|
<meta charset="utf-8">
|
<title>智慧运维管理平台</title>
|
<meta name="viewport"
|
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
|
<link rel="stylesheet" th:href="@{/ajax/libs/mui/css/mui.min.css}">
|
<link rel="stylesheet" th:href="@{/ajax/libs/mui/css/icons-extra.css}">
|
<link rel="stylesheet" th:href="@{/css/iconfont.css}">
|
<style>
|
.mui-content {
|
margin: 0 6px;
|
}
|
|
.mui-content-padded {
|
margin: auto;
|
margin-top: 2px;
|
background: #252f3b;
|
}
|
|
.mui-content-padded img {
|
width: 100%;
|
height: 220px;
|
}
|
|
.mui-content-padded p {
|
font-size: 18px;
|
margin-bottom: 4px;
|
color: #000000;
|
}
|
|
.mui-grid-view.mui-grid-9 {
|
background-color: #efeff4;
|
margin-top: -12px;
|
}
|
|
.sys {
|
background: #FFFFFF;
|
margin-top: -3px;
|
}
|
|
.sys ul {
|
-webkit-padding-start: 10px;
|
-webkit-margin-before: 0px;
|
}
|
|
.sys li {
|
padding: 0 5px;
|
line-height: 42px;
|
display: flex;
|
justify-content: space-between;
|
box-sizing: border-box;
|
border-bottom: 1px #f1f1f1 solid;
|
}
|
|
.sys li span {
|
padding-left: 25px;
|
font-size: 17px;
|
}
|
|
.m02 {
|
background: url([[@{/img/ico_user.png}]]) no-repeat 1px center;
|
background-size: 28px auto;
|
}
|
|
.mui-grid-view.mui-grid-9 .mui-table-view-cell {
|
border: 0.5px solid #bbb;
|
border-radius: 6px;
|
margin: 1.5% 1.5% 1.5% 1.5%;
|
background: #FFFFFF;
|
}
|
|
.mui-grid-view.mui-grid-9 .mui-table-view-cell > a:not(.mui-btn) {
|
padding: 8px 0;
|
}
|
|
.mui-col-xs-4 {
|
width: 30.333333%;
|
}
|
|
.mui-icon-list {
|
color: #0c63e8;
|
}
|
|
.mui-icon-chat {
|
color: #ec6e10;
|
}
|
|
.mui-icon-contact {
|
color: #cf5cea;
|
}
|
|
.mui-icon-videocam {
|
color: #0aa8f7;
|
}
|
|
.mui-icon-gear {
|
color: #2ac845;
|
}
|
|
.mui-icon-close {
|
color: #f70808;
|
}
|
|
.mui-icon-settings {
|
color: #b5d220;
|
}
|
|
.mui-icon-compose {
|
color: #12efe6;
|
}
|
|
.mui-icon-loop {
|
color: #ce8d04;
|
}
|
</style>
|
</head>
|
<body>
|
<div class="mui-content">
|
<div class="mui-content-padded">
|
<p>
|
<img th:src="@{/img/login-left.png}" data-preview-src="" data-preview-group="1"/>
|
</p>
|
</div>
|
<div class="sys">
|
<ul>
|
<li class="m02">
|
<span id="user_mag">服务未绑定</span>
|
</li>
|
</ul>
|
</div>
|
<div>
|
<ul class="mui-table-view mui-grid-view mui-grid-9">
|
<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
|
<a href="javascript:void(0)" onclick="getView('warn-list')">
|
<span class="mui-icon mui-icon-chat"><span id="warnList" class="mui-badge"
|
style="display:none">0</span></span>
|
<div class="mui-media-body">出入库告警</div>
|
</a>
|
</li>
|
<li id="bind" class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" style="display: none">
|
<a href="javascript:void(0)" onclick="getView('bind')">
|
<span class="mui-icon mui-icon-gear"></span>
|
<div class="mui-media-body">服务绑定</div>
|
</a>
|
</li>
|
<li id="unbind" class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" style="display: none">
|
<a href="javascript:void(0)" onclick="getView('unbind')">
|
<span class="mui-icon mui-icon-close"></span>
|
<div class="mui-media-body">服务解绑</div>
|
</a>
|
</li>
|
</ul>
|
</div>
|
</div>
|
<script th:src="@{/js/jquery.min.js}"></script>
|
<script th:src="@{/wx/wx-common.js}"></script>
|
<script th:src="@{/ajax/libs/mui/js/mui.js}"></script>
|
<!--<script src="https://lf-cdn.coze.cn/obj/unpkg/flow-platform/chat-app-sdk/1.2.0-beta.20/libs/cn/index.js"></script>-->
|
<script th:inline="javascript">
|
|
var loginType = [[${loginType}]]; //登录方式
|
var userName = [[${userName}]];
|
var userId = [[${userId}]];
|
var user = [[${user}]];
|
openid = [[${openid}]]; //用户的openid
|
SERVE_URL = location.href.split("/wx/")[0]; //服务域名
|
var companyId = "";
|
var mobile;
|
|
|
$(function () {
|
if (loginType == "WECHAT") {
|
$("#bind").css("display", "");
|
$("#unbind").css("display", "");
|
}
|
mui.init();
|
getUser();
|
// getWarnList();
|
});
|
|
//跳转其他业务模块
|
function getView(tag) {
|
|
//微信公众号页面跳转
|
if (mobile || tag == 'bind') {
|
location.href = SERVE_URL + '/wx?tag=' + tag;
|
} else {
|
mui.alert("您尚未绑定服务,请先绑定!", '提示', ["确定"], function () {
|
}, "div");
|
}
|
|
};
|
|
//获取用户信息,查看用户是否绑定系统服务
|
function getUser() {
|
var data = {
|
"openid": openid,
|
"userName": userName,
|
"loginType": loginType
|
};
|
wxCommon.postJson("../wx/getUserBindInfo", data,function (result) {
|
if (result.code == "0000") {
|
companyId = result.data.companyId;
|
mobile = result.data.phonenumber;
|
$("#user_mag").html(result.data.userName + ",服务已绑定!")
|
}
|
});
|
}
|
|
//获取未处理告警数量
|
function getWarnList() {
|
var data = JSON.stringify({
|
"interfaceId": "app_10081",
|
"sign": "01",
|
"outId": "01-01",
|
"reqDateTime": new Date(),
|
"data": {
|
"userName": userName,
|
"loginType": loginType,
|
"openid": openid,
|
|
}
|
});
|
$.ajax({
|
type: "POST",
|
url: "../wx/gateway",
|
dataType: "json",
|
contentType: "application/json;charset=UTF-8",
|
data: data,
|
success: function (result) {
|
if (result.code == "0000") {
|
var num = result.data;
|
if (num <= 0) {
|
$("#warnList").text("0");
|
$("#warnList").hide();
|
} else {
|
if (num > 99) {
|
num = "99+";
|
}
|
$("#warnList").text(num);
|
$("#warnList").show();
|
}
|
|
} else {
|
$("#warnList").text("0");
|
$("#warnList").hide();
|
}
|
}
|
});
|
}
|
|
</script>
|
</body>
|
</html>
|