提交 5a117569 编写于 作者: 蔡祥熠

Merge branch 'fix/手写签批修改' into 'develop'

Merge of fix/手写签批修改 to develop

See merge request o2oa/o2oa!656
{
"container": {
"-webkit-user-select": "none",
"-moz-user-select": "none",
"user-select" : "none"
},
"toolbar" : {
"overflow" : "hidden",
"text-align" : "center"
},
"uploadActionNode":{
"margin": "0px 10px 10px 10px",
"background-color": "#FFF",
"padding": "4px 14px",
"border": "1px solid #999",
"border-radius": "3px",
"font-size": "14px",
"color": "#666",
"cursor": "pointer"
},
"resetActionNode" : {
"margin": "10px 10px 10px 10px",
"background-color": "#FFF",
"padding": "4px 14px",
"border": "1px solid #999",
"border-radius": "3px",
"font-size": "14px",
"color": "#666",
"cursor": "pointer"
},
"contentNode" :{
"overflow" : "hidden",
"border" : "0px solid #ccc"
},
"descriptionNode":{
"font-size":"14px",
"color" : "#666",
"margin-top" : "5px",
"margin-left" : "5px"
},
"toolbar" : {
"font-size": "14px",
"color": "#666",
"overflow": "hidden",
"margin-bottom": "3px",
"height": "70px",
"background-color": "#F8F8F8",
"box-shadow": "0 1px 3px 0 rgba(0,0,0,0.25)"
},
"toolItemGroup": {
"float": "left",
"overflow": "hidden"
},
"toolItem": {
"margin": "15px 3px 10px 3px",
"color": "#666",
"float": "left",
"background-repeat": "no-repeat",
"background-position-x": "center",
"background-position-y": "top",
"padding": "23px 5px 5px 5px",
"cursor": "pointer"
},
"toolRightItem": {
"margin": "15px 10px 10px 3px",
"color": "#666",
"float": "right",
"background-repeat": "no-repeat",
"background-position-x": "center",
"background-position-y": "top",
"padding": "23px 5px 5px 5px",
"cursor": "pointer"
},
"toolItem_over": {
"color": "#3C76B7"
},
"toolItem_disable": {
"color": "#999",
"cursor": "default"
},
"separator": {
"margin": "17px 2px 10px 2px",
"height": "40px",
"float": "left",
"border-left": "1px solid rgba(0,0,0,0.12)"
},
"canvasWrap": {
"border": "1px solid #ccc",
"margin": "0px auto"
},
"cancel_mobile": {
"color": "#333",
"font-size": "16px",
"width": "40px",
"height": "36px",
"font-weight": "bold",
"position": "absolute",
"top": "20px",
"left": "30px"
},
"save_mobile": {
"color": "#4A90E2",
"font-size": "16px",
"width": "40px",
"height": "36px",
"font-weight": "bold",
"position": "absolute",
"top": "20px",
"right": "30px"
},
"undo_mobile": {
"background":"#fff url(../o2_core/o2/widget/$Tablet/default/icon/undo_normal.png) no-repeat center center",
"width": "36px",
"height": "36px",
"border-radius": "18px",
"box-shadow": "5px 4px 5px #ccc",
"position": "absolute",
"bottom": "20px",
"right": "130px"
},
"undo_mobile_disable": {
"background":"#fff url(../o2_core/o2/widget/$Tablet/default/icon/undo_disable.png) no-repeat center center"
},
"redo_mobile": {
"background":"#fff url(../o2_core/o2/widget/$Tablet/default/icon/redo_normal.png) no-repeat center center",
"width": "36px",
"height": "36px",
"border-radius": "18px",
"box-shadow": "5px 4px 5px #ccc",
"position": "absolute",
"bottom": "20px",
"right": "80px"
},
"redo_mobile_disable": {
"background":"#fff url(../o2_core/o2/widget/$Tablet/default/icon/redo_disable.png) no-repeat center center"
},
"reset_mobile": {
"background":"#fff url(../o2_core/o2/widget/$Tablet/default/icon/reset_normal.png) no-repeat center center",
"width": "36px",
"height": "36px",
"border-radius": "18px",
"box-shadow": "5px 4px 5px #ccc",
"position": "absolute",
"bottom": "20px",
"right": "30px"
},
"reset_mobile_disable": {
"background":"#fff url(../o2_core/o2/widget/$Tablet/default/icon/reset_disable.png) no-repeat center center"
},
"imageMoveMaskNode": {
"width": "100%",
"height": "100%",
"opacity": 0.6,
"position": "absolute",
"background-color": "#CCC",
"top": "0px",
"left": "0px",
"z-index" : 1002,
"-webkit-user-select": "none",
"-moz-user-select": "none",
"user-select" : "none"
},
"imageMoveOkNode": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/ok.png) no-repeat",
"width" : "16px",
"height" : "16px",
"right" : "-20px",
"top" : "5px",
"position" : "absolute",
"cursor" : "pointer"
},
"imageMoveCancelNode": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/cancel.png) no-repeat",
"width" : "16px",
"height" : "16px",
"right" : "-20px",
"top" : "30px",
"position" : "absolute",
"cursor" : "pointer"
},
"imageMoveResizeNode": {
"cursor" : "nw-resize",
"position": "absolute",
"bottom": "0px",
"right": "0px",
"border" : "2px solid #52a3f5",
"width" : "8px",
"height" : "8px"
},
"inputEditareaWrap":{
"position": "absolute",
"border": "1px dashed red",
"top": "0px",
"left": "0px",
"width": "calc( 100% - 2px )",
"min-height": "calc( 100% - 2px )",
"background": "transparent",
// "z-index": 1003
},
"inputEditarea": {
"outline": "none",
"border": "0px",
"width": "calc( 100% - 10px )",
"min-height": "calc( 100% - 10px )",
"background": "transparent",
"user-select": "text",
"-webkit-user-select": "text",
"padding":"5px",
"line-height": "140%",
"letter-spacing":"0.8px",
"white-space": "pre-wrap"
},
"inputCancelNode": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/cancel2.png) no-repeat center center",
"background-color": "#52a3f5",
"width" : "16px",
"height" : "16px",
"border-radius": "100px",
"right" : "-8px",
"top" : "-8px",
"position" : "absolute",
"cursor" : "pointer"
},
"inputDragNode": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/move.png) no-repeat center center",
"background-color": "#52a3f5",
"cursor" : "move",
"position": "absolute",
"top": "-8px",
"left": "-8px",
"width" : "16px",
"height" : "16px",
"border-radius": "100px"
},
"inputResizeNode": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/resize.png) no-repeat center center",
"background-size" : "8px",
"background-color" : "#52a3f5",
"cursor" : "nw-resize",
"position": "absolute",
"bottom": "-8px",
"right": "-8px",
"width" : "16px",
"height" : "16px",
"border-radius": "100px"
},
"inputCancelNode_mobile": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/cancel2.png) no-repeat center center",
"width" : "16px",
"height" : "16px",
"border-radius": "100px",
"right" : "-8px",
"top" : "-8px",
"position" : "absolute",
"cursor" : "pointer"
},
"inputDragNode_mobile": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/move3.png) no-repeat center center",
"cursor" : "move",
"position": "absolute",
"top": "-8px",
"left": "-8px",
"width" : "16px",
"height" : "16px",
"border-radius": "100px"
},
"inputResizeNode_mobile": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/resize3.png) no-repeat center center",
"background-size" : "8px",
"cursor" : "nw-resize",
"position": "absolute",
"bottom": "-8px",
"right": "-8px",
"width" : "16px",
"height" : "16px",
"border-radius": "100px"
},
"scrollNode": {
"position": "absolute",
"top": "0",
"right": "0px",
"width": "16px",
"height": "100%",
"z-index": 10
},
"scrollupIcon":{
"cursor" : "pointer",
"background": "url(../o2_core/o2/widget/$Tablet/default/icon/up.png)",
"width": "16px",
"height": "16px",
"display": "block"
},
"scrolldownIcon": {
"cursor" : "pointer",
"background": "url(../o2_core/o2/widget/$Tablet/default/icon/down.png)",
"width": "16px",
"height": "16px",
"display": "block"
},
"scrollVAreaNode": {
"width": "16px",
"height": "calc( 100% - 32px )",
"position": "relative",
"overflow": "visible"
},
"scrollVNode" :{
"background": "url(../o2_core/o2/widget/$Tablet/default/icon/scroll.png)",
"position": "absolute",
"width":"16px",
"height": "24px"
}
}
\ No newline at end of file
......@@ -146,5 +146,171 @@
},
"reset_mobile_disable": {
"background":"#fff url(../o2_core/o2/widget/$Tablet/default/icon/reset_disable.png) no-repeat center center"
},
"imageMoveMaskNode": {
"width": "100%",
"height": "100%",
"opacity": 0.6,
"position": "absolute",
"background-color": "#CCC",
"top": "0px",
"left": "0px",
"z-index" : 1002,
"-webkit-user-select": "none",
"-moz-user-select": "none",
"user-select" : "none"
},
"imageMoveOkNode": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/ok.png) no-repeat",
"width" : "16px",
"height" : "16px",
"right" : "-20px",
"top" : "5px",
"position" : "absolute",
"cursor" : "pointer"
},
"imageMoveCancelNode": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/cancel.png) no-repeat",
"width" : "16px",
"height" : "16px",
"right" : "-20px",
"top" : "30px",
"position" : "absolute",
"cursor" : "pointer"
},
"imageMoveResizeNode": {
"cursor" : "nw-resize",
"position": "absolute",
"bottom": "0px",
"right": "0px",
"border" : "2px solid #52a3f5",
"width" : "8px",
"height" : "8px"
},
"inputEditareaWrap":{
"position": "absolute",
"border": "1px dashed red",
"top": "0px",
"left": "0px",
"width": "calc( 100% - 2px )",
"min-height": "calc( 100% - 2px )",
"background": "transparent",
// "z-index": 1003
},
"inputEditarea": {
"outline": "none",
"border": "0px",
"width": "calc( 100% - 10px )",
"min-height": "calc( 100% - 10px )",
"background": "transparent",
"user-select": "text",
"-webkit-user-select": "text",
"padding":"5px",
"line-height": "140%",
"letter-spacing":"0.8px",
"white-space": "pre-wrap"
},
"inputCancelNode": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/cancel2.png) no-repeat center center",
"background-color": "#52a3f5",
"width" : "16px",
"height" : "16px",
"border-radius": "100px",
"right" : "-8px",
"top" : "-8px",
"position" : "absolute",
"cursor" : "pointer"
},
"inputDragNode": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/move.png) no-repeat center center",
"background-color": "#52a3f5",
"cursor" : "move",
"position": "absolute",
"top": "-8px",
"left": "-8px",
"width" : "16px",
"height" : "16px",
"border-radius": "100px"
},
"inputResizeNode": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/resize.png) no-repeat center center",
"background-size" : "8px",
"background-color" : "#52a3f5",
"cursor" : "nw-resize",
"position": "absolute",
"bottom": "-8px",
"right": "-8px",
"width" : "16px",
"height" : "16px",
"border-radius": "100px"
},
"inputCancelNode_mobile": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/cancel2.png) no-repeat center center",
"width" : "16px",
"height" : "16px",
"border-radius": "100px",
"right" : "-8px",
"top" : "-8px",
"position" : "absolute",
"cursor" : "pointer"
},
"inputDragNode_mobile": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/move3.png) no-repeat center center",
"cursor" : "move",
"position": "absolute",
"top": "-8px",
"left": "-8px",
"width" : "16px",
"height" : "16px",
"border-radius": "100px"
},
"inputResizeNode_mobile": {
"background" : "url(../o2_core/o2/widget/$Tablet/default/icon/resize3.png) no-repeat center center",
"background-size" : "8px",
"cursor" : "nw-resize",
"position": "absolute",
"bottom": "-8px",
"right": "-8px",
"width" : "16px",
"height" : "16px",
"border-radius": "100px"
},
"scrollNode": {
"position": "absolute",
"top": "0",
"right": "0px",
"width": "16px",
"height": "100%",
"z-index": 10
},
"scrollupIcon":{
"cursor" : "pointer",
"background": "url(../o2_core/o2/widget/$Tablet/default/icon/up.png)",
"width": "16px",
"height": "16px",
"display": "block"
},
"scrolldownIcon": {
"cursor" : "pointer",
"background": "url(../o2_core/o2/widget/$Tablet/default/icon/down.png)",
"width": "16px",
"height": "16px",
"display": "block"
},
"scrollVAreaNode": {
"width": "16px",
"height": "calc( 100% - 32px )",
"position": "relative",
"overflow": "visible"
},
"scrollVNode" :{
"background": "url(../o2_core/o2/widget/$Tablet/default/icon/scroll.png)",
"position": "absolute",
"width":"16px",
"height": "24px"
}
}
\ No newline at end of file
MWF.xApplication.process.Xform.widget = MWF.xApplication.process.Xform.widget || {};
MWF.xApplication.process.Xform.widget.HandwrittenApproval = new Class({
Implements: [Options, Events],
options: {
"speed": 1,
"fxTime": 500,
"inforTime": 2000
},
initialize: function(documentEditor, options){
this.setOptions(options);
this.documentEditor = documentEditor;
this.css = this.documentEditor.css;
},
is_iPad: function(){
var ua = navigator.userAgent.toLowerCase();
return (ua.match(/iPad/i)=="ipad");
},
load: function(callback){
this.getHistroyDocumentList(function(){
if (this.historyDocumentList && this.historyDocumentList.length){
this.getHistoryDataList(function(){
this.createHistoryToolbar();
if (!layout.mobile || this.is_iPad()) this.createHistoryListNode();
this.documentEditor.options.pageShow = "single";
this.documentEditor.resetData();
this.beginDiffHistory();
this.loadHistoryToolbar();
if (!layout.mobile) this.loadHistoryList();
if (callback) callback();
}.bind(this));
}else{
this.documentEditor.form.app.notice(MWF.xApplication.process.Xform.LP.handwrittenApproval.nodiff, "info", this.documentEditor.node);
}
}.bind(this));
},
createHistoryToolbar: function(){
this.documentEditor.documentToolbarNode = this.documentEditor.toolbarNode;
this.toolbarNode = this.documentEditor.toolbarNode.clone(true);
this.toolbarNode.inject(this.documentEditor.toolbarNode, "after");
this.documentEditor.toolbarNode = this.toolbarNode;
this.documentEditor.documentToolbarNode.hide();
this.toolbarNode.empty();
if (this.documentEditor.sidebarNode) this.documentEditor.sidebarNode.hide();
},
loadHistoryToolbar: function(){
debugger;
var html = "";
if (this.historyDataList && this.historyDataList.length && this.historyDataList[0].json.v!="6"){
html += "<span MWFnodetype=\"MWFToolBarButton\" MWFButtonImage=\"../x_component_process_Xform/$Form/default/documenteditoricon/play.png\" title=\""+MWF.xApplication.process.Xform.LP.handwrittenApproval.play+"\" MWFButtonAction=\"play\"></span>";
html += "<span MWFnodetype=\"MWFToolBarButton\" MWFButtonImage=\"../x_component_process_Xform/$Form/default/documenteditoricon/pause.png\" title=\""+MWF.xApplication.process.Xform.LP.handwrittenApproval.pause+"\" MWFButtonAction=\"pause\"></span>";
html += "<span MWFnodetype=\"MWFToolBarButton\" MWFButtonImage=\"../x_component_process_Xform/$Form/default/documenteditoricon/stop.png\" title=\""+MWF.xApplication.process.Xform.LP.handwrittenApproval.stop+"\" MWFButtonAction=\"stopPlay\"></span>";
html += "<span MWFnodetype=\"MWFToolBarSeparator\"></span>";
html += "<span MWFnodetype=\"MWFToolBarButton\" MWFButtonImage=\"../x_component_process_Xform/$Form/default/documenteditoricon/prev.png\" title=\""+MWF.xApplication.process.Xform.LP.handwrittenApproval.prev+"\" MWFButtonAction=\"prev\"></span>";
html += "<span MWFnodetype=\"MWFToolBarButton\" MWFButtonImage=\"../x_component_process_Xform/$Form/default/documenteditoricon/next.png\" title=\""+MWF.xApplication.process.Xform.LP.handwrittenApproval.next+"\" MWFButtonAction=\"next\"></span>";
html += "<span MWFnodetype=\"MWFToolBarSeparator\"></span>";
}
html += "<span MWFnodetype=\"MWFToolBarButton\" MWFButtonImage=\"../x_component_process_Xform/$Form/default/documenteditoricon/exit.png\" title=\""+MWF.xApplication.process.Xform.LP.handwrittenApproval.exit+"\" MWFButtonAction=\"exit\" MWFButtonText=\""+MWF.xApplication.process.Xform.LP.handwrittenApproval.exit+"\"></span>";
html += "<span MWFnodetype=\"MWFToolBarSeparator\"></span>";
var text = MWF.xApplication.process.Xform.LP.handwrittenApproval.diff_patch_count;
text = text.replace(/{history}/, this.historyDataList.length).replace(/{diff}/, this.diffCount);
html += "<span style='float: left; line-height: 24px; color: #666666; margin-left: 10px'>"+text+"</span>";
this.toolbarNode.set("html", html);
MWF.require("MWF.widget.Toolbar", function() {
this.toolbar = new MWF.widget.Toolbar(this.toolbarNode, {"style": "documentEdit"}, this);
this.toolbar.load();
this.checkToolbar();
}.bind(this));
this.toolbarNode.setStyle("overflow", "visible");
if (this.historyListAreaNode) this.historyListAreaNode.inject(this.toolbarNode);
},
checkToolbar: function(){
if (this.historyDataList && this.historyDataList.length && this.historyDataList[0].json.v!="6"){
if (this.toolbar){
if (this.playing){
if (this.stop){
this.toolbar.childrenButton[0].enable();
this.toolbar.childrenButton[1].disable();
if (this.patchIndex==0 && this.diffIndex==0){
this.toolbar.childrenButton[3].disable();
if (this.diffPatch.length) this.toolbar.childrenButton[4].enable();
}else{
if (this.patchIndex<this.diffPatch.length-1){
this.toolbar.childrenButton[3].enable();
this.toolbar.childrenButton[4].enable();
}else if (this.patchIndex<this.diffPatch.length && this.diffIndex < this.diffPatch[this.patchIndex].patch.diffs.length){
this.toolbar.childrenButton[3].enable();
this.toolbar.childrenButton[4].enable();
}else{
if (this.diffPatch.length) this.toolbar.childrenButton[3].enable();
this.toolbar.childrenButton[4].disable();
}
}
}else{
this.toolbar.childrenButton[0].disable();
this.toolbar.childrenButton[1].enable();
this.toolbar.childrenButton[3].disable();
this.toolbar.childrenButton[4].disable();
}
this.toolbar.childrenButton[2].enable();
}else{
this.toolbar.childrenButton[0].enable();
this.toolbar.childrenButton[1].disable();
this.toolbar.childrenButton[2].disable();
if (this.patchIndex==0 && this.diffIndex==0){
this.toolbar.childrenButton[3].disable();
if (this.diffPatch.length) this.toolbar.childrenButton[4].enable();
}else{
if (this.patchIndex<this.diffPatch.length-1){
this.toolbar.childrenButton[3].enable();
this.toolbar.childrenButton[4].enable();
}else if (this.patchIndex<this.diffPatch.length && this.diffIndex < this.diffPatch[this.patchIndex].patch.diffs.length){
this.toolbar.childrenButton[3].enable();
this.toolbar.childrenButton[4].enable();
}else{
if (this.diffPatch.length) this.toolbar.childrenButton[3].enable();
this.toolbar.childrenButton[4].disable();
}
}
}
}
}else{
// 不做动画效果,不需要处理工具条
}
}
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册