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
699f9f67
Commit
699f9f67
authored
Jun 30, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 修改 area 渲染
parent
f9a36f65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
utils.tsx
src/pages/member/utils.tsx
+22
-0
No files found.
src/pages/member/utils.tsx
View file @
699f9f67
import
React
from
'react'
;
import
{
PATTERN_MAPS
}
from
'@/constants/regExp'
;
import
PicWrap
from
'./components/PicWrap'
;
export
type
ElementType
=
{
/**
...
...
@@ -194,4 +196,23 @@ export function createMemberSchema(elements: ElementType[]) {
components
[
item
.
fieldName
as
string
]
=
getFieldType
(
item
);
}
return
components
;
};
// 根据 fieldType 渲染对应的内容
export
function
renderFieldTypeContent
(
fieldType
:
FieldType
,
fieldValue
:
any
):
React
.
ReactNode
{
// 默认渲染 string
let
node
:
React
.
ReactNode
=
fieldValue
;
switch
(
fieldType
)
{
case
'upload'
:
node
=
(
<
PicWrap
pics=
{
[
fieldValue
.
fieldValue
]
}
/>
);
break
;
default
:
break
;
}
return
node
;
};
\ No newline at end of file
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