import React from 'react';
import { Icon, Modal, Button, Form, message, Input, Spin, Select, DatePicker, Upload } from 'antd';
import './patent.less';
import { intellectualGetList, catagoryList } from '../../dataDic.js';
import { beforeUploadFile, newDownloadFile } from '../../tools.js';
import ajax from 'jquery/src/ajax/xhr.js'
import $ from 'jquery/src/ajax';
import moment from 'moment';
const IntellectualDescFrom = Form.create()(React.createClass({
loadData(id, type) {
this.setState({
loading: true
});
$.ajax({
method: "get",
dataType: "json",
crossDomain: false,
url: globalConfig.context + "/api/user/cognizance/intellectualDetail",
data: {
id: id != undefined ? id : this.props.data.id,
type: type != undefined ? type : this.props.data.type
}
}).done((data) => {
if (!data.data) {
if (data.error && data.error.length) {
message.warning(data.error[0].message);
};
return;
};
this.setState({
id: data.data.id,
uid: data.data.uid,
pid: data.data.pid,
intellectualPropertyNumber: data.data.intellectualPropertyNumber,
intellectualPropertyName: data.data.intellectualPropertyName,
sortNumber: data.data.sortNumber,
catagory: data.data.catagory,
obtainWay: data.data.obtainWay,
authorizationNumber: data.data.authorizationNumber,
authorizationDate: data.data.authorizationDate,
propertyRightUrl: data.data.propertyRightUrl,
type: data.data.type,
manuscript: data.data.manuscript,
propertyRightDownloadFileName: data.data.propertyRightDownloadFileName,
authorizationDateFormattedDate: data.data.authorizationDateFormattedDate
});
}).always(function () {
this.setState({
loading: false
});
}.bind(this));
},
getInitialState() {
return {
loading: false,
intellectualGetOption: [],
catagoryOption: []
};
},
componentWillMount() {
let _me = this;
intellectualGetList.map(function (item) {
_me.state.intellectualGetOption.push(