Browse Source

fix:执行明细的退款明细的图片预览

lihuilin/feature-20250923114949-现金
zhangrenyuan 1 month ago
parent
commit
9af8a347b2
  1. 32
      src/views/moneyManage/executor/executor.vue

32
src/views/moneyManage/executor/executor.vue

@ -91,7 +91,7 @@
<el-table-column prop="refundVoucher" label="退款截图" width="120">
<template #default="scope">
<el-image v-if="scope.row.refundVoucher" :src="scope.row.refundVoucher"
:preview-src-list="[scope.row.refundVoucher]"
@click="previewImage(scope.row.refundVoucher)"
style="width: 40px; height: 40px; cursor: pointer;z-index: 99999;" fit="cover" />
<span v-else style="color: #FA5A1E;">待补充</span>
</template>
@ -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()
}

Loading…
Cancel
Save