|
|
@ -306,21 +306,29 @@ export function useDataSource(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 配置高级查询参数固定格式
|
|
|
|
// 配置高级查询参数固定格式
|
|
|
|
|
|
|
|
console.log(opt.advanced)
|
|
|
|
opt.advanced?.conditions.forEach(item => {
|
|
|
|
opt.advanced?.conditions.forEach(item => {
|
|
|
|
let obj = {
|
|
|
|
let obj = {
|
|
|
|
Key: '',
|
|
|
|
Key: '',
|
|
|
|
Value: null
|
|
|
|
Value: {
|
|
|
|
|
|
|
|
ConditionalList: []
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
obj['Key'] = item.logicalOperator
|
|
|
|
obj['Key'] = item.logicalOperator
|
|
|
|
if (item?.conditions) {
|
|
|
|
if (item?.conditions) {
|
|
|
|
item.conditions.forEach(row => {
|
|
|
|
item.conditions.forEach(row => {
|
|
|
|
// 只有当查询条件字段和筛选符都有值的时候才行(不然后台报错)
|
|
|
|
// 只有当查询条件字段和筛选符都有值的时候才行(不然后台报错)
|
|
|
|
if (row.field && row.value) {
|
|
|
|
if (row.field && row.value) {
|
|
|
|
obj.Value = {
|
|
|
|
// 将id替换成Name支持输入框模糊查询(看后期要不要改成外键下拉形式)
|
|
|
|
FieldName: row.field,
|
|
|
|
const field = replaceEndChar(row.field, 'Id', 'Name')
|
|
|
|
|
|
|
|
obj.Value.ConditionalList.push({
|
|
|
|
|
|
|
|
Key: 0,
|
|
|
|
|
|
|
|
Value: {
|
|
|
|
|
|
|
|
FieldName: field,
|
|
|
|
FieldValue: row.value,
|
|
|
|
FieldValue: row.value,
|
|
|
|
ConditionalType: row.operator
|
|
|
|
ConditionalType: row.operator
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -328,6 +336,7 @@ export function useDataSource(
|
|
|
|
ap.Value.ConditionalList.push(obj)
|
|
|
|
ap.Value.ConditionalList.push(obj)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
console.log(ap)
|
|
|
|
if (ap.Value.ConditionalList.length) {
|
|
|
|
if (ap.Value.ConditionalList.length) {
|
|
|
|
params['advancedSearchParams'] = { ConditionalList: [ap] }
|
|
|
|
params['advancedSearchParams'] = { ConditionalList: [ap] }
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -394,7 +403,11 @@ export function useDataSource(
|
|
|
|
setLoading(false)
|
|
|
|
setLoading(false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 创建正则表达式匹配目标字符在末尾的情况
|
|
|
|
|
|
|
|
function replaceEndChar(str, target, replacement) {
|
|
|
|
|
|
|
|
const pattern = new RegExp(target + '$')
|
|
|
|
|
|
|
|
return str.replace(pattern, replacement)
|
|
|
|
|
|
|
|
}
|
|
|
|
function setTableData<T = Recordable>(values: T[]) {
|
|
|
|
function setTableData<T = Recordable>(values: T[]) {
|
|
|
|
dataSourceRef.value = values
|
|
|
|
dataSourceRef.value = values
|
|
|
|
}
|
|
|
|
}
|
|
|
|