diff --git a/o2web/source/o2_core/o2/xDesktop/Common.js b/o2web/source/o2_core/o2/xDesktop/Common.js index d9d7499dc0bb840649034b29fe9fdb3fdd99a61a..328be19813e6224a73c856c0b588e46b6f593326 100644 --- a/o2web/source/o2_core/o2/xDesktop/Common.js +++ b/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,17 @@ 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 + }; + if( data.ignoreEmpower )rData.ignoreEmpower = true; + if( data.ignoredEmpower )rData.ignoredEmpower = true; + return data; + } var rData = { "id": data.id, "name": data.name, @@ -664,63 +674,106 @@ 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 + } + }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) + } } } }; diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Authorfield/authorfield.html b/o2web/source/x_component_cms_FormDesigner/Module/Authorfield/authorfield.html index 33d387a240170f8b1a0b4914f9c8c2c1377193a4..634744b68b092531ff7daaff2ecfbc3249696eda 100644 --- a/o2web/source/x_component_cms_FormDesigner/Module/Authorfield/authorfield.html +++ b/o2web/source/x_component_cms_FormDesigner/Module/Authorfield/authorfield.html @@ -183,6 +183,19 @@
通过编写脚本排除组织、身份、个人和群组的选择范围
+ +
+
数据保存
+ + + + + +
数据保存: + 完整 + 精简 +
+
diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Personfield/personfield.html b/o2web/source/x_component_cms_FormDesigner/Module/Personfield/personfield.html index 29f8964239d7bf6139098217dc7d50f80c93345e..1e2d69de1498df2b248846e7bec4a106aeadcdf2 100644 --- a/o2web/source/x_component_cms_FormDesigner/Module/Personfield/personfield.html +++ b/o2web/source/x_component_cms_FormDesigner/Module/Personfield/personfield.html @@ -213,6 +213,19 @@
通过编写脚本排除组织或个人的选择范围
+ +
+
数据保存
+ + + + + +
数据保存: + 完整 + 精简 +
+
diff --git a/o2web/source/x_component_cms_Xform/Personfield.js b/o2web/source/x_component_cms_Xform/Personfield.js index 0a908d56849082e21e02929330ca977d6313a78d..7db8fad8d18542f83923e5011ce63352d35359c4 100644 --- a/o2web/source/x_component_cms_Xform/Personfield.js +++ b/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); diff --git a/o2web/source/x_component_cms_Xform/Readerfield.js b/o2web/source/x_component_cms_Xform/Readerfield.js index 652f23f78ee3a2b4360f2affbe8ceebea9ce2df3..ab6a9c60a2abb6f64fa91923b4d8fc38341e0a93 100644 --- a/o2web/source/x_component_cms_Xform/Readerfield.js +++ b/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); diff --git a/o2web/source/x_component_process_FormDesigner/Module/Orgfield/orgfield.html b/o2web/source/x_component_process_FormDesigner/Module/Orgfield/orgfield.html index 7e4b302aeb827a5591f8e5fcbb68dfa46bd2073f..d42a18ac6633617bdb1af73ad779f082b3cb0f7e 100644 --- a/o2web/source/x_component_process_FormDesigner/Module/Orgfield/orgfield.html +++ b/o2web/source/x_component_process_FormDesigner/Module/Orgfield/orgfield.html @@ -176,6 +176,19 @@
通过编写脚本排除组织、身份、个人和群组的选择范围
+ +
+
数据保存
+ + + + + +
数据保存: + 完整 + 精简 +
+
diff --git a/o2web/source/x_component_process_FormDesigner/Module/Personfield/personfield.html b/o2web/source/x_component_process_FormDesigner/Module/Personfield/personfield.html index 86148250b96e4b213fd8878224be5da64bf21e50..ef4720c77483040b167105a6c282475e7a9f52fd 100644 --- a/o2web/source/x_component_process_FormDesigner/Module/Personfield/personfield.html +++ b/o2web/source/x_component_process_FormDesigner/Module/Personfield/personfield.html @@ -219,6 +219,19 @@
+
+
数据保存
+ + + + + +
数据保存: + 完整 + 精简 +
+
+
diff --git a/o2web/source/x_component_process_Work/Processor.js b/o2web/source/x_component_process_Work/Processor.js index df95a6dbc6001f8f676dbc74788e3d56f8d592fa..131629fe2d6302ac5be1f2e4eca15984c1c34910 100644 --- a/o2web/source/x_component_process_Work/Processor.js +++ b/o2web/source/x_component_process_Work/Processor.js @@ -1849,10 +1849,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); @@ -1942,11 +1945,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) @@ -2019,10 +2023,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; @@ -2088,16 +2093,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); @@ -2105,11 +2112,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 ); } diff --git a/o2web/source/x_component_process_Xform/Org.js b/o2web/source/x_component_process_Xform/Org.js index 2ce59be0abf7343996ae0c3beec6c86d2be8e94f..079aa8d7a6c86ac6329744c9c96e552b7fce3945 100644 --- a/o2web/source/x_component_process_Xform/Org.js +++ b/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}); diff --git a/o2web/source/x_component_process_Xform/Personfield.js b/o2web/source/x_component_process_Xform/Personfield.js index bc066a4dcf437d9676947069f0461a8d8c396259..2853369873d688060960c67cbdc6701880347785 100644 --- a/o2web/source/x_component_process_Xform/Personfield.js +++ b/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});