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

+ 48 - 2
gulpfile.js

@@ -489,10 +489,56 @@ function build_bundle(){
         .pipe(rename({ extname: '.min.js' }))
         .pipe(gulp.dest(dest))
 }
+
+function build_concat_basework() {
+    var src = [
+        'o2web/source/x_desktop/js/base_work_begin.js',
+        'o2web/source/x_desktop/js/base.js',
+        'o2web/source/o2_core/o2/widget/Common.js',
+        'o2web/source/o2_core/o2/widget/Dialog.js',
+        'o2web/source/o2_core/o2/widget/UUID.js',
+        'o2web/source/o2_core/o2/widget/Menu.js',
+        'o2web/source/o2_core/o2/widget/Toolbar.js',
+        'o2web/source/o2_core/o2/xDesktop/Common.js',
+        'o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js',
+        'o2web/source/o2_core/o2/xAction/RestActions.js',
+        'o2web/source/o2_core/o2/xDesktop/Access.js',
+        'o2web/source/o2_core/o2/xDesktop/Dialog.js',
+        'o2web/source/o2_core/o2/xDesktop/Menu.js',
+        'o2web/source/o2_core/o2/xDesktop/UserData.js',
+        'o2web/source/x_component_Template/MPopupForm.js',
+        'o2web/source/o2_core/o2/xDesktop/Authentication.js',
+        'o2web/source/o2_core/o2/xDesktop/Dialog.js',
+        'o2web/source/o2_core/o2/xDesktop/Window.js',
+        'o2web/source/x_component_Common/Main.js',
+        'o2web/source/x_component_process_Work/Main.js',
+        'o2web/source/x_component_Selector/package.js',
+        'o2web/source/x_component_Selector/Person.js',
+        'o2web/source/x_component_Selector/Identity.js',
+        'o2web/source/x_component_Selector/Unit.js',
+        'o2web/source/o2_core/o2/xScript/Environment.js',
+        'o2web/source/o2_core/o2/xScript/Actions/ScriptActions.js',
+        'o2web/source/o2_core/o2/xScript/Actions/CMSScriptActions.js',
+        'o2web/source/o2_core/o2/xScript/Actions/PortalScriptActions.js',
+        'o2web/source/x_component_process_Work/Processor.js',
+        'o2web/source/x_component_Template/MTooltips.js',
+        'o2web/source/o2_core/o2/xAction/services/x_organization_assemble_authentication.js',
+        'o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.js',
+        'o2web/source/o2_core/o2/xAction/services/x_cms_assemble_control.js',
+        'o2web/source/x_desktop/js/base_work_end.js'
+    ];
+    var dest = 'target/o2server/servers/webServer/x_desktop/js/';
+    return gulp.src(src)
+        .pipe(concat('bask_work.js'))
+        .pipe(gulp.dest(dest))
+        .pipe(uglify())
+        .pipe(rename({ extname: '.min.js' }))
+        .pipe(gulp.dest(dest));
+}
 // function build_concat(){
 //     return gulp.parallel(build_concat_o2, build_concat_desktop, build_concat_xform);
 // }
