248 lines
10 KiB
Plaintext
248 lines
10 KiB
Plaintext
@using Mini.Web.WebHelper;
|
||
@{
|
||
ViewBag.Title = "Index";
|
||
Layout = "~/Areas/Admin/Views/Shared/_content.cshtml";
|
||
}
|
||
|
||
<div class="layui-fluid" style="padding-left:0px;padding-top:10px;">
|
||
<div class="layui-card" id="topcard" style="width:100%;padding-top:10px;">
|
||
<div class="layui-card-header layui-self-header">
|
||
<div style="float:left;position:relative;">
|
||
企业微信监控
|
||
</div>
|
||
<div style="float:right;position:relative;">
|
||
@*@Html.Action("ToolBarNew", "Control",
|
||
new {
|
||
tool= ViewBag.ToolBar as ToolBar,
|
||
otherToolBars = new Mini.Web.WebHelper.ToolBarNew[] {}
|
||
}
|
||
)*@
|
||
@await Component.InvokeAsync("ToolBarNew", new { ToolBar = ViewBag.ToolBar as ToolBar, otherToolBars = new Mini.Web.WebHelper.ToolBarNew[] {
|
||
new ToolBarNew(){ btnColor="", btnName="聊天记录" },
|
||
new ToolBarNew(){ btnColor="", btnName="外部联系人" },
|
||
new ToolBarNew(){ btnColor="", btnName="查找客户" },
|
||
new ToolBarNew(){ btnColor="", btnName="群管理" },
|
||
new ToolBarNew(){ btnColor="", btnName="备注姓名" }
|
||
} })
|
||
@*<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="add" type="button" value="+新增" />
|
||
<input class="layui-btn layui-btn-sm layui-btn-normal" data-method="update" type="reset" value="修改" />
|
||
<input class="layui-btn layui-btn-sm layui-btn-reset" data-method="delete" type="reset" value="删除" />*@
|
||
</div>
|
||
<div class="hrclass" style="position:relative;float: left;"></div>
|
||
</div>
|
||
<div class="layui-card-body " id="contentBody">
|
||
<form class="layui-form selftopwhere" id="myform">
|
||
<div class="layui-form-item">
|
||
企业:
|
||
<div class="layui-inline">
|
||
@Html.DropDownList("corp", ViewBag.Select as List<SelectListItem>)
|
||
</div>
|
||
名称:
|
||
<div class="layui-inline">
|
||
<input type="text" style="width:130px;" name="name" required lay-verify="required" placeholder="ID/名称/号码/邮箱" autocomplete="off" class="layui-input">
|
||
</div>
|
||
|
||
<div class="layui-inline">
|
||
<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="search" type="button" value="查询" /><input class="layui-btn layui-btn-sm layui-btn-reset" type="reset" value="清空" />
|
||
</div>
|
||
</div>
|
||
</form>
|
||
<table class="layui-hide" id="tab_kefuzhuangtaiyi1" lay-filter="wochao"></table>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<!--确定宽度-->
|
||
|
||
<script>
|
||
var table;
|
||
$(function () {
|
||
//var tempwidth = 1410;
|
||
//var tempheight = 1115;
|
||
//var width = $(window).width();
|
||
//var height = Math.ceil(width * (tempheight / tempwidth));
|
||
//$("body").height($(window).height() + 150);
|
||
|
||
//$(window).resize(function () {//自动适应大小
|
||
// console.log("resize");
|
||
// table.resize('tab_kefuzhuangtaiyi1');
|
||
//});
|
||
});
|
||
</script>
|
||
<script>
|
||
layui.use('laydate', function () {
|
||
var laydate = layui.laydate;
|
||
//执行一个laydate实例
|
||
laydate.render({
|
||
elem: '#start' //指定元素
|
||
});
|
||
//执行一个laydate实例
|
||
laydate.render({
|
||
elem: '#end' //指定元素
|
||
});
|
||
});
|
||
var selectRow = {};
|
||
var winindex;
|
||
var layer;
|
||
var rowid;
|
||
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
|
||
layui.use('element', function () {
|
||
var element = layui.element;
|
||
element.on('tab(tonghuajiankong)', function (n) {
|
||
$(".bodytable").addClass("hidden");
|
||
$("#kefuzhuangtai" + (n.index + 1)).removeClass("hidden");
|
||
});
|
||
element.on('tab(maintab)', function (n) {
|
||
if (n.index == 0)
|
||
$("#bottomcard").removeClass("hidden");
|
||
else
|
||
$("#bottomcard").addClass("hidden");
|
||
});
|
||
});
|
||
layui.use(['laypage', 'layer', 'table', 'laydate'], function () {
|
||
var laydate = layui.laydate;
|
||
layer = layui.layer;
|
||
table = layui.table;
|
||
table.render({
|
||
id: 'listReload'//列表别名ID
|
||
, elem: '#tab_kefuzhuangtaiyi1'
|
||
, url: 'GetWeWorktHtmlList'
|
||
, method: 'POST'
|
||
, cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
||
, page: true
|
||
, limit: 30
|
||
, height: "full-160"
|
||
//, size:"sm"
|
||
, cols: [[
|
||
{ field: 'numbers', type: 'numbers' }
|
||
, { field: 'corpid', title: '企业ID' }
|
||
, { field: 'corpname', title: '企业号' }
|
||
, { field: 'userid', title: 'ID' }
|
||
, { field: 'uname', title: '名称' }
|
||
, { field: 'remarkname', title: '备注名称' }
|
||
, {
|
||
field: 'fmsgtime', title: '首次聊天时间', templet: function (d) {
|
||
if (d.fmsgtime == null)
|
||
return "";
|
||
return layui.util.toDateString(d.fmsgtime, 'yyyy-MM-dd HH:mm:ss');
|
||
}
|
||
}
|
||
, {
|
||
field: 'lmsgtime', title: '最后聊天时间', templet: function (d) {
|
||
if (d.lmsgtime == null)
|
||
return "";
|
||
return layui.util.toDateString(d.lmsgtime, 'yyyy-MM-dd HH:mm:ss');
|
||
}
|
||
}
|
||
, { field: 'mobile', title: '电话' }
|
||
, { field: 'email', title: '邮箱' }
|
||
]], where: $("#myform").serializeFormJSON()
|
||
});
|
||
//监听行单击事件(单击事件为:rowDouble)
|
||
table.on('row(wochao)', function (obj) {
|
||
var data = obj.data;
|
||
//console.log(data);
|
||
//标注选中样式
|
||
obj.tr.addClass('self-table-click').siblings().removeClass('self-table-click');
|
||
selectRow = data;
|
||
});
|
||
|
||
|
||
var active = {
|
||
other5: function () {
|
||
if (selectRow.userid == "undefined" || selectRow.userid == null) {
|
||
//layer.alert("请先选中一条记录!", { title: '提示' });
|
||
layer.msg("请先选中一条记录!", { icon: 7 });
|
||
return;
|
||
}
|
||
winindex = layer.open({
|
||
type: 2,
|
||
content: '/Admin/HHuser/Remarks?userid=' + selectRow.userid + "&corp=" + selectRow.corpid,
|
||
title: '备注姓名',
|
||
area: ['500px', '400px']
|
||
});
|
||
},
|
||
other4: function () {
|
||
var corp = $("#corp").val();
|
||
if (corp == "") {
|
||
layer.msg("请选择企业!", { icon: 7 });
|
||
return;
|
||
}
|
||
var corpname = $("#corp option[value='" + corp + "']").text();
|
||
window.parent.ChildAddTab('微信群--' + corpname, '/Admin/HHuser/Group?corp=' + corp, "icon-detail");
|
||
}, other3: function () {
|
||
var width = $(window).width() * 0.7;
|
||
var height = $(window).height() * 0.7;
|
||
if (width < 600)
|
||
width == 600;
|
||
if (height < 500)
|
||
height = 500;
|
||
winindex = layer.open({
|
||
type: 2,
|
||
content: '/Admin/HHuser/Find',
|
||
area: [width + 'px', height + 'px']
|
||
});
|
||
}, other1: function () {
|
||
if (selectRow.userid == "undefined" || selectRow.userid == null) {
|
||
//layer.alert("请先选中一条记录!", { title: '提示' });
|
||
layer.msg("请先选中一条记录!", { icon: 7 });
|
||
return;
|
||
}
|
||
//winindex = layer.open({
|
||
// type: 2,
|
||
// content: '/Admin/HHuser/Message?userid=' + selectRow.userid + "&uname=" + selectRow.uname + "&corp=" + selectRow.corpid,
|
||
// area: ['600px', '500px']
|
||
//});
|
||
window.parent.ChildAddTab('企微聊天记录--' + selectRow.uname, '/Admin/HHuser/Message?userid=' + selectRow.userid + "&uname=" + encodeURIComponent(selectRow.uname) + "&corp=" + selectRow.corpid, "icon-detail");
|
||
}, other2: function () {
|
||
if (selectRow.userid == "undefined" || selectRow.userid == null) {
|
||
//layer.alert("请先选中一条记录!", { title: '提示' });
|
||
layer.msg("请先选中一条记录!", { icon: 7 });
|
||
return;
|
||
}
|
||
window.parent.ChildAddTab('外部联系人--' + selectRow.uname, '/Admin/HHuser/Outer?userid=' + selectRow.userid + "&uname=" + encodeURIComponent(selectRow.uname) + "&corp=" + selectRow.corpid, "icon-detail");
|
||
//winindex = layer.open({
|
||
// type: 2,
|
||
// content: '/Admin/HHuser/Outer?userid=' + row.userid + "&uname=" + row.uname + "&corp=" + row.corpid,
|
||
// area: ['600px', '500px']
|
||
//});
|
||
}, search: function () {
|
||
//alert($("#myform").serialize());
|
||
//console.log($("#myform").serialize());
|
||
//console.log($("#myform").serializeFormJSON());
|
||
var param = $("#myform").serializeFormJSON();
|
||
table.reload('listReload', {
|
||
page: {
|
||
curr: 1 //重新从第 1 页开始
|
||
},
|
||
where: param
|
||
});
|
||
}
|
||
};
|
||
$('.layui-btn').on('click', function () {
|
||
var othis = $(this), method = othis.data('method');
|
||
console.log(method);
|
||
active[method] ? active[method].call(this, othis) : '';
|
||
|
||
});
|
||
});
|
||
function Closed() {
|
||
layer.close(winindex);
|
||
}
|
||
function TableReload() {
|
||
table.reload('listReload', {
|
||
|
||
});
|
||
}
|
||
|
||
</script>
|
||
<script type="text/html" id="agentTpl">
|
||
{{# if(d.ISOUTERAGENT == '1'){ }}
|
||
是
|
||
{{# } else if(d.ISOUTERAGENT == '0') { }}
|
||
否
|
||
|
||
{{# } }}
|
||
</script>
|
||
|