|
|
@@ -57,10 +57,6 @@ Ext.define('saas.view.core.query.QueryPanel', {
|
|
|
ignore = item.ignore,
|
|
|
defaultValue = item.defaultValue;
|
|
|
|
|
|
- if(!item.columnWidth){
|
|
|
- item.columnWidth = 0.25;
|
|
|
- }
|
|
|
-
|
|
|
// 设置model绑定
|
|
|
if(!ignore) {
|
|
|
if(bind) {
|
|
|
@@ -97,46 +93,83 @@ Ext.define('saas.view.core.query.QueryPanel', {
|
|
|
/**
|
|
|
* 获得过滤条件
|
|
|
*/
|
|
|
- getConditions: function() {
|
|
|
+ getConditions: function(moreQuery) {
|
|
|
var me = this,
|
|
|
formItems = me.queryFormItems,
|
|
|
+ moreQueryFormItems = me.moreQueryFormItems,
|
|
|
viewModel = me.getViewModel(),
|
|
|
viewModelData = viewModel.getData(),
|
|
|
bindItems = viewModelData['form'],
|
|
|
+ moreItems = viewModelData['moreForm'],
|
|
|
condition,
|
|
|
conditions = [];
|
|
|
|
|
|
- for(k in bindItems) {
|
|
|
- var item = Ext.Array.findBy(formItems, function(i) {
|
|
|
- return i.name == k;
|
|
|
- });
|
|
|
- var field = item.name,
|
|
|
- func = item.getCondition,
|
|
|
- value = bindItems[k],
|
|
|
- condition;
|
|
|
-
|
|
|
- if(typeof func == 'function') {
|
|
|
- condition = {
|
|
|
- type: 'condition',
|
|
|
- value: func(value)
|
|
|
- }
|
|
|
- }else {
|
|
|
- var xtype = item.xtype || 'textfield',
|
|
|
- type = item.fieldType || me.getDefaultFieldType(xtype),
|
|
|
- operation = item.operation || me.getDefaultFieldOperation(xtype),
|
|
|
- conditionValue = me.getConditionValue(xtype, value);
|
|
|
+ if(moreQuery) {
|
|
|
+ for(k in moreItems) {
|
|
|
+ var item = Ext.Array.findBy(moreQueryFormItems, function(i) {
|
|
|
+ return i.name == k;
|
|
|
+ });
|
|
|
+ var field = item.name,
|
|
|
+ func = item.getCondition,
|
|
|
+ value = moreItems[k],
|
|
|
+ condition;
|
|
|
|
|
|
- if(!conditionValue) {
|
|
|
- continue;
|
|
|
+ if(typeof func == 'function') {
|
|
|
+ condition = {
|
|
|
+ type: 'condition',
|
|
|
+ value: func(value)
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ var xtype = item.xtype || 'textfield',
|
|
|
+ type = item.fieldType || me.getDefaultFieldType(xtype),
|
|
|
+ operation = item.operation || me.getDefaultFieldOperation(xtype),
|
|
|
+ conditionValue = me.getConditionValue(xtype, value);
|
|
|
+
|
|
|
+ if(!conditionValue) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ condition = {
|
|
|
+ type: type,
|
|
|
+ field: field,
|
|
|
+ operation: operation,
|
|
|
+ value: conditionValue
|
|
|
+ }
|
|
|
}
|
|
|
- condition = {
|
|
|
- type: type,
|
|
|
- field: field,
|
|
|
- operation: operation,
|
|
|
- value: conditionValue
|
|
|
+ conditions.push(condition);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ for(k in bindItems) {
|
|
|
+ var item = Ext.Array.findBy(formItems, function(i) {
|
|
|
+ return i.name == k;
|
|
|
+ });
|
|
|
+ var field = item.name,
|
|
|
+ func = item.getCondition,
|
|
|
+ value = bindItems[k],
|
|
|
+ condition;
|
|
|
+
|
|
|
+ if(typeof func == 'function') {
|
|
|
+ condition = {
|
|
|
+ type: 'condition',
|
|
|
+ value: func(value)
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ var xtype = item.xtype || 'textfield',
|
|
|
+ type = item.fieldType || me.getDefaultFieldType(xtype),
|
|
|
+ operation = item.operation || me.getDefaultFieldOperation(xtype),
|
|
|
+ conditionValue = me.getConditionValue(xtype, value);
|
|
|
+
|
|
|
+ if(!conditionValue) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ condition = {
|
|
|
+ type: type,
|
|
|
+ field: field,
|
|
|
+ operation: operation,
|
|
|
+ value: conditionValue
|
|
|
+ }
|
|
|
}
|
|
|
+ conditions.push(condition);
|
|
|
}
|
|
|
- conditions.push(condition);
|
|
|
}
|
|
|
|
|
|
return conditions;
|