Эх сурвалжийг харах

Merge branch 'fix/Forum.vote_edit_execption' into 'develop'

Merge of fix/[企业社区]修复投票贴在列表中具有编辑入口的问题 to develop

See merge request o2oa/o2oa!249
蔡祥熠 5 жил өмнө
parent
commit
c852c2566b

+ 8 - 4
o2web/source/x_component_ForumPerson/$Main/default/listItem.json

@@ -160,20 +160,24 @@
         "width": "8%"
       },
       "content": {
-        "html": "<td styles='normalTdCenterNode' width='8%'>" +
-        " <span styles='documentActionNode' item='edit'></span>" +
-        " <span styles='documentActionNode' item='remove'></span>" +
+        "html": "<td styles='normalTdCenterNode' width='8%'>"+
+        " <span styles='documentActionNode' item='remove'></span>"+
+        " <span styles='documentActionNode' item='edit'></span>"+
+        " <span style='width: 20px; height: 20px; line-height: 20px; margin-top: 5px; margin-right: 5px; display: inline-block;' item='placeholder'></span>"+
         "</td>",
         "items": {
           "edit": {
             //"access": "admin",
             "title": "edit",
             "action": "edit",
-            "condition": "function( d ){ return this.isAdmin() || (d.creatorName == this.app.userName) }",
+            "condition": "function( d ){ return d.typeCategory!='投票' && this.isAdmin() || (d.creatorName == this.app.userName) }",
             "styles": "actionEditNode",
             "mouseoverStyles": "actionEditNode_over",
             "mousedownStyles": "actionEditNode_over"
           },
+          "placeholder" : {
+            "show": "function( d ){ return !(d.typeCategory!='投票' && (this.isAdmin() || (d.creatorName == this.app.userName))) }"
+          },
           "remove": {
             "title": "remove",
             "action": "remove",

+ 7 - 3
o2web/source/x_component_ForumSearch/$Main/default/listItem.json

@@ -143,20 +143,24 @@
         "width": "6%"
       },
       "content": {
-        "html": "<td styles='normalTdCenterNode' width='6%'>" +
-        " <span styles='documentActionNode' item='edit'></span>" +
+        "html": "<td styles='normalTdCenterNode' width='6%'>"+
         " <span styles='documentActionNode' item='remove'></span>" +
+        " <span styles='documentActionNode' item='edit'></span>" +
+        " <span style='width: 20px; height: 20px; line-height: 20px; margin-top: 5px; margin-right: 5px; display: inline-block;' item='placeholder'></span>"+
         "</td>",
         "items": {
           "edit": {
             //"access": "admin",
             "title": "edit",
             "action": "edit",
-            "condition": "function( d ){ return this.isAdmin() || (d.creatorName == this.app.userName) }",
+            "condition": "function( d ){ return d.typeCategory!='投票' && (this.isAdmin() || (d.creatorName == this.app.userName)) }",
             "styles": "actionEditNode",
             "mouseoverStyles": "actionEditNode_over",
             "mousedownStyles": "actionEditNode_over"
           },
+          "placeholder" : {
+            "show": "function( d ){ return !(d.typeCategory!='投票' && (this.isAdmin() || (d.creatorName == this.app.userName))) }"
+          },
           "remove": {
             "title": "remove",
             "action": "remove",

+ 5 - 1
o2web/source/x_component_ForumSection/$Main/default/listItem.json

@@ -115,6 +115,7 @@
         "html": "<td styles='normalTdCenterNode' width='10%'>" +
         " <span styles='documentActionNode' item='remove'></span>" +
         " <span styles='documentActionNode' item='edit'></span>" +
+        " <span style='width: 20px; height: 20px; line-height: 20px; margin-top: 5px; margin-right: 5px; display: inline-block;' item='placeholder'></span>" +
         "</td>",
         "items": {
           "edit": {
@@ -122,11 +123,14 @@
             "title": "edit",
             //"text": "edit",
             "action": "edit",
-            "condition": "function( d ){ return this.app.isAdmin || (d.creatorName == this.app.userName) }",
+            "condition": "function( d ){ return d.typeCategory!='投票' && (this.app.isAdmin || (d.creatorName == this.app.userName)) }",
             "styles": "actionEditNode",
             "mouseoverStyles": "actionEditNode_over",
             "mousedownStyles": "actionEditNode_over"
           },
+          "placeholder" : {
+            "show": "function( d ){ return !(d.typeCategory!='投票' && (this.app.isAdmin || (d.creatorName == this.app.userName))) }"
+          },
           "remove": {
             "title": "remove",
             //"text": "remove",

+ 9 - 5
o2web/source/x_component_ForumSection/$Main/default/listItemPrime.json

@@ -63,7 +63,7 @@
             "event" : "click^^function(node){ this.app.openPerson( this.data.creatorName ) }"
           },
           "createTime" : {
-            "value" : "function(d){ return this.app.getDateDiff( d.createTime ) }"
+            "value" : "function(d){ return MWFForum.getDateDiff( d.createTime ) }"
           }
         }
       }
@@ -100,7 +100,7 @@
           },
           "latestReplyTime2" : {
             "show": "function( d ){ return !d.latestReplyUser ? false : true }",
-            "value" : "function(d){ return this.app.getDateDiff( d.latestReplyTime ) }"
+            "value" : "function(d){ return MWFForum.getDateDiff( d.latestReplyTime ) }"
           }
         }
       }
@@ -112,9 +112,10 @@
         "width": "10%"
       },
       "content": {
-        "html": "<td styles='normalTdCenterNode' width='10%'>" +
-        " <span styles='documentActionNode' item='edit'></span>" +
+        "html": "<td styles='normalTdCenterNode' width='10%'>"+
         " <span styles='documentActionNode' item='remove'></span>" +
+        " <span styles='documentActionNode' item='edit'></span>" +
+        " <span style='width: 20px; height: 20px; line-height: 20px; margin-top: 5px; margin-right: 5px; display: inline-block;' item='placeholder'></span>" +
         "</td>",
         "items": {
           "edit": {
@@ -122,11 +123,14 @@
             "title": "edit",
             //"text": "edit",
             "action": "edit",
-            "condition": "function( d ){ return this.app.isAdmin || (d.creatorName == this.app.userName) }",
+            "condition": "function( d ){ return d.typeCategory!='投票' && (this.app.isAdmin || (d.creatorName == this.app.userName)) }",
             "styles": "actionEditNode",
             "mouseoverStyles": "actionEditNode_over",
             "mousedownStyles": "actionEditNode_over"
           },
+          "placeholder" : {
+            "show": "function( d ){ return !(d.typeCategory!='投票' && (this.app.isAdmin || (d.creatorName == this.app.userName))) }"
+          },
           "remove": {
             "title": "remove",
             //"text": "remove",