-exports.build_concat = gulp.parallel(build_concat_o2, build_concat_desktop, build_concat_xform, build_bundle);
+exports.build_concat = gulp.parallel(build_concat_o2, build_concat_desktop, build_concat_xform, build_bundle, build_concat_basework);
 
 
 function build_web_v_html() {
@@ -584,7 +630,7 @@ function chmod_sh(){
 function chmod_servers(){
     return (shell.task('chmod 777 -R target/o2server/servers'))();
 }
-exports.build_web = gulp.series(build_web_minimize, build_web_move, gulp.parallel(build_concat_o2, build_concat_desktop, build_concat_xform, build_bundle), build_web_v_html, build_web_v_o2);
+exports.build_web = gulp.series(build_web_minimize, build_web_move, gulp.parallel(build_concat_o2, build_concat_desktop, build_concat_xform, build_bundle, build_concat_basework), build_web_v_html, build_web_v_o2);
 if (os.platform().indexOf("win")==-1){
     exports.deploy = gulp.series(deploy_server, chmod_jvm, chmod_commons, chmod_sh, chmod_servers);
 }else{

+ 82 - 0
o2web/gulpfile.js

@@ -351,6 +351,84 @@ function createO2ConcatTask(path, isMin, thisOptions) {
     });
 }
 
+function createBaseWorkConcatTask(path, isMin, thisOptions) {
+    gulp.task(path+".base_work : concat", function(){
+        var option = thisOptions || options;
+        var src = [
+            'source/' + path + '/js/base_work_begin.js',
+            'source/' + path + '/js/base.js',
+            'source/o2_core/o2/widget/Common.js',
+            'source/o2_core/o2/widget/Dialog.js',
+            'source/o2_core/o2/widget/UUID.js',
+            'source/o2_core/o2/widget/Menu.js',
+            'source/o2_core/o2/widget/Toolbar.js',
+            'source/o2_core/o2/xDesktop/Common.js',
+            'source/o2_core/o2/xDesktop/Actions/RestActions.js',
+            'source/o2_core/o2/xAction/RestActions.js',
+            'source/o2_core/o2/xDesktop/Access.js',
+            'source/o2_core/o2/xDesktop/Dialog.js',
+            'source/o2_core/o2/xDesktop/Menu.js',
+            'source/o2_core/o2/xDesktop/UserData.js',
+            'source/x_component_Template/MPopupForm.js',
+            'source/o2_core/o2/xDesktop/Authentication.js',
+            'source/o2_core/o2/xDesktop/Dialog.js',
+            'source/o2_core/o2/xDesktop/Window.js',
+            'source/x_component_Common/Main.js',
+            'source/x_component_process_Work/Main.js',
+            'source/x_component_Selector/package.js',
+            'source/x_component_Selector/Person.js',
+            'source/x_component_Selector/Identity.js',
+            'source/x_component_Selector/Unit.js',
+            'source/o2_core/o2/xScript/Environment.js',
+            'source/o2_core/o2/xScript/Actions/ScriptActions.js',
+            'source/o2_core/o2/xScript/Actions/CMSScriptActions.js',
+            'source/o2_core/o2/xScript/Actions/PortalScriptActions.js',
+            'source/x_component_process_Work/Processor.js',
+            'source/x_component_Template/MTooltips.js',
+            'source/o2_core/o2/xAction/services/x_organization_assemble_authentication.js',
+            'source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.js',
+            'source/o2_core/o2/xAction/services/x_cms_assemble_control.js',
+            'source/' + path + '/js/base_work_end.js'
+        ];
+        var dest = option.dest+'/' + path + '/';
+        return gulp.src(src)
+            .pipe(concat('js/base_work.js'))
+            .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
+            .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
+                host: option.host,
+                user: option.user || 'anonymous',
+                pass: option.pass || '@anonymous',
+                port: option.port || 21,
+                remotePath: (option.remotePath || '/') + path
+            })))
+            .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
+                host: option.host,
+                user: option.user || 'anonymous',
+                pass: option.pass || null,
+                port: option.port || 22,
+                remotePath: (option.remotePath || '/') + path
+            })))
+            .pipe(gulp.dest(dest))
+            .pipe(uglify())
+            .pipe(rename({ extname: '.min.js' }))
+            .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
+            .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
+                host: option.host,
+                user: option.user || 'anonymous',
+                pass: option.pass || '@anonymous',
+                port: option.port || 21,
+                remotePath: (option.remotePath || '/') + path
+            })))
+            .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
+                host: option.host,
+                user: option.user || 'anonymous',
+                pass: option.pass || null,
+                port: option.port || 22,
+                remotePath: (option.remotePath || '/') + path
+            })))
+            .pipe(gulp.dest(dest))
+    });
+}
 function getAppTask(path, isMin, thisOptions) {
     if (path==="x_component_process_Xform"){
         createDefaultTask(path, isMin, thisOptions);
@@ -360,6 +438,10 @@ function getAppTask(path, isMin, thisOptions) {
         createDefaultTask(path, isMin, thisOptions);
         createO2ConcatTask(path, isMin, thisOptions);
         return gulp.series(path, path+" : concat", path+".xDesktop : concat",  path+" : bundle");
+    }else if (path==="x_desktop") {
+        createDefaultTask(path, isMin, thisOptions);
+        createBaseWorkConcatTask(path, isMin, thisOptions);
+        return gulp.series(path, path+".base_work : concat");
     }else{
         createDefaultTask(path, isMin, thisOptions);
         return gulp.series(path);

+ 1 - 1
o2web/source/o2_core/o2/widget/Common.js

@@ -1,5 +1,5 @@
 o2.widget = o2.widget || {};
-o2.widget.css = {};
+o2.widget.css = o2.widget.css || {};
 o2.widget.Common = new Class({
 	Implements: [Options, Events],
 	options: {},

+ 3 - 1
o2web/source/x_component_Template/MSelector.js

@@ -693,4 +693,6 @@ MSelector.Tootips = new Class({
         _selector.fireEvent("postCreateItem", [ listItemNode, data ] );
         _selector._postCreateItem(listItemNode, data)
     }
-});
+});
+MWF.xApplication.Template = MWF.xApplication.Template || {};
+MWF.xApplication.Template.MSelector = MSelector;

+ 3 - 1
o2web/source/x_component_Template/MTooltips.js

@@ -903,4 +903,6 @@ var MTooltips = new Class({
     _loadCustom : function( callback ){
         if(callback)callback();
     }
-});
+});
+MWF.xApplication.Template = MWF.xApplication.Template || {};
+MWF.xApplication.Template.MTooltips = MTooltips;

