把样本id根据某个 标识符分割得到个数组,然后再遍历数组 ,把 reportlets 跟数组值拼接起来 reportlets 定义在循环外
var reportlets ="";
var all_id="321*222*444";
var ids=all_id.split("*")
for ( var i = 0; i <ids.length; i++){
report="{reportlet:'xxx.cpt',样本id:'"+ids[i]+"'},"
reportlets+=report
}
reportlets="["+reportlets+"]"