262 lines
14 KiB
Plaintext
262 lines
14 KiB
Plaintext
@using WX.CRM.WebHelper;
|
|
@using WX.CRM.Model.Entity;
|
|
@{
|
|
ViewBag.Title = "聊天记录";
|
|
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
|
|
}
|
|
<script src="~/Scripts/op/tablegrid.sort.js"></script>
|
|
<script src="~/Scripts/op/jquery.highlight.js"></script>
|
|
<style>
|
|
.highlight {background-color: #ffff88; }
|
|
</style>
|
|
<div class="mvctool">
|
|
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
|
|
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
|
|
</div>
|
|
<div class="bas_datagrid">
|
|
<div id="tb" style="padding:5px;height:auto" class="grid_toolbar">
|
|
<ul class="toolBar_ul">
|
|
<li>
|
|
月份:<select id="slt_month" name="slt_month" style="width:120px;height:22px">
|
|
@foreach (var item in ViewBag.monthList as List<SelectListItem>)
|
|
{
|
|
<option value="@item.Value">@item.Text</option>
|
|
}
|
|
|
|
</select>
|
|
</li>
|
|
<li>时间:@Html.WdatePickerText("txt_stime", string.Format("{0:yyyy-MM-dd}", DateTime.Now))-@Html.WdatePickerText("txt_etime", string.Format("{0:yyyy-MM-dd}", DateTime.Now))</li>
|
|
<li>关键字:<input type="text" name="txt_keyword" style="width:150px" /></li>
|
|
<li>客户微信名:<input type="text" name="txt_customerUserName" style="width:150px" /></li>
|
|
<li>客户微信号:<input type="text" name="txt_alias" style="width:150px" /></li>
|
|
<li>@Html.Action("UserComBoxByRole", "Control", new { onLoadSucced = "onLoadSucced()", controlName = "nb1", roleCodes = ViewBag.roleCodes, saledeptid = "", salegroupid = ViewBag.userGroupId, iseid = "0", inneruserid = "", currentRight = WX.CRM.WebHelper.InitRights.CONST_微信聊天合规管理 })</li>
|
|
|
|
</ul>
|
|
</div>
|
|
@Html.Raw(ViewBag.gridTable)
|
|
</div>
|
|
|
|
<div id="recordPlayerWin"></div>
|
|
<input type="hidden" name="msgcontent" id="msgcontent" value="" />
|
|
<script type="text/JavaScript" language="javascript">
|
|
var face = [{ name: "[微笑]", imgpath: "0.png" }, { name: "[撇嘴]", imgpath: "1.png" }, { name: "[色]", imgpath: "2.png" }, { name: "[发呆]", imgpath: "3.png" },
|
|
{ name: "[得意]", imgpath: "4.png" }, { name: "[流泪]", imgpath: "5.png" }, { name: "[害羞]", imgpath: "6.png" }, { name: "[闭嘴]", imgpath: "7.png" }, { name: "[睡]", imgpath: "8.png" },
|
|
{ name: "[大哭]", imgpath: "9.png" }, { name: "[尴尬]", imgpath: "10.png" }, { name: "[发怒]", imgpath: "11.png" }, { name: "[调皮]", imgpath: "12.png" },
|
|
{ name: "[呲牙]", imgpath: "13.png" }, { name: "[惊讶]", imgpath: "14.png" }, { name: "[难过]", imgpath: "15.png" }, { name: "[酷]", imgpath: "16.png" },
|
|
{ name: "[囧]", imgpath: "17.png" }, { name: "[抓狂]", imgpath: "18.png" }, { name: "[吐]", imgpath: "19.png" }, { name: "[偷笑]", imgpath: "20.png" },
|
|
{ name: "[愉快]", imgpath: "21.png" }, { name: "[白眼]", imgpath: "22.png" }, { name: "[傲慢]", imgpath: "23.png" },
|
|
{ name: "[饿]", imgpath: "24.png" }, { name: "[困]", imgpath: "25.png" }, { name: "[惊恐]", imgpath: "26.png" },
|
|
{ name: "[流汗]", imgpath: "27.png" }, { name: "[憨笑]", imgpath: "28.png" }, { name: "[悠闲]", imgpath: "29.png" }, { name: "[奋斗]", imgpath: "30.png" },
|
|
{ name: "[咒骂]", imgpath: "31.png" }, { name: "[疑问]", imgpath: "32.png" }, { name: "[嘘]", imgpath: "33.png" }, { name: "[晕]", imgpath: "34.png" },
|
|
{ name: "[疯]", imgpath: "35.png" }, { name: "[衰]", imgpath: "36.png" }, { name: "[骷髅]", imgpath: "37.png" },
|
|
{ name: "[敲打]", imgpath: "38.png" }, { name: "[再见]", imgpath: "39.png" }, { name: "[擦汗]", imgpath: "40.png" },
|
|
{ name: "[抠鼻]", imgpath: "41.png" }, { name: "[鼓掌]", imgpath: "42.png" }, { name: "[糟糕]", imgpath: "43.png" },
|
|
{ name: "[坏笑]", imgpath: "44.png" }, { name: "[左哼哼]", imgpath: "45.png" },
|
|
{ name: "[右哼哼]", imgpath: "46.png" }, { name: "[哈欠]", imgpath: "47.png" },
|
|
{ name: "[鄙视]", imgpath: "48.png" }, { name: "[委屈]", imgpath: "49.png" },
|
|
{ name: "[快哭了]", imgpath: "50.png" }, { name: "[阴险]", imgpath: "51.png" },
|
|
{ name: "[亲亲]", imgpath: "52.png" }, { name: "[吓]", imgpath: "53.png" },
|
|
{ name: "[可怜]", imgpath: "54.png" }, { name: "[菜刀]", imgpath: "55.png" },
|
|
{ name: "[西瓜]", imgpath: "56.png" }, { name: "[啤酒]", imgpath: "57.png" },
|
|
{ name: "[篮球]", imgpath: "58.png" }, { name: "[乒乓]", imgpath: "59.png" },
|
|
{ name: "[咖啡]", imgpath: "60.png" }, { name: "[美食]", imgpath: "61.png" },
|
|
{ name: "[猪头]", imgpath: "62.png" }, { name: "[玫瑰]", imgpath: "63.png" },
|
|
{ name: "[凋谢]", imgpath: "64.png" }, { name: "[嘴唇]", imgpath: "65.png" },
|
|
{ name: "[爱心]", imgpath: "66.png" }, { name: "[心碎]", imgpath: "67.png" },
|
|
{ name: "[蛋糕]", imgpath: "68.png" }, { name: "[电]", imgpath: "69.png" }, { name: "[炸弹]", imgpath: "70.gif" }, { name: "[便便]", imgpath: "71.gif" },
|
|
{ name: "[月亮]", imgpath: "72.gif" }, { name: "[太阳]", imgpath: "73.gif" }, { name: "[拥抱]", imgpath: "74.png" }, { name: "[强]", imgpath: "75.gif" }, { name: "[弱]", imgpath: "76.gif" },
|
|
{ name: "[握手]", imgpath: "77.gif" }, { name: "[胜利]", imgpath: "78.gif" }, { name: "[抱拳]", imgpath: "79.gif" }, { name: "[勾引]", imgpath: "80.gif" },
|
|
{ name: "[拳头]", imgpath: "81.gif" }, { name: "[OK]", imgpath: "82.gif" }, { name: "[跳跳]", imgpath: "83.gif" }, { name: "[发抖]", imgpath: "84.gif" },
|
|
{ name: "[怄火]", imgpath: "85.png" }, { name: "[转圈]", imgpath: "86.gif" }
|
|
];
|
|
//替换表情
|
|
function replaceFace(cotent) {
|
|
var txt = cotent;
|
|
$(face).each(function (i, n) {
|
|
while (txt.indexOf(n.name) > -1) {
|
|
txt = txt.replace(n.name, "<img src=\"/Face/" + n.imgpath + "\">");
|
|
}
|
|
});
|
|
return txt;
|
|
}
|
|
</script>
|
|
<script type="text/javascript">
|
|
var keywords = "@ViewBag.keyword";
|
|
var keywordArray = keywords.split(';');
|
|
|
|
$(function () {
|
|
loadtablegrid();
|
|
|
|
$(window).resize(function () {//自动适应大小
|
|
$('#tablist').tablegrid('resize', {
|
|
height: $(window).height() - 110
|
|
});
|
|
});
|
|
|
|
$("#btnQuery").click(function () {
|
|
$('#tablist').tablegrid("Search");
|
|
});
|
|
});
|
|
function frameReturnByClose() {
|
|
$("#modalwindow").window('close');
|
|
}
|
|
function frameReturnByReload(flag) {
|
|
$("#tablist").tablegrid("Load");
|
|
}
|
|
function frameReturnByMes(mes) {
|
|
$.messageBox5s('提示', mes);
|
|
}
|
|
|
|
function loadtablegrid() {
|
|
$('#tablist').tablegrid({
|
|
url: '/WeiXin/Message/GetHtmlList',
|
|
height: $(window).height() - 110,
|
|
loadNow: false,
|
|
data: GetControlValue,
|
|
onLoadSuccess: function (data) {
|
|
//alert(data.rowsList);
|
|
|
|
},
|
|
onLoadError: function () {
|
|
$.messager.alert("警告", "信息加载失败!", "error");
|
|
}
|
|
});
|
|
}
|
|
|
|
function onLoadSucced() {
|
|
$('#tablist').tablegrid("Search");
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
@*ToolBar事件处理*@
|
|
<script type="text/javascript">
|
|
function GetIframeHtml(src) {
|
|
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
|
|
}
|
|
|
|
//获取datagrid头部及字段
|
|
function getDataGridHeader() {
|
|
var columns = $('#tablist').tablegrid("getAllHead");
|
|
return columns;
|
|
}
|
|
|
|
|
|
|
|
|
|
function GetControlValue() {
|
|
return { saleDeptId: $("#nb1_uc_org_depts").val(), groupId: $("#nb1_uc_org_groups").val(), userId: $("#nb1_uc_org_ids").val(), dayType: $("#txt_Daytype").val() };
|
|
}
|
|
|
|
|
|
function ShowMesageDetial(username, jobusername) {
|
|
$("#modalwindow").html(GetIframeHtml("/WeiXin/WorkAccount/MessageDetial?username=" + username + "&workusername=" + jobusername + "&guid=" + GetGuid()));
|
|
$("#modalwindow").window({ title: '聊天记录', width: 800, height: 600, iconCls: 'icon-add' }).window('open');
|
|
}
|
|
|
|
@*function Update_Click() {
|
|
var row = $('#tablist').tablegrid('getSelected');
|
|
if (row != null) {
|
|
$.messager.confirm('提示', '你确定要标记为违规信息吗?', function (r) {
|
|
if (r) {
|
|
$.r_post("/WeiXin/Message/UpdateIsillegal?msgsvrid=" + row.msgsvrid + "&username=" + row.username + "&msgcontent=" + row.msgcontent + "&month=" + $('#slt_month').val() + "&msgtype=" + row.msgtype + "&talker=" + row.talker + "&msgurl=" + row.msgurl, function (data) {
|
|
if (data.type == 1) {
|
|
$("#tablist").tablegrid('Load');
|
|
$.messageBox5s('提示', '更新信息成功');
|
|
} else {
|
|
$.messageBox5s('错误', data.message);
|
|
}
|
|
}, "json");
|
|
}
|
|
});
|
|
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
|
}*@
|
|
|
|
function Update_Click() {
|
|
var row = $('#tablist').tablegrid('getSelected');
|
|
if (row != null) {
|
|
$("#msgcontent").val(row.msgcontent);
|
|
$("#modalwindow").html(GetIframeHtml("/WeiXin/Message/MessageCompliance?msgsvrid=" + row.msgsvrid + "&username=" + row.username + "&month=" + $('#slt_month').val() + "&msgtype=" + row.msgtype + "&talker=" + row.talker + "&msgurl=" + row.msgurl + "&createtime="+row.createtime+"&Ieguid=" + GetGuid()));
|
|
$("#modalwindow").window({ title: '标记违规信息', width: 700, height: 500, iconCls: 'icon-edit' }).window('open');
|
|
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
|
}
|
|
|
|
function getMsgContent() {
|
|
return $("#msgcontent").val();
|
|
}
|
|
|
|
function GetImage(msgSvrId,type) {
|
|
$.ajax({
|
|
url: GetTrueUlr("@Html.Raw(System.Configuration.ConfigurationManager.AppSettings["WeiXinFilePath"])") + msgSvrId + "?i=" + GetGuid(),
|
|
type: "GET",
|
|
dataType: "json",
|
|
loading: true,
|
|
success: function (data) {
|
|
if (data.retmsg != null) {
|
|
var index = data.retmsg.indexOf("_");
|
|
var msgsId = data.retmsg.substring(0, index);
|
|
var path = GetTrueUlr(data.retmsg.substring(index + 1, data.retmsg.length));
|
|
if (type != 34) {
|
|
$("#file_" + msgsId).attr("src", path);
|
|
$("#file_" + msgsId).attr("href", path);
|
|
$("#file_" + msgsId).attr("target", "_blank");
|
|
} else {
|
|
$("#file_" + msgsId).attr("href", "javascript:void(0);").attr("onclick", "PalyRecord('" + path + "');");
|
|
}
|
|
}
|
|
}, error: function () {
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
function keyHighLight(msgSvrId) {
|
|
var body = $("#txt_" + msgSvrId);
|
|
//alert($("#txt_" + msgSvrId).val());
|
|
//body.html(replaceFace(body.val()));
|
|
body.highlight(keywordArray);
|
|
}
|
|
|
|
function Keyword_Click() {
|
|
$("#modalwindow").html(GetIframeHtml("/WeiXin/Message/Keyword?guid=" + GetGuid()));
|
|
$("#modalwindow").window({ title: '合规关键字', width: 800, height: 600, iconCls: 'icon-add' }).window('open');
|
|
}
|
|
|
|
function PalyRecord(url) {
|
|
$.post("/Weixin/WorkAccount/Audio", { url: url }, function (result) {
|
|
if (result.result === "ok") {
|
|
var data = result.data;
|
|
$('#recordPlayerWin').window({ title: '播放录音', width: 330, height: 180, iconCls: 'icon-add', shadow: true, modal: true, closed: true, minimizable: false, maximizable: false, collapsible: false }).window('open');
|
|
var isChrome = window.navigator.userAgent.indexOf("Chrome") !== -1;
|
|
if (isChrome) {
|
|
$('#recordPlayerWin').html("<video controls=\"\" src=\"" + data + "\" style=\"width:300px; height:50px;\" autoplay=\"autoplay\" />");
|
|
} else {
|
|
$('#recordPlayerWin').html('<object id="Player" width="300" height="50" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"hspace="5"><param name="AutoRewind" value="1"><param name="FileName" value="' + data + '"><param name="ShowControls" value="1"><param name="ShowPositionControls" value="0"><param name="ShowAudioControls" value="1"><param name="ShowTracker" value="1"><param name="ShowDisplay" value="0"><param name="ShowStatusBar" value="0"><param name="ShowGotoBar" value="0"><param name="ShowCaptioning" value="0"><param name="AutoStart" value="1"><param name="Volume" value="5000"><param name="AnimationAtStart" value="0"><param name="TransparentAtStart" value="0"><param name="AllowChangeDisplaySize" value="0"><param name="AllowScan" value="0"><param name="EnableContextMenu" value="0"><param name="ClickToPlay" value="1"> </object>');
|
|
}
|
|
} else {
|
|
alert("转换失败,请稍后重试!");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
<script>
|
|
function GetTrueUlr(purl) {
|
|
if (purl == null)
|
|
return purl;
|
|
var realhost = window.location.host;//当前域名
|
|
if (purl.indexOf(realhost) > -1) {//如果包含真的域名则直接返回
|
|
return purl;
|
|
} else {//不等于真实域名
|
|
purl = purl.replace("http://", "");
|
|
if (purl.indexOf(":") > -1)
|
|
purl = "http://" + realhost.substring(0, realhost.indexOf(":")) + purl.substring(purl.indexOf(":"));
|
|
else
|
|
purl = "http://" + realhost.substring(0, realhost.indexOf(":")) + purl.substring(purl.indexOf("/"));
|
|
return purl;
|
|
}
|
|
}
|
|
</script> |