1035 lines
46 KiB
Plaintext
1035 lines
46 KiB
Plaintext
@using WX.CRM.Model.Entity;
|
||
@{
|
||
ViewBag.Title = "Index";
|
||
Layout = null;
|
||
}
|
||
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<title>微信CRM</title>
|
||
<meta name="renderer" content="webkit">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||
<!--<link href="/layui-v2.5.4/css/layui.css" rel="stylesheet" />-->
|
||
<link href="/layui-v2.5.4/css/layui _up.css" rel="stylesheet" />
|
||
<script src="/Scripts/jquery-1.10.2.min.js"></script>
|
||
<script src="/layui-v2.5.4/layui.js"></script>
|
||
<script src="/Scripts/jquery-1.10.2.min.js"></script>
|
||
<script src="/layui-v2.5.4/zadmin.js?v=2"></script>
|
||
<link href="/layui-v2.5.4/css/admin.css" rel="stylesheet" />
|
||
<script src="/Scripts/common.js"></script>
|
||
<link href="~/Content/Common.css" rel="stylesheet" />
|
||
<link href="~/layui-v2.5.4/css/bigpage.css" rel="stylesheet" />
|
||
<!-- 注意:如果你直接复制所有代码到本地,上述css路径需要改成你本地的 -->
|
||
<style>
|
||
.gbbiaoqian {
|
||
background: url(/image/icon/close.png) no-repeat center;
|
||
height: 32px;
|
||
width: 16px;
|
||
float: left;
|
||
position: relative;
|
||
}
|
||
|
||
.refresh {
|
||
background: url(/image/icon/refresh.png) no-repeat center;
|
||
height: 32px;
|
||
width: 16px;
|
||
float: left;
|
||
position: relative;
|
||
}
|
||
|
||
.Newlyadded {
|
||
background: url(/image/icon/Newlyadded.png) no-repeat center;
|
||
height: 32px;
|
||
width: 16px;
|
||
float: left;
|
||
position: relative;
|
||
}
|
||
|
||
.searchbutton {
|
||
border-radius: 0;
|
||
right: 0;
|
||
width: 30px;
|
||
height: 32px;
|
||
line-height: 32px;
|
||
border: none;
|
||
background-color: #e1251b;
|
||
font-size: 20px;
|
||
font-weight: 700;
|
||
color: #fff;
|
||
-webkit-transition: background .2s ease;
|
||
transition: background .2s ease;
|
||
cursor: pointer;
|
||
background: url(/image/icon/search.png) center no-repeat;
|
||
position: absolute;
|
||
display: block;
|
||
}
|
||
|
||
.searchbutton:hover {
|
||
background: url(/image/icon/search2.png) center no-repeat;
|
||
}
|
||
|
||
.messcount {
|
||
/* padding-right: 15px; */
|
||
display: inline-block;
|
||
border-radius: 50%;
|
||
background-color: #FF5722;
|
||
text-align: center;
|
||
/*position: absolute;*/
|
||
line-height: 16px;
|
||
min-width: 16px;
|
||
/*vertical-align: middle;*/
|
||
color: white;
|
||
margin-left: 20px;
|
||
padding: 1px;
|
||
font-size: 12px;
|
||
}
|
||
|
||
.tipsfloatright {
|
||
float: right;
|
||
}
|
||
|
||
.tipsMore {
|
||
cursor: pointer;
|
||
}
|
||
|
||
.tipsMore:hover {
|
||
text-decoration-line: underline;
|
||
color: #ff6a00;
|
||
}
|
||
|
||
.tipsfloatleft {
|
||
margin-left: 4px;
|
||
}
|
||
|
||
.topTitle {
|
||
height: 30px;
|
||
border-bottom: 1px #d2d2d2 solid;
|
||
margin: 0 -14px 0 -15px;
|
||
padding: 0 5px 5px 8px;
|
||
font-family: MicrosoftYaHei-Bold;
|
||
font-size: 15px;
|
||
color: #333333;
|
||
font-weight: bold;
|
||
}
|
||
|
||
.tipShow {
|
||
/*height: 30px;*/
|
||
line-height: 30px;
|
||
position: relative;
|
||
cursor: pointer;
|
||
padding: 5px 5px 5px 0px;
|
||
color: black;
|
||
}
|
||
|
||
.LookDiv {
|
||
border-bottom: 1px #e8e7e7 solid;
|
||
padding: 0px 5px 30px 0px;
|
||
}
|
||
|
||
.LookDetial {
|
||
cursor: pointer;
|
||
}
|
||
|
||
.LookDetial:hover {
|
||
text-decoration-line: underline;
|
||
color: #e1251b;
|
||
}
|
||
|
||
.tipButton {
|
||
margin-top: 20px;
|
||
padding-left: 10px;
|
||
}
|
||
|
||
/*.tipShow .tipsfloatright {
|
||
color: white;
|
||
}*/
|
||
|
||
.tipShow:hover {
|
||
/*background-color: red;*/
|
||
/*border-bottom: 2px #ff6a00 solid;*/
|
||
/*text-decoration: #ff6a00 solid;*/
|
||
text-decoration-line: underline;
|
||
color: #ff6a00;
|
||
}
|
||
|
||
.tipicon {
|
||
width: 25px;
|
||
height: 25px;
|
||
}
|
||
</style>
|
||
|
||
@*新消息闪动特效*@
|
||
<style>
|
||
.circle_bottom {
|
||
background: red;
|
||
border-radius: 100%;
|
||
width: 10px;
|
||
height: 10px;
|
||
filter: alpha(opacity=40);
|
||
z-index: -100;
|
||
position: absolute;
|
||
}
|
||
|
||
.animation {
|
||
-webkit-animation: twinkling 2.1s infinite ease-in-out;
|
||
animation: twinkling 2.1s infinite ease-in-out;
|
||
-webkit-animation-fill-mode: both;
|
||
animation-fill-mode: both;
|
||
}
|
||
|
||
@@-webkit-keyframes twinkling {
|
||
0% {
|
||
opacity: 0.2;
|
||
filter: alpha(opacity=20);
|
||
-webkit-transform: scale(1);
|
||
}
|
||
|
||
50% {
|
||
opacity: 0.5;
|
||
filter: alpha(opacity=50);
|
||
-webkit-transform: scale(1.3);
|
||
}
|
||
|
||
100% {
|
||
opacity: 0.2;
|
||
filter: alpha(opacity=20);
|
||
-webkit-transform: scale(1);
|
||
}
|
||
}
|
||
|
||
@@keyframes twinkling {
|
||
0% {
|
||
opacity: 0.2;
|
||
filter: alpha(opacity=20);
|
||
-webkit-transform: scale(1);
|
||
}
|
||
|
||
50% {
|
||
opacity: 0.5;
|
||
filter: alpha(opacity=50);
|
||
-webkit-transform: scale(1.3);
|
||
}
|
||
|
||
100% {
|
||
opacity: 0.2;
|
||
filter: alpha(opacity=20);
|
||
-webkit-transform: scale(1);
|
||
}
|
||
}
|
||
|
||
.hidden {
|
||
display: none;
|
||
}
|
||
|
||
.tipContent {
|
||
height: 300px;
|
||
overflow-y: scroll;
|
||
}
|
||
|
||
#myMessxs {
|
||
min-height: 100px;
|
||
background-color: white;
|
||
border: 1px solid #d2d2d2;
|
||
box-shadow: 0 2px 4px rgba(0,0,0,.12);
|
||
border-radius: 5px;
|
||
color: black;
|
||
}
|
||
|
||
.mysvgicon {
|
||
right: 10px;
|
||
left: auto;
|
||
position: absolute;
|
||
top: -10px;
|
||
}
|
||
|
||
.svgIcon {
|
||
width: 20px;
|
||
height: 20px;
|
||
vertical-align: middle;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body class="layui-layout-body" style="overflow: hidden">
|
||
@{
|
||
List<BAS_MODULEMENU> mainmenu = ViewBag.MainMenu as List<BAS_MODULEMENU>;
|
||
var first = mainmenu.FirstOrDefault();
|
||
|
||
}
|
||
<div id="app" class="layadmin-side-shrink-init">
|
||
<div class="layui-layout layui-layout-admin">
|
||
|
||
<div class="layui-side leftcolor myscrolcss" style="top:0px;">
|
||
<div style="font-size:24px;"></div>
|
||
@*<div class="layui-logo" style="font-size:24px;"></div>*@
|
||
<ul class="layui-nav layui-nav-tree nonbackground" lay-filter="test" id="leftmunu" style="top:20px;">
|
||
<!-- 侧边导航: <ul class="layui-nav layui-nav-tree layui-nav-side"> -->
|
||
@foreach (var item in mainmenu)
|
||
{
|
||
<li class="layui-nav-item layui-nav-itemed ">
|
||
<dl class="layui-nav-child">
|
||
@*<dd>*@
|
||
<dd class="@Html.Raw(item.MODULEMENUID==first.MODULEMENUID?"layui-this":"")">
|
||
<a _href="@Html.Raw("/Home/Module?moduleId="+item.MODULEMENUID)" mydata-id="@item.MODULEMENUID" ntitle="@Html.Raw(item.map_MNAME)" href="javascript:void(0);">
|
||
<div class="@Html.Raw(item.ICON) self_icon"></div>
|
||
<span class="menuleft">@Html.Raw(item.map_MNAME)</span>
|
||
</a>
|
||
</dd>
|
||
</dl>
|
||
</li>
|
||
}
|
||
|
||
</ul>
|
||
</div>
|
||
<div class="layui-header header header-demo" style="background-color:white;border-bottom:#c5c5c7 1px solid;">
|
||
<ul class="layui-nav layui-layout-left layui-form" style="padding-left:0px;">
|
||
<li class="layui-nav-item layadmin-flexible" lay-unselect="">
|
||
<a href="javascript:;" layadmin-event="flexible" title="侧边伸缩" id="flexibleLeft">
|
||
<i class="layui-icon layui-icon-spread-left blackcolor" id="LAY_app_flexible"></i>
|
||
</a>
|
||
</li>
|
||
@Html.Partial("AXCtiToolsNewLayout")
|
||
<span class="layui-nav-bar" style="left: 38px; top: 48px; width: 0px; opacity: 0;display:none"></span>
|
||
</ul>
|
||
<ul class="layui-nav layui-layout-right layui_right_color layui-form">
|
||
<li class="layui-nav-item layui_right_color">
|
||
<a href="javascript:;" style="color:black;"><i class="layui-icon layui-icon-username" style="font-size: 16px; color: #1E9FFF;vertical-align: middle;"></i>@Html.Raw(ViewBag.Name)</a>
|
||
<dl class="layui-nav-child">
|
||
<!-- 二级菜单 -->
|
||
<dd>
|
||
<a href='javascript:ChildAddTab("产品讲解", "/Base/Case")'>
|
||
<i class="layui-icon layui-icon-service" style="font-size: 16px; color: #1E9FFF;vertical-align: middle;"></i>
|
||
产品讲解
|
||
</a>
|
||
</dd>
|
||
<dd><a href="javascript:UpdatePwd()"> <i class="layui-icon layui-icon-list" style="font-size: 20px; color: #1E9FFF;vertical-align: middle;"></i>修改密码</a></dd>
|
||
<dd><a href="/Account/LogOff"> <i class="layui-icon layui-icon-close" style="font-size: 16px; color: #e1251b;vertical-align: middle;"></i>注销</a></dd>
|
||
</dl>
|
||
</li>
|
||
<li class="layui-nav-item" style="color: #DADADA">|</li>
|
||
<li class="layui-nav-item">
|
||
<div style="height:12px;line-height:16px;width:21px;font-size:16px; background-color:#36A7FF; color:white;margin-bottom: 2px;">A1</div>
|
||
<div class="layui_wifi_icon"> </div>
|
||
</li>
|
||
<li class="layui-nav-item" lay-unselect="" style=" margin-left:10px;" id="myMessage">
|
||
<div class="layui-icon layui_bell_icon" data-anim="layui-anim-rotate layui-anim-loop"></div>
|
||
<!-- 如果有新消息,则显示小圆点 -->
|
||
<span id="shanyishan" class="layui-badge-dot circle_bottom animation hidden" style="top:20%;left:4px; width:10px; height:10px;"></span>
|
||
</li>
|
||
<!--<span class="layui-nav-bar" style="left: 38px; top: 20px; width: 0px; opacity: 0;display:none"></span>-->
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="layui-body" id="nav2">
|
||
<div class="left-div">
|
||
<div class="divcontent towmenu">
|
||
<div id="leftdiv" class="myscrolcss" style="padding:0;margin:0; overflow-y:auto;overflow-x:hidden;height:100%;">
|
||
<div class="headstyle">
|
||
@*@Html.Raw(Request.QueryString["module"] == null ? "设置" : Request.QueryString["module"])*@
|
||
<span id="moduletitle">@Html.Raw(first.MNAME)</span>
|
||
</div>
|
||
<hr class="menuhr" style="margin-top:10px;" />
|
||
@foreach (var item in mainmenu)
|
||
{
|
||
<div id="Module_@Html.Raw(item.MODULEMENUID)" class="demo-tree-more mytree @Html.Raw(item.MODULEMENUID==first.MODULEMENUID?"":"hiddenMenu") ">
|
||
</div>
|
||
}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<style>
|
||
span[lay-stope="tabmore"] {
|
||
display: none;
|
||
}
|
||
|
||
.ly_toolBar {
|
||
display: none;
|
||
}
|
||
|
||
div[overflow] .ly_toolBar {
|
||
display: block;
|
||
position: absolute;
|
||
top: 0;
|
||
z-index: 10;
|
||
width: 25px;
|
||
height: 39px;
|
||
line-height: 39px;
|
||
border-width: 1px;
|
||
border-style: solid;
|
||
border-radius: 2px;
|
||
text-align: center;
|
||
background-color: #fff;
|
||
cursor: pointer;
|
||
color: black;
|
||
font-size: 14px;
|
||
border-color: #dcd9d9;
|
||
/*border-top: none;
|
||
border-left: none;
|
||
border-right: 1px solid #928b8b;
|
||
border-bottom: none;*/
|
||
}
|
||
|
||
div[overflow] .ly_toolBar_all {
|
||
right: 0;
|
||
z-index: 99999;
|
||
}
|
||
|
||
div[overflow] .layui-tab-title {
|
||
padding-left: 30px;
|
||
padding-right: 60px;
|
||
}
|
||
|
||
div[overflow] .ly_layui-tab-more {
|
||
padding-left: 10px;
|
||
padding-right: 32px;
|
||
}
|
||
|
||
div[overflow] .ly_toolBar_right {
|
||
right: 26px;
|
||
}
|
||
|
||
div[overflow] .ly_toolBar_all {
|
||
right: 0;
|
||
z-index: 99999;
|
||
}
|
||
|
||
.ly_layui-tab-more {
|
||
padding-right: 30px;
|
||
height: auto !important;
|
||
white-space: normal !important;
|
||
z-index: 999;
|
||
background-color: white;
|
||
}
|
||
|
||
.right-div .layui-tab-title li {
|
||
padding: 0 6px;
|
||
}
|
||
</style>
|
||
<div class="right-div">
|
||
<div class="layui-tab layui-tab-brief" lay-filter="xbs_tab" style="margin:0;" lay-allowclose="false">
|
||
<span class="layui-unselect ly_toolBar ly_toolBar_left" id="ly_scroll_left" title="向左滚动"><i class="layui-icon layui-icon-prev"></i></span>
|
||
<span class="layui-unselect ly_toolBar ly_toolBar_right" id="ly_scroll_right" title="向右边滚动"><i class="layui-icon layui-icon-next"></i></span>
|
||
<span class="layui-unselect ly_toolBar ly_toolBar_all" id="ly_scroll_all" title="全部显示"><i class="layui-icon layui-icon-down" id="ly_scroll_all_icon"></i></span>
|
||
<ul id="xbs_tab" class="layui-tab-title wocha">
|
||
<li class="home layui-this" lay-id="tba1">
|
||
我的桌面
|
||
</li>
|
||
</ul>
|
||
<div class="layui-tab-content">
|
||
<div class="layui-tab-item layui-show">
|
||
<iframe tab-id="tba1" src='/Home/WelCome' frameborder="0" scrolling="yes" class="x-iframe"></iframe>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script>
|
||
var nowScroopt = 0;
|
||
$(function () {
|
||
$("#ly_scroll_left").click(function () {
|
||
var nowleft = $("#xbs_tab").scrollLeft();
|
||
//$("#xbs_tab").scrollLeft(nowleft + 300);
|
||
$("#xbs_tab").animate({
|
||
scrollLeft: nowleft - 300,
|
||
});
|
||
});
|
||
$("#ly_scroll_right").click(function () {
|
||
var nowleft = $("#xbs_tab").scrollLeft();
|
||
//$("#xbs_tab").scrollLeft(nowleft - 300);
|
||
|
||
$("#xbs_tab").animate({
|
||
scrollLeft: nowleft + 300,
|
||
});
|
||
});
|
||
|
||
$("#ly_scroll_all").click(function () {
|
||
//$("#xbs_tab").addClass("layui-tab-more11");
|
||
if ($("#ly_scroll_all_icon").hasClass("layui-icon-down")) {
|
||
nowScroopt = $("#xbs_tab").scrollLeft();
|
||
$("#xbs_tab").addClass("ly_layui-tab-more ");
|
||
$("#ly_scroll_all_icon").removeClass("layui-icon-down").addClass("layui-icon-up");
|
||
} else {
|
||
$("#xbs_tab").removeClass("ly_layui-tab-more ");
|
||
if (nowScroopt != 0) {
|
||
$("#xbs_tab").animate({
|
||
scrollLeft: nowScroopt,
|
||
});
|
||
}
|
||
$("#ly_scroll_all_icon").addClass("layui-icon-down").removeClass("layui-icon-up");
|
||
}
|
||
});
|
||
})
|
||
function currenttabclose() {
|
||
$("#xbs_tab .layui-this .layui-tab-close").click();
|
||
}
|
||
</script>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<script>
|
||
var alldata=@Html.Raw(ViewBag.AllMenuList);
|
||
var layer;
|
||
var tree;
|
||
layui.use(['layer', 'tree'], function () {
|
||
layer = layui.layer;
|
||
tree = layui.tree;
|
||
$(alldata).each(function (i,aa) {
|
||
MenuInit(aa.ModuleId, aa.Data);
|
||
});
|
||
//二级菜单初始化
|
||
function MenuInit(munuid, leftmenudata) {
|
||
tree.render({
|
||
elem: '#Module_' + munuid
|
||
, data: leftmenudata
|
||
, showLine: false //是否开启连接线
|
||
, accordion: false
|
||
, click: function (obj) {
|
||
console.log(obj)
|
||
if (obj.data.url == null || obj.data.url == "") {
|
||
|
||
} else {
|
||
$("#Module_" + obj.data.moduleid + " .treeClick").removeClass("treeClick");
|
||
$(obj.elem).addClass("treeClick");
|
||
var newurl=ConfigUrl(obj.data);
|
||
AddTab(obj.data.title, "", newurl);
|
||
//var m = $("#iframediv").find("#ifwochao_" + obj.data.id).length;
|
||
//if (m > 0) {
|
||
// $("#iframediv .x-iframe").addClass("hidden-iframe")
|
||
// $("#iframediv #ifwochao_" + obj.data.id).removeClass("hidden-iframe")
|
||
//} else {
|
||
// obj.data = ConfigUrl(obj.data);
|
||
// var myiframe = iframehtml.format({ tabId: obj.data.id, tabId2: obj.data.id, src: obj.data.url });
|
||
// $("#iframediv").append(myiframe);
|
||
// //$("#ifwochao").attr("src", obj.data.url);
|
||
//}
|
||
}
|
||
}
|
||
});
|
||
}
|
||
function ConfigUrl(data) {
|
||
var myurl = data.url;
|
||
if (myurl.indexOf("http://") > -1 || myurl.indexOf("https://") > -1) {
|
||
if (myurl.indexOf("|") > -1) {//分内外网
|
||
var ssw = window.location.href;
|
||
if (ssw.indexOf("192.168.") > -1 || ssw.indexOf("localhost") > -1) {//内网无疑
|
||
myurl = myurl.split('|')[0];
|
||
} else {
|
||
myurl = myurl.split('|')[1];
|
||
}
|
||
}
|
||
}
|
||
if (myurl.indexOf("http://") == -1 && myurl.charAt(0) != "/") {
|
||
myurl = "/" + myurl;
|
||
}
|
||
if (myurl.indexOf("{companycode}") > -1) {
|
||
myurl = myurl.replace("{companycode}", "@Html.Raw(ViewBag.companycode)");
|
||
}
|
||
$("#iframediv .x-iframe").addClass("hidden-iframe")
|
||
if (myurl.indexOf("?") > -1) {
|
||
myurl += "&urlTitle=" + encodeURI(data.title);
|
||
} else {
|
||
myurl += "?urlTitle=" + encodeURI(data.title);
|
||
}
|
||
return myurl;
|
||
}
|
||
});
|
||
|
||
</script>
|
||
<script>
|
||
function SetTabsTitle(url, customername) {
|
||
var iframes = document.getElementsByTagName("iframe");
|
||
for (var i = 0; i < iframes.length; i++) {
|
||
if (url.indexOf(iframes[i].getAttribute("src")) > -1) {
|
||
var iframeIndex = $(iframes[i]).parent().index();
|
||
console.log("index:" + iframeIndex);
|
||
var tabTitle = $("#xbs_tab li:eq(" + iframeIndex + ")");
|
||
console.log(tabTitle);
|
||
if ($(tabTitle).text().indexOf(customername) == -1) {
|
||
$(tabTitle).contents().filter(function () {
|
||
return this.nodeType == 3
|
||
}).each(function () {
|
||
this.textContent = customername + "-" + this.textContent;
|
||
});
|
||
//alert($(tabTitle).find(".layui-tab-close").prev());
|
||
//$(tabTitle).find(".layui-tab-close").before(customername + "-" + $(tabTitle).text());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
function frameReturnByClose() {
|
||
CloseWindow();
|
||
}
|
||
function CloseWindow() {
|
||
layer.close(winindex);
|
||
}
|
||
|
||
function UpdatePwd() {
|
||
winindex = layer.open({
|
||
type: 2,
|
||
title: "修改密码",
|
||
content: '/Base/InnerUser/ChangeUserIfo',
|
||
area: ['500px', '300px']
|
||
});
|
||
|
||
}
|
||
</script>
|
||
<script>
|
||
$(function () {
|
||
resizeWindow();
|
||
$(window).resize(function () {//自动适应大小
|
||
resizeWindow();
|
||
});
|
||
});
|
||
function resizeWindow() {
|
||
var height = $(window).height() - 56;
|
||
$("#leftdiv").height(height);
|
||
}
|
||
</script>
|
||
@*tab操作*@
|
||
<script>
|
||
var nowIndexID = "";//当tab关闭得时候跳回上一个Index
|
||
var preIndexID = "";//上一个tabIndex
|
||
|
||
var nowIndex = 0;
|
||
var preIndex = 0;
|
||
var active = null;
|
||
var tabid = 1;
|
||
var tabList = [{ id: 1, tab_id: "main_01" }];//tab切换
|
||
function tab_click(lay_id) {
|
||
//console.log("您点击了:" + lay_id);
|
||
if (tabList[tabList.length - 1].tab_id != lay_id)//如果连续点击最后这一条,将不处理
|
||
{
|
||
var newtablist = [];
|
||
var newIndex = 0;
|
||
for (var mm = 0; mm < tabList.length; mm++) {
|
||
if (tabList[mm].tab_id != lay_id) {
|
||
newtablist[newIndex] = tabList[mm];
|
||
newIndex++;
|
||
}
|
||
}
|
||
tabList = newtablist;
|
||
tabid++;
|
||
tabList[tabList.length] = { id: tabid, tab_id: lay_id };//重新赋值
|
||
}
|
||
//console.log(tabList);
|
||
}
|
||
layui.config({ base: '/layui-v2.5.4/', }).use(['tabrightmenu', 'element'], function () {
|
||
|
||
var element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块
|
||
let rightmenu_ = layui.tabrightmenu;
|
||
// 默认渲染部分弹出项
|
||
rightmenu_.render({
|
||
container: '#nav2',
|
||
filter: 'xbs_tab',
|
||
// navArr:对象数组,每个对象包含dataType、title、method属性
|
||
navArr: [
|
||
{ eventName: 'refresh', title: '刷新', icon: 'refresh' },
|
||
{ eventName: 'closeothers', title: '关闭其它', icon: 'gbbiaoqian' },
|
||
{ eventName: 'hr', title: '分割线' },
|
||
{ eventName: 'openinnewwin', title: '在新的窗体打开', icon: 'Newlyadded' }
|
||
],
|
||
lockId: "tba1"//锁定id
|
||
// 注册自定义事件
|
||
})
|
||
|
||
$("#xbs_tab").on("click", "li", function () {
|
||
var lay_id = $(this).attr("lay-id");
|
||
tab_click(lay_id);
|
||
|
||
});
|
||
|
||
//tab删除
|
||
element.on('tabDelete(xbs_tab)', function (data) {
|
||
var layid = $("#xbs_tab li:eq(" + data.index + ")").attr("lay-id");
|
||
//console.log("关闭了:" + data.index + ",idd:" + layid); //得到当前Tab的所在下标
|
||
var newtablist = [];
|
||
var newIndex = 0;
|
||
for (var mm = 0; mm < tabList.length; mm++) {
|
||
var now = $("#xbs_tab li[lay-id='" + tabList[mm].tab_id + "']");
|
||
if (now != null && now.length > 0) {
|
||
newtablist[newIndex] = tabList[mm];
|
||
newIndex++;
|
||
}
|
||
}
|
||
tabList = newtablist;
|
||
|
||
if (tabList[tabList.length - 1] != null) {
|
||
element.tabChange('xbs_tab', tabList[tabList.length - 1].tab_id);//点击
|
||
}
|
||
|
||
});
|
||
|
||
//监听导航点击
|
||
element.on('nav(demo)', function (elem) {
|
||
//console.log(elem)
|
||
layer.msg(elem.text());
|
||
});
|
||
|
||
active = {
|
||
tabAdd: function (url, title, key) {
|
||
console.log("tab添加");
|
||
//新增一个Tab项
|
||
for (var i = 0; i < $('.x-iframe').length; i++) {
|
||
if ($('.x-iframe').eq(i).attr('tab-id') == key) {
|
||
//element.tabChange(key);
|
||
//event.stopPropagation();
|
||
element.tabChange('xbs_tab', key); //切换到:用户管理
|
||
tab_click(lay_id);
|
||
return;
|
||
}
|
||
};
|
||
tabid++;
|
||
tabList[tabList.length] = { id: tabid, tab_id: key };//新增一个tab需要进入tab 列表
|
||
|
||
element.tabAdd('xbs_tab', {
|
||
title: title//用于演示
|
||
, content: '<iframe tab-id="' + key + '" frameborder="0" src="' + url + '" scrolling="yes" class="x-iframe"></iframe>'
|
||
, id: key//实际使用一般是规定好的id,这里以时间戳模拟下
|
||
})
|
||
element.tabChange('xbs_tab', key); //切换到:用户管理
|
||
//event.stopPropagation();
|
||
//element.tabChange('xbs_tab', layid);
|
||
}
|
||
};
|
||
|
||
$("#flexibleLeft").click(function () {
|
||
if ($("#LAY_app_flexible").hasClass("layui-icon-shrink-right")) {//隐藏操作
|
||
$("#LAY_app_flexible").removeClass("layui-icon-shrink-right");
|
||
$("#LAY_app_flexible").addClass("layui-icon-spread-left");
|
||
$("#app").addClass("layadmin-side-shrink");
|
||
$("#app").removeClass("layadmin-side-show");
|
||
} else {//显示操作
|
||
$("#app").removeClass("layadmin-side-shrink-init");
|
||
$("#LAY_app_flexible").removeClass("layui-icon-spread-left");
|
||
$("#LAY_app_flexible").addClass("layui-icon-shrink-right");
|
||
$("#app").removeClass("layadmin-side-shrink");
|
||
$("#app").addClass("layadmin-side-show");
|
||
}
|
||
|
||
});
|
||
var nimalegebi = 0;
|
||
var nowtitle = "";
|
||
var index = null;
|
||
$("#leftmunu").find("li a").mouseover(function () {
|
||
if ($("#app").hasClass("layadmin-side-shrink") || $("#app").hasClass("layadmin-side-shrink-init")) {
|
||
var overtitle = $(this).attr("ntitle");
|
||
if (nowtitle != overtitle) {
|
||
index = layer.tips(overtitle, this, {
|
||
tips: 2,
|
||
time: 20000,
|
||
color: "red"
|
||
});
|
||
nowtitle = overtitle;
|
||
}
|
||
}
|
||
});
|
||
$("#leftmunu").mouseleave(function () {
|
||
if (index != null)
|
||
layer.close(index);
|
||
});
|
||
//===========================================******定时获取提醒消息*********========================================
|
||
//===========================================***************========================================
|
||
});
|
||
function GetDataFunc(messagedata) {
|
||
var html = "";
|
||
console.log("取得数据");
|
||
console.log(messagedata);
|
||
if (messagedata != null) {
|
||
html += "<div class='tipContent'>";
|
||
$(messagedata).each(function (xa, da) {
|
||
var tabtitle = "";
|
||
html += "<div id='showId_" + da.PKID + "' showId='" + da.PKID + "' isLook='" + da.ISLOOK + "' class='tipShow'><div class='tipShowItem'><span>" + da.CODENAME + "</span> " + (da.ISLOOK == 1 ? "" : "<span class='layui-badge-dot'></span>") + "<span class='tipsfloatright'>" + da.SHOWTIME + "</span></div>";
|
||
html += "<div class='tipShowItem'><span class='tipsfloatleft'>" + da.MESSAGE + "</span></div></div>";
|
||
html += "<div class='LookDiv'>";
|
||
if (da.CODE == "ComplainMessage") {//投诉消息
|
||
tabtitle = "投诉列表";
|
||
html += "<span class='tipsfloatright LookDetial' title='点击查看详细' url='/Qc/CustomerComplain/Index' ntitle='" + tabtitle + "'>查看</span>";
|
||
}
|
||
html += "</div>";
|
||
//else if (da.CODE == "SysNotice") {
|
||
// html += "<div id='showId_" + da.PKID + "' showId='" + da.PKID + "' isLook='" + da.ISLOOK + "' class='tipShow'><div class='tipShowItem'><span>" + da.CODENAME + "</span> " + (da.ISLOOK == 1 ? "" : "<span class='layui-badge-dot'></span>") + "<span class='tipsfloatright'>" + da.SHOWTIME + "</span></div>";
|
||
// html += "<div class='tipShowItem'><span class='tipsfloatleft'>" + da.MESSAGE + "</span></div></div>";
|
||
});
|
||
html += "</div>";
|
||
}
|
||
return html;
|
||
}
|
||
|
||
function ParentAddTab(url, title, key) {
|
||
active["tabAdd"](url, title, key);
|
||
}
|
||
function addTab(title, url, key) {
|
||
active["tabAdd"](url, title, key);
|
||
}
|
||
|
||
</script>
|
||
<style>
|
||
.msgtable {
|
||
}
|
||
|
||
.msgtable img {
|
||
height: 25px;
|
||
width: 25px;
|
||
}
|
||
|
||
.msgtable .lefttd img {
|
||
padding-left: 10px;
|
||
}
|
||
|
||
.msgtable td {
|
||
height: 38px;
|
||
}
|
||
|
||
.msgtable .msgtitle {
|
||
margin-left: 10px;
|
||
}
|
||
</style>
|
||
<script type="text/javascript">
|
||
//打开聊天界面
|
||
function OpenWindow(accountnum, accountName) {
|
||
window.open('/home/appletchat?accountnum=' + accountnum + "&accountName=" + accountName, 'chatwindow_' + accountnum, 'top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
|
||
}
|
||
$("#UserInfo").click(function () {
|
||
ChildAddTab("我的桌面", "/Home/WelCome", "");
|
||
});
|
||
function linkToItem(url) {
|
||
ChildAddTab("待办事项", url, "");
|
||
}
|
||
function ShowResDetial(url) {
|
||
ChildAddTab("客户详细", url, "");
|
||
}
|
||
function linkToMyAllocatedRes(url) {
|
||
ChildAddTab("系统分配资源", url, "");
|
||
}
|
||
function linkCmsUp(url) {
|
||
ChildAddTab("文案审核", url, "");
|
||
$.post("/Cms/CmsUp/LookMsg", function (data) {
|
||
if (!data.result)
|
||
console.log(data.retmsg);
|
||
});
|
||
}
|
||
function linkToMyActivityResDsb(url) {
|
||
ChildAddTab("经理分配资源", url, "");
|
||
}
|
||
function linkToWeiXinJianKong(url) {
|
||
ChildAddTab("工作微信监控", url, "");
|
||
}
|
||
function linkToWeiXinZJ(url) {
|
||
ChildAddTab("合规信息统计", url, "");
|
||
}
|
||
function linkToWeiXinZG(url) {
|
||
ChildAddTab("微信聊天违规信息", url, "");
|
||
}
|
||
function linkToWeiXinGR(url) {
|
||
ChildAddTab("我的违规记录", url, "");
|
||
}
|
||
function linkToWeiXinHB(url) {
|
||
ChildAddTab("微信红包", url, "");
|
||
}
|
||
function linkToActivityStOrEx(url) {
|
||
ChildAddTab("诊股资源回收", url, "");
|
||
}
|
||
function linkToComplainCustomer(url) {
|
||
ChildAddTab("客户投诉列表", url, "");
|
||
}
|
||
function linkToActivityStOrEx(url) {
|
||
ChildAddTab("资源统计及输出", url, "");
|
||
}
|
||
$(function () {
|
||
$("#ifMain").attr("src", "/Home/WelCome");
|
||
var doItmexm = null;
|
||
var contenthtml = `<table class='msgtable' style='width:400px'>
|
||
<tr><td class='lefttd'><img src='/Content/Images/db.png'/><a href='{dbsx}'><span class="msgtitle">待办:{dbsx_count}个</span></a></td><td><img src='/Content/Images/shsp.png'/><a href='{wash}'><span class="msgtitle">文案审核:{wash_count}个</span></a></td><tr/>
|
||
<tr><td class='lefttd'><img src='/Content/Images/login.png'/><a href='{softlogin}'><span class="msgtitle">登陆:{softlogin_count}个</span></a></td><td></td><tr/>
|
||
<tr><td class='lefttd'><img src='/Content/Images/ziyuan.png'/><a href='{newres}'><span class="msgtitle">新资源:{newres_count}个</span></a></td><td></td><tr/>
|
||
</table>`;
|
||
function doItem() {
|
||
$.post("/Csvr/ToDoItem/DoItems", function (data) {
|
||
if (data.result) {
|
||
var strs = "";
|
||
var newhtml = contenthtml;
|
||
var msgs = data.messages;
|
||
var urls = data.url;
|
||
var width = "250";
|
||
var mycars = new Array();
|
||
var xm = 0;
|
||
var msgcount = 0;
|
||
for (var i = 0; i < msgs.length; i++) {
|
||
if (urls[i] && urls[i].indexOf("Csvr/ToDoItem/Index") > -1) {
|
||
msgcount++;
|
||
if (urls[i].indexOf("resourcetag=softlogin") > -1) {
|
||
newhtml = newhtml.replace("{softlogin}", "javascript:linkToItem(\"" + urls[i] + "\")").replace("{softlogin_count}", msgs[i]);
|
||
} else {
|
||
newhtml = newhtml.replace("{dbsx}", "javascript:linkToItem(\"" + urls[i] + "\")").replace("{dbsx_count}", msgs[i]);
|
||
}
|
||
//strs += '<p><a class="aLink" href="javascript:void(0)" onclick="linkToItem(\'' + urls[i] + '\')">' + msgs[i] + "</a></p>";
|
||
}
|
||
//if (urls[i] && urls[i].indexOf("Csvr/MsgOpenAccount/RedirectToCustomerDetial") > -1) {
|
||
// var $div = "<div style='width:150px;height:auto;'></div>";
|
||
// var resIds = msgs[i].split("#");
|
||
// strs += "<div style='width:216px;height:auto;white-space:normal;'><span>新开户资源:</span>";
|
||
// var url = urls[i];
|
||
// $.each(resIds, function (i, n) {
|
||
// if (n) {
|
||
// var _url = url;
|
||
// _url = _url + "?resid=" + n + "&isView=0";
|
||
// strs += '<a style="margin-left:10px;" class="aLink" href="javascript:ShowResDetial(\'' + _url + '\')">' + n + "</a>";
|
||
// }
|
||
// });
|
||
// strs += "</div>";
|
||
//}
|
||
|
||
if (urls[i] && urls[i].indexOf("Res/Allocate/MyAllocatedRes") > -1) {
|
||
msgcount++;
|
||
//strs += '<p><a href="javascript:void(0)" onclick="linkToMyAllocatedRes(\'' + urls[i] + '\')">' + msgs[i] + "</a></p>";
|
||
newhtml = newhtml.replace("{newres}", "javascript:linkToMyAllocatedRes(\"" + urls[i] + "\")").replace("{newres_count}", msgs[i]);
|
||
}
|
||
|
||
if (urls[i] && urls[i].indexOf("Cms/CmsUp/Index") > -1) {
|
||
if (msgs[i] != "0") {
|
||
msgcount++;
|
||
//strs += '<p><a href="javascript:void(0)" onclick="linkCmsUp(\'' + urls[i] + '\')">' + msgs[i] + "</a></p>";
|
||
newhtml = newhtml.replace("{wash}", "javascript:linkCmsUp(\"" + urls[i] + "\")").replace("{wash_count}", msgs[i]);
|
||
}
|
||
}
|
||
|
||
//if (urls[i] && urls[i].indexOf("Res/Distribute/MyActivityResDsb") > -1) {
|
||
// strs += '<p><a href="javascript:void(0)" onclick="linkToMyActivityResDsb(\'' + urls[i] + '\')">' + msgs[i] + "</a></p>";
|
||
//}
|
||
|
||
if (urls[i] && urls[i].indexOf("WeiXin/WorkAccount/AliveIndex") > -1) {
|
||
strs += '<a href="javascript:void(0)" onclick="linkToWeiXinJianKong(\'' + urls[i] + '\')">' + msgs[i] + "</a>";
|
||
}
|
||
|
||
if (urls[i] && urls[i].indexOf("/Quality/ComplainCustomer/Index") > -1) {
|
||
if (msgs[i] != "") {
|
||
strs += '<a href="javascript:void(0)" onclick="linkToComplainCustomer(\'' + urls[i] + '\')" style="color:red">' + msgs[i] + "</a>";
|
||
}
|
||
}
|
||
|
||
//if (urls[i] && urls[i].indexOf("Res/Activity/ActivityStOrEx") > -1) {
|
||
// if (msgs[i] != "") {
|
||
// strs += '<a href="javascript:void(0)" onclick="linkToActivityStOrEx(\'' + urls[i] + '\')">' + msgs[i] + "</a>";
|
||
// }
|
||
//}
|
||
|
||
//if (urls[i] && urls[i].indexOf("/WeiXin/MyIllegalRecord/LookNotice?type=1") > -1) {
|
||
// mycars[xm] = '<a class="aLink" href="javascript:void(0)" style="width:200px;" onclick="linkToWeiXinZJ(\'' + urls[i] + '\')">' + msgs[i] + " 查看" + "</a>";
|
||
// width = "250";
|
||
// xm++;
|
||
//}
|
||
|
||
//if (urls[i] && urls[i].indexOf("/WeiXin/MyIllegalRecord/LookNotice?type=2") > -1) {
|
||
// mycars[xm] = '<a class="aLink" href="javascript:void(0)" style="width:200px;" onclick="linkToWeiXinZG(\'' + urls[i] + '\')">' + msgs[i] + " 查看" + "</a>";
|
||
// width = "250";
|
||
// xm++;
|
||
//}
|
||
|
||
//if (urls[i] && urls[i].indexOf("/WeiXin/MyIllegalRecord/LookNotice?type=3") > -1) {
|
||
// mycars[xm] = '<a class="aLink" href="javascript:void(0)" style="width:200px;" onclick="linkToWeiXinGR(\'' + urls[i] + '\')">' + msgs[i] + " 查看" + "</a>";
|
||
// width = "250";
|
||
// xm++;
|
||
//}
|
||
|
||
//if (urls[i] && urls[i].indexOf("/Weixin/WorkAccount/ShowHongBao") > -1) {
|
||
// mycars[xm] = '<a class="aLink" href="javascript: void (0)" style="width: 200px; " onclick="linkToWeiXinHB(\'' + urls[i] + '\')">' + msgs[i] + " 查看" + "</a>";
|
||
// width = "250";
|
||
// xm++;
|
||
//}
|
||
|
||
if (urls[i] && urls[i].indexOf("/Res/Activity/LookNotice") > -1) {
|
||
mycars[xm] = '<a class="aLink" href="javascript: void (0)" style="width: 200px; " onclick="linkToActivityStOrEx(\'' + urls[i] + '\')">' + msgs[i] + " 查看" + "</a>";
|
||
width = "250";
|
||
xm++;
|
||
}
|
||
|
||
}
|
||
var eid = @Html.Raw(ViewBag.Userid);
|
||
newhtml = newhtml.replace("{dbsx}", "javascript:linkToItem(\"../Csvr/ToDoItem/Index?userid=" + eid + "\")").replace("{dbsx_count}", "0");
|
||
newhtml = newhtml.replace("{newres}", "javascript:linkToMyAllocatedRes(\"../Res/Allocate/MyAllocatedRes?userid=" + eid + "\")").replace("{newres_count}","0");
|
||
newhtml = newhtml.replace("{softlogin}", "javascript:linkToItem(\"../Csvr/ToDoItem/Index?resourcetag=softlogin&userid=" + eid + "\")").replace("{softlogin_count}", "0");
|
||
newhtml = newhtml.replace("{wash}", "javascript:linkCmsUp(\"../Cms/CmsUp/Index?userid=" + eid + "\")").replace("{wash_count}", "0");
|
||
|
||
//console.log(doItmexm);
|
||
if (msgcount>0) {
|
||
//if (doItmexm != null)
|
||
// $(doItmexm).panel('close');
|
||
//doItmexm =
|
||
layer.open({
|
||
title: '提醒'
|
||
, content: newhtml// strs
|
||
, anim: 2
|
||
, scrollbar: true
|
||
, tipsMore: true
|
||
, shade: false
|
||
, offset: 'rb'
|
||
, time: 60000
|
||
, btn: []
|
||
});
|
||
|
||
//$.messager.show({
|
||
// title: "提醒", msg: strs, height: 'auto', width: width, height: '120', timeout: 60000, showType: 'slide', style: {
|
||
// left: '',
|
||
// right: 5,
|
||
// top: '',
|
||
// bottom: -document.body.scrollTop - document.documentElement.scrollTop + 5
|
||
// }
|
||
//});
|
||
//$(".panel-tool-close").one("click", function () {
|
||
// doItmexm = null;
|
||
//});
|
||
}
|
||
for (var i = 0; i < mycars.length; i++) {
|
||
layer.open({
|
||
title: '提醒'
|
||
, icon: 6
|
||
, content: mycars[i]
|
||
, anim: 2
|
||
, scrollbar: true
|
||
, tipsMore: true
|
||
, shade: false
|
||
, offset: 'rb'
|
||
, time: 60000
|
||
, btn: []
|
||
});
|
||
//$.messager.show({
|
||
// title: "提醒", msg: mycars[i], height: 'auto', width: width, height: '120', timeout: 60000, showType: 'slide', style: {
|
||
// left: '',
|
||
// right: 5,
|
||
// top: '',
|
||
// bottom: -document.body.scrollTop - document.documentElement.scrollTop + 5
|
||
// }
|
||
//});
|
||
}
|
||
|
||
|
||
//$.messageBox_set("提醒", strs, 10000);
|
||
}
|
||
// $.messageBox5s('提示', data.message);
|
||
}, "json");
|
||
//setTimeout(doItem, 1 * 30 * 1000);//3分钟提示一次
|
||
//setTimeout(doItem, 5 * 1000);//3分钟提示一次
|
||
}
|
||
//setTimeout(doItem, 3 * 1000);
|
||
//setTimeout(doItem, 5 * 60 * 1000);
|
||
|
||
});
|
||
|
||
</script>
|
||
@*实现跨域监听*@
|
||
<script>
|
||
window.addEventListener("message", receiveMessage, false);
|
||
function receiveMessage(event) {
|
||
console.log("收到消息了,该死的");
|
||
console.log(event);
|
||
if (event.data != null && event.data.url != null) {
|
||
//ChildAddTab(event.data.name, event.data.url, event.data.icon)
|
||
//ParentAddTab(event.data.url, event.data.name);
|
||
AddNewTab(event.data.name, "", event.data.url);
|
||
}
|
||
}
|
||
</script>
|
||
</body>
|
||
</html>
|