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
b3096296
Commit
b3096296
authored
Aug 16, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: circular reference and key as prop
parent
8df81c2f
Pipeline
#23155
passed with stages
in 11 minutes and 19 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
86 additions
and
60 deletions
+86
-60
src/api/forbiddens.ts
src/api/forbiddens.ts
+0
-3
src/ui/BuildDeck/CardDetail.tsx
src/ui/BuildDeck/CardDetail.tsx
+75
-54
src/ui/Layout/index.tsx
src/ui/Layout/index.tsx
+2
-2
src/ui/Layout/utils.ts
src/ui/Layout/utils.ts
+9
-1
No files found.
src/api/forbiddens.ts
View file @
b3096296
import
{
useConfig
}
from
"
@/config
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
initStore
}
from
"
@/stores
"
;
const
{
lflistUrl
}
=
useConfig
();
const
{
lflistUrl
}
=
useConfig
();
class
Forbidden
{
class
Forbidden
{
...
@@ -12,7 +10,6 @@ class Forbidden {
...
@@ -12,7 +10,6 @@ class Forbidden {
const
{
time
,
forbiddens
}
=
this
.
extractForbiddensFromText
(
text
);
const
{
time
,
forbiddens
}
=
this
.
extractForbiddensFromText
(
text
);
this
.
time
=
time
;
this
.
time
=
time
;
this
.
setForbiddens
(
forbiddens
);
this
.
setForbiddens
(
forbiddens
);
initStore
.
forbidden
=
true
;
}
}
public
set
(
cardId
:
number
,
limitCount
:
number
):
void
{
public
set
(
cardId
:
number
,
limitCount
:
number
):
void
{
...
...
src/ui/BuildDeck/CardDetail.tsx
View file @
b3096296
import
{
Button
,
Descriptions
}
from
"
antd
"
;
import
{
Button
,
Descriptions
,
type
DescriptionsProps
}
from
"
antd
"
;
import
classNames
from
"
classnames
"
;
import
classNames
from
"
classnames
"
;
import
{
useEffect
,
useMemo
,
useState
}
from
"
react
"
;
import
{
useEffect
,
useMemo
,
useState
}
from
"
react
"
;
...
@@ -40,6 +40,69 @@ export const CardDetail: React.FC<{
...
@@ -40,6 +40,69 @@ export const CardDetail: React.FC<{
[
card
?.
text
.
desc
],
[
card
?.
text
.
desc
],
);
);
const
items
=
useMemo
(()
=>
{
const
result
:
DescriptionsProps
[
"
items
"
]
=
[];
if
(
card
?.
data
.
level
)
{
result
.
push
({
label
:
"
等级
"
,
children
:
card
?.
data
.
level
,
});
}
result
.
push
({
label
:
"
类型
"
,
children
:
cardType
,
span
:
2
,
});
if
(
card
?.
data
.
attribute
)
{
result
.
push
({
label
:
"
属性
"
,
children
:
fetchStrings
(
Region
.
System
,
Attribute2StringCodeMap
.
get
(
card
?.
data
.
attribute
??
0
)
||
0
,
),
});
}
if
(
card
?.
data
.
race
)
{
result
.
push
({
label
:
"
种族
"
,
children
:
fetchStrings
(
Region
.
System
,
Race2StringCodeMap
.
get
(
card
?.
data
.
race
??
0
)
||
0
,
),
span
:
2
,
});
}
if
(
isMonster
(
card
?.
data
.
type
??
0
))
{
result
.
push
({
label
:
"
攻击力
"
,
children
:
card
?.
data
.
atk
,
});
if
(
!
isLinkMonster
(
card
?.
data
.
type
??
0
))
{
result
.
push
({
label
:
"
守备力
"
,
children
:
card
?.
data
.
def
,
});
}
if
(
card
?.
data
.
lscale
)
{
result
.
push
({
label
:
"
灵摆刻度
"
,
children
:
(
<>
←
{
card
.
data
.
lscale
}
-
{
card
.
data
.
rscale
}
→
</>
),
});
}
}
return
result
;
},
[
code
]);
return
(
return
(
<
div
className=
{
classNames
(
styles
.
detail
,
{
[
styles
.
open
]:
open
})
}
>
<
div
className=
{
classNames
(
styles
.
detail
,
{
[
styles
.
open
]:
open
})
}
>
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
.
container
}
>
...
@@ -57,59 +120,17 @@ export const CardDetail: React.FC<{
...
@@ -57,59 +120,17 @@ export const CardDetail: React.FC<{
{
/* <Avatar size={22}>光</Avatar> */
}
{
/* <Avatar size={22}>光</Avatar> */
}
</
div
>
</
div
>
<
ScrollableArea
>
<
ScrollableArea
>
<
Descriptions
layout=
"vertical"
size=
"small"
>
<
Descriptions
layout=
"vertical"
size=
"small"
items=
{
items
}
/>
{
card
?.
data
.
level
&&
(
<
Descriptions
<
Descriptions
.
Item
label=
"等级"
>
layout=
"vertical"
{
card
?.
data
.
level
}
size=
"small"
</
Descriptions
.
Item
>
items=
{
desc
.
filter
(
Boolean
).
map
((
d
,
i
)
=>
({
)
}
label
:
<
Descriptions
.
Item
label=
"类型"
span=
{
2
}
>
desc
.
length
>
1
?
(
i
?
"
怪兽效果
"
:
"
灵摆效果
"
)
:
"
卡片效果
"
,
{
cardType
}
span
:
3
,
</
Descriptions
.
Item
>
children
:
<
CardEffectText
desc=
{
d
}
/>,
{
card
?.
data
.
attribute
&&
(
}))
}
<
Descriptions
.
Item
label=
"属性"
>
></
Descriptions
>
{
fetchStrings
(
Region
.
System
,
Attribute2StringCodeMap
.
get
(
card
?.
data
.
attribute
??
0
)
||
0
,
)
}
</
Descriptions
.
Item
>
)
}
{
card
?.
data
.
race
&&
(
<
Descriptions
.
Item
label=
"种族"
span=
{
2
}
>
{
fetchStrings
(
Region
.
System
,
Race2StringCodeMap
.
get
(
card
?.
data
.
race
??
0
)
||
0
,
)
}
</
Descriptions
.
Item
>
)
}
{
isMonster
(
card
?.
data
.
type
??
0
)
&&
(
<>
<
Descriptions
.
Item
label=
"攻击力"
>
2000
</
Descriptions
.
Item
>
{
!
isLinkMonster
(
card
?.
data
.
type
??
0
)
&&
(
<
Descriptions
.
Item
label=
"守备力"
>
0
</
Descriptions
.
Item
>
)
}
{
card
?.
data
.
lscale
&&
(
<
Descriptions
.
Item
label=
"灵摆刻度"
>
←
{
card
.
data
.
lscale
}
-
{
card
.
data
.
rscale
}
→
</
Descriptions
.
Item
>
)
}
</>
)
}
</
Descriptions
>
<
Descriptions
layout=
"vertical"
size=
"small"
>
{
desc
.
filter
(
Boolean
).
map
((
d
,
i
)
=>
(
<
Descriptions
.
Item
label=
{
desc
.
length
>
1
?
(
i
?
"
怪兽效果
"
:
"
灵摆效果
"
)
:
"
卡片效果
"
}
span=
{
3
}
key=
{
i
}
>
<
CardEffectText
desc=
{
d
}
/>
</
Descriptions
.
Item
>
))
}
</
Descriptions
>
</
ScrollableArea
>
</
ScrollableArea
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
src/ui/Layout/index.tsx
View file @
b3096296
...
@@ -9,7 +9,6 @@ import {
...
@@ -9,7 +9,6 @@ import {
}
from
"
react-router-dom
"
;
}
from
"
react-router-dom
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
forbidden
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
accountStore
}
from
"
@/stores
"
;
import
{
accountStore
}
from
"
@/stores
"
;
...
@@ -18,6 +17,7 @@ import {
...
@@ -18,6 +17,7 @@ import {
getLoginStatus
,
getLoginStatus
,
handleSSOLogin
,
handleSSOLogin
,
initDeck
,
initDeck
,
initForbidden
,
initSqlite
,
initSqlite
,
initWASM
,
initWASM
,
}
from
"
./utils
"
;
}
from
"
./utils
"
;
...
@@ -29,7 +29,7 @@ export const loader: LoaderFunction = async () => {
...
@@ -29,7 +29,7 @@ export const loader: LoaderFunction = async () => {
initDeck
();
initDeck
();
initSqlite
();
initSqlite
();
initWASM
();
initWASM
();
forbidden
.
init
();
initForbidden
();
return
null
;
return
null
;
};
};
...
...
src/ui/Layout/utils.ts
View file @
b3096296
import
rustInit
from
"
rust-src
"
;
import
rustInit
from
"
rust-src
"
;
import
{
CookieKeys
,
getCookie
,
setCookie
}
from
"
@/api
"
;
import
{
CookieKeys
,
forbidden
,
getCookie
,
setCookie
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
useEnv
}
from
"
@/hook
"
;
import
{
useEnv
}
from
"
@/hook
"
;
import
sqliteMiddleWare
,
{
sqliteCmd
}
from
"
@/middleware/sqlite
"
;
import
sqliteMiddleWare
,
{
sqliteCmd
}
from
"
@/middleware/sqlite
"
;
...
@@ -41,6 +41,14 @@ export const initWASM = async () => {
...
@@ -41,6 +41,14 @@ export const initWASM = async () => {
initStore
.
wasm
=
true
;
initStore
.
wasm
=
true
;
};
};
/** 加载禁限卡表 */
export
const
initForbidden
=
async
()
=>
{
if
(
!
initStore
.
forbidden
)
{
await
forbidden
.
init
();
initStore
.
forbidden
=
true
;
}
};
/** sso登录跳转回来 */
/** sso登录跳转回来 */
export
const
handleSSOLogin
=
async
(
search
:
string
)
=>
{
export
const
handleSSOLogin
=
async
(
search
:
string
)
=>
{
/** 从SSO跳转回的URL之中,解析用户信息 */
/** 从SSO跳转回的URL之中,解析用户信息 */
...
...
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