king
2021-05-31 ce70be666bcd78a7e16e739040488cf7e7256cc2
src/tabviews/zshare/mutilform/index.jsx
@@ -1105,25 +1105,6 @@
          </Col>
        )
      } else if (item.type === 'fileupload') {
        let filelist = this.props.data ? this.props.data[item.field] : item.initval
        if (filelist && item.readin) {
          try {
            filelist = filelist.split(',').map((url, index) => {
              return {
                uid: `${index}`,
                name: url.slice(url.lastIndexOf('/') + 1),
                status: 'done',
                url: url,
                origin: true
              }
            })
          } catch {
            filelist = []
          }
        } else {
          filelist = []
        }
        fields.push(
          <Col span={item.span || 24} key={index}>
            <Form.Item
@@ -1138,7 +1119,7 @@
              }
            >
              {getFieldDecorator(item.field, {
                initialValue: filelist,
                initialValue: item.initval || '',
                rules: [
                  {
                    required: item.required === 'true',
@@ -1146,7 +1127,7 @@
                  }
                ]
              })(
                <FileUpload accept={item.suffix} maxFile={item.maxfile} fileType={item.fileType || 'text'} />
                <FileUpload config={item}/>
              )}
            </Form.Item>
          </Col>
@@ -1326,20 +1307,6 @@
              } else if (item.type === 'multiselect' || item.type === 'checkbox') {
                _value = _value ? _value.join(',') : ''
      
              } else if (item.type === 'fileupload') {
                let vals = []
                if (_value && _value.length > 0) {
                  _value.forEach(_val => {
                    if (_val.origin && _val.url) {
                      vals.push(_val.url)
                    } else if (!_val.origin && _val.status === 'done' && _val.response) {
                      vals.push(_val.response)
                    }
                  })
                }
                _value = vals.join(',')
              } else if (item.type === 'text' || item.type === 'textarea') {
                _value = _value.replace(/\t*|\v*/g, '')       // 去除制表符