doSelect(){ var that=this; var maintenance=that.form.maintenance; var aab073 = that.form.aab073; var queryCondition = that.form.queryCondition; var whereCondition = "1 = 1"; let lagRegister = that.$refs['lagRegister'].getWidget(); if(isNotNull(maintenance)){ whereCondition += " and aab073 is '"+maintenance+"'"; } if(isNotNull(aab073)){ whereCondition += " and aab073 = '"+aab073+"'"; } if(isNotNull(queryCondition)){ whereCondition += " and (bab001 like '%"+queryCondition+"%' or aab004 like '%"+queryCondition+"%' or aab998 like '%"+queryCondition+"%')"; } var aae002=that.form.aae002 if(isNotNull(aae002)){ // whereCondition += " and (aab004 like '%"+queryCondition+"%' or aab361 like '%"+queryCondition+"%')"; whereCondition += " and (aae002 = '"+aae002+"')"; } lagRegister.doRefresh({ whereCondition:whereCondition}); },哪里有问题
时间: 2024-03-12 20:47:28 浏览: 25
代码中存在以下问题:
1. 缺少函数定义的函数名,这部分代码可能是函数内部的代码,需要放到函数内部。
2. `isNotNull` 函数未定义,需要先定义该函数或使用其他判断函数。
3. 变量 `aae002` 在代码中只有一个地方被使用,可以直接在判断条件中使用,不需要单独定义变量。
建议修改后的代码如下:
```
// 假设函数名为 selectData
selectData() {
var that = this;
var maintenance = that.form.maintenance;
var aab073 = that.form.aab073;
var queryCondition = that.form.queryCondition;
var whereCondition = "1 = 1";
let lagRegister = that.$refs['lagRegister'].getWidget();
if (maintenance) {
whereCondition += " and aab073 is '" + maintenance + "'";
}
if (aab073) {
whereCondition += " and aab073 = '" + aab073 + "'";
}
if (queryCondition) {
whereCondition += " and (bab001 like '%" + queryCondition + "%' or aab004 like '%" + queryCondition + "%' or aab998 like '%" + queryCondition + "%')";
}
if (that.form.aae002) {
whereCondition += " and (aae002 = '" + that.form.aae002 + "')";
}
lagRegister.doRefresh({ whereCondition: whereCondition });
}
```