|
@ -282,30 +282,39 @@ const opensearchTable = ( |
|
|
if (searchCondition && searchCondition.length > 0) { |
|
|
if (searchCondition && searchCondition.length > 0) { |
|
|
// 转换筛选条件所需 |
|
|
// 转换筛选条件所需 |
|
|
let filters: any[] = [] |
|
|
let filters: any[] = [] |
|
|
searchCondition.forEach((item) => { |
|
|
for (var i=0; i< searchCondition.length; i++ ) { |
|
|
|
|
|
// searchCondition.forEach((item) => { |
|
|
// 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取 |
|
|
// 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取 |
|
|
// 20231127 row[item.value]?row[item.value] 修改为 row?row[item.value] 返回'null' 为了查询不到任何数据 |
|
|
if (searchCondition[i].isMainValue) { |
|
|
if (item.isMainValue) { |
|
|
_searchCondition[searchCondition[i].key] = formRef.value.formModel[searchCondition[i].value] |
|
|
_searchCondition[item.key] = formRef.value.formModel[item.value] |
|
|
? formRef.value.formModel[searchCondition[i].value] |
|
|
? formRef.value.formModel[item.value] |
|
|
|
|
|
: props.detailData |
|
|
: props.detailData |
|
|
? props.detailData[item.value] |
|
|
? props.detailData[searchCondition[i].value] |
|
|
: row |
|
|
: row |
|
|
? row[item.value] |
|
|
? row[searchCondition[i].value] |
|
|
: 'null' |
|
|
: '' |
|
|
|
|
|
// 是否含有空参数情况 |
|
|
|
|
|
let isNull = false |
|
|
|
|
|
if (_searchCondition[searchCondition[i].key] == '' || _searchCondition[searchCondition[i].key] == undefined) { |
|
|
|
|
|
isNull = true |
|
|
|
|
|
} |
|
|
|
|
|
if (isNull) { |
|
|
|
|
|
message.warning(searchCondition[i].message) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
// 扩展 转换为筛选条件进行查询 |
|
|
// 扩展 转换为筛选条件进行查询 |
|
|
if (item.isSearch) { |
|
|
if (searchCondition[i].isSearch) { |
|
|
filters.push({ |
|
|
filters.push({ |
|
|
action: item.action, |
|
|
action: searchCondition[i].action, |
|
|
column: item.key, |
|
|
column: searchCondition[i].key, |
|
|
value: item.value |
|
|
value: searchCondition[i].value |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
_searchCondition[item.key] = item.value |
|
|
_searchCondition[searchCondition[i].key] = searchCondition[i].value |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
|
|
|
if (filters.length > 0) { |
|
|
if (filters.length > 0) { |
|
|
_searchCondition.isSearch = true |
|
|
_searchCondition.isSearch = true |
|
|
_searchCondition.filters = filters |
|
|
_searchCondition.filters = filters |
|
|