|
|
@@ -27,38 +27,14 @@ Ext.define('saas.view.core.form.FormPanel', {
|
|
|
blankText: '该字段不能为空'
|
|
|
},
|
|
|
|
|
|
- dockedItems: [{
|
|
|
- xtype: 'toolbar',
|
|
|
- dock: 'top',
|
|
|
- style: {
|
|
|
- 'border-bottom': '1px solid #35baf6 !important'
|
|
|
- },
|
|
|
- items: [{
|
|
|
- xtype: 'tbtext',
|
|
|
- bind: '单据编号:{id}'
|
|
|
- }, '->', {
|
|
|
- xtype: 'button',
|
|
|
- text: '新增',
|
|
|
- handler: 'add'
|
|
|
- }, {
|
|
|
- xtype: 'button',
|
|
|
- text: '保存',
|
|
|
- handler: 'save'
|
|
|
- }, {
|
|
|
- xtype: 'button',
|
|
|
- text: '审核',
|
|
|
- handler: "audit"
|
|
|
- }]
|
|
|
- }],
|
|
|
-
|
|
|
items: [],
|
|
|
|
|
|
remoteConfig: true, // 是否需要从远端读取form配置
|
|
|
bindFields: [], // 已绑定字段(需要保存到数据库)
|
|
|
+ toolBtns: [], // 自定义按钮
|
|
|
|
|
|
initComponent: function() {
|
|
|
var me = this,
|
|
|
- remoteConfig = me.remoteConfig;
|
|
|
|
|
|
//判断是否加载数据
|
|
|
if(me.initId&&me.initId!=0){
|
|
|
@@ -78,9 +54,37 @@ Ext.define('saas.view.core.form.FormPanel', {
|
|
|
.catch(function(response) {
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ Ext.apply(me, {
|
|
|
+ remoteConfig: me.remoteConfig,
|
|
|
+ dockedItems: [{
|
|
|
+ xtype: 'toolbar',
|
|
|
+ dock: 'top',
|
|
|
+ style: {
|
|
|
+ 'border-bottom': '1px solid #35baf6 !important'
|
|
|
+ },
|
|
|
+ items: me.toolBtns.concat(['->', {
|
|
|
+ xtype: 'button',
|
|
|
+ text: '新增',
|
|
|
+ handler: 'add'
|
|
|
+ }, {
|
|
|
+ xtype: 'button',
|
|
|
+ text: '保存',
|
|
|
+ handler: 'save'
|
|
|
+ }, {
|
|
|
+ xtype: 'button',
|
|
|
+ text: '审核',
|
|
|
+ handler: "audit"
|
|
|
+ }])
|
|
|
+ }]
|
|
|
+ });
|
|
|
|
|
|
- remoteConfig && me.FormUtil.setItems(me);
|
|
|
+ me.remoteConfig && me.FormUtil.setItems(me);
|
|
|
me.callParent(arguments);
|
|
|
+ },
|
|
|
+
|
|
|
+ addItems: function(items) {
|
|
|
+ this.add(items);
|
|
|
}
|
|
|
|
|
|
});
|