Bladeren bron

Merge branch 'feature/JSDoc' into 'wrdp'

Merge of feature/JSDoc 先提交一部分jsdoc相关的内容,避免后面有冲突 to wrdp

See merge request o2oa/o2oa!2472
蔡祥熠 5 jaren geleden
bovenliggende
commit
e288fc9d60

+ 45 - 0
o2web/jsdoc.conf.json

@@ -0,0 +1,45 @@
+{
+    "opts": {
+        "encoding": "utf8",               // same as -e utf8
+        "destination": "./o2web/jsdoc/",          // same as -d ./out/
+        "recurse": true,                  // same as -r
+        "template" : "./node_modules/ink-docstrap/template"
+        //"template": "templates/default"  // same as -t templates/default
+        //        "tutorials": "path/to/tutorials" // same as -u path/to/tutorials
+    },
+
+    "tags": {
+        "allowUnknownTags": true
+    },
+    "source": {
+        "include": ["./o2web/source/x_component_process_Xform"],
+        "includePattern": ".+\\.js(doc|x)?$",
+        "excludePattern": "(^|\\/|\\\\)_"
+    },
+    "plugins": [
+        "plugins/markdown",
+        "plugins/summarize"
+    ],
+    "templates": {
+        "cleverLinks": false,
+        "monospaceLinks": false,
+        "dateFormat": "YYYY-MM-dd",
+        "outputSourceFiles": true,
+        "outputSourcePath": true,
+        "systemName": "O2前台组件API",
+        "footer": "",
+        "copyright": "o2 group",
+        "navType": "vertical",
+        "theme": "cosmo", //readable lumen cosmo
+        "linenums": true,
+        "collapseSymbols": false,
+        "inverseNav": true,
+        "protocol": "html://",
+        "methodHeadingReturns": false
+    },
+    "markdown": {
+        "parser": "gfm",
+        "hardwrap": true
+    }
+}
+//执行命令: jsdoc -c ./o2web/jsdoc.conf.json

+ 9 - 6
o2web/source/x_component_process_Xform/$Input.js

@@ -1,10 +1,13 @@
 MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
-/** Class Input组件 */
-MWF.xApplication.process.Xform.$Input = MWF.APP$Input =  new Class({
+/** @class $Input 组件类,此类为所有输入组件的父类
+* @extends MWF.xApplication.process.Xform.$Module
+*/
+MWF.xApplication.process.Xform.$Input = MWF.APP$Input =  new Class(
+    /** @lends MWF.xApplication.process.Xform.$Input# */
+    {
 	Implements: [Events],
 	Extends: MWF.APP$Module,
 	iconStyle: "personfieldIcon",
-
     initialize: function(node, json, form, options){
         this.node = $(node);
         this.node.store("module", this);
@@ -285,14 +288,14 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input =  new Class({
         }
     },
     /**
-     * 重置组件的值,如果设置了默认值,则设置为默认值,否则置空。
+     * 重置组件的值为默认值或置空。
      */
     resetData: function(){
         this.setData(this.getValue());
     },
     /**
      * 为控件赋值。
-     *  @param {string/number/jsonObject} .
+     *  @param data{string/number/jsonObject/array} .
      */
 	setData: function(data){
         // if (data && data.isAG){
@@ -526,7 +529,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input =  new Class({
     },
     /**
      * 根据组件的校验设置进行校验。
-     *  @param {string} routeName-路由名称.
+     *  @param {string} routeName - 可选,路由名称.
      *  @return {boolean} 是否通过校验
      */
     validation: function(routeName, opinion){

+ 13 - 2
o2web/source/x_component_process_Xform/$Module.js

@@ -1,16 +1,27 @@
 
 MWF.require("MWF.widget.Common", null, false);
-MWF.xApplication.process.Xform.$Module = MWF.APP$Module =  new Class({
+/** @class $Module 组件类,此类为所有组件的父类。 */
+MWF.xApplication.process.Xform.$Module = MWF.APP$Module =  new Class(
+    /** @lends MWF.xApplication.process.Xform.$Module# */
+    {
     Implements: [Events],
     options: {
         "moduleEvents": ["load", "queryLoad", "postLoad"]
     },
 
     initialize: function(node, json, form, options){
-
+        /**
+         * 组件的节点
+         * {@link https://mootools.net/core/docs/1.6.0/Element/Element MootoolsElement }
+         * @member {Element}
+         */
         this.node = $(node);
         this.node.store("module", this);
         this.json = json;
+        /**
+         * 组件的所在表单对象.
+         * @member {MWF.xApplication.process.Xform.Form}
+         */
         this.form = form;
     },
     _getSource: function(){

+ 2 - 2
o2web/source/x_component_process_Xform/DatagridMobile.js

@@ -1393,7 +1393,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
                     var moduleTd = td.retrieve("module");
                     if (moduleTd){
                         this.form.modules.erase(moduleTd);
-                        delete moduleTd;
+                        moduleTd = null;
                     }
                 }
                 var ths = table.getElements("th");
@@ -1402,7 +1402,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
                     var moduleTh = th.retrieve("module");
                     if (moduleTh){
                         this.form.modules.erase(moduleTh);
-                        delete moduleTh;
+                        moduleTh = null;
                     }
                 }
             }

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

@@ -1156,7 +1156,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
 					var module = td.retrieve("module");
 					if (module){
 						this.form.modules.erase(module);
-						delete module;
+						module = null;
 					}
 				}
 			}

+ 3 - 0
o2web/source/x_component_process_Xform/Textfield.js

@@ -1,4 +1,7 @@
 MWF.xDesktop.requireApp("process.Xform", "$Input", null, false);
+/** @class Textfield 文本输入框类。
+ * @extends MWF.xApplication.process.Xform.$Input
+ */
 MWF.xApplication.process.Xform.Textfield = MWF.APPTextfield =  new Class({
 	Implements: [Events],
 	Extends: MWF.APP$Input,

+ 1 - 0
package.json

@@ -67,6 +67,7 @@
                 "gulp-tm-uglify": "3.0.1",
                 "gulp-uglify-es": "^2.0.0",
                 "gulp-util": "^3.0.8",
+                "ink-docstrap": "^1.3.2",
                 "minimist": "^1.2.0",
                 "progress-stream": "^2.0.0",
                 "request": "^2.88.2",