import React from 'react'; import { Switch, Icon, Button, Input, Spin, Table, message, Select, Modal, DatePicker } from 'antd'; import { technicalSourceList } from '../../../../dataDic.js'; import { getCatagory, getIntellectualObtainWay, getProportion, saveProportion } from '../../../../tools.js'; import moment from 'moment'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; import IntellectualDesc from './intellectualDesc.jsx'; const Intellectual = React.createClass({ loadData(pageNo) { this.state.data = []; this.setState({ loading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/intellectualList", data: { pageNo: pageNo || 1, pageSize: this.state.pagination.pageSize, uid: this.props.data.uid, startDate: this.state.startDateFormattedDate, endDate: this.state.endDateFormattedDate } }).done((data) => { if (data.error.length || !data.data || !data.data.list) { message.warning(data.error[0].message); return; }; for (let i = 0; i < data.data.list.length; i++) { let thisdata = data.data.list[i]; this.state.data.push({ key: i, id: thisdata.id, uid: thisdata.uid, intellectualPropertyNumber: thisdata.intellectualPropertyNumber, intellectualPropertyName: thisdata.intellectualPropertyName, sortNumber: thisdata.sortNumber, catagory: thisdata.catagory, obtainWay: thisdata.obtainWay, authorizationNumber: thisdata.authorizationNumber, authorizationDate: thisdata.authorizationDate, evaluationCategory: thisdata.evaluationCategory, authorizationDateFormattedDate: thisdata.authorizationDateFormattedDate, propertyRightUrl: thisdata.propertyRightUrl, propertyRightDownloadFileName: thisdata.propertyRightDownloadFileName, type: thisdata.type }); }; this.state.pagination.current = data.data.pageNo; this.state.pagination.total = data.data.totalCount; this.setState({ dataSource: this.state.data, pagination: this.state.pagination }); }).always(function () { this.setState({ loading: false }); }.bind(this)); let _me = this; getProportion(this.props.data.uid, function (data) { _me.setState({ proportion: data }); }); }, getInitialState() { return { selectedRowKeys: [], selectedRows: [], loading: false, pagination: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function (page) { this.loadData(page); }.bind(this), showTotal: function (total) { return '共' + total + '条数据'; } }, columns: [ { title: '知识产权编号', dataIndex: 'intellectualPropertyNumber', key: 'intellectualPropertyNumber' }, { title: '知识产权名称', dataIndex: 'intellectualPropertyName', key: 'intellectualPropertyName' }, { title: '排序号', dataIndex: 'sortNumber', key: 'sortNumber' }, { title: '知识产权类型', dataIndex: 'catagory', key: 'catagory', render: text => { return getCatagory(text) } }, { title: '获取方式', dataIndex: 'obtainWay', key: 'obtainWay', render: text => { return getIntellectualObtainWay(text) } }, { title: '授权号', dataIndex: 'authorizationNumber', key: 'authorizationNumber' }, { title: '授权时间', dataIndex: 'authorizationDateFormattedDate', key: 'authorizationDateFormattedDate' } ], dataSource: [] }; }, componentWillMount() { this.loadData(); }, tableRowClick(record, index) { this.state.RowData = record; this.setState({ showDesc: true }); }, delectRow() { let deletedIds = []; for (let idx = 0; idx < this.state.selectedRows.length; idx++) { let rowItem = this.state.selectedRows[idx]; if (rowItem.id) { deletedIds.push(rowItem.id) } } this.setState({ selectedRowKeys: [], loading: deletedIds.length > 0 }); $.ajax({ method: "POST", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/deleteIntellectual", data: { ids: deletedIds } }).done(function (data) { if (!data.error.length) { message.success('删除成功!'); this.setState({ loading: false, }); } else { message.warning(data.error[0].message); }; this.loadData(); }.bind(this)); }, closeDesc(e, s) { this.state.showDesc = e; if (s) { this.loadData(); }; }, search() { this.loadData(); }, reset() { this.state.startDateFormattedDate = undefined; this.state.endDateFormattedDate = undefined; this.loadData(); }, render() { const rowSelection = { selectedRowKeys: this.state.selectedRowKeys, onChange: (selectedRowKeys, selectedRows) => { this.setState({ selectedRows: selectedRows, selectedRowKeys: selectedRowKeys }); } }; const hasSelected = this.state.selectedRowKeys.length > 0; return (
知识产权列表 是否已完成: { e ? this.state.proportion.intellectualProperty = 1 : this.state.proportion.intellectualProperty = 0; saveProportion(this.state.proportion.id, this.props.data.uid, 'intellectualProperty', this.state.proportion.intellectualProperty); this.setState({ proportion: this.state.proportion }); }} /> SOOPAT 佰腾网 国家知识产权局 中国版权保护中心
开始日期: { this.setState({ startDateFormattedDate: dataString }); }} /> 结束日期: { this.setState({ endDateFormattedDate: dataString }); }} />

); } }); export default Intellectual;