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
1c6ae294
Commit
1c6ae294
authored
Feb 23, 2021
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改admin的密码信息、小区排版修复
Signed-off-by:
cellee
<
893264950@qq.com
>
parent
13579cda
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
249 additions
and
96 deletions
+249
-96
config.ts
config/config.ts
+2
-1
PdfUpload.tsx
src/components/Form/PdfUpload.tsx
+2
-2
Account.ts
src/models/CommunityManagement/Account.ts
+4
-5
CompanyInformation.tsx
...countManagement/CompanyInformation/CompanyInformation.tsx
+5
-3
Account.less
src/pages/AccountManagement/account/Account.less
+6
-0
Account.tsx
src/pages/AccountManagement/account/Account.tsx
+13
-84
editAdmin.tsx
src/pages/AccountManagement/account/editAdmin.tsx
+213
-0
Adds.tsx
src/pages/CommunityManagement/CellList/Adds.tsx
+2
-0
params.ts
src/utils/params.ts
+2
-1
No files found.
config/config.ts
View file @
1c6ae294
/*
* @Author: your name
* @Date: 2020-12-01 18:40:06
* @LastEditTime: 2021-02-
03 15:41:15
* @LastEditTime: 2021-02-
23 09:51:06
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\config\config.ts
...
...
@@ -372,6 +372,7 @@ export default defineConfig({
{
path
:
'./Add'
,
component
:
'./AccountManagement/account/AccountAdds'
},
{
path
:
'./Detail'
,
component
:
'./AccountManagement/account/AccountDetail'
},
{
path
:
'./reset'
,
component
:
'./AccountManagement/account/AccountReset'
},
{
path
:
'./editAdmin'
,
component
:
'./AccountManagement/account/editAdmin'
},
{
path
:
'*'
,
component
:
'@/pages/404'
},
],
},
...
...
src/components/Form/PdfUpload.tsx
View file @
1c6ae294
/*
* @Author: your name
* @Date: 2021-02-01 14:54:48
* @LastEditTime: 2021-02-2
2 17:14:12
* @LastEditTime: 2021-02-2
3 10:42:27
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\components\Form\PdfUpload.tsx
...
...
@@ -93,7 +93,7 @@ const PdfUpload: React.FC<PriceInputProps> = ({
v
.
descriptionId
==
detailvalue
[
i
].
descriptionId
);
});
console
.
log
(
filterValue
);
//
console.log(filterValue);
if
(
filterValue
.
length
>
0
)
{
obj
.
forEach
((
n
:
any
)
=>
{
if
(
...
...
src/models/CommunityManagement/Account.ts
View file @
1c6ae294
...
...
@@ -64,17 +64,16 @@ export default {
*
RA
({
playload
},
{
call
,
put
})
{
const
resp
=
yield
call
(
service
.
RA
,
playload
);
if
(
resp
.
code
==
500
||
resp
.
error_code
!=
'0000'
)
{
}
if
(
resp
.
error_code
!=
'0000'
)
{
printf
(
playload
,
resp
);
message
.
error
(
`
${
resp
.
error_code
}
:
${
resp
.
error_msg
}
`
);
}
else
{
switch
(
playload
.
index
)
{
case
41
:
case
67
:
// 编辑admin
{
// let Data = resp.data;
// yield put({ type: 'returnPage', Data });
let
Data
=
null
;
yield
put
({
type
:
'returnPage'
,
Data
});
history
.
push
(
'/AccountManagement/account'
);
}
break
;
case
38
:
...
...
src/pages/AccountManagement/CompanyInformation/CompanyInformation.tsx
View file @
1c6ae294
/*
* @Author: your name
* @Date: 2020-11-19 16:54:53
* @LastEditTime: 2021-02-2
0 18:41:17
* @LastEditTime: 2021-02-2
3 10:33:29
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\pages\AccountManagement\CompanyInformation\CompanyInformation.tsx
...
...
@@ -15,7 +15,7 @@ import { connect } from 'umi';
import
styles
from
'./index.less'
;
const
CompanyInformation
=
(
props
:
any
)
=>
{
const
{
dispatch
,
Means
,
loading
}
=
props
;
const
{
dispatch
,
Means
,
loading
,
user
}
=
props
;
const
[
ModelExcel
,
setModelExcel
]
=
useState
(
false
);
//编辑状态
...
...
@@ -62,7 +62,7 @@ const CompanyInformation = (props: any) => {
<
div
className=
{
styles
.
box
}
>
<
div
className=
{
styles
.
item1
}
>
Company Information
</
div
>
{
ModelExcel
?
(
{
ModelExcel
&&
user
.
currentUser
.
userModel
.
tosUserName
==
'admin'
?
(
<
Button
onClick=
{
goToReturn
}
>
<
LeftOutlined
/>
Back
...
...
@@ -141,11 +141,13 @@ const CompanyInformation = (props: any) => {
};
const
Company
=
(
styte
:
any
)
=>
{
const
{
user
}
=
styte
;
const
{
Means
}
=
styte
.
Account
;
const
loading
=
styte
.
loading
.
models
.
Account
||
false
;
return
{
Means
,
loading
,
user
,
};
};
export
default
connect
(
Company
)(
CompanyInformation
);
src/pages/AccountManagement/account/Account.less
View file @
1c6ae294
...
...
@@ -68,3 +68,9 @@ hr {
// transform: translateY(-50%);
}
}
.editadmin {
.ant-form-item-label {
width: 160px;
}
}
src/pages/AccountManagement/account/Account.tsx
View file @
1c6ae294
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Form
,
Input
,
Button
,
Pagination
,
message
,
Modal
,
Tag
}
from
'antd'
;
import
{
Form
,
Input
,
Button
,
Pagination
,
message
,
Tag
}
from
'antd'
;
import
{
connect
,
history
}
from
'umi'
;
import
{
SearchOutlined
,
ClearOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
SearchOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
ProTable
from
'@ant-design/pro-table'
;
import
'./Account.less'
;
...
...
@@ -9,16 +9,15 @@ import './Account.less';
import
moment
from
'moment'
;
const
Account
=
(
props
:
any
)
=>
{
const
{
dispatch
,
Data
,
DataSave
,
DataSaveDetail
,
Result
,
loading
}
=
props
;
const
{
user
,
dispatch
,
Data
,
Result
,
loading
}
=
props
;
const
RA
=
(
index
:
any
,
values
:
any
)
=>
{
dispatch
({
type
:
'Account/RA'
,
playload
:
{
index
:
index
,
body
:
values
}
});
};
const
[
term
,
setTerm
]
=
useState
({}
as
any
);
// 拉取数据的条件存储
const
[
over
,
setOver
]
=
useState
(
false
);
// 关闭账号确认弹窗
const
[
accountName
,
setaccountName
]
=
useState
(
null
as
any
);
// 弹窗账号信息
// 数据
useEffect
(()
=>
{
console
.
log
(
Data
);
if
(
Data
==
null
)
{
Refresh
();
}
...
...
@@ -27,13 +26,6 @@ const Account = (props: any) => {
// 监听改变状态提交结果
useEffect
(()
=>
{
if
(
Result
!=
null
)
{
// console.log('改变取消弹窗重新加载,在清空结果');
// let obj = {
// userStatus: accountName.userStatus == 0 ? 1 : 0,
// userID: accountName.tosUserId,
// };
// RA(52, obj);
setOver
(
false
);
// 清除结果
dispatch
({
type
:
'Account/ResultClear'
});
dispatch
({
type
:
'Account/ReData'
});
...
...
@@ -56,11 +48,6 @@ const Account = (props: any) => {
RA
(
51
,
obj
);
};
// 列表刷新加载
const
Refresh2
=
()
=>
{
RA
(
51
,
term
);
};
// 表头
const
columns
=
[
{
...
...
@@ -94,13 +81,6 @@ const Account = (props: any) => {
);
},
},
// {
// title: 'Created By',
// dataIndex: 'tosUserServiceCell',
// key: 'createAccount',
// width: 280,
// ellipsis: true,
// },
{
title
:
'Creator'
,
dataIndex
:
'creatorName'
,
...
...
@@ -127,7 +107,7 @@ const Account = (props: any) => {
onClick=
{
()
=>
{
edit
(
record
);
}
}
disabled=
{
record
.
tosUserLevel
==
1
?
true
:
false
}
disabled=
{
record
.
tosUserLevel
==
1
&&
user
.
tosUserLevel
!==
1
?
true
:
false
}
>
Edit
</
Button
>
...
...
@@ -140,19 +120,6 @@ const Account = (props: any) => {
>
Detail
</
Button
>
{
/* <Button
type="link"
onClick={() => {
lockS(record);
}}
>
{record.userStatus != 1 ? 'Close' : 'Open'}
</Button> */
}
{
/*{record.userID == 1||record.userID == this.props.currentUser.userid?'':
<Button style={{background: 'transparent', border: 0, color: '#1890FF'}}
onClick={() => this.changeStatus(record)}>
{record.userStatus == 1 ? "lock" : "unlock"}</Button>}*/
}
</
span
>
),
},
...
...
@@ -160,11 +127,16 @@ const Account = (props: any) => {
// 编辑- 新增
const
edit
=
(
item
:
any
)
=>
{
//
console.log(item);
console
.
log
(
item
);
// 无论编辑还是新增都清掉二级账户选择
dispatch
({
type
:
'Account/InfoClear'
});
if
(
item
==
1
)
{
history
.
push
(
'/AccountManagement/account/Add'
);
}
else
if
(
item
.
tosUserName
==
'admin'
)
{
// console.log('跳到编辑Admin');
let
DataSave
=
item
;
dispatch
({
type
:
'Account/SA'
,
DataSave
});
history
.
push
(
'/AccountManagement/account/editAdmin'
);
}
else
{
let
DataSave
=
item
;
dispatch
({
type
:
'Account/SA'
,
DataSave
});
...
...
@@ -179,13 +151,6 @@ const Account = (props: any) => {
history
.
push
(
'/AccountManagement/account/Detail'
);
};
// 停用账号弹窗
const
lockS
=
(
item
:
any
)
=>
{
setOver
(
true
);
setaccountName
(
item
);
console
.
log
(
item
);
};
// 表头单搜索
const
onFinishContract
=
(
value
:
any
)
=>
{
if
(
value
.
tosAccountName
||
value
.
creatorName
)
{
...
...
@@ -211,21 +176,6 @@ const Account = (props: any) => {
RA
(
51
,
t
);
};
// 弹窗 提交确认账号打开关闭
const
handleOk
=
(
e
:
any
)
=>
{
//
let
obj
=
{
userStatus
:
accountName
.
userStatus
==
0
?
1
:
0
,
userID
:
accountName
.
tosUserId
,
};
RA
(
52
,
obj
);
// setOver(false);
};
// 关闭弹窗
const
handleCancel
=
(
e
:
any
)
=>
{
setOver
(
false
);
};
return
(
<>
<
div
className=
"contop"
style=
{
{
display
:
'flex'
,
justifyContent
:
'space-between'
}
}
>
...
...
@@ -246,16 +196,6 @@ const Account = (props: any) => {
<
Button
type=
"primary"
htmlType=
"submit"
icon=
{
<
SearchOutlined
/>
}
loading=
{
loading
}
>
Search
{
' '
}
</
Button
>
{
/* <Button
htmlType="button"
onClick={Refresh}
style={{ marginLeft: '15px' }}
icon={<ClearOutlined />}
loading={loading}
>
{' '}
Reset
</Button> */
}
</
Form
.
Item
>
</
Form
>
...
...
@@ -281,18 +221,6 @@ const Account = (props: any) => {
search=
{
false
}
loading=
{
loading
}
toolBarRender=
{
false
}
// toolBarRender={() => [
// <Button
// type="primary"
// loading={loading}
// icon={<PlusOutlined />}
// onClick={() => {
// edit(1);
// }}
// >
// Add Account
// </Button>,
// ]}
options=
{
{
density
:
false
,
fullScreen
:
false
,
...
...
@@ -300,7 +228,6 @@ const Account = (props: any) => {
setting
:
false
,
}
}
headerTitle=
"Account list"
// pagination={{ defaultCurrent: 1, total: Data.totalRow }}
/>
<
div
className=
"pages"
>
...
...
@@ -319,9 +246,11 @@ const Account = (props: any) => {
};
const
AccountProps
=
(
styte
:
any
)
=>
{
const
user
=
styte
.
user
.
currentUser
.
userModel
;
const
{
Data
,
DataSave
,
DataSaveDetail
,
Result
}
=
styte
.
Account
;
const
loading
=
styte
.
loading
.
models
.
Account
||
false
;
return
{
user
,
Data
,
DataSave
,
DataSaveDetail
,
...
...
src/pages/AccountManagement/account/editAdmin.tsx
0 → 100644
View file @
1c6ae294
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Form
,
Button
,
Spin
,
Input
}
from
'antd'
;
import
{
connect
,
history
}
from
'umi'
;
import
{
EditOutlined
,
LeftOutlined
}
from
'@ant-design/icons'
;
import
'./Account.less'
;
const
Account
=
(
props
:
any
)
=>
{
const
module
=
'Account'
;
const
{
dispatch
,
SubResult
,
user
,
DataSave
,
load
}
=
props
;
const
RA
=
(
index
:
any
,
values
:
any
)
=>
{
dispatch
({
type
:
'Account/RA'
,
playload
:
{
index
:
index
,
body
:
values
}
});
};
const
[
pass
,
setPass
]
=
useState
(
false
);
// 是否修改密码
const
[
tips
,
setTips
]
=
useState
({
start
:
false
,
mag
:
''
,
});
// 表单提示
// 表单标识
const
[
form
]
=
Form
.
useForm
();
const
formRef
=
useRef
(
null
);
// 当前编辑账户的数据
useEffect
(()
=>
{
if
(
DataSave
!=
null
&&
user
!=
null
)
{
// 赋值
form
.
setFieldsValue
({
tosUserName
:
DataSave
.
tosUserName
,
tosUserPhone
:
DataSave
.
tosUserPhone
,
tosAccountName
:
DataSave
.
tosAccountName
,
});
}
else
{
history
.
push
(
'/AccountManagement/account'
);
}
},
[
DataSave
,
user
]);
//提交信息结果
useEffect
(()
=>
{
if
(
SubResult
!=
null
)
{
if
(
SubResult
.
statr
==
0
&&
SubResult
.
desc
==
0
)
{
// 保存成功, 清掉原来数据 并且跳转
// message.success('Submitted Successfully !');
dispatch
({
type
:
module
+
'/ReData'
});
dispatch
({
type
:
module
+
'/AccountClear'
});
history
.
go
(
-
1
);
}
}
},
[
SubResult
]);
// 保存提交
const
onFinishContract
=
async
(
value
:
any
)
=>
{
// 提交判断
if
(
pass
&&
(
!
value
.
oldPassword
||
!
value
.
tosUserPwd
))
{
setTips
({
start
:
true
,
mag
:
'Please enter everything'
});
}
else
if
(
pass
&&
value
.
tosUserPwd
&&
value
.
tosUserPwd
.
legth
<
5
)
{
setTips
({
start
:
true
,
mag
:
'The password is too simple (Must be greater than 6 digits)'
});
}
else
if
(
pass
&&
value
.
tosUserPwd
!=
value
.
tosUserPwd1
)
{
setTips
({
start
:
true
,
mag
:
'The two passwords are inconsistent'
});
}
else
{
setTips
({
start
:
false
,
mag
:
''
});
RA
(
67
,
value
);
}
// RA(67, value);
};
//goToReturn
const
goToReturn
=
()
=>
{
history
.
go
(
-
1
);
};
//输入密码
const
goPass
=
()
=>
{
setTips
({
start
:
false
,
mag
:
''
,
});
setPass
(
!
pass
);
};
return
(
<
Spin
spinning=
{
load
}
>
<
div
className=
"contop editadmin"
style=
{
{
padding
:
'12px 20px'
}
}
>
<
h3
className=
"capi"
>
<
EditOutlined
/>
Edit Admin
<
div
className=
"back"
>
<
Button
onClick=
{
goToReturn
}
>
<
LeftOutlined
/>
Back
</
Button
>
</
div
>
</
h3
>
<
hr
></
hr
>
{
/* 表单内容 */
}
<
Form
ref=
{
formRef
}
form=
{
form
}
autoComplete=
"off"
layout=
"inline"
name=
"contract"
onFinish=
{
onFinishContract
}
>
<
div
style=
{
{
width
:
'100%'
,
marginBottom
:
20
}
}
>
<
Form
.
Item
name=
"tosUserName"
label=
"Account"
style=
{
{
display
:
'inline-block'
}
}
>
<
Input
value=
"admin"
disabled
/>
</
Form
.
Item
>
</
div
>
<
div
style=
{
{
width
:
'100%'
,
marginBottom
:
20
}
}
>
<
Form
.
Item
name=
"tosAccountName"
label=
"Administrator Name"
rules=
{
[{
required
:
true
}]
}
style=
{
{
display
:
'inline-block'
}
}
>
<
Input
maxLength=
{
24
}
minLength=
{
2
}
placeholder=
"Please enter Administrator Name"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"tosUserPhone"
label=
"Contact Information"
rules=
{
[{
required
:
true
}]
}
style=
{
{
display
:
'inline-block'
,
margin
:
'0 8px'
}
}
>
<
Input
maxLength=
{
11
}
minLength=
{
8
}
placeholder=
"Please enter Contact Information"
/>
</
Form
.
Item
>
</
div
>
{
pass
?
(
// 点击输入密码
<
div
style=
{
{
width
:
'100%'
,
marginBottom
:
5
}
}
>
<
Form
.
Item
label=
"Change Password"
>
<
Form
.
Item
name=
"oldPassword"
style=
{
{
marginBottom
:
15
}
}
>
<
Input
type=
"password"
maxLength=
{
24
}
placeholder=
"Old password"
style=
{
{
width
:
240
}
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"tosUserPwd"
style=
{
{
marginBottom
:
15
}
}
>
<
Input
type=
"password"
maxLength=
{
24
}
placeholder=
"New password"
style=
{
{
width
:
240
}
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"tosUserPwd1"
style=
{
{
marginBottom
:
15
}
}
>
<
Input
type=
"password"
maxLength=
{
24
}
placeholder=
"New password again"
style=
{
{
width
:
240
}
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
{
/* 表单错误提示 */
}
{
tips
.
start
?
(
<
li
style=
{
{
marginLeft
:
160
,
color
:
'#f00'
,
marginBottom
:
15
}
}
>
{
tips
.
mag
}
</
li
>
)
:
(
''
)
}
</
div
>
)
:
(
// 没点击输入密码
<
div
style=
{
{
width
:
'100%'
,
marginBottom
:
25
}
}
>
<
Form
.
Item
label=
"Login password"
>
<
Button
type=
"link"
onClick=
{
goPass
}
>
Change Password
</
Button
>
</
Form
.
Item
>
</
div
>
)
}
<
Form
.
Item
style=
{
{
marginLeft
:
160
}
}
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
load
}
>
Submit
</
Button
>
{
pass
?
(
//本次不修改
<
Button
type=
"link"
onClick=
{
goPass
}
>
Next change password
</
Button
>
)
:
(
''
)
}
</
Form
.
Item
>
</
Form
>
</
div
>
</
Spin
>
);
};
const
AccountProps
=
(
state
:
any
)
=>
{
const
{
Data
,
DataSave
,
DataSaveDetail
,
Result
,
SubResult
}
=
state
.
Account
;
const
{
user
}
=
state
;
const
load
=
state
.
loading
.
global
;
return
{
Data
,
DataSave
,
DataSaveDetail
,
Result
,
user
,
// 获取当前账户信息
SubResult
,
load
,
};
};
export
default
connect
(
AccountProps
)(
Account
);
src/pages/CommunityManagement/CellList/Adds.tsx
View file @
1c6ae294
...
...
@@ -424,6 +424,7 @@ const Adds = (props: any) => {
name=
{
'mainPdfList'
}
label=
"Maintenance Schedule:"
colon=
{
false
}
wrapperCol=
{
{
span
:
24
}
}
style=
{
{
marginBottom
:
tips
[
0
]
?
4
:
14
,
}
}
...
...
@@ -454,6 +455,7 @@ const Adds = (props: any) => {
name=
{
'essentialPdfList'
}
label=
"Essential Information:"
colon=
{
false
}
wrapperCol=
{
{
span
:
24
}
}
style=
{
{
marginBottom
:
tips
[
1
]
?
4
:
14
,
}
}
...
...
src/utils/params.ts
View file @
1c6ae294
/*
* @Author: your name
* @Date: 2020-11-19 20:34:18
* @LastEditTime: 2021-02-2
0 18:14:15
* @LastEditTime: 2021-02-2
3 17:12:49
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\params.ts
...
...
@@ -99,4 +99,5 @@ export const requestList = [
[
'/tos/tosCommunity/get/detail2'
,
'64 获取小区详情(新增)'
,
{}],
[
'/tos/tosCompany/edit'
,
'65 修改公司信息'
,
{}],
[
'/tos/tosCompany/get'
,
'66 获取公司信息'
,
{}],
[
'/tos/users/edit'
,
'67 修改admin信息'
,
{}],
];
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