03910b1a by renchao@pashanhoo.com

style:图片上传

1 parent dafd2826
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-06-21 15:35:29
* @LastEditTime: 2023-06-21 16:35:04
-->
<template>
<div class="rlPopup">
......@@ -248,9 +248,11 @@
type: 'warning'
}).then(async () => {
let bsmClmx = this.previewImg.imgList[this.previewImg.index].bsmClmx
let bsmSj = this.previewImg.imgList[this.previewImg.index].bsmSj
this.previewImg.imgList = this.previewImg.imgList.filter(item => item.bsmClmx != bsmClmx)
deleteClmx(bsmClmx).then(res => {
if (res.code == 200) {
that.$emit('updateList', res.result)
that.$emit('updateList', { children: this.previewImg.imgList, bsmSj: bsmSj })
that.$message({
message: '删除成功!',
type: 'success'
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-06-21 15:30:43
* @LastEditTime: 2023-06-21 16:29:37
-->
<template>
<div class="clxx">
......@@ -120,8 +120,9 @@
this.previewImg.bsmSj = item.bsmSj;
},
updateList (val) {
console.log(val, 'valvalvalval');
let that = this
if (val != null) { //删除最后一张图片时 val=null
if (val.children.length != []) { //删除最后一张图片时 val=null
this.tableData.forEach(item => {
if (item.bsmSj === val.bsmSj) {
item.children = val.children
......@@ -140,7 +141,6 @@
}
})
}
},
// 添加材料目录
handleAdd () {
......@@ -173,7 +173,7 @@
this.previewImg.index = 0
this.treeCheckId = item?.bsmSj
this.treeCheckIndex = index
this.previewImg.imgList = item.children? item.children: []
this.previewImg.imgList = item.children ? item.children : []
this.previewImg.bsmSj = item?.bsmSj
},
// 小图片点击
......