| | |
| | | import './index.scss'; |
| | | import Input from '../../libs/Input'; |
| | | // import Button from '../../libs/Button'; |
| | | import { Button } from 'antd'; |
| | | import { Button, Select } from 'antd'; |
| | | |
| | | // import Default from '../../assets/scale_default.png' |
| | | |
| | | const Option = Select.Option; |
| | | class QuestionnairContent extends React.PureComponent { |
| | | state = { |
| | | questionnairSign: false, |
| | | questionnairTitle: '', |
| | | questionnairDescription: '' |
| | | questionnairDescription: '', |
| | | questionnairBusinessType: '' |
| | | }; |
| | | |
| | | componentDidMount() { |
| | | const { title, content } = this.props.initData; |
| | | const { title, content, businessType } = this.props.initData; |
| | | console.log(title); |
| | | this.setState({ |
| | | questionnairTitle: title, |
| | | questionnairDescription: content |
| | | questionnairDescription: content, |
| | | questionnairBusinessType: businessType |
| | | }); |
| | | } |
| | | //新增题目时内容页滚动到底部 |
| | |
| | | ); |
| | | }; |
| | | |
| | | handleChange = (e, key) => { |
| | | handleChange = ({ target: { value, name } }) => { |
| | | console.log(value, name) |
| | | this.setState({ |
| | | [key]: e.target.value |
| | | [name]: value |
| | | }); |
| | | }; |
| | | } |
| | | |
| | | handleBlur = () => { |
| | | // const { onBlurTitle } = this.props; |
| | |
| | | const { |
| | | questionnairSign, |
| | | questionnairTitle, |
| | | questionnairDescription |
| | | questionnairDescription, |
| | | questionnairBusinessType |
| | | } = this.state; |
| | | const { submitQuestionTemp, editors, btnLoading } = this.props; |
| | | |
| | |
| | | <Input |
| | | placeholder="问卷标题" |
| | | value={questionnairTitle} |
| | | onChange={e => { |
| | | this.handleChange(e, 'questionnairTitle'); |
| | | }} |
| | | name='questionnairTitle' |
| | | onChange={this.handleChange} |
| | | onBlur={this.handleBlur} |
| | | style={{ |
| | | height: 45, |
| | |
| | | <Input |
| | | placeholder="问卷描述" |
| | | value={questionnairDescription} |
| | | onChange={e => { |
| | | this.handleChange(e, 'questionnairDescription'); |
| | | }} |
| | | name='questionnairDescription' |
| | | onChange={this.handleChange} |
| | | onBlur={this.handleBlur} |
| | | style={{ |
| | | height: 25, |
| | |
| | | /> |
| | | </div> |
| | | ); |
| | | const questionnairBusinessType1 = ( |
| | | <div className="title-inner" style={{ marginTop: 10 }}> |
| | | <span style={{ color: 'red' }}>*</span> |
| | | <Select placeholder="业务类型" |
| | | value={questionnairBusinessType} |
| | | style={{ |
| | | width: '100%', |
| | | textAlign: 'center', |
| | | fontSize: 18, |
| | | color: '#666', |
| | | fontFamily: 'PingFangSC-Medium' |
| | | }} |
| | | onChange={(value) => this.handleChange({ target: { name: 'questionnairBusinessType', value } })} |
| | | > |
| | | <Option value='1'>企业体检</Option> |
| | | <Option value='2'>培训活动</Option> |
| | | <Option value='3'>未检调查</Option> |
| | | <Option value='4'>刑执监督</Option> |
| | | </Select> |
| | | </div> |
| | | ); |
| | | return ( |
| | | <div className="questionnair-page" ref={el => (this.page = el)}> |
| | | <div className="questionnair-page-banner"> |
| | |
| | | <div className="questionnair-page-title"> |
| | | {questionnairtitleEl} |
| | | {questionnairDescriptionEl} |
| | | {questionnairBusinessType1} |
| | | </div> |
| | | <div |
| | | className="questionnair-page-content" |
| | |
| | | // this.props.isThereEditor(); |
| | | submitQuestionTemp(editors, { |
| | | questionnairTitle, |
| | | questionnairDescription |
| | | questionnairDescription, |
| | | questionnairBusinessType |
| | | }); |
| | | }} |
| | | > |