From 64fdaba93d111adb36b413da529ab9a1fbe131c0 Mon Sep 17 00:00:00 2001 From: Disciple_C Date: Tue, 18 Aug 2026 10:54:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=8F=90=E7=8E=B0?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=BC=B9=E7=AA=97=E6=B7=BB=E5=8A=A0=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WithdrawDetailModal.module.less | 22 +++++- .../components/WithdrawDetailModal.tsx | 68 ++++++++++++++----- 2 files changed, 72 insertions(+), 18 deletions(-) diff --git a/src/pages/finance/withdraw/components/WithdrawDetailModal.module.less b/src/pages/finance/withdraw/components/WithdrawDetailModal.module.less index 5877990..308cc2f 100644 --- a/src/pages/finance/withdraw/components/WithdrawDetailModal.module.less +++ b/src/pages/finance/withdraw/components/WithdrawDetailModal.module.less @@ -143,9 +143,14 @@ } // ===== 上传 ===== - .uploader { + .uploadWrapper { flex: 1; + display: flex; + flex-direction: column; + gap: 8px; + } + .uploader { :global { .ant-upload-list-picture-card-container { width: 96px; @@ -159,6 +164,21 @@ } } + .pasteTip { + display: flex; + align-items: center; + gap: 6px; + padding: 8px 12px; + background: #e6f7ff; + border-radius: 4px; + color: #1677ff; + font-size: 12px; + + span { + line-height: 1.5; + } + } + .uploadTrigger { display: flex; flex-direction: column; diff --git a/src/pages/finance/withdraw/components/WithdrawDetailModal.tsx b/src/pages/finance/withdraw/components/WithdrawDetailModal.tsx index a26fb95..828df2a 100644 --- a/src/pages/finance/withdraw/components/WithdrawDetailModal.tsx +++ b/src/pages/finance/withdraw/components/WithdrawDetailModal.tsx @@ -1,8 +1,8 @@ -import { defineComponent, reactive, ref } from 'vue'; +import { defineComponent, reactive, ref, onMounted, onUnmounted } from 'vue'; import { useEffect } from '@/hooks'; import { Modal, Radio, Input, Button, Upload, Image, Spin, message } from 'ant-design-vue'; import type { UploadFile } from 'ant-design-vue'; -import { PlusOutlined } from '@ant-design/icons-vue'; +import { PlusOutlined, CopyOutlined } from '@ant-design/icons-vue'; import { uploadFile, OssUploadType } from '@/utils/oss'; import { getWithdrawInfo, postWithdrawAudit, type WithdrawInfoVO } from '../model/services'; import { getAuditStatusText, getPayStatusText } from '../model/useWithdrawModel'; @@ -41,6 +41,34 @@ export default defineComponent({ const auditForm = reactive({ pass: true, remark: '' }); const imageList = ref([]); const submitting = ref(false); + const uploadAreaRef = ref(null); + + // ===== 粘贴图片上传 ===== + const handlePaste = async (e: ClipboardEvent) => { + if (!props.visible || !uploadAreaRef.value) return; + + const items = e.clipboardData?.items; + if (!items) return; + + for (let i = 0; i < items.length; i++) { + const item = items[i]; + if (item.type.indexOf('image') !== -1) { + e.preventDefault(); + const file = item.getAsFile(); + if (file) { + await beforeUpload(file as unknown as UploadFile); + } + } + } + }; + + onMounted(() => { + document.addEventListener('paste', handlePaste); + }); + + onUnmounted(() => { + document.removeEventListener('paste', handlePaste); + }); // ===== 拉取详情 ===== const fetchDetail = async (id: number) => { @@ -239,21 +267,27 @@ export default defineComponent({ {auditForm.pass && *} 审核图片 - - {imageList.value.length >= MAX_IMAGE_COUNT ? null : ( -
- -
请选择图片
-
- )} -
+
+ + {imageList.value.length >= MAX_IMAGE_COUNT ? null : ( +
+ +
选择或粘贴图片
+
+ )} +
+
+ + 支持 Ctrl+V 粘贴图片 +
+