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

Merge branch 'fix/Process.org_null_value' into 'wrdp'

Merge of fix/Process.org_null_value 修复Org组件返回空值出错的问题 to wrdp

See merge request o2oa/o2oa!2433
蔡祥熠 5 лет назад
Родитель
Сommit
a5fa496d83

+ 5 - 0
o2web/source/x_component_Selector/Person.js

@@ -84,6 +84,11 @@ MWF.xApplication.Selector.Person = new Class({
 
 
         this.subCategorys = []; //直接的分类
         this.subCategorys = []; //直接的分类
         this.subItems = []; //直接的选择项
         this.subItems = []; //直接的选择项
+
+        if( !this.options.values ){
+            this.options.values = [];
+        }
+
         this._init();
         this._init();
     },
     },
     _init : function(){
     _init : function(){

+ 4 - 4
o2web/source/x_component_process_Work/Processor.js

@@ -2051,7 +2051,7 @@ if (MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form) {
                 if (this.ignoreOldData) {
                 if (this.ignoreOldData) {
                     identityOpt.values = this._computeValue() || [];
                     identityOpt.values = this._computeValue() || [];
                 } else {
                 } else {
-                    identityOpt.values = this.getValue();
+                    identityOpt.values = this.getValue() || [];
                 }
                 }
                 identityOpt.exclude = exclude;
                 identityOpt.exclude = exclude;
             }
             }
@@ -2069,7 +2069,7 @@ if (MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form) {
                 if (this.ignoreOldData) {
                 if (this.ignoreOldData) {
                     unitOpt.values = this._computeValue() || [];
                     unitOpt.values = this._computeValue() || [];
                 } else {
                 } else {
-                    unitOpt.values = this.getValue();
+                    unitOpt.values = this.getValue() || [];
                 }
                 }
                 unitOpt.exclude = exclude;
                 unitOpt.exclude = exclude;
             }
             }
@@ -2355,7 +2355,7 @@ if (MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form) {
         resetSelectorData: function () {
         resetSelectorData: function () {
             if (this.selector && this.selector.selector) {
             if (this.selector && this.selector.selector) {
                 this.selector.selector.emptySelectedItems();
                 this.selector.selector.emptySelectedItems();
-                this.selector.selector.options.values = this.getValue();
+                this.selector.selector.options.values = this.getValue() || [];
                 this.selector.selector.setSelectedItem();
                 this.selector.selector.setSelectedItem();
             }
             }
         },
         },
@@ -2364,7 +2364,7 @@ if (MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form) {
             this.setData(v || "");
             this.setData(v || "");
         },
         },
         resetData: function () {
         resetData: function () {
-            var v = this.getValue();
+            var v = this.getValue() || [];
             //this.setData((v) ? v.join(", ") : "");
             //this.setData((v) ? v.join(", ") : "");
             this.setData(v);
             this.setData(v);
         },
         },

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

@@ -276,7 +276,7 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
 
 
         if( this.selectTypeList.length === 0 )return false;
         if( this.selectTypeList.length === 0 )return false;
 
 
-        var values = this.getInputData();
+        var values = this.getInputData() || [];
 
 
         var exclude = [];
         var exclude = [];
         if( this.json.exclude ){
         if( this.json.exclude ){