From 6b35360899815773df8f6cf4c4df7d63dcdd486a Mon Sep 17 00:00:00 2001 From: nikogu <644506165@qq.com> Date: Mon, 20 Nov 2017 14:44:53 +0800 Subject: [PATCH] Fixed: https://github.com/ant-design/ant-design-pro/issues/229 --- mock/rule.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mock/rule.js b/mock/rule.js index 4a1a4dab..2090ce8e 100644 --- a/mock/rule.js +++ b/mock/rule.js @@ -41,10 +41,14 @@ export function getRule(req, res, u) { } if (params.status) { - const s = params.status.split(','); - if (s.length === 1) { - dataSource = dataSource.filter(data => parseInt(data.status, 10) === parseInt(s[0], 10)); - } + const status = params.status.split(','); + let filterDataSource = []; + status.forEach((s) => { + filterDataSource = filterDataSource.concat( + [...dataSource].filter(data => parseInt(data.status, 10) === parseInt(s[0], 10)) + ); + }); + dataSource = filterDataSource; } if (params.no) { -- GitLab