Browse Source

执行人放大问题

jiangcheng/feature-20260326164657-金币日常优化3.0
ZhangYong 2 weeks ago
parent
commit
5c9e302877
  1. 46
      src/views/moneyManage/executor/executor.vue

46
src/views/moneyManage/executor/executor.vue

@ -192,7 +192,7 @@
<div class="dialog-item"> <div class="dialog-item">
<el-text style="width:4vw;">{{ t('common_add.transferVoucher') }}</el-text> <el-text style="width:4vw;">{{ t('common_add.transferVoucher') }}</el-text>
<img v-if="editRow.payVoucher" :src="editRow.payVoucher" <img v-if="editRow.payVoucher" :src="editRow.payVoucher"
style="width: 80px; height: 80px; object-fit: cover;">
style="width: 80px; height: 80px; object-fit: cover; cursor: zoom-in;" @click="openVoucherViewer(editRow.payVoucher)">
<div v-else> <div v-else>
{{ t('common_add.noTransferVoucher') }} {{ t('common_add.noTransferVoucher') }}
</div> </div>
@ -302,6 +302,50 @@ const showEdit = ref(false)
const editForm = ref({ const editForm = ref({
jwcode: '' jwcode: ''
}) })
//
const openVoucherViewer = (url) => {
if (!url) return
const container = document.createElement('div')
container.style.position = 'fixed'
container.style.left = '0'
container.style.top = '0'
container.style.width = '100vw'
container.style.height = '100vh'
container.style.backgroundColor = 'rgba(0,0,0,0.7)'
container.style.display = 'flex'
container.style.alignItems = 'center'
container.style.justifyContent = 'center'
container.style.zIndex = '9999'
container.style.cursor = 'zoom-in'
const img = document.createElement('img')
img.src = url
img.style.maxWidth = '90%'
img.style.maxHeight = '90%'
img.style.transformOrigin = 'center center'
img.style.transition = 'transform 0.05s linear'
let scale = 1
const onWheel = (e) => {
e.preventDefault()
const factor = e.deltaY > 0 ? 0.9 : 1.1
scale = Math.min(5, Math.max(0.2, scale * factor))
img.style.transform = `scale(${scale})`
}
const onKey = (e) => { if (e.key === 'Escape') close() }
const close = () => {
container.removeEventListener('wheel', onWheel)
document.body.removeEventListener('keydown', onKey)
document.body.contains(container) && document.body.removeChild(container)
}
container.addEventListener('wheel', onWheel, { passive: false })
container.addEventListener('click', (e) => { if (e.target === container) close() })
document.body.addEventListener('keydown', onKey)
container.appendChild(img)
document.body.appendChild(container)
}
// //
const getRefund = async function () { const getRefund = async function () {
try { try {

Loading…
Cancel
Save