[JavaScript] 纯文本查看 复制代码
let arr = [
['部门', 'A区', 'B区', 'C区', 'D区', 'E区', 'F区', 'G区', 'H区', 'I区', 'J区', 'K区', 'L区', 'M区', 'N区', 'O区', 'P区', 'Q区', 'R区', 'S区', 'T区', 'U区', 'V区', 'W区', 'X区', 'Y区', 'Z区', 'AA区', 'AB区', 'AC区', 'AD区', 'AE区', 'AF区', 'AG区', 'AH区', 'AI区', 'AJ区', 'AK区'],
['1日', 0.02688, 0.01728, 0.01382, 0.05634, 0.0214, 0.03659, 0.03204, 0.01449, 0.02566, 0.01149, 0.0229, 0.04695, 0.02326, 0.02083, 0.0268, 0.01665, 0.01266, 0.01143, 0.01761, 0.02809, 0.02151, 0, 0.01082, 0.00763, 0.01389, 0, 0.01706, 0.01307, 0, 0.00719, 0.02941, 0.00676, 0.008, 0, 0, 0, 0.02098],
['2日', 0.02753, 0.01935, 0.01449, 0.05674, 0.02266, 0.03667, 0.0299, 0.01744, 0.02587, 0.01163, 0.0235, 0.04651, 0.02713, 0.02062, 0.02505, 0.01753, 0.01235, 0.0117, 0.01742, 0.03261, 0.02174, 0, 0.0118, 0.00787, 0.01399, 0, 0.02062, 0.0129, 0, 0.00714, 0.0303, 0.0068, 0.00784, 0, 0, 0, 0.02154],
['3日', 0.02728, 0.02053, 0.01485, 0.05155, 0.02415, 0.03632, 0.02848, 0.01724, 0.02652, 0.01149, 0.02584, 0.04695, 0.02713, 0.02105, 0.02526, 0.01573, 0.01205, 0.0119, 0.01418, 0.02747, 0.01546, 0.01515, 0.01168, 0.01575, 0.01389, 0, 0.01754, 0.01282, 0, 0.00703, 0.0303, 0.00342, 0.00778, 0, 0, 0.01333, 0.02128],
['4日', 0.02567, 0.02028, 0.00976, 0.05085, 0.02143, 0.03448, 0.02698, 0.01734, 0.0267, 0.0163, 0.03038, 0.04525, 0.02344, 0.02094, 0.02311, 0.01544, 0.01205, 0.00882, 0.01742, 0.02674, 0.01463, 0.01587, 0.00905, 0, 0.01404, 0, 0.01404, 0.01307, 0, 0.00822, 0.0303, 0.00669, 0.00775, 0, 0, 0.01163, 0.02036],
['5日', 0.02495, 0.02165, 0.0098, 0.04811, 0.02158, 0.03893, 0.02381, 0.01146, 0.02607, 0.01081, 0.03015, 0.04803, 0.02372, 0.02116, 0.02119, 0.01525, 0.01176, 0.00875, 0.01712, 0.02591, 0.01471, 0.01613, 0.00988, 0, 0.01754, 0, 0.01399, 0.0129, 0, 0.00805, 0.0303, 0.00647, 0.00763, 0, 0, 0.01149, 0.01997],
['6日', 0.02503, 0.025, 0.00962, 0.04362, 0.02017, 0.04057, 0.02369, 0.01156, 0.02659, 0.0107, 0.03046, 0.05128, 0.02381, 0.01604, 0.02311, 0.01508, 0.01099, 0.01173, 0.01351, 0.02564, 0.01456, 0.01563, 0.0109, 0.00781, 0.01767, 0, 0.01449, 0.01316, 0, 0.00795, 0.03125, 0.00627, 0.00766, 0, 0, 0.01136, 0.02024],
['7日', 0.02539, 0.02692, 0.01878, 0.0301, 0.0211, 0.04439, 0.02189, 0.01449, 0.02604, 0.01093, 0.03, 0.04741, 0.02381, 0.01081, 0.02521, 0.01432, 0.01087, 0.01194, 0.01365, 0.02062, 0.01478, 0.01471, 0.01174, 0.00769, 0.0212, 0, 0.0146, 0.01325, 0, 0.00785, 0.0303, 0.00621, 0.00758, 0, 0, 0.01136, 0.02026],
['8日', 0.02336, 0.02068, 0.0186, 0.02694, 0.02086, 0.04019, 0.02034, 0.01724, 0.02342, 0.00559, 0.02906, 0.05106, 0.01575, 0.01047, 0.02088, 0.01267, 0.01111, 0.01212, 0.0101, 0.01563, 0.01485, 0.01408, 0.0118, 0.00775, 0.02143, 0, 0.01439, 0.0129, 0, 0.01038, 0.02941, 0.00615, 0.01487, 0, 0, 0.01163, 0.01891],
['9日', 0.02441, 0.01887, 0.01887, 0.0297, 0.02493, 0.04116, 0.02044, 0.01734, 0.02198, 0.00552, 0.02864, 0.04292, 0.01556, 0.0101, 0.02058, 0.01181, 0.01075, 0.01227, 0.00683, 0.01571, 0.01456, 0.01351, 0.01071, 0.00769, 0.0212, 0, 0.01399, 0.00645, 0, 0.0123, 0.02778, 0.00885, 0.01838, 0, 0, 0.0101, 0.01886],
['10日', 0.0243, 0.02056, 0.01896, 0.02251, 0.02669, 0.04087, 0.01864, 0.01989, 0.02157, 0.00559, 0.02644, 0.04018, 0.01527, 0.0102, 0.02268, 0.01328, 0.01053, 0.0122, 0.00664, 0.01531, 0.02415, 0.01316, 0.00806, 0.00794, 0.01761, 0, 0.00704, 0.00641, 0, 0.01317, 0.02778, 0.00862, 0.02143, 0, 0, 0.0101, 0.01864],
['11日', 0.0247, 0.02434, 0.01835, 0.02258, 0.0249, 0.04502, 0.01681, 0.01972, 0.02157, 0.00556, 0.02381, 0.04091, 0.01533, 0.0101, 0.02484, 0.01392, 0.01087, 0.01502, 0.0099, 0.01515, 0.01914, 0.01205, 0.01256, 0.00806, 0.02069, 0.00769, 0.01413, 0.00676, 0.00714, 0.01422, 0.02632, 0.00852, 0.02465, 0, 0, 0.0102, 0.01963],
['12日', 0.02631, 0.02622, 0.01762, 0.02181, 0.02893, 0.04471, 0.0199, 0.01966, 0.02229, 0.00546, 0.02392, 0.04167, 0.01167, 0.01042, 0.02893, 0.01483, 0.01087, 0.0152, 0.01351, 0.015, 0.01896, 0.01205, 0.01175, 0.00806, 0.01718, 0.00763, 0.01408, 0.00699, 0.00752, 0.01647, 0.02632, 0.00855, 0.02768, 0.03125, 0, 0.0102, 0.02071],
['13日', 0.02667, 0.02612, 0.01747, 0.01852, 0.02807, 0.04695, 0.02322, 0.01961, 0.02147, 0.01099, 0.02179, 0.04225, 0.00806, 0.00538, 0.02911, 0.01667, 0.01075, 0.01858, 0.01736, 0.015, 0.01905, 0.01205, 0.01091, 0.00781, 0.01754, 0.00775, 0.01068, 0.00685, 0.00763, 0.02, 0.02778, 0.01156, 0.03072, 0.03125, 0, 0.0202, 0.02124],
['14日', 0.02719, 0.02559, 0.01717, 0.01846, 0.02603, 0.04673, 0.02769, 0.02235, 0.02205, 0.01667, 0.02184, 0.04245, 0.00791, 0.00524, 0.02947, 0.01565, 0.0101, 0.01829, 0.01754, 0.01508, 0.01826, 0, 0.01266, 0.01527, 0.02069, 0.00769, 0.01071, 0.00676, 0.00787, 0.01972, 0.02703, 0.01133, 0.02749, 0.03125, 0, 0.02885, 0.02162],
['15日', 0.02722, 0.02904, 0.01681, 0.01852, 0.02621, 0.04176, 0.0281, 0.02235, 0.02128, 0.01613, 0.02158, 0.03687, 0.0119, 0.01031, 0.02537, 0.01787, 0.01942, 0.01807, 0.02048, 0.01493, 0.02336, 0, 0.01354, 0.01515, 0.02041, 0.00763, 0.01068, 0.01389, 0.00794, 0.01869, 0.02632, 0.01136, 0.02389, 0.03333, 0, 0.03061, 0.0218],
['16日', 0.02882, 0.03014, 0.01581, 0.02353, 0.03001, 0.04378, 0.02791, 0.0221, 0.02058, 0.01587, 0.02222, 0.03302, 0.0123, 0.01064, 0.02376, 0.01864, 0.01887, 0.01802, 0.02349, 0.01531, 0.02336, 0, 0.01372, 0.01493, 0.02105, 0.01538, 0.01068, 0.00719, 0.00806, 0.0195, 0.02703, 0.01117, 0.02357, 0.05882, 0, 0.0297, 0.02257],
['17日', 0.02844, 0.03351, 0.01538, 0.01739, 0.02849, 0.04176, 0.02796, 0.02528, 0.02059, 0.01639, 0.02228, 0.03226, 0.01266, 0.01042, 0.02355, 0.01939, 0.01835, 0.01802, 0.02373, 0.0203, 0.02294, 0, 0.01092, 0.01481, 0.01724, 0.01538, 0.0073, 0.00694, 0, 0.01697, 0, 0.01108, 0.02, 0.05556, 0, 0.02941, 0.02188],
['18日', 0.02797, 0.03276, 0.01471, 0.01453, 0.02977, 0.03908, 0.02662, 0.02833, 0.01971, 0.01081, 0.02457, 0.03241, 0.01224, 0.0101, 0.0211, 0.02151, 0.01852, 0.01807, 0.02694, 0.0201, 0.0303, 0, 0.01055, 0.0146, 0.01656, 0.01481, 0.00702, 0.00685, 0, 0.01659, 0, 0.00806, 0.02288, 0.05405, 0, 0.02913, 0.02169],
['19日', 0.02623, 0.03077, 0.01767, 0.01441, 0.02945, 0.0367, 0.02152, 0.02557, 0.01803, 0.00552, 0.02222, 0.02752, 0.01195, 0.01036, 0.02123, 0.02133, 0.02679, 0.01802, 0.02606, 0.01563, 0.03017, 0, 0.00964, 0.0073, 0.0165, 0.0146, 0.00704, 0.0069, 0, 0.01629, 0, 0.00806, 0.02194, 0.05128, 0, 0.02913, 0.02047],
['20日', 0.02454, 0.02911, 0.01767, 0.01176, 0.0254, 0.03241, 0.02156, 0.02849, 0.01694, 0.00552, 0.02244, 0.02326, 0.01172, 0.01047, 0.01923, 0.0207, 0.02679, 0.01511, 0.02676, 0.01613, 0.02929, 0, 0.00982, 0.00719, 0.01656, 0.01504, 0.00719, 0.00714, 0, 0.0186, 0, 0.01105, 0.02516, 0.04878, 0, 0.0283, 0.01977],
['21日', 0.02516, 0.02886, 0.01761, 0.01149, 0.02456, 0.03456, 0.02513, 0.02841, 0.02086, 0.01087, 0.02993, 0.02715, 0.0229, 0.01047, 0.01713, 0.01917, 0.02727, 0.01231, 0.02389, 0.01579, 0.02857, 0, 0.00887, 0.00699, 0.01623, 0.01527, 0.00364, 0.00714, 0, 0.0207, 0, 0.01087, 0.03145, 0.05, 0, 0.02857, 0.02069],
['22日', 0.02575, 0.0303, 0.01754, 0.01441, 0.02544, 0.03645, 0.02459, 0.02535, 0.021, 0.01093, 0.03509, 0.0274, 0.01894, 0.00526, 0.01743, 0.02065, 0.02752, 0.01543, 0.02389, 0.01538, 0.03252, 0, 0.00878, 0.0069, 0.01618, 0.00752, 0.00357, 0.00709, 0.00763, 0.0198, 0, 0.01117, 0.02813, 0.04762, 0, 0.02941, 0.02107],
['23日', 0.02575, 0.02867, 0.01736, 0.01404, 0.02699, 0.03872, 0.02156, 0.02801, 0.02286, 0.01105, 0.03769, 0.02715, 0.02256, 0.00543, 0.01974, 0.01981, 0.02804, 0.01558, 0.02397, 0.01005, 0.03187, 0, 0.01047, 0.01399, 0.01597, 0.00752, 0.00712, 0.00676, 0.00781, 0.02077, 0, 0.01093, 0.02857, 0.06667, 0, 0.02941, 0.02165],
['24日', 0.02616, 0.02946, 0.01748, 0.01397, 0.02608, 0.04128, 0.02087, 0.03073, 0.02354, 0.01105, 0.03614, 0.03153, 0.02555, 0.00543, 0.01931, 0.01793, 0.01786, 0.01538, 0.02365, 0.00976, 0.02778, 0, 0.01212, 0.01408, 0.01567, 0.01527, 0.01075, 0.00671, 0.00741, 0.02263, 0, 0.01596, 0.02839, 0.06667, 0, 0.02885, 0.02211],
['25日', 0.02749, 0.03025, 0.02069, 0.01401, 0.02911, 0.04054, 0.02244, 0.03073, 0.02248, 0.0107, 0.03712, 0.02727, 0.025, 0, 0.01891, 0.01839, 0.01724, 0.01529, 0.02581, 0.00966, 0.02767, 0, 0.01264, 0.01379, 0.01515, 0.02308, 0.01038, 0.00649, 0.00719, 0.02201, 0, 0.01571, 0.02727, 0.0625, 0, 0.02857, 0.02248],
['26日', 0.02837, 0.03438, 0.02389, 0.01348, 0.02673, 0.04318, 0.02358, 0.0309, 0.02223, 0.0107, 0.03704, 0.0262, 0.02431, 0, 0.01883, 0.02016, 0.02479, 0.01765, 0.02589, 0.01389, 0.02703, 0, 0.01411, 0.02055, 0.01502, 0.02256, 0.01338, 0.0068, 0.00685, 0.02178, 0, 0.01575, 0.02703, 0.06122, 0, 0.02857, 0.02323],
['27日', 0.0295, 0.03852, 0.0264, 0.01351, 0.02758, 0.04566, 0.02329, 0.02809, 0.02113, 0.01087, 0.03563, 0.02532, 0.02431, 0, 0.0166, 0.02201, 0.02439, 0.01734, 0.02556, 0.01376, 0.0303, 0.02062, 0.01484, 0.02027, 0.01529, 0.02206, 0.01661, 0.00676, 0.00654, 0.02451, 0, 0.01795, 0.03235, 0.05882, 0, 0.0297, 0.02414],
['28日', 0.02783, 0.03687, 0.02273, 0.0134, 0.02347, 0.04795, 0.02304, 0.02521, 0.02064, 0.01053, 0.03425, 0.02532, 0.03367, 0, 0.01016, 0.02101, 0.02439, 0.01719, 0.02244, 0.00897, 0.03297, 0.02041, 0.01403, 0.01351, 0.01786, 0.02174, 0.01672, 0, 0.00662, 0.02402, 0, 0.01759, 0.03143, 0.05882, 0, 0.02913, 0.02306],
['29日', 0.0278, 0.03571, 0.02875, 0.01044, 0.02431, 0.04989, 0.02516, 0.017, 0.02074, 0.01087, 0.03463, 0.02049, 0.03257, 0.00556, 0.00994, 0.02101, 0.02344, 0.01796, 0.02194, 0.00881, 0.03249, 0.02151, 0.01399, 0.01351, 0.0177, 0.02128, 0.01672, 0, 0.00671, 0.02605, 0, 0.02015, 0.03361, 0.0566, 0, 0.03261, 0.02327],
['30日', 0.02877, 0.04006, 0.0304, 0.01036, 0.02395, 0.05157, 0.02484, 0.0169, 0.02111, 0.01087, 0.04025, 0.02049, 0.02894, 0.00559, 0.00792, 0.02147, 0.02381, 0.01767, 0.01858, 0.0124, 0.03584, 0.02083, 0.01536, 0.01361, 0.02047, 0.02797, 0.01582, 0, 0.00676, 0.02831, 0, 0.0229, 0.03621, 0.05769, 0, 0.03333, 0.02424]
]
function filterArr(arr, keyword) {
keyword.forEach(k => {
// 如果不存在该值就直接返回
if (arr[0].indexOf(k) < 0) return;
// 否则循环添加
// 。。。。。没想好怎么写
});
return '返还筛选后的数组'
}
console.log(filterArr(arr, ['B区', 'E区', 'I区']))