Просмотр исходного кода

版式正文痕迹保留增加是否允许查看痕迹配置

huqi 5 лет назад
Родитель
Сommit
b23e358c10

+ 7 - 0
o2web/source/o2_core/o2/xDesktop/WebSocket.js

@@ -164,6 +164,13 @@ MWF.xDesktop.WebSocket = new Class({
         console.log("websocket is error ...");
         //MWF.xDesktop.notice("success", {"x": "right", "y": "top"}, "websocket is error ...");
     },
+    checkRetry: function(){
+        if (this.serverCheck) window.clearTimeout(this.serverCheck);
+        if (this.heartbeatCheck) window.clearTimeout(this.heartbeatCheck);
+        if (this.errorCount < this.maxErrorCount) this.serverCheck = window.setTimeout(function(){
+            this.retry();
+        }.bind(this), this.checkingTimeout);
+    },
     retry: function(){
         if (this.webSocket){
             this.close();

+ 13 - 1
o2web/source/x_component_process_FormDesigner/Module/Documenteditor/documenteditor.html

@@ -59,7 +59,19 @@
 			</td>
 		</tr>
 		</table>
-		<div id="text{$.pid}allowPrintScriptArea" style="display: text{($.allowEdit=='s')?'block':'none'}" class="MWFFormulaArea" name="allowPrintScript" title="允许打印脚本 (S)"></div>
+		<div id="text{$.pid}allowPrintScriptArea" style="display: text{($.allowPrint=='s')?'block':'none'}" class="MWFFormulaArea" name="allowPrintScript" title="允许打印脚本 (S)"></div>
+
+		<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+			<tr>
+				<td class="editTableTitle">查看痕迹:</td>
+				<td class="editTableValue">
+					<input class="editTableRadio" onclick="if (this.checked) {$('text{$.pid}allowHistoryScriptArea').setStyle('display', 'none')}" name="allowHistory" text{($.allowHistory!='n' && $.allowHistory!='s')?'checked':''} type="radio" value="y"/>允许
+					<input class="editTableRadio" onclick="if (this.checked) {$('text{$.pid}allowHistoryScriptArea').setStyle('display', 'none')}" name="allowHistory" text{($.allowHistory=='n')?'checked':''} type="radio" value="n"/>不允许
+					<input class="editTableRadio" onclick="if (this.checked) {$('text{$.pid}allowHistoryScriptArea').setStyle('display', 'block')}" name="allowHistory" text{($.allowHistory=='s')?'checked':''} type="radio" value="s"/>根据脚本
+				</td>
+			</tr>
+		</table>
+		<div id="text{$.pid}allowHistoryScriptArea" style="display: text{($.allowHistory=='s')?'block':'none'}" class="MWFFormulaArea" name="allowHistoryScript" title="允许查看痕迹脚本 (S)"></div>
 
 		<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
 			<tr>

+ 11 - 1
o2web/source/x_component_process_Xform/Documenteditor.js

@@ -615,6 +615,7 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
 
         this.allowEdit = this._isAllowEdit();
         this.allowPrint = this._isAllowPrint();
+        this.allowHistory = this._isAllowHistory();
         this.toolNode = new Element("div", {"styles": this.css.doc_toolbar}).inject(this.node);
         this.contentNode = new Element("div", {"styles": this.css.doc_content}).inject(this.node);
 
@@ -1066,6 +1067,15 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
         }
         return true;
     },
+    _isAllowHistory: function(){
+        if (this.json.allowHistory=="n") return false;
+        if (this.json.allowHistory=="s"){
+            if (this.json.allowHistoryScript && this.json.allowHistoryScript.code){
+                return !!this.form.Macro.exec(this.json.allowHistoryScript.code, this);
+            }
+        }
+        return true;
+    },
 
     _getEdit: function(name, typeItem, scriptItem){
         switch (this.json[typeItem]) {
@@ -1104,7 +1114,7 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
         if (this.allowPrint){
             html += "<span MWFnodetype=\"MWFToolBarButton\" MWFButtonImage=\"/x_component_process_Xform/$Form/default/icon/print.png\" title=\""+MWF.xApplication.process.Xform.LP.printdoc+"\" MWFButtonAction=\"_printDoc\" MWFButtonText=\""+MWF.xApplication.process.Xform.LP.printdoc+"\"></span>";
         }
-        if (this.allowPrint){
+        if (this.allowHistory){
            html += "<span MWFnodetype=\"MWFToolBarButton\" MWFButtonImage=\"/x_component_process_Xform/$Form/default/icon/versions.png\" title=\""+MWF.xApplication.process.Xform.LP.history+"\" MWFButtonAction=\"_historyDoc\" MWFButtonText=\""+MWF.xApplication.process.Xform.LP.history+"\"></span>";
         }
         this.toolbarNode = new Element("div", {"styles": this.css.doc_toolbar_node}).inject(this.toolNode);

+ 33 - 17
o2web/source/x_component_process_Xform/widget/DocumentHistory.js

@@ -814,34 +814,50 @@ MWF.xApplication.process.Xform.widget.DocumentHistory = new Class({
                 }
             }.bind(this));
         }else{
-            var duration = this.options.speed*this.options.fxTime/nodes.length
-            var span = new Element("span", {"styles": {"opacity": 0}}).inject(ins);
-            span.appendChild(node);
-            var fx = new Fx.Tween(span, {property: 'opacity', duration:duration});
-            fx.start(0,1).chain(function(){
+            var duration = this.options.speed*this.options.fxTime/nodes.length;
+            if (!duration){
+                ins.appendChild(node);
                 idx++;
                 if (idx<nodes.length){
                     this.doInsetNodeAnimation(ins, nodes, idx, callback);
                 }else{
                     if (callback) callback();
                 }
-            }.bind(this));
+            }else{
+                var span = new Element("span", {"styles": {"opacity": 0}}).inject(ins);
+                span.appendChild(node);
+                var fx = new Fx.Tween(span, {property: 'opacity', duration:duration});
+                fx.start(0,1).chain(function(){
+                    idx++;
+                    if (idx<nodes.length){
+                        this.doInsetNodeAnimation(ins, nodes, idx, callback);
+                    }else{
+                        if (callback) callback();
+                    }
+                }.bind(this));
+            }
         }
     },
 
     doCharAnimation: function(node, str, idx, callback){
         var duration = this.options.speed*this.options.fxTime/str.length;
-        var char = str.charAt(idx);
-        var span = new Element("span", {"styles": {"opacity": 0}, "html": char}).inject(node);
-        var fx = new Fx.Tween(span, {property: 'opacity', duration:duration});
-        fx.start(0,1).chain(function(){
-            idx++;
-            if (idx<str.length){
-                this.doCharAnimation(node, str, idx, callback);
-            }else{
-                if (callback) callback();
-            }
-        }.bind(this));
+        if (!duration){
+            node.set("html", str);
+            idx = str.length;
+            if (callback) callback();
+        }else{
+            var char = str.charAt(idx);
+            var span = new Element("span", {"styles": {"opacity": 0}, "html": char}).inject(node);
+            var fx = new Fx.Tween(span, {property: 'opacity', duration:duration});
+            fx.start(0,1).chain(function(){
+                idx++;
+                if (idx<str.length){
+                    this.doCharAnimation(node, str, idx, callback);
+                }else{
+                    if (callback) callback();
+                }
+            }.bind(this));
+        }
     },
 
     doDeleteAnimation: function(node, diff, obj, callback){