123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- import React from 'react';
- import { Input, Button, Form, Select, Upload, Icon, Spin, message, Radio , InputNumber } from 'antd';
- import './pfs.less';
- import YearSelect from '../../yearSelect.jsx';
- const FormItem = Form.Item;
- const RadioButton = Radio.Button;
- const RadioGroup = Radio.Group;
- const jingli_yuanxiao = 'XXX年获得博士学位,师从XXX名师;\nXXX年入职厦门大学,XXX年获评教授职称;\nXXX年成为厦门大学材料学院副院长;\n曾担任XXX届人大代表;\n曾担任XXX名企的科研顾问;\n从事科研研究8年,累计发表论文xxx篇,获得专利xx项。';
- const jingli_shehui = 'XXX年毕业于XXX名校,获得XXX学位;\nXXX年就职于XXX企业,担任XXX岗位;\nXXX年创办XXX企业或机构;\n曾担任XXX届人大代表。';
- const chengjiu_yuanxiao = '案例1:XXX年,主持(参与)XXX重大科研项目,该项目在XXX领域取了xxx成果,获得了xxx奖项。(纵向科研课题)\n案例2:XXX年,因为在xxx方面的科研成就,获得了xxx奖项。(科研奖项)\n案例3:XXX年,获得了XXX专利,该专利具有xxx价值。(专利,重点展现最核心最有价值的专利即可)\n案例4:XXX年,在XXX核心刊物上发表XXX论文,在XXX方面的研究上取得突破性成就。(科研成果,体现最有核心价值的即可)\n案例5:XXX年,与XXX企业合作进行XXX项目的研究,该项目投产后,实现了xxx的经济效益。(横向科研课题)\n案例6:XXX年,因xxx项目,获得厦门双百人才计划项目支持,该项目于XXX年正式投产,取得XXX经济效益。(技术创业)\n案例7:XXX年,担任xxx企业的技术总监,主持研发了XXX项目,该项目获得了xxx成就(经济效益、社会效益等)。(企业成就)';
- const chengjiu_shehui = '案例1:XXX年,担任xxx企业的XXX岗位,在该岗位上实现了XXX业绩。(职业经理人成就)\n案例2:XXX年,因xxx项目,获得厦门双百人才计划项目支持,该项目于XXX年正式投产,取得xxx经济效益或社会效益。(重大人才项目成就)\n案例3:XXX年,创办了XXX企业,该企业取得了xxx成就(经济效益、社会效益等)。(创业成就)\n案例4:XXX年,因为在xxx方面成就,被评为xxx风云人物。(社会荣誉成就)\n案例5:XXX年,曾主持xxx国家课题项目,该项目取得xxx成果。(重大课题成就)\n案例6:从业xxx年以来,为xxx企业提供过各类管理咨询和政策指导服务,其中,为xxx家企业服务,帮助其实现xxx效果。(服务类成就)'
- function getBase64(img, callback) {
- const reader = new FileReader();
- reader.addEventListener('load', () => callback(reader.result));
- reader.readAsDataURL(img);
- };
- function beforeUpload(file) {
- const isJPG = file.type === 'image/jpeg';
- if (!isJPG) {
- message.error('You can only upload JPG file!');
- }
- const isLt2M = file.size / 1024 / 1024 < 2;
- if (!isLt2M) {
- message.error('Image must smaller than 2MB!');
- }
- return isJPG && isLt2M;
- };
- class Avatar extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- imageUrl: ''
- }
- }
- handleChange(info) {
- if (info.file.status === 'done') {
- // Get this url from response in real world.
- getBase64(info.file.originFileObj, imageUrl => this.setState({ imageUrl }));
- }
- }
- render() {
- const imageUrl = this.state.imageUrl;
- return (
- <Upload
- className="avatar-uploader"
- name={this.props.name}
- showUploadList={false}
- action="/upload.do"
- beforeUpload={beforeUpload}
- onChange={this.handleChange}
- >
- {
- imageUrl ?
- <img src={imageUrl} role="presentation" id={this.props.name} /> :
- <Icon type="plus" className="avatar-uploader-trigger" />
- }
- </Upload>
- );
- }
- };
- const PfsFrom = Form.create()(React.createClass({
- getInitialState() {
- return {
- loading: false,
- };
- },
- handleSubmit(e) {
- e.preventDefault();
- this.props.form.validateFields((err, values) => {
- if (!err) {
- console.log('Received values of form: ', values);
- }
- });
- },
- normFile(e) {
- if (Array.isArray(e)) {
- return e;
- }
- return e && e.fileList;
- },
- zhichengyear(e) {
- this.state.zhichengyear = e;
- },
- zigeyear(e) {
- this.state.zigeyear = e;
- },
- jingliChange(e) {
- if (e.target.value == "a") {
- this.props.form.setFieldsValue({ 'jingli': "" })
- } else if (e.target.value == "b") {
- this.props.form.setFieldsValue({
- 'jingli': jingli_yuanxiao
- })
- } else if (e.target.value == "c") {
- this.props.form.setFieldsValue({
- 'jingli': jingli_shehui
- })
- }
- },
- chengjiuChange(e) {
- if (e.target.value == "a") {
- this.props.form.setFieldsValue({ 'chengjiu': "" })
- } else if (e.target.value == "b") {
- this.props.form.setFieldsValue({
- 'chengjiu': chengjiu_yuanxiao
- })
- } else if (e.target.value == "c") {
- this.props.form.setFieldsValue({
- 'chengjiu': chengjiu_shehui
- })
- }
- },
- render() {
- const { getFieldDecorator } = this.props.form;
- const formItemLayout = {
- labelCol: { span: 3 },
- wrapperCol: { span: 12 },
- };
- const _me = this;
- return (
- <Form horizontal onSubmit={this.handleSubmit} className="pfs-form">
- <FormItem
- {...formItemLayout}
- label="从事领域"
- help={'请输入所从事领域的名称,多个领域请以逗号隔开'}
- >
- {getFieldDecorator('lingyu')(
- <Input />
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 3 }}
- wrapperCol={{ span: 4 }}
- label="从业工龄"
- >
- {getFieldDecorator('gongling')(
- <div>
- <InputNumber /><span>年</span>
- </div>
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="职称名字"
- >
- {getFieldDecorator('zhichengname')(
- <Input />
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 3 }}
- wrapperCol={{ span: 6 }}
- label="取得时间"
- hasFeedback
- >
- {getFieldDecorator('zhichengyear')(
- <YearSelect handleyear={this.zhichengyear} />
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="职称证书"
- hasFeedback
- >
- {getFieldDecorator('zhichengimg')(
- <Avatar name="zhichengimg" />
- )}
- </FormItem>
- <div className="set-explain">
- <p>要求2M 以下的jpg、jpeg格式的图片。该资料不会公开展示,仅作为审核材料使用。</p>
- </div>
- <FormItem
- {...formItemLayout}
- label="执业资格"
- >
- {getFieldDecorator('zige')(
- <Input />
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 3 }}
- wrapperCol={{ span: 6 }}
- label="取得时间"
- hasFeedback
- >
- {getFieldDecorator('zigeyear')(
- <YearSelect handleyear={this.zigeyear} />
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="资格证明"
- hasFeedback
- >
- {getFieldDecorator('zigeimg')(
- <Avatar name="zigeimg" />
- )}
- </FormItem>
- <div className="set-explain">
- <p>要求2M 以下的jpg、jpeg格式的图片。该资料不会公开展示,仅作为审核材料使用。</p>
- </div>
- <FormItem
- {...formItemLayout}
- label="工作单位"
- >
- {getFieldDecorator('danwei')(
- <Input />
- )}
- </FormItem>
- <FormItem
- {...formItemLayout}
- label="职位头衔"
- >
- {getFieldDecorator('touxian')(
- <Input />
- )}
- </FormItem>
- <div className="textarea-title">
- <span>从业经历</span>
- <RadioGroup className="set-radio-button" onChange={this.jingliChange} defaultValue="a">
- <RadioButton value="a">自定义</RadioButton>
- <RadioButton value="b">院校专家模板</RadioButton>
- <RadioButton value="c">企业或社会专家模板</RadioButton>
- </RadioGroup>
- </div>
- <div className="set-explain">
- <p>您可使用模板直接编辑调整!</p>
- </div>
- <FormItem
- labelCol={{ span: 3 }}
- wrapperCol={{ span: 20, offset: 3 }}
- help={
- <div>
- <p>还可输入{
- (() => {
- if (_me.props.form.getFieldValue('jingli') && _me.props.form.getFieldValue('jingli').length) {
- return 1000 - _me.props.form.getFieldValue('jingli').length;
- } else {
- return 1000;
- }
- })()
- }字/1000</p>
- <p>描述您主要的从业履历,包括职业,最有亮点的社会兼职。可自定义或选择模板后直接编辑</p>
- </div>
- }
- label=""
- >
- {getFieldDecorator('jingli')(
- <Input type="textarea"
- rows={6} />
- )}
- </FormItem>
- <div className="textarea-title">
- <span>从业经历</span>
- <RadioGroup className="set-radio-button" onChange={this.chengjiuChange} defaultValue="a">
- <RadioButton value="a">自定义</RadioButton>
- <RadioButton value="b">院校专家模板</RadioButton>
- <RadioButton value="c">企业或社会专家模板</RadioButton>
- </RadioGroup>
- </div>
- <div className="set-explain">
- <p>您可使用模板直接编辑调整!</p>
- </div>
- <FormItem
- labelCol={{ span: 3 }}
- wrapperCol={{ span: 20, offset: 3 }}
- help={
- <div>
- <p>还可输入{
- (() => {
- if (_me.props.form.getFieldValue('chengjiu') && _me.props.form.getFieldValue('chengjiu').length) {
- return 1000 - _me.props.form.getFieldValue('chengjiu').length;
- } else {
- return 1000;
- }
- })()
- }字/1000</p>
- <p>描述您主要的从业履历,包括职业,最有亮点的社会兼职。可自定义或选择模板后直接编辑</p>
- </div>
- }
- label=""
- >
- {getFieldDecorator('chengjiu')(
- <Input type="textarea"
- rows={6} />
- )}
- </FormItem>
- <FormItem wrapperCol={{ span: 12, offset: 3 }}>
- <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
- </FormItem>
- </Form >
- );
- },
- }));
- const Pfs = React.createClass({
- getInitialState() {
- return {
- loading: false
- };
- },
- render() {
- return (
- <Spin spinning={this.state.loading} className='spin-box'>
- <div className="set-pfs">
- <div className="acc-detail">
- <p className="acc-title">职业信息</p>
- <PfsFrom />
- </div>
- </div>
- </Spin>
- )
- }
- });
- export default Pfs;
|