awMoveStackAdd.conditions.push(new Condition('noticeDate',OPRATER_BETWEEN,Ext.getCmp('startNoticeDate').getRawValue()+ ' 00:00:00',Ext.getCmp('endNoticeDate').getRawValue()+ ' 23:59:59','Datetime','','','')); 取时间条件
condition类
/* * 此文件中有部分方法调拨仓储特有的与appfuze的框架中的这个文件不同之处,故在此做备份*/function Condition(columnName,operator,firstValue,secondValue,type,entity,andOr,bracket,isAutoDispose){this.columnName = columnName;this.operator = operator;this.firstValue = firstValue;this.secondValue = secondValue;this.type = type;this.entity = entity;this.andOr = andOr;this.bracket = bracket;this.isAutoDispose = isAutoDispose;this.toString=function() {var str='[';str+='columnName:' + columnName;str+=',operator:' + operator;str+=',firstValue:' + firstValue;str+=',secondValue:' + secondValue;str+=',type:' + type;str+=',entity:' + entity;str+=',andOr:' +andOr;str+=',bracket:' + bracket;str+=',isAutoDispose:' +isAutoDispose;return str;}}var OPRATER_EQUAL = "=";var OPRATER_UNEQUAL = "<>";var OPRATER_GREATER_AND_EQUAL = ">=";var OPRATER_LESS_AND_EQUAL = "<=";var OPRATER_GREATER = ">";var OPRATER_LESS = "<";var OPRATER_CONTAINS = "like '%|%'";var OPRATER_NOT_CONTAINS = "not like '%|%'";var OPRATER_LEFT_CONTAINS = "like '|%'";var OPRATER_RIGHT_CONTAINS = "like '%|'";var OPRATER_BETWEEN = "between";var OPRATER_ISNULL = "is null";var OPRATER_ISNOTNULL = "is not null";var TYPE_IS_DATETIME = "Datetime";var TYPE_IS_NUMBER = "Number";var TYPE_IS_STRING = "String";var IS_AUTO_DISPOSE_YES="0"; var IS_AUTO_DISPOSE_NO="1";function buildCondition(form,cd) {visit(form,form.getForm().items,cd);if(typeof(_sessionParam) != 'undefined'){for(var key in _sessionParam){cd.push(new Condition(key,"=",_sessionParam[key],'','','','','','true'));};}}function visit(form,items,cd) {if(items && items.length&&items.each) {items.each(function(item) {if(!item.disabled&&item.condition){var cname=item.condition.col;if(!cname) {cname=item.id;}var op=translate(item.condition.operator);var fvalue='',svalue='';var next=item.condition.next;var value=form.getForm().findField(item.name).getValue();fvalue=valueif(fvalue instanceof Date){fvalue = fvalue.format('Y-m-d H:i:s'); }if(next) { //get second value of the conditionsvalue=form.getForm().findField(next).getValue();if(svalue instanceof Date){ svalue = svalue.format('Y-m-d'); svalue = svalue + ' 23:59:59';}}var type=item.condition.type;if(!type) {type='String';}var entity=item.condition.entity;if(!entity) {entity='';}var andor=item.condition.andor;if(!andor) {andor='';}var bracket=item.condition.bracket;if(!bracket) {bracket='';}var isAutoDispose=item.condition.isAutoDispose;if(!isAutoDispose) {isAutoDispose='';}cd.push(new Condition(cname,op,fvalue,svalue,type,entity,andor,bracket,isAutoDispose));visit(form,item.items,cd);}});}}function translate(alias) {var op=null;switch(alias.toLowerCase()) {case '=':op=OPRATER_EQUAL;break;case '<>':op=OPRATER_UNEQUAL;break;case '>=':op=OPRATER_GREATER_AND_EQUAL;break;case '<=':op=OPRATER_LESS_AND_EQUAL;break;case '>':op=OPRATER_GREATER;break;case '<':op=OPRATER_LESS;break;case 'like':op=OPRATER_CONTAINS;break;case 'nlike':op=OPRATER_NOT_CONTAINS;break;case 'llike':op=OPRATER_LEFT_CONTAINS;break;case 'rlike':op=OPRATER_RIGHT_CONTAINS;break;case 'between':op=OPRATER_BETWEEN;break;case 'isnull':op=OPRATER_ISNULL;break;case 'notnull':op=OPRATER_ISNOTNULL;break;default:cd=OPRATER_EQUAL;alert('Operator '+alias+' is not defined,default '+OPRATER_EQUAL);}return op;}