From 4c6bdfe1f3557e49a315c1564bcb6164c0bc7faa Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 03 四月 2020 18:27:22 +0800
Subject: [PATCH] 2020-04-03

---
 src/tabviews/zshare/fileupload/index.jsx |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/tabviews/zshare/fileupload/index.jsx b/src/tabviews/zshare/fileupload/index.jsx
index 682498f..2074c98 100644
--- a/src/tabviews/zshare/fileupload/index.jsx
+++ b/src/tabviews/zshare/fileupload/index.jsx
@@ -12,7 +12,9 @@
 
 class FileUpload extends Component {
   static propTpyes = {
-    value: PropTypes.array    // 鎸夐挳淇℃伅銆佽〃鍗曞垪琛�
+    value: PropTypes.array,    // 鎸夐挳淇℃伅銆佽〃鍗曞垪琛�
+    maxFile: PropTypes.any,    // 鏈�澶ф枃浠舵暟
+    fileType: PropTypes.string // 鏂囦欢鏄剧ず绫诲瀷
   }
 
   state = {
@@ -110,12 +112,19 @@
   }
 
   render() {
-    const { value } = this.props
+    const { value, maxFile, fileType } = this.props
     const { showprogress, percent, baseUrl } = this.state
+
+    let uploadable = ''
+
+    if (maxFile && maxFile > 0 && value && value.length >= maxFile) {
+      uploadable = 'limit-fileupload'
+    }
 
     const props = {
       name: 'file',
       disabled: showprogress,
+      listType: fileType,
       fileList: value,
       action: baseUrl,
       method: 'post',
@@ -125,7 +134,9 @@
       onRemove: this.onRemove,
       data: this.getExtraData,
       beforeUpload: this.beforeUpload,
+      className: uploadable
     }
+
     return (
       <Upload {...props}>
         <Button>

--
Gitblit v1.8.0