From 2174f758e8a963964198e092f0d528ef1ae9b81e Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期二, 22 七月 2025 09:59:05 +0800 Subject: [PATCH] feat: 页面 --- src/views/Reward/components/UploadFileDialog.vue | 86 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 86 insertions(+), 0 deletions(-) diff --git a/src/views/Reward/components/UploadFileDialog.vue b/src/views/Reward/components/UploadFileDialog.vue new file mode 100644 index 0000000..23785ab --- /dev/null +++ b/src/views/Reward/components/UploadFileDialog.vue @@ -0,0 +1,86 @@ +<template> + <ProDialog + title="瀵煎叆" + v-model="visible" + @close="onDialogClose" + destroy-on-close + draggable + width="700px" + > + <ProForm :model="form" ref="dialogForm" label-width="120px"> + <ProFormItemV2 + label="涓婁紶鏂囦欢:" + prop="url" + :check-rules="[{ message: '璇蜂笂浼犳枃浠�', type: 'upload' }]" + > + <ProFormUpload v-model:file-url="form.url" accept="xlsx,xls"></ProFormUpload> + </ProFormItemV2> + <ProFormItemV2 + label="涓婁紶鍑瘉:" + prop="certificateUrl" + :check-rules="[{ message: '璇蜂笂浼犲嚟璇�', type: 'upload' }]" + > + <ProFormUpload + v-model:file-url="form.certificateUrl" + :limitFileSize="50" + accept="doc,docx,pdf,xls,xlsx,jpg/jpeg,png" + ></ProFormUpload> + </ProFormItemV2> + </ProForm> + <template #footer> + <span class="dialog-footer"> + <el-button @click="emit('onCancel')">鍙� 娑�</el-button> + <el-button type="primary" @click="handleConfirm">纭� 瀹�</el-button> + </span> + </template> + </ProDialog> +</template> + +<script setup lang="ts"> +import { FormInstance } from 'element-plus'; +import { + ProDialog, + ProForm, + ProFormItemV2, + UploadUserFile, + ProFormUpload, +} from '@bole-core/components'; + +defineOptions({ + name: 'UploadCertRewardDialog', +}); + +const visible = defineModel({ type: Boolean }); + +type Form = { + title?: string; + certificateUrl: UploadUserFile[]; + url: UploadUserFile[]; + parkBountyApplyId: string; +}; + +const form = defineModel<Form>('form'); + +const emit = defineEmits<{ + (e: 'onConfirm'): void; + (e: 'onCancel'): void; +}>(); + +const dialogForm = ref<FormInstance>(); + +function onDialogClose() { + if (!dialogForm.value) return; + dialogForm.value.resetFields(); +} + +function handleConfirm() { + if (!dialogForm.value) return; + dialogForm.value.validate((valid) => { + if (valid) { + emit('onConfirm'); + } else { + return; + } + }); +} +</script> -- Gitblit v1.9.1