|
|
@@ -123,7 +123,7 @@ Ext.define('saas.view.core.query.QueryPanel', {
|
|
|
}else {
|
|
|
var xtype = item.xtype || 'textfield',
|
|
|
type = item.fieldType || me.getDefaultFieldType(xtype),
|
|
|
- operation = item.operation || me.getDefaultFieldOperation(type),
|
|
|
+ operation = item.operation || me.getDefaultFieldOperation(xtype),
|
|
|
conditionValue = me.getConditionValue(xtype, value);
|
|
|
|
|
|
if(!conditionValue) {
|
|
|
@@ -158,17 +158,19 @@ Ext.define('saas.view.core.query.QueryPanel', {
|
|
|
return type;
|
|
|
},
|
|
|
|
|
|
- getDefaultFieldOperation: function(type) {
|
|
|
+ getDefaultFieldOperation: function(xtype) {
|
|
|
var operation;
|
|
|
|
|
|
- if(type == 'string') {
|
|
|
- operation = 'like';
|
|
|
- }else if(type == 'number') {
|
|
|
+ if(Ext.Array.contains(['numberfield'], xtype)) {
|
|
|
operation = '=';
|
|
|
- }else if(type == 'date') {
|
|
|
+ }else if(Ext.Array.contains(['datefield'], xtype)) {
|
|
|
operation = '=';
|
|
|
- }else if(type == 'enum') {
|
|
|
+ }else if(Ext.Array.contains(['condatefield'], xtype)) {
|
|
|
+ operation = 'between';
|
|
|
+ }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
|
|
|
operation = 'in';
|
|
|
+ }else {
|
|
|
+ operation = 'like';
|
|
|
}
|
|
|
|
|
|
return operation;
|