king
2023-12-01 7a6874905fa9c6cec03040b29c455db7e81fb22e
src/tabviews/zshare/fileupload/index.jsx
@@ -12,8 +12,9 @@
class FileUpload extends Component {
  static propTpyes = {
    config: PropTypes.object,  // 表单信息
    onChange: PropTypes.func,  // 表单变化
    data: PropTypes.any,
    config: PropTypes.object,
    onChange: PropTypes.func,
  }
  state = {
@@ -31,7 +32,7 @@
  }
  UNSAFE_componentWillMount () {
    const { config } = this.props
    const { config, data } = this.props
    let filelist = []
    if (config.initval) {
@@ -56,6 +57,12 @@
          })
        } catch (e) {
          filelist = []
        }
        if (data && config.subFields && config.subFields.length === 1 && filelist.length === 1) {
          if (data[config.subFields[0].field]) {
            filelist[0].name = data[config.subFields[0].field]
          }
        }
      }
    }
@@ -270,7 +277,7 @@
      percent: 0
    })
    let file_name = file.name.replace(/\.{1}[^.]*$/ig, '')
    let file_name = file.name
    if (compress === 'true' || compress === 'base64') {
      let reader = new FileReader()