|
@@ -47,6 +47,8 @@ import { useI18n } from '@/hooks/web/useI18n'
|
|
|
import { getEnterpriseBaseInfo, updateEnterpriseAlbum } from '@/api/enterprise'
|
|
|
import Snackbar from '@/plugins/snackbar'
|
|
|
import Confirm from '@/plugins/confirm'
|
|
|
+import cloneDeep from 'lodash/cloneDeep'
|
|
|
+
|
|
|
const emit = defineEmits(['complete'])
|
|
|
|
|
|
const { t } = useI18n()
|
|
@@ -78,10 +80,13 @@ const handleClick = (index) => {
|
|
|
const handleDelete = async (url) => {
|
|
|
const index = imgList.value.indexOf(url)
|
|
|
if (index === -1) return
|
|
|
+ const albumList = cloneDeep(imgList.value)
|
|
|
+ albumList.splice(index, 1)
|
|
|
Confirm('系统提示', '是否确认删除?').then(async () => {
|
|
|
- await updateEnterpriseAlbum({ albumList: imgList.value })
|
|
|
+ await updateEnterpriseAlbum({ albumList })
|
|
|
Snackbar.success('删除成功')
|
|
|
imgList.value.splice(index, 1)
|
|
|
+ getInfo()
|
|
|
})
|
|
|
}
|
|
|
|