+ 21 - 0
o2web/source/x_component_process_FormDesigner/Module/Documenteditor.js

@@ -109,5 +109,26 @@ MWF.xApplication.process.FormDesigner.Module.Documenteditor = MWF.FCDocumentedit
 		this._setNodeProperty();
         if (!this.form.isSubform) this._createIconAction() ;
 		this._setNodeEvent();
+	},
+	_preprocessingModuleData: function(){
+		this.node.clearStyles();
+		this.json.recoveryStyles = Object.clone(this.json.styles);
+		if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
+			if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){
+				//需要运行时处理
+			}else{
+				this.node.setStyle(key, value);
+				delete this.json.styles[key];
+			}
+		}.bind(this));
+		this.node.empty();
+		this.node.setStyles(this.css.documentEditorNode);
+
+		this.json.preprocessing = "y";
+	},
+	_recoveryModuleData: function(){
+		if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
+		this.json.recoveryStyles = null;
+		this._resetContent();
 	}
 });

+ 7 - 1
o2web/source/x_component_process_FormDesigner/Module/Documenteditor/default/css.wcss

@@ -82,6 +82,12 @@
 		"height": "100%",
 		"border": "0"
 	},
+	"documentEditorNode": {
+		"background": "#f1f1f1",
+		"border": "1px solid #cccccc",
+		"overflow": "hidden",
+		"position": "relative"
+	},
 	"doc_page": {
         "width": "15.6cm",
         "padding": "1.7cm 2.6cm 1.5cm 2.8cm",
@@ -143,4 +149,4 @@
         "line-height": "1.02cm"
     },
 	
-}
+}

+ 7 - 0
o2web/source/x_component_process_FormDesigner/Module/Documenteditor/documenteditor.html

@@ -13,6 +13,13 @@
 				<td class="editTableTitle">描述:</td>
 				<td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
 			</tr>
+			<tr>
+				<td class="editTableTitle">延时加载:</td>
+				<td class="editTableValue">
+					<input type="radio" name="isDelay" value="true" text{($.isDelay)?'checked':''}/>是
+					<input type="radio" name="isDelay" value="false" text{(!$.isDelay)?'checked':''}/>否
+				</td>
+			</tr>
 		</table>
 
 		<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable" style="display:block">

+ 12 - 0
o2web/source/x_component_process_FormDesigner/Module/Form.js

@@ -894,6 +894,18 @@ MWF.xApplication.process.FormDesigner.Module.Form = MWF.FCForm = new Class({
 		debugger;
 		var data = this._copyFormJson(this.data);
 
+		if (data.json.styleConfig && data.json.styleConfig.extendFile){
+			var stylesUrl = "../x_component_process_FormDesigner/Module/Form/skin/" + this.json.styleConfig.extendFile;
+			MWF.getJSON(stylesUrl, function (responseJSON) {
+					if (responseJSON && responseJSON.form) {
+						data.json = Object.merge(data.json, responseJSON.form);
+					}
+					if (callback) callback();
+				}.bind(this), false
+			);
+		}
+		data.json["$version"] = "5.2";
+
 		this._recoveryModuleData();
 
 		//@todo 预先整理表单样式

+ 32 - 1
o2web/source/x_component_process_FormDesigner/Module/Label.js

@@ -200,6 +200,37 @@ MWF.xApplication.process.FormDesigner.Module.Label = MWF.FCLabel = new Class({
 			this.prefixNode = null;
             this.suffixNode = null;
 		}
-	}
+	},
+    _preprocessingModuleData: function(){
+        this.node.clearStyles();
+        this.json.recoveryStyles = Object.clone(this.json.styles);
+
+        if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
+            if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){
+                //需要运行时处理
+            }else{
+                this.node.setStyle(key, value);
+                delete this.json.styles[key];
+            }
+        }.bind(this));
+
+        if (this.json.valueType==="text"){
+            if (!this.json.text){
+                if (this.textNode){
+                    this.textNode.set("text", "");
+                }else{
+                    this.node.set("text", "");
+                }
+            }
+        }else{
+            this.node.set("text", "");
+        }
+        this.json.preprocessing = "y";
+    },
+    _recoveryModuleData: function(){
+        if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
+        this.json.recoveryStyles = null;
+        this._setEditStyle_custom("text");
+    }
 
 });

