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
77dccf9e
Commit
77dccf9e
authored
Jun 09, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ff417675
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
18 deletions
+39
-18
resources/js/Pages/Home/components/CurrentConsignment/index.tsx
+3
-9
resources/js/Pages/Spot/components/CurrentConsignment/index.tsx
+3
-8
resources/js/components/Input/index.tsx
+0
-1
resources/js/service/TradeService.ts
+33
-0
No files found.
resources/js/Pages/Home/components/CurrentConsignment/index.tsx
View file @
77dccf9e
...
...
@@ -9,9 +9,9 @@ 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'
;
import
{
show_message
}
from
"@/js/utils/tdesign"
;
import
CustomCheckBox
from
'@/js/components/CheckBox'
;
import
{
isShow
}
from
'@/js/utils/dom'
;
import
{
getSelectedIds
}
from
'@/js/service/TradeService'
;
// 当前委托
class
CurrentConsignment
extends
Component
<
any
,
any
>
{
...
...
@@ -201,14 +201,8 @@ class CurrentConsignment extends Component<any, any> {
}
else
{
// 获取选中的行--is_checked
const
list
=
this
.
state
.
list
;
const
ids
:
any
[]
=
[];
list
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
is_checked
)
{
ids
.
push
(
item
.
id
);
}
})
if
(
!
ids
.
length
)
{
show_message
(
'未选择行'
);
const
ids
=
getSelectedIds
(
list
);
if
(
!
ids
)
{
return
;
}
params
=
{
...
...
resources/js/Pages/Spot/components/CurrentConsignment/index.tsx
View file @
77dccf9e
...
...
@@ -12,6 +12,7 @@ import {show_message} from "@/js/utils/tdesign";
import
CustomCheckBox
from
'@/js/components/CheckBox'
;
import
{
SpotCurrentEntrustment
}
from
'@/js/utils/api/spot'
;
import
{
isShow
}
from
'@/js/utils/dom'
;
import
{
getSelectedIds
}
from
'@/js/service/TradeService'
;
// 当前委托
class
CurrentConsignment
extends
Component
<
any
,
any
>
{
...
...
@@ -201,14 +202,8 @@ class CurrentConsignment extends Component<any, any> {
}
else
{
// 获取选中的行--is_checked
const
list
=
this
.
state
.
list
;
const
ids
:
any
[]
=
[];
list
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
is_checked
)
{
ids
.
push
(
item
.
id
);
}
})
if
(
!
ids
.
length
)
{
show_message
(
'未选择行'
);
const
ids
=
getSelectedIds
(
list
);
if
(
!
ids
)
{
return
;
}
params
=
{
...
...
resources/js/components/Input/index.tsx
View file @
77dccf9e
...
...
@@ -30,7 +30,6 @@ export default function (props) {
inputChange
(
value
);
}
}
onClear=
{
()
=>
{
console
.
log
(
'onClear'
);
}
}
/>
);
...
...
resources/js/service/TradeService.ts
0 → 100644
View file @
77dccf9e
import
{
show_message
}
from
"../utils/tdesign"
;
/**
* 撤销(返回选中项的id列表)
*/
export
const
getSelectedIds
=
(
list
:
any
[],
condition
:
any
=
{
status
:
'NEW'
},
key
:
string
=
'is_checked'
)
=>
{
const
ids
:
any
[]
=
[];
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
const
item
=
list
[
i
];
if
(
item
[
key
])
{
// 循环条件列表
const
keys
=
Object
.
keys
(
condition
);
for
(
let
j
=
0
;
j
<
keys
.
length
;
j
++
)
{
const
conditionKey
=
keys
[
j
];
if
(
item
[
conditionKey
])
{
// 存在这个字段,值是否相等
if
(
item
[
conditionKey
]
!==
condition
[
conditionKey
])
{
show_message
(
'所选撤销行不满足条件'
,
'error'
);
return
;
}
else
{
// 等于
ids
.
push
(
item
.
id
);
}
}
}
}
}
if
(
!
ids
.
length
)
{
show_message
(
'未选择行'
);
return
;
}
return
ids
;
}
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