支持定时任务视图筛选条件关系切换

This commit is contained in:
whyour
2022-11-10 01:31:21 +08:00
parent c72abd29ec
commit 7038e15ad2
12 changed files with 127 additions and 64 deletions
+4 -3
View File
@@ -116,8 +116,9 @@ export default class CronService {
private formatViewQuery(query: any, viewQuery: any) {
if (viewQuery.filters && viewQuery.filters.length > 0) {
if (!query[Op.and]) {
query[Op.and] = [];
const primaryOperate = viewQuery.filterRelation === 'or' ? Op.or : Op.and;
if (!query[primaryOperate]) {
query[primaryOperate] = [];
}
for (const col of viewQuery.filters) {
const { property, value, operation } = col;
@@ -166,7 +167,7 @@ export default class CronService {
],
};
}
query[Op.and].push(q);
query[primaryOperate].push(q);
}
}
}