| | |
| | | |
| | | class NormalEditor extends Component { |
| | | static propTpyes = { |
| | | Item: PropTypes.object, // 表单元素 |
| | | onChange: PropTypes.func, // 表单更新 |
| | | config: PropTypes.object, |
| | | onChange: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, defaultValue } = this.props |
| | | let initVal = null |
| | | let encryption = 'false' |
| | | |
| | | if (this.props['data-__meta']) { |
| | | initVal = this.props['data-__meta'].initialValue || null |
| | | if (config && config.initval) { |
| | | initVal = config.initval |
| | | } else if (defaultValue) { |
| | | initVal = defaultValue |
| | | } |
| | | |
| | | if (this.props.Item && this.props.Item.encryption === 'true') { |
| | | if (config && config.encryption === 'true') { |
| | | encryption = 'true' |
| | | if (initVal) { |
| | | try { |
| | | initVal = window.decodeURIComponent(window.atob(initVal)) |
| | | } catch { |
| | | } catch (e) { |
| | | initVal = this.props['data-__meta'].initialValue || null |
| | | } |
| | | } |
| | |
| | | if (encryption === 'true') { |
| | | try { |
| | | val = window.btoa(window.encodeURIComponent(val)) |
| | | } catch { |
| | | } catch (e) { |
| | | val = editorState.toHTML() |
| | | } |
| | | } |
| | |
| | | form.append('fileExt', params.file.fileType) |
| | | form.append('shardingCnt', _param.chunks) |
| | | form.append('shardingNo', _param.chunk) |
| | | form.append('LoginUID', sessionStorage.getItem('LoginUID') || '') |
| | | |
| | | Api.getLargeFileUpload(form).then(res => { |
| | | if (res.status) { |