|
@@ -142,6 +142,35 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ function changeSyncStatus(title,id) {
|
|
|
+ layer.open({
|
|
|
+ title: title,
|
|
|
+ maxmin: true, //开启最大化最小化按钮
|
|
|
+ content: '确认手动操作同步状态?',
|
|
|
+ skin: 'two-btns',
|
|
|
+ btn: ['确定', '取消'],
|
|
|
+ btn1: function(index, layero){
|
|
|
+ $.ajax({
|
|
|
+ type: "post",
|
|
|
+ url: "${ctx}/knowledgeSharingDetails/knowledgeSharingDetails/changeSyncStatus?id=" + id,
|
|
|
+ success: function (res) {
|
|
|
+ parent.layer.msg('操作成功', { icon: 1 });
|
|
|
+ setTimeout(function () {
|
|
|
+ layer.close(index);
|
|
|
+ document.getElementById("refreshBtn").click();
|
|
|
+ }, 200);
|
|
|
+ },
|
|
|
+ error: function () {
|
|
|
+ parent.layer.msg('操作失败', { icon: 2 });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ btn2: function (index) {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//打开对话框(查看)
|
|
|
function openDialogListView(title,url,width,height){
|
|
@@ -280,8 +309,10 @@
|
|
|
,{align:'center',title:"操作",width:150,templet:function(d){
|
|
|
////对操作进行初始化
|
|
|
var xml = "<div class=\"layui-btn-group\">";
|
|
|
- if( d.isAdmin == "1" && d.isSync == "0")
|
|
|
+ if( (d.cansync != undefined && d.cansync == "1") && d.isSync == "0")
|
|
|
xml += "<a href=\"javascript:void(0)\" onclick=\"syncToDify('同步', '"+d.id+"')\" class=\"layui-btn layui-btn-xs layui-bg-blue\"> 同步</a>";
|
|
|
+ if( (d.cansync != undefined && d.cansync == "1") && d.isSync == "0")
|
|
|
+ xml += "<a href=\"javascript:void(0)\" onclick=\"changeSyncStatus('手动同步', '"+d.id+"')\" class=\"layui-btn layui-btn-xs layui-bg-blue\"> 手动同步</a>";
|
|
|
if(d.canedit != undefined && d.canedit == "1")
|
|
|
xml += "<a href=\"javascript:void(0)\" onclick=\"openDialog('修改发帖信息', '${ctx}/knowledgeSharingDetails/knowledgeSharingDetails/form?id="+ d.id +"','95%', '95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\"> 编辑</a>";
|
|
|
if((d.candelete != undefined && d.candelete == "1") || d.isAdmin == "1")
|
|
@@ -296,23 +327,44 @@
|
|
|
<c:forEach items="${page.list}" var="knowledgeSharingInfo" varStatus="index">
|
|
|
<c:if test="${index.index != 0}">,</c:if>
|
|
|
{
|
|
|
- "index":"${index.index+1}"
|
|
|
- ,"id":"${knowledgeSharingInfo.id}"
|
|
|
- ,"columnId":"${knowledgeSharingInfo.columnId}"
|
|
|
- ,"subject":"${knowledgeSharingInfo.subject}"
|
|
|
- ,"columnName":"${fns:getMainDictLabel(knowledgeSharingInfo.columnId, 'column_name', '')}"
|
|
|
- ,"invitationCount":"${knowledgeSharingInfo.invitationCount}"
|
|
|
- ,"createBy":"${knowledgeSharingInfo.createBy.name}"
|
|
|
- ,"createDate":"<fmt:formatDate value="${knowledgeSharingInfo.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
- ,"moderator":"${knowledgeSharingInfo.moderator}"
|
|
|
- ,"lastPublish":"${knowledgeSharingInfo.lastPublish}"
|
|
|
- ,"readCount":"${knowledgeSharingInfo.readCount}"
|
|
|
- ,"replyCount":"${knowledgeSharingInfo.replyCount}"
|
|
|
- ,"isSync": "${knowledgeSharingInfo.isSync}"
|
|
|
- ,"isSyncText": "${knowledgeSharingInfo.isSync == '1' ? '<span class=\'layui-badge layui-bg-green\'>已同步</span>' : '<span class=\'layui-badge\'>未同步</span>'}"
|
|
|
- ,"isAdmin":"${knowledgeSharingInfo.isAdmin}"
|
|
|
- <shiro:hasPermission name="knowledgeSharing:knowledgeSharing:edit">,"canedit":<c:choose><c:when test="${fns:getUser().id == knowledgeSharingInfo.createBy.id}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose></shiro:hasPermission>
|
|
|
- <shiro:hasPermission name="knowledgeSharing:knowledgeSharing:del">,"candelete":<c:choose><c:when test="${fns:getUser().id == knowledgeSharingInfo.createBy.id}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose></shiro:hasPermission>
|
|
|
+ "index": "${index.index+1}"
|
|
|
+ ,
|
|
|
+ "id": "${knowledgeSharingInfo.id}"
|
|
|
+ ,
|
|
|
+ "columnId": "${knowledgeSharingInfo.columnId}"
|
|
|
+ ,
|
|
|
+ "subject": "${knowledgeSharingInfo.subject}"
|
|
|
+ ,
|
|
|
+ "columnName": "${fns:getMainDictLabel(knowledgeSharingInfo.columnId, 'column_name', '')}"
|
|
|
+ ,
|
|
|
+ "invitationCount": "${knowledgeSharingInfo.invitationCount}"
|
|
|
+ ,
|
|
|
+ "createBy": "${knowledgeSharingInfo.createBy.name}"
|
|
|
+ ,
|
|
|
+ "createDate": "<fmt:formatDate value="${knowledgeSharingInfo.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
|
|
|
+ ,
|
|
|
+ "moderator": "${knowledgeSharingInfo.moderator}"
|
|
|
+ ,
|
|
|
+ "lastPublish": "${knowledgeSharingInfo.lastPublish}"
|
|
|
+ ,
|
|
|
+ "readCount": "${knowledgeSharingInfo.readCount}"
|
|
|
+ ,
|
|
|
+ "replyCount": "${knowledgeSharingInfo.replyCount}"
|
|
|
+ ,
|
|
|
+ "isSync": "${knowledgeSharingInfo.isSync}"
|
|
|
+ ,
|
|
|
+ "isSyncText": "${knowledgeSharingInfo.isSync == '1' ? '<span class=\'layui-badge layui-bg-green\'>已同步</span>' : '<span class=\'layui-badge\'>未同步</span>'}"
|
|
|
+ ,
|
|
|
+ "isAdmin": "${knowledgeSharingInfo.isAdmin}"
|
|
|
+ <shiro:hasPermission name="knowledgeSharing:knowledgeSharing:edit">,
|
|
|
+ "canedit": <c:choose><c:when test="${fns:getUser().id == knowledgeSharingInfo.createBy.id}">"1"
|
|
|
+ </c:when><c:otherwise>"0"</c:otherwise></c:choose></shiro:hasPermission>
|
|
|
+ <shiro:hasPermission name="knowledgeSharing:knowledgeSharing:del">,
|
|
|
+ "candelete": <c:choose><c:when test="${fns:getUser().id == knowledgeSharingInfo.createBy.id}">"1"
|
|
|
+ </c:when><c:otherwise>"0"</c:otherwise></c:choose></shiro:hasPermission>
|
|
|
+ <shiro:hasPermission name="knowledgeSharing:knowledgeSharing:sync">,
|
|
|
+ "cansync": "1"</shiro:hasPermission>
|
|
|
+
|
|
|
}
|
|
|
</c:forEach>
|
|
|
</c:if>
|
|
@@ -327,7 +379,7 @@
|
|
|
</script>
|
|
|
<script>
|
|
|
resizeListWindow1();
|
|
|
- $(window).resize(function(){
|
|
|
+ $(window).resize(function () {
|
|
|
resizeListWindow1();
|
|
|
});
|
|
|
</script>
|