Compare commits
1 Commits
50d5f54015
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 64fdaba93d |
@@ -143,9 +143,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===== 上传 =====
|
// ===== 上传 =====
|
||||||
.uploader {
|
.uploadWrapper {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uploader {
|
||||||
:global {
|
:global {
|
||||||
.ant-upload-list-picture-card-container {
|
.ant-upload-list-picture-card-container {
|
||||||
width: 96px;
|
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 {
|
.uploadTrigger {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { defineComponent, reactive, ref } from 'vue';
|
import { defineComponent, reactive, ref, onMounted, onUnmounted } from 'vue';
|
||||||
import { useEffect } from '@/hooks';
|
import { useEffect } from '@/hooks';
|
||||||
import { Modal, Radio, Input, Button, Upload, Image, Spin, message } from 'ant-design-vue';
|
import { Modal, Radio, Input, Button, Upload, Image, Spin, message } from 'ant-design-vue';
|
||||||
import type { UploadFile } 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 { uploadFile, OssUploadType } from '@/utils/oss';
|
||||||
import { getWithdrawInfo, postWithdrawAudit, type WithdrawInfoVO } from '../model/services';
|
import { getWithdrawInfo, postWithdrawAudit, type WithdrawInfoVO } from '../model/services';
|
||||||
import { getAuditStatusText, getPayStatusText } from '../model/useWithdrawModel';
|
import { getAuditStatusText, getPayStatusText } from '../model/useWithdrawModel';
|
||||||
@@ -41,6 +41,34 @@ export default defineComponent({
|
|||||||
const auditForm = reactive({ pass: true, remark: '' });
|
const auditForm = reactive({ pass: true, remark: '' });
|
||||||
const imageList = ref<UploadFile[]>([]);
|
const imageList = ref<UploadFile[]>([]);
|
||||||
const submitting = ref(false);
|
const submitting = ref(false);
|
||||||
|
const uploadAreaRef = ref<HTMLElement | null>(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) => {
|
const fetchDetail = async (id: number) => {
|
||||||
@@ -239,6 +267,7 @@ export default defineComponent({
|
|||||||
{auditForm.pass && <span class={styles.required}>*</span>}
|
{auditForm.pass && <span class={styles.required}>*</span>}
|
||||||
审核图片
|
审核图片
|
||||||
</span>
|
</span>
|
||||||
|
<div ref={uploadAreaRef} class={styles.uploadWrapper}>
|
||||||
<Upload
|
<Upload
|
||||||
listType="picture-card"
|
listType="picture-card"
|
||||||
fileList={imageList.value}
|
fileList={imageList.value}
|
||||||
@@ -250,10 +279,15 @@ export default defineComponent({
|
|||||||
{imageList.value.length >= MAX_IMAGE_COUNT ? null : (
|
{imageList.value.length >= MAX_IMAGE_COUNT ? null : (
|
||||||
<div class={styles.uploadTrigger}>
|
<div class={styles.uploadTrigger}>
|
||||||
<PlusOutlined />
|
<PlusOutlined />
|
||||||
<div class={styles.uploadText}>请选择图片</div>
|
<div class={styles.uploadText}>选择或粘贴图片</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Upload>
|
</Upload>
|
||||||
|
<div class={styles.pasteTip}>
|
||||||
|
<CopyOutlined />
|
||||||
|
<span>支持 Ctrl+V 粘贴图片</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class={styles.footer}>
|
<div class={styles.footer}>
|
||||||
<Button type="primary" onClick={handleSubmit} loading={submitting.value}>
|
<Button type="primary" onClick={handleSubmit} loading={submitting.value}>
|
||||||
|
|||||||
Reference in New Issue
Block a user