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
707b88d2
Commit
707b88d2
authored
May 25, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add AnnounceModal
parent
a65896ee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
0 deletions
+58
-0
src/ui/Duel/Main.tsx
src/ui/Duel/Main.tsx
+2
-0
src/ui/Duel/Message/AnnounceModal.tsx
src/ui/Duel/Message/AnnounceModal.tsx
+55
-0
src/ui/Duel/Message/index.ts
src/ui/Duel/Message/index.ts
+1
-0
No files found.
src/ui/Duel/Main.tsx
View file @
707b88d2
...
...
@@ -2,6 +2,7 @@ import React from "react";
import
{
Alert
,
AnnounceModal
,
CardListModal
,
CardModal
,
CheckCounterModal
,
...
...
@@ -28,6 +29,7 @@ const NeosDuel = () => {
<
OptionModal
/>
<
CheckCounterModal
/>
<
SortCardModal
/>
<
AnnounceModal
/>
</>
);
};
...
...
src/ui/Duel/Message/AnnounceModal.tsx
0 → 100644
View file @
707b88d2
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
Button
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
sendSelectOptionResponse
}
from
"
@/api
"
;
import
{
messageStore
}
from
"
@/stores
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
const
{
announceModal
}
=
messageStore
;
export
const
AnnounceModal
=
()
=>
{
const
snap
=
useSnapshot
(
announceModal
);
const
isOpen
=
snap
.
isOpen
;
const
title
=
snap
.
title
;
const
min
=
snap
.
min
;
const
options
=
snap
.
options
;
const
[
selected
,
setSelected
]
=
useState
<
number
[]
>
([]);
return
(
<
DragModal
title=
{
title
}
open=
{
isOpen
}
closable=
{
false
}
footer=
{
<
Button
disabled=
{
selected
.
length
!=
min
}
onClick=
{
()
=>
{
let
response
=
selected
.
reduce
((
res
,
current
)
=>
res
|
current
,
0
);
// 多个选择求或
sendSelectOptionResponse
(
response
);
announceModal
.
isOpen
=
false
;
announceModal
.
title
=
undefined
;
announceModal
.
options
=
[];
}
}
>
submit
</
Button
>
}
>
<
CheckCard
.
Group
bordered
size=
"small"
onChange=
{
(
value
:
any
)
=>
{
setSelected
(
value
);
}
}
>
{
options
.
map
((
option
,
idx
)
=>
(
<
CheckCard
key=
{
idx
}
title=
{
option
.
info
}
value=
{
option
.
response
}
/>
))
}
</
CheckCard
.
Group
>
</
DragModal
>
);
};
src/ui/Duel/Message/index.ts
View file @
707b88d2
export
*
from
"
./Alert
"
;
export
*
from
"
./AnnounceModal
"
;
export
*
from
"
./CardListModal
"
;
export
*
from
"
./CardModal
"
;
export
*
from
"
./CheckCounterModal
"
;
...
...
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