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
bd852b92
Commit
bd852b92
authored
Mar 30, 2024
by
Chunchi Che
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/filter' into 'main'
修复组卡页过滤器(灵摆怪兽条件下选择特定星级无法搜出卡) See merge request
mycard/Neos!354
parents
cda9dcde
2fbf92b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
src/middleware/sqlite/fts.ts
src/middleware/sqlite/fts.ts
+6
-2
src/ui/BuildDeck/Filter.tsx
src/ui/BuildDeck/Filter.tsx
+0
-1
No files found.
src/middleware/sqlite/fts.ts
View file @
bd852b92
...
@@ -48,14 +48,17 @@ export function invokeFts(db: Database, params: FtsParams): CardMeta[] {
...
@@ -48,14 +48,17 @@ export function invokeFts(db: Database, params: FtsParams): CardMeta[] {
}
}
function
getFtsCondtions
(
conditions
:
FtsConditions
):
string
{
function
getFtsCondtions
(
conditions
:
FtsConditions
):
string
{
const
{
types
,
levels
,
atk
,
def
,
races
,
attributes
}
=
conditions
;
const
{
types
,
levels
,
lscales
,
atk
,
def
,
races
,
attributes
}
=
conditions
;
const
assertMonster
=
`(type &
${
TYPE_MONSTER
}
) > 0`
;
const
assertMonster
=
`(type &
${
TYPE_MONSTER
}
) > 0`
;
const
typesCondition
=
types
const
typesCondition
=
types
.
map
((
type
)
=>
`(type &
${
type
}
) > 0`
)
.
map
((
type
)
=>
`(type &
${
type
}
) > 0`
)
.
join
(
"
OR
"
);
.
join
(
"
OR
"
);
const
levelsCondition
=
levels
const
levelsCondition
=
levels
.
map
((
level
)
=>
`level =
${
level
}
`
)
.
map
((
level
)
=>
`(level & 0xff) =
${
level
}
`
)
.
join
(
"
OR
"
);
const
lscalesCondition
=
lscales
.
map
((
lscale
)
=>
`((level >> 0x18) & 0xff) =
${
lscale
}
`
)
.
join
(
"
OR
"
);
.
join
(
"
OR
"
);
const
atkCondition
=
const
atkCondition
=
atk
.
min
!==
null
||
atk
.
max
!==
null
atk
.
min
!==
null
||
atk
.
max
!==
null
...
@@ -79,6 +82,7 @@ function getFtsCondtions(conditions: FtsConditions): string {
...
@@ -79,6 +82,7 @@ function getFtsCondtions(conditions: FtsConditions): string {
const
merged
=
[
const
merged
=
[
typesCondition
,
typesCondition
,
levelsCondition
,
levelsCondition
,
lscalesCondition
,
atkCondition
,
atkCondition
,
defCondition
,
defCondition
,
raceCondition
,
raceCondition
,
...
...
src/ui/BuildDeck/Filter.tsx
View file @
bd852b92
...
@@ -115,7 +115,6 @@ export const Filter: React.FC<{
...
@@ -115,7 +115,6 @@ export const Filter: React.FC<{
type=
"primary"
type=
"primary"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
onConfirm
(
newConditions
);
onConfirm
(
newConditions
);
console
.
log
(
newConditions
);
}
}
}
}
>
>
确定
确定
...
...
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