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

Merge branch 'feature/OrgSelector.add_simple_restore_setting' into 'develop'

Merge of feature/【流程管理】内容管理、流程管理人员相关选择组件增加保存精简数据的配置 to develop

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

+ 18 - 2
o2web/source/o2_core/o2/widget/O2Identity.js

@@ -1,5 +1,6 @@
 o2.widget = o2.widget || {};
 o2.require("o2.widget.Common", null, false);
+o2.require("o2.xDesktop.Common", null, false);
 o2.require("o2.xDesktop.Actions.RestActions", null, false);
 o2.widget.O2Identity = new Class({
 	Implements: [Options, Events],
@@ -11,6 +12,7 @@ o2.widget.O2Identity = new Class({
         "disableInfor" : false
 	},
 	initialize: function(data, container, options){
+	    debugger;
 		this.setOptions(options);
 		this.loadedInfor = false;
 
@@ -30,7 +32,21 @@ o2.widget.O2Identity = new Class({
         //o2.widget.O2Identity.iditems.push(this);
 	},
     setText: function(){
-        this.node.set("text", this.data.displayName || (this.data.name+"("+this.data.unitName+")"));
+	    var disply;
+	    if( this.data.displayName ){
+            disply = this.data.displayName;
+        }else{
+	        var name = this.data.name || o2.name.cn(this.data.distinguishedName);
+	        var unit;
+            if(this.data.unitName){
+                unit = this.data.unitName;
+            }else if( this.data.unitLevelName ){
+                var list = this.data.unitLevelName.split("/");
+                unit = list[ list.length - 1 ];
+            }
+            disply = name + (unit ? "("+unit+")" : "")
+        }
+        this.node.set("text", this.data.displayName || disply );
     },
     load: function(){
         var style = ( layout.mobile && this.style.identityNode_mobile ) ?
@@ -228,7 +244,7 @@ o2.widget.O2Person = new Class({
 o2.widget.O2Unit = new Class({
     Extends: o2.widget.O2Identity,
     getPersonData: function(){
-        if (!this.data.distinguishedName){
+        if (!this.data.distinguishedName || !this.data.levelName){
             this.action.actions = {"getUnit": {"uri": "/jaxrs/unit/{id}"}};
             this.action.invoke({"name": "getUnit", "async": false, "parameter": {"id": (this.data.id || this.data.name)}, "success": function(json){
                 this.data = json.data;

+ 113 - 57
o2web/source/o2_core/o2/xDesktop/Common.js

@@ -574,27 +574,27 @@ MWF.xDesktop.removeEvents = function(name, type){
 };
 
 MWF.org = {
-    parseOrgData: function(data, flat){
+    parseOrgData: function(data, flat, simple){
         if (data.distinguishedName){
             var flag = data.distinguishedName.substr(data.distinguishedName.length-2, 2);
             switch (flag.toLowerCase()){
                 case "@i":
-                    return this.parseIdentityData(data, flat);
+                    return this.parseIdentityData(data, flat, simple);
                     break;
                 case "@p":
-                    return this.parsePersonData(data, flat);
+                    return this.parsePersonData(data, simple);
                     break;
                 case "@u":
-                    return this.parseUnitData(data, flat);
+                    return this.parseUnitData(data, simple);
                     break;
                 case "@g":
-                    return this.parseGroupData(data, flat);
+                    return this.parseGroupData(data, simple);
                     break;
                 case "@r":
-                    return this.parseRoleData(data, flat);
+                    return this.parseRoleData(data, simple);
                     break;
                 case "@a":
-                    return this.parseAttributeData(data, flat);
+                    return this.parseAttributeData(data, simple);
                     break;
                 default:
                     return data;
@@ -603,7 +603,19 @@ MWF.org = {
             return data;
         }
     },
-    parseIdentityData: function(data, flat){
+    parseIdentityData: function(data, flat, simple){
+        if( simple ){
+            var data = {
+                "id": data.id,
+                "name": data.name,
+                "distinguishedName": data.distinguishedName,
+                "unitLevelName" : data.unitLevelName,
+                "person": data.person
+            };
+            if( data.ignoreEmpower )rData.ignoreEmpower = true;
+            if( data.ignoredEmpower )rData.ignoredEmpower = true;
+            return data;
+        }
         var rData = {
             "id": data.id,
             "name": data.name,
@@ -664,63 +676,107 @@ MWF.org = {
         }
         return rData;
     },
-    parsePersonData: function(data){
-        return {
-            "id": data.id,
-            "genderType": data.genderType,
-            "name": data.name,
-            "employee": data.employee,
-            "unique": data.unique,
-            "distinguishedName": data.distinguishedName,
-            "dn": data.distinguishedName,
-            "mail": data.mail,
-            "weixin": data.weixin,
-            "qq": data.qq,
-            "mobile": data.mobile,
-            "officePhone": data.officePhone
+    parsePersonData: function(data, simple){
+        if( simple ){
+            return {
+                "id": data.id,
+                "name": data.name,
+                "employee": data.employee,
+                "distinguishedName": data.distinguishedName,
+            }
+        }else{
+            return {
+                "id": data.id,
+                "genderType": data.genderType,
+                "name": data.name,
+                "employee": data.employee,
+                "unique": data.unique,
+                "distinguishedName": data.distinguishedName,
+                "dn": data.distinguishedName,
+                "mail": data.mail,
+                "weixin": data.weixin,
+                "qq": data.qq,
+                "mobile": data.mobile,
+                "officePhone": data.officePhone
+            }
         }
     },
-    parseUnitData: function(data){
-        return {
-            "id": data.id,
-            "name": data.name,
-            "unique": data.unique,
-            "distinguishedName": data.distinguishedName,
-            "dn": data.distinguishedName,
-            "typeList":data.typeList,
-            "shortName": data.shortName,
-            "level": data.level,
-            "levelName": data.levelName
+    parseUnitData: function(data, simple){
+        if( simple ){
+            return {
+                "id": data.id,
+                "name": data.name,
+                "distinguishedName": data.distinguishedName,
+                "levelName": data.levelName
+            }
+        }else{
+            return {
+                "id": data.id,
+                "name": data.name,
+                "unique": data.unique,
+                "distinguishedName": data.distinguishedName,
+                "dn": data.distinguishedName,
+                "typeList":data.typeList,
+                "shortName": data.shortName,
+                "level": data.level,
+                "levelName": data.levelName
+            }
         }
     },
-    parseGroupData: function(data){
-        return {
-            "id": data.id,
-            "name": data.name,
-            "unique": data.unique,
-            "distinguishedName": data.distinguishedName,
-            "dn": data.distinguishedName
+    parseGroupData: function(data, simple){
+        if( simple ){
+            return {
+                "id": data.id,
+                "name": data.name,
+                "distinguishedName": data.distinguishedName
+            }
+        }else{
+            return {
+                "id": data.id,
+                "name": data.name,
+                "unique": data.unique,
+                "distinguishedName": data.distinguishedName,
+                "dn": data.distinguishedName
+            }
         }
     },
-    parseRoleData: function(data){
-        return {
-            "id": data.id,
-            "name": data.name,
-            "unique": data.unique,
-            "distinguishedName": data.distinguishedName,
-            "dn": data.distinguishedName
+    parseRoleData: function(data, simple){
+        if( simple ){
+            return {
+                "id": data.id,
+                "name": data.name,
+                "distinguishedName": data.distinguishedName
+            }
+        }else{
+            return {
+                "id": data.id,
+                "name": data.name,
+                "unique": data.unique,
+                "distinguishedName": data.distinguishedName,
+                "dn": data.distinguishedName
+            }
         }
     },
-    parseAttributeData: function(){
-        return {
-            "id": data.id,
-            "description": data.description,
-            "name": data.name,
-            "unique": data.unique,
-            "distinguishedName": data.distinguishedName,
-            "dn": data.distinguishedName,
-            "person": data.person,
-            "attributeList": Array.clone(data.attributeList)
+    parseAttributeData: function(data, simple){
+        if(simple){
+            return {
+                "id": data.id,
+                "name": data.name,
+                "distinguishedName": data.distinguishedName,
+                "person": data.person,
+                "attributeList": Array.clone(data.attributeList)
+            }
+        }else{
+            return {
+                "id": data.id,
+                "description": data.description,
+                "name": data.name,
+                "unique": data.unique,
+                "distinguishedName": data.distinguishedName,
+                "dn": data.distinguishedName,
+                "person": data.person,
+                "attributeList": Array.clone(data.attributeList)
+            }
         }
     }
 };

+ 13 - 0
o2web/source/x_component_cms_FormDesigner/Module/Authorfield/authorfield.html

@@ -183,6 +183,19 @@
             <div style="height: 24px; line-height:24px; background-color: #EEE; padding: 0px 6px; border-top: 1px solid #999">通过编写脚本排除组织、身份、个人和群组的选择范围</div>
             <div class="MWFFormulaArea" name="exclude" title="脚本 (S)"></div>
         </div>
+
+        <div>
+            <div style="text-align: center; height: 24px; background-color: #F1F1F1; line-height: 24px; border-bottom: 1px solid #cccccc; border-top: 1px solid #cccccc;font-weight: bold;">数据保存</div>
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">数据保存:</td>
+                    <td class="editTableValue">
+                        <input type="radio" name="storeRange" value="full" text{($.section!='simple')?'checked':''}/>完整
+                        <input type="radio" name="storeRange" value="simple" text{($.section=='simple')?'checked':''}/>精简
+                    </td>
+                </tr>
+            </table>
+        </div>
     </div>
     <!--<div title="区段" class="MWFTab">-->
         <!--<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">-->

+ 13 - 0
o2web/source/x_component_cms_FormDesigner/Module/Org/org.html

@@ -417,6 +417,19 @@
             <div style="height: 24px; line-height:24px; background-color: #EEE; padding: 0px 6px; border-top: 1px solid #999">通过编写脚本排除组织、身份、个人和群组的选择范围</div>
             <div class="MWFFormulaArea" name="exclude" title="脚本 (S)"></div>
         </div>
+
+        <div>
+            <div style="text-align: center; height: 24px; background-color: #F1F1F1; line-height: 24px; border-bottom: 1px solid #cccccc; border-top: 1px solid #cccccc;font-weight: bold;">数据保存</div>
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">数据保存:</td>
+                    <td class="editTableValue">
+                        <input type="radio" name="storeRange" value="full" text{($.section!='simple')?'checked':''}/>完整
+                        <input type="radio" name="storeRange" value="simple" text{($.section=='simple')?'checked':''}/>精简
+                    </td>
+                </tr>
+            </table>
+        </div>
     </div>
     <div title="事件"  class="MWFTab">
         <div class="MWFEventsArea" name="events"></div>

+ 13 - 0
o2web/source/x_component_cms_FormDesigner/Module/Personfield/personfield.html

@@ -213,6 +213,19 @@
             <div style="height: 24px; line-height:24px; background-color: #EEE; padding: 0px 6px; border-top: 1px solid #999">通过编写脚本排除组织或个人的选择范围</div>
             <div class="MWFFormulaArea" name="exclude" title="脚本 (S)"></div>
         </div>
+
+        <div>
+            <div style="text-align: center; height: 24px; background-color: #F1F1F1; line-height: 24px; border-bottom: 1px solid #cccccc; border-top: 1px solid #cccccc;font-weight: bold;">数据保存</div>
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">数据保存:</td>
+                    <td class="editTableValue">
+                        <input type="radio" name="storeRange" value="full" text{($.section!='simple')?'checked':''}/>完整
+                        <input type="radio" name="storeRange" value="simple" text{($.section=='simple')?'checked':''}/>精简
+                    </td>
+                </tr>
+            </table>
+        </div>
     </div>
     <!--<div title="区段" class="MWFTab">-->
     <!--<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">-->

+ 13 - 0
o2web/source/x_component_cms_FormDesigner/Module/Readerfield/readerfield.html

@@ -165,6 +165,19 @@
             <div style="height: 24px; line-height:24px; background-color: #EEE; padding: 0px 6px; border-top: 1px solid #999">通过编写脚本指定组织的选择范围</div>
             <div class="MWFScriptArea" name="rangeKey" title="脚本 (S)"></div>
         </div>
+
+        <div>
+            <div style="text-align: center; height: 24px; background-color: #F1F1F1; line-height: 24px; border-bottom: 1px solid #cccccc; border-top: 1px solid #cccccc;font-weight: bold;">数据保存</div>
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">数据保存:</td>
+                    <td class="editTableValue">
+                        <input type="radio" name="storeRange" value="full" text{($.section!='simple')?'checked':''}/>完整
+                        <input type="radio" name="storeRange" value="simple" text{($.section=='simple')?'checked':''}/>精简
+                    </td>
+                </tr>
+            </table>
+        </div>
     </div>
     <!--<div title="区段" class="MWFTab">-->
         <!--<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">-->

+ 4 - 1
o2web/source/x_component_cms_Xform/Personfield.js

@@ -78,6 +78,9 @@ MWF.xApplication.cms.Xform.Personfield = MWF.CMSPersonfield =  new Class({
 			var v = this.form.Macro.exec(this.json.exclude.code, this);
 			exclude = typeOf(v)==="array" ? v : [v];
 		}
+
+		var simple = this.json.storeRange === "simple";
+
 		var options = {
 			"type": this.json.selectType,
 			"unitType": (this.json.selectUnitType==="all") ? "" : this.json.selectUnitType,
@@ -90,7 +93,7 @@ MWF.xApplication.cms.Xform.Personfield = MWF.CMSPersonfield =  new Class({
 			"onComplete": function(items){
 				var values = [];
 				items.each(function(item){
-					values.push(MWF.org.parseOrgData(item.data, true));
+					values.push(MWF.org.parseOrgData(item.data, true, simple));
 				}.bind(this));
 				if (this.json.isInput){
                     this.addData(values);

+ 4 - 1
o2web/source/x_component_cms_Xform/Readerfield.js

@@ -549,6 +549,9 @@ MWF.xApplication.cms.Xform.Readerfield = MWF.CMSReaderfield =  new Class({
             var v = this.form.Macro.exec(this.json.exclude.code, this);
             exclude = typeOf(v)==="array" ? v : [v];
         }
+
+        var simple = this.json.storeRange === "simple";
+
 		var options = {
 			"type" : "",
 			"types": selectType,
@@ -562,7 +565,7 @@ MWF.xApplication.cms.Xform.Readerfield = MWF.CMSReaderfield =  new Class({
 			"onComplete": function(items, itemsObject){
 				var values = [];
 				items.each( function(it){
-					values.push(MWF.org.parseOrgData(it.data, true));
+					values.push(MWF.org.parseOrgData(it.data, true, simple));
 				});
 				if (this.json.isInput){
                     this.addData(values);

+ 12 - 0
o2web/source/x_component_process_FormDesigner/Module/Org/org.html

@@ -441,6 +441,18 @@
             <div style="height: 24px; line-height:24px; background-color: #EEE; padding: 0px 6px; border-top: 1px solid #999">通过编写脚本排除组织、身份、个人和群组的选择范围</div>
             <div class="MWFFormulaArea" name="exclude" title="脚本 (S)"></div>
         </div>
+        <div>
+            <div style="text-align: center; height: 24px; background-color: #F1F1F1; line-height: 24px; border-bottom: 1px solid #cccccc; border-top: 1px solid #cccccc;font-weight: bold;">数据保存</div>
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">数据保存:</td>
+                    <td class="editTableValue">
+                        <input type="radio" name="storeRange" value="full" text{($.section!='simple')?'checked':''}/>完整
+                        <input type="radio" name="storeRange" value="simple" text{($.section=='simple')?'checked':''}/>精简
+                    </td>
+                </tr>
+            </table>
+        </div>
     </div>
     <div title="事件"  class="MWFTab">
         <div class="MWFEventsArea" name="events"></div>

+ 13 - 0
o2web/source/x_component_process_FormDesigner/Module/Orgfield/orgfield.html

@@ -176,6 +176,19 @@
             <div style="height: 24px; line-height:24px; background-color: #EEE; padding: 0px 6px; border-top: 1px solid #999">通过编写脚本排除组织、身份、个人和群组的选择范围</div>
             <div class="MWFFormulaArea" name="exclude" title="脚本 (S)"></div>
         </div>
+
+        <div>
+            <div style="text-align: center; height: 24px; background-color: #F1F1F1; line-height: 24px; border-bottom: 1px solid #cccccc; border-top: 1px solid #cccccc;font-weight: bold;">数据保存</div>
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">数据保存:</td>
+                    <td class="editTableValue">
+                        <input type="radio" name="storeRange" value="full" text{($.section!='simple')?'checked':''}/>完整
+                        <input type="radio" name="storeRange" value="simple" text{($.section=='simple')?'checked':''}/>精简
+                    </td>
+                </tr>
+            </table>
+        </div>
     </div>
     <!--<div title="区段" class="MWFTab">-->
     <!--<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">-->

+ 13 - 0
o2web/source/x_component_process_FormDesigner/Module/Personfield/personfield.html

@@ -219,6 +219,19 @@
             <div class="MWFFormulaArea" name="exclude" title="脚本 (S)"></div>
         </div>
 
+        <div>
+            <div style="text-align: center; height: 24px; background-color: #F1F1F1; line-height: 24px; border-bottom: 1px solid #cccccc; border-top: 1px solid #cccccc;font-weight: bold;">数据保存</div>
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">数据保存:</td>
+                    <td class="editTableValue">
+                        <input type="radio" name="storeRange" value="full" text{($.section!='simple')?'checked':''}/>完整
+                        <input type="radio" name="storeRange" value="simple" text{($.section=='simple')?'checked':''}/>精简
+                    </td>
+                </tr>
+            </table>
+        </div>
+
     </div>
     <div title="区段" class="MWFTab">
         <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">

+ 13 - 0
o2web/source/x_component_process_ProcessDesigner/widget/$OrgEditor/org.html

@@ -358,6 +358,19 @@
             <div style="height: 24px; line-height:24px; background-color: #EEE; padding: 0px 6px; border-top: 1px solid #999">通过编写脚本排除组织、身份的选择范围</div>
             <div class="MWFFormulaArea" name="exclude" title="脚本 (S)"></div>
         </div>
+
+        <div>
+            <div style="text-align: center; height: 24px; background-color: #F1F1F1; line-height: 24px; border-bottom: 1px solid #cccccc; border-top: 1px solid #cccccc;font-weight: bold;">数据保存</div>
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">数据保存:</td>
+                    <td class="editTableValue">
+                        <input type="radio" name="storeRange" value="full" text{($.section!='simple')?'checked':''}/>完整
+                        <input type="radio" name="storeRange" value="simple" text{($.section=='simple')?'checked':''}/>精简
+                    </td>
+                </tr>
+            </table>
+        </div>
     </div>
     <div title="事件"  class="MWFTab">
         <div class="MWFEventsArea" name="events"></div>

+ 14 - 7
o2web/source/x_component_process_Work/Processor.js

@@ -1890,10 +1890,13 @@ if( MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form ){
             items.each(function(item){
                 array.push(item.data);
             }.bind(this));
+
+            var simple = this.json.storeRange === "simple";
+
             this.checkEmpower( array, function( data ){
                 var values = [];
                 data.each(function(d){
-                    values.push(MWF.org.parseOrgData(d, true));
+                    values.push(MWF.org.parseOrgData(d, true, simple));
                 }.bind(this));
 
                 this.setData(values);
@@ -1983,11 +1986,12 @@ if( MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form ){
         },
         saveCheckedEmpowerData:function( callback ){
             var data = this.getData();
+            var simple = this.json.storeRange === "simple";
             //this.empowerChecker.replaceEmpowerIdentity(data, function( newData ){
             this.empowerChecker.setIgnoreEmpowerFlag(data, function( newData ){
                 var values = [];
                 newData.each(function(d){
-                    values.push(MWF.org.parseOrgData(d, true));
+                    values.push(MWF.org.parseOrgData(d, true, simple));
                 }.bind(this));
                 this.setData( values );
                 if( callback )callback(values)
@@ -2065,10 +2069,11 @@ if( MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form ){
             if( layout.mobile ){
                 return this.getValue();
             }else{
+                var simple = this.json.storeRange === "simple";
                 var data = [];
                 if( this.selector && this.selector.selector){
                     this.selector.selector.selectedItems.each( function( item ){
-                        data.push( MWF.org.parseOrgData(item.data, true) );
+                        data.push( MWF.org.parseOrgData(item.data, true, simple) );
                     })
                 }
                 return data;
@@ -2134,16 +2139,18 @@ if( MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form ){
             var oldValues = this.getValue();
             var values = [];
 
+            var simple = this.json.storeRange === "simple";
+
             var type = typeOf(value);
             if (type==="array"){
                 value.each(function(v){
                     var vtype = typeOf(v);
                     var data = null;
                     if (vtype==="string"){
-                        this.getOrgAction()[this.getValueMethod(v)](function(json){ data = MWF.org.parseOrgData(json.data, true); }.bind(this), error, v, false);
+                        this.getOrgAction()[this.getValueMethod(v)](function(json){ data = MWF.org.parseOrgData(json.data, true, simple); }.bind(this), error, v, false);
                     }
                     if (vtype==="object") {
-                        data = MWF.org.parseOrgData(v, true);
+                        data = MWF.org.parseOrgData(v, true, simple);
                         if(data.woPerson)delete data.woPerson;
                     }
                     if (data)values.push(data);
@@ -2151,11 +2158,11 @@ if( MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form ){
             }
             if (type==="string"){
                 var vData;
-                this.getOrgAction()[this.getValueMethod(value)](function(json){ vData = MWF.org.parseOrgData(json.data, true); }.bind(this), error, value, false);
+                this.getOrgAction()[this.getValueMethod(value)](function(json){ vData = MWF.org.parseOrgData(json.data, true, simple); }.bind(this), error, value, false);
                 if (vData)values.push(vData);
             }
             if (type==="object"){
-                var vData = MWF.org.parseOrgData(value, true);
+                var vData = MWF.org.parseOrgData(value, true, simple);
                 if(vData.woPerson)delete vData.woPerson;
                 values.push( vData );
             }

+ 14 - 7
o2web/source/x_component_process_Xform/Org.js

@@ -304,10 +304,13 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
         items.each(function(item){
             array.push(item.data);
         }.bind(this));
+
+        var simple = this.json.storeRange === "simple";
+
         this.checkEmpower( array, function( data ){
             var values = [];
             data.each(function(d){
-                values.push(MWF.org.parseOrgData(d, true));
+                values.push(MWF.org.parseOrgData(d, true, simple));
             }.bind(this));
 
             if (this.json.isInput){
@@ -383,6 +386,8 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
     _searchConfirmPerson: function(item){
         var inforNode = item.inforNode || new Element("div");
 
+        var simple = this.json.storeRange === "simple";
+
         if (item.data){
 
             var data = item.data;
@@ -394,7 +399,7 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
                     }, function(json){
                         if( json.data.length > 0 ){
                             if( data["person"] )json.data[0].id = data["person"];
-                            item.data = MWF.org.parseOrgData( json.data[0], true );
+                            item.data = MWF.org.parseOrgData( json.data[0], true, simple );
                             item.value = this.getDataText( item.data );
                             if(item.node)item.node.set("text", item.value);
                         }
@@ -402,7 +407,7 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
                 }
             }
             if( item.data && ( item.data.createTime || item.data.updateTime ) ){
-                item.data = MWF.org.parseOrgData( item.data, true );
+                item.data = MWF.org.parseOrgData( item.data, true, simple );
             }
 
             var text = "";
@@ -706,6 +711,8 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
         var values = [];
         var comboxValues = [];
 
+        var simple = this.json.storeRange === "simple";
+
         var type = typeOf(value);
         if (type==="array"){
             value.each(function(v){
@@ -713,10 +720,10 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
                 var data = null;
                 if (vtype==="string"){
                     var error = (this.json.isInput) ? function(){ comboxValues.push(v); } : null;
-                    this.getOrgAction()[this.getValueMethod(v)](function(json){ data = MWF.org.parseOrgData(json.data, true); }.bind(this), error, v, false);
+                    this.getOrgAction()[this.getValueMethod(v)](function(json){ data = MWF.org.parseOrgData(json.data, true, simple); }.bind(this), error, v, false);
                 }
                 if (vtype==="object") {
-                    data = MWF.org.parseOrgData(v, true);
+                    data = MWF.org.parseOrgData(v, true, simple);
                     if(data.woPerson)delete data.woPerson;
                 }
                 if (data){
@@ -728,14 +735,14 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
         if (type==="string"){
             var vData;
             var error = (this.json.isInput) ? function(){ comboxValues.push(value); } : null;
-            this.getOrgAction()[this.getValueMethod(value)](function(json){ vData = MWF.org.parseOrgData(json.data, true); }.bind(this), error, value, false);
+            this.getOrgAction()[this.getValueMethod(value)](function(json){ vData = MWF.org.parseOrgData(json.data, true, simple); }.bind(this), error, value, false);
             if (vData){
                 values.push(vData);
                 comboxValues.push({"text": this.getDataText(vData),"value": vData});
             }
         }
         if (type==="object"){
-            var vData = MWF.org.parseOrgData(value, true);
+            var vData = MWF.org.parseOrgData(value, true, simple);
             if(vData.woPerson)delete vData.woPerson;
             values.push( vData );
             comboxValues.push({"text": this.getDataText(value),"value": vData});

+ 7 - 5
o2web/source/x_component_process_Xform/Personfield.js

@@ -357,9 +357,10 @@ MWF.xApplication.process.Xform.Personfield = MWF.APPPersonfield =  new Class({
         return options;
     },
     selectOnComplete: function(items){
+        var simple = this.json.storeRange === "simple";
         var values = [];
         items.each(function(item){
-            values.push(MWF.org.parseOrgData(item.data, true));
+            values.push(MWF.org.parseOrgData(item.data, true, simple));
         }.bind(this));
         if (this.json.isInput){
             this.addData(values);
@@ -643,6 +644,7 @@ MWF.xApplication.process.Xform.Personfield = MWF.APPPersonfield =  new Class({
         var comboxValues = [];
 
         debugger;
+        var simple = this.json.storeRange === "simple";
 
         var type = typeOf(value);
         if (type==="array"){
@@ -651,10 +653,10 @@ MWF.xApplication.process.Xform.Personfield = MWF.APPPersonfield =  new Class({
                 var data = null;
                 if (vtype==="string"){
                     var error = (this.json.isInput) ? function(){ comboxValues.push(v); } : null;
-                    this.getOrgAction()[this.getValueMethod(v)](function(json){ data = MWF.org.parseOrgData(json.data, false); }.bind(this), error, v, false);
+                    this.getOrgAction()[this.getValueMethod(v)](function(json){ data = MWF.org.parseOrgData(json.data, false, simple); }.bind(this), error, v, false);
                 }
                 if (vtype==="object") {
-                    data = MWF.org.parseOrgData(v, false);
+                    data = MWF.org.parseOrgData(v, false, simple);
                     if(data.woPerson)delete data.woPerson;
                 }
                 if (data){
@@ -666,14 +668,14 @@ MWF.xApplication.process.Xform.Personfield = MWF.APPPersonfield =  new Class({
         if (type==="string"){
             var vData;
             var error = (this.json.isInput) ? function(){ comboxValues.push(value); } : null;
-            this.getOrgAction()[this.getValueMethod(value)](function(json){ vData = MWF.org.parseOrgData(json.data, false); }.bind(this), error, value, false);
+            this.getOrgAction()[this.getValueMethod(value)](function(json){ vData = MWF.org.parseOrgData(json.data, false, simple); }.bind(this), error, value, false);
             if (vData){
                 values.push(vData);
                 comboxValues.push({"text": this.getDataText(vData),"value": vData});
             }
         }
         if (type==="object"){
-            var vData = MWF.org.parseOrgData(value, false);
+            var vData = MWF.org.parseOrgData(value, false, simple);
             if(vData.woPerson)delete vData.woPerson;
             values.push( vData );
             comboxValues.push({"text": this.getDataText(value),"value": vData});