|
@@ -107,17 +107,23 @@
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /** 查看详情(带阅读记录) */
|
|
|
|
|
|
|
+ /** 查看详情(带阅读记录 + 点击量递增) */
|
|
|
function openDetailDialogWithRead(id) {
|
|
function openDetailDialogWithRead(id) {
|
|
|
- // 先记录阅读行为
|
|
|
|
|
|
|
+ // 记录阅读行为 + 递增点击量
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
type: 'POST',
|
|
|
url: '${ctx}/workKnowledgeBase/readLike/recordRead',
|
|
url: '${ctx}/workKnowledgeBase/readLike/recordRead',
|
|
|
data: { fileId: id },
|
|
data: { fileId: id },
|
|
|
success: function(result) {
|
|
success: function(result) {
|
|
|
|
|
+ // 递增点击量(与阅读记录并行,不影响主流程)
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ type: 'POST',
|
|
|
|
|
+ url: '${ctx}/workKnowledgeBase/readLike/incrementClick',
|
|
|
|
|
+ data: { fileId: id }
|
|
|
|
|
+ });
|
|
|
// 无论是否首次阅读,都打开详情弹窗
|
|
// 无论是否首次阅读,都打开详情弹窗
|
|
|
openDetailDialog(id);
|
|
openDetailDialog(id);
|
|
|
- // 刷新列表,更新阅读量
|
|
|
|
|
|
|
+ // 刷新列表,更新阅读量和点击量
|
|
|
setTimeout(function() {
|
|
setTimeout(function() {
|
|
|
search();
|
|
search();
|
|
|
}, 500);
|
|
}, 500);
|
|
@@ -187,17 +193,23 @@
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /** 预览文件(带阅读记录) */
|
|
|
|
|
|
|
+ /** 预览文件(带阅读记录 + 点击量递增) */
|
|
|
function openPreviewWithRead(url, type, fileId) {
|
|
function openPreviewWithRead(url, type, fileId) {
|
|
|
- // 先记录阅读行为
|
|
|
|
|
|
|
+ // 记录阅读行为 + 递增点击量
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
type: 'POST',
|
|
|
url: '${ctx}/workKnowledgeBase/readLike/recordRead',
|
|
url: '${ctx}/workKnowledgeBase/readLike/recordRead',
|
|
|
data: { fileId: fileId },
|
|
data: { fileId: fileId },
|
|
|
success: function(result) {
|
|
success: function(result) {
|
|
|
|
|
+ // 递增点击量(与阅读记录并行,不影响主流程)
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ type: 'POST',
|
|
|
|
|
+ url: '${ctx}/workKnowledgeBase/readLike/incrementClick',
|
|
|
|
|
+ data: { fileId: fileId }
|
|
|
|
|
+ });
|
|
|
// 调用原有的预览方法
|
|
// 调用原有的预览方法
|
|
|
openPreview(url, type);
|
|
openPreview(url, type);
|
|
|
- // 刷新列表,更新阅读量
|
|
|
|
|
|
|
+ // 刷新列表,更新阅读量和点击量
|
|
|
setTimeout(function() {
|
|
setTimeout(function() {
|
|
|
search();
|
|
search();
|
|
|
}, 500);
|
|
}, 500);
|
|
@@ -668,13 +680,13 @@
|
|
|
<shiro:hasPermission name="workKnowledgeBase:share:export">
|
|
<shiro:hasPermission name="workKnowledgeBase:share:export">
|
|
|
<button class="layui-btn layui-btn-sm layui-bg-yellow"
|
|
<button class="layui-btn layui-btn-sm layui-bg-yellow"
|
|
|
onclick="exportAllTabs()">
|
|
onclick="exportAllTabs()">
|
|
|
- <i class="glyphicon glyphicon-export"></i> 导出
|
|
|
|
|
|
|
+ 导出详细列表
|
|
|
</button>
|
|
</button>
|
|
|
</shiro:hasPermission>
|
|
</shiro:hasPermission>
|
|
|
<shiro:hasPermission name="workKnowledgeBase:point:listAll">
|
|
<shiro:hasPermission name="workKnowledgeBase:point:listAll">
|
|
|
- <button class="layui-btn layui-btn-sm layui-bg-cyan"
|
|
|
|
|
|
|
+ <button class="layui-btn layui-btn-sm layui-bg-orange"
|
|
|
onclick="exportPointStats()">
|
|
onclick="exportPointStats()">
|
|
|
- <i class="glyphicon glyphicon-export"></i> 积分统计导出
|
|
|
|
|
|
|
+ 导出积分统计
|
|
|
</button>
|
|
</button>
|
|
|
</shiro:hasPermission>
|
|
</shiro:hasPermission>
|
|
|
</c:if>
|
|
</c:if>
|
|
@@ -754,7 +766,10 @@
|
|
|
}},
|
|
}},
|
|
|
{field: 'createByName', align: 'center', title: '创建人', width: 100},
|
|
{field: 'createByName', align: 'center', title: '创建人', width: 100},
|
|
|
{field: 'createTime', align: 'center', title: '创建时间', width: 160},
|
|
{field: 'createTime', align: 'center', title: '创建时间', width: 160},
|
|
|
- //添加点击量,点击后展示的数据和原先阅读量展示的详情一致,此处点击量即点击查看一下,就记录一下
|
|
|
|
|
|
|
+ // 点击量(仅展示,通过点击文件名称/文件地址触发递增)
|
|
|
|
|
+ {field: 'clickCount', align: 'center', title: '点击量', width: 100, templet: function(d){
|
|
|
|
|
+ return '<span style="color:#009688;">' + (d.clickCount || 0) + '</span>';
|
|
|
|
|
+ }},
|
|
|
{field: 'readCount', align: 'center', title: '阅读量', width: 100, templet: function(d){
|
|
{field: 'readCount', align: 'center', title: '阅读量', width: 100, templet: function(d){
|
|
|
return '<a href="javascript:void(0)" onclick="showReadDetail(\'' + d.id + '\')" style="color:#1e9fff;cursor:pointer;">' + (d.readCount || 0) + '</a>';
|
|
return '<a href="javascript:void(0)" onclick="showReadDetail(\'' + d.id + '\')" style="color:#1e9fff;cursor:pointer;">' + (d.readCount || 0) + '</a>';
|
|
|
}},
|
|
}},
|
|
@@ -896,6 +911,7 @@
|
|
|
,"treeNodeId": "${row.treeNodeId}"
|
|
,"treeNodeId": "${row.treeNodeId}"
|
|
|
,"treeName": "<c:out value='${row.treeName}'/>"
|
|
,"treeName": "<c:out value='${row.treeName}'/>"
|
|
|
,"isQaCategory": ${row.isQaCategory == true ? 'true' : 'false'}
|
|
,"isQaCategory": ${row.isQaCategory == true ? 'true' : 'false'}
|
|
|
|
|
+ ,"clickCount": ${row.clickCount != null ? row.clickCount : 0}
|
|
|
,"readCount": ${row.readCount != null ? row.readCount : 0}
|
|
,"readCount": ${row.readCount != null ? row.readCount : 0}
|
|
|
,"likeCount": ${row.likeCount != null ? row.likeCount : 0}
|
|
,"likeCount": ${row.likeCount != null ? row.likeCount : 0}
|
|
|
,"liked": ${row.liked == true ? 'true' : 'false'}
|
|
,"liked": ${row.liked == true ? 'true' : 'false'}
|