From a1d7e81859f554f3a53680cc35f0f49bf1f77098 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 14 五月 2026 14:37:02 +0800
Subject: [PATCH] 导入项目
---
src/components/FormCreate/src/config/useUploadFileRule.ts | 80 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 80 insertions(+), 0 deletions(-)
diff --git a/src/components/FormCreate/src/config/useUploadFileRule.ts b/src/components/FormCreate/src/config/useUploadFileRule.ts
new file mode 100644
index 0000000..a1ea85e
--- /dev/null
+++ b/src/components/FormCreate/src/config/useUploadFileRule.ts
@@ -0,0 +1,80 @@
+import { generateUUID } from '@/utils'
+import { localeProps, makeRequiredRule } from '@/components/FormCreate/src/utils'
+
+export const useUploadFileRule = () => {
+ const label = '鏂囦欢涓婁紶'
+ const name = 'UploadFile'
+ return {
+ icon: 'icon-upload',
+ label,
+ name,
+ rule() {
+ return {
+ type: name,
+ field: generateUUID(),
+ title: label,
+ info: '',
+ $required: false
+ }
+ },
+ props(_, { t }) {
+ return localeProps(t, name + '.props', [
+ makeRequiredRule(),
+ {
+ type: 'select',
+ field: 'fileType',
+ title: '鏂囦欢绫诲瀷',
+ value: ['doc', 'xls', 'ppt', 'txt', 'pdf'],
+ options: [
+ { label: 'doc', value: 'doc' },
+ { label: 'xls', value: 'xls' },
+ { label: 'ppt', value: 'ppt' },
+ { label: 'txt', value: 'txt' },
+ { label: 'pdf', value: 'pdf' }
+ ],
+ props: {
+ multiple: true
+ }
+ },
+ {
+ type: 'switch',
+ field: 'autoUpload',
+ title: '鏄惁鍦ㄩ�夊彇鏂囦欢鍚庣珛鍗宠繘琛屼笂浼�',
+ value: true
+ },
+ {
+ type: 'switch',
+ field: 'drag',
+ title: '鎷栨嫿涓婁紶',
+ value: false
+ },
+ {
+ type: 'switch',
+ field: 'isShowTip',
+ title: '鏄惁鏄剧ず鎻愮ず',
+ value: true
+ },
+ {
+ type: 'inputNumber',
+ field: 'fileSize',
+ title: '澶у皬闄愬埗(MB)',
+ value: 5,
+ props: { min: 0 }
+ },
+ {
+ type: 'inputNumber',
+ field: 'limit',
+ title: '鏁伴噺闄愬埗',
+ value: 5,
+ props: { min: 0 }
+ },
+ {
+ type: 'switch',
+ field: 'disabled',
+ title: '鏄惁绂佺敤',
+ value: false
+ }
+ ])
+ }
+ }
+}
--
Gitblit v1.8.0