Browse Source

主从表绑定与ignore逻辑调整

zhuth 7 years ago
parent
commit
7b5cde426e
1 changed files with 15 additions and 18 deletions
  1. 15 18
      frontend/saas-web/app/view/core/form/FormPanel.js

+ 15 - 18
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -21,7 +21,6 @@ Ext.define('saas.view.core.form.FormPanel', {
     initId: 0,
     layout: 'column',
     autoScroll: true,
-    border: 1,
     bodyPadding: 5,
 
     fieldDefaults: {
@@ -94,9 +93,6 @@ Ext.define('saas.view.core.form.FormPanel', {
             dockedItems: [{
                 xtype: 'toolbar',
                 dock: 'top',
-                style: {
-                    'border-bottom': '1px solid #35baf6 !important'
-                },
                 items: me.getToolBarItems(),
             }],
             listeners: {
@@ -331,23 +327,24 @@ Ext.define('saas.view.core.form.FormPanel', {
                 return;
             }
 
-            // 设置model绑定
-            if (!ignore) {
-                if (bind) {
-                    if (!Ext.isString(bind)) {
-                        Ext.apply(bind, {
-                            value: '{' + name + '}'
-                        });
-                    } else {
-                        item.bind = '{' + name + '}';
-                    }
+            if (bind) {
+                if (!Ext.isString(bind)) {
+                    Ext.apply(bind, {
+                        value: '{' + name + '}'
+                    });
                 } else {
                     item.bind = '{' + name + '}';
                 }
-                // 设置默认值
-                if (defaultValue) {
-                    viewModel.set(name, defaultValue);
-                }
+            } else {
+                item.bind = '{' + name + '}';
+            }
+            // 设置默认值
+            if (defaultValue) {
+                viewModel.set(name, defaultValue);
+            }
+
+            // 设置model绑定
+            if (!ignore) {
                 if(!Ext.Array.contains(bindFields, name)) {
                     bindFields.push(name);
                 }