var str = "abc-a,add-a,ccc-b,ccc-d,abc-a,abc-b,abc-f,tbg-g";
convert the above string to the following array form:
var arr = [
{"name" : "abc", "nameIdx":[{"site" : "a"}]},
{"name" : "add", "nameIdx":[{"site" : "a"}]},
{"name" : "ccc", "nameIdx":[{"site" : "b"},{"site" : "d"}]},
{"name" : "abc", "nameIdx":[{"site" : "a"},{"site" : "b"},{"site" : "f"}]},
{"name" : "tbg", "nameIdx":[{"site" : "g"}]}
]
The string format is concatenated with commas in the form of abc-y. Unlimited number, the value of abc3 can be 26 arbitrary lowercase letters, can be the same. The value of y is 26 lowercase letters and can only be one. "name", "nameIdx" and "site" are field names in the converted array.