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
accc62a9
Commit
accc62a9
authored
Dec 03, 2020
by
Sixiang_Zzb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户管理详情提示优化
parent
35276b15
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
41 deletions
+58
-41
TableShow.tsx
src/components/TableShow/TableShow.tsx
+4
-3
UsersDetail.tsx
src/pages/UserManagement/LIFEUserManagement/UsersDetail.tsx
+54
-38
No files found.
src/components/TableShow/TableShow.tsx
View file @
accc62a9
...
...
@@ -52,6 +52,7 @@ const TableShow = (props: any) => {
[
'status'
,
'status'
,
(
text
:
number
,
record
:
any
)
=>
<
Space
size=
"middle"
>
{
user_type_status
[
text
]
}
</
Space
>,
],
[
...
...
@@ -71,7 +72,7 @@ const TableShow = (props: any) => {
<
Tabs
defaultActiveKey=
"0"
>
{
dataRow
.
map
((
item
:
any
,
index
:
number
)
=>
{
return
(
<
TabPane
tab=
{
item
.
name
}
key=
{
i
tem
.
id
}
>
<
TabPane
tab=
{
item
.
name
}
key=
{
i
ndex
}
>
<
Row
gutter=
{
16
}
style=
{
{
marginLeft
:
9
}
}
>
<
Col
>
Address:
</
Col
>
<
Col
>
...
...
@@ -86,7 +87,7 @@ const TableShow = (props: any) => {
</
Row
>
{
item
.
unit
.
map
((
unit
:
any
,
uindex
:
any
)
=>
{
return
(
<
div
key=
{
u
nit
.
living
}
>
<
div
key=
{
u
index
}
>
<
Row
gutter=
{
32
}
>
<
Col
span=
{
20
}
>
<
Table
...
...
@@ -114,7 +115,7 @@ const TableShow = (props: any) => {
);
}
}
footer=
{
()
=>
''
}
rowKey=
{
'
ower_name
'
}
rowKey=
{
'
id
'
}
dataSource=
{
unit
.
member
}
columns=
{
key
}
pagination=
{
false
}
...
...
src/pages/UserManagement/LIFEUserManagement/UsersDetail.tsx
View file @
accc62a9
...
...
@@ -50,6 +50,8 @@ const UsersDetail = (props: any) => {
const
formRef
=
useRef
(
null
as
any
);
const
[
loadding
,
setLoadding
]
=
useState
(
false
);
// 提交
const
onFinish
=
(
values
:
any
)
=>
{
if
(
DataSave
!=
null
)
{
...
...
@@ -71,6 +73,7 @@ const UsersDetail = (props: any) => {
}
};
// 监听删除结果
useEffect
(()
=>
{
if
(
Result
!=
null
)
{
console
.
log
(
Result
);
...
...
@@ -82,6 +85,7 @@ const UsersDetail = (props: any) => {
}
},
[
Result
]);
// 监听返回内容
useEffect
(()
=>
{
console
.
log
(
returnValue
);
if
(
returnValue
!=
null
)
{
...
...
@@ -101,6 +105,7 @@ const UsersDetail = (props: any) => {
}
},
[
returnValue
]);
// 监听数据返回
useEffect
(()
=>
{
if
(
DataSave
!=
null
)
{
console
.
log
(
'给予页面数据'
);
...
...
@@ -124,6 +129,7 @@ const UsersDetail = (props: any) => {
}
},
[
DataSave
]);
// 监听数据返回
useEffect
(()
=>
{
if
(
DataSaveDetail
!=
null
)
{
console
.
log
(
'页面数据副歌'
);
...
...
@@ -132,15 +138,18 @@ const UsersDetail = (props: any) => {
}
},
[
DataSaveDetail
]);
// 存储住户详情页的数据
useEffect
(()
=>
{
console
.
log
(
memberDetail
);
if
(
!
memberDetail
)
{
var
tmp
=
{
owerName
:
DataSave
.
owerName
,
owerPhone
:
DataSave
.
owerPhone
,
owerEmail
:
DataSave
.
owerEmail
,
};
formRef
.
current
.
setFieldsValue
(
tmp
);
if
(
DataSave
)
{
if
(
!
memberDetail
)
{
var
tmp
=
{
owerName
:
DataSave
.
owerName
,
owerPhone
:
DataSave
.
owerPhone
,
owerEmail
:
DataSave
.
owerEmail
,
};
formRef
.
current
.
setFieldsValue
(
tmp
);
}
}
},
[
memberDetail
]);
...
...
@@ -151,6 +160,7 @@ const UsersDetail = (props: any) => {
setDataSaveLoading
(
true
);
},
[]);
// 住户详情页
const
tableShowCallback
=
(
values
:
any
)
=>
{
console
.
log
(
'成员信息'
);
console
.
log
(
values
);
...
...
@@ -159,6 +169,7 @@ const UsersDetail = (props: any) => {
setMemberDetail
(
true
);
};
// 删除单元
const
deleteUnit
=
(
values
:
any
)
=>
{
if
(
permissionArr
.
indexOf
(
'5'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
...
...
@@ -186,6 +197,7 @@ const UsersDetail = (props: any) => {
});
};
// 删除住户
const
DeleteMember
=
(
values
:
any
,
e
:
any
)
=>
{
console
.
log
(
values
);
if
(
permissionArr
.
indexOf
(
'7'
)
<
0
)
{
...
...
@@ -201,18 +213,22 @@ const UsersDetail = (props: any) => {
cancelText
:
'Cancel'
,
onCancel
()
{},
onOk
()
{
setLoadding
(
true
);
RA
(
39
,
{
id
:
values
.
id
,
ownerId
:
values
.
owner_id
});
},
});
};
// 返回
const
titleBackCallBack
=
()
=>
{
setMemberDetail
(
false
);
};
// 监听删除住户返回的结果
useEffect
(()
=>
{
if
(
memberResult
!=
null
)
{
setMemberDetail
(
false
);
setLoadding
(
false
);
message
.
success
(
'Successfully delete!!!'
);
RA
(
13
,
{
id
:
DataSave
.
id
,
...
...
@@ -226,6 +242,7 @@ const UsersDetail = (props: any) => {
}
},
[
memberResult
]);
// 编辑手机号码验证
const
checkData
=
(
rule
:
any
,
value
:
any
,
callback
:
any
)
=>
{
if
(
value
)
{
if
(
/^
\d{8}
$|^1
[
3|5|7|8
]\d{9}
$/
.
test
(
value
))
{
...
...
@@ -237,9 +254,6 @@ const UsersDetail = (props: any) => {
callback
(
'*it is required!'
);
};
console
.
log
(
memberDetail
);
console
.
log
(
DataSave
);
return
(
<
div
className=
{
styles
.
base
}
>
<
Spin
spinning=
{
visible
}
tip=
"Loading Submit"
>
...
...
@@ -329,35 +343,37 @@ const UsersDetail = (props: any) => {
</>
)
:
(
<>
<
div
>
<
TitleBack
title=
{
'Family/Tenant Details'
}
url=
"none"
titleBack=
{
titleBackCallBack
}
></
TitleBack
>
<
Row
>
<
Col
span=
{
4
}
>
User Type:
</
Col
>
<
Col
span=
{
4
}
>
{
memberData
.
owner_relationship
!=
null
?
user_status
[
memberData
.
owner_relationship
-
1
][
1
]
:
null
}
</
Col
>
</
Row
>
<
Row
gutter=
{
16
}
>
<
Col
span=
{
4
}
>
User Name:
</
Col
>
<
Col
span=
{
4
}
>
{
memberData
.
owner_family_name
}
</
Col
>
</
Row
>
<
Row
gutter=
{
16
}
>
<
Col
span=
{
4
}
>
Contact Detail:
</
Col
>
<
Col
span=
{
4
}
>
{
memberData
.
owner_family_phone
}
</
Col
>
<
Col
span=
{
4
}
>
{
memberData
.
owner_family_email
}
</
Col
>
</
Row
>
<
Line
></
Line
>
<
Spin
spinning=
{
loadding
}
>
<
div
>
<
TitleBack
title=
{
'Family/Tenant Details'
}
url=
"none"
titleBack=
{
titleBackCallBack
}
></
TitleBack
>
<
Row
>
<
Col
span=
{
4
}
>
User Type:
</
Col
>
<
Col
span=
{
4
}
>
{
memberData
.
owner_relationship
!=
null
?
user_status
[
memberData
.
owner_relationship
-
1
][
1
]
:
null
}
</
Col
>
</
Row
>
<
Row
gutter=
{
16
}
>
<
Col
span=
{
4
}
>
User Name:
</
Col
>
<
Col
span=
{
4
}
>
{
memberData
.
owner_family_name
}
</
Col
>
</
Row
>
<
Row
gutter=
{
16
}
>
<
Col
span=
{
4
}
>
Contact Detail:
</
Col
>
<
Col
span=
{
4
}
>
{
memberData
.
owner_family_phone
}
</
Col
>
<
Col
span=
{
4
}
>
{
memberData
.
owner_family_email
}
</
Col
>
</
Row
>
<
Line
></
Line
>
<
Button
danger
onClick=
{
DeleteMember
.
bind
(
this
,
memberData
)
}
>
Delete
</
Button
>
</
div
>
<
Button
danger
onClick=
{
DeleteMember
.
bind
(
this
,
memberData
)
}
>
Delete
</
Button
>
</
div
>
</
Spin
>
</>
)
}
</
Spin
>
...
...
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