Commit abda1cd8 by 陈浩建

修复部分字段为空replace报错问题

parent 852bd420
...@@ -558,9 +558,9 @@ export default { ...@@ -558,9 +558,9 @@ export default {
const schools = res.data.schoolsData const schools = res.data.schoolsData
that.modelData.schools = (schools == undefined ? [] : schools); that.modelData.schools = (schools == undefined ? [] : schools);
that.modelData.universityId= university.universityId that.modelData.universityId= university.universityId
that.productIntroduction =this.HTMLEncode(product.productIntroduction.replace(/&lt/g, '<').replace(/&gt/g, '>')); that.productIntroduction =this.HTMLEncode(product.productIntroduction == null ? "" : product.productIntroduction.replace(/&lt/g, '<').replace(/&gt/g, '>'));
that.productSetMealIntroduction = this.HTMLEncode(product.productSetMealIntroduction.replace(/&lt/g, '<').replace(/&gt/g, '>')); that.productSetMealIntroduction = this.HTMLEncode(product.productSetMealIntroduction == null ? "" : product.productSetMealIntroduction.replace(/&lt/g, '<').replace(/&gt/g, '>'));
that.productRf2 =this.HTMLEncode(product.productRf2.replace(/&lt/g, '<').replace(/&gt/g, '>')); that.productRf2 =this.HTMLEncode(product.productRf2 ==null ? "" : product.productRf2.replace(/&lt/g, '<').replace(/&gt/g, '>'));
that.modelData.productMealPrice = product.productMealPrice that.modelData.productMealPrice = product.productMealPrice
that.modelData.productUniversity = product.productUniversity that.modelData.productUniversity = product.productUniversity
that.modelData.productRhPrice=product.productRhPrice that.modelData.productRhPrice=product.productRhPrice
......
...@@ -340,13 +340,12 @@ ...@@ -340,13 +340,12 @@
},0) },0)
}, },
modifyfunction(data){ modifyfunction(data){
console.log(data);
this.modifyForm.id=data.id this.modifyForm.id=data.id
this.fileid={ this.fileid={
id:data.id id:data.id
} }
let url=this.baseuploadUrl()+"app/ciop"+data.advImg.replace("enclosure","ciop")
if (!(data.advImg == null || data.advImg=="")) { if (!(data.advImg == null || data.advImg=="")) {
let url = this.baseuploadUrl()+"app/ciop"+data.advImg.replace("enclosure","ciop")
//下载图片浏览 //下载图片浏览
this.fileList.push({ this.fileList.push({
uid: this.getuuid(), uid: this.getuuid(),
......
...@@ -199,8 +199,8 @@ ...@@ -199,8 +199,8 @@
modifyvisible: false, modifyvisible: false,
add: true, add: true,
productIntroduction: "", productIntroduction: "",
productSetMealIntroduction: '', productSetMealIntroduction: "",
productRf2:'', productRf2:"",
subNames: [], subNames: [],
schoolNames: [], schoolNames: [],
queryParam: { queryParam: {
...@@ -358,9 +358,9 @@ ...@@ -358,9 +358,9 @@
} }
}) })
if (data != undefined) { if (data != undefined) {
this.productIntroduction = data.productIntroduction.replace(/&lt/g, '<').replace(/&gt/g, '>') this.productIntroduction = data.productIntroduction == null ? "":data.productIntroduction.replace(/&lt/g, '<').replace(/&gt/g, '>')
this.productSetMealIntroduction = data.productSetMealIntroduction.replace(/&lt/g, '<').replace(/&gt/g, '>') this.productSetMealIntroduction = data.productSetMealIntroduction == null ? "":data.productSetMealIntroduction.replace(/&lt/g, '<').replace(/&gt/g, '>')
this.productRf2 = data.productRf2.replace(/&lt/g, '<').replace(/&gt/g, '>') this.productRf2 = data.productRf2 == null ? "":data.productRf2.replace(/&lt/g, '<').replace(/&gt/g, '>')
this.modelData.productMealPrice = data.productMealPrice this.modelData.productMealPrice = data.productMealPrice
this.modelData.productUniversity = data.productUniversity this.modelData.productUniversity = data.productUniversity
this.modelData.productRhPrice=data.productRhPrice this.modelData.productRhPrice=data.productRhPrice
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment