From 2718e47db2df7710326d97a06e7b8efff404804a Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080@qq.com> Date: Fri, 13 May 2022 12:01:03 +0800 Subject: [PATCH] =?UTF-8?q?PC=E5=85=AC=E5=8F=B8=E5=85=B3=E4=BA=8E=E6=88=91?= =?UTF-8?q?=E4=BB=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wjnft/brand/index.vue | 50 ++++- src/views/wjnft/us/index.vue | 372 +++++++++++++++++++++++++------- 2 files changed, 330 insertions(+), 92 deletions(-) diff --git a/src/views/wjnft/brand/index.vue b/src/views/wjnft/brand/index.vue index b9d1f08..e59b3f8 100644 --- a/src/views/wjnft/brand/index.vue +++ b/src/views/wjnft/brand/index.vue @@ -446,7 +446,6 @@ export default { this.$refs["form"].validate(valid => { if (valid) { if (this.form.id != null) { - console.log(this.pictureUrl); let url = ""; if(this.pictureUrl.length > 0){ this.imgList.forEach(item =>{ @@ -455,16 +454,36 @@ export default { }else{ url = url + item.url+','; } - - }) + }); if(this.pictureUrl.length > 1 ){ url = url + this.pictureUrl.join(",") + }else{ + url = url + this.pictureUrl[0]; } - url = url + this.pictureUrl[0]; + this.form.picture = url; + }else { + this.imgList.forEach(item =>{ + if(url === ""){ + if(this.imgList.length > 0){ + url = item.url+','; + }else{ + url = item.url; + } + }else{ + let c = this.imgList[this.imgList.length-1]; + //console.log(c); + if(c.url === item.url){ + //console.log(c.url === item.url) + url = url + item.url; + }else{ + url = url + item.url+','; + } + + } + }); this.form.picture = url; } - console.log(this.imgList); - console.log(this.form) + console.log(this.form); updateBrand(this.form).then(response => { this.$modal.msgSuccess("修改成功"); this.open = false; @@ -531,12 +550,21 @@ export default { this.pictureUrl.push( res.url); return this.imgList; }, + //删除图片 handleRemove(file) { - console.log(file); - //this.$refs.upload.clearFiles() - const findex = this.imgList.map(f => f.url).indexOf(file.url); - if(findex > -1) { - this.imgList.splice(findex, 1); + if(file.name !== undefined){ + console.log(this.$refs.upload.uploadFiles); + // this.$refs.upload.clearFiles() + let n = this.$refs.upload.uploadFiles; + const finde = n.map(f => f.name).indexOf(file.name); + if(finde > -1) { + n.splice(finde, 1); + } + }else{ + const findex = this.imgList.map(f => f.url).indexOf(file.url); + if(findex > -1) { + this.imgList.splice(findex, 1); + } } }, diff --git a/src/views/wjnft/us/index.vue b/src/views/wjnft/us/index.vue index 50c9cdd..f3371ba 100644 --- a/src/views/wjnft/us/index.vue +++ b/src/views/wjnft/us/index.vue @@ -10,39 +10,7 @@ @keyup.enter.native="handleQuery" /> - - - - - - - - - - - - - - - + 搜索 重置 @@ -82,25 +50,51 @@ v-hasPermi="['wjnft:us:remove']" >删除 - - 导出 - + + + + + + + + + + + - - + + + + + + + - - - +