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

Merge branch 'wrdp' into 'develop'

Wrdp

See merge request o2oa/o2oa!1922
胡起 5 лет назад
Родитель
Сommit
5705cebe17

+ 14 - 6
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/regist/ActionCreate.java

@@ -8,6 +8,7 @@ import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.entity.annotation.CheckPersistType;
 import com.x.base.core.entity.type.GenderType;
+import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.base.core.project.config.Config;
 import com.x.base.core.project.gson.GsonPropertyObject;
 import com.x.base.core.project.http.ActionResult;
@@ -94,18 +95,25 @@ class ActionCreate extends BaseAction {
 
 	public static class Wi extends GsonPropertyObject {
 
+		@FieldDescribe("用户名称.")
 		private String name;
-
+		
+		@FieldDescribe("性别.男:m,女:f,未知:d")
 		private GenderType genderType;
-
+		
+		@FieldDescribe("密码.")
 		private String password;
-
+		
+		@FieldDescribe("必填,手机号.")
 		private String mobile;
-
+		
+		@FieldDescribe("手机认证码")
 		private String codeAnswer;
-
+		
+		@FieldDescribe("图片认证码")
 		private String captchaAnswer;
-
+		
+		@FieldDescribe("图片认证编号")
 		private String captcha;
 
 		public String getName() {

+ 46 - 22
o2web/source/x_component_process_Xform/Documenteditor.js

@@ -2894,7 +2894,30 @@ debugger;
         }
         return node;
     },
-
+    getDocumentHtml: function(){
+        var tmpNode = this.contentNode.getFirst().getFirst().clone(true);
+        var htmlNode = tmpNode.getLast();
+        htmlNode = this.removeDisplayNone(htmlNode);
+        var nodes = tmpNode.querySelectorAll("[data-w-style]");
+        if (nodes.length){
+            for (var i=0; i<nodes.length; i++){
+                var n = nodes.item(i);
+                wStyle = n.dataset["wStyle"];
+                var styles = wStyle.split(/\s*\;\s*/g);
+                styles.each(function(style){
+                    if (style){
+                        try{
+                            s = style.split(/\s*\:\s*/g);
+                            n.setStyle(s[0], s[1]);
+                        }catch(e) {}
+                    }
+                });
+            }
+        }
+        var htmlStr = tmpNode.get("html");
+        tmpNode.destroy();
+        return "<html xmlns:v=\"urn:schemas-microsoft-com:vml\"><head><meta charset=\"UTF-8\" /></head><body>"+htmlStr+"</body></html>";
+    },
     toWord: function(callback, name){
         debugger;
         var docNmae = name || "";
@@ -2922,26 +2945,27 @@ debugger;
             });
 
             //var content = this.contentNode.getFirst().getFirst().get("html");
-            var tmpNode = this.contentNode.getFirst().getFirst().clone(true);
-            var htmlNode = tmpNode.getLast();
-            htmlNode = this.removeDisplayNone(htmlNode);
-            var nodes = tmpNode.querySelectorAll("[data-w-style]");
-            if (nodes.length){
-                for (var i=0; i<nodes.length; i++){
-                    var n = nodes.item(i);
-                    wStyle = n.dataset["wStyle"];
-                    var styles = wStyle.split(/\s*\;\s*/g);
-                    styles.each(function(style){
-                        if (style){
-                            try{
-                                s = style.split(/\s*\:\s*/g);
-                                n.setStyle(s[0], s[1]);
-                            }catch(e) {}
-                        }
-                    });
-                }
-            }
-            var content = "<html xmlns:v=\"urn:schemas-microsoft-com:vml\"><head><meta charset=\"UTF-8\" /></head><body>"+tmpNode.get("html")+"</body></html>";
+            // var tmpNode = this.contentNode.getFirst().getFirst().clone(true);
+            // var htmlNode = tmpNode.getLast();
+            // htmlNode = this.removeDisplayNone(htmlNode);
+            // var nodes = tmpNode.querySelectorAll("[data-w-style]");
+            // if (nodes.length){
+            //     for (var i=0; i<nodes.length; i++){
+            //         var n = nodes.item(i);
+            //         wStyle = n.dataset["wStyle"];
+            //         var styles = wStyle.split(/\s*\;\s*/g);
+            //         styles.each(function(style){
+            //             if (style){
+            //                 try{
+            //                     s = style.split(/\s*\:\s*/g);
+            //                     n.setStyle(s[0], s[1]);
+            //                 }catch(e) {}
+            //             }
+            //         });
+            //     }
+            // }
+            var content = this.getDocumentHtml();
+            //var content = "<html xmlns:v=\"urn:schemas-microsoft-com:vml\"><head><meta charset=\"UTF-8\" /></head><body>"+tmpNode.get("html")+"</body></html>";
 
             var fileName = docNmae || this.json.toWordFilename || "$doc";
             var n = fileName.lastIndexOf(".");
@@ -2966,7 +2990,7 @@ debugger;
                     }.bind(this));
                 }
             }.bind(this));
-            tmpNode.destroy();
+            //tmpNode.destroy();
 
             if (!toEdit){
                 this._readFiletext();