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
1e4738fa
Commit
1e4738fa
authored
Sep 18, 2020
by
maple
Committed by
MrShi
Sep 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fixed]业主模块
(cherry picked from commit
8e27beb5
)
parent
6199bd32
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
193 additions
and
72 deletions
+193
-72
BackButton.tsx
src/components/BackButton/BackButton.tsx
+1
-1
TableShow.tsx
src/components/TableShow/TableShow.tsx
+2
-1
TitleSearch.tsx
src/components/TitleSearch/TitleSearch.tsx
+21
-8
Toast.tsx
src/components/Toast/Toast.tsx
+37
-0
index.tsx
src/components/组件模板 copy/index.tsx
+0
-0
History.ts
src/models/Common/History.ts
+1
-1
User.ts
src/models/CommunityManagement/User.ts
+36
-24
Users.tsx
src/pages/UserManagement/LIFEUserManagement/Users.tsx
+23
-9
UsersDetail.tsx
src/pages/UserManagement/LIFEUserManagement/UsersDetail.tsx
+72
-28
No files found.
src/components/BackButton/BackButton.tsx
View file @
1e4738fa
...
...
@@ -15,7 +15,7 @@ const BackButton = (props:any) => {
const
url
=
props
.
url
;
const
goToReturn
=
()
=>
{
// history.back()
URL
(
history
.
location
.
pathname
,
module2
,
dispatch
)
URL
(
{
pathname
:
history
.
location
.
pathname
,
status
:
0
}
,
module2
,
dispatch
)
console
.
log
(
"这里的地址为"
)
console
.
log
(
history
.
location
.
pathname
)
history
.
go
(
-
1
)
...
...
src/components/TableShow/TableShow.tsx
View file @
1e4738fa
...
...
@@ -5,6 +5,7 @@ const { TabPane } = Tabs
import
{
objectColumns
}
from
'@/utils/string'
;
import
{
size
}
from
'lodash'
;
import
Toast
from
'../Toast/Toast'
;
...
...
@@ -69,7 +70,7 @@ const TableShow = (props:any) => {
<
Row
gutter=
{
32
}
><
Col
>
Unit No:
</
Col
><
Col
>
{
unit
.
living
}
</
Col
></
Row
>
</
div
>
<
div
style=
{
{
position
:
"absolute"
,
right
:
0
,
bottom
:
16
}
}
>
{
props
.
deleteDisable
?
<
Button
type=
"danger"
onClick=
{
deleteUnit
.
bind
(
this
,
unit
.
living
)
}
>
Delete
</
Button
>
:
null
}
{
props
.
deleteDisable
?<
Button
type=
"danger"
onClick=
{
deleteUnit
.
bind
(
this
,
unit
.
living
)
}
>
Delete
</
Button
>
:
null
}
</
div
>
</
div
>
)
...
...
src/components/TitleSearch/TitleSearch.tsx
View file @
1e4738fa
...
...
@@ -16,14 +16,6 @@ const TitleSearch= (props:any) => {
const
{
dispatch
,
CommunityList
}
=
props
;
const
tosCommunityget
=
(
values
:
any
)
=>
{
dispatch
({
type
:
'Init/tosCommunityget'
,
playload
:
values
})};
useEffect
(()
=>
{
if
(
CommunityList
==
null
)
{
tosCommunityget
(
null
)
}
},
[]);
const
key
=
props
.
listkey
const
name
=
props
.
list
;
const
single
=
props
.
single
...
...
@@ -36,6 +28,27 @@ const TitleSearch= (props:any) => {
const
[
communitys
,
setCommunitys
]
=
useState
(
CommunityList
)
const
[
datePicker
,
setDate
]
=
useState
(
null
)
const
tosCommunityget
=
(
values
:
any
)
=>
{
dispatch
({
type
:
'Init/tosCommunityget'
,
playload
:
values
})};
useEffect
(()
=>
{
// console.log("标题搜寻组件初始化") OK
if
(
CommunityList
==
null
)
{
// console.log("小区数量初始化") OK
tosCommunityget
(
null
)
}
},
[]);
useEffect
(()
=>
{
if
(
CommunityList
!=
null
)
{
// console.log("小区数量初始化完毕") OK
var
tmp
=
{}
tmp
[
community
]
=
CommunityList
// props.onSubmit(tmp) 禁用 改用组件初始化
setCommunitys
(
CommunityList
)
}
},[
CommunityList
])
const
onFinish
=
values
=>
{
if
(
datePicker
)
{
...
...
src/components/Toast/Toast.tsx
0 → 100644
View file @
1e4738fa
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
message
,
Button
,
Modal
,}
from
'antd'
;
const
Toast
=
(
props
:
any
)
=>
{
const
{
value
,
onChange
}
=
props
const
[
visible
,
setVisible
]
=
useState
(
false
)
const
showModal
=
()
=>
{
setVisible
(
true
)
}
const
handleOk
=
()
=>
{
setVisible
(
false
)
onChange
()
};
const
handleCancel
=
()
=>
{
setVisible
(
false
)
};
return
(
<>
<
Button
type=
"primary"
onClick=
{
showModal
}
>
Open Modal
</
Button
>
<
Modal
title=
"Basic Modal"
visible=
{
visible
}
onOk=
{
handleOk
}
onCancel=
{
handleCancel
}
>
<
p
>
Some contents...
</
p
>
<
p
>
Some contents...
</
p
>
<
p
>
Some contents...
</
p
>
</
Modal
>
</>
);
};
export
default
Toast
;
src/components/
Toast
/index.tsx
→
src/components/
组件模板 copy
/index.tsx
View file @
1e4738fa
File moved
src/models/Common/History.ts
View file @
1e4738fa
...
...
@@ -30,7 +30,7 @@ export default {
//链接
*
URL
({
playload
},
{
put
})
{
let
history_url
=
playload
;
console
.
log
(
"保存地址"
);
console
.
log
(
"保存地址"
+
JSON
.
stringify
(
playload
)
);
yield
put
({
type
:
'returnURL'
,
history_url
});
},
*
URLCLEAR
({
},
{
put
})
{
...
...
src/models/CommunityManagement/User.ts
View file @
1e4738fa
...
...
@@ -19,7 +19,8 @@ export default {
communityInfo
:
null
,
pageDate
:
null
,
returnValue
:
null
,
returnValue
:
null
,
memberResult
:
null
,
},
reducers
:
{
...
...
@@ -53,7 +54,9 @@ export default {
ReturnValue
(
state
,
{
returnValue
})
{
return
{...
state
,
returnValue
}
},
returnMemberResult
(
state
,
{
memberResult
})
{
return
{...
state
,
memberResult
}
}
},
effects
:
{
...
...
@@ -72,15 +75,12 @@ export default {
let
returnValue
=
null
;
yield
put
({
type
:
'DataSaveDetail'
,
DataSaveDetail
,
returnValue
});
}
break
;
case
16
:
{
console
.
log
(
"等待删除完成"
)
var
returnValue
=
{
test
:
"yes"
};
yield
put
({
type
:
'ReturnValue'
,
returnValue
});
}
break
;
}
const
resp
=
yield
call
(
service
.
RA
,
playload
);
console
.
log
(
resp
)
if
(
resp
.
code
==
500
||
resp
.
error_code
!=
"0000"
)
{
if
(
resp
.
code
==
500
||
resp
.
error_code
!=
"0000"
)
{
// message.error("Server Error,try again,error code:500",3)
// window.location.href = '/500';
}
if
(
resp
.
error_code
!=
"0000"
)
{
...
...
@@ -93,17 +93,22 @@ export default {
Data3Error
=
{
msg
:
"Information Wrong!"
};
yield
put
({
type
:
'returnData3Error'
,
Data3Error
});
}
break
;
case
1
6
:
{
Result
=
resp
;
yield
put
({
type
:
'returnResult'
,
Result
});
case
1
3
:
{
//
history
.
push
(
"/UserManagement/LIFEUserManagement"
)
}
break
;
// 删除失败的案例
// case 16:{
// Result = resp;
// yield put({ type: 'returnResult', Result });
// } break;
}
}
else
{
switch
(
playload
.
index
)
{
case
12
:
{
case
12
:{
let
Data
=
resp
.
data
;
yield
put
({
type
:
'returnPage'
,
Data
});
}
break
;
...
...
@@ -117,15 +122,19 @@ export default {
let
DataSaveDetail
=
resp
.
data
;
yield
put
({
type
:
'DataSaveDetail'
,
DataSaveDetail
});
}
break
;
//
case 16: {
//
console.log("等待删除完成")
//
var returnValue = resp;
//
yield put({ type: 'ReturnValue', returnValue });
//
} break;
case
16
:
{
console
.
log
(
"等待删除完成"
)
var
returnValue
=
resp
;
yield
put
({
type
:
'ReturnValue'
,
returnValue
});
}
break
;
case
32
:
{
let
communityInfo
=
resp
;
yield
put
({
type
:
'returnCommunityInfo'
,
communityInfo
});
}
break
;
case
39
:
{
let
memberResult
=
resp
;
yield
put
({
type
:
'returnMemberResult'
,
memberResult
});
}
break
;
}
}
...
...
@@ -170,7 +179,10 @@ export default {
yield
put
({
type
:
'returnPage'
,
pageDate
})
},
*
MemberResultClear
({
},
{
put
})
{
let
memberResult
=
null
;
yield
put
({
type
:
'returnMemberResult'
,
memberResult
});
},
},
};
src/pages/UserManagement/LIFEUserManagement/Users.tsx
View file @
1e4738fa
...
...
@@ -10,7 +10,7 @@ import TitleSearch from '../../../components/TitleSearch/TitleSearch';
import
{
timestampToTime
}
from
'../../../utils/time'
;
import
{
PAGE
,
RA
,
URLCLEAR
,
getCookie
,
DataClear
}
from
'@/utils/method'
;
import
{
PAGE
,
RA
,
URLCLEAR
,
getCookie
,
DataClear
,
URL
}
from
'@/utils/method'
;
import
PageData
from
'@/models/Common/PageData'
;
const
module
=
"User"
...
...
@@ -105,14 +105,26 @@ const Users = (props:any) => {
useEffect
(()
=>
{
if
(
pageStart
==
false
)
{
if
(
history_url
!=
null
&&
history
.
location
.
pathname
!=
history_url
)
{
console
.
log
(
"来自上层数据"
)
console
.
log
(
location
.
pathname
)
if
(
history_url
!=
null
){
console
.
log
(
history_url
.
pathname
)}
if
(
history_url
!=
null
&&
location
.
pathname
!=
history_url
.
pathname
)
{
console
.
log
(
"来自上层数据"
)
if
(
history_url
.
status
==
0
)
{
console
.
log
(
"更新数据源"
)
var
tmp
=
Data
tmp
.
defaultCurrent
=
pageData
.
defaultCurrent
var
tmp2
=
curString
;
tmp2
.
defaultCurrent
=
pageData
.
defaultCurrent
;
setCurString
(
tmp2
)
var
tmp2
=
curString
;
tmp2
.
defaultCurrent
=
pageData
.
defaultCurrent
;
setCurString
(
tmp2
)
setTestData
(
tmp
)
}
else
{
console
.
log
(
"异变数据源"
)
console
.
log
(
history_url
)
RA
(
12
,
{
ownerName
:
null
,
communityArray
:
CommunityList
},
module
,
dispatch
);
changeValue
(
"loading"
,
true
)
}
// URLCLEAR(module2, dispatch)
}
else
{
var
tmp
=
{
rows
:[],
total
:
0
,
defaultCurrent
:
1
}
...
...
@@ -140,11 +152,13 @@ const Users = (props:any) => {
}
const
goToEdit
=
(
values
:
any
,
e
:
any
)
=>
{
SA
(
values
)
PAGE
(
curString
,
module3
,
dispatch
)
PAGE
(
curString
,
module3
,
dispatch
)
URL
({
pathname
:
location
.
pathname
+
'/Edit'
,
status
:
1
},
module2
,
dispatch
)
history
.
push
(
location
.
pathname
+
'/Edit'
)
}
const
goToAdd
=
()
=>
{
URL
({
pathname
:
location
.
pathname
+
'/Add'
,
status
:
1
},
module2
,
dispatch
)
history
.
push
(
location
.
pathname
+
'/Add'
)
}
...
...
src/pages/UserManagement/LIFEUserManagement/UsersDetail.tsx
View file @
1e4738fa
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Input
,
Tabs
,
Table
,
Space
,
Pagination
,
Tooltip
,
Button
,
Form
,
Row
,
Col
,
message
,
Spin
}
from
'antd'
;
import
{
Input
,
Tabs
,
Modal
,
Space
,
Pagination
,
Tooltip
,
Button
,
Form
,
Row
,
Col
,
message
,
Spin
}
from
'antd'
;
const
{
confirm
}
=
Modal
;
const
{
TabPane
}
=
Tabs
;
import
{
ExclamationCircleOutlined
}
from
'@ant-design/icons'
;
import
{
Link
,
useIntl
,
connect
,
Dispatch
}
from
'umi'
;
import
styles
from
'./UsersAdd.less'
;
import
Line
from
'../../../components/Line/Line'
;
...
...
@@ -15,10 +18,11 @@ import { validateMessages } from '@/utils/params';
const
UsersDetail
=
(
props
:
any
)
=>
{
const
{
dispatch
,
DataSave
,
DataSaveDetail
,
Result
,
returnValue
}
=
props
;
const
{
dispatch
,
DataSave
,
DataSaveDetail
,
Result
,
returnValue
,
memberResult
}
=
props
;
const
RA
=
(
index
:
any
,
values
:
any
)
=>
{
dispatch
({
type
:
'User/RA'
,
playload
:
{
index
:
index
,
body
:
values
}
})
};
const
ResultClear
=
()
=>
{
dispatch
({
type
:
'User/ResultClear'
})
};
const
MemberResultClear
=
()
=>
{
dispatch
({
type
:
'User/MemberResultClear'
})
};
const
[
memberDetail
,
setMemberDetail
]
=
useState
(
false
);
const
[
memberData
,
setMemberData
]
=
useState
(
null
);
...
...
@@ -28,6 +32,7 @@ const UsersDetail = (props:any) => {
const
user_type_status
=
[
"Unregistered"
,
"registered"
,
"Deregistered"
]
const
[
DataSaveLoading
,
setDataSaveLoading
]
=
useState
(
false
);
const
[
visible
,
setVisible
]
=
useState
(
false
)
const
formRef
=
useRef
(
null
);
const
onFinish
=
(
values
:
any
)
=>
{
...
...
@@ -67,10 +72,11 @@ const UsersDetail = (props:any) => {
enable
:
DataSave
.
enable
,
})
}
},[
returnValue
])
},
[
returnValue
])
useEffect
(()
=>
{
if
(
DataSave
!=
null
)
{
console
.
log
(
"页面数据"
)
console
.
log
(
"
给予
页面数据"
)
console
.
log
(
DataSave
)
var
tmp
=
{
owerName
:
DataSave
.
owerName
,
...
...
@@ -111,11 +117,19 @@ const UsersDetail = (props:any) => {
setMemberData
(
values
)
setMemberDetail
(
true
)
}
const
titleBackCallBack
=
()
=>
{
setMemberDetail
(
false
)
}
const
deleteUnit
=
(
values
:
any
)
=>
{
console
.
log
(
values
)
// console.log(values)
confirm
({
title
:
'Are you sure delete this infomation?'
,
icon
:
<
ExclamationCircleOutlined
/>,
content
:
'Please click confirm to delete'
,
okText
:
'Confirm'
,
okType
:
'danger'
,
cancelText
:
'Cancel'
,
onCancel
()
{},
onOk
()
{
if
(
DataSave
!=
null
)
{
//console.log(DataSave)
var
tmp
=
{
...
...
@@ -125,10 +139,32 @@ const UsersDetail = (props:any) => {
}
RA
(
16
,
tmp
);
}
}
const
DeleteMember
=
()
=>
{
},
});
}
const
DeleteMember
=
(
values
:
any
,
e
:
any
)
=>
{
console
.
log
(
values
)
RA
(
39
,
{
id
:
values
.
id
,
ownerId
:
values
.
owner_id
})
}
const
titleBackCallBack
=
()
=>
{
setMemberDetail
(
false
)
}
useEffect
(()
=>
{
if
(
memberResult
!=
null
)
{
setMemberDetail
(
false
)
RA
(
13
,
{
id
:
DataSave
.
id
,
owerName
:
DataSave
.
owerName
,
enable
:
DataSave
.
enable
,
})
MemberResultClear
()
}
},[
memberResult
])
return
(
<
div
className=
{
styles
.
base
}
>
...
...
@@ -142,12 +178,18 @@ const UsersDetail = (props:any) => {
<
div
className=
{
styles
.
box1item1
}
>
Owner's Name
</
div
>
<
div
className=
{
styles
.
box1item2
}
><
Form
.
Item
name=
"owerName"
rules=
{
[{
required
:
true
,
min
:
2
,
max
:
30
}]
}
><
Input
disabled=
{
!
editFlag
}
placeholder=
"Ower Name"
/></
Form
.
Item
></
div
>
</
div
>
{
DataSave
.
enable
==
1
?
<>
<
div
className=
{
styles
.
box4
}
>
<
div
className=
{
styles
.
box4item0
}
>
Contact Details
</
div
>
<
div
className=
{
styles
.
box4item1
}
><
Form
.
Item
name=
"owerPhone"
><
Input
disabled=
{
!
editFlag
}
placeholder=
"Phone Number"
/></
Form
.
Item
></
div
>
<
div
className=
{
styles
.
box4item2
}
><
Form
.
Item
name=
"owerEmail"
rules=
{
[{
required
:
true
,
type
:
"email"
}]
}
><
Input
disabled=
{
!
editFlag
}
placeholder=
"Email"
/></
Form
.
Item
></
div
>
</
div
>
</>
:
null
}
<
Line
/>
<
Spin
spinning=
{
DataSaveLoading
}
tip=
"Loading Detial"
>
{
...
...
@@ -161,6 +203,7 @@ const UsersDetail = (props:any) => {
}
</
Spin
>
</
Form
>
</>:
null
}
...
...
@@ -182,7 +225,7 @@ const UsersDetail = (props:any) => {
<
Col
span=
{
4
}
>
{
memberData
.
ower_email
}
</
Col
>
</
Row
>
<
Line
></
Line
>
<
Button
type=
"danger"
onClick=
{
DeleteMember
}
>
Delete
</
Button
>
<
Button
type=
"danger"
onClick=
{
DeleteMember
.
bind
(
this
,
memberData
)
}
>
Delete
</
Button
>
</
div
>
</>
...
...
@@ -192,13 +235,14 @@ const UsersDetail = (props:any) => {
};
function
mapStateToProps
(
state
:
any
)
{
const
{
DataSave
,
DataSaveDetail
,
Result
,
returnValue
}
=
state
.
User
;
const
{
DataSave
,
DataSaveDetail
,
Result
,
returnValue
,
memberResult
}
=
state
.
User
;
return
{
DataSave
,
DataSaveDetail
,
Result
,
returnValue
,
memberResult
,
};
}
export
default
connect
(
mapStateToProps
)(
UsersDetail
);
...
...
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