+ 22 - 1
o2web/source/x_component_process_FormDesigner/Module/Log.js

@@ -80,7 +80,9 @@ MWF.xApplication.process.FormDesigner.Module.Log = MWF.FCLog = new Class({
 		this.node.addEvent("selectstart", function(){
 			return false;
 		});
-		
+		this._createIcon();
+	},
+	_createIcon: function(){
 		this.iconNode = new Element("div", {
 			"styles": this.css.iconNode
 		}).inject(this.node);
@@ -96,5 +98,24 @@ MWF.xApplication.process.FormDesigner.Module.Log = MWF.FCLog = new Class({
 		this.iconNode = this.node.getElement("div").setStyles(this.css.iconNode);
 		this.iconNode.getFirst("div").setStyles(this.css.iconNodeIcon);
 		this.iconNode.getLast("div").setStyles(this.css.iconNodeText);
+	},
+	_preprocessingModuleData: function(){
+		this.node.clearStyles();
+		this.json.recoveryStyles = Object.clone(this.json.styles);
+		if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
+			if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){
+				//需要运行时处理
+			}else{
+				this.node.setStyle(key, value);
+				delete this.json.styles[key];
+			}
+		}.bind(this));
+		this.node.empty();
+		this.json.preprocessing = "y";
+	},
+	_recoveryModuleData: function(){
+		if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
+		this.json.recoveryStyles = null;
+		this._createIcon();
 	}
 });

+ 10 - 0
o2web/source/x_component_process_FormDesigner/Module/Table$Td.js

@@ -222,11 +222,21 @@ MWF.xApplication.process.FormDesigner.Module.Table$Td = MWF.FCTable$Td = new Cla
 			}.bind(this));
 		}
 
+		if (this.table){
+			if (!(this.json.styles && this.json.styles.border) && this.table.json.styles && this.table.json.styles.border){
+				this.node.setStyle("border", this.table.json.styles.border);
+			}
+		}
 		this.json.preprocessing = "y";
 	},
 	_recoveryModuleData: function(){
 		if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
 		this.json.recoveryStyles = null;
+		if (this.table){
+			if (!(this.json.styles && this.json.styles.border) && this.table.json.styles && this.table.json.styles.border){
+				this.node.setStyle("border", "");
+			}
+		}
 	},
 
     setCustomStyles: function(){

+ 14 - 1
o2web/source/x_component_process_FormDesigner/Module/Table.js

@@ -557,7 +557,6 @@ MWF.xApplication.process.FormDesigner.Module.Table = MWF.FCTable = new Class({
 	},
 	_preprocessingModuleData: function(){
 		this.node.clearStyles();
-		//if (this.initialStyles) this.node.setStyles(this.initialStyles);
 		this.json.recoveryStyles = Object.clone(this.json.styles);
 
 		if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
@@ -573,7 +572,21 @@ MWF.xApplication.process.FormDesigner.Module.Table = MWF.FCTable = new Class({
 				}
 			}
 		}.bind(this));
+
+		if (this.json.styles && this.json.styles.border){
+			if (!this.table) this.table = this.node.getElement("table");
+			if( this.json.styles["table-layout"] ){
+				this.table.setStyle("table-layout",this.json.styles["table-layout"]);
+			}
+			this.table.setStyle("border-collapse","collapse");
+		}
 		this.json.preprocessing = "y";
+	},
+	_recoveryModuleData: function(){
+		if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
+		this.json.recoveryStyles = null;
+		if (!this.table) this.table = this.node.getElement("table");
+		this.table.setStyle("border-collapse","separate");
 	}
 	
 });

+ 1 - 0
o2web/source/x_component_process_Work/Main.js

@@ -1,3 +1,4 @@
+MWF.xApplication.process.Work.options = Object.clone(o2.xApplication.Common.options);
 MWF.xApplication.process.Work.options.multitask = true;
 MWF.xApplication.process.Work.Main = new Class({
 	Extends: MWF.xApplication.Common.Main,

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

@@ -38,6 +38,11 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
         }
     },
     load: function(){
+        if (!this.json.isDelay){
+            this.active();
+        }
+    },
+    active: function(){
         this._loadModuleEvents();
         if (this.fireEvent("queryLoad")){
             this.fireEvent("beforeLoad");
@@ -62,7 +67,6 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
             this._loadStyles();
 
             this._afterLoaded();
-
         }
     },
 

