فهرست منبع

Merge branch 'cherry-pick-fbec468e' into 'develop'

Merge branch 'fix/fix/[流程管理]修复自定义弹出框分类未选中的问题,设置自定义提交表单的操作脚本默认值' into 'develop'

See merge request o2oa/o2oa!871
蔡祥熠 5 سال پیش
والد
کامیت
0fa4eea27d

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

@@ -1025,6 +1025,7 @@ MWF.xApplication.Selector.Person = new Class({
     },
 
     setSelectedItem: function(){
+        debugger;
         if (this.options.values.length){
             this.options.values.each(function(v, i){
                 if (typeOf(v)==="object"){

+ 60 - 9
o2web/source/x_component_Template/Selector/Custom.js

@@ -132,8 +132,35 @@ MWF.xApplication.Template.Selector.Custom = new Class({
             this.initSearchArea(false);
         }
     },
-    _getItem: function (callback, failure, id, async) {
-        if (callback) callback.apply(id, [{"id": id}]);
+    nestData : function( data, isItem ){
+        if( !this.nestedData )this.nestedData = {};
+        var setNest = function (d, isItem) {
+            if( isItem ){
+                this.nestedData[ d["id"] || d["name"] ] = d;
+            }else if( this.options.categorySelectable ){
+                this.nestedData[ d["id"] || d["name"] ] = { id : d.id , name : d.name };
+                if( d.subItemList )this.nestData( d.subItemList, true  );
+                if( d.subCategoryList )this.nestData( d.subCategoryList );
+            }else{
+                if( d.subItemList )this.nestData( d.subItemList, true );
+                if( d.subCategoryList )this.nestData( d.subCategoryList );
+            }
+        }.bind(this);
+        if( data ){
+            for( var i=0; i<data.length; i++ ){
+                var d = data[i];
+                setNest(d, isItem );
+            }
+        }else{
+            for( var i=0; i<this.options.selectableItems.length; i++ ){
+                var d = this.options.selectableItems[i];
+                setNest(d, d.isItem);
+            }
+        }
+    },
+    _getItem: function (callback, failure, id, async, data) {
+        if( !this.nestedData )this.nestData();
+        if (callback) callback.apply(id, [{ "data": this.nestedData[id] || {"id": id} }]);
     },
     _newItem: function (data, selector, container, level, category, delay) {
         return new MWF.xApplication.Template.Selector.Custom.Item(data, selector, container, level, category, delay);
@@ -182,8 +209,8 @@ MWF.xApplication.Template.Selector.Custom.Item = new Class({
     },
     checkSelectedSingle: function () {
         var selectedItem = this.selector.options.values.filter(function (item, index) {
-            if (typeOf(item) === "object") return (this.data.id === item.id) || (this.data.name === item.name);
-            if (typeOf(item) === "string") return (this.data.id === item) || (this.data.name === item);
+            if (typeOf(item) === "object") return ( this.data.id && this.data.id === item.id) || (this.data.name && this.data.name === item.name);
+            if (typeOf(item) === "string") return ( this.data.id && this.data.id === item) || (this.data.name && this.data.name === item);
             return false;
         }.bind(this));
         if (selectedItem.length) {
@@ -192,7 +219,7 @@ MWF.xApplication.Template.Selector.Custom.Item = new Class({
     },
     checkSelected: function () {
         var selectedItem = this.selector.selectedItems.filter(function (item, index) {
-            return (item.data.id === this.data.id) || (item.data.name === this.data.name);
+            return ( item.data.id && item.data.id === this.data.id) || (item.data.name && item.data.name === this.data.name);
         }.bind(this));
         if (selectedItem.length) {
             //selectedItem[0].item = this;
@@ -248,9 +275,9 @@ MWF.xApplication.Template.Selector.Custom.ItemCategory = new Class({
         return this.data.name;
     },
     clickItem: function (callback) {
+        debugger;
         if (this._hasChild()) {
             var firstLoaded = !this.loaded;
-            debugger;
             this.loadSub(function () {
                 if (firstLoaded) {
                     if (!this.selector.isFlatCategory) {
@@ -277,7 +304,7 @@ MWF.xApplication.Template.Selector.Custom.ItemCategory = new Class({
     loadSub: function (callback) {
         debugger;
         if (!this.loaded) {
-            if( this._hasChild() ){
+            if( this._hasChildItem() ){
                 this.data.subItemList.each(function (subItem, index) {
                     var item = this.selector._newItem(subItem, this.selector, this.children, this.level + 1, this);
                     this.selector.items.push(item);
@@ -337,7 +364,7 @@ MWF.xApplication.Template.Selector.Custom.ItemCategorySelectable = new Class({
             this.children.setStyle("display", "block");
             //    if (!this.selector.options.expand) this.children.setStyle("display", "none");
 
-            if( this._hasChild() ){
+            if( this._hasChildItem() ){
                 this.data.subItemList.each(function (subItem, index) {
                     var item = this.selector._newItem(subItem, this.selector, this.children, this.level + 1, this);
                     this.selector.items.push(item);
@@ -347,6 +374,7 @@ MWF.xApplication.Template.Selector.Custom.ItemCategorySelectable = new Class({
             if ( this._hasChildCategory() ) {
                 this.data.subCategoryList.each(function (subCategory, index) {
                     var category = this.selector._newItemCategorySelectable(subCategory, this.selector, this.children, this.level + 1, this);
+                    this.selector.items.push(category);
                     this.subCategorys.push( category );
                 }.bind(this));
             }
@@ -362,6 +390,7 @@ MWF.xApplication.Template.Selector.Custom.ItemCategorySelectable = new Class({
             if ( this._hasChildCategory() ) {
                 this.data.subCategoryList.each(function (subCategory, index) {
                     var category = this.selector._newItemCategorySelectable(subCategory, this.selector, this.children, this.level + 1, this);
+                    this.selector.items.push(category);
                     this.subCategorys.push( category );
                 }.bind(this));
             }
@@ -375,7 +404,7 @@ MWF.xApplication.Template.Selector.Custom.ItemCategorySelectable = new Class({
     loadItemChildren : function( callback ){
         if (!this.itemLoaded){
 
-            if( this._hasChild() ){
+            if( this._hasChildItem() ){
                 this.data.subItemList.each(function (subItem, index) {
                     var item = this.selector._newItem(subItem, this.selector, this.children, this.level + 1, this);
                     this.selector.items.push(item);
@@ -397,6 +426,28 @@ MWF.xApplication.Template.Selector.Custom.ItemCategorySelectable = new Class({
     _hasChild: function () {
         return this._hasChildCategory() || this._hasChildItem();
     },
+    checkSelectedSingle: function () {
+        var selectedItem = this.selector.options.values.filter(function (item, index) {
+            if (typeOf(item) === "object") return ( this.data.id && this.data.id === item.id) || (this.data.name && this.data.name === item.name);
+            if (typeOf(item) === "string") return ( this.data.id && this.data.id === item) || (this.data.name && this.data.name === item);
+            return false;
+        }.bind(this));
+        if (selectedItem.length) {
+            this.selectedSingle();
+        }
+    },
+    checkSelected: function () {
+        var selectedItem = this.selector.selectedItems.filter(function (item, index) {
+            return ( item.data.id && item.data.id === this.data.id) || (item.data.name && item.data.name === this.data.name);
+        }.bind(this));
+        if (selectedItem.length) {
+            //selectedItem[0].item = this;
+            selectedItem[0].addItem(this);
+            this.selectedItem = selectedItem[0];
+            this.setSelected();
+        }
+    },
     check: function () {
+        this.checkSelected();
     }
 });

+ 8 - 1
o2web/source/x_component_process_FormDesigner/Module/Form/template/form.json

@@ -17,6 +17,10 @@
         "code": "",
         "html": ""
       },
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
 
       "events": {
         "queryLoad" : {
@@ -194,7 +198,10 @@
         "code": "",
         "html": ""
       },
-
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "help": {
           "code": "",

+ 8 - 1
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_classical.json

@@ -16,6 +16,10 @@
         "code": "",
         "html": ""
       },
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "postLoad": {
           "code": "",
@@ -3398,7 +3402,10 @@
         "code": "",
         "html": ""
       },
-
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "help": {
           "code": "",

+ 8 - 0
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_cms_publish.json

@@ -18,6 +18,10 @@
         "code": "",
         "html": ""
       },
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "postLoad": {
           "code": "",
@@ -3065,6 +3069,10 @@
         "code": "",
         "html": ""
       },
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "postLoad": {
           "code": "",

+ 8 - 1
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_common.json

@@ -18,6 +18,10 @@
         "code": "",
         "html": ""
       },
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "postLoad": {
           "code": "",
@@ -8464,7 +8468,10 @@
         "code": "",
         "html": ""
       },
-
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "help": {
           "code": "",

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_custom_submit_mobile.json


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_custom_submit_pc.json


+ 8 - 1
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_file.json

@@ -19,6 +19,10 @@
         "code": "",
         "html": ""
       },
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "postLoad": {
           "code": "",
@@ -5848,7 +5852,10 @@
         "code": "",
         "html": ""
       },
-
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "help": {
           "code": "",

+ 8 - 1
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_mobile.json

@@ -17,7 +17,10 @@
         "code": "",
         "html": ""
       },
-
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "postLoad": {
           "code": "",
@@ -141,6 +144,10 @@
         "code": "",
         "html": ""
       },
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "postLoad": {
           "code": "",

+ 8 - 0
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_project.json

@@ -18,6 +18,10 @@
         "code": "",
         "html": ""
       },
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "postLoad": {
           "code": "",
@@ -3863,6 +3867,10 @@
         "code": "",
         "html": ""
       },
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "postLoad": {
           "code": "",

+ 8 - 0
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_project2.json

@@ -18,6 +18,10 @@
         "code": "",
         "html": ""
       },
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "postLoad": {
           "code": "",
@@ -3862,6 +3866,10 @@
         "code": "",
         "html": ""
       },
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "postLoad": {
           "code": "",

+ 8 - 0
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_tab.json

@@ -18,6 +18,10 @@
         "code": "",
         "html": ""
       },
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "postLoad": {
           "code": "",
@@ -8376,6 +8380,10 @@
         "code": "",
         "html": ""
       },
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "postLoad": {
           "code": "",

+ 8 - 0
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_tab_red.json

@@ -18,6 +18,10 @@
         "code": "",
         "html": ""
       },
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "postLoad": {
           "code": "",
@@ -8498,6 +8502,10 @@
         "code": "",
         "html": ""
       },
+      "submitScript":{
+        "code":"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();",
+        "html": ""
+      },
       "events": {
         "postLoad": {
           "code": "",

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است