diff --git a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ApplicationServer.java b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ApplicationServer.java index 4b33062908543abc63f8b8215faefbc6a9153ac2..127087033f1af1bfce92841ca8481e15e42459e9 100644 --- a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ApplicationServer.java +++ b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ApplicationServer.java @@ -25,6 +25,7 @@ public class ApplicationServer extends ConfigObject { private static final Integer DEFAULT_MAXTHREAD = 500; private static final Boolean DEFAULT_REQUESTLOGENABLE = false; private static final String DEFAULT_REQUESTLOGFORMAT = ""; + private static final Integer DEFAULT_REQUESTLOGRETAINDAYS = 7; public ApplicationServer() { this.enable = true; @@ -44,9 +45,9 @@ public class ApplicationServer extends ConfigObject { this.exposeJest = DEFAULT_EXPOSEJEST; this.persistentConnectionsEnable = DEFAULT_PERSISTENTCONNECTIONSENABLE; this.maxThread = DEFAULT_MAXTHREAD; - this.maxThread = DEFAULT_MAXTHREAD; this.requestLogEnable = DEFAULT_REQUESTLOGENABLE; this.requestLogFormat = DEFAULT_REQUESTLOGFORMAT; + this.requestLogRetainDays = DEFAULT_REQUESTLOGRETAINDAYS; } @FieldDescribe("是否启用") @@ -85,6 +86,8 @@ public class ApplicationServer extends ConfigObject { private Boolean requestLogEnable; @FieldDescribe("访问日志记录格式.") private String requestLogFormat; + @FieldDescribe("访问日志记录天数,默认7天.") + private Integer requestLogRetainDays; @FieldDescribe("是否启用长连接,默认true.") private Boolean persistentConnectionsEnable; @@ -265,4 +268,9 @@ public class ApplicationServer extends ConfigObject { return StringUtils.isEmpty(this.requestLogFormat) ? "" : this.requestLogFormat; } + public Integer getRequestLogRetainDays() { + return (null == this.requestLogRetainDays || this.requestLogRetainDays < 1) ? DEFAULT_REQUESTLOGRETAINDAYS + : this.requestLogRetainDays; + } + } diff --git a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/CenterServer.java b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/CenterServer.java index 7c3b5da71c3b18cc1c7bf8ea511cffe53b676935..44ef027d025cf2ba682e575f768c91459eb47b06 100644 --- a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/CenterServer.java +++ b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/CenterServer.java @@ -13,6 +13,8 @@ import com.x.base.core.project.tools.DefaultCharset; public class CenterServer extends ConfigObject { + private static final long serialVersionUID = 8147826320846595611L; + private static final Boolean DEFAULT_ENABLE = true; private static final Integer DEFAULT_PORT = 20030; private static final Integer DEFAULT_SCANINTERVAL = 0; @@ -25,6 +27,7 @@ public class CenterServer extends ConfigObject { private static final Boolean DEFAULT_PERSISTENTCONNECTIONSENABLE = true; private static final Boolean DEFAULT_REQUESTLOGENABLE = false; private static final String DEFAULT_REQUESTLOGFORMAT = ""; + private static final Integer DEFAULT_REQUESTLOGRETAINDAYS = 7; public static CenterServer defaultInstance() { return new CenterServer(); @@ -48,6 +51,7 @@ public class CenterServer extends ConfigObject { this.persistentConnectionsEnable = DEFAULT_PERSISTENTCONNECTIONSENABLE; this.requestLogEnable = DEFAULT_REQUESTLOGENABLE; this.requestLogFormat = DEFAULT_REQUESTLOGFORMAT; + this.requestLogRetainDays = DEFAULT_REQUESTLOGRETAINDAYS; } @FieldDescribe("是否启用") @@ -84,6 +88,8 @@ public class CenterServer extends ConfigObject { private Boolean requestLogEnable; @FieldDescribe("访问日志记录格式.") private String requestLogFormat; + @FieldDescribe("访问日志记录天数,默认7天.") + private Integer requestLogRetainDays; @FieldDescribe("是否启用长连接,默认false.") private Boolean persistentConnectionsEnable; @@ -210,4 +216,9 @@ public class CenterServer extends ConfigObject { return StringUtils.isEmpty(this.requestLogFormat) ? "" : this.requestLogFormat; } + public Integer getRequestLogRetainDays() { + return (null == this.requestLogRetainDays || this.requestLogRetainDays < 1) ? DEFAULT_REQUESTLOGRETAINDAYS + : this.requestLogRetainDays; + } + } diff --git a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/WebServer.java b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/WebServer.java index 03deb4df6f37cb798f929df0215b3b7d01c8d847..158a7211b5ae47421b543722c781153ae0fcc3c9 100644 --- a/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/WebServer.java +++ b/o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/WebServer.java @@ -27,6 +27,7 @@ public class WebServer extends ConfigObject { this.persistentConnectionsEnable = DEFAULT_PERSISTENTCONNECTIONSENABLE; this.requestLogEnable = DEFAULT_REQUESTLOGENABLE; this.requestLogFormat = DEFAULT_REQUESTLOGFORMAT; + this.requestLogRetainDays = DEFAULT_REQUESTLOGRETAINDAYS; } private static final Integer DEFAULT_HTTP_PORT = 80; @@ -42,6 +43,7 @@ public class WebServer extends ConfigObject { private static final Boolean DEFAULT_REQUESTLOGENABLE = false; private static final String DEFAULT_REQUESTLOGFORMAT = ""; private static final Integer DEFAULT_PROXY_TIMEOUT = 300; + private static final Integer DEFAULT_REQUESTLOGRETAINDAYS = 7; @FieldDescribe("是否启用") private Boolean enable; @@ -80,6 +82,8 @@ public class WebServer extends ConfigObject { private Boolean requestLogEnable; @FieldDescribe("访问日志记录格式.") private String requestLogFormat; + @FieldDescribe("访问日志记录天数,默认7天.") + private Integer requestLogRetainDays; public Boolean getPersistentConnectionsEnable() { return persistentConnectionsEnable == null ? DEFAULT_PERSISTENTCONNECTIONSENABLE @@ -193,6 +197,7 @@ public class WebServer extends ConfigObject { return StringUtils.isEmpty(this.requestLogFormat) ? "" : this.requestLogFormat; } + public Integer getProxyTimeOut() { return proxyTimeOut == null ? DEFAULT_PROXY_TIMEOUT : this.proxyTimeOut; } @@ -200,4 +205,11 @@ public class WebServer extends ConfigObject { public void setProxyTimeOut(Integer proxyTimeOut) { this.proxyTimeOut = proxyTimeOut; } + + public Integer getRequestLogRetainDays() { + return (null == this.requestLogRetainDays || this.requestLogRetainDays < 1) ? DEFAULT_REQUESTLOGRETAINDAYS + : this.requestLogRetainDays; + } + + } diff --git a/o2server/x_console/src/main/java/com/x/server/console/server/application/ApplicationServerTools.java b/o2server/x_console/src/main/java/com/x/server/console/server/application/ApplicationServerTools.java index c77f86c0287f5fc2d6248725166947741b1126e6..32552897a065c3a82ffcce36a759079902b70391 100644 --- a/o2server/x_console/src/main/java/com/x/server/console/server/application/ApplicationServerTools.java +++ b/o2server/x_console/src/main/java/com/x/server/console/server/application/ApplicationServerTools.java @@ -163,6 +163,7 @@ public class ApplicationServerTools extends JettySeverTools { AsyncRequestLogWriter asyncRequestLogWriter = new AsyncRequestLogWriter(); asyncRequestLogWriter.setFilenameDateFormat("yyyy_MM_dd"); asyncRequestLogWriter.setAppend(true); + asyncRequestLogWriter.setRetainDays(applicationServer.getRequestLogRetainDays()); asyncRequestLogWriter.setFilename(Config.dir_logs().toString() + File.separator + "yyyy_MM_dd." + Config.node() + ".application.request.log"); String format = "%{client}a - %u %{yyyy-MM-dd HH:mm:ss.SSS ZZZ|" + DateFormatUtils.format(new Date(), "z") diff --git a/o2server/x_console/src/main/java/com/x/server/console/server/center/CenterServerTools.java b/o2server/x_console/src/main/java/com/x/server/console/server/center/CenterServerTools.java index cd5ce263dc4ac31264c000eaa6ccc4882b167435..a397cd6a85bd057282d872ecf89f507f7737d72c 100644 --- a/o2server/x_console/src/main/java/com/x/server/console/server/center/CenterServerTools.java +++ b/o2server/x_console/src/main/java/com/x/server/console/server/center/CenterServerTools.java @@ -125,6 +125,7 @@ public class CenterServerTools extends JettySeverTools { AsyncRequestLogWriter asyncRequestLogWriter = new AsyncRequestLogWriter(); asyncRequestLogWriter.setFilenameDateFormat("yyyy_MM_dd"); asyncRequestLogWriter.setAppend(true); + asyncRequestLogWriter.setRetainDays(centerServer.getRequestLogRetainDays()); asyncRequestLogWriter.setFilename( Config.dir_logs().toString() + File.separator + "yyyy_MM_dd." + Config.node() + ".center.request.log"); String format = "%{client}a - %u %{yyyy-MM-dd HH:mm:ss.SSS ZZZ|" + DateFormatUtils.format(new Date(), "z") diff --git a/o2server/x_console/src/main/java/com/x/server/console/server/web/WebServerTools.java b/o2server/x_console/src/main/java/com/x/server/console/server/web/WebServerTools.java index 025d7385edcf5ef4e8d1620ffb4285e477e257d0..da5a01f4ad16d08ebdeb7df9523099db0531d0aa 100644 --- a/o2server/x_console/src/main/java/com/x/server/console/server/web/WebServerTools.java +++ b/o2server/x_console/src/main/java/com/x/server/console/server/web/WebServerTools.java @@ -130,6 +130,7 @@ public class WebServerTools extends JettySeverTools { AsyncRequestLogWriter asyncRequestLogWriter = new AsyncRequestLogWriter(); asyncRequestLogWriter.setFilenameDateFormat("yyyy_MM_dd"); asyncRequestLogWriter.setAppend(true); + asyncRequestLogWriter.setRetainDays(webServer.getRequestLogRetainDays()); asyncRequestLogWriter.setFilename( Config.dir_logs().toString() + File.separator + "yyyy_MM_dd." + Config.node() + ".web.request.log"); String format = "%{client}a - %u %{yyyy-MM-dd HH:mm:ss.SSS ZZZ|" + DateFormatUtils.format(new Date(), "z") diff --git a/o2web/source/o2_core/o2.js b/o2web/source/o2_core/o2.js index 52c6351ed9ce94dfe57fe6de3b732b0ae5e8fba3..4fda5e2b539dc754f4b84dfb7e27c4bf78513b5c 100644 --- a/o2web/source/o2_core/o2.js +++ b/o2web/source/o2_core/o2.js @@ -1555,7 +1555,8 @@ if (window.Promise && !Promise.any){ address: o2.filterUrl(address), body: data, debug: (window.layout && layout["debugger"]), - token: (window.layout && layout.session && layout.session.user) ? layout.session.user.token : "" + token: (window.layout && layout.session && layout.session.user) ? layout.session.user.token : "", + tokenName: o2.tokenName } var actionWorker = new Worker("../o2_core/o2/actionWorker.js"); var p = new Promise(function(s,f){ diff --git a/o2web/source/o2_core/o2/actionWorker.js b/o2web/source/o2_core/o2/actionWorker.js index 52b0bbbaebf67747f33a6bb82cd2d02bb41fd1b3..1477928fc8d95f50b997cada6be41fbb1ec59f1c 100644 --- a/o2web/source/o2_core/o2/actionWorker.js +++ b/o2web/source/o2_core/o2/actionWorker.js @@ -34,6 +34,7 @@ function V(httpRequest) { var body = data.body; var debug = data.debug; var token = data.token; + var tokenName = data.tokenName; if (noCache) url = url+(((url.indexOf("?")!==-1) ? "&" : "?")+(new Date()).getTime()); @@ -44,8 +45,8 @@ function V(httpRequest) { this.request.setRequestHeader("Accept", "text/html,application/json,*/*"); if (debug) this.request.setRequestHeader("x-debugger", "true"); if (token){ - this.request.setRequestHeader(o2.tokenName, token); - this.request.setRequestHeader("authorization", token); + this.request.setRequestHeader(tokenName, token); + this.request.setRequestHeader("Authorization", token); } this.request.send(body); diff --git a/o2web/source/o2_core/o2/widget/JavascriptEditor.js b/o2web/source/o2_core/o2/widget/JavascriptEditor.js index e7a58be101689154da034cdb23dbf8c832d55c19..c3311ed654f0c6a0861b81a2da43cbb4a8585369 100644 --- a/o2web/source/o2_core/o2/widget/JavascriptEditor.js +++ b/o2web/source/o2_core/o2/widget/JavascriptEditor.js @@ -21,6 +21,7 @@ o2.widget.JavascriptEditor = new Class({ this.unbindEvents = []; this.node = $(node); this.id = o2.uuid(); + if (!o2.JSEditorCWE.isInit) o2.JSEditorCWE.init(); }, getDefaultEditorData: function(){ switch (this.options.type) { @@ -850,6 +851,7 @@ o2.widget.JavascriptEditor.completionWorkerEnvironment = o2.JSEditorCWE = { this.scriptWorker.onmessage = function(e) { if (e.data && e.data.type=="ready") this.setOnMessage(); }.bind(this); + this.isInit = true; return this; }, setOnMessage: function(){ @@ -872,4 +874,4 @@ o2.widget.JavascriptEditor.completionWorkerEnvironment = o2.JSEditorCWE = { this.scriptWorker.postMessage(o); } } -}.init(); +}; diff --git a/o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js b/o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js index 680893b1eccea92601cefbba290e48764f1c3e4d..00fa1d45451ba3626a4f0ca44e19f4181abfcb31 100644 --- a/o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js +++ b/o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js @@ -167,7 +167,7 @@ MWF.xDesktop.Actions.RestActions = new Class({ xhr.open(method, uri, async!==false); xhr.withCredentials = true; - if (file) messageItem = this.addFormDataMessage(file, false, xhr, progress); + if (file && File.prototype.isPrototypeOf(file)) messageItem = this.addFormDataMessage(file, false, xhr, progress); xhr.send(data); }, setMessageText: function(messageItem, text){ diff --git a/o2web/source/o2_core/scriptWorker.js b/o2web/source/o2_core/scriptWorker.js index 366408979f29ac2ee18709df6ba29a89c8311970..45e1790d021071604412bb8f3b8ce85d4c14f2c6 100644 --- a/o2web/source/o2_core/scriptWorker.js +++ b/o2web/source/o2_core/scriptWorker.js @@ -157,6 +157,7 @@ o2.addReady(function () { o2.getJSON("../x_desktop/res/config/config.json", function (config) { layout.config = config; + o2.tokenName = config.tokenName || "x-token"; configLoaded = true; if (configLoaded && commonLoaded && lpLoaded) _getDistribute(function () { _load(); }); }); diff --git a/o2web/source/x_component_AppMarketV2_Application/$Main/default/style.css b/o2web/source/x_component_AppMarketV2_Application/$Main/default/style.css index c45bcaf8a1962a33ce75e0354e069b1e79d02fa8..191080fbd4b2a513801af42aef089437dfb6529c 100644 --- a/o2web/source/x_component_AppMarketV2_Application/$Main/default/style.css +++ b/o2web/source/x_component_AppMarketV2_Application/$Main/default/style.css @@ -421,6 +421,13 @@ line-height:26px; } +.o2_appmarket_application_comment_content_title_a{ + font-size:20px; + font-family:MicrosoftYaHei; + color:rgba(51,51,51,1); + line-height:26px; + text-decoration: none; +} .o2_appmarket_application_comment_content_text{ width:90%; height:58%; diff --git a/o2web/source/x_component_AppMarketV2_Application/Comment.js b/o2web/source/x_component_AppMarketV2_Application/Comment.js index e04233f4ba5b83ad51719654bafe36dc0169f142..9d3c196412a7c3dd6f6fadc07dd9f88c953589f6 100644 --- a/o2web/source/x_component_AppMarketV2_Application/Comment.js +++ b/o2web/source/x_component_AppMarketV2_Application/Comment.js @@ -395,7 +395,15 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({ var content = percomment.content; var percommentConent = content.replace("

","").replace("

",""); - new Element("div",{"class":"o2_appmarket_application_comment_content_title","text":percomment.title}).inject(commentcontentright); + var subjectUrl = this.bbsUrlPath; + if(subjectUrl.indexOf(":",8)>0){ + subjectUrl = subjectUrl.slice(0,subjectUrl.indexOf(":",8)); + } + subjectUrl = subjectUrl+"/x_desktop/forum.html?app=ForumDocument&id="+percomment.id; + debugger + var subjectDiv= new Element("div",{"class":"o2_appmarket_application_comment_content_title"}).inject(commentcontentright); + var subjectA = new Element("a",{"class":"o2_appmarket_application_comment_content_title_a","text":percomment.title,"href":subjectUrl,"target":"_blank"}).inject(subjectDiv); + //subjectA.setStyle("text-decoration","none"); var conentDiv = new Element("div",{"class":"o2_appmarket_application_comment_content_text"}).inject(commentcontentright); var conentHtml = percomment.content; diff --git a/o2web/source/x_component_process_FormDesigner/Module/ReadLog/template.json b/o2web/source/x_component_process_FormDesigner/Module/ReadLog/template.json index 2692ee570eddc55556726db7838ba9809cfa3bae..0f8afe9ff14b3a1bcec50fe264557f75aa5147fc 100644 --- a/o2web/source/x_component_process_FormDesigner/Module/ReadLog/template.json +++ b/o2web/source/x_component_process_FormDesigner/Module/ReadLog/template.json @@ -8,7 +8,7 @@ "filterPerson": [], "filterRoute": [], "mode": "default", //default table or text - "textStyle": "
{person}({unit}): {opinion} ({data})
", + "textStyle": "
{person}({unit}): {opinion} ({date})
", "isTask": "true", "showReadTitle": "待阅人", "showReadCompletedTitle":"已阅人", diff --git a/o2web/source/x_component_process_ProcessDesigner/$Process/route.html b/o2web/source/x_component_process_ProcessDesigner/$Process/route.html index 1e52cdb1c3bd23069c9b09ac0a25bab6d0656cd6..d7dbb1f652d3895da5b210f31100d994563e866d 100644 --- a/o2web/source/x_component_process_ProcessDesigner/$Process/route.html +++ b/o2web/source/x_component_process_ProcessDesigner/$Process/route.html @@ -36,8 +36,8 @@ {{$.lp.opinionRequired}}: - 是 - 否 + {{$.lp.yes}} + {{$.lp.no}} diff --git a/o2web/source/x_component_process_Xform/DatatablePC.js b/o2web/source/x_component_process_Xform/DatatablePC.js index bf7e06041fbf2ae365ed9f5fd39c6d51509338e4..4971922228553382974cb58b4101d6cf6ae7a2c8 100644 --- a/o2web/source/x_component_process_Xform/DatatablePC.js +++ b/o2web/source/x_component_process_Xform/DatatablePC.js @@ -379,17 +379,46 @@ MWF.xApplication.process.Xform.DatatablePC = new Class( this.totalColumns.each(function(column, index){ var json = column.moduleJson; if(!json)return; + + var pointLength = 0; //小数点后的最大数位 + var tmpV; if (column.type === "count"){ tmpV = data.data.length; }else if(column.type === "number"){ - var tmpV = new Decimal(0); + tmpV = new Decimal(0); for (var i=0; i -1 ){ + pointLength = Math.max(pointLength, v.split(".")[1].length); + } + } + } + } + + if( isNaN( tmpV ) ){ + totalData[json.id] = ""; + column.td.set("text", "" ); + }else{ + if( pointLength > 0 && tmpV.toString() !== "0" ){ + var s = tmpV.toString(); + if( s.indexOf(".") > -1 ){ + var length = s.split(".")[1].length; + if( length < pointLength ){ + totalData[json.id] = s + "0".repeat(pointLength-length); + }else{ + totalData[json.id] = s; + } + }else{ + totalData[json.id] = s +"."+ "0".repeat(pointLength) + } + }else{ + totalData[json.id] = tmpV.toString(); } + column.td.set("text", totalData[json.id] ); } - totalData[json.id] = tmpV.toString(); - column.td.set("text", isNaN( tmpV ) ? "" : tmpV ); }.bind(this)); data.total = totalData; return totalData; diff --git a/o2web/source/x_desktop/index.html b/o2web/source/x_desktop/index.html index 51596a30a0218d0cd9096ad3be4ff6c96453846c..59ea69932a9899d81c7bd1568dcba7f4cf0e90ab 100644 --- a/o2web/source/x_desktop/index.html +++ b/o2web/source/x_desktop/index.html @@ -6,7 +6,7 @@ - O2 + O2OA