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
6199bd32
Commit
6199bd32
authored
Sep 18, 2020
by
maple
Committed by
MrShi
Sep 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix]用户模块
(cherry picked from commit
28f9a4cf
)
parent
b885a868
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
332 additions
and
180 deletions
+332
-180
config.ts
config/config.ts
+3
-0
TableShow.tsx
src/components/TableShow/TableShow.tsx
+2
-2
User.ts
src/models/CommunityManagement/User.ts
+31
-8
login.ts
src/models/login.ts
+2
-1
ResultPage.tsx
src/pages/UserManagement/LIFEUserManagement/ResultPage.tsx
+54
-0
ResultPageFailed.tsx
...es/UserManagement/LIFEUserManagement/ResultPageFailed.tsx
+39
-0
UserMemberDetail.tsx
...es/UserManagement/LIFEUserManagement/UserMemberDetail.tsx
+25
-0
Users.tsx
src/pages/UserManagement/LIFEUserManagement/Users.tsx
+95
-111
UsersDetail.tsx
src/pages/UserManagement/LIFEUserManagement/UsersDetail.tsx
+71
-52
Template.tsx
src/pages/runTest/Template.tsx
+1
-1
tos.ts
src/services/tos.ts
+5
-1
method.ts
src/utils/method.ts
+1
-1
params.ts
src/utils/params.ts
+3
-3
No files found.
config/config.ts
View file @
6199bd32
...
...
@@ -87,7 +87,10 @@ export default defineConfig({
{
path
:
'./'
,
component
:
'./UserManagement/LIFEUserManagement/Users'
},
{
path
:
'./Add'
,
component
:
'./UserManagement/LIFEUserManagement/UsersAdd'
},
{
path
:
'./Detail'
,
component
:
'./UserManagement/LIFEUserManagement/UsersDetail'
},
{
path
:
'./MemberDetail'
,
component
:
'./UserManagement/LIFEUserManagement/UserMemberDetail'
},
{
path
:
'./Edit'
,
component
:
'./UserManagement/LIFEUserManagement/UsersDetail'
},
{
path
:
'./Result'
,
component
:
'./UserManagement/LIFEUserManagement/ResultPage'
},
{
path
:
'./ResultFailed'
,
component
:
'./UserManagement/LIFEUserManagement/ResultPageFailed'
},
]
},
{
...
...
src/components/TableShow/TableShow.tsx
View file @
6199bd32
...
...
@@ -55,7 +55,7 @@ const TableShow = (props:any) => {
dataRow
.
map
((
item
,
index
)
=>
{
return
(
<
TabPane
tab=
{
item
.
name
}
key=
{
index
}
>
<
Row
gutter=
{
16
}
><
Col
>
Address:
</
Col
><
Col
>
{
((
item
.
unit
)[
0
].
member
)[
0
]
.
address_and_postalCode
}
</
Col
></
Row
>
<
Row
gutter=
{
16
}
><
Col
>
Address:
</
Col
><
Col
>
{
((
item
).
owner
)
.
address_and_postalCode
}
</
Col
></
Row
>
{
(
item
.
unit
).
map
((
unit
:
any
,
uindex
:
any
)
=>
{
return
(
...
...
@@ -79,7 +79,7 @@ const TableShow = (props:any) => {
<
Row
>
<
img
width=
{
80
}
src=
{
unit
.
imgUrl
}
/>
</
Row
>
<
Row
style=
{
{
marginTop
:
8
}
}
><
div
style=
{
{
width
:
80
,
textAlign
:
"center"
}
}
>
{
((
item
.
unit
)[
0
].
member
)[
0
].
cdk_code
}
(
{
user_code
[((
item
.
unit
)[
0
].
member
)[
0
].
cdk_s
tatus
]
}
)
</
div
></
Row
>
<
Row
style=
{
{
marginTop
:
8
}
}
><
div
style=
{
{
width
:
80
,
textAlign
:
"center"
}
}
>
{
item
.
owner
.
cdkCode
}
(
{
user_code
[
item
.
owner
.
cdkS
tatus
]
}
)
</
div
></
Row
>
</
Col
>
</
Row
>
...
...
src/models/CommunityManagement/User.ts
View file @
6199bd32
...
...
@@ -17,7 +17,9 @@ export default {
curString
:
{
subscribeDate
:
null
,
status
:
null
,
curPage
:
1
,
curPage2
:
1
},
communityInfo
:
null
,
pageDate
:
null
,
pageDate
:
null
,
returnValue
:
null
,
},
reducers
:
{
...
...
@@ -30,8 +32,8 @@ export default {
returnDataSave
(
state
,
{
DataSave
})
{
return
{
...
state
,
DataSave
};
},
DataSaveDetail
(
state
,
{
DataSaveDetail
,})
{
return
{
...
state
,
DataSaveDetail
};
DataSaveDetail
(
state
,
{
DataSaveDetail
,
returnValue
})
{
return
{
...
state
,
DataSaveDetail
,
returnValue
};
},
returnSource
(
state
,
{
sourceData
})
{
return
{
...
state
,
sourceData
};
...
...
@@ -47,8 +49,10 @@ export default {
},
PageDate
(
state
,
{
pageDate
})
{
return
{...
state
,
pageDate
}
}
},
ReturnValue
(
state
,
{
returnValue
})
{
return
{...
state
,
returnValue
}
},
},
...
...
@@ -63,6 +67,16 @@ export default {
let
Data
=
null
;
yield
put
({
type
:
'returnPage'
,
Data
});
}
break
;
case
13
:
{
let
DataSaveDetail
=
null
;
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
)
...
...
@@ -103,9 +117,11 @@ export default {
let
DataSaveDetail
=
resp
.
data
;
yield
put
({
type
:
'DataSaveDetail'
,
DataSaveDetail
});
}
break
;
case
16
:
{
console
.
log
(
"等待删除完成"
)
}
break
;
// case 16: {
// console.log("等待删除完成")
// var returnValue = resp;
// yield put({ type: 'ReturnValue', returnValue });
// } break;
case
32
:
{
let
communityInfo
=
resp
;
yield
put
({
type
:
'returnCommunityInfo'
,
communityInfo
});
...
...
@@ -148,6 +164,13 @@ export default {
var
pageDate
=
playload
yield
put
({
type
:
'PageDate'
,
pageDate
})
},
*
DataClear
({
},
{
put
})
{
var
pageDate
=
null
yield
put
({
type
:
'returnPage'
,
pageDate
})
},
},
};
src/models/login.ts
View file @
6199bd32
...
...
@@ -71,7 +71,8 @@ const Model: LoginModelType = {
// tosUserName: "admin"
// tosUserPhone: "18818881888"
setCookie
(
"name"
,
response
.
token
.
tosUserName
)
setCookie
(
"phone"
,
response
.
token
.
tosUserPhone
)
setCookie
(
"phone"
,
response
.
token
.
tosUserPhone
)
setCookie
(
"id"
,
response
.
token
.
id
)
console
.
log
(
"获取到Token:"
+
getCookie
(
"token"
))
yield
put
({
type
:
'saveToken'
,
token
:
userMessage
.
token
,
userName
:
payload
.
userName
,
password
:
payload
.
password
});
const
urlParams
=
new
URL
(
window
.
location
.
href
);
...
...
src/pages/UserManagement/LIFEUserManagement/ResultPage.tsx
0 → 100644
View file @
6199bd32
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Input
,
Tabs
,
Table
,
Result
,
Button
}
from
'antd'
;
const
{
TabPane
}
=
Tabs
;
import
{
connect
,
history
}
from
'umi'
;
import
{
RA
}
from
'@/utils/method'
;
const
module
=
"User"
const
ResultPage
=
(
props
:
any
)
=>
{
const
{
dispatch
,
Data
}
=
props
;
const
formRef
=
useRef
(
null
)
const
[
resultTime
,
setResultTime
]
=
useState
(
3
);
function
loop
(
i
:
number
)
{
if
(
i
<
4
)
{
console
.
log
(
i
)
setResultTime
(
4
-
i
)
setTimeout
(
function
(){
loop
(
++
i
)},
1000
)
}
else
{
setResultTime
(
0
)
history
.
go
(
-
1
)
}
}
useEffect
(()
=>
{
loop
(
1
)
},[])
const
backPage
=
()
=>
{
}
return
(
<
div
style=
{
{
width
:
"100%"
,
minWidth
:
1020
,
padding
:
34
,
backgroundColor
:
"#ffffff"
}
}
>
<
Result
status=
"success"
title=
"Successfully submit the file!"
subTitle=
{
<
p
>
server has been handled it ,Wait for
<
strong
>
{
resultTime
}
</
strong
>
seconds to return automatically.
</
p
>
}
extra=
{
[
<
Button
type=
"primary"
key=
"ok"
onClick=
{
backPage
}
>
Ok
</
Button
>,
<
Button
key=
"back"
onClick=
{
backPage
}
>
Back
</
Button
>
]
}
/>
</
div
>
);
};
function
map
(
state
:
any
)
{
const
{
Data
}
=
state
[
module
]
return
{
Data
}
}
export
default
connect
(
map
)(
ResultPage
);
\ No newline at end of file
src/pages/UserManagement/LIFEUserManagement/ResultPageFailed.tsx
0 → 100644
View file @
6199bd32
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Input
,
Tabs
,
Table
,
Result
,
Button
}
from
'antd'
;
const
{
TabPane
}
=
Tabs
;
import
{
connect
,
history
}
from
'umi'
;
import
{
RA
}
from
'@/utils/method'
;
const
module
=
"User"
const
ResultPageFailed
=
(
props
:
any
)
=>
{
const
{
dispatch
,
Data
}
=
props
;
const
formRef
=
useRef
(
null
)
const
[
resultTime
,
setResultTime
]
=
useState
(
3
);
const
backPage
=
()
=>
{
history
.
go
(
-
1
)
}
return
(
<
div
style=
{
{
width
:
"100%"
,
minWidth
:
1020
,
padding
:
34
,
backgroundColor
:
"#ffffff"
}
}
>
<
Result
status=
"error"
title=
"Error submit the file!"
subTitle=
{
<
p
>
server has been handled it ,please try again or back.
</
p
>
}
extra=
{
[
<
Button
type=
"primary"
key=
"ok"
><
a
href=
"http://47.74.233.180:8651/tos/excel/down?operator_id=123456"
>
Download
</
a
></
Button
>,
<
Button
key=
"back"
onClick=
{
backPage
}
>
Back
</
Button
>
]
}
/>
</
div
>
);
};
function
map
(
state
:
any
)
{
const
{
Data
}
=
state
[
module
]
return
{
Data
}
}
export
default
connect
(
map
)(
ResultPageFailed
);
\ No newline at end of file
src/pages/UserManagement/LIFEUserManagement/UserMemberDetail.tsx
0 → 100644
View file @
6199bd32
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Input
,
Tabs
,
Table
,
Space
,
Button
}
from
'antd'
;
const
{
TabPane
}
=
Tabs
;
import
{
connect
,
history
}
from
'umi'
;
import
{
RA
}
from
'@/utils/method'
;
const
module
=
"User"
const
UserMemberDetail
=
(
props
:
any
)
=>
{
const
{
dispatch
,
Data
}
=
props
;
const
formRef
=
useRef
(
null
)
return
(
<
div
style=
{
{
width
:
"100%"
,
minWidth
:
1020
,
padding
:
34
,
backgroundColor
:
"#ffffff"
}
}
>
</
div
>
);
};
function
map
(
state
:
any
)
{
const
{
Data
}
=
state
[
module
]
return
{
Data
}
}
export
default
connect
(
map
)(
UserMemberDetail
);
\ No newline at end of file
src/pages/UserManagement/LIFEUserManagement/Users.tsx
View file @
6199bd32
...
...
@@ -10,7 +10,7 @@ import TitleSearch from '../../../components/TitleSearch/TitleSearch';
import
{
timestampToTime
}
from
'../../../utils/time'
;
import
{
PAGE
,
RA
,
URLCLEAR
}
from
'@/utils/method'
;
import
{
PAGE
,
RA
,
URLCLEAR
,
getCookie
,
DataClear
}
from
'@/utils/method'
;
import
PageData
from
'@/models/Common/PageData'
;
const
module
=
"User"
...
...
@@ -37,98 +37,110 @@ const Users = (props:any) => {
// const string2mean = [[0, "未注册"], [1, "注册"], [2, "注销"]]
const
string2mean
=
[[
0
,
"Unregistered"
],[
1
,
"Registered"
],
[
2
,
"Deregistered"
]]
const
[
curString
,
setCurString
]
=
useState
(
null
)
const
[
curString
,
setCurString
]
=
useState
({
defaultCurrent
:
1
})
const
[
compent
,
setCompent
]
=
useState
({
loading
:
false
,
fileUploading
:
false
})
const
[
TestData
,
setTestData
]
=
useState
(
null
)
//{ rows: [], total:0,defaultCurrent:1 }
const
[
pageStart
,
setPageStart
]
=
useState
(
false
)
const
columns
=
[
{
title
:
username
,
dataIndex
:
'owerName'
,
},
{
title
:
project
,
dataIndex
:
'communityName'
,},
{
title
:
unit
,
render
:(
text
:
any
,
record
:
any
)
=>
(<
div
>
{
record
.
buildingNumber
+
"#"
+
record
.
floorNumber
+
"—"
+
record
.
roomNumber
}
</
div
>)},
{
title
:
status
,
dataIndex
:
'enable'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(<
div
>
{
string2mean
[
text
][
1
]
}
</
div
>)},
{
title
:
submissionTime
,
render
:(
text
:
any
,
record
:
any
)
=>
(<
div
>
{
timestampToTime
(
record
.
createTime
.
time
)
}
</
div
>)},
{
title
:
actions
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
Space
size=
"middle"
>
<
a
onClick=
{
goToEdit
.
bind
(
this
,
record
)
}
disabled=
{
record
.
enable
==
2
?
true
:
false
}
>
Edit
</
a
>
<
a
onClick=
{
goToDetail
.
bind
(
this
,
record
)
}
>
Detail
</
a
>
</
Space
>
),
},
];
const
[
fileUpload
,
setFileUpload
]
=
useState
(
false
);
const
[
fileUploading
,
setFileUploading
]
=
useState
(
false
)
const
[
resultTime
,
setResultTime
]
=
useState
(
3
);
const
changeValue
=
(
key
:
any
,
value
:
any
)
=>
{
var
tmp
=
compent
;
tmp
[
key
]
=
value
;
setCompent
(
tmp
)
}
// 上传的模块
const
propsUpload
=
{
name
:
'file'
,
action
:
'http://47.74.233.180:8651/tos/excel/upload?userId=369'
,
action
:
()
=>
{
return
"http://47.74.233.180:8651/tos/excel/upload?userId="
+
getCookie
(
"id"
)}
,
onChange
(
info
)
{
if
(
info
.
file
.
status
==
'uploading'
)
{
setFileUploading
(
true
)
// console.log(info.file, info.fileList);
changeValue
(
"fileUploading"
,
true
)
}
if
(
info
.
file
.
status
===
'done'
)
{
setFileUpload
(
true
)
setFileUploading
(
false
)
// message.success(`${info.file.name} file uploaded successfully`);
if
(
info
.
file
.
status
===
'done'
)
{
if
(
info
.
file
.
response
.
data
.
error_code
==
"0000"
)
{
history
.
push
(
location
.
pathname
+
"/Result"
)
}
else
{
history
.
push
(
location
.
pathname
+
"/ResultFailed"
)
message
.
error
(
`
${
info
.
file
.
name
}
file upload failed.`
);
changeValue
(
"fileUploading"
,
false
)
}
}
else
if
(
info
.
file
.
status
===
'error'
)
{
message
.
error
(
`
${
info
.
file
.
name
}
file upload failed.`
);
setFileUploading
(
false
)
changeValue
(
"fileUploading"
,
false
)
}
},
showUploadList
:
false
,
}
useEffect
(()
=>
{
if
(
fileUpload
)
{
var
index
=
2
var
timer
=
setInterval
(()
=>
{
setResultTime
(
index
)
index
--
if
(
index
==
-
1
)
{
setFileUpload
(
false
)
setResultTime
(
3
)
clearInterval
(
timer
)
}
},
1000
)
}
},
[
fileUpload
])
const
backPage
=
()
=>
{
setFileUpload
(
false
)
setResultTime
(
3
)
}
useEffect
(()
=>
{
if
(
CommunityList
!=
null
)
{
console
.
log
(
"小组件开始请求"
)
RA
(
12
,
{
ownerName
:
null
,
communityArray
:
CommunityList
},
module
,
dispatch
);
}
},
[
CommunityList
])
// useEffect(() => {
// if (CommunityList != null) {
// console.log("小组件开始请求")
// if (pageData != null) {
// console.log(pageData)
// }
// RA(12, {
// ownerName: pageData != null?pageData.search.name:null,
// communityArray: pageData != null?pageData.search.cell:CommunityList
// }, module, dispatch);
// }
// }, [CommunityList])
useEffect
(()
=>
{
if
(
Data
!=
null
)
{
var
tmp
=
{
serach
:
{
name
:
null
,
cell
:
null
},
defaultCurrent
:
1
,
total
:
0
}
if
(
pageStart
==
false
)
{
if
(
history_url
!=
null
&&
history
.
location
.
pathname
!=
history_url
)
{
console
.
log
(
"旧页面"
);
console
.
log
(
history_url
)
console
.
log
(
history
.
location
.
pathname
)
console
.
log
(
pageData
)
tmp
.
defaultCurrent
=
pageData
.
defaultCurrent
;
}
else
{
console
.
log
(
"新页面"
)
}
tmp
.
total
=
Data
.
total
setCurString
(
tmp
)
console
.
log
(
tmp
)
URLCLEAR
(
module2
,
dispatch
)
console
.
log
(
"来自上层数据"
)
var
tmp
=
Data
tmp
.
defaultCurrent
=
pageData
.
defaultCurrent
var
tmp2
=
curString
;
tmp2
.
defaultCurrent
=
pageData
.
defaultCurrent
;
setCurString
(
tmp2
)
setTestData
(
tmp
)
// URLCLEAR(module2, dispatch)
}
else
{
var
tmp
=
{
rows
:[],
total
:
0
,
defaultCurrent
:
1
}
setTestData
(
tmp
)
}
}
if
(
pageStart
==
true
)
{
if
(
Data
!=
null
)
{
console
.
log
(
"可以接受值2"
)
console
.
log
(
Data
)
changeValue
(
"loading"
,
false
)
setTestData
(
Data
)
}
}
},
[
Data
])
useEffect
(()
=>
{
setPageStart
(
true
)
},[])
const
goToDetail
=
(
values
:
any
,
e
:
any
)
=>
{
SA
(
values
)
console
.
log
(
"保存页面参数"
)
console
.
log
(
curString
)
PAGE
(
curString
,
module3
,
dispatch
)
PAGE
(
curString
,
module3
,
dispatch
)
//保存页面参数
history
.
push
(
location
.
pathname
+
'/Detail'
)
}
const
goToEdit
=
(
values
:
any
,
e
:
any
)
=>
{
SA
(
values
)
PAGE
(
curString
,
module3
,
dispatch
)
history
.
push
(
location
.
pathname
+
'/Edit'
)
}
...
...
@@ -136,80 +148,52 @@ const Users = (props:any) => {
history
.
push
(
location
.
pathname
+
'/Add'
)
}
const
columns
=
[
{
title
:
username
,
dataIndex
:
'owerName'
,
},
{
title
:
project
,
dataIndex
:
'communityName'
,},
{
title
:
unit
,
render
:(
text
:
any
,
record
:
any
)
=>
(<
div
>
{
record
.
buildingNumber
+
"#"
+
record
.
floorNumber
+
"—"
+
record
.
roomNumber
}
</
div
>)},
{
title
:
status
,
dataIndex
:
'enable'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(<
div
>
{
string2mean
[
text
][
1
]
}
</
div
>)},
{
title
:
submissionTime
,
render
:(
text
:
any
,
record
:
any
)
=>
(<
div
>
{
timestampToTime
(
record
.
createTime
.
time
)
}
</
div
>)},
{
title
:
actions
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
Space
size=
"middle"
>
<
a
onClick=
{
goToEdit
.
bind
(
this
,
record
)
}
disabled=
{
record
.
enable
==
2
?
true
:
false
}
>
Edit
</
a
>
<
a
onClick=
{
goToDetail
.
bind
(
this
,
record
)
}
>
Detail
</
a
>
</
Space
>
),
},
];
const
CallBackTitleSearch
=
(
comment
:
any
)
=>
{
console
.
log
(
comment
)
var
tmp
=
curString
tmp
.
total
=
0
tmp
.
serach
.
name
=
comment
.
OwnerName
tmp
.
serach
.
cell
=
comment
.
serviceCommunityList
setCurString
(
tmp
)
RA
(
12
,
{
ownerName
:
comment
.
OwnerName
,
communityArray
:
comment
.
serviceCommunityList
},
module
,
dispatch
);
}
},
module
,
dispatch
);
changeValue
(
"loading"
,
true
)
const
pageChange
=
(
values
:
any
)
=>
{
var
tmp
=
curString
tmp
.
defaultCurrent
=
values
.
current
setCurString
(
tmp
)
}
const
pageChange
=
(
values
:
any
)
=>
{
var
tmp
=
curString
;
tmp
.
defaultCurrent
=
values
.
current
;
setCurString
(
tmp
)
}
return
(
<
div
className=
{
styles
.
base
}
>
{
/* 头部组件 */
}
{
fileUpload
!=
true
?
<>
<
TitleSearch
listkey=
{
[
"OwnerName"
]
}
list=
{
[
"Owner Name"
]
}
community=
{
"serviceCommunityList"
}
onSubmit=
{
CallBackTitleSearch
}
/>
<
TitleSearch
listkey=
{
[
"OwnerName"
]
}
list=
{
[
"Owner Name"
]
}
community=
{
"serviceCommunityList"
}
onSubmit=
{
CallBackTitleSearch
}
/>
{
/* 内容组件 */
}
<
div
className=
{
styles
.
box2
}
>
<
button
className=
{
styles
.
buttonAdd2
}
onClick=
{
goToAdd
}
>
Create New Owner
</
button
>
<
div
className=
{
styles
.
buttonAdd
}
>
<
Upload
{
...
propsUpload
}
>
<
Button
icon=
{
fileUploading
?
null
:<
UploadOutlined
/>
}
>
{
fileUploading
?<><
Spin
indicator=
{
<
LoadingOutlined
style=
{
{
fontSize
:
16
}
}
spin
/>
}
/>
Uploading
</>:
"Batch Upload"
}
</
Button
>
<
Button
icon=
{
compent
.
fileUploading
?
null
:<
UploadOutlined
/>
}
>
{
compent
.
fileUploading
?<><
Spin
indicator=
{
<
LoadingOutlined
style=
{
{
fontSize
:
16
}
}
spin
/>
}
/>
Uploading
</>:
"Batch Upload"
}
</
Button
>
</
Upload
>
</
div
>
</
div
>
{
/* 列表组件 */
}
<
Spin
spinning=
{
compent
.
loading
}
>
{
Data
!=
null
?
<
Table
rowKey=
{
"id"
}
style=
{
{
marginTop
:
16
}
}
dataSource=
{
Data
.
rows
}
columns=
{
columns
}
pagination=
{
curString
}
onChange=
{
pageChange
}
/>
TestData
!=
null
?
<>
<
Table
rowKey=
{
"id"
}
style=
{
{
marginTop
:
16
}
}
dataSource=
{
TestData
.
rows
}
columns=
{
columns
}
pagination=
{
TestData
}
onChange=
{
pageChange
}
/>
</>
:
null
}
</>
:
<
Result
status=
"success"
title=
"Successfully submit the file!"
subTitle=
{
<
p
>
server has been handled it ,Wait for
<
strong
>
{
resultTime
}
</
strong
>
seconds to return automatically.
</
p
>
}
extra=
{
[
<
Button
type=
"primary"
key=
"ok"
onClick=
{
backPage
}
>
Ok
</
Button
>,
<
Button
key=
"back"
onClick=
{
backPage
}
>
Back
</
Button
>
]
}
/>
}
</
Spin
>
</
div
>
);
...
...
src/pages/UserManagement/LIFEUserManagement/UsersDetail.tsx
View file @
6199bd32
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Input
,
Tabs
,
Table
,
Space
,
Pagination
,
Tooltip
,
Button
,
Form
,
Row
,
Col
,
message
}
from
'antd'
;
import
{
Input
,
Tabs
,
Table
,
Space
,
Pagination
,
Tooltip
,
Button
,
Form
,
Row
,
Col
,
message
,
Spin
}
from
'antd'
;
const
{
TabPane
}
=
Tabs
;
import
{
Link
,
useIntl
,
connect
,
Dispatch
}
from
'umi'
;
import
styles
from
'./UsersAdd.less'
;
...
...
@@ -11,25 +11,29 @@ import { checkParam } from '../../../utils/method'
import
TableShow
from
'@/components/TableShow/TableShow'
;
import
{
values
,
fromPairs
}
from
'lodash'
;
import
{
timestampToTime
}
from
'@/utils/time'
;
import
{
validateMessages
}
from
'@/utils/params'
;
const
UsersDetail
=
(
props
:
any
)
=>
{
const
{
dispatch
,
DataSave
,
DataSaveDetail
,
Result
}
=
props
;
const
{
dispatch
,
DataSave
,
DataSaveDetail
,
Result
,
returnValue
}
=
props
;
const
RA
=
(
index
:
any
,
values
:
any
)
=>
{
dispatch
({
type
:
'User/RA'
,
playload
:
{
index
:
index
,
body
:
values
}
})
};
const
ResultClear
=
()
=>
{
dispatch
({
type
:
'User/ResultClear'
})
};
const
[
postman
,
setPostman
]
=
useState
({
extend
:
null
,
tab
:
1
})
const
[
memberDetail
,
setMemberDetail
]
=
useState
(
false
);
const
[
memberData
,
setMemberData
]
=
useState
(
null
);
const
[
editFlag
,
setEditFlag
]
=
useState
(
false
)
const
user_status
=
[[
1
,
"家属"
],
[
2
,
"租户"
]]
const
user_type_status
=
[
"
Registered"
,
"Unregistered"
,
"Cancellation
"
]
const
user_type_status
=
[
"
Unregistered"
,
"registered"
,
"Deregistered
"
]
const
[
DataSaveLoading
,
setDataSaveLoading
]
=
useState
(
false
);
const
formRef
=
useRef
(
null
);
const
onFinish
=
(
values
:
any
)
=>
{
if
(
DataSave
!=
null
)
{
values
.
id
=
DataSave
.
id
values
.
id
=
DataSave
.
id
values
.
enable
=
DataSave
.
enable
}
else
{
values
.
id
=
null
}
...
...
@@ -38,7 +42,7 @@ const UsersDetail = (props:any) => {
console
.
log
(
"添加业主提交的参数:"
+
tmp
.
length
)
console
.
log
(
values
)
if
(
checkParam
(
values
))
{
RA
(
18
,
values
)
RA
(
18
,
values
)
}
else
{
message
.
error
(
"Error,Please finish it,not empty!"
,
3
)
}
...
...
@@ -52,7 +56,18 @@ const UsersDetail = (props:any) => {
ResultClear
()
}
}
},[
Result
])
},
[
Result
])
useEffect
(()
=>
{
if
(
returnValue
!=
null
)
{
message
.
success
(
"Delete Successfully!"
)
RA
(
13
,
{
id
:
DataSave
.
id
,
owerName
:
DataSave
.
owerName
,
enable
:
DataSave
.
enable
,
})
}
},[
returnValue
])
useEffect
(()
=>
{
if
(
DataSave
!=
null
)
{
console
.
log
(
"页面数据"
)
...
...
@@ -62,39 +77,34 @@ const UsersDetail = (props:any) => {
owerPhone
:
DataSave
.
owerPhone
,
owerEmail
:
DataSave
.
owerEmail
}
formRef
.
current
.
setFieldsValue
(
tmp
)
formRef
.
current
.
setFieldsValue
(
tmp
)
RA
(
13
,
{
ownerId
:
DataSave
.
id
,
owerName
:
DataSave
.
owerName
,
id
:
DataSave
.
id
,
owerName
:
DataSave
.
owerName
,
enable
:
DataSave
.
enable
,
})
}
else
{
history
.
go
(
-
1
)
}
},
[
DataSave
])
useEffect
(()
=>
{
if
(
DataSaveDetail
!=
null
)
{
console
.
log
(
"页面数据副歌"
)
console
.
log
(
DataSaveDetail
)
}
if
(
DataSaveDetail
!=
null
)
{
console
.
log
(
"页面数据副歌"
)
console
.
log
(
DataSaveDetail
)
setDataSaveLoading
(
false
)
}
},
[
DataSaveDetail
])
useEffect
(()
=>
{
if
((
location
.
pathname
).
indexOf
(
"Edit"
)
>
-
1
)
{
setEditFlag
(
true
)
setEditFlag
(
true
)
}
setDataSaveLoading
(
true
)
},
[])
const
extendName
=
(
values
:
any
)
=>
{
var
tmp
=
postman
tmp
.
extend
=
values
setPostman
(
tmp
)
}
const
checkInput
=
(
e
:
any
)
=>
{
console
.
log
(
e
)
if
(
e
.
target
.
value
.
length
==
1
)
{
message
.
error
(
"Ower Name Should be limit 2~30!"
,
3
)
}
}
const
tableShowCallback
=
(
values
:
any
)
=>
{
console
.
log
(
"成员信息"
)
console
.
log
(
values
)
...
...
@@ -123,30 +133,37 @@ const UsersDetail = (props:any) => {
<
div
className=
{
styles
.
base
}
>
{
memberDetail
==
false
?
<>
<
TitleBack
sublist=
{
[
'Status : '
+
user_type_status
[
DataSave
.
enable
],
'Create Time : '
+
timestampToTime
(
DataSave
.
createTime
.
time
)]
}
title=
{
editFlag
?
"Edit Owner Infomation"
:
"Owner Detail"
}
/>
<
Form
ref=
{
formRef
}
name=
"basic"
onFinish=
{
onFinish
}
>
<
div
className=
{
styles
.
box1
}
>
<
div
className=
{
styles
.
box1item1
}
>
Owner's Name
</
div
>
<
div
className=
{
styles
.
box1item2
}
><
Form
.
Item
name=
"owerName"
><
Input
disabled=
{
!
editFlag
}
placeholder=
"Ower Name"
onBlur=
{
checkInput
}
maxLength=
{
30
}
/></
Form
.
Item
></
div
>
</
div
>
<
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"
><
Input
disabled=
{
!
editFlag
}
placeholder=
"Email"
/></
Form
.
Item
></
div
>
</
div
>
<
Line
/>
{
DataSaveDetail
!=
null
?
<
TableShow
data=
{
DataSaveDetail
}
onSubmit=
{
tableShowCallback
}
onChange=
{
deleteUnit
}
deleteDisable=
{
editFlag
}
/>
:
null
}
{
editFlag
?
<>
memberDetail
==
false
?
<>
{
DataSave
!=
null
?
<>
<
TitleBack
sublist=
{
[
'Status : '
+
user_type_status
[
DataSave
.
enable
],
'Create Time : '
+
timestampToTime
(
DataSave
.
createTime
.
time
)]
}
title=
{
editFlag
?
"Edit Owner Infomation"
:
"Owner Detail"
}
/>
<
Form
ref=
{
formRef
}
name=
"basic"
onFinish=
{
onFinish
}
validateMessages=
{
validateMessages
}
>
<
div
className=
{
styles
.
box1
}
>
<
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
>
<
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
>
<
Line
/>
<
Form
.
Item
><
Button
type=
"primary"
htmlType=
"submit"
>
Submit
</
Button
></
Form
.
Item
>
</>:
null
}
</
Form
>
<
Spin
spinning=
{
DataSaveLoading
}
tip=
"Loading Detial"
>
{
DataSaveDetail
!=
null
?
<
TableShow
data=
{
DataSaveDetail
}
onSubmit=
{
tableShowCallback
}
onChange=
{
deleteUnit
}
deleteDisable=
{
editFlag
}
/>
:
null
}
{
editFlag
?
<>
<
Line
/>
<
Form
.
Item
><
Button
type=
"primary"
htmlType=
"submit"
>
Submit
</
Button
></
Form
.
Item
>
</>:
null
}
</
Spin
>
</
Form
>
</>:
null
}
</>
:
<>
<
div
>
...
...
@@ -168,18 +185,20 @@ const UsersDetail = (props:any) => {
<
Button
type=
"danger"
onClick=
{
DeleteMember
}
>
Delete
</
Button
>
</
div
>
</>
}
</
div
>
);
};
function
mapStateToProps
(
state
:
any
)
{
const
{
DataSave
,
DataSaveDetail
,
Result
}
=
state
.
User
;
const
{
DataSave
,
DataSaveDetail
,
Result
,
returnValue
}
=
state
.
User
;
return
{
DataSave
,
DataSaveDetail
,
Result
Result
,
returnValue
,
};
}
export
default
connect
(
mapStateToProps
)(
UsersDetail
);
...
...
src/pages/runTest/Template.tsx
View file @
6199bd32
...
...
@@ -33,7 +33,7 @@ const Guard = (props:any) => {
return
(
<
div
className=
{
styles
.
base
}
>
<
TitleGet
title=
{
"Version 1.1.
2
"
}
/>
<
TitleGet
title=
{
"Version 1.1.
4
"
}
/>
<
p
>
token:
{
page
.
token
}
name:
{
getCookie
(
"name"
)
}
...
...
src/services/tos.ts
View file @
6199bd32
...
...
@@ -101,9 +101,13 @@ const requestList = [
[
"/tos/home/page/community/houseCard/add"
,
"35 申请住户卡"
],
[
"/tos/property/community/houseCard/query/detail"
,
"36 获取住户卡详情"
],
[
"/tos/property/decorate/record/get/detail"
,
"37 获取装修记录详情"
],
[
"/tos/users/save"
,
"38 新建后台信息"
],
[
"/tos/users/save"
,
"38 新建后台信息"
],
[
"/tos/life/community/account/member/del"
,
"39 删除业主成员信息"
],
// {"id":"c06286cfe7b843cb96fdfcb987231123","ownerId":"6b359755a36b49c28241a4620fa6539b"}
]
const
params
=
[
{
"communityName"
:
""
},
{
"communityNum"
:
""
,
"noticTitlel"
:
""
},
...
...
src/utils/method.ts
View file @
6199bd32
...
...
@@ -59,7 +59,7 @@ export const SA = (values: any, module: string, dispatch: any) => { dispatch({ t
export
const
PAGE
=
(
values
:
any
,
module
:
string
,
dispatch
:
any
)
=>
{
dispatch
({
type
:
module
+
'/PAGE'
,
playload
:
values
})
};
export
const
URL
=
(
values
:
any
,
module
:
string
,
dispatch
:
any
)
=>
{
dispatch
({
type
:
module
+
'/URL'
,
playload
:
values
})
};
export
const
URLCLEAR
=
(
module
:
string
,
dispatch
:
any
)
=>
{
dispatch
({
type
:
module
+
'/URLCLEAR'
})
};
export
const
DataClear
=
(
module
:
string
,
dispatch
:
any
)
=>
{
dispatch
({
type
:
module
+
'/DataClear'
})
};
export
const
ResultClear
=
(
module
:
any
,
dispatch
:
any
)
=>
{
dispatch
({
type
:
module
+
'/ResultClear'
})
};
// const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]]
// const values = [{ categoriesImageUrl: "http://url", categoriesName: "A9" },{ categoriesImageUrl: "http://url...", categoriesName: "A8" }]
...
...
src/utils/params.ts
View file @
6199bd32
export
const
validateMessages
=
{
required
:
'
p
lease enter,it is required!'
,
required
:
'
P
lease enter,it is required!'
,
types
:
{
email
:
'
${label}
is not validate email!'
,
email
:
'
It
is not validate email!'
,
number
:
'${label} is not a validate number!'
,
string
:
'${label} is not a validate number!'
},
string
:
{
range
:
'
i
t must be between ${min} and ${max}'
,
range
:
'
I
t must be between ${min} and ${max}'
,
},
number
:
{
range
:
'${label} must be between ${min} and ${max}'
,
...
...
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