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';
import
SearchOptionsTow
from
'./SearchOptionsTow'
;
const
SearchOptionsCommnity
=
(
props
:
any
)
=>
{
const
{
dispatch
,
CommunityList
,
opname
,
defaultName
,
SearchOptionsCommnity
}
=
props
;
const
{
dispatch
,
CommunityList
,
opname
,
defaultName
,
type
}
=
props
;
const
tosCommunityget
=
(
values
:
any
)
=>
{
dispatch
({
type
:
'Init/tosCommunityget'
,
playload
:
values
});
};
...
...
@@ -34,6 +35,7 @@ const SearchOptionsCommnity = (props: any) => {
list
=
{
CommunityList
}
extendName
=
{
extendName
}
def
=
{
defaultName
}
type
=
{
type
}
>
<
/
SearchOptionsTow
>
) : null
}
</>
...
...
src/components/SearchOptions/SearchOptionsTow.tsx
View file @
e23bed6c
...
...
@@ -3,7 +3,8 @@ import { Select } from 'antd';
const
{
Option
}
=
Select
;
const
SearchOptionsTow
=
(
porps
:
any
)
=>
{
const
{
list
,
extendName
,
def
}
=
porps
;
const
{
list
,
extendName
,
def
,
type
}
=
porps
;
const
options
=
list
.
map
((
d
:
any
,
index
:
number
)
=>
(
<
Option
value=
{
d
}
key=
{
index
}
>
{
d
}
...
...
@@ -15,10 +16,12 @@ const SearchOptionsTow = (porps: any) => {
}
return
(
<
div
>
{
type
?
(
<
Select
showSearch
allowClear
mode=
"multiple"
autoClearSearchValue
style=
{
{
width
:
320
}
}
placeholder=
"Community Name"
optionFilterProp=
"children"
...
...
@@ -27,6 +30,19 @@ const SearchOptionsTow = (porps: any) => {
>
{
options
}
</
Select
>
)
:
(
<
Select
showSearch
allowClear
style=
{
{
width
:
200
}
}
placeholder=
"Community Name"
optionFilterProp=
"children"
onChange=
{
onChange
}
defaultValue=
{
def
}
>
{
options
}
</
Select
>
)
}
</
div
>
);
};
...
...
src/pages/CommunityManagement/CommunityAnnouncement/CommunityAnnouncement.tsx
View file @
e23bed6c
...
...
@@ -36,7 +36,6 @@ const CommunityAnnouncement = (props: any) => {
dispatch
({
type
:
module
+
'/returnDataSaveDetail'
,
playload
:
{
DataSaveDetail
:
null
}
});
},
[
1
]);
// 表头
const
columns
=
[
{
...
...
@@ -85,10 +84,20 @@ const CommunityAnnouncement = (props: any) => {
title
:
'Actions'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
Space
size=
"middle"
>
<
Button
type=
"link"
onClick=
{
()
=>
{
goToAdd
(
1
,
record
);}
}
>
<
Button
type=
"link"
onClick=
{
()
=>
{
goToAdd
(
1
,
record
);
}
}
>
Edit
</
Button
>
<
Button
type=
"link"
onClick=
{
()
=>
{
goToAdd
(
2
,
record
);}
}
>
<
Button
type=
"link"
onClick=
{
()
=>
{
goToAdd
(
2
,
record
);
}
}
>
Detail
</
Button
>
</
Space
>
...
...
@@ -100,11 +109,11 @@ const CommunityAnnouncement = (props: any) => {
const
DetailPage
=
(
page
:
any
)
=>
{
let
data
=
{
Method
:
'returnDataSaveDetail'
,
DefaultName
:
"DataSaveDetail"
,
Data
:
page
DefaultName
:
'DataSaveDetail'
,
Data
:
page
,
};
return
data
;
}
}
;
// 分页数据一改变就发起请求
useEffect
(()
=>
{
...
...
@@ -122,16 +131,15 @@ const CommunityAnnouncement = (props: any) => {
function
goToAdd
(
num
:
any
,
record
:
any
)
{
if
(
num
==
0
)
{
history
.
push
(
'./CommunityAnnouncement/Add'
);
}
else
if
(
num
==
1
)
{
}
else
if
(
num
==
1
)
{
// 传递列表信息
dispatch
({
type
:
module
+
'/returnDataSave'
,
playload
:
{
DataSave
:
record
}
});
history
.
push
(
'./CommunityAnnouncement/Edit'
);
}
else
if
(
num
==
2
)
{
}
else
if
(
num
==
2
)
{
// 传递列表信息
dispatch
({
type
:
module
+
'/returnDataSave'
,
playload
:
{
DataSave
:
record
}
});
history
.
push
(
'./CommunityAnnouncement/Detail'
);
}
}
const
[
form
]
=
Form
.
useForm
();
...
...
@@ -145,21 +153,21 @@ const CommunityAnnouncement = (props: any) => {
pageNum
:
1
,
};
// 把内容存进去
SA
(
DetailPage
(
page
),
module
,
dispatch
)
SA
(
DetailPage
(
page
),
module
,
dispatch
)
;
};
// 表单提交
const
onFinishContract
=
(
value
:
any
)
=>
{
console
.
log
(
value
)
console
.
log
(
value
)
;
if
(
!
value
.
communityNumList
&&
!
value
.
noticTitlel
&&
!
value
.
creator
)
{
message
.
error
(
'Please enter one of them!'
);
}
else
{
// 要看是哪里分页
let
mlist
=
{
...
value
}
mlist
.
communityNumList
=
value
.
communityNumList
let
mlist
=
{
...
value
}
;
mlist
.
communityNumList
=
value
.
communityNumList
;
mlist
.
pageNum
=
1
;
// 把内容存进去
SA
(
DetailPage
(
mlist
),
module
,
dispatch
)
SA
(
DetailPage
(
mlist
),
module
,
dispatch
)
;
// requst(payload);
}
};
...
...
@@ -174,10 +182,10 @@ const CommunityAnnouncement = (props: any) => {
// 页面切换
const
paginationHandler
=
(
page
:
number
,
pageSize
?:
number
)
=>
{
// 要看是哪里分页
let
mlist
=
{
...
DataSaveDetail
}
let
mlist
=
{
...
DataSaveDetail
}
;
mlist
.
pageNum
=
page
;
// 把内容存进去
SA
(
DetailPage
(
mlist
),
module
,
dispatch
)
SA
(
DetailPage
(
mlist
),
module
,
dispatch
)
;
};
return
(
...
...
@@ -194,6 +202,7 @@ const CommunityAnnouncement = (props: any) => {
<
SearchOptionsCommnity
// ubmit={extendName}
opname=
{
opname
}
type=
{
1
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"noticTitlel"
>
...
...
@@ -225,7 +234,6 @@ const CommunityAnnouncement = (props: any) => {
</
Form
>
</
div
>
<
div
style=
{
{
width
:
'100%'
,
paddingLeft
:
10
,
paddingRight
:
10
,
backgroundColor
:
'#ffffff'
}
}
>
<
ProTable
loading=
{
userListLoading
}
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