| | |
| | | import './index.scss' |
| | | |
| | | const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent')) |
| | | const { TextArea } = Input |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | |
| | | } |
| | | |
| | | state = { |
| | | appMenus: [] |
| | | appMenus: [], |
| | | property: '' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | appMenus = [] |
| | | } |
| | | |
| | | this.setState({appMenus}) |
| | | this.setState({appMenus, property: this.props.wrap.property || ''}) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | render() { |
| | | const { wrap } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { appMenus } = this.state |
| | | const { appMenus, property } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="logo属性"> |
| | | {getFieldDecorator('property', { |
| | | initialValue: wrap.property || '' |
| | | })( |
| | | <Radio.Group onChange={(e) => this.setState({property: e.target.value})} style={{whiteSpace: 'nowrap'}}> |
| | | <Radio value="">空</Radio> |
| | | <Radio value="linkmenu">关联菜单</Radio> |
| | | <Radio value="link">链接</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {property === 'linkmenu' ? <Col span={12}> |
| | | <Form.Item label="logo链接"> |
| | | {getFieldDecorator('logolink', { |
| | | initialValue: wrap.logolink || '' |
| | | {getFieldDecorator('linkmenu', { |
| | | initialValue: wrap.linkmenu || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.select'] + '关联菜单!' |
| | | } |
| | | ] |
| | | })( |
| | | <Select |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | > |
| | | <Select.Option key="empty" intid={''} value={''}>无</Select.Option> |
| | | {appMenus.map(option => |
| | | <Select.Option key={option.MenuID} value={option.MenuID}>{option.MenuName}</Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | {property === 'link' ? <Col span={24}> |
| | | <Form.Item label="logo链接" className="textarea"> |
| | | {getFieldDecorator('link', { |
| | | initialValue: wrap.link || '', |
| | | rules: [{ |
| | | required: true, |
| | | message: '请输入链接地址!' |
| | | }] |
| | | })(<TextArea rows={2} />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="存在登录且取到登录信息时,显示用户头像、用户名及退出。"> |