瀏覽代碼

【内容管理】修复视图范围选择人员、组织、身份保存出错的问题

unknown 5 年之前
父節點
當前提交
bc9eb8f5cd

+ 3 - 3
o2web/source/x_component_query_ViewDesigner/Property.js

@@ -450,7 +450,7 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
             personUnitNodes.each(function(node){
                 new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
                     "type": "unit",
-                    "names": (this.data.data.where) ? this.data.data.where.unitList : [],
+                    "names": (this.data.data.where) ? this.data.data.where.creatorUnitList : [],
                     "onChange": function(ids){this.savePersonSelectItem(node, ids);}.bind(this)
                 });
             }.bind(this));
@@ -458,7 +458,7 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
             personNodes.each(function(node){
                 new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
                     "type": "person",
-                    "names": (this.data.data.where) ? this.data.data.where.personList : [],
+                    "names": (this.data.data.where) ? this.data.data.where.creatorPersonList : [],
                     "onChange": function(ids){this.savePersonSelectItem(node, ids);}.bind(this)
                 });
             }.bind(this));
@@ -466,7 +466,7 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
             identityNodes.each(function(node){
                 new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
                     "type": "identity",
-                    "names": (this.data.data.where) ? this.data.data.where.identityList : [],
+                    "names": (this.data.data.where) ? this.data.data.where.creatorIdentityList : [],
                     "onChange": function(ids){this.savePersonSelectItem(node, ids);}.bind(this)
                 });
             }.bind(this));

+ 46 - 0
o2web/source/x_component_query_ViewDesigner/View.js

@@ -628,6 +628,28 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
             return false;
         }
 
+        var list;
+        if( this.data.data && this.data.data.where ){
+            if( this.data.data.where.creatorIdentityList ){
+                list = this.data.data.where.creatorIdentityList;
+                for( var i=0; i< list.length ; i++){
+                    if( typeOf( list[i] ) === "object" )list[i] = list[i].name || "";
+                }
+            }
+            if( this.data.data.where.creatorPersonList ){
+                list = this.data.data.where.creatorPersonList;
+                for( var i=0; i< list.length ; i++){
+                    if( typeOf( list[i] ) === "object" )list[i] = list[i].name || "";
+                }
+            }
+            if( this.data.data.where.creatorUnitList ){
+                list = this.data.data.where.creatorIdentityList;
+                for( var i=0; i< list.length ; i++){
+                    if( typeOf( list[i] ) === "object" )list[i] = list[i].name || "";
+                }
+            }
+        }
+
         this.designer.actions.saveView(this.data, function(json){
             this.data.id = json.data.id;
             this.isNewView = false;
@@ -645,6 +667,30 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
                 return false;
             }
         //}
+
+        debugger;
+            var list;
+            if( this.data.data && this.data.data.where ){
+                if( this.data.data.where.creatorIdentityList ){
+                    list = this.data.data.where.creatorIdentityList;
+                    for( var i=0; i< list.length ; i++){
+                        if( typeOf( list[i] ) === "object" )list[i] = list[i].name || "";
+                    }
+                }
+                if( this.data.data.where.creatorPersonList ){
+                    list = this.data.data.where.creatorPersonList;
+                    for( var i=0; i< list.length ; i++){
+                        if( typeOf( list[i] ) === "object" )list[i] = list[i].name || "";
+                    }
+                }
+                if( this.data.data.where.creatorUnitList ){
+                    list = this.data.data.where.creatorUnitList;
+                    for( var i=0; i< list.length ; i++){
+                        if( typeOf( list[i] ) === "object" )list[i] = list[i].name || "";
+                    }
+                }
+            }
+
         this.designer.actions.saveView(this.data, function(json){
             this.designer.notice(this.designer.lp.notice.save_success, "success", this.node, {"x": "left", "y": "bottom"});
             this.isNewView = false;