king
2021-10-13 5a995a24857abb0a1dac5e4c67c600e54db01539
src/templates/zshare/unattended/settingform/index.jsx
@@ -10,7 +10,9 @@
    actions: PropTypes.array
  }
  state = {}
  state = {
    enable: this.props.autoMatic.enable
  }
  handleConfirm = () => {
    // 表单提交时检查输入值是否正确
@@ -28,6 +30,7 @@
  render() {
    const { actions, autoMatic } = this.props
    const { getFieldDecorator } = this.props.form
    const { enable } = this.state
    const formItemLayout = {
      labelCol: {
@@ -48,7 +51,7 @@
              {getFieldDecorator('enable', {
                initialValue: autoMatic.enable,
              })(
                <Radio.Group>
                <Radio.Group onChange={(e) => this.setState({enable: e.target.value})}>
                  <Radio value="true">是</Radio>
                  <Radio value="false">否</Radio>
                </Radio.Group>
@@ -65,7 +68,7 @@
              {getFieldDecorator('action', {
                initialValue: autoMatic.action || '',
                rules: [{
                  required: true,
                  required: enable === 'true',
                  message: '请选择执行按钮!'
                }]
              })(
@@ -77,6 +80,24 @@
              )}
            </Form.Item>
          </Col>
          <Col span={20}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="按钮执行失败时,后续的处理方式。">
                <Icon type="question-circle" style={{color: '#c49f47', marginRight: '3px'}} />
                报错时
              </Tooltip>
            }>
              {getFieldDecorator('onFail', {
                initialValue: autoMatic.onFail,
              })(
                <Radio.Group onChange={(e) => this.setState({enable: e.target.value})}>
                  <Radio value="stop">停止</Radio>
                  <Radio value="skip">跳过</Radio>
                  <Radio value="again">重新执行</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
        </Row>
      </Form>
    )