diff --git a/src/views/moneyManage/executor/executor.vue b/src/views/moneyManage/executor/executor.vue index 3c9a305..8b02a32 100644 --- a/src/views/moneyManage/executor/executor.vue +++ b/src/views/moneyManage/executor/executor.vue @@ -91,7 +91,7 @@ @@ -477,6 +477,36 @@ const currencies = ref([ label: '越南盾' } ]) + +// 预览图片函数 +const previewImage = (imageUrl) => { + // 使用 element-plus 的 el-image 组件实现图片预览功能 + const imageElement = document.createElement('img'); + imageElement.src = imageUrl; + imageElement.style.maxWidth = '80vw'; + imageElement.style.maxHeight = '80vh'; + + const viewer = document.createElement('div'); + viewer.style.position = 'fixed'; + viewer.style.top = '0'; + viewer.style.left = '0'; + viewer.style.width = '100vw'; + viewer.style.height = '100vh'; + viewer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)'; + viewer.style.display = 'flex'; + viewer.style.justifyContent = 'center'; + viewer.style.alignItems = 'center'; + viewer.style.zIndex = '9999'; + viewer.style.overflow = 'auto'; + + viewer.appendChild(imageElement); + document.body.appendChild(viewer); + + viewer.addEventListener('click', () => { + document.body.removeChild(viewer); + }); +}; + const handleImageChange = (file) => { uploadRef.value.submit() }