Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
2cad8ecc
Commit
2cad8ecc
authored
Jun 15, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新全局配置获取方式
parent
596dcd9c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
57 deletions
+11
-57
base.config.json
config/base.config.json
+1
-28
demo.js
demo.js
+5
-5
UserLayouts.tsx
src/layouts/UserLayouts.tsx
+2
-1
HeaderDropdown.tsx
src/layouts/components/HeaderDropdown.tsx
+3
-23
No files found.
config/base.config.json
View file @
2cad8ecc
{
"global"
:
{
"logo"
:
""
,
"countryList"
:
[
{
"name"
:
"简体中文-ZH"
,
"key"
:
"cn"
,
"icon"
:
""
},
{
"name"
:
"English-EN"
,
"key"
:
"en"
,
"icon"
:
""
},
{
"name"
:
"日本語-JP"
,
"key"
:
"jp"
,
"icon"
:
""
},
{
"name"
:
"한국어-KO"
,
"key"
:
"ko"
,
"icon"
:
""
}
]
}
}
\ No newline at end of file
{
"global"
:{
"logo"
:
"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png"
,
"countryList"
:[{
"name"
:
"简体中文-ZH"
,
"key"
:
"cn"
,
"icon"
:
"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"
},{
"name"
:
"English-EN"
,
"key"
:
"en"
,
"icon"
:
"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"
},{
"name"
:
"日本語-JP"
,
"key"
:
"jp"
,
"icon"
:
"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"
},{
"name"
:
"한국어-KO"
,
"key"
:
"ko"
,
"icon"
:
"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"
}]}}
demo.js
View file @
2cad8ecc
...
...
@@ -3,27 +3,27 @@ const mockData = {
code
:
1000
,
data
:
{
global
:
{
logo
:
''
,
logo
:
'
http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png
'
,
countryList
:
[
{
name
:
'简体中文-ZH'
,
key
:
'cn'
,
icon
:
''
icon
:
'
http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png
'
},
{
name
:
'English-EN'
,
key
:
'en'
,
icon
:
''
icon
:
'
http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png
'
},
{
name
:
'日本語-JP'
,
key
:
'jp'
,
icon
:
''
icon
:
'
http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png
'
},
{
name
:
'한국어-KO'
,
key
:
'ko'
,
icon
:
''
icon
:
'
http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png
'
}
]
}
...
...
src/layouts/UserLayouts.tsx
View file @
2cad8ecc
...
...
@@ -3,6 +3,7 @@ import styles from './styles/UserLayouts.less'
import
UserHeader
from
'./components/UserHeader'
;
import
BaseFooter
from
'./components/BaseFooter'
;
import
{
Row
}
from
'antd'
;
import
{
GlobalConfig
}
from
'@/global/config'
;
/**
* 登录、注册等用户界面布局
...
...
@@ -11,7 +12,7 @@ import { Row } from 'antd';
const
UserLayouts
:
React
.
FC
=
(
props
)
=>
{
return
(
<
div
className=
{
styles
.
lingxiBusinessUserLayout
}
>
<
UserHeader
/>
<
UserHeader
logo=
{
GlobalConfig
.
global
.
logo
}
/>
<
div
className=
{
styles
.
lingxiBusinessUserBg
}
>
{
props
.
children
}
<
BaseFooter
/>
...
...
src/layouts/components/HeaderDropdown.tsx
View file @
2cad8ecc
...
...
@@ -6,34 +6,14 @@ import japenImg from '../../../mockStatic/japen.png'
import
korenImg
from
'../../../mockStatic/koren.png'
import
us
from
'../../../mockStatic/us.png'
import
{
CaretDownOutlined
}
from
'@ant-design/icons'
import
{
GlobalConfig
}
from
'@/global/config'
interface
countryItem
{
name
:
string
,
key
:
string
,
icon
:
string
}
const
countryList
:
countryItem
[]
=
[
{
name
:
'简体中文-ZH'
,
key
:
'cn'
,
icon
:
ChinaImg
},
{
name
:
'English-EN'
,
key
:
'en'
,
icon
:
us
},
{
name
:
'日本語-JP'
,
key
:
'jp'
,
icon
:
japenImg
},
{
name
:
'한국어-KO'
,
key
:
'ko'
,
icon
:
korenImg
}
]
const
HeaderDropdown
:
React
.
FC
=
()
=>
{
// 此处暂时无接口, 对接接口后需用枚举类型做补充
const
[
select
,
setSelect
]
=
useState
<
countryItem
>
({
...
...
@@ -45,7 +25,7 @@ const HeaderDropdown: React.FC = () => {
const
menuHeaderDropdown
=
(
<
Menu
selectedKeys=
{
[]
}
>
{
countryList
.
map
(
v
=>
<
Menu
.
Item
key=
{
v
.
key
}
onClick=
{
()
=>
setSelect
(
v
)
}
>
GlobalConfig
.
global
.
countryList
.
map
(
v
=>
<
Menu
.
Item
key=
{
v
.
key
}
onClick=
{
()
=>
setSelect
(
v
)
}
>
<
Space
>
{
select
.
key
===
v
.
key
?
<
img
src=
{
gou
}
style=
{
{
width
:
20
,
height
:
20
}
}
/>
:
<
div
style=
{
{
width
:
20
,
height
:
20
}
}
></
div
>
}
<
img
src=
{
v
.
icon
}
style=
{
{
width
:
24
,
height
:
17
}
}
/>
...
...
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