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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
MyCard
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
Pipeline
#23044
passed with stages
in 13 minutes and 43 seconds
Changes
3
Pipelines
1
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;
/** 过滤条件 */
export
interface
FtsConditions
{
levels
:
number
[];
// 星阶/link值
lscales
:
number
[];
// 左刻度
types
:
number
[];
// 卡片类型
levels
:
number
[];
// 星阶/刻度/link值
races
:
number
[];
// 种族
attributes
:
number
[];
// 属性
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) => ({
label
:
(
index
+
1
).
toString
(),
}));
const
lscales
=
Array
.
from
({
length
:
12
},
(
_
,
index
)
=>
({
value
:
index
+
1
,
label
:
(
index
+
1
).
toString
(),
}));
export
const
Filter
:
React
.
FC
<
{
conditions
:
FtsConditions
;
onConfirm
:
(
newConditons
:
FtsConditions
)
=>
void
;
...
...
@@ -47,6 +52,7 @@ export const Filter: React.FC<{
[genOptions(Race2StringCodeMap), "种族", "races"],
[genOptions(Type2StringCodeMap), "类型", "types"],
[levels, "星级", "levels"],
[lscales, "灵摆刻度", "lscales"],
] as const;
const handleInputNumberChange =
...
...
@@ -166,7 +172,7 @@ const Item: React.FC<
<
div
className=
{
styles
[
"
item-name
"
]
}
>
{
title
}
{
showTip
&&
(
<
Tooltip
title=
"
输入-2即等同于输入“?”
"
>
<
Tooltip
title=
"
若要输入 ? 的攻击/守备,请输入 -2
"
>
<
InfoCircleFilled
style=
{
{
fontSize
:
10
}
}
/>
</
Tooltip
>
)
}
...
...
src/ui/BuildDeck/index.tsx
View file @
257357ce
...
...
@@ -19,7 +19,7 @@ import {
import
classNames
from
"
classnames
"
;
import
{
isEqual
}
from
"
lodash-es
"
;
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
{
HTML5Backend
}
from
"
react-dnd-html5-backend
"
;
import
{
LoaderFunction
}
from
"
react-router-dom
"
;
...
...
@@ -199,6 +199,7 @@ const Search: React.FC = () => {
atk
:
{
min
:
null
,
max
:
null
},
def
:
{
min
:
null
,
max
:
null
},
levels
:
[],
lscales
:
[],
races
:
[],
attributes
:
[],
types
:
[],
...
...
@@ -284,12 +285,12 @@ const Search: React.FC = () => {
});
};
/** 滚动条的ref */
/** 滚动条的ref
,用来在翻页之后快速回顶
*/
const
ref
=
useRef
<
OverlayScrollbarsComponentRef
<
"
div
"
>>
(
null
);
const
scrollToTop
=
()
=>
{
const
scrollToTop
=
useCallback
(
()
=>
{
const
viewport
=
ref
.
current
?.
osInstance
()?.
elements
().
viewport
;
if
(
viewport
)
viewport
.
scrollTop
=
0
;
};
}
,
[])
;
return
(
<
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