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
a6cadda8
Commit
a6cadda8
authored
Sep 01, 2020
by
MrShi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新开dev_ssz分支,业主模块修改
parent
f659fc86
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
478 additions
and
195 deletions
+478
-195
proxy.ts
config/proxy.ts
+24
-14
tosUser.ts
src/models/tosUser.ts
+19
-7
TosUser.tsx
src/pages/UserManagement/tosUser/TosUser.tsx
+26
-39
TosUserCreate.tsx
src/pages/UserManagement/tosUser/TosUserCreate.tsx
+66
-5
TosUserDetails.tsx
src/pages/UserManagement/tosUser/TosUserDetails.tsx
+158
-65
TosUserEdit.tsx
src/pages/UserManagement/tosUser/TosUserEdit.tsx
+169
-63
tosUser.ts
src/services/tosUser.ts
+12
-0
authority.ts
src/utils/authority.ts
+4
-2
No files found.
config/proxy.ts
View file @
a6cadda8
...
...
@@ -7,16 +7,16 @@
*/
export
default
{
dev
:
{
/*
'/api/': {
'/api/'
:
{
target
:
'https://preview.pro.ant.design'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
*/
'/api/'
:
{
},
/*
'/api/': {
target: 'http://localhost:8080',
changeOrigin: true,
pathRewrite: { '^': '' },
},
},
*/
'/res/'
:
{
target
:
'http://mapleonlyone.top'
,
changeOrigin
:
true
,
...
...
@@ -27,8 +27,13 @@ export default {
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
/* '/tos/': {
target: 'http://47.74.233.180:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},*/
'/tos/'
:
{
target
:
'http://
47.74.233.180
:8651'
,
target
:
'http://
localhost
:8651'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
...
...
@@ -54,8 +59,13 @@ export default {
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
/* '/tos/': {
target: 'http://47.74.233.180:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},*/
'/tos/'
:
{
target
:
'http://
47.74.233.180
:8651'
,
target
:
'http://
localhost
:8651'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
...
...
@@ -76,15 +86,15 @@ export default {
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
'/tos/'
:
{
target
:
'http://47.74.233.180:8651'
,
'/tos/'
:
{
target
:
'http://47.74.233.180:8651'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
/* '/tos/': {
target: 'http://localhost:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},
// '/tos/': {
// target: 'http://localhost:8651',
// changeOrigin: true,
// pathRewrite: { '^': '' },
// },
},*/
},
};
src/models/tosUser.ts
View file @
a6cadda8
import
{
getOwnerDetail
,
getOwner
,
getTosUser
,
delAdvertisement
,
saveAdvertisement
,
quitAndUserAd
,
uploadApk
,
checkVideo
}
from
'@/services/tosUser'
;
import
{
updateOwner
,
saveOwner
,
getOwnerDetail
,
getOwner
,
getTosUser
,
delAdvertisement
,
saveAdvertisement
,
quitAndUserAd
,
uploadApk
,
checkVideo
}
from
'@/services/tosUser'
;
export
default
{
namespace
:
'tUModel'
,
...
...
@@ -17,19 +17,31 @@ export default{
*
getOwner
({
callback
,
payload
},{
call
,
put
})
{
const
response
=
yield
call
(
getOwner
,
payload
);
yield
put
({
type
:
"get
Owner
"
,
type
:
"get"
,
});
if
(
callback
)
callback
(
response
);
},
*
getOwnerDetail
({
callback
,
payload
},{
call
,
put
})
{
const
response
=
yield
call
(
getOwnerDetail
,
payload
);
yield
put
({
type
:
"getOwnerDetail"
,
type
:
"get"
,
});
if
(
callback
)
callback
(
response
);
},
*
saveOwner
({
callback
,
payload
},{
call
,
put
})
{
const
response
=
yield
call
(
saveOwner
,
payload
);
yield
put
({
type
:
"save"
,
});
if
(
callback
)
callback
(
response
);
},
*
updateOwner
({
callback
,
payload
},{
call
,
put
})
{
const
response
=
yield
call
(
updateOwner
,
payload
);
yield
put
({
type
:
"save"
,
});
if
(
callback
)
callback
(
response
);
},
*
delAdvertisement
({
callback
,
payload
},{
call
,
put
})
{
const
response
=
yield
call
(
delAdvertisement
,
payload
);
yield
put
({
...
...
@@ -74,7 +86,7 @@ export default{
};
},
getOwner
(
state
,
action
)
{
/*
getOwner(state, action) {
return {
...state,
data:action.payload || {},
...
...
@@ -86,7 +98,7 @@ export default{
...state,
data:action.payload || {},
};
},
},
*/
del
(
state
,
action
)
{
return
{
...
state
,
...
...
src/pages/UserManagement/tosUser/TosUser.tsx
View file @
a6cadda8
...
...
@@ -5,9 +5,7 @@ from "antd";
import
styles
from
'./style.less'
;
import
{
ConnectState
}
from
"@/models/connect"
;
import
XLSX
from
"@/pages/account/xlsx.core.min"
;
import
{
router
}
from
"umi"
;
import
'moment/locale/zh-cn'
;
// @ts-ignore
import
SelectOptions
from
'../../../components/SelectOptions/index'
;
class
TosUser
extends
React
.
Component
{
...
...
@@ -34,7 +32,6 @@ class TosUser extends React.Component {
visible
:
false
,
deviceStatus
:
''
,
selectedRowKeys
:
[],
used
:
null
,
newAdd
:
null
,
strList
:
[],
...
...
@@ -206,17 +203,15 @@ class TosUser extends React.Component {
visible
:
false
,
});
};
//获取所有设备
//获取所有设备
getDevice
=
()
=>
{
const
params
=
{
// address: (this.state.province == undefined ? '' : this.state.province.label) +
// (this.state.city == undefined ? '' : '-' + this.state.city.label) +
// (this.state.district == undefined ? '' : '-' + this.state.district.label) +
// (this.state.street == undefined ? '' : '-' + this.state.street.label),
name
:
this
.
state
.
name
,
/*name: this.state.name,
model: this.state.model,
status: this.state.status,
id
:
this
.
props
.
currentUser
.
userid
,
id: this.props.currentUser.userid,
*/
// userPhone:"18813787835",
// id:"240ebdfbac82417082ff789750760b83",
// ownerName: "哈喽kk",
...
...
@@ -227,17 +222,12 @@ class TosUser extends React.Component {
payload
:
params
,
callback
:
(
res
)
=>
{
if
(
res
)
{
/*this.setState({
data: res.rows,
total: res.total,
})*/
if
(
res
.
error_code
==
"0000"
){
this
.
setState
({
data
:
res
.
data
.
rows
,
total
:
res
.
data
.
total
,
})
}
else
if
(
res
.
error_code
==
"0001"
){
}
else
if
(
res
.
error_code
==
"0001"
){
alert
(
res
.
error_msg
);
}
else
if
(
res
.
error_code
==
"0002"
){
alert
(
res
.
error_msg
);
...
...
@@ -246,7 +236,7 @@ class TosUser extends React.Component {
// window.location.href = '/';
// router.replace('/');
}
else
{
else
{
alert
(
"Tos查询出错!未知错误!"
);
}
}
...
...
@@ -255,8 +245,6 @@ class TosUser extends React.Component {
};
//跳转到编辑页面
edit
=
(
params
)
=>
{
let
flag
=
0
;
...
...
@@ -304,7 +292,6 @@ class TosUser extends React.Component {
edit2
=
(
params
)
=>
{
let
flag
=
0
;
const
nowUser
=
this
.
props
.
currentUser
;
this
.
props
.
dispatch
(
routerRedux
.
push
({
pathname
:
'/UserManagement/tosUser/edit'
,
query
:
params
,
...
...
@@ -332,7 +319,7 @@ class TosUser extends React.Component {
}
}
}
else
{
//alert("找不到用户权限记录!");
//alert("找不到用户权限记录!");
//return;;
}
/* if(flag == 0){
...
...
@@ -362,17 +349,17 @@ class TosUser extends React.Component {
};
//加载省
provinceload
=
(
code
)
=>
{
this
.
props
.
dispatch
({
type
:
'deviceModel/getRegion'
,
payload
:
{
code
:
code
,},
callback
:
(
res
)
=>
{
if
(
res
)
{
this
.
setState
({
provinceList
:
res
.
data
,
});
}
}
});
//
this.props.dispatch({
//
type: 'deviceModel/getRegion',
//
payload: {code: code,},
//
callback: (res) => {
//
if (res) {
//
this.setState({
//
provinceList: res.data,
//
});
//
}
//
}
//
});
};
//省变更
provinceChange
=
(
e
)
=>
{
...
...
@@ -416,7 +403,7 @@ class TosUser extends React.Component {
})
}
else
{
this
.
setState
({
city
:
{
label
:
e
.
label
,}});
this
.
props
.
dispatch
({
/*
this.props.dispatch({
type: 'deviceModel/getRegion',
payload: {code: e.key,},
callback: (res) => {
...
...
@@ -428,7 +415,7 @@ class TosUser extends React.Component {
});
}
}
});
});
*/
}
};
//区变更
...
...
@@ -441,7 +428,7 @@ class TosUser extends React.Component {
})
}
else
{
this
.
setState
({
district
:
{
label
:
e
.
label
,}});
this
.
props
.
dispatch
({
/*
this.props.dispatch({
type: 'deviceModel/getRegion',
payload: {code: e.key,},
callback: (res) => {
...
...
@@ -452,12 +439,12 @@ class TosUser extends React.Component {
});
}
}
});
});
*/
}
};
//批量删除
del
()
{
this
.
props
.
dispatch
({
/*
this.props.dispatch({
type: 'deviceModel/delDevice',
payload: this.state.delData,
callback: (res) => {
...
...
@@ -472,13 +459,13 @@ class TosUser extends React.Component {
} else if(res.error_code == "0008"){
alert(res.error_msg);
window.location.href = '/';
router
.
replace
(
'/'
);
//
router.replace('/');
} else {
alert("删除失败!未知错误!");
}
}
}
});
});
*/
};
//显示信息
info
()
{
...
...
src/pages/UserManagement/tosUser/TosUserCreate.tsx
View file @
a6cadda8
...
...
@@ -161,13 +161,73 @@ class TosUserCreate extends React.Component {
snChange
=
(
e
)
=>
{
this
.
setState
({
sn
:
e
.
target
.
value
});
};
//设备sn变更
snChange1
=
(
e
)
=>
{
this
.
setState
({
sn1
:
e
.
target
.
value
});
};
//设备sn变更
snChange2
=
(
e
)
=>
{
this
.
setState
({
sn2
:
e
.
target
.
value
});
};
//管理员变更
keeperChange
=
(
e
)
=>
{
this
.
setState
({
keeper
:
e
.
target
.
value
});
};
//联系电话正则
phoneBlur
=
()
=>
{
if
(
!
(
/^1
[
3|4|5|8
][
0-9
]\d{4,8}
$/
.
test
(
this
.
state
.
phone
))){
const
params
=
{
/* deviceAddress: (this.state.province == undefined ? '' : this.state.province.label) +
(this.state.city == undefined ? '' : '-'+this.state.city.label) +
(this.state.district == undefined ? '' : '-'+this.state.district.label) +
(this.state.street == undefined ? '' : '-'+this.state.street.label),
deviceName: this.state.name,
deviceModel: this.state.model,
deviceKeeper: this.state.keeper,
deviceID: this.state.id,
deviceSerialNumber: this.state.sn,
devicePhone: this.state.phone,
deviceWorking: this.state.status == '' ? 2 : this.state.status,
deviceStatus: this.state.deviceStatus ? this.state.deviceStatus : 0,
deviceCreate: this.props.currentUser.userid,*/
owerName
:
this
.
state
.
sn
,
owerPhone
:
this
.
state
.
sn1
,
owerEmail
:
this
.
state
.
sn2
,
communityName
:
this
.
state
.
model
,
buildingNumber
:
this
.
state
.
name
,
floorNumber
:
this
.
state
.
keeper
,
roomNumber
:
this
.
state
.
phone1
,
addressAndpostalCode
:
this
.
state
.
phone
};
console
.
log
(
"params"
,
params
);
this
.
props
.
dispatch
({
type
:
'tUModel/saveOwner'
,
payload
:
params
,
callback
:
(
res
)
=>
{
if
(
res
.
error_code
==
"0000"
)
{
alert
(
res
.
error_msg
);
this
.
back
();
}
else
if
(
res
.
error_code
==
"0002"
)
{
alert
(
res
.
error_msg
);
this
.
back
();
}
else
if
(
res
.
error_code
==
"0001"
){
alert
(
res
.
error_msg
);
}
else
if
(
res
.
error_code
==
"0003"
){
alert
(
res
.
error_msg
)
}
else
if
(
res
.
error_code
==
"0008"
){
alert
(
res
.
error_msg
);
window
.
location
.
href
=
'/'
;
router
.
replace
(
'/'
);
}
else
{
alert
(
"提交错误!未知原因!"
);
}
}
});
/*if(!(/^1[3|4|5|8][0-9]\d{4,8}$/.test(this.state.phone))){
this.setState({
phoneBlur: false,
})
...
...
@@ -217,7 +277,7 @@ class TosUserCreate extends React.Component {
});
}
});
}
}
*/
};
//联系电话变更
phoneChange
=
(
e
)
=>
{
...
...
@@ -291,7 +351,7 @@ class TosUserCreate extends React.Component {
//渲染
render
()
{
const
{
name
,
model
,
keeper
,
phone
,
phone1
,
province
,
city
,
district
,
street
,
provinceList
,
cityList
,
districtList
,
streetList
,
phoneBlur
,
sn
}
=
this
.
state
;
provinceList
,
cityList
,
districtList
,
streetList
,
phoneBlur
,
sn
,
sn1
,
sn2
}
=
this
.
state
;
/* const provinceSelect = provinceList.map((item) => (
<Select.Option value={item.code} label={item.name}>{item.name}</Select.Option>
));
...
...
@@ -311,8 +371,9 @@ class TosUserCreate extends React.Component {
<
div
className=
{
styles
.
detailsBox
}
>
<
div
>
<
span
className=
{
styles
.
detailsContent
}
>
Owner's Name
</
span
>
<
Input
className=
{
styles
.
input
}
value=
{
sn
}
placeholder=
"Single Line Input"
onChange=
{
(
e
)
=>
this
.
snChange
(
e
)
}
/>
<
Input
className=
{
styles
.
input
}
value=
{
sn
}
placeholder=
"OwnerName"
onChange=
{
(
e
)
=>
this
.
snChange
(
e
)
}
/>
<
Input
className=
{
styles
.
input
}
value=
{
sn1
}
placeholder=
"Phone"
onChange=
{
(
e
)
=>
this
.
snChange1
(
e
)
}
/>
<
Input
className=
{
styles
.
input
}
value=
{
sn2
}
placeholder=
"E-mail"
onChange=
{
(
e
)
=>
this
.
snChange2
(
e
)
}
/>
</
div
>
<
div
>
<
span
className=
{
styles
.
detailsContent
}
>
Project / community
</
span
>
...
...
src/pages/UserManagement/tosUser/TosUserDetails.tsx
View file @
a6cadda8
This diff is collapsed.
Click to expand it.
src/pages/UserManagement/tosUser/TosUserEdit.tsx
View file @
a6cadda8
This diff is collapsed.
Click to expand it.
src/services/tosUser.ts
View file @
a6cadda8
...
...
@@ -20,7 +20,19 @@ export async function getOwnerDetail(params) {
data
:
params
,
});
}
export
async
function
saveOwner
(
params
)
{
return
request
(
'/tos/tosOwner/save'
,
{
method
:
'POST'
,
data
:
params
,
});
}
export
async
function
updateOwner
(
params
)
{
return
request
(
'/tos/tosOwner/info/update'
,
{
method
:
'POST'
,
data
:
params
,
});
}
export
async
function
delAdvertisement
(
params
)
{
return
request
(
'/api/ad/del'
,
{
method
:
'POST'
,
...
...
src/utils/authority.ts
View file @
a6cadda8
...
...
@@ -14,14 +14,16 @@ export function getAuthority(str?: string): string | string[] {
authority
=
authorityString
;
}
if
(
typeof
authority
===
'string'
)
{
return
[
authority
];
// return [authority];
return
[
'admin'
];
}
// preview.pro.ant.design only do not use in your production.
// preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
if
(
!
authority
&&
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION
===
'site'
)
{
return
[
'admin'
];
}
return
authority
;
// return authority;
return
[
'admin'
];
}
export
function
setAuthority
(
authority
:
string
|
string
[]):
void
{
...
...
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