dev01 месяцев назад: 2
Родитель
Сommit
af32aa7656

+ 24 - 11
js/component/common/imgList/index.js

@@ -72,20 +72,25 @@ class ImgList extends Component {
   }
 
   beforeUpload(file) {
-    const { isSupportPDF = false } = this.props
+    const { isSupportPDF = false, limitation = true } = this.props
     const isLt2M = file.size / 1024 / 1024 < 20;
-    if (!isLt2M) {
+    if (!isLt2M && limitation) {
       message.error('文件大小不能超过 20MB!');
       return isLt2M;
     }
     if (this.props.accept) {
-      if (isLt2M) {
-        this.state.newUploadArr.push(file)
-        this.setState({
-          newUploadArr: this.state.newUploadArr
-        })
-      }
-      return isLt2M;
+      this.state.newUploadArr.push(file)
+      this.setState({
+        newUploadArr: this.state.newUploadArr
+      })
+      return true;
+      // if (isLt2M) {
+      //   this.state.newUploadArr.push(file)
+      //   this.setState({
+      //     newUploadArr: this.state.newUploadArr
+      //   })
+      // }
+      // return isLt2M;
     } else {
       const isJPG = file.type.split('/');
       if (isSupportPDF) {
@@ -99,14 +104,22 @@ class ImgList extends Component {
           return false;
         }
       }
-      if (isJPG && isLt2M) {
+      if (isJPG) {
         // 用于计算当次选择的图片数量
         this.state.newUploadArr.push(file)
         this.setState({
           newUploadArr: this.state.newUploadArr
         })
       }
-      return isJPG && isLt2M;
+      return isJPG;
+      // if (isJPG && isLt2M) {
+      //   // 用于计算当次选择的图片数量
+      //   this.state.newUploadArr.push(file)
+      //   this.setState({
+      //     newUploadArr: this.state.newUploadArr
+      //   })
+      // }
+      // return isJPG && isLt2M;
     }
   }
 

+ 2 - 1
js/component/manageCenter/standard/stList/index.jsx

@@ -53,6 +53,7 @@ const PicturesWall = React.createClass({
       <div style={{ display: "inline-block" }}>
         <ImgList
           isSupportPDF={true}
+          limitation={false}
           domId={this.props.domId}
           uploadConfig={{
             action: globalConfig.context + "/api/admin/standard/uploadPicture",
@@ -117,7 +118,7 @@ const Standard = Form.create()(React.createClass({
           title: '参考',
           dataIndex: 'reference',
           key: 'reference',
-          render: (text, record) => <span>{['国家 ', '行业 ', '地方 ', '团体 ', '国际 ','企业 '][record.type]}{text}</span>
+          render: (text, record) => <span>{['国家 ', '行业 ', '地方 ', '团体 ', '国际 ', '企业 '][record.type]}{text}</span>
         },
         {
           title: '部门',