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
linweijiong
jinfa-platform
Commits
9960133c
Commit
9960133c
authored
Aug 26, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
布局容器
parent
fcfc8899
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
2 deletions
+68
-2
index.tsx
src/components/NiceForm/index.tsx
+17
-0
global.d.ts
src/global/config/global.d.ts
+47
-0
request.ts
src/utils/request.ts
+4
-2
No files found.
src/components/NiceForm/index.tsx
View file @
9960133c
...
...
@@ -36,6 +36,23 @@ const RowLayout = styled(props => <Row justify='end' {...props}/>)`
}
`
// 自定义flex布局容器
registerVirtualBox
(
'flex-box'
,
props
=>
{
const
childProperties
=
props
.
schema
.
getOrderProperties
()
const
{
title
,
required
}
=
props
.
props
const
{
labelcol
,
wrappercol
}
=
props
.
schema
.
getExtendsComponentProps
()
return
<
Row
>
{
title
&&
<
Col
span=
{
labelcol
}
className=
{
cx
(
required
?
'flex-layout-label-required'
:
''
)
}
>
{
title
}
</
Col
>
}
<
Col
span=
{
wrappercol
}
>
<
Row
>
{
childProperties
.
map
((
v
,
i
,
arr
)
=>
renderCol
(
v
.
schema
,
arr
.
length
-
1
===
i
))
}
</
Row
>
</
Col
>
</
Row
>
})
registerVirtualBox
(
'flex-layout'
,
(
_props
)
=>
{
const
{
children
,
props
}
=
_props
const
rowStyle
=
props
[
'x-component-props'
]
?
props
[
'x-component-props'
].
rowStyle
:
{}
...
...
src/global/config/global.d.ts
0 → 100644
View file @
9960133c
export
interface
MemberType
{
id
:
number
;
typeName
:
string
;
}
export
interface
BusinessType
{
id
:
number
;
typeName
:
string
;
}
export
interface
UseType
{
memberType
:
MemberType
[];
businessType
:
BusinessType
[];
}
export
interface
UserRegister
{
useType
:
UseType
;
}
export
interface
Web
{
shopInfo
:
any
[];
}
export
interface
PayConfig
{
paymemberConfig
?:
any
;
}
export
interface
CountryList
{
name
:
string
;
key
:
string
;
icon
:
string
;
}
export
interface
Global
{
siteId
:
number
;
siteUrl
:
string
;
logo
:
string
;
countryList
:
CountryList
[];
}
export
interface
RootObject
{
userRegister
:
UserRegister
;
web
:
Web
;
payConfig
:
PayConfig
;
global
:
Global
;
}
\ No newline at end of file
src/utils/request.ts
View file @
9960133c
...
...
@@ -70,10 +70,12 @@ const baseRequest = extend({
// 请求拦截器
baseRequest
.
interceptors
.
request
.
use
((
url
:
string
,
options
:
RequestOptionsInit
):
{
url
:
string
,
options
:
RequestOptionsInit
}
=>
{
// 判断是否有权限
const
loginAfterHeaders
=
getAuth
()
const
{
userId
,
memberId
,
token
}
=
getAuth
()
const
headers
=
{
...
options
.
headers
,
...
loginAfterHeaders
userId
,
memberId
,
token
}
return
{
// 前缀如果已经带上api, 跳过自动补前缀
...
...
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