去掉id和name前后的逗号
This commit is contained in:
@@ -2828,7 +2828,23 @@
|
|||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
},
|
},
|
||||||
|
// 截取字符前后的逗号
|
||||||
|
subComma(str){
|
||||||
|
if(str && str!== ''){
|
||||||
|
if(str.indexOf(',') === 0){
|
||||||
|
str = str.slice(1)
|
||||||
|
}
|
||||||
|
if(str.lastIndexOf(',') === str.length - 1){
|
||||||
|
str = str.slice(0, -1)
|
||||||
|
}
|
||||||
|
return str
|
||||||
|
}else{
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
},
|
||||||
assemble(ids,names){
|
assemble(ids,names){
|
||||||
|
ids = this.subComma(ids)
|
||||||
|
names = this.subComma(names)
|
||||||
let list= new Array();
|
let list= new Array();
|
||||||
if(ids && ids !== '' && names && names !== ''){
|
if(ids && ids !== '' && names && names !== ''){
|
||||||
let idArray=ids.split(',');
|
let idArray=ids.split(',');
|
||||||
|
|||||||
Reference in New Issue
Block a user