优化私聊查询

This commit is contained in:
liaozetao
2024-01-04 19:01:55 +08:00
parent 7f15427638
commit 56df854368

View File

@@ -107,23 +107,6 @@ export default {
{ field: 'fromNick', title: '搜索人昵称', align: 'center', width: '5%' },
{ field: 'toErBanNo', title: '聊天对象ID', align: 'center', width: '5%' },
{ field: 'toNick', title: '聊天对象昵称', align: 'center', width: '5%' },
{ field: 'firstTouchTime', title: '首次接触时间', align: 'center', width: '5%' },
{
field: 'isInitiative',
title: '首次接触情况',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
var value = '';
if (val == 0) {
value = '被动回复';
} else if (val == 1) {
value = '主动发起';
}
return value;
}
},
{ field: 'chatMsgNum', title: '聊天条目数', align: 'center', width: '5%' },
{
field: 'handle',
title: '查看详情',
@@ -204,11 +187,32 @@ export default {
const toErBanNo = currentData.toErBanNo;
const toNick = currentData.toNick;
$("#detailModal").modal('show');
$('#modalLabel').html(fromNick + '(' + fromErBanNo + ')与' + toNick + '(' + toErBanNo + ')的聊天记录');
var fromUid = currentData.fromUid;
var toUid = currentData.toUid;
$('#fromUid').val(fromUid);
$('#toUid').val(toUid);
$('#modalLabel').html(fromNick + '(' + fromErBanNo + ')与' + toNick + '(' + toErBanNo + ')的聊天记录 首次接触时间: 首次接触情况: 聊天条目数0');
$.ajax({
type: "get",
url: "/admin/userChatMsgRecord/getDetail",
dataType: "json",
data: {
fromUid: fromUid,
toUid: toUid,
startTime: $('#startTime').val(),
endTime: $('#endTime').val(),
},
success: function (json) {
apiResult(json);
let data = json.data;
if (data) {
let firstTouchTime = data.firstTouchTime;
let isInitiative = data.isInitiative;
let chatMsgNum = data.chatMsgNum;
$('#modalLabel').html(fromNick + '(' + fromErBanNo + ')与' + toNick + '(' + toErBanNo + ')的聊天记录 首次接触时间:' + firstTouchTime + ' 首次接触情况:' + (isInitiative ? '被动回复' : '主动发起') + ' 聊天条目数:' + chatMsgNum);
}
}
});
$('#detailTable').bootstrapTable('destroy');
$('#detailTable').bootstrapTable({
columns: [