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
257357ce
Commit
257357ce
authored
Aug 12, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: some opts, and add searching by lscale
parent
5d6b93e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
src/middleware/sqlite/fts.ts
src/middleware/sqlite/fts.ts
+2
-1
src/ui/BuildDeck/Filter.tsx
src/ui/BuildDeck/Filter.tsx
+7
-1
src/ui/BuildDeck/index.tsx
src/ui/BuildDeck/index.tsx
+5
-4
No files found.
src/middleware/sqlite/fts.ts
View file @
257357ce
...
@@ -8,8 +8,9 @@ const TYPE_MONSTER = 0x1;
...
@@ -8,8 +8,9 @@ const TYPE_MONSTER = 0x1;
/** 过滤条件 */
/** 过滤条件 */
export
interface
FtsConditions
{
export
interface
FtsConditions
{
levels
:
number
[];
// 星阶/link值
lscales
:
number
[];
// 左刻度
types
:
number
[];
// 卡片类型
types
:
number
[];
// 卡片类型
levels
:
number
[];
// 星阶/刻度/link值
races
:
number
[];
// 种族
races
:
number
[];
// 种族
attributes
:
number
[];
// 属性
attributes
:
number
[];
// 属性
atk
:
{
min
:
number
|
null
;
max
:
number
|
null
};
// 攻击力区间
atk
:
{
min
:
number
|
null
;
max
:
number
|
null
};
// 攻击力区间
...
...
src/ui/BuildDeck/Filter.tsx
View file @
257357ce
...
@@ -23,6 +23,11 @@ const levels = Array.from({ length: 12 }, (_, index) => ({
...
@@ -23,6 +23,11 @@ const levels = Array.from({ length: 12 }, (_, index) => ({
label
:
(
index
+
1
).
toString
(),
label
:
(
index
+
1
).
toString
(),
}));
}));
const
lscales
=
Array
.
from
({
length
:
12
},
(
_
,
index
)
=>
({
value
:
index
+
1
,
label
:
(
index
+
1
).
toString
(),
}));
export
const
Filter
:
React
.
FC
<
{
export
const
Filter
:
React
.
FC
<
{
conditions
:
FtsConditions
;
conditions
:
FtsConditions
;
onConfirm
:
(
newConditons
:
FtsConditions
)
=>
void
;
onConfirm
:
(
newConditons
:
FtsConditions
)
=>
void
;
...
@@ -47,6 +52,7 @@ export const Filter: React.FC<{
...
@@ -47,6 +52,7 @@ export const Filter: React.FC<{
[genOptions(Race2StringCodeMap), "种族", "races"],
[genOptions(Race2StringCodeMap), "种族", "races"],
[genOptions(Type2StringCodeMap), "类型", "types"],
[genOptions(Type2StringCodeMap), "类型", "types"],
[levels, "星级", "levels"],
[levels, "星级", "levels"],
[lscales, "灵摆刻度", "lscales"],
] as const;
] as const;
const handleInputNumberChange =
const handleInputNumberChange =
...
@@ -166,7 +172,7 @@ const Item: React.FC<
...
@@ -166,7 +172,7 @@ const Item: React.FC<
<
div
className=
{
styles
[
"
item-name
"
]
}
>
<
div
className=
{
styles
[
"
item-name
"
]
}
>
{
title
}
{
title
}
{
showTip
&&
(
{
showTip
&&
(
<
Tooltip
title=
"
输入-2即等同于输入“?”
"
>
<
Tooltip
title=
"
若要输入 ? 的攻击/守备,请输入 -2
"
>
<
InfoCircleFilled
style=
{
{
fontSize
:
10
}
}
/>
<
InfoCircleFilled
style=
{
{
fontSize
:
10
}
}
/>
</
Tooltip
>
</
Tooltip
>
)
}
)
}
...
...
src/ui/BuildDeck/index.tsx
View file @
257357ce
...
@@ -19,7 +19,7 @@ import {
...
@@ -19,7 +19,7 @@ import {
import
classNames
from
"
classnames
"
;
import
classNames
from
"
classnames
"
;
import
{
isEqual
}
from
"
lodash-es
"
;
import
{
isEqual
}
from
"
lodash-es
"
;
import
{
type
OverlayScrollbarsComponentRef
}
from
"
overlayscrollbars-react
"
;
import
{
type
OverlayScrollbarsComponentRef
}
from
"
overlayscrollbars-react
"
;
import
{
memo
,
useEffect
,
useRef
,
useState
}
from
"
react
"
;
import
{
memo
,
use
Callback
,
use
Effect
,
useRef
,
useState
}
from
"
react
"
;
import
{
DndProvider
,
useDrag
,
useDrop
}
from
"
react-dnd
"
;
import
{
DndProvider
,
useDrag
,
useDrop
}
from
"
react-dnd
"
;
import
{
HTML5Backend
}
from
"
react-dnd-html5-backend
"
;
import
{
HTML5Backend
}
from
"
react-dnd-html5-backend
"
;
import
{
LoaderFunction
}
from
"
react-router-dom
"
;
import
{
LoaderFunction
}
from
"
react-router-dom
"
;
...
@@ -199,6 +199,7 @@ const Search: React.FC = () => {
...
@@ -199,6 +199,7 @@ const Search: React.FC = () => {
atk
:
{
min
:
null
,
max
:
null
},
atk
:
{
min
:
null
,
max
:
null
},
def
:
{
min
:
null
,
max
:
null
},
def
:
{
min
:
null
,
max
:
null
},
levels
:
[],
levels
:
[],
lscales
:
[],
races
:
[],
races
:
[],
attributes
:
[],
attributes
:
[],
types
:
[],
types
:
[],
...
@@ -284,12 +285,12 @@ const Search: React.FC = () => {
...
@@ -284,12 +285,12 @@ const Search: React.FC = () => {
});
});
};
};
/** 滚动条的ref */
/** 滚动条的ref
,用来在翻页之后快速回顶
*/
const
ref
=
useRef
<
OverlayScrollbarsComponentRef
<
"
div
"
>>
(
null
);
const
ref
=
useRef
<
OverlayScrollbarsComponentRef
<
"
div
"
>>
(
null
);
const
scrollToTop
=
()
=>
{
const
scrollToTop
=
useCallback
(
()
=>
{
const
viewport
=
ref
.
current
?.
osInstance
()?.
elements
().
viewport
;
const
viewport
=
ref
.
current
?.
osInstance
()?.
elements
().
viewport
;
if
(
viewport
)
viewport
.
scrollTop
=
0
;
if
(
viewport
)
viewport
.
scrollTop
=
0
;
};
}
,
[])
;
return
(
return
(
<
div
className=
{
styles
.
container
}
ref=
{
dropRef
}
>
<
div
className=
{
styles
.
container
}
ref=
{
dropRef
}
>
...
...
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