Commit 35506fd4 by wangshufen

feature:计算平台docking上次文件和Pharmacophore添加database修改

parent f61ca308
......@@ -144,7 +144,8 @@
height: 150px;
}
.Docking-center .pharmacophore-title{
width: 50%;
/* width: 50%; */
margin-right: 15px;
}
.Docking-center .pharmacophore-title2{
width: 25%;
......
......@@ -47,9 +47,9 @@ export default class StructureSearch extends Component {
ligand_smi: '',
receptor_pdb: '',
grid_center: 'notinputcenter',
gridx: null,
gridy: null,
gridz: null,
gridx: '',
gridy: '',
gridz: '',
handlespeed: '',
},
pharmacophoreData: {
......@@ -57,6 +57,7 @@ export default class StructureSearch extends Component {
ligand_file: '',
ligand_smi: '',
select_nums: null,
database_select: 'PDB',
},
ListData: [],
taskManagerData: {
......@@ -95,6 +96,8 @@ export default class StructureSearch extends Component {
handlespeed: '',
},
fileList: [],
fileListReceptor: [],
fileListLigand: [],
uploading: false,
visible: false,
total_num: 0,
......@@ -162,6 +165,8 @@ export default class StructureSearch extends Component {
};
getDocking = () => {
let formData = new FormData();
// const { fileList } = this.state;
// console.log('fileList', fileList);
let docking = this.state.docking;
for (const key in docking) {
formData.append(key, docking[key]);
......@@ -446,6 +451,15 @@ export default class StructureSearch extends Component {
return;
}
};
onChangeDatabase = (e) => {
let { value } = e.target;
let pharmacophoreData = this.state.pharmacophoreData;
pharmacophoreData.database_select = value;
this.setState({
pharmacophoreData,
});
};
onChange = (e) => {
let { value } = e.target;
console.log(value);
......@@ -798,7 +812,9 @@ export default class StructureSearch extends Component {
getDownload = (e) => {};
render() {
const { list, total_num, ListData, uploading, fileList, fileListReceptor, fileListLigand, visible, ListData2 } = this.state;
const props = {
name: 'file',
beforeUpload: (file) => {
var fileName = file.name;
var suffixName = fileName.substring(fileName.lastIndexOf('.'));
......@@ -833,11 +849,22 @@ export default class StructureSearch extends Component {
amd: amd,
});
this.setState(
(state) => ({
fileListLigand: [...state.fileListLigand, file],
}),
() => {
console.log('file111===', file);
console.log('fileListLigand===', this.state.fileListLigand);
}
);
return false;
},
fileList,
fileListLigand,
};
const props2 = {
name: 'file',
beforeUpload: (file) => {
var fileName = file.name;
var suffixName = fileName.substring(fileName.lastIndexOf('.'));
......@@ -851,9 +878,19 @@ export default class StructureSearch extends Component {
docking: docking,
});
this.setState(
(state) => ({
fileListReceptor: [...state.fileListReceptor, file],
}),
() => {
console.log('file===', file);
console.log('fileListReceptor===', this.state.fileListReceptor);
}
);
return false;
},
fileList,
fileListReceptor,
};
const props3 = {
beforeUpload: (file) => {
......@@ -874,7 +911,6 @@ export default class StructureSearch extends Component {
fileList,
};
const { list, total_num, ListData, uploading, fileList, visible, ListData2 } = this.state;
const formItemLayout2 = {
labelCol: {
xs: { span: 24 },
......@@ -895,9 +931,9 @@ export default class StructureSearch extends Component {
};
const radioStyle = {
display: 'block',
height: '30px',
lineHeight: '30px',
marginBottom: '20px',
height: 'auto',
// lineHeight: '30px',
// marginBottom: '20px',
width: '700px',
};
const columns = [
......@@ -1146,9 +1182,11 @@ export default class StructureSearch extends Component {
{list[2].state && (
<div className='pharmacophore-div'>
<div className='pharmacophore-top'>
<div className='pharmacophore-title'>Pharmacophore Database from PDB Rharmacophore:</div>
<Radio.Group onChange={this.onChange} value={1}>
<Radio value={1}>PDB</Radio>
<div className='pharmacophore-title'>Databases:</div>
<Radio.Group onChange={this.onChangeDatabase} value={this.state.pharmacophoreData.database_select}>
<Radio value={'PDB'}>PDB</Radio>
<Radio value={'GPCR'}>GPCR</Radio>
<Radio value={'KINASE'}>KINASE</Radio>
</Radio.Group>
</div>
<div className='pharmacophore-top'>
......
......@@ -20,11 +20,10 @@ function disableF12() {
// disableF12();
//对axios二次封装
// console.log('getQueryString', getQueryString('token'));
// console.log('localStorage', localStorage.getItem('token'));
const token = getQueryString('token') || localStorage.getItem('token');
const request = axios.create({
baseURL: 'http://tcal.atelligence-ai.com/',
baseURL: 'http://69.235.144.91:8087/',
// baseURL: 'http://tcal.atelligence-ai.com/',
timeout: 15000,
headers: {
// 'Content-Type': 'application/json',
......@@ -32,46 +31,48 @@ const request = axios.create({
},
});
function checkToken(config) {
request
.get('http://69.235.144.91:8048/yszh-login/auth/checkToken')
function checkFetchToken() {
fetch('http://69.235.144.91:8048/yszh-login/auth/checkToken', {
method: 'GET',
headers: {
accessToken: token,
},
})
.then((res) => res.json())
.then((res) => {
console.log(res);
if (res.data.code === 200) {
console.log('token 检验通过');
return config;
console.log('fetch--res', res);
if (res.code === 200) {
//校验通过,存储token
token && localStorage.setItem('token', token);
} else {
// message.error('请重新登录');
console.log('token校验没通过 返回登录页');
alert('token校验失败,返回登录页');
// window.open('http://localhost:3000/#/login', '_self');
window.open('http://69.235.144.91:3048/#/login', '_self');
window.open('http://ysplatform.atelligence-ai.com/#/login', '_self');
}
})
.catch((err) => {
console.log('token校验报错 返回登录页');
// message.error('请重新登录');
window.open('http://69.235.144.91:3048/#/login', '_self');
.catch(function(err) {
console.log('err', err);
window.open('http://ysplatform.atelligence-ai.com/#/login', '_self');
});
}
checkToken();
checkFetchToken();
//拦截器
request.interceptors.request.use((config) => {
// alert('拦截器..');
console.log('token---', '拦截器方法校验token');
if (!!token) {
checkToken(config);
console.log(config);
if (localStorage.getItem('token')) {
config.headers['accessToken'] = localStorage.getItem('token');
return config;
} else {
console.log('token为空....');
window.open('http://69.235.144.91:3048/#/login', '_self');
window.open('http://ysplatform.atelligence-ai.com/#/login', '_self');
}
// return config;
});
request.interceptors.response.use(
(res) => {
return res.data;
return res;
},
(err) => {
if (err && err.response) {
......
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