king
2020-04-15 0c1c59933e95c4c691d6ba3d11bf4aef98fe9e8d
2020-04-15
1 文件已重命名
15个文件已修改
370 ■■■■■ 已修改文件
public/options.txt 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/formtab/formgroup/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/dragelement/card.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/index.jsx 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/index.jsx 75 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/billcodeform/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/contrastform/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/customform/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/customscript/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/index.jsx 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/uniqueform/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycardexcelin/customscript/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycardexcelin/index.jsx 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycardexcelin/uniqueform/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycardexcelout/index.jsx 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/options.txt
src/tabviews/formtab/formgroup/index.jsx
@@ -658,7 +658,8 @@
  }
  render() {
    const { groups, setting } = this.props
    const { setting } = this.props
    const { groups } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -673,7 +674,7 @@
    let _width = (setting && setting.width) || 100
    let keys = groups.map(group => group.uuid)
    return (
      <Form {...formItemLayout} className="form-tab-form-field">
        <Collapse
src/templates/comtableconfig/index.jsx
@@ -1396,98 +1396,22 @@
  verifySubmit = () => {
    const { card } = this.state
    let config = JSON.parse(JSON.stringify(this.state.config))
    if (card.OpenType === 'excelIn') {
      this.verifyRef.handleConfirm().then(res => {
        config.action = config.action.map(item => {
          if (item.uuid === card.uuid) {
            item.verify = res
          }
          return item
        })
        this.setState({
          profileVisible: false,
          config: config,
          card: '',
        })
      })
    } else if (card.execMode) {
      this.verifyRef.handleConfirm().then(res => {
        config.action = config.action.map(item => {
          if (item.uuid === card.uuid) {
            item.verify = res
          }
          return item
        })
        this.setState({
          profileVisible: false,
          config: config,
          card: '',
        })
      })
    } else {
      let _verify = this.verifyRef.state.verify
      let _loading = this.verifyRef.state.updateloading
      if (card.OpenType !== 'excelOut' && _verify.default === 'false' && _verify.scripts.length === 0) {
        notification.warning({
          top: 92,
          message: '不执行默认sql时,必须设置自定义脚本!',
          duration: 10
        })
        return
      } else if (card.OpenType === 'excelOut') {
        let _cols = _verify.columns.map(col => col.Column)
        let _vcols = Array.from(new Set(_cols))
        if (_cols.length > _vcols.length) {
          notification.warning({
            top: 92,
            message: 'Excel列字段名,不可重复!',
            duration: 10
          })
          return
        }
      }
    this.verifyRef.handleConfirm().then(res => {
      config.action = config.action.map(item => {
        if (item.uuid === card.uuid) {
          item.verify = _verify
          item.verify = res
        }
  
        return item
      })
  
      if (_loading) {
        let _this = this
        confirm({
          content: `存在未保存项,确定提交吗?`,
          okText: this.state.dict['header.confirm'],
          cancelText: this.state.dict['header.cancel'],
          onOk() {
            _this.setState({
              profileVisible: false,
              config: config,
              card: '',
            })
          },
          onCancel() {}
        })
      } else {
        this.setState({
          profileVisible: false,
          config: config,
          card: '',
        })
      }
    }
      this.setState({
        profileVisible: false,
        config: config,
        card: ''
      })
    })
  }
  /**
src/templates/formtabconfig/dragelement/card.jsx
@@ -143,7 +143,7 @@
        }
      </div>
      {type === 'action' ? <Icon className="edit" title="编辑" type="edit" onClick={edit} /> : null}
      {type === 'action' && card.btnType === 'confirm' && card.intertype === 'inner' && !card.innerFunc ?
      {type === 'action' && card.btnType !== 'cancel' ?
        <Icon className="edit profile" title="校验规则" type="profile" onClick={profile} /> : null
      }
      {type === 'action' && card.btnType !== 'confirm' && card.btnType !== 'cancel' && <Icon className="edit close" title="删除" type="close" onClick={del} />}
src/templates/formtabconfig/index.jsx
@@ -1009,20 +1009,21 @@
  verifySubmit = () => {
    const { card } = this.state
    let config = JSON.parse(JSON.stringify(this.state.config))
    let _verify = this.verifyRef.state.verify
    config.action = config.action.map(item => {
      if (item.uuid === card.uuid) {
        item.verify = _verify
      }
      return item
    })
    this.setState({
      profileVisible: false,
      config: config,
      card: '',
    this.verifyRef.handleConfirm().then(res => {
      config.action = config.action.map(item => {
        if (item.uuid === card.uuid) {
          item.verify = res
        }
        return item
      })
      this.setState({
        profileVisible: false,
        config: config,
        card: ''
      })
    })
  }
src/templates/subtableconfig/index.jsx
@@ -25,6 +25,7 @@
import GridBtnForm from '@/templates/zshare/gridbtnform'
import EditCard from '@/templates/zshare/editcard'
import VerifyCard from '@/templates/zshare/verifycard'
import VerifyCardPrint from '@/templates/zshare/verifycardprint'
import VerifyCardExcelIn from '@/templates/zshare/verifycardexcelin'
import VerifyCardExcelOut from '@/templates/zshare/verifycardexcelout'
import MenuForm from '@/templates/zshare/menuform'
@@ -1067,67 +1068,11 @@
    const { card } = this.state
    let config = JSON.parse(JSON.stringify(this.state.config))
    
    if (card.OpenType === 'excelIn') {
      this.verifyRef.handleConfirm().then(res => {
        config.action = config.action.map(item => {
          if (item.uuid === card.uuid) {
            item.verify = res
          }
          return item
        })
        this.setState({
          profileVisible: false,
          config: config,
          card: ''
        })
      })
    } else if (card.execMode) {
      this.verifyRef.handleConfirm().then(res => {
        config.action = config.action.map(item => {
          if (item.uuid === card.uuid) {
            item.verify = res
          }
          return item
        })
        this.setState({
          profileVisible: false,
          config: config,
          card: '',
        })
      })
    } else {
      let _verify = this.verifyRef.state.verify
      if (card.OpenType !== 'excelOut' && _verify.default === 'false' && _verify.scripts.length === 0) {
        notification.warning({
          top: 92,
          message: '不执行默认sql时,必须设置自定义脚本!',
          duration: 10
        })
        return
      } else if (card.OpenType === 'excelOut') {
        let _cols = _verify.columns.map(col => col.Column)
        let _vcols = Array.from(new Set(_cols))
        if (_cols.length > _vcols.length) {
          notification.warning({
            top: 92,
            message: 'Excel列字段名,不可重复!',
            duration: 10
          })
          return
        }
      }
    this.verifyRef.handleConfirm().then(res => {
      config.action = config.action.map(item => {
        if (item.uuid === card.uuid) {
          item.verify = _verify
          item.verify = res
        }
  
        return item
@@ -1138,7 +1083,7 @@
        config: config,
        card: ''
      })
    }
    })
  }
  /**
@@ -2646,7 +2591,7 @@
          onCancel={() => { this.setState({ profileVisible: false }) }}
          destroyOnClose
        >
          {this.state.card && this.state.card.OpenType !== 'excelIn' ?
          {this.state.card && !this.state.card.execMode && this.state.card.OpenType !== 'excelIn' && this.state.card.OpenType !== 'excelOut' ?
            <VerifyCard
              floor="subtable"
              card={this.state.card}
@@ -2655,6 +2600,14 @@
              wrappedComponentRef={(inst) => this.verifyRef = inst}
            /> : null
          }
          {this.state.card && this.state.card.execMode ?
            <VerifyCardPrint
              card={this.state.card}
              dict={this.state.dict}
              columns={config.columns}
              wrappedComponentRef={(inst) => this.verifyRef = inst}
            /> : null
          }
          {this.state.card && this.state.card.OpenType === 'excelIn' ?
            <VerifyCardExcelIn
              card={this.state.card}
src/templates/zshare/verifycard/billcodeform/index.jsx
@@ -180,11 +180,10 @@
          values.linkFieldName = _billField ? _billField.label : ''
        }
        this.props.orderChange(values)
        this.setState({
          editItem: null
        }, () => {
          this.props.orderChange(values)
          let _usedfields = this.props.billcodes.map(item => item.field)
          this.setState({
src/templates/zshare/verifycard/contrastform/index.jsx
@@ -35,9 +35,10 @@
      if (!err) {
        values.uuid = this.state.editItem ? this.state.editItem.uuid : ''
        this.props.contrastChange(values)
        this.setState({
          editItem: null
        }, () => {
          this.props.contrastChange(values)
        })
        this.props.form.setFieldsValue({
          frontfield: '',
src/templates/zshare/verifycard/customform/index.jsx
@@ -86,10 +86,11 @@
        this.setState({loading: true})
        Api.getLocalConfig(param).then(res => {
          if (res.status) {
            this.props.customChange(values)
            this.setState({
              loading: false,
              editItem: null
            }, () => {
              this.props.customChange(values)
            })
            this.props.form.setFieldsValue({
              sql: '',
src/templates/zshare/verifycard/customscript/index.jsx
@@ -32,7 +32,6 @@
    })
  }
  handleConfirm = () => {
    // 表单提交时检查输入值是否正确
    this.props.form.validateFieldsAndScroll((err, values) => {
@@ -86,10 +85,11 @@
        this.setState({loading: true})
        Api.getLocalConfig(param).then(res => {
          if (res.status) {
            this.props.scriptsChange(values)
            this.setState({
              loading: false,
              editItem: null
            }, () => {
              this.props.scriptsChange(values)
            })
            this.props.form.setFieldsValue({
              sql: ''
src/templates/zshare/verifycard/index.jsx
@@ -15,6 +15,7 @@
import './index.scss'
const { TabPane } = Tabs
const { confirm } = Modal
class VerifyCard extends Component {
  static propTpyes = {
@@ -27,7 +28,6 @@
  }
  state = {
    updateloading: false, // 修改中
    initsql: '',          // sql验证时变量声明及赋值
    verify: {},
    fields: [],
@@ -772,25 +772,6 @@
    })
  }
  updateChange = () => {
    let _loading = false
    if (this.customForm && this.customForm.state.editItem) {
      _loading = true
    } else if (this.uniqueForm && this.uniqueForm.state.editItem) {
      _loading = true
    } else if (this.orderForm && this.orderForm.state.editItem) {
      _loading = true
    } else if (this.scriptsForm && this.scriptsForm.state.editItem) {
      _loading = true
    } else if (this.contrastForm && this.contrastForm.state.editItem) {
      _loading = true
    }
    this.setState({
      updateloading: _loading
    })
  }
  uniqueChange = (values) => {
    let verify = JSON.parse(JSON.stringify(this.state.verify))
@@ -809,8 +790,6 @@
    this.setState({
      verify: verify
    }, () => {
      this.updateChange()
    })
  }
@@ -832,8 +811,6 @@
    this.setState({
      verify: verify
    }, () => {
      this.updateChange()
    })
  }
@@ -855,8 +832,6 @@
    this.setState({
      verify: verify
    }, () => {
      this.updateChange()
    })
  }
@@ -878,8 +853,6 @@
    this.setState({
      verify: verify
    }, () => {
      this.updateChange()
    })
  }
@@ -901,8 +874,6 @@
    this.setState({
      verify: verify
    }, () => {
      this.updateChange()
    })
  }
@@ -960,10 +931,6 @@
        }
      }, 10)
    }
    this.setState({
      updateloading: true
    })
  }
  handleStatus = (record, type) => {
@@ -1165,6 +1132,55 @@
    })
  }
  handleConfirm = () => {
    let verify = JSON.parse(JSON.stringify(this.state.verify))
    // 表单提交时检查输入值是否正确
    return new Promise((resolve, reject) => {
      if (verify.default === 'false' && verify.scripts.length === 0) {
        notification.warning({
          top: 92,
          message: '不执行默认sql时,必须设置自定义脚本!',
          duration: 10
        })
        return
      }
      let _loading = false
      if (this.customForm && this.customForm.state.editItem) {
        _loading = true
      } else if (this.uniqueForm && this.uniqueForm.state.editItem) {
        _loading = true
      } else if (this.orderForm && this.orderForm.state.editItem) {
        _loading = true
      } else if (this.scriptsForm && this.scriptsForm.state.editItem) {
        _loading = true
      } else if (this.contrastForm && this.contrastForm.state.editItem) {
        _loading = true
      }
      if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) {
        _loading = true
      } else if (this.customForm && this.customForm.props.form.getFieldValue('sql')) {
        _loading = true
      }
      if (_loading) {
        confirm({
          content: `存在未保存项,确定提交吗?`,
          okText: this.props.dict['header.confirm'],
          cancelText: this.props.dict['header.cancel'],
          onOk() {
            resolve(verify)
          },
          onCancel() {}
        })
      } else {
        resolve(verify)
      }
    })
  }
  /**
   * @description 组件销毁,清除state更新
   */
src/templates/zshare/verifycard/uniqueform/index.jsx
@@ -46,9 +46,10 @@
        values.fieldlabel = values.fieldlabel.join(',')
        values.field = values.field.join(',')
        this.props.uniqueChange(values)
        this.setState({
          editItem: null
        }, () => {
          this.props.uniqueChange(values)
        })
        this.props.form.setFieldsValue({
          field: [],
src/templates/zshare/verifycardexcelin/customscript/index.jsx
@@ -137,10 +137,11 @@
        this.setState({loading: true})
        Api.getLocalConfig(param).then(res => {
          if (res.status) {
            this.props.scriptsChange(values)
            this.setState({
              loading: false,
              editItem: null
            }, () => {
              this.props.scriptsChange(values)
            })
            this.props.form.setFieldsValue({
              sql: ''
src/templates/zshare/verifycardexcelin/index.jsx
@@ -20,7 +20,6 @@
  }
  state = {
    updateloading: false, // 修改中
    verify: {},
    excelColumns: [
      {
@@ -283,8 +282,6 @@
    this.setState({
      verify: verify
    }, () => {
      this.updateChange()
    })
  }
@@ -306,8 +303,6 @@
    this.setState({
      verify: verify
    }, () => {
      this.updateChange()
    })
  }
@@ -329,23 +324,6 @@
    this.setState({
      verify: verify
    }, () => {
      this.updateChange()
    })
  }
  updateChange = () => {
    let _loading = false
    if (this.columnForm && this.columnForm.state.editItem) {
      _loading = true
    } else if (this.scriptsForm && this.scriptsForm.state.editItem) {
      _loading = true
    } else if (this.uniqueForm && this.uniqueForm.state.editItem) {
      _loading = true
    }
    this.setState({
      updateloading: _loading
    })
  }
@@ -386,10 +364,6 @@
        }
      }, 10)
    }
    this.setState({
      updateloading: true
    })
  }
  handleStatus = (record, type) => {
@@ -518,7 +492,20 @@
            }
          }
          if (this.state.updateloading) {
          let _loading = false
          if (this.columnForm && this.columnForm.state.editItem) {
            _loading = true
          } else if (this.scriptsForm && this.scriptsForm.state.editItem) {
            _loading = true
          } else if (this.uniqueForm && this.uniqueForm.state.editItem) {
            _loading = true
          }
          if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) {
            _loading = true
          }
          if (_loading) {
            confirm({
              content: `存在未保存项,确定提交吗?`,
              okText: this.props.dict['header.confirm'],
src/templates/zshare/verifycardexcelin/uniqueform/index.jsx
@@ -46,9 +46,10 @@
        values.fieldlabel = values.fieldlabel.join(',')
        values.field = values.field.join(',')
        this.props.uniqueChange(values)
        this.setState({
          editItem: null
        }, () => {
          this.props.uniqueChange(values)
        })
        this.props.form.setFieldsValue({
          field: [],
src/templates/zshare/verifycardexcelout/index.jsx
@@ -190,6 +190,28 @@
    })
  }
  handleConfirm = () => {
    let verify = JSON.parse(JSON.stringify(this.state.verify))
    // 表单提交时检查输入值是否正确
    return new Promise((resolve, reject) => {
      let _cols = verify.columns.map(col => col.Column)
      let _vcols = Array.from(new Set(_cols))
      if (_cols.length > _vcols.length) {
        notification.warning({
          top: 92,
          message: 'Excel列字段名,不可重复!',
          duration: 10
        })
        return
      }
      resolve(verify)
    })
  }
  render() {
    const { verify, excelColumns } = this.state
    const formItemLayout = {