+ 7 - 4
o2web/source/x_component_process_Xform/Form.js

@@ -188,7 +188,6 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
         }
     },
     load: function (callback) {
-        debugger;
         this.checkLock();
         this.loadExtendStyle(function () {
             if (this.app) {
@@ -199,7 +198,7 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
                     }.bind(this));
                     this.app.addEvent("queryClose", function () {
                         this.beforeCloseWork();
-                    }.bind(this))
+                    }.bind(this));
                 }
             }
             if (!this.businessData.control.allowSave) this.setOptions({ "readonly": true });
@@ -219,13 +218,13 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
                 this.fireEvent("queryLoad");
                 if (this.event_resolve){
                     this.event_resolve(function(){
-                        this.loadForm(callback)
+                        this.loadForm(callback);
                     }.bind(this));
                 }else{
                     this.loadForm(callback);
                 }
             }.bind(this));
-        }.bind(this))
+        }.bind(this));
     },
     loadForm: function(callback){
         if (this.lockDataPerson){
@@ -246,6 +245,10 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
             if (callback) callback();
             return;
         }
+        if (this.json["$version"]=="5.2"){
+            if (callback) callback();
+            return;
+        }
         var stylesUrl = "../x_component_process_FormDesigner/Module/Form/skin/" + this.json.styleConfig.extendFile;
         MWF.getJSON(stylesUrl, {
                 "onSuccess": function (responseJSON) {

+ 1 - 1
o2web/source/x_component_process_Xform/Table.js

@@ -77,7 +77,7 @@ MWF.xApplication.process.Xform.Table = MWF.APPTable =  new Class({
                 this.node.setStyle(key, value);
             }
         }.bind(this));
-        this._loadBorderStyle();
+        if (this.form.json["$version"]!=="5.2") this._loadBorderStyle();
     }
 });
 MWF.xApplication.process.Xform.Table$Td = MWF.APPTable$Td =  new Class({

Разница между файлами не показана из-за своего большого размера
+ 5 - 0
o2web/source/x_desktop/js/base_work_begin.js


+ 10 - 0
o2web/source/x_desktop/js/base_work_end.js

@@ -0,0 +1,10 @@
+o2.xDesktop.$all=true;
+o2.xDesktop.Common=true;
+MWF.xApplication.Selector.package = MWF.O2Selector;
+
+layout.addReady(function(){
+    MWF.Actions.actions["x_organization_assemble_authentication"] = new MWF.xAction.RestActions.Action["x_organization_assemble_authentication"]("x_organization_assemble_authentication", orgActins);
+    MWF.Actions.actions["x_processplatform_assemble_surface"] = new MWF.xAction.RestActions.Action["x_processplatform_assemble_surface"]("x_processplatform_assemble_surface", processActins);
+    MWF.Actions.actions["x_cms_assemble_control"] = new MWF.xAction.RestActions.Action["x_cms_assemble_control"]("x_cms_assemble_control", cmsActins);
+});
+

+ 5 - 8
o2web/source/x_desktop/work.html

@@ -2,14 +2,7 @@
 <html lang="zh-CN">
     <head>
         <meta http-equiv="X-UA-Compatible" content="IE=edge" />
-        <link rel="stylesheet" type="text/css" href="css/style.css" charset="UTF-8" />
-        <link rel="stylesheet" href="css/mBoxNotice.css" charset="UTF-8" />
-        <link rel="stylesheet" href="css/mBoxTooltip.css" charset="UTF-8" />
-
-        <script src="../o2_core/o2.min.js"></script>
-        <script src="../o2_lib/Decimal.js"></script>
-        <script src="js/base.min.js"></script>
-        <script src="js/work.min.js"></script>
+        <link rel="stylesheet" type="text/css" href="css/style_all.css" charset="UTF-8" />
 
         <title>WORK</title>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -18,5 +11,9 @@
         <div id="layout" style="overflow: auto; height:100%">
             <div id="loaddingArea" style="overflow: hidden;width:0px; height:2px; background-color:#4e82bd; position: absolute; top: 0; z-index: 100"></div>
         </div>
+
+        <script src="../o2_core/o2.min.js"></script>
+        <script src="js/base_work.min.js"></script>
+        <script src="js/work.min.js"></script>
     </body>
 </html>

Некоторые файлы не были показаны из-за большого количества измененных файлов