Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
love_飞影
Neos
Commits
5a6f4933
Commit
5a6f4933
authored
May 07, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix small
parent
0776484e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
src/service/duel/selectUnselectCard.ts
src/service/duel/selectUnselectCard.ts
+1
-0
src/stores/messageStore/types.ts
src/stores/messageStore/types.ts
+2
-0
src/ui/Duel/Message/CheckCardModal.tsx
src/ui/Duel/Message/CheckCardModal.tsx
+10
-6
No files found.
src/service/duel/selectUnselectCard.ts
View file @
5a6f4933
...
...
@@ -16,6 +16,7 @@ export default ({
messageStore
.
selectCardActions
.
cancelAble
=
cancelable
;
messageStore
.
selectCardActions
.
min
=
min
;
messageStore
.
selectCardActions
.
max
=
max
;
messageStore
.
selectCardActions
.
single
=
true
;
for
(
const
option
of
selectableCards
)
{
fetchCheckCardMeta
(
option
);
...
...
src/stores/messageStore/types.ts
View file @
5a6f4933
...
...
@@ -36,6 +36,8 @@ export interface ModalState {
isChain
?:
boolean
;
min
?:
number
;
max
?:
number
;
// 是否只能选择单个
single
?:
boolean
;
cancelAble
:
boolean
;
finishAble
:
boolean
;
// 上级/同调/超量/链接召唤的总cost
...
...
src/ui/Duel/Message/CheckCardModal.tsx
View file @
5a6f4933
import
{
ThunderboltOutlined
}
from
"
@ant-design/icons
"
;
import
{
CheckCard
,
CheckCardProps
}
from
"
@ant-design/pro-components
"
;
import
{
Button
,
Col
,
Popover
,
Row
}
from
"
antd
"
;
import
{
Button
,
C
ard
,
C
ol
,
Popover
,
Row
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
...
...
@@ -26,6 +26,7 @@ export const CheckCardModal = () => {
const
isChain
=
snap
.
isChain
;
const
min
=
snap
.
min
??
0
;
const
max
=
snap
.
max
??
10
;
const
single
=
snap
.
single
??
false
;
const
selecteds
=
snap
.
selecteds
;
const
selectables
=
snap
.
selectables
;
const
mustSelects
=
snap
.
mustSelects
;
...
...
@@ -37,7 +38,7 @@ export const CheckCardModal = () => {
const
cancelable
=
snap
.
cancelAble
;
const
finishable
=
snap
.
finishAble
;
const
totalLevels
=
snap
.
totalLevels
||
0
;
const
totalLevels
=
snap
.
totalLevels
??
0
;
const
overflow
=
snap
.
overflow
||
false
;
const
LevelSum1
=
mustSelects
.
concat
(
response
)
...
...
@@ -50,8 +51,9 @@ export const CheckCardModal = () => {
const
levelMatched
=
overflow
?
LevelSum1
>=
totalLevels
||
LevelSum2
>=
totalLevels
:
LevelSum1
==
totalLevels
||
LevelSum2
==
totalLevels
;
const
submitable
=
response
.
length
>=
min
&&
response
.
length
<=
max
&&
levelMatched
;
const
submitable
=
single
?
response
.
length
==
1
:
response
.
length
>=
min
&&
response
.
length
<=
max
&&
levelMatched
;
const
resetCheckCardModal
=
()
=>
{
selectCardActions
.
isOpen
=
false
;
...
...
@@ -68,7 +70,9 @@ export const CheckCardModal = () => {
return
(
<
DragModal
title=
{
`${preHintMsg} ${selectHintMsg} ${min}-${max}`
}
title=
{
`${preHintMsg} ${selectHintMsg} ${min}-${max} ${
single ? "每次选择一张" : ""
}`
}
open=
{
isOpen
}
closable=
{
false
}
footer=
{
...
...
@@ -157,7 +161,7 @@ export const CheckCardModal = () => {
{
selecteds
.
concat
(
mustSelects
).
map
((
option
,
idx
)
=>
{
return
(
<
Col
span=
{
4
}
key=
{
idx
}
>
<
C
heckC
ard
<
Card
style=
{
{
width
:
120
}
}
cover=
{
<
img
...
...
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