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
ef7863ea
Commit
ef7863ea
authored
Sep 01, 2020
by
MrShi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev分支,业主修改
parent
a6cadda8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
160 additions
and
9 deletions
+160
-9
UserLayout.tsx
src/layouts/UserLayout.tsx
+2
-2
tosUser.ts
src/models/tosUser.ts
+16
-1
TosUserDetails.tsx
src/pages/UserManagement/tosUser/TosUserDetails.tsx
+84
-3
TosUserEdit.tsx
src/pages/UserManagement/tosUser/TosUserEdit.tsx
+43
-3
tosUser.ts
src/services/tosUser.ts
+15
-0
No files found.
src/layouts/UserLayout.tsx
View file @
ef7863ea
src/models/tosUser.ts
View file @
ef7863ea
import
{
updateOwner
,
saveOwner
,
getOwnerDetail
,
getOwner
,
getTosUser
,
delAdvertisement
,
saveAdvertisement
,
quitAndUserAd
,
uploadApk
,
checkVideo
}
from
'@/services/tosUser'
;
import
{
deleteUnit
,
getOwnerQr
,
updateOwner
,
saveOwner
,
getOwnerDetail
,
getOwner
,
getTosUser
,
delAdvertisement
,
saveAdvertisement
,
quitAndUserAd
,
uploadApk
,
checkVideo
}
from
'@/services/tosUser'
;
export
default
{
export
default
{
namespace
:
'tUModel'
,
namespace
:
'tUModel'
,
...
@@ -42,6 +42,21 @@ export default{
...
@@ -42,6 +42,21 @@ export default{
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
*
getOwnerQr
({
callback
,
payload
},{
call
,
put
})
{
const
response
=
yield
call
(
getOwnerQr
,
payload
);
yield
put
({
type
:
"save"
,
});
if
(
callback
)
callback
(
response
);
},
*
deleteUnit
({
callback
,
payload
},{
call
,
put
})
{
const
response
=
yield
call
(
deleteUnit
,
payload
);
yield
put
({
type
:
"del"
,
});
if
(
callback
)
callback
(
response
);
},
*
delAdvertisement
({
callback
,
payload
},{
call
,
put
})
{
*
delAdvertisement
({
callback
,
payload
},{
call
,
put
})
{
const
response
=
yield
call
(
delAdvertisement
,
payload
);
const
response
=
yield
call
(
delAdvertisement
,
payload
);
yield
put
({
yield
put
({
...
...
src/pages/UserManagement/tosUser/TosUserDetails.tsx
View file @
ef7863ea
...
@@ -136,6 +136,85 @@ class TosUserDetails extends React.Component {
...
@@ -136,6 +136,85 @@ class TosUserDetails extends React.Component {
visible
:
false
,
visible
:
false
,
});
});
};
};
//获取二维码
getQrCode
=
()
=>
{
const
nowUser
=
this
.
props
.
currentUser
.
userid
;
const
params
=
{
type
:
this
.
state
.
type
,
userID
:
nowUser
,
// userPhone:"18813787835",
ownerId
:
this
.
props
.
location
.
query
.
id
,
owerName
:
this
.
props
.
location
.
query
.
owerName
,
communityName
:
this
.
props
.
location
.
query
.
communityName
,
unit
:
this
.
props
.
location
.
query
.
buildingNumber
+
"#"
+
this
.
props
.
location
.
query
.
floorNumber
+
"-"
+
this
.
props
.
location
.
query
.
roomNumber
};
this
.
props
.
dispatch
({
type
:
'tUModel/getOwnerQr'
,
payload
:
params
,
callback
:
(
res
)
=>
{
if
(
res
)
{
console
.
log
(
res
);
if
(
res
.
error_code
==
"0000"
){
this
.
setState
({
qrUrl
:
res
.
data
.
qrUrl
,
})
}
else
if
(
res
.
error_code
==
"0002"
)
{
alert
(
res
.
error_msg
);
}
else
if
(
res
.
error_code
==
"0008"
){
alert
(
res
.
error_msg
);
window
.
location
.
href
=
'/'
;
router
.
replace
(
'/'
);
}
else
{
alert
(
"获取失败!未知错误!"
);
}
}
}
});
};
//删除Unit
DeleteUnit
=
()
=>
{
alert
(
"确定要删除该条记录吗?"
);
const
nowUser
=
this
.
props
.
currentUser
.
userid
;
const
params
=
{
type
:
this
.
state
.
type
,
userID
:
nowUser
,
// userPhone:"18813787835",
ownerId
:
this
.
props
.
location
.
query
.
id
,
owerName
:
this
.
props
.
location
.
query
.
owerName
,
communityName
:
this
.
props
.
location
.
query
.
communityName
,
unit
:
this
.
props
.
location
.
query
.
buildingNumber
+
"#"
+
this
.
props
.
location
.
query
.
floorNumber
+
"-"
+
this
.
props
.
location
.
query
.
roomNumber
};
this
.
props
.
dispatch
({
type
:
'tUModel/deleteUnit'
,
payload
:
params
,
callback
:
(
res
)
=>
{
if
(
res
)
{
console
.
log
(
res
);
if
(
res
.
error_code
==
"0000"
){
this
.
setState
({
qrUrl
:
res
.
data
.
qrUrl
,
})
}
else
if
(
res
.
error_code
==
"0002"
)
{
alert
(
res
.
error_msg
);
}
else
if
(
res
.
error_code
==
"0008"
){
alert
(
res
.
error_msg
);
window
.
location
.
href
=
'/'
;
router
.
replace
(
'/'
);
}
else
{
alert
(
"删除失败!请联系工作人员!"
);
}
}
}
});
};
//获取警报数据
//获取警报数据
getData
=
()
=>
{
getData
=
()
=>
{
const
nowUser
=
this
.
props
.
currentUser
.
userid
;
const
nowUser
=
this
.
props
.
currentUser
.
userid
;
...
@@ -380,8 +459,10 @@ class TosUserDetails extends React.Component {
...
@@ -380,8 +459,10 @@ class TosUserDetails extends React.Component {
if
(
this
.
state
.
current
==
"record"
){
if
(
this
.
state
.
current
==
"record"
){
// this.getRecord();
// this.getRecord();
this
.
getData
();
this
.
getData
();
this
.
getQrCode
();
}
else
{
}
else
{
this
.
getData
();
this
.
getData
();
this
.
getQrCode
();
}
}
});
});
}
}
...
@@ -574,7 +655,7 @@ class TosUserDetails extends React.Component {
...
@@ -574,7 +655,7 @@ class TosUserDetails extends React.Component {
//渲染
//渲染
render
()
{
render
()
{
const
{
data
,
total
,
typeList
,
current
,
record
,
visible
,
tosUser
}
=
this
.
state
;
const
{
data
,
total
,
typeList
,
current
,
record
,
visible
,
tosUser
,
qrUrl
}
=
this
.
state
;
const
typeSelect
=
typeList
.
map
((
item
,
index
)
=>
(
const
typeSelect
=
typeList
.
map
((
item
,
index
)
=>
(
<
Select
.
Option
value=
{
index
}
>
{
item
}
</
Select
.
Option
>
<
Select
.
Option
value=
{
index
}
>
{
item
}
</
Select
.
Option
>
...
@@ -656,8 +737,8 @@ class TosUserDetails extends React.Component {
...
@@ -656,8 +737,8 @@ class TosUserDetails extends React.Component {
<
div
>
<
div
>
{
current
==
'record'
?
{
current
==
'record'
?
<
div
>
<
div
>
<
img
style
={{
width
:100,
height
:100,
float
:"
right
"}}
src=
{
"http://www.srthinker.com:5205/file/d575594254a141f29d23d711d9158ba5.png"
}
/>
<
img
style
={{
width
:100,
height
:100,
float
:"
right
"}}
src=
{
this
.
state
.
qrUrl
}
/>
<
Button
className=
{
styles
.
button1
}
onClick=
{
()
=>
this
.
getRecord
()
}
>
Delete Unit
</
Button
>
<
Button
className=
{
styles
.
button1
}
onClick=
{
()
=>
this
.
DeleteUnit
()
}
>
Delete Unit
</
Button
>
</
div
>
</
div
>
:
''
}
:
''
}
...
...
src/pages/UserManagement/tosUser/TosUserEdit.tsx
View file @
ef7863ea
...
@@ -136,6 +136,44 @@ class TosUserEdit extends React.Component {
...
@@ -136,6 +136,44 @@ class TosUserEdit extends React.Component {
visible
:
false
,
visible
:
false
,
});
});
};
};
//获取二维码
getQrCode
=
()
=>
{
const
nowUser
=
this
.
props
.
currentUser
.
userid
;
const
params
=
{
type
:
this
.
state
.
type
,
userID
:
nowUser
,
// userPhone:"18813787835",
ownerId
:
this
.
props
.
location
.
query
.
id
,
owerName
:
this
.
props
.
location
.
query
.
owerName
,
communityName
:
this
.
props
.
location
.
query
.
communityName
,
unit
:
this
.
props
.
location
.
query
.
buildingNumber
+
"#"
+
this
.
props
.
location
.
query
.
floorNumber
+
"-"
+
this
.
props
.
location
.
query
.
roomNumber
};
this
.
props
.
dispatch
({
type
:
'tUModel/getOwnerQr'
,
payload
:
params
,
callback
:
(
res
)
=>
{
if
(
res
)
{
console
.
log
(
res
);
if
(
res
.
error_code
==
"0000"
){
this
.
setState
({
qrUrl
:
res
.
data
.
qrUrl
,
})
}
else
if
(
res
.
error_code
==
"0002"
)
{
alert
(
res
.
error_msg
);
}
else
if
(
res
.
error_code
==
"0008"
){
alert
(
res
.
error_msg
);
window
.
location
.
href
=
'/'
;
router
.
replace
(
'/'
);
}
else
{
alert
(
"获取失败!未知错误!"
);
}
}
}
});
};
//获取警报数据
//获取警报数据
getData
=
()
=>
{
getData
=
()
=>
{
const
nowUser
=
this
.
props
.
currentUser
.
userid
;
const
nowUser
=
this
.
props
.
currentUser
.
userid
;
...
@@ -353,7 +391,7 @@ class TosUserEdit extends React.Component {
...
@@ -353,7 +391,7 @@ class TosUserEdit extends React.Component {
};
};
console
.
log
(
"params"
,
params
);
console
.
log
(
"params"
,
params
);
this
.
props
.
dispatch
({
this
.
props
.
dispatch
({
type
:
'tUModel/
sav
eOwner'
,
type
:
'tUModel/
updat
eOwner'
,
payload
:
params
,
payload
:
params
,
callback
:
(
res
)
=>
{
callback
:
(
res
)
=>
{
if
(
res
.
error_code
==
"0000"
)
{
if
(
res
.
error_code
==
"0000"
)
{
...
@@ -388,8 +426,10 @@ class TosUserEdit extends React.Component {
...
@@ -388,8 +426,10 @@ class TosUserEdit extends React.Component {
if
(
this
.
state
.
current
==
"record"
){
if
(
this
.
state
.
current
==
"record"
){
// this.getRecord();
// this.getRecord();
this
.
getData
();
this
.
getData
();
this
.
getQrCode
();
}
else
{
}
else
{
this
.
getData
();
this
.
getData
();
this
.
getQrCode
();
// this.getData();
// this.getData();
}
}
});
});
...
@@ -583,7 +623,7 @@ class TosUserEdit extends React.Component {
...
@@ -583,7 +623,7 @@ class TosUserEdit extends React.Component {
//渲染
//渲染
render
()
{
render
()
{
const
{
data
,
total
,
typeList
,
current
,
record
,
visible
,
tosUser
,
sn
,
sn1
,
sn2
}
=
this
.
state
;
const
{
data
,
total
,
typeList
,
current
,
record
,
visible
,
tosUser
,
sn
,
sn1
,
sn2
,
qrUrl
}
=
this
.
state
;
const
typeSelect
=
typeList
.
map
((
item
,
index
)
=>
(
const
typeSelect
=
typeList
.
map
((
item
,
index
)
=>
(
<
Select
.
Option
value=
{
index
}
>
{
item
}
</
Select
.
Option
>
<
Select
.
Option
value=
{
index
}
>
{
item
}
</
Select
.
Option
>
...
@@ -674,7 +714,7 @@ class TosUserEdit extends React.Component {
...
@@ -674,7 +714,7 @@ class TosUserEdit extends React.Component {
<
div
>
<
div
>
{
current
==
'record'
?
{
current
==
'record'
?
<
div
>
<
div
>
<
img
style
={{
width
:100,
height
:100,
float
:"
right
"}}
src=
{
"http://www.srthinker.com:5205/file/d575594254a141f29d23d711d9158ba5.png"
}
/>
<
img
style
={{
width
:100,
height
:100,
float
:"
right
"}}
src=
{
this
.
state
.
qrUrl
}
/>
{
/*<Button className={styles.button1} onClick={() => this.getRecord()}>删除单位</Button>*/
}
{
/*<Button className={styles.button1} onClick={() => this.getRecord()}>删除单位</Button>*/
}
</
div
>
</
div
>
...
...
src/services/tosUser.ts
View file @
ef7863ea
...
@@ -33,6 +33,21 @@ export async function updateOwner(params) {
...
@@ -33,6 +33,21 @@ export async function updateOwner(params) {
data
:
params
,
data
:
params
,
});
});
}
}
export
async
function
getOwnerQr
(
params
)
{
return
request
(
'/tos/life/community/qr/get'
,
{
method
:
'POST'
,
data
:
params
,
});
}
export
async
function
deleteUnit
(
params
)
{
return
request
(
'/tos/life/community/account/unit/del'
,
{
method
:
'POST'
,
data
:
params
,
});
}
export
async
function
delAdvertisement
(
params
)
{
export
async
function
delAdvertisement
(
params
)
{
return
request
(
'/api/ad/del'
,
{
return
request
(
'/api/ad/del'
,
{
method
:
'POST'
,
method
:
'POST'
,
...
...
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