diff --git a/back/services/cron.ts b/back/services/cron.ts index 105ce646..1940951e 100644 --- a/back/services/cron.ts +++ b/back/services/cron.ts @@ -12,8 +12,7 @@ import { killTask, } from '../config/util'; import { promises, existsSync } from 'fs'; -import { promisify } from 'util'; -import { Op } from 'sequelize'; +import { Op, where, col as colFn } from 'sequelize'; import path from 'path'; @Service() @@ -164,9 +163,23 @@ export default class CronService { } if (operate && operate2) { q[property] = { - [operate2]: [ - { [operate]: `%${value}%` }, - { [operate]: `%${encodeURIComponent(value)}%` }, + [Op.or]: [ + { + [operate2]: [ + { [operate]: `%${value}%` }, + { [operate]: `%${encodeURIComponent(value)}%` }, + ], + }, + { + [operate2]: [ + where(colFn(property), operate, `%${value}%`), + where( + colFn(property), + operate, + `%${encodeURIComponent(value)}%`, + ), + ], + }, ], }; } diff --git a/src/pages/crontab/viewCreateModal.tsx b/src/pages/crontab/viewCreateModal.tsx index 5634f492..c07be70d 100644 --- a/src/pages/crontab/viewCreateModal.tsx +++ b/src/pages/crontab/viewCreateModal.tsx @@ -20,7 +20,7 @@ const PROPERTIES = [ { name: '名称', value: 'name' }, { name: '定时规则', value: 'schedule' }, { name: '状态', value: 'status' }, - // { name: '标签', value: 'labels' }, + { name: '标签', value: 'labels' }, ]; const EOperation: any = {