| | |
| | | |
| | | 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 () { |
| | |
| | | roleList = [] |
| | | } |
| | | |
| | | this.setState({roleList}) |
| | | let MenuType = '' |
| | | |
| | | if (window.GLOB.customMenu && window.GLOB.customMenu.parentId === 'BillPrintTemp') { |
| | | MenuType = 'billPrint' |
| | | } |
| | | |
| | | this.setState({roleList, MenuType}) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | 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: { |
| | |
| | | )} |
| | | </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" /> |
| | |
| | | })( |
| | | <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> |
| | |
| | | {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> |
| | |
| | | )} |
| | | </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" /> |
| | |
| | | )} |
| | | </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" /> |