首页 新闻 搜索 专区 学院

js怎么过滤 对象集合中的数据

0
[待解决问题]

 

 

 

 

 

  1. 2017-04|AEON|FLM&SLM:"0"
  2. 2017-04|AEON|Replenishment:"2"
  3. 2017-04|BAY|FLM&SLM:"0"
  4. 2017-04|BAY|Replenishment:"586"
  5. 2017-04|CIMB|FLM&SLM:"0"
  6. 2017-04|CIMB|Replenishment:"42"
  7. 2017-04|CITI|FLM&SLM:"0"
  8. 2017-04|CITI|Replenishment:"8"
  9. 2017-04|GSB|FLM&SLM:"0"
  10. 2017-04|GSB|Replenishment:"1234"
  11. 2017-04|LHB|FLM&SLM:"0"
  12. 2017-04|LHB|Replenishment:"53"
  13. 2017-04|TBNK|FLM&SLM:"0"
  14. 2017-04|TBNK|Replenishment:"579"
  15. 2017-04|TMB|FLM&SLM:"0"
  16. 2017-04|TMB|Replenishment:"707"
  17. 2017-04|UOB|FLM&SLM:"0"
  18. 2017-04|UOB|Replenishment:"37"
  19. 2017-05|AEON|FLM&SLM:"0"
  20. 2017-05|AEON|Replenishment:"38"
  21. 2017-05|BAY|FLM&SLM:"0"
  22. 2017-05|BAY|Replenishment:"2184"
  23. 2017-05|CIMB|FLM&SLM:"0"
  24. 2017-05|CIMB|Replenishment:"102"
  25. 2017-05|CITI|FLM&SLM:"0"
  26. 2017-05|CITI|Replenishment:"21"
  27. 2017-05|GSB|FLM&SLM:"0"
  28. 2017-05|GSB|Replenishment:"3637"
  29. 2017-05|LHB|FLM&SLM:"0"
  30. 2017-05|LHB|Replenishment:"239"
  31. 2017-05|TBNK|FLM&SLM:"1"
  32. 2017-05|TBNK|Replenishment:"1575"
  33. 2017-05|TMB|FLM&SLM:"2"
  34. 2017-05|TMB|Replenishment:"2631"
  35. 2017-05|UOB|FLM&SLM:"0"
  36. 2017-05|UOB|Replenishment:"149"
  37. 2017-06|AEON|FLM&SLM:"0"
  38. 2017-06|AEON|Replenishment:"168"
  39. 2017-06|AIRA|FLM&SLM:"0"
  40. 2017-06|AIRA|Replenishment:"3"
  41. 2017-06|BAY|FLM&SLM:"0"
  42. 2017-06|BAY|Replenishment:"2309"
  43. 2017-06|BOC|FLM&SLM:"0"
  44. 2017-06|BOC|Replenishment:"8"
  45. 2017-06|CIMB|FLM&SLM:"0"
  46. 2017-06|CIMB|Replenishment:"108"
  47. 2017-06|CITI|FLM&SLM:"0"
  48. 2017-06|CITI|Replenishment:"397"
  49. 2017-06|GSB|FLM&SLM:"2"
  50. 2017-06|GSB|Replenishment:"3642"
  51. 2017-06|LHB|FLM&SLM:"0"
  52. 2017-06|LHB|Replenishment:"135"
  53. 2017-06|TBNK|FLM&SLM:"2"
  54. 2017-06|TBNK|Replenishment:"1663"
  55. 2017-06|TMB|FLM&SLM:"4"
  56. 2017-06|TMB|Replenishment:"2993"
  57. 2017-06|UOB|FLM&SLM:"0"
  58. 2017-06|UOB|Replenishment:"156"
  59. 2017-07|AEON|FLM&SLM:"15"
  60. 2017-07|AEON|Replenishment:"184"
  61. 2017-07|AIRA|FLM&SLM:"0"
  62. 2017-07|AIRA|Replenishment:"1"
  63. 2017-07|BAY|FLM&SLM:"37"
  64. 2017-07|BAY|Replenishment:"2303"
  65. 2017-07|BOC|FLM&SLM:"0"
  66. 2017-07|BOC|Replenishment:"10"
  67. 2017-07|CIMB|FLM&SLM:"1"
  68. 2017-07|CIMB|Replenishment:"99"
  69. 2017-07|CITI|FLM&SLM:"0"
  70. 2017-07|CITI|Replenishment:"403"
  71. 2017-07|EASY BUY|FLM&SLM:"0"
  72. 2017-07|EASY BUY|Replenishment:"0"
  73. 2017-07|GSB|FLM&SLM:"8"
  74. 2017-07|GSB|Replenishment:"3813"
  75. 2017-07|LHB|FLM&SLM:"2"
  76. 2017-07|LHB|Replenishment:"133"
  77. 2017-07|TBNK|FLM&SLM:"6"
  78. 2017-07|TBNK|Replenishment:"1676"
  79. 2017-07|TMB|FLM&SLM:"18"
  80. 2017-07|TMB|Replenishment:"2933"
  81. 2017-07|UOB|FLM&SLM:"0"
  82. 2017-07|UOB|Replenishment:"152"
  83. 2017-08|AEON|FLM&SLM:"24"
  84. 2017-08|AEON|Replenishment:"149"
  85. 2017-08|BAY|FLM&SLM:"33"
  86. 2017-08|BAY|Replenishment:"617"
  87. 2017-08|BOC|FLM&SLM:"3"
  88. 2017-08|BOC|Replenishment:"3"
  89. 2017-08|CIMB|FLM&SLM:"0"
  90. 2017-08|CIMB|Replenishment:"20"
  91. 2017-08|CITI|FLM&SLM:"0"
  92. 2017-08|CITI|Replenishment:"82"
  93. 2017-08|EASY BUY|FLM&SLM:"0"
  94. 2017-08|EASY BUY|Replenishment:"0"
  95. 2017-08|GSB|FLM&SLM:"100"
  96. 2017-08|GSB|Replenishment:"1308"
  97. 2017-08|LHB|FLM&SLM:"0"
  98. 2017-08|LHB|Replenishment:"52"
  99. 2017-08|TBNK|FLM&SLM:"4"
  100. 2017-08|TBNK|Replenishment:"438"
  101. 2017-08|TMB|FLM&SLM:"8"
  102. 2017-08|TMB|Replenishment:"493"
  103. 2017-08|UOB|FLM&SLM:"0"
  104. 2017-08|UOB|Replenishment:"27"
  105. 2017-09|AEON|FLM&SLM:"46"
  106. 2017-09|AEON|Replenishment:"38"
  107. 2017-09|BAY|FLM&SLM:"12"
  108. 2017-09|BAY|Replenishment:"17"
  109. 2017-09|CIMB|FLM&SLM:"1"
  110. 2017-09|CIMB|Replenishment:"3"
  111. 2017-09|CITI|FLM&SLM:"1"
  112. 2017-09|CITI|Replenishment:"0"
  113. 2017-09|GSB|FLM&SLM:"35"
  114. 2017-09|GSB|Replenishment:"150"
  115. 2017-09|TBNK|FLM&SLM:"1449"
  116. 2017-09|TBNK|Replenishment:"3"
  117. 2017-09|TMB|FLM&SLM:"4"
  118. 2017-09|TMB|Replenishment:"10"
  119. 2017-09|UOB|FLM&SLM:"0"
  120. 2017-09|UOB|Replenishment:"0"
  121. 2017-10|AEON|FLM&SLM:"51"
  122. 2017-10|AEON|Replenishment:"37"
  123. 2017-10|BAY|FLM&SLM:"2"
  124. 2017-10|BAY|Replenishment:"13"
  125. 2017-10|BOC|FLM&SLM:"0"
  126. 2017-10|BOC|Replenishment:"3"
  127. 2017-10|CIMB|FLM&SLM:"0"
  128. 2017-10|CIMB|Replenishment:"1"
  129. 2017-10|GSB|FLM&SLM:"69"
  130. 2017-10|GSB|Replenishment:"82"
  131. 2017-10|TBNK|FLM&SLM:"81"
  132. 2017-10|TBNK|Replenishment:"2"
  133. 2017-10|TMB|FLM&SLM:"1"
  134. 2017-10|TMB|Replenishment:"2"
  135. 2017-10|UOB|FLM&SLM:"0"
  136. 2017-10|UOB|Replenishment:"1"
  137. 2017-11|AEON|FLM&SLM:"61"
  138. 2017-11|AEON|Replenishment:"85"
  139. 2017-11|BAY|FLM&SLM:"10"
  140. 2017-11|BAY|Replenishment:"23"
  141. 2017-11|BOC|FLM&SLM:"0"
  142. 2017-11|BOC|Replenishment:"2"
  143. 2017-11|CIMB|FLM&SLM:"0"
  144. 2017-11|CIMB|Replenishment:"0"
  145. 2017-11|CITI|FLM&SLM:"0"
  146. 2017-11|CITI|Replenishment:"1"
  147. 2017-11|GSB|FLM&SLM:"111"
  148. 2017-11|GSB|Replenishment:"94"
  149. 2017-11|LHB|FLM&SLM:"0"
  150. 2017-11|LHB|Replenishment:"23"
  151. 2017-11|TBNK|FLM&SLM:"0"
  152. 2017-11|TBNK|Replenishment:"26"
  153. 2017-11|TMB|FLM&SLM:"2"
  154. 2017-11|TMB|Replenishment:"10"
  155. 2017-11|UOB|FLM&SLM:"0"
  156. 2017-11|UOB|Replenishment:"6"
  157. 2017-12|AEON|FLM&SLM:"31"
  158. 2017-12|AEON|Replenishment:"33"
  159. 2017-12|AIRA|FLM&SLM:"0"
  160. 2017-12|AIRA|Replenishment:"4"
  161. 2017-12|BAY|FLM&SLM:"1"
  162. 2017-12|BAY|Replenishment:"21"
  163. 2017-12|BOC|FLM&SLM:"0"
  164. 2017-12|BOC|Replenishment:"4"
  165. 2017-12|CIMB|FLM&SLM:"0"
  166. 2017-12|CIMB|Replenishment:"7"
  167. 2017-12|CITI|FLM&SLM:"0"
  168. 2017-12|CITI|Replenishment:"23"
  169. 2017-12|EASY BUY|FLM&SLM:"0"
  170. 2017-12|EASY BUY|Replenishment:"0"
  171. 2017-12|GSB|FLM&SLM:"64"
  172. 2017-12|GSB|Replenishment:"65"
  173. 2017-12|LHB|FLM&SLM:"2"
  174. 2017-12|LHB|Replenishment:"42"
  175. 2017-12|TBNK|FLM&SLM:"0"
  176. 2017-12|TBNK|Replenishment:"38"
  177. 2017-12|TMB|FLM&SLM:"0"
  178. 2017-12|TMB|Replenishment:"67"
  179. 2017-12|UOB|FLM&SLM:"0"
  180. 2017-12|UOB|Replenishment:"6"
  181. Branch:"Bangkok"

数据 是这样的

 

怎么把 2017-05 的 过滤出来 谢谢 ?

 

~雨落忧伤~的主页 ~雨落忧伤~ | 菜鸟二级 | 园豆:336
提问于:2018-04-19 11:35
< >
分享
所有回答(1)
0
function m_filter(item)    {
    var reg = /^2017-05/, ans = {};
    for(var i in item)    {
        if(reg.test(i))
            ans[i] = item[i];
    }
    return ans;
}
hehe_54321 | 园豆:750 (小虾三级) | 2018-04-19 13:33
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册