Commit febb13ed by wangshufen

fixed:kinase bug修复

parent 36c9821b
{ {
"presets":["react-app"], "presets": ["react-app"],
"plugins": [ "plugins": [["import", { "libraryName": "antd", "libraryDirectory": "es", "style": "css" }], ["transform-decorators-legacy"]]
["import", { "libraryName": "antd", "libraryDirectory": "es", "style": "css" }], }
["transform-decorators-legacy"]
]
}
\ No newline at end of file
module.exports = {
root: true, //此项是用来告诉eslint找当前配置文件不能往父级查找
env: {
node: true,
},
// "off" -> 0 关闭规则 "warn" -> 1 开启警告规则 "error" -> 2 开启错误规则
rules: {
'generator-star-spacing': 'off',
'no-tabs': 'off',
'no-unused-vars': 'off', //声明的变量未使用
'no-console': 'off',
'no-irregular-whitespace': 'off',
'no-debugger': 'off',
eqeqeq: 'off', // 使用全等
},
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 7,
sourceType: 'module',
},
};
{
"compilerOptions": {
"baseUrl": "./",
"experimentalDecorators": true,
"paths": {
"@/*": ["src/*"]
}
}
}
import React, { Component } from 'react' import React, { Component } from 'react'
import { Pagination,message,Button,Tabs,Spin,Table,Tag,Typography} from 'antd'; import { Pagination,message,Button,Tabs,Spin,Table,Tag,Typography} from 'antd';
import { request } from '../../../utils/request' import request from '../../../utils/request'
import './index.css' import './index.css'
import qs from 'qs' import qs from 'qs'
const { Title } = Typography; const { Title } = Typography;
......
import React, { Component } from 'react' import React, { Component } from 'react'
import { Card,Tooltip,Popover,message,Radio,Button,Tabs,Spin,Table,Tag,Input, Collapse,Modal,Form,Select,InputNumber,Typography} from 'antd'; import { Card,Tooltip,Popover,message,Radio,Button,Tabs,Spin,Table,Tag,Input, Collapse,Modal,Form,Select,InputNumber,Typography} from 'antd';
import { request } from '../../../utils/request' import request from '../../../utils/request'
import Molstar from "molstar-react"; import Molstar from "molstar-react";
import { Jsme } from 'jsme-react' import { Jsme } from 'jsme-react'
import qs from 'qs' import qs from 'qs'
......
import React, { Component } from 'react' import React, { Component } from 'react'
import { Card,Tooltip,Popover,message,Radio,Button,Icon,Tabs,Spin,Table,Tag,Input, Collapse,Modal,Form,Select,InputNumber,Typography, Dropdown} from 'antd'; import { Card,Tooltip,Popover,message,Radio,Button,Icon,Tabs,Spin,Table,Tag,Input, Collapse,Modal,Form,Select,InputNumber,Typography, Dropdown} from 'antd';
import { request } from '../../../utils/request' import request from '../../../utils/request'
import Molstar from "molstar-react"; import Molstar from "molstar-react";
import { Jsme } from 'jsme-react' import { Jsme } from 'jsme-react'
import qs from 'qs' import qs from 'qs'
......
import React, { Component } from 'react' import React, { Component } from 'react'
import { Card,Tooltip,message,Button,Tabs,Spin,Table,Tag, Collapse,Divider,Modal,Form,Select,InputNumber,Popover} from 'antd'; import { Card,Tooltip,message,Button,Tabs,Spin,Table,Tag, Collapse,Divider,Modal,Form,Select,InputNumber,Popover} from 'antd';
import { request } from '../../../utils/request' import request from '../../../utils/request'
import Molstar from "molstar-react"; import Molstar from "molstar-react";
import { Jsme } from 'jsme-react' import { Jsme } from 'jsme-react'
import qs from 'qs' import qs from 'qs'
......
import React, { Component } from 'react' import React, { Component } from 'react'
import { Jsme } from 'jsme-react' import { Jsme } from 'jsme-react'
import { Card,Button,Pagination,Tabs,Spin,message ,Tag} from 'antd'; import { Card,Button,Pagination,Tabs,Spin,message ,Tag} from 'antd';
import { request } from '../../../utils/request' import request from '../../../utils/request'
import qs from 'qs' import qs from 'qs'
import './index.css' import './index.css'
const { TabPane } = Tabs; const { TabPane } = Tabs;
......
import React, { Component } from 'react' import React, { Component } from 'react'
import { Card,Tooltip,Popover,message,Radio,Button,Tabs,Spin,Table,Tag,Input, Collapse,Modal,Form,Select,InputNumber,Typography} from 'antd'; import { Card,Tooltip,Popover,message,Radio,Button,Tabs,Spin,Table,Tag,Input, Collapse,Modal,Form,Select,InputNumber,Typography} from 'antd';
import { request } from '../../../utils/request' import request from '../../../utils/request'
import Molstar from "molstar-react"; import Molstar from "molstar-react";
import { Jsme } from 'jsme-react' import { Jsme } from 'jsme-react'
import qs from 'qs' import qs from 'qs'
......
...@@ -3,7 +3,7 @@ import { Form, Input, Button,Select ,Tabs,message,Radio,Checkbox,Row ,Col} from ...@@ -3,7 +3,7 @@ import { Form, Input, Button,Select ,Tabs,message,Radio,Checkbox,Row ,Col} from
import LogoTitlte from '../../components/LogoTitlte/index' import LogoTitlte from '../../components/LogoTitlte/index'
import { Jsme } from 'jsme-react' import { Jsme } from 'jsme-react'
import qs from 'qs' import qs from 'qs'
import { request } from '../../utils/request' import request from '../../utils/request'
import './style.css' import './style.css'
const { TabPane } = Tabs; const { TabPane } = Tabs;
const { Option } = Select; const { Option } = Select;
......
import React, { Component } from 'react' import React, { Component } from 'react'
import { Pagination, message, Button, Tabs, Spin, Table, Tag, Typography } from 'antd' import { Pagination, message, Button, Tabs, Spin, Table, Tag, Typography } from 'antd'
import { request } from '../../../utils/request' import request from '../../../utils/request'
import './index.css' import './index.css'
import qs from 'qs' import qs from 'qs'
const { Title } = Typography const { Title } = Typography
...@@ -15,7 +15,7 @@ export default class IndicationDetails extends Component { ...@@ -15,7 +15,7 @@ export default class IndicationDetails extends Component {
} }
getDetails () { getDetails () {
this.setState({ loading: true }) this.setState({ loading: true })
request.post('/gpcr/indication_search', this.state.smilesData) request.post('/kinase/indication_search', this.state.smilesData)
.then(res => { .then(res => {
this.setState({ loading: false }) this.setState({ loading: false })
if (res.data.code === 200) { if (res.data.code === 200) {
......
...@@ -18,7 +18,7 @@ import { ...@@ -18,7 +18,7 @@ import {
Menu, Menu,
Dropdown, Dropdown,
} from 'antd' } from 'antd'
import { request } from '../../../utils/request' import request from '../../../utils/request'
import Molstar from 'molstar-react' import Molstar from 'molstar-react'
import { Jsme } from 'jsme-react' import { Jsme } from 'jsme-react'
import qs from 'qs' import qs from 'qs'
......
import React, { Component } from 'react' import React, { Component } from 'react';
import { import { Card, Tooltip, message, Button, Tabs, Spin, Table, Tag, Collapse, Input, Modal, Form, Select, InputNumber, Popover, Pagination, Anchor, Icon, Badge, Menu, Dropdown } from 'antd';
Card, import WrappedIframe from '../../../components/iframePdb';
Tooltip, import request from '../../../utils/request';
message, import Molstar from 'molstar-react';
Button, import { Jsme } from 'jsme-react';
Tabs, import qs from 'qs';
Spin, import './index.css';
Table, const { Panel } = Collapse;
Tag, const { TabPane } = Tabs;
Collapse, const { Option } = Select;
Input, const { Link } = Anchor;
Modal, let id = 0;
Form,
Select,
InputNumber,
Popover,
Pagination,
Anchor,
Icon,
Badge,
Menu,
Dropdown,
} from 'antd'
import WrappedIframe from '../../../components/iframePdb'
import { request } from '../../../utils/request'
import Molstar from 'molstar-react'
import { Jsme } from 'jsme-react'
import qs from 'qs'
import './index.css'
const { Panel } = Collapse
const { TabPane } = Tabs
const { Option } = Select
const { Link } = Anchor
let id = 0
@Form.create() @Form.create()
export default class SearchDetails extends Component { export default class SearchDetails extends Component {
...@@ -140,48 +118,48 @@ export default class SearchDetails extends Component { ...@@ -140,48 +118,48 @@ export default class SearchDetails extends Component {
total_num3: 0, total_num3: 0,
aciveKey: '', aciveKey: '',
directoryState: false, directoryState: false,
};
componentDidMount() {
this.getDetails();
} }
componentDidMount () { getDetails() {
this.getDetails()
}
getDetails () {
// this.setState({loading:true}) // this.setState({loading:true})
this.setState({ loading: true }) this.setState({ loading: true });
request request
.post('kinase/drug_detail', qs.parse(this.props.location.search.slice(1))) .post('kinase/drug_detail', qs.parse(this.props.location.search.slice(1)))
.then((res) => { .then((res) => {
this.setState({ loading: false }) this.setState({ loading: false });
if (res.data.code === 200) { if (res.data.code === 200) {
let data = res.data.data let data = res.data.data;
console.log(data) console.log(data);
this.setState({ this.setState({
DetailsData: data, DetailsData: data,
}) });
this.setState({ Calculated_propeties: data.Calculated_propeties }) this.setState({ Calculated_propeties: data.Calculated_propeties });
this.setState({ Biological_propeties: data.biological_propeties }) this.setState({ Biological_propeties: data.biological_propeties });
this.setState({ loading: false }) this.setState({ loading: false });
let StructureList = data.Structure let StructureList = data.Structure;
if (StructureList.length > 0) { if (StructureList.length > 0) {
this.getStructure(StructureList[0].pdb) this.getStructure(StructureList[0].pdb);
this.setState({ this.setState({
aciveKey: StructureList[0].pdb, aciveKey: StructureList[0].pdb,
}) });
} }
this.getBioassayList() this.getBioassayList();
this.getTargetList() this.getTargetList();
this.getIndicationList() this.getIndicationList();
} else { } else {
message.error(res.data.msg) message.error(res.data.msg);
} }
}) })
.catch((err) => { .catch((err) => {
console.error(err) console.error(err);
}) });
} }
getStructure = (e) => { getStructure = (e) => {
console.log(e) console.log(e);
request request
.post( .post(
'/search_pdb_data', '/search_pdb_data',
...@@ -190,373 +168,360 @@ export default class SearchDetails extends Component { ...@@ -190,373 +168,360 @@ export default class SearchDetails extends Component {
}) })
) )
.then((res) => { .then((res) => {
this.setState({ loading: false }) this.setState({ loading: false });
if (res.data.code === 200) { if (res.data.code === 200) {
this.setState({ getStructureList: res.data.data }) this.setState({ getStructureList: res.data.data });
let listData = this.state.listData let listData = this.state.listData;
listData.pdb_code = res.data.data.name listData.pdb_code = res.data.data.name;
listData.ligand = '' listData.ligand = '';
listData.resolution = 0 listData.resolution = 0;
this.setState({ listData }) this.setState({ listData });
// debugger;
let pdbLink = let pdbLink = 'http://52.83.169.190:3004/?id=' + JSON.stringify(listData);
'http://52.83.169.190:3004/?id=' + JSON.stringify(listData)
this.setState({ this.setState({
pdbLink, pdbLink,
}) });
} else { } else {
message.error(res.data.msg) message.error(res.data.msg);
} }
}) })
.catch((err) => { .catch((err) => {
console.error(err) console.error(err);
}) });
} };
ChangeTabs = (e) => { ChangeTabs = (e) => {
this.setState({ this.setState({
aciveKey: e, aciveKey: e,
}) });
this.setState({ this.setState({
pdbLink: '', pdbLink: '',
}) });
let listData = this.state.listData let listData = this.state.listData;
listData.ligand = '' listData.ligand = '';
listData.resolution = 0 listData.resolution = 0;
if (listData.pdbList) { if (listData.pdbList) {
delete listData.pdbList delete listData.pdbList;
} }
this.setState({ this.setState({
listData: listData, listData: listData,
pdbLink: '', pdbLink: '',
}) });
this.getStructure(e) this.getStructure(e);
} };
getPdid (e) { getPdid(e) {
console.log(e) console.log(e);
this.setState({ visible: true }) this.setState({ visible: true });
this.setState({ pdbId: e }) this.setState({ pdbId: e });
} }
getTag = (e) => { getTag = (e) => {
let listData = this.state.listData let listData = this.state.listData;
listData.pdb_code = e listData.pdb_code = e;
listData.ligand = '' listData.ligand = '';
listData.resolution = 0 listData.resolution = 0;
this.setState({ listData }) this.setState({ listData });
let pdbLink2 = 'http://52.83.169.190:3004/?id=' + JSON.stringify(listData) let pdbLink2 = 'http://52.83.169.190:3004/?id=' + JSON.stringify(listData);
this.setState({ this.setState({
pdbLink2, pdbLink2,
}) });
this.setState({ visible: true }) this.setState({ visible: true });
this.setState({ pdbId: e }) this.setState({ pdbId: e });
} };
getReferences = (e) => { getReferences = (e) => {
window.open(`https://pubmed.ncbi.nlm.nih.gov/${e}`) window.open(`https://pubmed.ncbi.nlm.nih.gov/${e}`);
} };
getReferences2 = (e) => { getReferences2 = (e) => {
window.open(e) window.open(e);
} };
getList = () => { getList = () => {
console.log('getList') console.log('getList');
if (this.state.listData.ligand === '') { if (this.state.listData.ligand === '') {
message.warning('输入查询条件') message.warning('输入查询条件');
return return;
} }
JSON.stringify(this.state.listData) JSON.stringify(this.state.listData);
let listData = this.state.listData let listData = this.state.listData;
listData.pdbList = this.state.pdbList listData.pdbList = this.state.pdbList;
let pdbLink = 'http://52.83.169.190:3004/?id=' + JSON.stringify(listData) let pdbLink = 'http://52.83.169.190:3004/?id=' + JSON.stringify(listData);
this.setState({ this.setState({
pdbLink, pdbLink,
}) });
} };
getResolutionData = (e) => { getResolutionData = (e) => {
let listData = this.state.listData let listData = this.state.listData;
listData.resolution = e listData.resolution = e;
this.setState({ this.setState({
listData, listData,
}) });
} };
LigandChange = (e) => { LigandChange = (e) => {
let listData = this.state.listData let listData = this.state.listData;
listData.ligand = e listData.ligand = e;
this.setState({ this.setState({
listData, listData,
}) });
} };
callback () { } callback() {}
getOne (e) { getOne(e) {
console.log(e) console.log(e);
const { dataid } = e const { dataid } = e;
let data = { let data = {
dataid, dataid,
} };
this.props.history.push({ this.props.history.push({
pathname: '/kinase/TargetDetails', pathname: '/kinase/TargetDetails',
search: qs.stringify(data), search: qs.stringify(data),
}) });
} }
getBioassayList = () => { getBioassayList = () => {
console.log(this.state.dataOne) console.log(this.state.dataOne);
const { dataid } = this.state.dataOne const { dataid } = this.state.dataOne;
this.setState({ loading: true }) this.setState({ loading: true });
request request
.post('kinase/drug_detail/bioassay', this.state.BioassaySearch) .post('kinase/drug_detail/bioassay', this.state.BioassaySearch)
.then((res) => { .then((res) => {
this.setState({ loading: false }) this.setState({ loading: false });
if (res) { if (res) {
console.log(res) console.log(res);
let DetailsData = this.state.DetailsData let DetailsData = this.state.DetailsData;
DetailsData.Bioassay = res.data.data DetailsData.Bioassay = res.data.data;
this.setState({ total_num2: res.data.total_num }) this.setState({ total_num2: res.data.total_num });
this.setState({ this.setState({
DetailsData: DetailsData, DetailsData: DetailsData,
}) });
} }
}) })
.catch((err) => { .catch((err) => {
console.error(err) console.error(err);
}) });
} };
getTargetList = () => { getTargetList = () => {
console.log(this.state.dataOne) console.log(this.state.dataOne);
const { dataid } = this.state.dataOne const { dataid } = this.state.dataOne;
this.setState({ loading: true }) this.setState({ loading: true });
request request
.post('kinase/drug_detail/target', this.state.TargetSearch) .post('kinase/drug_detail/target', this.state.TargetSearch)
.then((res) => { .then((res) => {
this.setState({ loading: false }) this.setState({ loading: false });
if (res) { if (res) {
console.log(res) console.log(res);
let DetailsData = this.state.DetailsData let DetailsData = this.state.DetailsData;
DetailsData.Target = res.data.data DetailsData.Target = res.data.data;
this.setState({ total_num: res.data.total_num }) this.setState({ total_num: res.data.total_num });
this.setState({ this.setState({
DetailsData: DetailsData, DetailsData: DetailsData,
}) });
} }
}) })
.catch((err) => { .catch((err) => {
console.error(err) console.error(err);
}) });
} };
getIndicationList = () => { getIndicationList = () => {
console.log(this.state.dataOne) console.log(this.state.dataOne);
const { dataid } = this.state.dataOne const { dataid } = this.state.dataOne;
this.setState({ loading: true }) this.setState({ loading: true });
request request
.post('kinase/drug_detail/indication', this.state.IndicationSearch) .post('kinase/drug_detail/indication', this.state.IndicationSearch)
.then((res) => { .then((res) => {
this.setState({ loading: false }) this.setState({ loading: false });
if (res) { if (res) {
console.log(res) console.log(res);
let DetailsData = this.state.DetailsData let DetailsData = this.state.DetailsData;
DetailsData.Indication = res.data.data DetailsData.Indication = res.data.data;
this.setState({ total_num3: res.data.total_num }) this.setState({ total_num3: res.data.total_num });
this.setState({ this.setState({
DetailsData: DetailsData, DetailsData: DetailsData,
}) });
} }
}) })
.catch((err) => { .catch((err) => {
console.error(err) console.error(err);
}) });
} };
onShowSizeChange = (current, pageSize) => { onShowSizeChange = (current, pageSize) => {
let BioassaySearch = this.state.BioassaySearch let BioassaySearch = this.state.BioassaySearch;
BioassaySearch.page = current BioassaySearch.page = current;
BioassaySearch.page_size = pageSize BioassaySearch.page_size = pageSize;
this.setState({ this.setState({
BioassaySearch, BioassaySearch,
}) });
this.getBioassayList() this.getBioassayList();
} };
onChange = (current, pageSize) => { onChange = (current, pageSize) => {
let BioassaySearch = this.state.BioassaySearch let BioassaySearch = this.state.BioassaySearch;
BioassaySearch.page = current BioassaySearch.page = current;
BioassaySearch.page_size = pageSize BioassaySearch.page_size = pageSize;
this.setState({ this.setState({
BioassaySearch, BioassaySearch,
}) });
this.getBioassayList() this.getBioassayList();
} };
onShowSizeChange2 = (current, pageSize) => { onShowSizeChange2 = (current, pageSize) => {
console.log(current, pageSize) console.log(current, pageSize);
let TargetSearch = this.state.TargetSearch let TargetSearch = this.state.TargetSearch;
TargetSearch.page = current TargetSearch.page = current;
TargetSearch.page_size = pageSize TargetSearch.page_size = pageSize;
this.setState({ this.setState({
TargetSearch, TargetSearch,
}) });
this.getTargetList() this.getTargetList();
} };
onChange2 = (current, pageSize) => { onChange2 = (current, pageSize) => {
console.log(current, pageSize) console.log(current, pageSize);
let TargetSearch = this.state.TargetSearch let TargetSearch = this.state.TargetSearch;
TargetSearch.page = current TargetSearch.page = current;
TargetSearch.page_size = pageSize TargetSearch.page_size = pageSize;
this.setState({ this.setState({
TargetSearch, TargetSearch,
}) });
this.getTargetList() this.getTargetList();
} };
onShowSizeChange3 = (current, pageSize) => { onShowSizeChange3 = (current, pageSize) => {
console.log(current, pageSize) console.log(current, pageSize);
let IndicationSearch = this.state.IndicationSearch let IndicationSearch = this.state.IndicationSearch;
IndicationSearch.page = current IndicationSearch.page = current;
IndicationSearch.page_size = pageSize IndicationSearch.page_size = pageSize;
this.setState({ this.setState({
IndicationSearch, IndicationSearch,
}) });
this.getIndicationList() this.getIndicationList();
} };
onChange3 = (current, pageSize) => { onChange3 = (current, pageSize) => {
console.log(current, pageSize) console.log(current, pageSize);
let IndicationSearch = this.state.IndicationSearch let IndicationSearch = this.state.IndicationSearch;
IndicationSearch.page = current IndicationSearch.page = current;
IndicationSearch.page_size = pageSize IndicationSearch.page_size = pageSize;
this.setState({ this.setState({
IndicationSearch, IndicationSearch,
}) });
this.getIndicationList() this.getIndicationList();
} };
handleAnchorClick = (e) => { handleAnchorClick = (e) => {
e.preventDefault() e.preventDefault();
} };
getValue = (e) => { getValue = (e) => {
const { value } = e.target const { value } = e.target;
let superpositionData = this.state.superpositionData let superpositionData = this.state.superpositionData;
superpositionData[0].chainID = value superpositionData[0].chainID = value;
this.setState(() => ({ superpositionData: superpositionData })) this.setState(() => ({ superpositionData: superpositionData }));
} };
SelectValue = (e) => { SelectValue = (e) => {
console.log(e) console.log(e);
let superpositionData = this.state.superpositionData let superpositionData = this.state.superpositionData;
superpositionData[0].pdbID = e superpositionData[0].pdbID = e;
this.setState(() => ({ superpositionData: superpositionData })) this.setState(() => ({ superpositionData: superpositionData }));
} };
onChangeGroup = (e) => { onChangeGroup = (e) => {
console.log(e) console.log(e);
this.setState({ this.setState({
pdbList: e, pdbList: e,
}) });
} };
remove = (k) => { remove = (k) => {
const { form } = this.props const { form } = this.props;
// can use data-binding to get // can use data-binding to get
const keys = form.getFieldValue('keys') const keys = form.getFieldValue('keys');
// We need at least one passenger // We need at least one passenger
if (keys.length === 1) { if (keys.length === 1) {
return return;
} }
this.setState({ this.setState({
sum: keys.length - 1, sum: keys.length - 1,
}) });
// can use data-binding to set // can use data-binding to set
form.setFieldsValue({ form.setFieldsValue({
keys: keys.filter((key) => key !== k), keys: keys.filter((key) => key !== k),
}) });
} };
add = () => { add = () => {
const { form } = this.props const { form } = this.props;
// can use data-binding to get // can use data-binding to get
const keys = form.getFieldValue('keys') const keys = form.getFieldValue('keys');
console.log(keys) console.log(keys);
const nextKeys = keys.concat(id++) const nextKeys = keys.concat(id++);
// can use data-binding to set // can use data-binding to set
// important! notify form to detect changes // important! notify form to detect changes
form.setFieldsValue({ form.setFieldsValue({
keys: nextKeys, keys: nextKeys,
}) });
this.setState({ this.setState({
sum: keys.length + 1, sum: keys.length + 1,
}) });
} };
handleSubmit = (e) => { handleSubmit = (e) => {
// console.log(e); // console.log(e);
// e.preventDefault(); // e.preventDefault();
this.props.form.validateFields((err, values) => { this.props.form.validateFields((err, values) => {
console.log(values) console.log(values);
const { const { keys, pdbList, chainList, methodList, cutoffList, cyclesList } = values;
keys, console.log('Received values of form: ', values);
pdbList,
chainList,
methodList,
cutoffList,
cyclesList,
} = values
console.log('Received values of form: ', values)
// console.log('Merged values:', keys.map(key => names[key])) // console.log('Merged values:', keys.map(key => names[key]))
// let names = keys.map(key => names[key]) // let names = keys.map(key => names[key])
for (let index = 0; index < pdbList.length; index++) { for (let index = 0; index < pdbList.length; index++) {
var element = pdbList[index] var element = pdbList[index];
if (element == undefined) { if (element == undefined) {
pdbList[index] = '' pdbList[index] = '';
} }
} }
let newArr = pdbList.filter((i) => i && i.trim()) let newArr = pdbList.filter((i) => i && i.trim());
for (let index = 0; index < chainList.length; index++) { for (let index = 0; index < chainList.length; index++) {
var element = chainList[index] var element = chainList[index];
if (element == undefined) { if (element == undefined) {
chainList[index] = '' chainList[index] = '';
} }
} }
let newArr2 = chainList.filter((i) => i && i.trim()) let newArr2 = chainList.filter((i) => i && i.trim());
for (let index = 0; index < methodList.length; index++) { for (let index = 0; index < methodList.length; index++) {
var element = methodList[index] var element = methodList[index];
if (element == undefined) { if (element == undefined) {
methodList[index] = '' methodList[index] = '';
} }
} }
let newArr3 = methodList.filter((i) => i && i.trim()) let newArr3 = methodList.filter((i) => i && i.trim());
for (let index = 0; index < cutoffList.length; index++) { for (let index = 0; index < cutoffList.length; index++) {
var element = cutoffList[index] var element = cutoffList[index];
if (element == undefined) { if (element == undefined) {
cutoffList[index] = '' cutoffList[index] = '';
} }
} }
let newArr4 = cutoffList.filter((i) => i && i.trim()) let newArr4 = cutoffList.filter((i) => i && i.trim());
for (let index = 0; index < cyclesList.length; index++) { for (let index = 0; index < cyclesList.length; index++) {
var element = cyclesList[index] var element = cyclesList[index];
if (element == undefined) { if (element == undefined) {
cyclesList[index] = '' cyclesList[index] = '';
} }
} }
let newArr5 = cyclesList.filter((i) => i && i.trim()) let newArr5 = cyclesList.filter((i) => i && i.trim());
console.log(newArr2) console.log(newArr2);
let superpositionData = this.state.superpositionData let superpositionData = this.state.superpositionData;
superpositionData[1].pdbID = newArr[0] === undefined ? '' : newArr[0] superpositionData[1].pdbID = newArr[0] === undefined ? '' : newArr[0];
superpositionData[1].chainID = newArr2[0] === undefined ? '' : newArr2[0] superpositionData[1].chainID = newArr2[0] === undefined ? '' : newArr2[0];
superpositionData[1].method = newArr3[0] === undefined ? '' : newArr3[0] superpositionData[1].method = newArr3[0] === undefined ? '' : newArr3[0];
superpositionData[1].cutoff = superpositionData[1].cutoff = newArr4[0] === undefined ? '' : parseInt(newArr4[0]);
newArr4[0] === undefined ? '' : parseInt(newArr4[0]) superpositionData[1].cycles = newArr5[0] === undefined ? '' : parseInt(newArr5[0]);
superpositionData[1].cycles = superpositionData[2].pdbID = newArr[1] === undefined ? '' : newArr[1];
newArr5[0] === undefined ? '' : parseInt(newArr5[0]) superpositionData[2].chainID = newArr2[1] === undefined ? '' : newArr2[1];
superpositionData[2].pdbID = newArr[1] === undefined ? '' : newArr[1] superpositionData[2].method = newArr3[1] === undefined ? '' : newArr3[1];
superpositionData[2].chainID = newArr2[1] === undefined ? '' : newArr2[1] (superpositionData[2].cutoff = newArr4[1] === undefined ? '' : parseInt(newArr4[1])), (superpositionData[2].cycles = newArr5[1] === undefined ? '' : parseInt(newArr5[1]));
superpositionData[2].method = newArr3[1] === undefined ? '' : newArr3[1] this.setState(() => ({ superpositionData: superpositionData }));
; (superpositionData[2].cutoff = console.log(this.state.superpositionData);
newArr4[1] === undefined ? '' : parseInt(newArr4[1])), let listData = this.state.listData;
(superpositionData[2].cycles = listData.pdbList = this.state.superpositionData;
newArr5[1] === undefined ? '' : parseInt(newArr5[1])) let pdbLink = 'http://52.83.169.190:3004/?id=' + JSON.stringify(listData);
this.setState(() => ({ superpositionData: superpositionData })) this.setState({ listData });
console.log(this.state.superpositionData) this.setState({ pdbLink });
let listData = this.state.listData console.log(this.state.pdbLink);
listData.pdbList = this.state.superpositionData });
let pdbLink = 'http://52.83.169.190:3004/?id=' + JSON.stringify(listData) };
this.setState({ listData }) render() {
this.setState({ pdbLink })
console.log(this.state.pdbLink)
})
}
render () {
const { const {
visible, visible,
panelList, panelList,
...@@ -575,11 +540,11 @@ export default class SearchDetails extends Component { ...@@ -575,11 +540,11 @@ export default class SearchDetails extends Component {
addList, addList,
sum, sum,
directoryState, directoryState,
} = this.state } = this.state;
const formItemLayout = { const formItemLayout = {
labelCol: { span: 8 }, labelCol: { span: 8 },
wrapperCol: { span: 12 }, wrapperCol: { span: 12 },
} };
const columns = [ const columns = [
{ {
title: 'Target name', title: 'Target name',
...@@ -587,29 +552,30 @@ export default class SearchDetails extends Component { ...@@ -587,29 +552,30 @@ export default class SearchDetails extends Component {
key: 'Target name', key: 'Target name',
render: (item, record) => ( render: (item, record) => (
<Tag <Tag
color="blue" color='blue'
onClick={() => { onClick={() => {
this.getOne(record) this.getOne(record);
}}> }}
>
{record.Target_name} {record.Target_name}
</Tag> </Tag>
), ),
}, },
{ {
title: "Uniport id", title: 'Uniport id',
dataIndex: "Uniport_id", dataIndex: 'Uniport_id',
key: "Uniport_id", key: 'Uniport_id',
}, },
{ {
title: "Group", title: 'Group',
dataIndex: "Group", dataIndex: 'Group',
key: "Group", key: 'Group',
}, },
{ {
title: "Family", title: 'Family',
dataIndex: "Family", dataIndex: 'Family',
key: "Family", key: 'Family',
}, },
{ {
title: 'PDB', title: 'PDB',
...@@ -619,14 +585,15 @@ export default class SearchDetails extends Component { ...@@ -619,14 +585,15 @@ export default class SearchDetails extends Component {
{PDB.map((item, index) => { {PDB.map((item, index) => {
return ( return (
<Tag <Tag
color="blue" color='blue'
key={index} key={index}
onClick={() => { onClick={() => {
this.getTag(item) this.getTag(item);
}}> }}
>
{item.toUpperCase()} {item.toUpperCase()}
</Tag> </Tag>
) );
})} })}
</span> </span>
), ),
...@@ -638,14 +605,14 @@ export default class SearchDetails extends Component { ...@@ -638,14 +605,14 @@ export default class SearchDetails extends Component {
render: (sequence) => ( render: (sequence) => (
<span> <span>
{ {
<Tooltip placement="topLeft" title={sequence}> <Tooltip placement='topLeft' title={sequence}>
<Button>Sequence</Button> <Button>Sequence</Button>
</Tooltip> </Tooltip>
} }
</span> </span>
), ),
}, },
] ];
const columns2 = [ const columns2 = [
{ {
title: 'Indication', title: 'Indication',
...@@ -660,7 +627,7 @@ export default class SearchDetails extends Component { ...@@ -660,7 +627,7 @@ export default class SearchDetails extends Component {
<span> <span>
{Synonyms != null && {Synonyms != null &&
Synonyms.map((item, index) => { Synonyms.map((item, index) => {
return <span key={index}>{item.toUpperCase()},</span> return <span key={index}>{item.toUpperCase()},</span>;
})} })}
</span> </span>
), ),
...@@ -672,7 +639,7 @@ export default class SearchDetails extends Component { ...@@ -672,7 +639,7 @@ export default class SearchDetails extends Component {
render: (Status) => ( render: (Status) => (
<span> <span>
{Status.map((item, index) => { {Status.map((item, index) => {
return <Tag key={index}>{item.toUpperCase()}</Tag> return <Tag key={index}>{item.toUpperCase()}</Tag>;
})} })}
</span> </span>
), ),
...@@ -701,28 +668,29 @@ export default class SearchDetails extends Component { ...@@ -701,28 +668,29 @@ export default class SearchDetails extends Component {
reference.map((item, index) => { reference.map((item, index) => {
return ( return (
<Tag <Tag
color="blue" color='blue'
key={index} key={index}
onClick={() => { onClick={() => {
this.getReferences2(item) this.getReferences2(item);
}}> }}
>
{item.toUpperCase()} {item.toUpperCase()}
</Tag> </Tag>
) );
})} })}
</span> </span>
), ),
}, },
] ];
const menu = ( const menu = (
<Menu> <Menu>
<Menu.Item>Action 1</Menu.Item> <Menu.Item>Action 1</Menu.Item>
<Menu.Item>Action 2</Menu.Item> <Menu.Item>Action 2</Menu.Item>
</Menu> </Menu>
) );
const expandedRowRender = (e) => { const expandedRowRender = (e) => {
console.log(e) console.log(e);
const { standards } = e const { standards } = e;
const columns = [ const columns = [
{ {
title: 'Standard Type', title: 'Standard Type',
...@@ -752,21 +720,20 @@ export default class SearchDetails extends Component { ...@@ -752,21 +720,20 @@ export default class SearchDetails extends Component {
<span> <span>
{ {
<Tag <Tag
color="blue" color='blue'
onClick={() => { onClick={() => {
this.getReferences2(reference) this.getReferences2(reference);
}}> }}
>
{reference} {reference}
</Tag> </Tag>
} }
</span> </span>
), ),
}, },
] ];
return ( return <Table columns={columns} dataSource={standards} pagination={false} />;
<Table columns={columns} dataSource={standards} pagination={false} /> };
)
}
const columns3 = [ const columns3 = [
{ {
...@@ -774,10 +741,11 @@ export default class SearchDetails extends Component { ...@@ -774,10 +741,11 @@ export default class SearchDetails extends Component {
dataIndex: 'Target', dataIndex: 'Target',
render: (item, record) => ( render: (item, record) => (
<Tag <Tag
color="blue" color='blue'
onClick={() => { onClick={() => {
this.getOne(record) this.getOne(record);
}}> }}
>
{record.Target_name} {record.Target_name}
</Tag> </Tag>
), ),
...@@ -805,7 +773,7 @@ export default class SearchDetails extends Component { ...@@ -805,7 +773,7 @@ export default class SearchDetails extends Component {
// </span> // </span>
// ), // ),
// }, // },
] ];
const columnsChain = [ const columnsChain = [
{ {
title: 'Chain_name', title: 'Chain_name',
...@@ -838,14 +806,14 @@ export default class SearchDetails extends Component { ...@@ -838,14 +806,14 @@ export default class SearchDetails extends Component {
dataIndex: 'res_end', dataIndex: 'res_end',
key: 'res_end', key: 'res_end',
}, },
] ];
const { getFieldDecorator, getFieldValue } = this.props.form const { getFieldDecorator, getFieldValue } = this.props.form;
const formItemLayoutWithOutLabel = { const formItemLayoutWithOutLabel = {
wrapperCol: { wrapperCol: {
xs: { span: 24, offset: 0 }, xs: { span: 24, offset: 0 },
sm: { span: 20, offset: 4 }, sm: { span: 20, offset: 4 },
}, },
} };
const formItemLayout2 = { const formItemLayout2 = {
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
...@@ -855,15 +823,11 @@ export default class SearchDetails extends Component { ...@@ -855,15 +823,11 @@ export default class SearchDetails extends Component {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 20 }, sm: { span: 20 },
}, },
} };
getFieldDecorator('keys', { initialValue: [] }) getFieldDecorator('keys', { initialValue: [] });
const keys = getFieldValue('keys') const keys = getFieldValue('keys');
const formItems = keys.map((k, index) => ( const formItems = keys.map((k, index) => (
<Form.Item <Form.Item {...(index === 0 ? formItemLayout2 : formItemLayoutWithOutLabel)} label={index === 0 ? 'SelectPDB: ' : ''} required={false} key={k}>
{...(index === 0 ? formItemLayout2 : formItemLayoutWithOutLabel)}
label={index === 0 ? 'SelectPDB: ' : ''}
required={false}
key={k}>
<div style={{ display: 'flex ', alignItems: 'center ' }}> <div style={{ display: 'flex ', alignItems: 'center ' }}>
{getFieldDecorator(`pdbList[${k}]`)( {getFieldDecorator(`pdbList[${k}]`)(
<Select style={{ width: '100px' }}> <Select style={{ width: '100px' }}>
...@@ -872,22 +836,15 @@ export default class SearchDetails extends Component { ...@@ -872,22 +836,15 @@ export default class SearchDetails extends Component {
<Option key={index.pdb} value={item.pdb.toLowerCase()}> <Option key={index.pdb} value={item.pdb.toLowerCase()}>
{item.pdb.toLowerCase()} {item.pdb.toLowerCase()}
</Option> </Option>
) );
})} })}
</Select> </Select>
)} )}
<div> <div>
<Form.Item style={{ margin: '0px' }}> <Form.Item style={{ margin: '0px' }}>{getFieldDecorator(`chainList[${k}]`)(<Input placeholder='请输入Chain' style={{ width: '100px', marginRight: 8 }} />)}</Form.Item>
{getFieldDecorator(`chainList[${k}]`)(
<Input
placeholder="请输入Chain"
style={{ width: '100px', marginRight: 8 }}
/>
)}
</Form.Item>
</div> </div>
<div> <div>
<Form.Item style={{ margin: '0px' }} help="The information is being validated..."> <Form.Item style={{ margin: '0px' }} help='The information is being validated...'>
{getFieldDecorator(`methodList[${k}]`)( {getFieldDecorator(`methodList[${k}]`)(
<Select style={{ width: '100px' }}> <Select style={{ width: '100px' }}>
{addList.map((item, index) => { {addList.map((item, index) => {
...@@ -895,72 +852,41 @@ export default class SearchDetails extends Component { ...@@ -895,72 +852,41 @@ export default class SearchDetails extends Component {
<Option key={index} value={item}> <Option key={index} value={item}>
{item} {item}
</Option> </Option>
) );
})} })}
</Select> </Select>
)} )}
</Form.Item> </Form.Item>
</div> </div>
<div> <div>
<Form.Item style={{ margin: '0px' }}> <Form.Item style={{ margin: '0px' }}>{getFieldDecorator(`cutoffList[${k}]`)(<Input placeholder='Cutoff' style={{ width: '100px', marginRight: 8 }} />)}</Form.Item>
{getFieldDecorator(`cutoffList[${k}]`)(
<Input
placeholder="Cutoff"
style={{ width: '100px', marginRight: 8 }}
/>
)}
</Form.Item>
</div> </div>
<div> <div>
<Form.Item style={{ margin: '0px' }}> <Form.Item style={{ margin: '0px' }}>
{getFieldDecorator(`cyclesList[${k}]`)( {getFieldDecorator(`cyclesList[${k}]`)(<Input placeholder='Cycles' style={{ width: '100px', marginRight: 8 }} />)}
<Input {keys.length > 1 ? <Icon className='dynamic-delete-button' type='minus-circle-o' onClick={() => this.remove(k)} style={{ marginLeft: '10px' }} /> : null}
placeholder="Cycles"
style={{ width: '100px', marginRight: 8 }}
/>
)}
{keys.length > 1 ? (
<Icon
className="dynamic-delete-button"
type="minus-circle-o"
onClick={() => this.remove(k)}
style={{ marginLeft: '10px' }}
/>
) : null}
</Form.Item> </Form.Item>
</div> </div>
</div> </div>
</Form.Item> </Form.Item>
)) ));
return ( return (
<div className="search-details-div"> <div className='search-details-div'>
<Modal <Modal footer={null} closable={false} width={850} visible={visible} wrapClassName='vertical-center-modal' onCancel={() => this.setState({ visible: false })}>
footer={null} <div className='Molstar-div'>
closable={false}
width={850}
visible={visible}
wrapClassName="vertical-center-modal"
onCancel={() => this.setState({ visible: false })}>
<div className="Molstar-div">
{/* <Molstar file={this.state.fileData} /> */} {/* <Molstar file={this.state.fileData} /> */}
<iframe <iframe src={pdbLink2} height={'500px'} width={'100%'} name='iframe-video' />
src={pdbLink2}
height={'500px'}
width={'100%'}
name="iframe-video"
/>
</div> </div>
</Modal> </Modal>
<Spin tip="Loading..." size="large" spinning={this.state.loading}> <Spin tip='Loading...' size='large' spinning={this.state.loading}>
<div className="Anchor-div"> <div className='Anchor-div'>
{directoryState && ( {directoryState && (
<Button type="primary" style={{ width: '100%' }} onClick={() => this.setState({ directoryState: false })}> <Button type='primary' style={{ width: '100%' }} onClick={() => this.setState({ directoryState: false })}>
收起目录 收起目录
</Button> </Button>
)} )}
{!directoryState && ( {!directoryState && (
<Button type="primary" style={{ width: '100%' }} onClick={() => this.setState({ directoryState: true })}> <Button type='primary' style={{ width: '100%' }} onClick={() => this.setState({ directoryState: true })}>
展开目录 展开目录
</Button> </Button>
)} )}
...@@ -968,143 +894,101 @@ export default class SearchDetails extends Component { ...@@ -968,143 +894,101 @@ export default class SearchDetails extends Component {
{directoryState && ( {directoryState && (
<div> <div>
<Anchor onClick={this.handleAnchorClick}> <Anchor onClick={this.handleAnchorClick}>
<Link href="#card" title="Title" /> <Link href='#card' title='Title' />
<Link href="#Indication" title="Indication" /> <Link href='#Indication' title='Indication' />
<Link href="#Target" title="Target" /> <Link href='#Target' title='Target' />
<Link <Link href='#BiologicalPropeties' title='Biological Propeties' />
href="#BiologicalPropeties" <Link href='#Bioassay' title='Bioassay' />
title="Biological Propeties" <Link href='#CalculatedPropeties' title='Calculated Propeties' />
/> <Link href='#Structure' title='Structure' />
<Link href="#Bioassay" title="Bioassay" />
<Link
href="#CalculatedPropeties"
title="Calculated Propeties"
/>
<Link href="#Structure" title="Structure" />
</Anchor> </Anchor>
</div> </div>
)} )}
</div> </div>
<Card hoverable id="card"> <Card hoverable id='card'>
<div> <div>
<div className="title-div">{name}</div> <div className='title-div'>{name}</div>
<div className="title-div-top"> <div className='title-div-top'>
<div className="DataList-left"> <div className='DataList-left'>
<div> <div>
<div className="title-div">{DetailsData.name}</div> <div className='title-div'>{DetailsData.name}</div>
<div className="title-div-top"> <div className='title-div-top'>
<div className="DataList-left"> <div className='DataList-left'>
<div> <div>
<div className="div-list"> <div className='div-list'>
<div className="list-one"> <div className='list-one'>
<div className="left-title">Synonyms</div> <div className='left-title'>Synonyms</div>
<div className="Synonyms-div"> <div className='Synonyms-div'>
<div> </div> <div> </div>
{DetailsData.synonyms.map((item, index) => { {DetailsData.synonyms.map((item, index) => {
return <Tag>{item}</Tag> return <Tag key={index}>{item}</Tag>;
})} })}
</div> </div>
</div> </div>
<div className="list-one"> <div className='list-one'>
<div className="left-title">Drug Type</div> <div className='left-title'>Drug Type</div>
<div /> <div />
{DetailsData.datatype} {DetailsData.datatype}
</div> </div>
<div className="list-one"> <div className='list-one'>
<div className="left-title">Smiles</div> <div className='left-title'>Smiles</div>
<div /> <div />
{DetailsData.smiles} {DetailsData.smiles}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div className="Jsme-div"> <div className='Jsme-div'>{DetailsData.smiles && <Jsme height='300px' width='300px' options='depict,useopenchemlib' smiles={DetailsData.smiles} />}</div>
{DetailsData.smiles && (
<Jsme
height="300px"
width="300px"
options="depict,useopenchemlib"
smiles={DetailsData.smiles}
/>
)}
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</Card> </Card>
<Collapse <Collapse defaultActiveKey={['1', '2', '3', '4', '5', '6']} onChange={this.callback}>
defaultActiveKey={['1', '2', '3', '4', '5', '6']} <Panel header='Indication' id='Indication' key='6'>
onChange={this.callback}> <Table bordered rowKey='dataid' dataSource={DetailsData.Indication} pagination={false} columns={columns2} />
<Panel header="Indication" id="Indication" key="6"> <Pagination showSizeChanger onShowSizeChange={this.onShowSizeChange3} onChange={this.onChange3} total={total_num3} />
<Table
bordered
rowKey="dataid"
dataSource={DetailsData.Indication}
pagination={false}
columns={columns2}
/>
<Pagination
showSizeChanger
onShowSizeChange={this.onShowSizeChange3}
onChange={this.onChange3}
total={total_num3}
/>
</Panel> </Panel>
<Panel header="Target" key="1" id="Target"> <Panel header='Target' key='1' id='Target'>
<Table <Table bordered rowKey='index' dataSource={DetailsData.Target} pagination={false} columns={columns} />
bordered <Pagination showSizeChanger onShowSizeChange={this.onShowSizeChange2} onChange={this.onChange2} total={total_num} />
rowKey="index"
dataSource={DetailsData.Target}
pagination={false}
columns={columns}
/>
<Pagination
showSizeChanger
onShowSizeChange={this.onShowSizeChange2}
onChange={this.onChange2}
total={total_num}
/>
</Panel> </Panel>
<Panel <Panel header='Biological Propeties' id='BiologicalPropeties' key='5'>
header="Biological Propeties" <div className='Calcilated'>
id="BiologicalPropeties" <div className='div-list'>
key="5"> <div className='list-one'>
<div className="Calcilated">
<div className="div-list">
<div className="list-one">
<div>Absorption:</div> <div>Absorption:</div>
<div /> <div />
{Biological_propeties.absorption} {Biological_propeties.absorption}
</div> </div>
<div className="list-one"> <div className='list-one'>
<div>Clearance:</div> <div>Clearance:</div>
<div /> <div />
{Biological_propeties.clearance} {Biological_propeties.clearance}
</div> </div>
<div className="list-one"> <div className='list-one'>
<div>Distribution: </div> <div>Distribution: </div>
<div /> <div />
{Biological_propeties.distribution} {Biological_propeties.distribution}
</div> </div>
<div className="list-one"> <div className='list-one'>
<div>Elimination:</div> <div>Elimination:</div>
<div /> <div />
{Biological_propeties.elimination} {Biological_propeties.elimination}
</div> </div>
<div className="list-one"> <div className='list-one'>
<div>Half Life: </div> <div>Half Life: </div>
<div /> <div />
{Biological_propeties.half_life} {Biological_propeties.half_life}
</div> </div>
<div className="list-one"> <div className='list-one'>
<div>metabolism: </div> <div>metabolism: </div>
<div /> <div />
{Biological_propeties.metabolism} {Biological_propeties.metabolism}
</div> </div>
<div className="list-one"> <div className='list-one'>
<div>Toxicity: </div> <div>Toxicity: </div>
<div /> <div />
{Biological_propeties.toxicity} {Biological_propeties.toxicity}
...@@ -1113,59 +997,44 @@ export default class SearchDetails extends Component { ...@@ -1113,59 +997,44 @@ export default class SearchDetails extends Component {
</div> </div>
</Panel> </Panel>
<Panel header="Bioassay" key="2" id="Bioassay"> <Panel header='Bioassay' key='2' id='Bioassay'>
<Table <Table bordered rowKey='dataid' dataSource={DetailsData.Bioassay} pagination={false} columns={columns3} expandedRowRender={expandedRowRender} />
bordered <Pagination showSizeChanger onShowSizeChange={this.onShowSizeChange} onChange={this.onChange} total={total_num2} />
rowKey="dataid"
dataSource={DetailsData.Bioassay}
pagination={false}
columns={columns3}
expandedRowRender={expandedRowRender}
/>
<Pagination
showSizeChanger
onShowSizeChange={this.onShowSizeChange}
onChange={this.onChange}
total={total_num2}
/>
</Panel> </Panel>
<Panel <Panel header='Calculated Propeties' key='3' id='CalculatedPropeties'>
header="Calculated Propeties"
key="3"
id="CalculatedPropeties">
<div> <div>
<div className="Calcilated"> <div className='Calcilated'>
<div className="list-one2"> <div className='list-one2'>
<div>Molecular weight:</div> <div>Molecular weight:</div>
<div /> <div />
{Calculated_propeties.Molecular_weight} {Calculated_propeties.Molecular_weight}
</div> </div>
<div className="list-one2"> <div className='list-one2'>
<div>LogP:</div> <div>LogP:</div>
<div /> <div />
{Calculated_propeties.logP} {Calculated_propeties.logP}
</div> </div>
<div className="list-one2"> <div className='list-one2'>
<div>Hydrogen bond donor: </div> <div>Hydrogen bond donor: </div>
<div /> <div />
{Calculated_propeties.Hydrogen_bond_donor} {Calculated_propeties.Hydrogen_bond_donor}
</div> </div>
<div className="list-one2"> <div className='list-one2'>
<div>Hydrogen bond acceptor:</div> <div>Hydrogen bond acceptor:</div>
<div /> <div />
{Calculated_propeties.Hydrogen_bond_acceptor} {Calculated_propeties.Hydrogen_bond_acceptor}
</div> </div>
<div className="list-one2"> <div className='list-one2'>
<div>Rotatable bond: </div> <div>Rotatable bond: </div>
<div /> <div />
{Calculated_propeties.Rotatable_bond} {Calculated_propeties.Rotatable_bond}
</div> </div>
<div className="list-one2"> <div className='list-one2'>
<div>sp3 Carbon: </div> <div>sp3 Carbon: </div>
<div /> <div />
{Calculated_propeties.sp3_Carbon} {Calculated_propeties.sp3_Carbon}
</div> </div>
<div className="list-one2"> <div className='list-one2'>
<div>tPSA: </div> <div>tPSA: </div>
<div /> <div />
{Calculated_propeties.tPSA} {Calculated_propeties.tPSA}
...@@ -1173,88 +1042,64 @@ export default class SearchDetails extends Component { ...@@ -1173,88 +1042,64 @@ export default class SearchDetails extends Component {
</div> </div>
</div> </div>
</Panel> </Panel>
<Panel header="Structure" key="4" id="Structure"> <Panel header='Structure' key='4' id='Structure'>
<Tabs <Tabs
defaultActiveKey="0" defaultActiveKey='0'
// type="card" // type="card"
style={{ height: 1000 }} style={{ height: 1000 }}
tabPosition="left" tabPosition='left'
onChange={this.ChangeTabs}> onChange={this.ChangeTabs}
>
{DetailsData.Structure.map((item, index) => { {DetailsData.Structure.map((item, index) => {
return ( return (
<TabPane id={item.pdb} tab={item.pdb} key={item.pdb}> <TabPane id={item.pdb} tab={item.pdb} key={item.pdb}>
<div className="TabPane-center"> <div className='TabPane-center'>
<div className="Molstar-div2"> <div className='Molstar-div2'>{this.state.aciveKey == item.pdb && <WrappedIframe pdbLink={this.state.pdbLink} />}</div>
{this.state.aciveKey == item.pdb && ( <div className='Structure-right'>
<WrappedIframe pdbLink={this.state.pdbLink} /> <Form layout='horizontal'>
)} <Form.Item label='详情' {...formItemLayout}>
</div>
<div className="Structure-right">
<Form layout="horizontal">
<Form.Item label="详情" {...formItemLayout}>
<div>method: {getStructureList.method}</div> <div>method: {getStructureList.method}</div>
<div>name: {getStructureList.name}</div> <div>name: {getStructureList.name}</div>
<div> <div>pdb_datatime: {getStructureList.pdb_datatime}</div>
pdb_datatime: {getStructureList.pdb_datatime} <div>resolution: {getStructureList.resolution}</div>
</div>
<div>
resolution: {getStructureList.resolution}
</div>
</Form.Item> </Form.Item>
<Form.Item label="References " {...formItemLayout}> <Form.Item label='References ' {...formItemLayout}>
{getStructureList.References && {getStructureList.References &&
getStructureList.References.map( getStructureList.References.map((item, index) => {
(item, index) => { return (
return ( <Button
<Button type='primary'
type="primary" onClick={() => {
onClick={() => { this.getReferences(item);
this.getReferences(item) }}
}} key={index}
key={index} style={{ marginRight: '5px' }}
style={{ marginRight: '5px' }}> >
{item} {item}
</Button> </Button>
) );
} })}
)}
</Form.Item> </Form.Item>
</Form> </Form>
<Collapse accordion> <Collapse accordion>
<Panel header="对齐" key="1"> <Panel header='对齐' key='1'>
<div className="form-div"> <div className='form-div'>
<Form <Form onSubmit={this.handleSubmit} className='login-form'>
onSubmit={this.handleSubmit} <Form.Item label='Ref.PDB' {...formItemLayout2}>
className="login-form">
<Form.Item
label="Ref.PDB"
{...formItemLayout2}>
<div> <div>
<Select <Select style={{ width: '100px' }} value={this.state.superpositionData[0].pdbID} onChange={this.SelectValue}>
style={{ width: '100px' }} {DetailsData.Structure.map((item, index) => {
value={ return (
this.state.superpositionData[0].pdbID <Option key={index.pdb} value={item.pdb.toLowerCase()}>
} {item.pdb.toLowerCase()}
onChange={this.SelectValue}> </Option>
{DetailsData.Structure.map( );
(item, index) => { })}
return (
<Option
key={index.pdb}
value={item.pdb.toLowerCase()}>
{item.pdb.toLowerCase()}
</Option>
)
}
)}
</Select> </Select>
<Input <Input
placeholder="请输入Chain" placeholder='请输入Chain'
onChange={this.getValue} onChange={this.getValue}
value={ value={this.state.superpositionData[0].chainID}
this.state.superpositionData[0]
.chainID
}
style={{ style={{
width: '100px', width: '100px',
}} }}
...@@ -1264,101 +1109,84 @@ export default class SearchDetails extends Component { ...@@ -1264,101 +1109,84 @@ export default class SearchDetails extends Component {
{formItems} {formItems}
<Form.Item {...formItemLayoutWithOutLabel}> <Form.Item {...formItemLayoutWithOutLabel}>
{sum < 2 && ( {sum < 2 && (
<Button <Button type='dashed' onClick={this.add} style={{ width: '60%' }}>
type="dashed" <Icon type='plus' /> Add field
onClick={this.add}
style={{ width: '60%' }}>
<Icon type="plus" /> Add field
</Button> </Button>
)} )}
</Form.Item> </Form.Item>
<Form.Item {...formItemLayoutWithOutLabel}> <Form.Item {...formItemLayoutWithOutLabel}>
<Button type="primary" htmlType="submit"> <Button type='primary' htmlType='submit'>
对齐 对齐
</Button> </Button>
</Form.Item> </Form.Item>
</Form> </Form>
</div> </div>
</Panel> </Panel>
<Panel header="抽取配体" key="2"> <Panel header='抽取配体' key='2'>
<Form layout="horizontal"> <Form layout='horizontal'>
<Form.Item label="配体列表" {...formItemLayout}> <Form.Item label='配体列表' {...formItemLayout}>
{getStructureList.ligand_up_list && {getStructureList.ligand_up_list &&
getStructureList.ligand_up_list.map( getStructureList.ligand_up_list.map((item, index) => {
(item, index) => { return (
return ( <Popover
<Popover content={
content={ <div>
<div> <div
<div key={index}
key={index} style={{
style={{ width: '100px',
width: '100px', wordWrap: 'break-word',
wordWrap: 'break-word', wordBreak: 'normal',
wordBreak: 'normal', }}
}}> >
{item.comp_name} {item.comp_name}
</div>
<Jsme
height="100px"
width="100px"
options="depict,useopenchemlib"
smiles={item.smiles}
/>
</div> </div>
}>
{ <Jsme height='100px' width='100px' options='depict,useopenchemlib' smiles={item.smiles} />
<Button </div>
type="primary" }
style={{ marginRight: '5px' }}> >
{item.name} {
</Button> <Button type='primary' style={{ marginRight: '5px' }}>
} {item.name}
</Popover> </Button>
) }
} </Popover>
)} );
})}
</Form.Item> </Form.Item>
<Form.Item label="配体选择" {...formItemLayout}> <Form.Item label='配体选择' {...formItemLayout}>
<Select <Select style={{ width: 250 }} value={this.state.listData.ligand} size='large' onChange={this.LigandChange}>
style={{ width: 250 }}
value={this.state.listData.ligand}
size="large"
onChange={this.LigandChange}>
{getStructureList.ligand_list && {getStructureList.ligand_list &&
getStructureList.ligand_list.map( getStructureList.ligand_list.map((item, index) => {
(item, index) => { return (
return ( <Option key={index} value={item}>
<Option key={index} value={item}> {item}
{item} </Option>
</Option> );
) })}
}
)}
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item label="搜索半径" {...formItemLayout}> <Form.Item label='搜索半径' {...formItemLayout}>
<InputNumber <InputNumber
style={{ width: 250 }} style={{ width: 250 }}
min={getStructureList.resolution} min={getStructureList.resolution}
max={10} max={10}
placeholder={'请输入大于resolutiond数字'} placeholder={'请输入大于resolutiond数字'}
step={0.1} step={0.1}
size="large" size='large'
onChange={this.getResolutionData} onChange={this.getResolutionData}
/> />
</Form.Item> </Form.Item>
<Form.Item label="Search" {...formItemLayout}> <Form.Item label='Search' {...formItemLayout}>
<Button <Button
type="primary" type='primary'
style={{ marginLeft: 50, width: 150 }} style={{ marginLeft: 50, width: 150 }}
size="large" size='large'
loading={this.state.loading} loading={this.state.loading}
disabled={ disabled={getStructureList.ligand_list.length === 0}
getStructureList.ligand_list.length === 0 onClick={this.getList}
} >
onClick={this.getList}>
Search Search
</Button> </Button>
</Form.Item> </Form.Item>
...@@ -1367,21 +1195,15 @@ export default class SearchDetails extends Component { ...@@ -1367,21 +1195,15 @@ export default class SearchDetails extends Component {
</Collapse> </Collapse>
</div> </div>
</div> </div>
<Table <Table bordered rowKey='item' dataSource={getStructureList.chain} pagination={false} columns={columnsChain} />
bordered
rowKey="item"
dataSource={getStructureList.chain}
pagination={false}
columns={columnsChain}
/>
</TabPane> </TabPane>
) );
})} })}
</Tabs> </Tabs>
</Panel> </Panel>
</Collapse> </Collapse>
</Spin> </Spin>
</div> </div>
) );
} }
} }
import React, { Component } from "react"; import React, { Component } from "react";
import { Jsme } from "jsme-react"; import { Jsme } from "jsme-react";
import { Card, Button, Pagination, Tabs, Spin, message, Collapse,Tag } from "antd"; import { Card, Button, Pagination, Tabs, Spin, message, Collapse,Tag } from "antd";
import { request } from "../../../utils/request"; import request from "../../../utils/request";
import qs from "qs"; import qs from "qs";
import "./index.css"; import "./index.css";
const { TabPane } = Tabs; const { TabPane } = Tabs;
......
...@@ -22,7 +22,7 @@ import { ...@@ -22,7 +22,7 @@ import {
Pagination, Pagination,
} from 'antd' } from 'antd'
import WrappedIframe from '../../../components/iframePdb' import WrappedIframe from '../../../components/iframePdb'
import { request } from '../../../utils/request' import request from '../../../utils/request'
import Molstar from 'molstar-react' import Molstar from 'molstar-react'
import { Jsme } from 'jsme-react' import { Jsme } from 'jsme-react'
import qs from 'qs' import qs from 'qs'
...@@ -1178,7 +1178,7 @@ export default class TargetDetails extends Component { ...@@ -1178,7 +1178,7 @@ export default class TargetDetails extends Component {
{targetsDetail.Structure.map((item, index) => { {targetsDetail.Structure.map((item, index) => {
return ( return (
<Option key={index.pdb} value={item.pdb.toLowerCase()}> <Option key={index.pdb} value={item.pdb.toLowerCase()}>
{item.pdb.toLowerCase()} {item.pdb&&item.pdb.toLowerCase()}
</Option> </Option>
) )
})} })}
...@@ -1537,7 +1537,7 @@ export default class TargetDetails extends Component { ...@@ -1537,7 +1537,7 @@ export default class TargetDetails extends Component {
<Option <Option
key={index} key={index}
value={item.pdb.toLowerCase()}> value={item.pdb.toLowerCase()}>
{item.pdb.toLowerCase()} {item.pdb&&item.pdb.toLowerCase()}
</Option> </Option>
) )
} }
......
import React from 'react' import React from 'react';
import { Form, Input, Button,Select ,Tabs,message,Radio,Checkbox,Row ,Col} from 'antd'; import { Form, Input, Button, Select, Tabs, message, Radio, Checkbox, Row, Col } from 'antd';
import LogoTitlte from '../../components/LogoTitlte/index' import LogoTitlte from '../../components/LogoTitlte/index';
import { Jsme } from 'jsme-react' import { Jsme } from 'jsme-react';
import qs from 'qs' import qs from 'qs';
import { request } from '../../utils/request' import request from '../../utils/request';
import './style.css' import './style.css';
const { TabPane } = Tabs; const { TabPane } = Tabs;
const { Option } = Select; const { Option } = Select;
class Home extends React.Component { class Home extends React.Component {
state = { state = {
select_db:'Ligands', select_db: 'Ligands',
data:'', data: '',
page: 1, page: 1,
page_size: 10, page_size: 10,
data_type:'smile', data_type: 'smile',
target_class:'', target_class: '',
// target_families:'', // target_families:'',
searchData: { searchData: {
name: 'Drug', name: 'Drug',
...@@ -22,14 +22,14 @@ class Home extends React.Component { ...@@ -22,14 +22,14 @@ class Home extends React.Component {
pdb_status: 0, pdb_status: 0,
page: 1, page: 1,
page_size: 10, page_size: 10,
finger: 0 finger: 0,
}, },
TargetSearchData: { TargetSearchData: {
name: 'Target', name: 'Target',
target_class: '', target_class: '',
target_data: '', target_data: '',
target_family:'', target_family: '',
pdb_status: 0, pdb_status: 0,
page: 1, page: 1,
page_size: 10, page_size: 10,
...@@ -39,520 +39,479 @@ class Home extends React.Component { ...@@ -39,520 +39,479 @@ class Home extends React.Component {
name: 'Ligand', name: 'Ligand',
page: 1, page: 1,
page_size: 10, page_size: 10,
finger: 0 finger: 0,
}, },
IndicationSearchData:{ IndicationSearchData: {
name:'Indication', name: 'Indication',
indication:'', indication: '',
page: 1, page: 1,
page_size: 10 page_size: 10,
},
MutationSearchData: {
}, name: 'Mutation',
MutationSearchData:{ chembl_id: '',
name:'Mutation', target_class: 'All Class',
chembl_id:'', target_data: '',
target_class :'All Class', target_families: '',
target_data:'', idselect_data: [],
target_families:'' , page: 1,
idselect_data:[], page_size: 10,
page: 1, },
page_size: 10 disabled: true,
loading: false,
}, SelectList: [],
disabled:true, draw: false,
loading:false, classList: [],
SelectList:[], classData: 'All Class',
draw:false, allClassList: {},
classList:[], childClassList: [],
classData:'All Class', TargetClassList: [],
allClassList:{}, TargetAllClassList: [],
childClassList :[], TargetChildClassList: [],
TargetClassList:[], compoundList: ['DrugName', 'Smiles'],
TargetAllClassList:[], targetList: ['TargetName', 'UniprotId'],
TargetChildClassList:[], optionsList: [{ label: '查询drug相关靶点', value: 1 }, { label: '查询ligand相关靶点', value: 2, disabled: false }, { label: '是否有PDB结构', value: 3 }],
compoundList:[ };
'DrugName', // Mutation
'Smiles' CheckChange = (e) => {
console.log(e);
],
targetList:[
'TargetName',
'UniprotId'
],
optionsList:[
{ label: '查询drug相关靶点', value: 1 },
{ label: '查询ligand相关靶点', value: 2,disabled: false, },
{ label: '是否有PDB结构', value: 3 },
]
}
// Mutation
CheckChange=(e)=>{
console.log(e);
let MutationSearchData = this.state.MutationSearchData;
MutationSearchData.idselect_data=e
this.setState(()=>({MutationSearchData:MutationSearchData}))
}
onAllChange=(e)=>{
if (e.target.checked) {
let MutationSearchData = this.state.MutationSearchData;
let all_idselect_data=["TM1", "TM4", "TM7", "ICL3", "ECL3", "N-Term", "ECL1", "ICL1", "TM5", "TM2","TM3", "TM6", "ICL2", "ECL2", "C-Term"]
MutationSearchData.idselect_data=all_idselect_data
this.setState(()=>({MutationSearchData:MutationSearchData }))
}else{
let MutationSearchData = this.state.MutationSearchData; let MutationSearchData = this.state.MutationSearchData;
let all_idselect_data=[] MutationSearchData.idselect_data = e;
MutationSearchData.idselect_data=all_idselect_data this.setState(() => ({ MutationSearchData: MutationSearchData }));
this.setState(()=>({MutationSearchData:MutationSearchData })) };
onAllChange = (e) => {
} if (e.target.checked) {
let MutationSearchData = this.state.MutationSearchData;
let all_idselect_data = ['TM1', 'TM4', 'TM7', 'ICL3', 'ECL3', 'N-Term', 'ECL1', 'ICL1', 'TM5', 'TM2', 'TM3', 'TM6', 'ICL2', 'ECL2', 'C-Term'];
MutationSearchData.idselect_data = all_idselect_data;
} this.setState(() => ({ MutationSearchData: MutationSearchData }));
getMutationList=()=>{ } else {
let data= JSON.parse(JSON.stringify(this.state.MutationSearchData)) let MutationSearchData = this.state.MutationSearchData;
data.idselect_data= data.idselect_data.toString() let all_idselect_data = [];
this.setState(()=>({loading:true })) MutationSearchData.idselect_data = all_idselect_data;
request.post('/mutation_search', qs.stringify(data) ) this.setState(() => ({ MutationSearchData: MutationSearchData }));
.then(res => {
this.setState(()=>({loading:false }))
if (res.data.code===200) {
console.log(data);
this.props.history.push({ pathname: '/home/SearchList', search: qs.stringify(data)})
}else{
message.error(res.data.msg);
} }
}) };
.catch(err => { getMutationList = () => {
console.error(err); let data = JSON.parse(JSON.stringify(this.state.MutationSearchData));
}) data.idselect_data = data.idselect_data.toString();
} this.setState(() => ({ loading: true }));
childClassChange3=(e)=>{ request
console.log(e); .post('/mutation_search', qs.stringify(data))
let MutationSearchData = this.state.MutationSearchData; .then((res) => {
MutationSearchData.target_families=e this.setState(() => ({ loading: false }));
this.setState(()=>({MutationSearchData:MutationSearchData })) if (res.data.code === 200) {
console.log(data);
} this.props.history.push({ pathname: '/home/SearchList', search: qs.stringify(data) });
getClassData3=(e)=>{ } else {
console.log(e); message.error(res.data.msg);
this.setState(()=>({classData:e })) }
let MutationSearchData = this.state.MutationSearchData; })
MutationSearchData.target_class=e .catch((err) => {
this.setState(()=>({MutationSearchData:MutationSearchData })) console.error(err);
let value =this.state.allClassList });
let childData=value[e] };
console.log(childData); childClassChange3 = (e) => {
this.setState(()=>({childClassList:childData})) console.log(e);
let MutationSearchData = this.state.MutationSearchData;
} MutationSearchData.target_families = e;
getMutationValue=(e)=>{ this.setState(() => ({ MutationSearchData: MutationSearchData }));
const { value } = e.target; };
let MutationSearchData = this.state.MutationSearchData; getClassData3 = (e) => {
MutationSearchData.target_data=value console.log(e);
this.setState(()=>({MutationSearchData:MutationSearchData })) this.setState(() => ({ classData: e }));
let MutationSearchData = this.state.MutationSearchData;
} MutationSearchData.target_class = e;
getChemblValue=(e)=>{ this.setState(() => ({ MutationSearchData: MutationSearchData }));
const { value } = e.target; let value = this.state.allClassList;
let MutationSearchData = this.state.MutationSearchData; let childData = value[e];
MutationSearchData.chembl_id=value console.log(childData);
this.setState(()=>({MutationSearchData:MutationSearchData })) this.setState(() => ({ childClassList: childData }));
};
} getMutationValue = (e) => {
// Indication const { value } = e.target;
let MutationSearchData = this.state.MutationSearchData;
getIndicationValue=(e)=>{ MutationSearchData.target_data = value;
const { value } = e.target; this.setState(() => ({ MutationSearchData: MutationSearchData }));
let IndicationSearchData = this.state.IndicationSearchData; };
IndicationSearchData.indication=value getChemblValue = (e) => {
this.setState(()=>({IndicationSearchData:IndicationSearchData })) const { value } = e.target;
let MutationSearchData = this.state.MutationSearchData;
} MutationSearchData.chembl_id = value;
getIndicationList=()=>{ this.setState(() => ({ MutationSearchData: MutationSearchData }));
let data=this.state.IndicationSearchData };
if (data.indication == '') { // Indication
return message.warning('请输入查询条件!')
}
this.setState(()=>({loading:true }))
request.post('/kinase/indication_search', data )
.then(res => {
this.setState(()=>({loading:false }))
if (res.data.code===200) {
this.props.history.push({ pathname: '/Kinase/IndicationDetails', search: qs.stringify(data)})
}else{
message.error(res.data.msg);
}
})
.catch(err => {
console.error(err);
})
}
// ligend
getLigendValue=(e)=>{
const { value } = e.target;
let ligandSearchData = this.state.ligandSearchData;
ligandSearchData.ligand_data=value
this.setState(()=>({ligandSearchData:ligandSearchData }))
}
logSmiles2=(e)=>{ getIndicationValue = (e) => {
let ligandSearchData = this.state.ligandSearchData; const { value } = e.target;
ligandSearchData.ligand_data =e let IndicationSearchData = this.state.IndicationSearchData;
this.setState(()=>({ligandSearchData:ligandSearchData })) IndicationSearchData.indication = value;
// this.setState(()=>({data:e })) this.setState(() => ({ IndicationSearchData: IndicationSearchData }));
} };
getLigendList=()=>{ getIndicationList = () => {
let data=this.state.ligandSearchData let data = this.state.IndicationSearchData;
if (data.ligand_data == '') { if (data.indication == '') {
return message.warning('请输入查询条件!') return message.warning('请输入查询条件!');
}
this.setState(()=>({loading:true }))
request.post('/kinase/ligand_search', data )
.then(res => {
console.log(res)
this.setState(()=>({loading:false }))
if (res.data.code===200) {
this.props.history.push({ pathname: '/Kinase/SearchList', search: qs.stringify(data)})
}else{
message.error(res.data.msg);
} }
}) this.setState(() => ({ loading: true }));
.catch(err => { request
console.error(err); .post('/kinase/indication_search', data)
}) .then((res) => {
} this.setState(() => ({ loading: false }));
getLigandData=(e)=>{ if (res.data.code === 200) {
const { value } = e.target; this.props.history.push({ pathname: '/Kinase/IndicationDetails', search: qs.stringify(data) });
let ligandSearchData = this.state.ligandSearchData; } else {
ligandSearchData.target_data=value message.error(res.data.msg);
this.setState(()=>({ligandSearchData:ligandSearchData })) }
})
} .catch((err) => {
ligandChange=(e)=>{ console.error(err);
let ligandSearchData = this.state.ligandSearchData; });
ligandSearchData.target_type =e };
this.setState(()=>({ligandSearchData:ligandSearchData }))
// ligend
} getLigendValue = (e) => {
childClassChange2=(e)=>{ const { value } = e.target;
console.log(e); let ligandSearchData = this.state.ligandSearchData;
let ligandSearchData = this.state.ligandSearchData; ligandSearchData.ligand_data = value;
ligandSearchData.target_families=e this.setState(() => ({ ligandSearchData: ligandSearchData }));
this.setState(()=>({ligandSearchData:ligandSearchData })) };
} logSmiles2 = (e) => {
getClassData2=(e)=>{ let ligandSearchData = this.state.ligandSearchData;
console.log(e); ligandSearchData.ligand_data = e;
this.setState(()=>({classData:e })) this.setState(() => ({ ligandSearchData: ligandSearchData }));
let ligandSearchData = this.state.ligandSearchData; // this.setState(()=>({data:e }))
ligandSearchData.target_class=e };
this.setState(()=>({ligandSearchData:ligandSearchData })) getLigendList = () => {
let value =this.state.allClassList let data = this.state.ligandSearchData;
let childData=value[e] if (data.ligand_data == '') {
console.log(childData); return message.warning('请输入查询条件!');
this.setState(()=>({childClassList:childData}))
}
// Target
getTargetClassData=(e)=>{
this.setState(()=>({classData:e }))
let TargetSearchData = this.state.TargetSearchData;
TargetSearchData.target_family=''
this.setState(()=>({TargetSearchData:TargetSearchData }))
TargetSearchData.target_class=e
this.setState(()=>({TargetSearchData:TargetSearchData }))
let value =this.state.TargetClassList
value.map((item)=>{
if (item.name===e) {
this.setState(()=>({TargetChildClassList:item.content}))
} }
this.setState(() => ({ loading: true }));
request
.post('/kinase/ligand_search', data)
.then((res) => {
console.log(res);
this.setState(() => ({ loading: false }));
if (res.data.code === 200) {
this.props.history.push({ pathname: '/Kinase/SearchList', search: qs.stringify(data) });
} else {
message.error(res.data.msg);
}
})
.catch((err) => {
console.error(err);
});
};
getLigandData = (e) => {
const { value } = e.target;
let ligandSearchData = this.state.ligandSearchData;
ligandSearchData.target_data = value;
this.setState(() => ({ ligandSearchData: ligandSearchData }));
};
ligandChange = (e) => {
let ligandSearchData = this.state.ligandSearchData;
ligandSearchData.target_type = e;
this.setState(() => ({ ligandSearchData: ligandSearchData }));
};
childClassChange2 = (e) => {
console.log(e);
let ligandSearchData = this.state.ligandSearchData;
ligandSearchData.target_families = e;
this.setState(() => ({ ligandSearchData: ligandSearchData }));
};
getClassData2 = (e) => {
console.log(e);
this.setState(() => ({ classData: e }));
let ligandSearchData = this.state.ligandSearchData;
ligandSearchData.target_class = e;
this.setState(() => ({ ligandSearchData: ligandSearchData }));
let value = this.state.allClassList;
let childData = value[e];
console.log(childData);
this.setState(() => ({ childClassList: childData }));
};
// Target
getTargetClassData = (e) => {
this.setState(() => ({ classData: e }));
let TargetSearchData = this.state.TargetSearchData;
TargetSearchData.target_family = '';
this.setState(() => ({ TargetSearchData: TargetSearchData }));
TargetSearchData.target_class = e;
this.setState(() => ({ TargetSearchData: TargetSearchData }));
let value = this.state.TargetClassList;
value.map((item) => {
if (item.name === e) {
this.setState(() => ({ TargetChildClassList: item.content }));
}
});
}) // let childData=value[e]
// console.log(childData);
// this.setState(()=>({childClassList:childData}))
// let childData=value[e] };
// console.log(childData);
// this.setState(()=>({childClassList:childData}))
}
childTargetClassChange=(e)=>{
console.log(e);
let TargetSearchData = this.state.TargetSearchData;
TargetSearchData.target_family=e
this.setState(()=>({TargetSearchData:TargetSearchData }))
}
targetChange=(e)=>{
let TargetSearchData = this.state.TargetSearchData;
TargetSearchData.target_type =e
this.setState(()=>({TargetSearchData:TargetSearchData }))
} childTargetClassChange = (e) => {
getindTargetication=(e)=>{ console.log(e);
const { value } = e.target; let TargetSearchData = this.state.TargetSearchData;
let TargetSearchData = this.state.TargetSearchData; TargetSearchData.target_family = e;
TargetSearchData.indication=value this.setState(() => ({ TargetSearchData: TargetSearchData }));
this.setState(()=>({TargetSearchData:TargetSearchData })) };
targetChange = (e) => {
} let TargetSearchData = this.state.TargetSearchData;
getTargetData2=(e)=>{ TargetSearchData.target_type = e;
const { value } = e.target; this.setState(() => ({ TargetSearchData: TargetSearchData }));
let TargetSearchData = this.state.TargetSearchData; };
TargetSearchData.target_data=value getindTargetication = (e) => {
this.setState(()=>({TargetSearchData:TargetSearchData })) const { value } = e.target;
let TargetSearchData = this.state.TargetSearchData;
} TargetSearchData.indication = value;
get_drug_name=(e)=>{ this.setState(() => ({ TargetSearchData: TargetSearchData }));
const { value } = e.target; };
let TargetSearchData = this.state.TargetSearchData; getTargetData2 = (e) => {
TargetSearchData.drug_name=value const { value } = e.target;
this.setState(()=>({TargetSearchData:TargetSearchData })) let TargetSearchData = this.state.TargetSearchData;
TargetSearchData.target_data = value;
} this.setState(() => ({ TargetSearchData: TargetSearchData }));
getTargetList=()=>{ };
let data=this.state.TargetSearchData get_drug_name = (e) => {
if (data.target_class == '' && data.target_data == '') { const { value } = e.target;
return message.warning('请输入查询条件!') let TargetSearchData = this.state.TargetSearchData;
} TargetSearchData.drug_name = value;
this.setState(()=>({loading:true })) this.setState(() => ({ TargetSearchData: TargetSearchData }));
request.post('/kinase/targets_search', data ) };
.then(res => { getTargetList = () => {
console.log(res) let data = this.state.TargetSearchData;
this.setState(()=>({loading:false })) if (data.target_class == '' && data.target_data == '') {
if (res.data.code===200) { return message.warning('请输入查询条件!');
this.props.history.push({ pathname: '/Kinase/SearchList', search: qs.stringify(data)})
}else{
message.error(res.data.msg);
} }
}) this.setState(() => ({ loading: true }));
.catch(err => { request
console.error(err); .post('/kinase/targets_search', data)
}) .then((res) => {
} console.log(res);
this.setState(() => ({ loading: false }));
onChangeCheckbox=(e)=>{ if (res.data.code === 200) {
console.log(e); this.props.history.push({ pathname: '/Kinase/SearchList', search: qs.stringify(data) });
let TargetSearchData = this.state.TargetSearchData; } else {
TargetSearchData.select_status=e message.error(res.data.msg);
this.setState(()=>({TargetSearchData:TargetSearchData})) }
console.log(this.state.TargetSearchData); })
} .catch((err) => {
handleChange=(e)=>{ console.error(err);
});
};
onChangeCheckbox = (e) => {
console.log(e);
let TargetSearchData = this.state.TargetSearchData;
TargetSearchData.select_status = e;
this.setState(() => ({ TargetSearchData: TargetSearchData }));
console.log(this.state.TargetSearchData);
};
handleChange = (e) => {
console.log(e); console.log(e);
this.setState(()=>({select_db:e })) this.setState(() => ({ select_db: e }));
if (e!='Ligands') { if (e != 'Ligands') {
this.setState(()=>({data:'' })) this.setState(() => ({ data: '' }));
} }
} };
childClassChange=(e)=>{ childClassChange = (e) => {
console.log(e); console.log(e);
let searchData = this.state.searchData; let searchData = this.state.searchData;
searchData.target_families=e searchData.target_families = e;
this.setState(()=>({searchData:searchData })) this.setState(() => ({ searchData: searchData }));
};
} getClassData = (e) => {
getClassData=(e)=>{
console.log(e); console.log(e);
this.setState(()=>({classData:e })) this.setState(() => ({ classData: e }));
let searchData = this.state.searchData; let searchData = this.state.searchData;
searchData.target_class=e searchData.target_class = e;
this.setState(()=>({searchData:searchData })) this.setState(() => ({ searchData: searchData }));
console.log(this.state.searchData); console.log(this.state.searchData);
let value =this.state.allClassList let value = this.state.allClassList;
let childData=value[e] let childData = value[e];
console.log(childData); console.log(childData);
this.setState(()=>({childClassList:childData})) this.setState(() => ({ childClassList: childData }));
};
} targetChange = (e) => {
targetChange=(e)=>{
let searchData = this.state.searchData; let searchData = this.state.searchData;
searchData.target_type =e searchData.target_type = e;
this.setState(()=>({searchData:searchData })) this.setState(() => ({ searchData: searchData }));
};
} logSmiles = (e) => {
logSmiles=(e)=>{
let searchData = this.state.searchData; let searchData = this.state.searchData;
searchData.drugs_data =e searchData.drugs_data = e;
this.setState(()=>({searchData:searchData })) this.setState(() => ({ searchData: searchData }));
// this.setState(()=>({data:e })) // this.setState(()=>({data:e }))
} };
componentDidMount(){ componentDidMount() {
// this.getList() // this.getList()
// this.getSelectList() // this.getSelectList()
this.getTargetSelectList() this.getTargetSelectList();
} }
getSelectList=()=>{ getSelectList = () => {
request.get('/kinase/target_class/drug') request
.then(res => { .get('/kinase/target_class/drug')
console.log(res) .then((res) => {
if (res.data.code===200) { console.log(res);
console.log(res.data.data); if (res.data.code === 200) {
console.log(res.data.data);
this.setState({
classList: Object.keys(res.data.data), this.setState({
allClassList:res.data.data classList: Object.keys(res.data.data),
allClassList: res.data.data,
});
console.log(this.state);
} else {
message.error(res.data.msg);
}
})
.catch((err) => {
console.error(err);
});
};
getTargetSelectList = () => {
// debugger
// alert(11);
// localStorage.getItem('token') &&
request
.get('/kinase/target_class/target')
.then((res) => {
console.log(res);
if (res.data.code === 200) {
console.log(res.data.data);
this.setState({
TargetClassList: res.data.data,
TargetAllClassList: res.data.data,
});
console.log(this.state);
} else {
message.error(res.data.msg);
}
}) })
console.log(this.state ); .catch((err) => {
}else{ console.error(err);
message.error(res.data.msg); });
} };
}) getValue = (e) => {
.catch(err => {
console.error(err);
})
}
getTargetSelectList=()=>{
request.get('/kinase/target_class/target')
.then(res => {
console.log(res)
if (res.data.code===200) {
console.log(res.data.data);
this.setState({
TargetClassList: res.data.data,
TargetAllClassList:res.data.data
})
console.log(this.state );
}else{
message.error(res.data.msg);
}
})
.catch(err => {
console.error(err);
})
}
getValue=(e)=>{
const { value } = e.target; const { value } = e.target;
let searchData = this.state.searchData; let searchData = this.state.searchData;
searchData.drugs_data=value searchData.drugs_data = value;
this.setState(()=>({searchData:searchData })) this.setState(() => ({ searchData: searchData }));
};
} getindication = (e) => {
getindication=(e)=>{
const { value } = e.target; const { value } = e.target;
let searchData = this.state.searchData; let searchData = this.state.searchData;
searchData.indication=value searchData.indication = value;
this.setState(()=>({searchData:searchData })) this.setState(() => ({ searchData: searchData }));
};
} getTargetData = (e) => {
getTargetData=(e)=>{
const { value } = e.target; const { value } = e.target;
let searchData = this.state.searchData; let searchData = this.state.searchData;
searchData.target_data=value searchData.target_data = value;
this.setState(()=>({searchData:searchData })) this.setState(() => ({ searchData: searchData }));
};
}
onChangeRadio = (e) => {
let value = e.target.value onChangeRadio = (e) => {
let searchData = this.state.searchData let value = e.target.value;
searchData.pdb_status = value let searchData = this.state.searchData;
searchData.pdb_status = value;
this.setState({ this.setState({
searchData: searchData, searchData: searchData,
}) });
} };
onChangeRadio2 = (e) => { onChangeRadio2 = (e) => {
let value = e.target.value;
let value = e.target.value let TargetSearchData = this.state.TargetSearchData;
let TargetSearchData = this.state.TargetSearchData TargetSearchData.pdb_status = value;
TargetSearchData.pdb_status = value
this.setState({ this.setState({
TargetSearchData: TargetSearchData, TargetSearchData: TargetSearchData,
}) });
} };
onChangeRadio3 = (e) => { onChangeRadio3 = (e) => {
let value = e.target.value let value = e.target.value;
let searchData = this.state.searchData let searchData = this.state.searchData;
searchData.finger = value searchData.finger = value;
this.setState({ this.setState({
searchData: searchData, searchData: searchData,
}) });
} };
onChangeRadio4 = (e) => { onChangeRadio4 = (e) => {
let value = e.target.value let value = e.target.value;
let ligandSearchData = this.state.ligandSearchData let ligandSearchData = this.state.ligandSearchData;
ligandSearchData.finger = value ligandSearchData.finger = value;
this.setState({ this.setState({
ligandSearchData: ligandSearchData, ligandSearchData: ligandSearchData,
}) });
} };
getList=()=>{ getList = () => {
let data=this.state.searchData let data = this.state.searchData;
request.post('/ligand_search', qs.stringify(data) ) request
.then(res => { .post('/ligand_search', qs.stringify(data))
console.log(res) .then((res) => {
if (res.data.code===200) { console.log(res);
this.props.history.push({ pathname: '/home/SearchList', search: qs.stringify(data)}) if (res.data.code === 200) {
}else{ this.props.history.push({ pathname: '/home/SearchList', search: qs.stringify(data) });
message.error(res.data.msg); } else {
} message.error(res.data.msg);
}) }
.catch(err => { })
console.error(err); .catch((err) => {
}) console.error(err);
} });
getDrugsList=()=>{ };
let data=this.state.searchData getDrugsList = () => {
let data = this.state.searchData;
if (data.drugs_data == '') { if (data.drugs_data == '') {
return message.warning('请输入查询条件!') return message.warning('请输入查询条件!');
} }
this.setState(()=>({loading:true })) this.setState(() => ({ loading: true }));
request.post('/kinase/drug_search', data ) this.props.history.push({ pathname: '/kinase/SearchList', search: qs.stringify(data) });
.then(res => { // request
console.log(res) // .post('/kinase/drug_search', data)
this.setState(()=>({loading:false })) // .then((res) => {
if (res.data.code===200) { // console.log(res);
this.props.history.push({ pathname: '/kinase/SearchList', search: qs.stringify(data)}) // this.setState(() => ({ loading: false }));
}else{ // if (res.data.code === 200) {
message.error(res.data.msg); // this.props.history.push({ pathname: '/kinase/SearchList', search: qs.stringify(data) });
} // } else {
}) // message.error(res.data.msg);
.catch(err => { // }
console.error(err); // })
}) // .catch((err) => {
} // console.error(err);
getDraw=()=>{ // });
this.setState(()=>({draw:!this.state.draw })) };
} getDraw = () => {
compoundChange=(e)=>{ this.setState(() => ({ draw: !this.state.draw }));
};
compoundChange = (e) => {
console.log(e); console.log(e);
let searchData = this.state.searchData; let searchData = this.state.searchData;
searchData.drugs_type=e searchData.drugs_type = e;
this.setState(()=>({searchData:searchData })) this.setState(() => ({ searchData: searchData }));
console.log(this.state.searchData) console.log(this.state.searchData);
};
} callback = (e) => {
callback=(e)=>{ console.log(e);
console.log(e); let searchData = this.state.searchData;
let searchData = this.state.searchData; searchData.name = e;
searchData.name=e this.setState(() => ({ searchData: searchData }));
this.setState(()=>({searchData:searchData })) console.log(this.state.searchData);
console.log(this.state.searchData); };
} getJsme = () => {
getJsme=()=>{
console.log(1); console.log(1);
} };
render() { render() {
const {select_db,data,data_type,optionsList,draw,SelectList,targetList,classList,classData,childClassList,compoundList,TargetClassList,TargetChildClassList}=this.state const { select_db, data, data_type, optionsList, draw, SelectList, targetList, classList, classData, childClassList, compoundList, TargetClassList, TargetChildClassList } = this.state;
const formItemLayout ={ const formItemLayout = {
labelCol: { span: 8 }, labelCol: { span: 8 },
wrapperCol: { span: 12 }, wrapperCol: { span: 12 },
} };
const formTailLayout = { const formTailLayout = {
labelCol: { span: 8 }, labelCol: { span: 8 },
wrapperCol: { span: 12, offset: 8 }, wrapperCol: { span: 12, offset: 8 },
...@@ -565,79 +524,48 @@ onChangeCheckbox=(e)=>{ ...@@ -565,79 +524,48 @@ onChangeCheckbox=(e)=>{
<div className='home'> <div className='home'>
<div className='home-div'> <div className='home-div'>
{/* <LogoTitlte></LogoTitlte> */} {/* <LogoTitlte></LogoTitlte> */}
<Tabs onChange={this.callback} type="card"> <Tabs onChange={this.callback} type='card'>
<TabPane tab="Drug" key="Drug"> <TabPane tab='Drug' key='Drug'>
<div className="top-div"> <div className='top-div'>
<div> <div>
<Form layout="horizontal"> <Form layout='horizontal'>
<Form.Item label="请输入药物名或Smiles" {...formItemLayout}> <Form.Item label='请输入药物名或Smiles' {...formItemLayout}>
<Input <Input placeholder='请输入化合物' style={{ width: 250 }} size='large' onChange={this.getValue} value={this.state.searchData.drugs_data} />
placeholder="请输入化合物"
style={{ width: 250 }}
size="large"
onChange={this.getValue}
value={this.state.searchData.drugs_data}
/>
</Form.Item> </Form.Item>
<Form.Item label="" {...formTailLayout}> <Form.Item label='' {...formTailLayout}>
<Button <Button type='primary' style={{ marginRight: '50px' }} onClick={this.getDraw}>
type="primary"
style={{ marginRight: '50px' }}
onClick={this.getDraw}>
画结构 画结构
</Button> </Button>
<div <div className={draw ? 'bottom-div' : 'bottom-div isShowDiv'}>
className={draw ? 'bottom-div' : 'bottom-div isShowDiv'} <Radio.Group onChange={this.onChangeRadio3} value={this.state.searchData.finger}>
>
<Radio.Group
onChange={this.onChangeRadio3}
value={this.state.searchData.finger}>
<Radio value={0}>Substructure</Radio> <Radio value={0}>Substructure</Radio>
{/* <Radio value={1}>有GPCR相关PDB结构</Radio> */} {/* <Radio value={1}>有GPCR相关PDB结构</Radio> */}
<Radio value={1}>Similar Structure</Radio> <Radio value={1}>Similar Structure</Radio>
</Radio.Group> </Radio.Group>
</div> </div>
<div <div className={draw ? 'bottom-div' : 'bottom-div isShowDiv'} onClick={this.getJsme}>
className={draw ? 'bottom-div' : 'bottom-div isShowDiv'} <Jsme height='500px' width='700px' options='oldlook,star' onChange={this.logSmiles} />
onClick={this.getJsme}>
<Jsme
height="500px"
width="700px"
options="oldlook,star"
onChange={this.logSmiles}
/>
</div> </div>
</Form.Item> </Form.Item>
<Form.Item label="使用PDB查询" {...formItemLayout}> <Form.Item label='使用PDB查询' {...formItemLayout}>
<Radio.Group <Radio.Group onChange={this.onChangeRadio} value={this.state.searchData.pdb_status}>
onChange={this.onChangeRadio}
value={this.state.searchData.pdb_status}>
<Radio value={0}>不使用</Radio> <Radio value={0}>不使用</Radio>
{/* <Radio value={1}>有GPCR相关PDB结构</Radio> */} {/* <Radio value={1}>有GPCR相关PDB结构</Radio> */}
<Radio value={2}>PDB结构</Radio> <Radio value={2}>PDB结构</Radio>
</Radio.Group> </Radio.Group>
</Form.Item> </Form.Item>
<Form.Item <Form.Item label='' {...formTailLayout}>
label="" <Button type='primary' style={{ width: 150 }} size='large' loading={this.state.loading} onClick={this.getDrugsList}>
{...formTailLayout}>
<Button
type="primary"
style={{ width: 150 }}
size="large"
loading={this.state.loading}
onClick={this.getDrugsList}>
Search Search
</Button> </Button>
</Form.Item> </Form.Item>
<Form.Item label="Tips" {...formTailLayout2}> <Form.Item label='Tips' {...formTailLayout2}>
<div className='Tips-div'> <div className='Tips-div'>
<div>1.本页面提供Kinase相关药物的搜索。</div> <div>1.本页面提供Kinase相关药物的搜索。</div>
<div>2.您可以直接使用药物名称或者ChEMBL ID进行搜索。</div> <div>2.您可以直接使用药物名称或者ChEMBL ID进行搜索。</div>
<div>3.您可以使用所需结构或者结构片段以及对应的Smiles进行搜索。</div> <div>3.您可以使用所需结构或者结构片段以及对应的Smiles进行搜索。</div>
<div> 4.您可以筛选其中有PDB结构的配体进行搜索。</div> <div> 4.您可以筛选其中有PDB结构的配体进行搜索。</div>
<div> 5.您可以根据所查看靶点来检索配体。</div> <div> 5.您可以根据所查看靶点来检索配体。</div>
</div> </div>
</Form.Item> </Form.Item>
...@@ -645,156 +573,98 @@ onChangeCheckbox=(e)=>{ ...@@ -645,156 +573,98 @@ onChangeCheckbox=(e)=>{
</div> </div>
</div> </div>
</TabPane> </TabPane>
<TabPane tab="Target" key="Target"> <TabPane tab='Target' key='Target'>
<div className="top-div"> <div className='top-div'>
<div> <div>
<Form layout="horizontal"> <Form layout='horizontal'>
<Form.Item label="请选择Class" {...formItemLayout}> <Form.Item label='请选择Class' {...formItemLayout}>
<Select <Select value={this.state.TargetSearchData.target_class} style={{ width: 250 }} size='large' placeholder='请选择' onChange={this.getTargetClassData}>
value={this.state.TargetSearchData.target_class} {TargetClassList &&
style={{ width: 250 }} TargetClassList.length > 0 &&
size="large" TargetClassList.map((item, index) => {
placeholder="请选择" return (
onChange={this.getTargetClassData}> <Option key={index} value={item.class}>
{TargetClassList.map((item, index) => { {item.class}
return ( {/* {item.name}({item.number}) */}
<Option key={index} value={item.name}> </Option>
{item.name}({item.number}) );
</Option> })}
)
})}
</Select> </Select>
<Select <Select value={this.state.TargetSearchData.target_family} style={{ width: 250 }} size='large' placeholder='请选择' onChange={this.childTargetClassChange}>
value={this.state.TargetSearchData.target_family} {TargetChildClassList &&
style={{ width: 250 }} TargetChildClassList.length > 0 &&
size="large" TargetChildClassList.map((item, index) => {
placeholder="请选择" return (
onChange={this.childTargetClassChange}> <Option key={index} value={item.name}>
{TargetChildClassList.map((item, index) => { {item.name} ({item.number})
return ( </Option>
<Option key={index} value={item.name}> );
{item.name} ({item.number}) })}
</Option>
)
})}
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item <Form.Item label='请输入Target name或Uniprot id' {...formItemLayout}>
label="请输入Target name或Uniprot id" <Input placeholder='请输入' style={{ width: 250 }} size='large' onChange={this.getTargetData2} value={this.state.TargetSearchData.target_data} />
{...formItemLayout}>
<Input
placeholder="请输入"
style={{ width: 250 }}
size="large"
onChange={this.getTargetData2}
value={this.state.TargetSearchData.target_data}
/>
</Form.Item> </Form.Item>
<Form.Item label="使用PDB查询" {...formItemLayout}> <Form.Item label='使用PDB查询' {...formItemLayout}>
<Radio.Group <Radio.Group onChange={this.onChangeRadio2} value={this.state.TargetSearchData.pdb_status}>
onChange={this.onChangeRadio2}
value={this.state.TargetSearchData.pdb_status}>
<Radio value={0}>不使用</Radio> <Radio value={0}>不使用</Radio>
{/* <Radio value={1}>有GPCR相关PDB结构</Radio> */} {/* <Radio value={1}>有GPCR相关PDB结构</Radio> */}
<Radio value={2}>PDB结构</Radio> <Radio value={2}>PDB结构</Radio>
</Radio.Group> </Radio.Group>
</Form.Item> </Form.Item>
<Form.Item <Form.Item label='' {...formTailLayout}>
label="" <Button type='primary' style={{ width: 150 }} size='large' loading={this.state.loading} onClick={this.getTargetList}>
{...formTailLayout}>
<Button
type="primary"
style={{ width: 150 }}
size="large"
loading={this.state.loading}
onClick={this.getTargetList}>
Search Search
</Button> </Button>
</Form.Item> </Form.Item>
<Form.Item label="Tips" {...formTailLayout2}> <Form.Item label='Tips' {...formTailLayout2}>
<div className='Tips-div'> <div className='Tips-div'>
<div>1. 本页面提供Kinase相关靶点数据检索功能。</div> <div>1. 本页面提供Kinase相关靶点数据检索功能。</div>
<div>2. 您可以直接检索靶点Uniprot名称或者ID,精准搜索您所需要的靶点。</div> <div>2. 您可以直接检索靶点Uniprot名称或者ID,精准搜索您所需要的靶点。</div>
<div>3. 您可以选择查看有PDB结构的靶点。</div> <div>3. 您可以选择查看有PDB结构的靶点。</div>
</div> </div>
</Form.Item> </Form.Item>
</Form> </Form>
</div> </div>
</div> </div>
</TabPane> </TabPane>
<TabPane tab="Ligand" key="Ligand"> <TabPane tab='Ligand' key='Ligand'>
<div className="top-div"> <div className='top-div'>
<div> <div>
<Form layout="horizontal"> <Form layout='horizontal'>
<Form.Item label="输入Chemblid或Smiles" {...formItemLayout}> <Form.Item label='输入Chemblid或Smiles' {...formItemLayout}>
<Input <Input placeholder='请输入' style={{ width: 250 }} size='large' onChange={this.getLigendValue} value={this.state.ligandSearchData.ligand_data} />
placeholder="请输入"
style={{ width: 250 }}
size="large"
onChange={this.getLigendValue}
value={this.state.ligandSearchData.ligand_data}
/>
</Form.Item> </Form.Item>
<Form.Item label="" {...formTailLayout}> <Form.Item label='' {...formTailLayout}>
<Button <Button type='primary' style={{ marginRight: '50px' }} onClick={this.getDraw}>
type="primary"
style={{ marginRight: '50px' }}
onClick={this.getDraw}>
画结构 画结构
</Button> </Button>
<Button <Button type='primary' style={{ marginLeft: 50, width: 150 }} size='large' loading={this.state.loading} onClick={this.getLigendList}>
type="primary"
style={{ marginLeft: 50, width: 150 }}
size="large"
loading={this.state.loading}
onClick={this.getLigendList}>
Search Search
</Button> </Button>
<div <div className={draw ? 'bottom-div' : 'bottom-div isShowDiv'}>
className={draw ? 'bottom-div' : 'bottom-div isShowDiv'} <Radio.Group onChange={this.onChangeRadio4} value={this.state.ligandSearchData.finger}>
>
<Radio.Group
onChange={this.onChangeRadio4}
value={this.state.ligandSearchData.finger}>
<Radio value={0}>Substructure</Radio> <Radio value={0}>Substructure</Radio>
{/* <Radio value={1}>有GPCR相关PDB结构</Radio> */} {/* <Radio value={1}>有GPCR相关PDB结构</Radio> */}
<Radio value={1}>Similar Structure</Radio> <Radio value={1}>Similar Structure</Radio>
</Radio.Group> </Radio.Group>
</div> </div>
<div <div className={draw ? 'bottom-div' : 'bottom-div isShowDiv'} onClick={this.getJsme}>
className={draw ? 'bottom-div' : 'bottom-div isShowDiv'} <Jsme height='500px' width='700px' options='oldlook,star' onChange={this.logSmiles2} />
onClick={this.getJsme}>
<Jsme
height="500px"
width="700px"
options="oldlook,star"
onChange={this.logSmiles2}
/>
</div> </div>
</Form.Item> </Form.Item>
</Form> </Form>
</div> </div>
</div> </div>
</TabPane> </TabPane>
<TabPane tab="Indication" key="Indication"> <TabPane tab='Indication' key='Indication'>
<div className="top-div"> <div className='top-div'>
<div> <div>
<Form layout="horizontal"> <Form layout='horizontal'>
<Form.Item label="输入适应症进行检索" {...formItemLayout}> <Form.Item label='输入适应症进行检索' {...formItemLayout}>
<Input <Input placeholder='请输入适应症' style={{ width: 250 }} size='large' onChange={this.getIndicationValue} value={this.state.IndicationSearchData.indication} />
placeholder="请输入适应症" <Button type='primary' style={{ marginLeft: 50, width: 150 }} size='large' loading={this.state.loading} onClick={this.getIndicationList}>
style={{ width: 250 }}
size="large"
onChange={this.getIndicationValue}
value={this.state.IndicationSearchData.indication}
/>
<Button
type="primary"
style={{ marginLeft: 50, width: 150 }}
size="large"
loading={this.state.loading}
onClick={this.getIndicationList}>
Search Search
</Button> </Button>
</Form.Item> </Form.Item>
...@@ -803,11 +673,10 @@ onChangeCheckbox=(e)=>{ ...@@ -803,11 +673,10 @@ onChangeCheckbox=(e)=>{
</div> </div>
</TabPane> </TabPane>
</Tabs> </Tabs>
</div> </div>
</div> </div>
) );
} }
} }
export default Home export default Home;
\ No newline at end of file
...@@ -4,7 +4,7 @@ import { withRouter } from 'react-router-dom' ...@@ -4,7 +4,7 @@ import { withRouter } from 'react-router-dom'
import { inject, observer } from 'mobx-react/index' import { inject, observer } from 'mobx-react/index'
import { Form, Input,message } from 'antd' import { Form, Input,message } from 'antd'
import PromptBox from '../../components/PromptBox' import PromptBox from '../../components/PromptBox'
import { request } from '../../utils/request' import request from '../../utils/request'
import md5 from 'js-md5'; import md5 from 'js-md5';
import qs from 'qs' import qs from 'qs'
......
import React from 'react' import React from 'react';
import BGParticle from '../../utils/BGParticle' import BGParticle from '../../utils/BGParticle';
import { notification } from 'antd' import { notification } from 'antd';
import './style.css' import './style.css';
import { withRouter } from 'react-router-dom' import { withRouter } from 'react-router-dom';
import { inject, observer } from 'mobx-react/index' import { inject, observer } from 'mobx-react/index';
import Loading2 from '../../components/Loading2' import Loading2 from '../../components/Loading2';
import {preloadingImages} from '../../utils/utils' import { preloadingImages } from '../../utils/utils';
import LogoTitlte from '../../components/LogoTitlte/index' import LogoTitlte from '../../components/LogoTitlte/index';
import 'animate.css' import 'animate.css';
import LoginForm from './LoginForm' import LoginForm from './LoginForm';
import RegisterForm from './RegisterForm' import RegisterForm from './RegisterForm';
const url = '' const url = '';
const imgs = [ const imgs = [
// 'http://47.99.130.140/imgs/wallhaven-p8r1e9.jpg', // 'http://47.99.130.140/imgs/wallhaven-p8r1e9.jpg',
// 'http://47.99.130.140/imgs/wallhaven-e7zyy8.jpg', // 'http://47.99.130.140/imgs/wallhaven-e7zyy8.jpg',
// 'http://47.99.130.140/imgs/wallhaven-6k9e7q.jpg', // 'http://47.99.130.140/imgs/wallhaven-6k9e7q.jpg',
// 'http://47.99.130.140/imgs/photo.jpg', // 'http://47.99.130.140/imgs/photo.jpg',
] ];
@withRouter //更新的作用
@inject('appStore') //接收
@observer //组件变为响应式
@withRouter @inject('appStore') @observer //这三步会把对应的store挂在props上
class Login extends React.Component { class Login extends React.Component {
state = { state = {
showBox: 'login', //展示当前表单 showBox: 'login', //展示当前表单
url: '', //背景图片 url: '', //背景图片
loading:false, loading: false,
loading2:false, loading2: false,
} };
componentDidMount () { componentDidMount() {
this.props.appStore.toggleLogin(true, { username: 'username' }) this.props.appStore.toggleLogin(true, { username: 'username' });
// const { from } = this.props.location.state || { from: { pathname: '/Kinase' } } // const { from } = this.props.location.state || { from: { pathname: '/Kinase' } }
const { from } = this.props.location.state || { from: { pathname: '/login' } } const { from } = this.props.location.state || { from: { pathname: '/login' } };
this.props.history.push(from) this.props.history.push(from);
} }
componentWillUnmount () { componentWillUnmount() {
this.particle && this.particle.destory() this.particle && this.particle.destory();
notification.destroy() notification.destroy();
} }
//载入页面时的一些处理 //载入页面时的一些处理
initPage = () => { initPage = () => {
this.setState({ this.setState({
loading:true loading: true,
}) });
this.props.appStore.initUsers() this.props.appStore.initUsers();
this.loadImageAsync(url).then(url=>{ this.loadImageAsync(url)
this.setState({ .then((url) => {
loading:false, this.setState({
url loading: false,
url,
});
}) })
}).then(()=>{ .then(() => {
//为什么写在then里?id为backgroundBox的DOM元素是在loading为false时才有,而上面的setState可能是异步的,必须等到setState执行完成后才去获取dom //为什么写在then里?id为backgroundBox的DOM元素是在loading为false时才有,而上面的setState可能是异步的,必须等到setState执行完成后才去获取dom
this.particle = new BGParticle('backgroundBox') this.particle = new BGParticle('backgroundBox');
this.particle.init() this.particle.init();
// notification.open({ // notification.open({
// message:<ul><li>初始账号:admin</li><li>初始密码:admin</li></ul>, // message:<ul><li>初始账号:admin</li><li>初始密码:admin</li></ul>,
// duration:0, // duration:0,
// className:'login-notification' // className:'login-notification'
// }) // })
}) });
} };
//切换showbox //切换showbox
switchShowBox = (box) => { switchShowBox = (box) => {
this.setState({ this.setState({
showBox: box showBox: box,
}) });
} };
//登录的背景图太大,等载入完后再显示,实际上是图片预加载, //登录的背景图太大,等载入完后再显示,实际上是图片预加载,
loadImageAsync (url) { loadImageAsync(url) {
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
const image = new Image(); const image = new Image();
image.onload = function() { image.onload = function() {
resolve(url); resolve(url);
}; };
image.onerror = function() { image.onerror = function() {
console.log('图片载入错误') console.log('图片载入错误');
}; };
image.src = url; image.src = url;
}); });
} }
render () { render() {
const {showBox,loading} = this.state const { showBox, loading } = this.state;
return ( return (
<div className='index-div'> <div className='index-div'>
<LogoTitlte></LogoTitlte> <LogoTitlte />
<div id='login-page'> <div id='login-page'>
<div className='home-page-div'> <div className='home-page-div'>
<div>Yashen API 是一个集成了化学、生物学、计算化学、计算生物学和机器学习的数据驱动的药物发现平台,帮助药物化学家在药物智能发现领域大展身手。</div> <div>Yashen API 是一个集成了化学、生物学、计算化学、计算生物学和机器学习的数据驱动的药物发现平台,帮助药物化学家在药物智能发现领域大展身手。</div>
<div>我们的Kinase平台专注于挖掘包括药物和配体结构、蛋白质结构在内的Kinase数据,并开发计算工具来加速Kinase药物发现。</div> <div>我们的Kinase平台专注于挖掘包括药物和配体结构、蛋白质结构在内的Kinase数据,并开发计算工具来加速Kinase药物发现。</div>
<div> Yashen API is a data-driven drug discovery platform, which integrates chemistry, biology, computational chemistry, computational biology and machine learning to empower medicinal chemists to make intelligence drug discovery decisions.</div> <div>
<div>Our Kinase platform focuses on mining available Kinase knowledge including corresponding drugs and ligands structure and protein structures data, and developing computational tools to accelerate Kinase drug discovery.</div> {' '}
Yashen API is a data-driven drug discovery platform, which integrates chemistry, biology, computational chemistry, computational biology and machine learning to empower medicinal
chemists to make intelligence drug discovery decisions.
</div>
<div>
Our Kinase platform focuses on mining available Kinase knowledge including corresponding drugs and ligands structure and protein structures data, and developing computational tools to
accelerate Kinase drug discovery.
</div>
</div> </div>
{ {
<div>
<div> <div id='backgroundBox' style={styles.backgroundBox} />
<div id='backgroundBox' style={styles.backgroundBox}/> <div className='container'>
<div className='container'> <LoginForm className={showBox === 'login' ? 'box showBox' : 'box hiddenBox'} switchShowBox={this.switchShowBox} />
<LoginForm <RegisterForm className={showBox === 'register' ? 'box showBox' : 'box hiddenBox'} switchShowBox={this.switchShowBox} />
className={showBox === 'login' ? 'box showBox' : 'box hiddenBox'}
switchShowBox={this.switchShowBox}/>
<RegisterForm
className={showBox === 'register' ? 'box showBox' : 'box hiddenBox'}
switchShowBox={this.switchShowBox}/>
</div>
</div> </div>
</div>
} }
</div> </div>
</div> </div>
) );
} }
} }
...@@ -129,30 +130,30 @@ const styles = { ...@@ -129,30 +130,30 @@ const styles = {
height: '100vh', height: '100vh',
// backgroundImage: `url(${url})`, // backgroundImage: `url(${url})`,
backgroundSize: 'cover', backgroundSize: 'cover',
transition:'all .5s', transition: 'all .5s',
// backgroundColor: '#4FA1D9' // backgroundColor: '#4FA1D9'
}, },
focus: { focus: {
// transform: 'scale(0.7)', // transform: 'scale(0.7)',
width: '20px', width: '20px',
opacity: 1 opacity: 1,
}, },
loadingBox:{ loadingBox: {
position:'fixed', position: 'fixed',
top:'50%', top: '50%',
left:'50%', left: '50%',
transform:'translate(-50%,-50%)' transform: 'translate(-50%,-50%)',
}, },
loadingTitle:{ loadingTitle: {
position:'fixed', position: 'fixed',
top:'50%', top: '50%',
left:'50%', left: '50%',
marginLeft: -45, marginLeft: -45,
marginTop: -18, marginTop: -18,
color:'#000', color: '#000',
fontWeight:500, fontWeight: 500,
fontSize:24 fontSize: 24,
}, },
} };
export default Login export default Login;
import React, { Component } from "react"; import React, { Component } from "react";
import { Jsme } from "jsme-react"; import { Jsme } from "jsme-react";
import qs from "qs"; import qs from "qs";
import { request } from "../../utils/request"; import request from "../../utils/request";
import { Input, Button, Modal, Table, message, Pagination } from "antd"; import { Input, Button, Modal, Table, message, Pagination } from "antd";
import Molstar from "molstar-react"; import Molstar from "molstar-react";
import "./index.css"; import "./index.css";
......
...@@ -9,7 +9,7 @@ import { ...@@ -9,7 +9,7 @@ import {
Tag, Tag,
Typography, Typography,
} from "antd"; } from "antd";
import { request } from "../../../utils/request"; import request from "../../../utils/request";
import "./index.css"; import "./index.css";
import qs from "qs"; import qs from "qs";
const { Title } = Typography; const { Title } = Typography;
......
...@@ -18,7 +18,7 @@ import { ...@@ -18,7 +18,7 @@ import {
InputNumber, InputNumber,
Typography, Typography,
} from "antd"; } from "antd";
import { request } from "../../../utils/request"; import request from "../../../utils/request";
import Molstar from "molstar-react"; import Molstar from "molstar-react";
import { Jsme } from "jsme-react"; import { Jsme } from "jsme-react";
import qs from "qs"; import qs from "qs";
......
...@@ -18,7 +18,7 @@ import { ...@@ -18,7 +18,7 @@ import {
InputNumber, InputNumber,
Typography, Typography,
} from "antd"; } from "antd";
import { request } from "../../../utils/request"; import request from "../../../utils/request";
import Molstar from "molstar-react"; import Molstar from "molstar-react";
import { Jsme } from "jsme-react"; import { Jsme } from "jsme-react";
import qs from "qs"; import qs from "qs";
......
import React, { Component } from "react"; import React, { Component } from "react";
import { Jsme } from "jsme-react"; import { Jsme } from "jsme-react";
import { Card, Button, Pagination, Tabs, Spin, message, Collapse } from "antd"; import { Card, Button, Pagination, Tabs, Spin, message, Collapse } from "antd";
import { request } from "../../../utils/request"; import request from "../../../utils/request";
import qs from "qs"; import qs from "qs";
import "./index.css"; import "./index.css";
const { TabPane } = Tabs; const { TabPane } = Tabs;
......
...@@ -19,7 +19,7 @@ import { ...@@ -19,7 +19,7 @@ import {
Typography, Typography,
Pagination, Pagination,
} from "antd"; } from "antd";
import { request } from "../../../utils/request"; import request from "../../../utils/request";
import Molstar from "molstar-react"; import Molstar from "molstar-react";
import { Jsme } from "jsme-react"; import { Jsme } from "jsme-react";
import qs from "qs"; import qs from "qs";
......
...@@ -3,7 +3,7 @@ import { Form, Input, Button,Select ,Tabs,message,Radio,Checkbox,Row ,Col} from ...@@ -3,7 +3,7 @@ import { Form, Input, Button,Select ,Tabs,message,Radio,Checkbox,Row ,Col} from
import LogoTitlte from '../../components/LogoTitlte/index' import LogoTitlte from '../../components/LogoTitlte/index'
import { Jsme } from 'jsme-react' import { Jsme } from 'jsme-react'
import qs from 'qs' import qs from 'qs'
import { request } from '../../utils/request' import request from '../../utils/request'
import './style.css' import './style.css'
const { TabPane } = Tabs; const { TabPane } = Tabs;
const { Option } = Select; const { Option } = Select;
......
import axios from 'axios';
import { getQueryString } from './utils';
import { message } from 'antd';
//禁用F12功能
function disableF12() {
document.onkeydown = function() {
var e = window.event || arguments[0];
if (e.keyCode == 123) {
return false;
} else if (e.ctrlKey && e.shiftKey && e.keyCode == 73) {
return false;
}
};
//禁用鼠标右键
document.oncontextmenu = function() {
return false;
};
}
// disableF12();
const baseURL = 'http://52.83.169.190:8002/'; //线上正式环境
// const baseURL = 'http://69.235.144.91:8002/'; 测试环境
//对axios二次封装
// console.log('getQueryString', getQueryString('token'));
// console.log('localStorage', localStorage.getItem('token'));
const token = getQueryString('token') || localStorage.getItem('token');
const request = axios.create({
baseURL,
timeout: 15000,
headers: {
// 'Content-Type': 'application/json',
// 部分接口需要formdate格式的数据 'Content-Type': 'application/x-www-form-urlencoded' qs.stringify(data)
accessToken: token,
},
});
function checkToken(config) {
// message.error('校验token');
// alert(' 校验token111');
request
.get('http://69.235.144.91:8048/yszh-login/auth/checkToken')
.then((res) => {
console.log('--res', res);
if (res.data.code === 200) {
console.log('token 检验通过');
return config;
} else {
localStorage.removeItem('token');
// alert(' 失败');
// message.error('请重新登录');
console.log('token校验没通过 返回登录页');
// window.open('http://localhost:3000/#/login');
window.open('http://localhost:3000/#/login', '_self');
}
})
.catch((err) => {
localStorage.removeItem('token');
// alert(' 服务器报错');
console.log('token校验没通过 返回登录页');
window.open('http://localhost:3000/#/login', '_self');
console.log('err', err);
return false;
});
}
checkToken();
//拦截器
request.interceptors.request.use((config) => {
// alert('拦截器..');
console.log('token---', '拦截器方法校验token');
console.log(config);
if (getQueryString('token') || localStorage.getItem('token')) {
checkToken(config);
} else {
console.log('token为空....');
window.open('http://localhost:3000/#/login');
}
});
request.interceptors.response.use(
(res) => {
return res;
},
(err) => {
if (err && err.response) {
switch (err.response.status) {
case 400:
console.log('请求错误');
break;
case 401:
console.log('未授权访问');
break;
case 404:
console.log('页面未找到');
break;
default:
console.log('其他错误信息');
}
}
return err;
}
);
export default request;
import axios from 'axios'; import axios from 'axios';
axios.defaults.timeout = 10000; import { getQueryString } from './utils';
document.onkeydown = function() { import { message } from 'antd';
var e = window.event || arguments[0]; //禁用F12功能
if (e.keyCode == 123) { function disableF12() {
document.onkeydown = function() {
var e = window.event || arguments[0];
if (e.keyCode == 123) {
return false;
} else if (e.ctrlKey && e.shiftKey && e.keyCode == 73) {
return false;
}
};
//禁用鼠标右键
document.oncontextmenu = function() {
return false; return false;
} else if (e.ctrlKey && e.shiftKey && e.keyCode == 73) { };
return false; }
} // disableF12();
};
document.oncontextmenu = function() {
return false;
};
var baseURL = 'http://52.83.169.190:8002/'; // const baseURL = 'http://52.83.169.190:8002/'; //线上正式环境
const baseURL = 'http://69.235.144.91:8002/'; // 测试环境
export const request = axios.create({ //对axios二次封装
baseURL: baseURL, // console.log('getQueryString', getQueryString('token'));
// console.log('localStorage', localStorage.getItem('token'));
const token = getQueryString('token') || localStorage.getItem('token');
const request = axios.create({
baseURL,
timeout: 15000,
// headers: {
// 'Content-Type': 'application/json',
// accessToken: token,
// },
}); });
function checkToken(config) {
// message.error('校验token');
// alert('alert 校验token')
request
.get('http://69.235.144.91:8048/yszh-login/auth/checkToken')
.then((res) => {
console.log('checkToken--res', res);
if (res.data.code === 200) {
console.log('token 检验通过');
return config;
} else {
message.error('请重新登录');
console.log('token校验没通过 返回登录页');
window.open('http://localhost:3000/#/login');
// window.open('http://localhost:3000/#/login', '_self');
}
})
.catch((err) => {
console.log('token校验没通过 返回登录页');
window.open('http://localhost:3000/#/login', '_self');
console.log('err', err);
});
}
// checkToken();
//拦截器
// request.interceptors.request.use((config) => {
// console.log('token---', '拦截器方法校验token');
// if (!!token) {
// checkToken(config);
// return config;
// } else {
// console.log('token为空....');
// window.open('http://localhost:3000/#/login', '_self');
// }
// return config;
// });
// request.interceptors.response.use(
// (res) => {
// return res;
// },
// (err) => {
// if (err && err.response) {
// switch (err.response.status) {
// case 400:
// console.log('请求错误');
// break;
// case 401:
// console.log('未授权访问');
// break;
// case 404:
// console.log('页面未找到');
// break;
// default:
// console.log('其他错误信息');
// }
// }
// return err;
// }
// );
export default request;
...@@ -63,4 +63,18 @@ export function preloadingImages(arr) { ...@@ -63,4 +63,18 @@ export function preloadingImages(arr) {
const img = new Image() const img = new Image()
img.src = item img.src = item
}) })
}
/**
* 获取URL中指定的参数
*/
export function getQueryString(name) {
let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
let r = window.location.hash.split('?')[1] && window.location.hash.split('?')[1].match(reg); //获取url中"?"符后的字符串并正则匹配
let context = '';
if (r != null) context = decodeURIComponent(r[2]);
reg = null;
r = null;
return context == null || context == '' || context == 'undefined' ? '' : context;
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment