king
2021-07-28 137fb8ea6af2789b3238b22bac31d80bced41dfe
src/menu/components/card/data-card/wrapsetting/settingform/index.jsx
@@ -6,14 +6,17 @@
class SettingForm extends Component {
  static propTpyes = {
    dict: PropTypes.object,      // 字典项
    config: PropTypes.object,    // 卡片行信息
    wrap: PropTypes.object,      // 数据源配置
    inputSubmit: PropTypes.func  // 回车事件
    dict: PropTypes.object,
    config: PropTypes.object,
    wrap: PropTypes.object,
    inputSubmit: PropTypes.func
  }
  state = {
    roleList: []
    roleList: [],
    appType: sessionStorage.getItem('appType'),
    cardType: this.props.wrap.cardType,
    MenuType: ''
  }
  UNSAFE_componentWillMount () {
@@ -28,7 +31,13 @@
      roleList = []
    }
    this.setState({roleList})
    let MenuType = ''
    if (window.GLOB.customMenu && window.GLOB.customMenu.parentId === 'BillPrintTemp') {
      MenuType = 'billPrint'
    }
    this.setState({roleList, MenuType})
  }
  handleConfirm = () => {
@@ -55,7 +64,7 @@
  render() {
    const { wrap, config } = this.props
    const { getFieldDecorator } = this.props.form
    const { roleList } = this.state
    const { roleList, MenuType, appType, cardType } = this.state
    const formItemLayout = {
      labelCol: {
@@ -132,7 +141,7 @@
                )}
              </Form.Item>
            </Col> : null}
            {config.subtype === 'datacard' ? <Col span={12}>
            {config.subtype === 'datacard' || (config.subtype === 'tablecard' && appType === 'mob') ? <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="数据源中选择分页时有效。">
                  <Icon type="question-circle" />
@@ -144,7 +153,8 @@
                })(
                  <Radio.Group>
                    <Radio value="page">页码</Radio>
                    <Radio value="switch">左右切换</Radio>
                    {appType !== 'mob' ? <Radio value="switch">左右切换</Radio> : null}
                    {appType === 'mob' ? <Radio value="slide">滑动加载</Radio> : null}
                  </Radio.Group>
                )}
              </Form.Item>
@@ -154,10 +164,22 @@
                {getFieldDecorator('cardType', {
                  initialValue: wrap.cardType || ''
                })(
                  <Radio.Group style={{whiteSpace: 'nowrap'}}>
                  <Radio.Group style={{whiteSpace: 'nowrap'}} onChange={(e) => this.setState({cardType: e.target.value})}>
                    <Radio key="" value=""> 不可选 </Radio>
                    <Radio key="radio" value={'radio'}> 单选 </Radio>
                    {config.subtype !== 'propcard' ? <Radio key="checkbox" value={'checkbox'}> 多选 </Radio> : null}
                  </Radio.Group>
                )}
              </Form.Item>
            </Col> : null}
            {config.subtype === 'datacard' && appType === 'mob' && cardType === 'checkbox' ? <Col span={12}>
              <Form.Item label="全选">
                {getFieldDecorator('checkAll', {
                  initialValue: wrap.checkAll || 'hidden'
                })(
                  <Radio.Group>
                    <Radio key="hidden" value="hidden"> 隐藏 </Radio>
                    <Radio key="show" value="show"> 显示 </Radio>
                  </Radio.Group>
                )}
              </Form.Item>
@@ -180,7 +202,7 @@
                )}
              </Form.Item>
            </Col> : null}
            {config.subtype !== 'tablecard' ? <Col span={12}>
            {config.subtype !== 'tablecard' && appType !== 'mob' ? <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="鼠标悬浮于卡片上方时,卡片放大1.05倍。">
                  <Icon type="question-circle" />
@@ -197,19 +219,7 @@
                )}
              </Form.Item>
            </Col> : null}
            {config.subtype === 'tablecard' ? <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="表格高度,超出时滚动,高度为空时根据内容自适应。">
                  <Icon type="question-circle" />
                  高度
                </Tooltip>
              }>
                {getFieldDecorator('height', {
                  initialValue: wrap.height
                })(<InputNumber min={100} max={2000} precision={0} onPressEnter={this.handleSubmit} />)}
              </Form.Item>
            </Col> : null}
            {config.subtype === 'propcard' ? <Col span={12}>
            {config.subtype === 'propcard' && MenuType === 'billPrint' ? <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="选择类型为《页眉/页脚》时,打印的每页里都会带有该组件。">
                  <Icon type="question-circle" />