king
2021-03-31 4f5f8002496e8b32c1ba83e9d3a0674e61c41c03
2021-03-31
2个文件已修改
30 ■■■■ 已修改文件
src/tabviews/zshare/mutilform/customTextArea/index.jsx 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/customTextArea/index.jsx
@@ -14,19 +14,19 @@
  state = {
    value: '',
    encryption: 'false'
    encryption: false
  }
  UNSAFE_componentWillMount () {
    let value = ''
    let encryption = 'false'
    let encryption = false
    if (this.props['data-__meta']) {
      value = this.props['data-__meta'].initialValue || ''
    }
    if (this.props.Item && this.props.Item.encryption === 'true') {
      encryption = 'true'
      encryption = true
      if (value) {
        try {
          value = window.decodeURIComponent(window.atob(value))
@@ -42,6 +42,22 @@
    })
  }
  UNSAFE_componentWillReceiveProps(nextProps) {
    const { value, encryption } = this.state
    if (!encryption && value !== nextProps.value) {
      this.setState({ value: nextProps.value || '' })
    } else if (encryption && window.btoa(window.encodeURIComponent(value)) !== nextProps.value) {
      let _value = nextProps.value || ''
      try {
        _value = window.decodeURIComponent(window.atob(_value))
      } catch {
        _value = nextProps.value || ''
      }
      this.setState({ value: _value })
    }
  }
  onChange = (e) => {
    const { encryption } = this.state
    let val = e.target.value
@@ -49,7 +65,7 @@
    this.setState({ value: val })
    let _val = val
    if (encryption === 'true') {
    if (encryption) {
      try {
        _val = window.btoa(window.encodeURIComponent(_val))
      } catch {
src/tabviews/zshare/mutilform/index.jsx
@@ -232,7 +232,9 @@
      formlist
    }, () => {
      if (action.setting && action.setting.focus) {
        this.selectInput(action.setting.focus)
        setTimeout(() => {
          this.selectInput(action.setting.focus)
        }, 500)
      }
      // 用来更新state,防止受控表单初始时不显示
      this.setState({
@@ -610,7 +612,7 @@
    // 表单切换时,更新关联字段
    if (_field.linkSubField) {
      let _data = _field.options.filter(op => op.Value === value)[0]
      if (_data) {
        _field.linkSubField.forEach(subfield => {
          if (this.props.form.getFieldValue(subfield) !== undefined) {