Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
elegantDeepKinase
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangshufen
elegantDeepKinase
Commits
da33d10f
Commit
da33d10f
authored
Feb 22, 2023
by
wangshufen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature:搜索优化功能修改
parent
3a8b772b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
78 additions
and
46 deletions
+78
-46
.vscode/settings.json
+0
-4
README.md
+4
-0
src/routes/Kinase/SearchDetails/index.js
+0
-0
src/routes/Kinase/TargetDetails/index.js
+0
-0
src/routes/Kinase/index.js
+28
-10
src/store/kinaseSearch.js
+20
-7
src/utils/request.js
+26
-25
No files found.
.vscode/settings.json
deleted
100644 → 0
View file @
3a8b772b
{
"liveServer.settings.port"
:
5501
}
\ No newline at end of file
README.md
View file @
da33d10f
项目启动:
1.
yarn
2.
yarn start
src/routes/Kinase/SearchDetails/index.js
View file @
da33d10f
This diff is collapsed.
Click to expand it.
src/routes/Kinase/TargetDetails/index.js
View file @
da33d10f
This diff is collapsed.
Click to expand it.
src/routes/Kinase/index.js
View file @
da33d10f
...
@@ -76,7 +76,7 @@ class Home extends React.Component {
...
@@ -76,7 +76,7 @@ class Home extends React.Component {
compoundList
:
[
'DrugName'
,
'Smiles'
],
compoundList
:
[
'DrugName'
,
'Smiles'
],
targetList
:
[
'TargetName'
,
'UniprotId'
],
targetList
:
[
'TargetName'
,
'UniprotId'
],
optionsList
:
[{
label
:
'查询drug相关靶点'
,
value
:
1
},
{
label
:
'查询ligand相关靶点'
,
value
:
2
,
disabled
:
false
},
{
label
:
'是否有PDB结构'
,
value
:
3
}],
optionsList
:
[{
label
:
'查询drug相关靶点'
,
value
:
1
},
{
label
:
'查询ligand相关靶点'
,
value
:
2
,
disabled
:
false
},
{
label
:
'是否有PDB结构'
,
value
:
3
}],
activeKey
:
this
.
props
.
kinaseSearch
.
activeTabKey
||
'Drug'
,
activeK
inaseTabK
ey
:
this
.
props
.
kinaseSearch
.
activeTabKey
||
'Drug'
,
};
};
// Mutation
// Mutation
CheckChange
=
(
e
)
=>
{
CheckChange
=
(
e
)
=>
{
...
@@ -154,8 +154,10 @@ class Home extends React.Component {
...
@@ -154,8 +154,10 @@ class Home extends React.Component {
IndicationSearchData
.
indication
=
value
;
IndicationSearchData
.
indication
=
value
;
this
.
setState
(()
=>
({
IndicationSearchData
:
IndicationSearchData
}));
this
.
setState
(()
=>
({
IndicationSearchData
:
IndicationSearchData
}));
};
};
//Indication Tab搜索
getIndicationList
=
()
=>
{
getIndicationList
=
()
=>
{
let
data
=
this
.
state
.
IndicationSearchData
;
let
data
=
this
.
state
.
IndicationSearchData
;
this
.
props
.
kinaseSearch
.
addIndicationSearchParams
(
data
);
if
(
data
.
indication
==
''
)
{
if
(
data
.
indication
==
''
)
{
return
message
.
warning
(
'请输入查询条件!'
);
return
message
.
warning
(
'请输入查询条件!'
);
}
}
...
@@ -189,8 +191,10 @@ class Home extends React.Component {
...
@@ -189,8 +191,10 @@ class Home extends React.Component {
this
.
setState
(()
=>
({
ligandSearchData
:
ligandSearchData
}));
this
.
setState
(()
=>
({
ligandSearchData
:
ligandSearchData
}));
// this.setState(()=>({data:e }))
// this.setState(()=>({data:e }))
};
};
//Ligand Tab搜索
getLigendList
=
()
=>
{
getLigendList
=
()
=>
{
let
data
=
this
.
state
.
ligandSearchData
;
let
data
=
this
.
state
.
ligandSearchData
;
this
.
props
.
kinaseSearch
.
addLigandSearchParams
(
data
);
if
(
data
.
ligand_data
==
''
)
{
if
(
data
.
ligand_data
==
''
)
{
return
message
.
warning
(
'请输入查询条件!'
);
return
message
.
warning
(
'请输入查询条件!'
);
}
}
...
@@ -287,8 +291,13 @@ class Home extends React.Component {
...
@@ -287,8 +291,13 @@ class Home extends React.Component {
TargetSearchData
.
drug_name
=
value
;
TargetSearchData
.
drug_name
=
value
;
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}));
this
.
setState
(()
=>
({
TargetSearchData
:
TargetSearchData
}));
};
};
//Target Tab搜索
getTargetList
=
()
=>
{
getTargetList
=
()
=>
{
let
data
=
this
.
state
.
TargetSearchData
;
let
data
=
this
.
state
.
TargetSearchData
;
console
.
log
(
'data:------ '
,
data
);
this
.
props
.
kinaseSearch
.
addTargetSearchParams
(
data
);
if
(
data
.
target_class
==
''
&&
data
.
target_data
==
''
)
{
if
(
data
.
target_class
==
''
&&
data
.
target_data
==
''
)
{
return
message
.
warning
(
'请输入查询条件!'
);
return
message
.
warning
(
'请输入查询条件!'
);
}
}
...
@@ -354,11 +363,19 @@ class Home extends React.Component {
...
@@ -354,11 +363,19 @@ class Home extends React.Component {
};
};
componentDidMount
()
{
componentDidMount
()
{
console
.
log
(
'111'
,
this
.
props
.
kinaseSearch
.
searchParams
);
console
.
log
(
'111'
,
this
.
props
.
kinaseSearch
.
ligandSearchParams
);
if
(
this
.
props
.
kinaseSearch
.
searchParams
.
drugs_data
)
{
if
(
this
.
props
.
kinaseSearch
.
drugSearchParams
.
drugs_data
)
{
this
.
state
.
searchData
=
this
.
props
.
kinaseSearch
.
searchParams
;
this
.
state
.
searchData
=
this
.
props
.
kinaseSearch
.
drugSearchParams
;
}
if
(
this
.
props
.
kinaseSearch
.
targetSearchParams
.
target_data
)
{
this
.
state
.
TargetSearchData
=
this
.
props
.
kinaseSearch
.
targetSearchParams
;
}
if
(
this
.
props
.
kinaseSearch
.
ligandSearchParams
.
ligand_data
)
{
this
.
state
.
ligandSearchData
=
this
.
props
.
kinaseSearch
.
ligandSearchParams
;
}
if
(
this
.
props
.
kinaseSearch
.
indicationSearchParams
.
indication
)
{
this
.
state
.
IndicationSearchData
=
this
.
props
.
kinaseSearch
.
indicationSearchParams
;
}
}
// console.log('222',qs.parse(this.props.location.search.slice(1)),)
// this.getList()
// this.getList()
// this.getSelectList()
// this.getSelectList()
this
.
getTargetSelectList
();
this
.
getTargetSelectList
();
...
@@ -474,9 +491,10 @@ class Home extends React.Component {
...
@@ -474,9 +491,10 @@ class Home extends React.Component {
console
.
error
(
err
);
console
.
error
(
err
);
});
});
};
};
//Drug Tab搜索
getDrugsList
=
()
=>
{
getDrugsList
=
()
=>
{
let
data
=
this
.
state
.
searchData
;
let
data
=
this
.
state
.
searchData
;
this
.
props
.
kinaseSearch
.
addSearchParams
(
data
);
this
.
props
.
kinaseSearch
.
add
Drug
SearchParams
(
data
);
if
(
data
.
drugs_data
==
''
)
{
if
(
data
.
drugs_data
==
''
)
{
return
message
.
warning
(
'请输入查询条件!'
);
return
message
.
warning
(
'请输入查询条件!'
);
}
}
...
@@ -513,8 +531,8 @@ class Home extends React.Component {
...
@@ -513,8 +531,8 @@ class Home extends React.Component {
searchData
.
name
=
e
;
searchData
.
name
=
e
;
this
.
setState
(()
=>
({
searchData
:
searchData
}));
this
.
setState
(()
=>
({
searchData
:
searchData
}));
console
.
log
(
this
.
state
.
searchData
);
console
.
log
(
this
.
state
.
searchData
);
this
.
setState
({
activeKey
:
e
});
this
.
setState
({
activeK
inaseTabK
ey
:
e
});
this
.
props
.
kinaseSearch
.
setActiveKey
(
e
);
this
.
props
.
kinaseSearch
.
setActiveK
inaseTabK
ey
(
e
);
};
};
getJsme
=
()
=>
{
getJsme
=
()
=>
{
console
.
log
(
1
);
console
.
log
(
1
);
...
@@ -538,7 +556,7 @@ class Home extends React.Component {
...
@@ -538,7 +556,7 @@ class Home extends React.Component {
<
div
className
=
'home'
>
<
div
className
=
'home'
>
<
div
className
=
'home-div'
>
<
div
className
=
'home-div'
>
{
/* <LogoTitlte></LogoTitlte> */
}
{
/* <LogoTitlte></LogoTitlte> */
}
<
Tabs
onChange
=
{
this
.
callback
}
activeKey
=
{
this
.
state
.
activeKey
}
type
=
'card'
>
<
Tabs
onChange
=
{
this
.
callback
}
activeKey
=
{
this
.
state
.
activeK
inaseTabK
ey
}
type
=
'card'
>
<
TabPane
tab
=
'Drug'
key
=
'Drug'
>
<
TabPane
tab
=
'Drug'
key
=
'Drug'
>
<
div
className
=
'top-div'
>
<
div
className
=
'top-div'
>
<
div
>
<
div
>
...
@@ -648,7 +666,7 @@ class Home extends React.Component {
...
@@ -648,7 +666,7 @@ class Home extends React.Component {
<
div
>
<
div
>
<
Form
layout
=
'horizontal'
>
<
Form
layout
=
'horizontal'
>
<
Form
.
Item
label
=
'输入Chemblid或Smiles'
{...
formItemLayout
}
>
<
Form
.
Item
label
=
'输入Chemblid或Smiles'
{...
formItemLayout
}
>
<
Input
placeholder
=
'请输入'
style
=
{{
width
:
250
}}
size
=
'large'
onChange
=
{
this
.
getLigendValue
}
value
=
{
this
.
state
.
ligandSearchData
.
ligand_data
}
/
>
<
Input
placeholder
=
'请输入
3
'
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
type
=
'primary'
style
=
{{
marginRight
:
'50px'
}}
onClick
=
{
this
.
getDraw
}
>
<
Button
type
=
'primary'
style
=
{{
marginRight
:
'50px'
}}
onClick
=
{
this
.
getDraw
}
>
...
...
src/store/kinaseSearch.js
View file @
da33d10f
import
{
observable
,
action
}
from
'mobx'
;
import
{
observable
,
action
}
from
'mobx'
;
class
KianseSearch
{
class
KianseSearch
{
@
observable
searchParams
=
{};
@
observable
drugSearchParams
=
{};
//kinase drug 搜索参数
@
observable
activeKey
=
''
;
@
observable
targetSearchParams
=
{};
//kinase target 搜索参数
@
action
addSearchParams
(
data
)
{
@
observable
ligandSearchParams
=
{};
//kinase ligand 搜索参数
console
.
log
(
'data'
,
data
);
@
observable
indicationSearchParams
=
{};
//kinase indication 搜索参数
this
.
searchParams
=
data
;
@
observable
activeKinaseTabKey
=
''
;
//记录选中的tab
@
action
addDrugSearchParams
(
data
)
{
this
.
drugSearchParams
=
data
;
}
@
action
addTargetSearchParams
(
data
)
{
this
.
targetSearchParams
=
data
;
}
@
action
addLigandSearchParams
(
data
)
{
this
.
ligandSearchParams
=
data
;
}
}
@
action
setActiveKey
=
(
key
)
=>
{
@
action
addIndicationSearchParams
(
data
)
{
console
.
log
(
'key----'
,
key
)
this
.
indicationSearchParams
=
data
;
}
@
action
setActiveKinaseTabKey
=
(
key
)
=>
{
console
.
log
(
'key----'
,
key
);
this
.
activeTabKey
=
key
;
this
.
activeTabKey
=
key
;
};
};
}
}
...
...
src/utils/request.js
View file @
da33d10f
...
@@ -17,10 +17,26 @@ function disableF12() {
...
@@ -17,10 +17,26 @@ function disableF12() {
}
}
// disableF12();
// disableF12();
const
baseURL
=
'http://52.83.169.190:8002/'
;
//线上正式环境
// const baseURL = 'http://69.235.144.91:8002/'; 测试环境
const
request
=
axios
.
create
({
baseURL
,
timeout
:
15000
,
headers
:
{
// 'Content-Type': 'application/json',
// 部分接口需要formdate格式的数据 'Content-Type': 'application/x-www-form-urlencoded' qs.stringify(data)
accessToken
:
getQueryString
(
'token'
)
||
localStorage
.
getItem
(
'token'
),
},
});
// 封装同步Ajax请求
// 封装同步Ajax请求
function
checkAjaxToken
()
{
function
checkAjaxToken
()
{
const
token
=
getQueryString
(
'token'
)
||
localStorage
.
getItem
(
'token'
);
const
token
=
getQueryString
(
'token'
)
||
localStorage
.
getItem
(
'token'
);
let
xhr
=
new
XMLHttpRequest
();
let
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'GET'
,
'http://69.235.144.91:8048/yszh-login/auth/checkToken'
,
false
);
xhr
.
open
(
'GET'
,
'http://69.235.144.91:8048/yszh-login/auth/checkToken'
,
false
);
xhr
.
setRequestHeader
(
'accessToken'
,
token
);
xhr
.
setRequestHeader
(
'accessToken'
,
token
);
xhr
.
send
(
null
);
xhr
.
send
(
null
);
...
@@ -35,33 +51,18 @@ function checkAjaxToken() {
...
@@ -35,33 +51,18 @@ function checkAjaxToken() {
return
false
;
return
false
;
}
}
}
}
checkAjaxToken
();
// checkAjaxToken();
const
token
=
getQueryString
(
'token'
)
||
localStorage
.
getItem
(
'token'
);
const
baseURL
=
'http://52.83.169.190:8002/'
;
//线上正式环境
// const baseURL = 'http://69.235.144.91:8002/'; 测试环境
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
,
},
});
//拦截器
//拦截器
request
.
interceptors
.
request
.
use
((
config
)
=>
{
//
request.interceptors.request.use((config) => {
console
.
log
(
'config'
,
config
);
//
console.log('config',config);
if
(
checkAjaxToken
())
{
//
if (checkAjaxToken()) {
return
config
;
//
return config;
}
else
{
//
} else {
console
.
log
(
'token为空.
...'
);
// console.log('token校验失败
...');
window
.
open
(
'http://ysplatform.atelligence-ai.com/#/login'
,
'_self'
);
//
window.open('http://ysplatform.atelligence-ai.com/#/login', '_self');
}
//
}
});
//
});
request
.
interceptors
.
response
.
use
(
request
.
interceptors
.
response
.
use
(
(
res
)
=>
{
(
res
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment