Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TOSTUMI
Project
Project
Details
Activity
Releases
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
Maple
TOSTUMI
Commits
e23bed6c
Commit
e23bed6c
authored
Nov 02, 2020
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组件通过参数显示不同内容
Signed-off-by:
cellee
<
893264950@qq.com
>
parent
cc8e125a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
39 deletions
+65
-39
SearchOptionsCommnity.tsx
src/components/SearchOptions/SearchOptionsCommnity.tsx
+3
-1
SearchOptionsTow.tsx
src/components/SearchOptions/SearchOptionsTow.tsx
+29
-13
CommunityAnnouncement.tsx
...anagement/CommunityAnnouncement/CommunityAnnouncement.tsx
+33
-25
No files found.
src/components/SearchOptions/SearchOptionsCommnity.tsx
View file @
e23bed6c
...
@@ -4,7 +4,8 @@ import SearchOptions from './SearchOptions';
...
@@ -4,7 +4,8 @@ import SearchOptions from './SearchOptions';
import
SearchOptionsTow
from
'./SearchOptionsTow'
;
import
SearchOptionsTow
from
'./SearchOptionsTow'
;
const
SearchOptionsCommnity
=
(
props
:
any
)
=>
{
const
SearchOptionsCommnity
=
(
props
:
any
)
=>
{
const
{
dispatch
,
CommunityList
,
opname
,
defaultName
,
SearchOptionsCommnity
}
=
props
;
const
{
dispatch
,
CommunityList
,
opname
,
defaultName
,
type
}
=
props
;
const
tosCommunityget
=
(
values
:
any
)
=>
{
const
tosCommunityget
=
(
values
:
any
)
=>
{
dispatch
({
type
:
'Init/tosCommunityget'
,
playload
:
values
});
dispatch
({
type
:
'Init/tosCommunityget'
,
playload
:
values
});
};
};
...
@@ -34,6 +35,7 @@ const SearchOptionsCommnity = (props: any) => {
...
@@ -34,6 +35,7 @@ const SearchOptionsCommnity = (props: any) => {
list
=
{
CommunityList
}
list
=
{
CommunityList
}
extendName
=
{
extendName
}
extendName
=
{
extendName
}
def
=
{
defaultName
}
def
=
{
defaultName
}
type
=
{
type
}
>
<
/
SearchOptionsTow
>
>
<
/
SearchOptionsTow
>
) : null
}
) : null
}
</>
</>
...
...
src/components/SearchOptions/SearchOptionsTow.tsx
View file @
e23bed6c
...
@@ -3,7 +3,8 @@ import { Select } from 'antd';
...
@@ -3,7 +3,8 @@ import { Select } from 'antd';
const
{
Option
}
=
Select
;
const
{
Option
}
=
Select
;
const
SearchOptionsTow
=
(
porps
:
any
)
=>
{
const
SearchOptionsTow
=
(
porps
:
any
)
=>
{
const
{
list
,
extendName
,
def
}
=
porps
;
const
{
list
,
extendName
,
def
,
type
}
=
porps
;
const
options
=
list
.
map
((
d
:
any
,
index
:
number
)
=>
(
const
options
=
list
.
map
((
d
:
any
,
index
:
number
)
=>
(
<
Option
value=
{
d
}
key=
{
index
}
>
<
Option
value=
{
d
}
key=
{
index
}
>
{
d
}
{
d
}
...
@@ -15,10 +16,12 @@ const SearchOptionsTow = (porps: any) => {
...
@@ -15,10 +16,12 @@ const SearchOptionsTow = (porps: any) => {
}
}
return
(
return
(
<
div
>
<
div
>
{
type
?
(
<
Select
<
Select
showSearch
showSearch
allowClear
allowClear
mode=
"multiple"
mode=
"multiple"
autoClearSearchValue
style=
{
{
width
:
320
}
}
style=
{
{
width
:
320
}
}
placeholder=
"Community Name"
placeholder=
"Community Name"
optionFilterProp=
"children"
optionFilterProp=
"children"
...
@@ -27,6 +30,19 @@ const SearchOptionsTow = (porps: any) => {
...
@@ -27,6 +30,19 @@ const SearchOptionsTow = (porps: any) => {
>
>
{
options
}
{
options
}
</
Select
>
</
Select
>
)
:
(
<
Select
showSearch
allowClear
style=
{
{
width
:
200
}
}
placeholder=
"Community Name"
optionFilterProp=
"children"
onChange=
{
onChange
}
defaultValue=
{
def
}
>
{
options
}
</
Select
>
)
}
</
div
>
</
div
>
);
);
};
};
...
...
src/pages/CommunityManagement/CommunityAnnouncement/CommunityAnnouncement.tsx
View file @
e23bed6c
...
@@ -36,7 +36,6 @@ const CommunityAnnouncement = (props: any) => {
...
@@ -36,7 +36,6 @@ const CommunityAnnouncement = (props: any) => {
dispatch
({
type
:
module
+
'/returnDataSaveDetail'
,
playload
:
{
DataSaveDetail
:
null
}
});
dispatch
({
type
:
module
+
'/returnDataSaveDetail'
,
playload
:
{
DataSaveDetail
:
null
}
});
},
[
1
]);
},
[
1
]);
// 表头
// 表头
const
columns
=
[
const
columns
=
[
{
{
...
@@ -85,10 +84,20 @@ const CommunityAnnouncement = (props: any) => {
...
@@ -85,10 +84,20 @@ const CommunityAnnouncement = (props: any) => {
title
:
'Actions'
,
title
:
'Actions'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
Space
size=
"middle"
>
<
Space
size=
"middle"
>
<
Button
type=
"link"
onClick=
{
()
=>
{
goToAdd
(
1
,
record
);}
}
>
<
Button
type=
"link"
onClick=
{
()
=>
{
goToAdd
(
1
,
record
);
}
}
>
Edit
Edit
</
Button
>
</
Button
>
<
Button
type=
"link"
onClick=
{
()
=>
{
goToAdd
(
2
,
record
);}
}
>
<
Button
type=
"link"
onClick=
{
()
=>
{
goToAdd
(
2
,
record
);
}
}
>
Detail
Detail
</
Button
>
</
Button
>
</
Space
>
</
Space
>
...
@@ -100,11 +109,11 @@ const CommunityAnnouncement = (props: any) => {
...
@@ -100,11 +109,11 @@ const CommunityAnnouncement = (props: any) => {
const
DetailPage
=
(
page
:
any
)
=>
{
const
DetailPage
=
(
page
:
any
)
=>
{
let
data
=
{
let
data
=
{
Method
:
'returnDataSaveDetail'
,
Method
:
'returnDataSaveDetail'
,
DefaultName
:
"DataSaveDetail"
,
DefaultName
:
'DataSaveDetail'
,
Data
:
page
Data
:
page
,
};
};
return
data
;
return
data
;
}
}
;
// 分页数据一改变就发起请求
// 分页数据一改变就发起请求
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -122,16 +131,15 @@ const CommunityAnnouncement = (props: any) => {
...
@@ -122,16 +131,15 @@ const CommunityAnnouncement = (props: any) => {
function
goToAdd
(
num
:
any
,
record
:
any
)
{
function
goToAdd
(
num
:
any
,
record
:
any
)
{
if
(
num
==
0
)
{
if
(
num
==
0
)
{
history
.
push
(
'./CommunityAnnouncement/Add'
);
history
.
push
(
'./CommunityAnnouncement/Add'
);
}
else
if
(
num
==
1
)
{
}
else
if
(
num
==
1
)
{
// 传递列表信息
// 传递列表信息
dispatch
({
type
:
module
+
'/returnDataSave'
,
playload
:
{
DataSave
:
record
}
});
dispatch
({
type
:
module
+
'/returnDataSave'
,
playload
:
{
DataSave
:
record
}
});
history
.
push
(
'./CommunityAnnouncement/Edit'
);
history
.
push
(
'./CommunityAnnouncement/Edit'
);
}
else
if
(
num
==
2
)
{
}
else
if
(
num
==
2
)
{
// 传递列表信息
// 传递列表信息
dispatch
({
type
:
module
+
'/returnDataSave'
,
playload
:
{
DataSave
:
record
}
});
dispatch
({
type
:
module
+
'/returnDataSave'
,
playload
:
{
DataSave
:
record
}
});
history
.
push
(
'./CommunityAnnouncement/Detail'
);
history
.
push
(
'./CommunityAnnouncement/Detail'
);
}
}
}
}
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
...
@@ -145,21 +153,21 @@ const CommunityAnnouncement = (props: any) => {
...
@@ -145,21 +153,21 @@ const CommunityAnnouncement = (props: any) => {
pageNum
:
1
,
pageNum
:
1
,
};
};
// 把内容存进去
// 把内容存进去
SA
(
DetailPage
(
page
),
module
,
dispatch
)
SA
(
DetailPage
(
page
),
module
,
dispatch
)
;
};
};
// 表单提交
// 表单提交
const
onFinishContract
=
(
value
:
any
)
=>
{
const
onFinishContract
=
(
value
:
any
)
=>
{
console
.
log
(
value
)
console
.
log
(
value
)
;
if
(
!
value
.
communityNumList
&&
!
value
.
noticTitlel
&&
!
value
.
creator
)
{
if
(
!
value
.
communityNumList
&&
!
value
.
noticTitlel
&&
!
value
.
creator
)
{
message
.
error
(
'Please enter one of them!'
);
message
.
error
(
'Please enter one of them!'
);
}
else
{
}
else
{
// 要看是哪里分页
// 要看是哪里分页
let
mlist
=
{
...
value
}
let
mlist
=
{
...
value
}
;
mlist
.
communityNumList
=
value
.
communityNumList
mlist
.
communityNumList
=
value
.
communityNumList
;
mlist
.
pageNum
=
1
;
mlist
.
pageNum
=
1
;
// 把内容存进去
// 把内容存进去
SA
(
DetailPage
(
mlist
),
module
,
dispatch
)
SA
(
DetailPage
(
mlist
),
module
,
dispatch
)
;
// requst(payload);
// requst(payload);
}
}
};
};
...
@@ -174,10 +182,10 @@ const CommunityAnnouncement = (props: any) => {
...
@@ -174,10 +182,10 @@ const CommunityAnnouncement = (props: any) => {
// 页面切换
// 页面切换
const
paginationHandler
=
(
page
:
number
,
pageSize
?:
number
)
=>
{
const
paginationHandler
=
(
page
:
number
,
pageSize
?:
number
)
=>
{
// 要看是哪里分页
// 要看是哪里分页
let
mlist
=
{
...
DataSaveDetail
}
let
mlist
=
{
...
DataSaveDetail
}
;
mlist
.
pageNum
=
page
;
mlist
.
pageNum
=
page
;
// 把内容存进去
// 把内容存进去
SA
(
DetailPage
(
mlist
),
module
,
dispatch
)
SA
(
DetailPage
(
mlist
),
module
,
dispatch
)
;
};
};
return
(
return
(
...
@@ -194,6 +202,7 @@ const CommunityAnnouncement = (props: any) => {
...
@@ -194,6 +202,7 @@ const CommunityAnnouncement = (props: any) => {
<
SearchOptionsCommnity
<
SearchOptionsCommnity
// ubmit={extendName}
// ubmit={extendName}
opname=
{
opname
}
opname=
{
opname
}
type=
{
1
}
/>
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
name=
"noticTitlel"
>
<
Form
.
Item
name=
"noticTitlel"
>
...
@@ -225,7 +234,6 @@ const CommunityAnnouncement = (props: any) => {
...
@@ -225,7 +234,6 @@ const CommunityAnnouncement = (props: any) => {
</
Form
>
</
Form
>
</
div
>
</
div
>
<
div
style=
{
{
width
:
'100%'
,
paddingLeft
:
10
,
paddingRight
:
10
,
backgroundColor
:
'#ffffff'
}
}
>
<
div
style=
{
{
width
:
'100%'
,
paddingLeft
:
10
,
paddingRight
:
10
,
backgroundColor
:
'#ffffff'
}
}
>
<
ProTable
<
ProTable
loading=
{
userListLoading
}
loading=
{
userListLoading
}
rowKey=
"id"
rowKey=
"id"
...
...
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