dongsuo/vue-data-board

buildFilterSentence 中valueObj 可能为undefined

muhaha31 opened this issue · 1 comments

export function buildFilterSentence(filter) { let filterSentence let valueObj if (trimColType(filter.colType).needQuotation) { valueObj = addQuotation(filter.value) } if (filter.operatorParamNum === 1) { filterSentence = ${filter.filteCol} ${filter.filterOperator} ${valueObj.value1}} else if (filter.operatorParamNum === 2) { filterSentence =${filter.filteCol} ${filter.filterOperator} ${valueObj.value1} and ${valueObj.value2}} else { filterSentence =${filter.filteCol} ${filter.filterOperator} ('${valueObj.arrValue.join(',')}')} return filterSentence function addQuotation(valueObj) { return { value1:'${valueObj.value1}', value2: '${valueObj.value2}', arrValue: valueObj.arrValue.map(value => '${value}') } }

如果needQuotation 为false, valueObj为undefined

fixed.