Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
admin-trade
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
haojie
admin-trade
Commits
829951c3
Commit
829951c3
authored
Jun 07, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
10a3379a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
11 deletions
+23
-11
resources/js/Pages/Home/components/CurrentConsignment/index.tsx
+2
-2
resources/js/Pages/Home/components/HistoryTransaction/index.tsx
+2
-3
resources/js/Pages/Home/components/HoldingPosition/index.tsx
+3
-3
resources/js/utils/local.ts
+7
-3
resources/js/utils/trade.ts
+9
-0
No files found.
resources/js/Pages/Home/components/CurrentConsignment/index.tsx
View file @
829951c3
...
...
@@ -5,7 +5,7 @@ import {isMobile} from '@/js/utils/tool';
import
Pagination
from
'@/js/components/Pagination'
;
import
CustomButton
from
'@/js/components/Button'
;
import
{
ContractCurrentEntrustment
}
from
'@/js/utils/api/contract'
;
import
{
getDirectionColor
}
from
'@/js/utils/trade'
;
import
{
getDirectionColor
,
getOpenText
}
from
'@/js/utils/trade'
;
import
{
getLocalContractHelper
,
getUserName
}
from
'@/js/utils/local'
;
import
{
open_loading
}
from
'@/js/utils/tdesign'
;
import
{
ContractRevoke
}
from
'@/js/utils/api/multipleUse'
;
...
...
@@ -113,7 +113,7 @@ class CurrentConsignment extends Component<any, any> {
<
div
className=
{
[
'table-direction'
].
join
(
' '
)
}
style=
{
{
color
:
getDirectionColor
(
item
.
position_side
)
}
}
>
{
getLocalContractHelper
(
'
position_side'
,
item
.
position_side
)
}
{
getLocalContractHelper
(
'
order_type'
,
item
.
type
)
}
/
{
getOpenText
(
item
.
position_side
)
}
</
div
>
<
CustomButton
onClick=
{
this
.
tableContractRevoke
.
bind
(
this
,
item
)
}
>
撤销
</
CustomButton
>
</
div
>
...
...
resources/js/Pages/Home/components/HistoryTransaction/index.tsx
View file @
829951c3
...
...
@@ -4,7 +4,7 @@ import CustomTable from '@/js/components/Table/index';
import
{
isMobile
}
from
'@/js/utils/tool'
;
import
Pagination
from
'@/js/components/Pagination'
;
import
{
ContractHistoryTransaction
}
from
'@/js/utils/api/contract'
;
import
{
getDirectionColor
,
getSuccessColor
,
getSuccessText
}
from
'@/js/utils/trade'
;
import
{
getDirectionColor
,
getSuccessColor
,
getSuccessText
,
getOpenText
}
from
'@/js/utils/trade'
;
import
{
getLocalContractHelper
,
getUserName
}
from
'@/js/utils/local'
;
import
{
open_loading
}
from
'@/js/utils/tdesign'
;
...
...
@@ -118,7 +118,7 @@ class HistoryTransaction extends Component<any, any> {
<
div
className=
{
[
'table-direction'
].
join
(
' '
)
}
style=
{
{
color
:
getDirectionColor
(
item
.
position_side
)
}
}
>
{
getLocalContractHelper
(
'
position_side'
,
item
.
position_side
)
}
{
getLocalContractHelper
(
'
order_type'
,
item
.
order_type
)
}
/
{
getOpenText
(
item
.
position_side
)
}
</
div
>
<
div
className=
{
'table-time'
}
>
<
span
>
更新时间
</
span
>
...
...
@@ -231,7 +231,6 @@ class HistoryTransaction extends Component<any, any> {
}
const
res
:
any
=
await
ContractHistoryTransaction
(
params
);
if
(
res
.
code
==
0
)
{
console
.
log
(
res
.
data
.
data
[
0
])
this
.
setState
({
list
:
res
.
data
.
data
,
total
:
res
.
data
.
total
,
...
...
resources/js/Pages/Home/components/HoldingPosition/index.tsx
View file @
829951c3
...
...
@@ -5,8 +5,8 @@ import {isMobile, isEqual} from '@/js/utils/tool';
import
CustomButton
from
'@/js/components/Button'
;
import
Pagination
from
'@/js/components/Pagination'
;
import
{
ContractHoldingPosition
}
from
'@/js/utils/api/contract'
;
import
{
get
LocalContractHelper
,
get
UserName
}
from
'@/js/utils/local'
;
import
{
is
Rise
,
isPlus
,
getDirectionColor
}
from
'@/js/utils/trade'
;
import
{
getUserName
}
from
'@/js/utils/local'
;
import
{
is
Plus
,
getDirectionColor
,
getOpenText
}
from
'@/js/utils/trade'
;
import
{
ClosePosition
}
from
'@/js/utils/api/multipleUse'
;
import
{
open_loading
}
from
'@/js/utils/tdesign'
;
...
...
@@ -110,7 +110,7 @@ class HoldingPosition extends Component<any, any> {
<
div
className=
{
'table-direction'
}
style=
{
{
color
:
getDirectionColor
(
item
.
position_side
)
}
}
>
{
get
LocalContractHelper
(
'position_side'
,
item
.
position_side
)
}
{
get
OpenText
(
item
.
position_side
)
}
</
div
>
<
CustomButton
onClick=
{
ClosePosition
.
bind
(
this
,
{
ids
:
[
item
.
id
]
...
...
resources/js/utils/local.ts
View file @
829951c3
...
...
@@ -103,11 +103,11 @@ export const getAdminUserList = async () => {
// 请求合约辅助列表
export
const
getContractHelpList
=
async
(
skip
:
boolean
=
false
)
=>
{
// 清空
//
window.localStorage.setItem(localContractHelpKey, '')
window
.
localStorage
.
setItem
(
localContractHelpKey
,
''
)
if
(
isLocalUserExpire
(
localContractHelpKey
,
24
*
60
*
60
*
1000
)
||
skip
)
{
try
{
const
res
:
any
=
await
ContractAssist
();
//
console.log(res.data)
console
.
log
(
res
.
data
)
if
(
res
.
code
==
0
)
{
// 存本地
setLocalData
(
localContractHelpKey
,
res
.
data
);
...
...
@@ -148,7 +148,11 @@ export const getLocalContractHelper = (key: string, value: string) => {
const
list
=
getLocalContractHelperList
(
key
);
if
(
list
.
length
)
{
const
obj
=
list
.
find
((
item
:
any
)
=>
item
.
value
==
value
);
return
obj
?
obj
.
label
:
'error'
;
if
(
obj
)
{
return
obj
.
label
;
}
else
{
return
'error'
;
}
}
}
...
...
resources/js/utils/trade.ts
View file @
829951c3
...
...
@@ -74,3 +74,12 @@ export const getStatusColor = (status: number) => {
return
'#D95E71'
}
}
// 开多开空文字
export
const
getOpenText
=
(
direction
:
string
)
=>
{
if
(
direction
==
'LONG'
)
{
return
'开多'
}
else
{
return
'开空'
}
}
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