Mini.Crm/Mini.Web/Areas/Admin/Views/WorkWeChat/Index.cshtml

216 lines
9.3 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@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;">
@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="微信红包" },
} })
</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" style="width:200px;">
<input type="text" name="name" required lay-verify="required" placeholder="微信号/昵称/微信用户名" 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?weixincrmaccount=@Html.Raw(ViewBag.weixincrmaccount)'
, method: 'POST'
, cellMinWidth: 80 //全局定义常规单元格的最小宽度layui 2.2.1 新增
, page: true
, limit: 30
, height: "full-160"
, size: "sm"
, autoSort: false //禁用前端自动排序。注意:该参数为 layui 2.4.4 新增
, cols: [[
{ field: 'numbers', type: 'numbers' }
, { field: 'username', title: '微信用户名' }
, { field: 'alias', title: '微信号' }
, { field: 'nickname', title: '昵称' }
, { field: 'version', title: '版本号', sort: true }
, {
field: 'status', title: 'App状态', sort: true, templet: function (d) {
if (d.status == '在线')
return '<span style="color:#00C63C;">在线</span>';
else if (d.status = '离线')
return '<span style="color:#AAAAAA;">离线</span>';
else
return '';
}
}
, { field: 'lasttimestr', title: '心跳时间', sort: true }
, { field: 'lastmsgtimestr', title: '数据反馈时间', sort: true }
, { field: 'lastfriendtimestr', title: '好友反馈时间', sort: true }
]], where: $("#myform").serializeFormJSON()
});
//监听排序事件
table.on('sort(wochao)', function (obj) { //注sort 是工具条事件名test 是 table 原始容器的属性 lay-filter="对应的值"
table.reload('listReload', {
initSort: obj //记录初始排序,如果不设的话,将无法标记表头的排序状态。
, where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
sort: obj.field //排序字段
, order: obj.type //排序方式
}
});
//layer.msg('服务端排序。order by ' + obj.field + ' ' + obj.type);
});
//监听行单击事件单击事件为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 = {
other3: function () {
if (selectRow.username == "undefined" || selectRow.username == null) {
//layer.alert("请先选中一条记录!", { title: '提示' });
layer.msg("请先选中一条记录!", { icon: 7 });
return;
}
window.parent.ChildAddTab('微信红包--' + selectRow.nickname, '/Admin/WorkWeChat/HongBao?weixincrmaccount=@Html.Raw(ViewBag.weixincrmaccount)&workusername=' + selectRow.username, "icon-detail");
}, other1: function () {
if (selectRow.username == "undefined" || selectRow.username == 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.nickname, '/Admin/WorkWeChat/MyMessage?weixincrmaccount=@Html.Raw(ViewBag.weixincrmaccount)&workusername=' + selectRow.username, "icon-detail");
}, other2: function () {
var username = "";
if (selectRow.username != "undefined" && selectRow.username != null) {
username = selectRow.username
window.parent.ChildAddTab('微信好友--' + selectRow.nickname, '/Admin/WorkWeChat/WorRcontact?weixincrmaccount=@Html.Raw(ViewBag.weixincrmaccount)&jobWxUserName=' + username, "icon-detail");
} else {
window.parent.ChildAddTab('微信好友--查找', '/Admin/WorkWeChat/WorRcontact', "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', {
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>