去掉id和name前后的逗号

This commit is contained in:
SUNJIABIN
2023-05-11 10:13:11 +08:00
parent d30f6f6200
commit 106965cc80
@@ -2532,35 +2532,35 @@
},
fileInfoHandle(){
//拼接文件名和id 提交到流程Activity
// this.form.FBGBUSS=this.FBGBUSSFileList.map(item => item.id).join(",")
// 修复将文件删除为一个后提交不显示的bug
this.form.FBGBUSS=this.FBGBUSSFileList.map(item => item.id ? item.id : item.response.data.id).join(",")
this.form.FBGBUSSName=this.FBGBUSSFileList.map(item => item.name).join(",")
//拼接文件名和id 提交到流程Activity
// this.form.FBGBUSS=this.FBGBUSSFileList.map(item => item.id).join(",")
// 修复将文件删除为一个后提交不显示的bug
this.form.FBGBUSS=this.FBGBUSSFileList.map(item => item.id ? item.id : item.response.data.id).join(",")
this.form.FBGBUSSName=this.FBGBUSSFileList.map(item => item.name).join(",")
// this.form.BZSMBUSS=this.BZSMBUSSFileList.map(item => item.id).join(",")
this.form.BZSMBUSS=this.BZSMBUSSFileList.map(item => item.id ? item.id : item.response.data.id).join(",")
this.form.BZSMBUSSName=this.BZSMBUSSFileList.map(item => item.name).join(",")
// this.form.BZSMBUSS=this.BZSMBUSSFileList.map(item => item.id).join(",")
this.form.BZSMBUSS=this.BZSMBUSSFileList.map(item => item.id ? item.id : item.response.data.id).join(",")
this.form.BZSMBUSSName=this.BZSMBUSSFileList.map(item => item.name).join(",")
// this.form.LSBBBUSS=this.LSBBBUSSFileList.map(item => item.id).join(",")
this.form.LSBBBUSS=this.LSBBBUSSFileList.map(item => item.id ? item.id : item.response.data.id).join(",")
this.form.LSBBBUSSName=this.LSBBBUSSFileList.map(item => item.name).join(",")
this.form.LSBBBUSS=this.LSBBBUSSFileList.map(item => item.id ? item.id : item.response.data.id).join(",")
this.form.LSBBBUSSName=this.LSBBBUSSFileList.map(item => item.name).join(",")
// this.form.QTWJBUSS=this.QTWJBUSSFileList.map(item => item.id).join(",")
this.form.QTWJBUSS=this.QTWJBUSSFileList.map(item => item.id ? item.id : item.response.data.id).join(",")
this.form.QTWJBUSSName=this.QTWJBUSSFileList.map(item => item.name).join(",")
// this.form.QTWJBUSS=this.QTWJBUSSFileList.map(item => item.id).join(",")
this.form.QTWJBUSS=this.QTWJBUSSFileList.map(item => item.id ? item.id : item.response.data.id).join(",")
this.form.QTWJBUSSName=this.QTWJBUSSFileList.map(item => item.name).join(",")
// this.form.GLWJBUSS=this.GLWJBUSSFileList.map(item => item.id).join(",")
this.form.GLWJBUSS=this.GLWJBUSSFileList.map(item => item.id ? item.id : item.response.data.id).join(",")
this.form.GLWJBUSSName=this.GLWJBUSSFileList.map(item => item.name).join(",")
// this.form.GLWJBUSS=this.GLWJBUSSFileList.map(item => item.id).join(",")
this.form.GLWJBUSS=this.GLWJBUSSFileList.map(item => item.id ? item.id : item.response.data.id).join(",")
this.form.GLWJBUSSName=this.GLWJBUSSFileList.map(item => item.name).join(",")
// this.form.summaryFile=this.summaryFileList.map(item => item.id).join(",")
this.form.summaryFile=this.summaryFileList.map(item => item.id ? item.id : item.response.data.id).join(",")
this.form.summaryFileName=this.summaryFileList.map(item => item.name).join(",")
// this.form.summaryFile=this.summaryFileList.map(item => item.id).join(",")
this.form.summaryFile=this.summaryFileList.map(item => item.id ? item.id : item.response.data.id).join(",")
this.form.summaryFileName=this.summaryFileList.map(item => item.name).join(",")
// this.form.madelSub=this.madelSubList.map(item => item.id).join(",")
this.form.madelSub=this.madelSubList.map(item => item.id ? item.id : item.response.data.id).join(",")
this.form.madelSubName=this.madelSubList.map(item => item.name).join(",")
// this.form.madelSub=this.madelSubList.map(item => item.id).join(",")
this.form.madelSub=this.madelSubList.map(item => item.id ? item.id : item.response.data.id).join(",")
this.form.madelSubName=this.madelSubList.map(item => item.name).join(",")
},
// 删除方法
@@ -2828,7 +2828,23 @@
}
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){
ids = this.subComma(ids)
names = this.subComma(names)
let list= new Array();
if(ids && ids !== '' && names && names !== ''){
let idArray=ids.split(',');