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
568b0654
Commit
568b0654
authored
Nov 17, 2020
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预览跨域问题,以及账号管理界面更新
Signed-off-by:
cellee
<
893264950@qq.com
>
parent
2e104c6c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
117 additions
and
70 deletions
+117
-70
config.ts
config/config.ts
+1
-0
proxy.ts
config/proxy.ts
+3
-3
index.tsx
src/components/PreView/index.tsx
+3
-1
Contract.ts
src/models/CommunityManagement/Contract.ts
+1
-1
Account.tsx
src/pages/AccountManagement/account/Account.tsx
+40
-24
AccountEdit.tsx
src/pages/AccountManagement/account/AccountEdit.tsx
+60
-37
ContractContent.tsx
src/pages/ContractManagement/ContractContent.tsx
+9
-4
No files found.
config/config.ts
View file @
568b0654
...
...
@@ -344,6 +344,7 @@ export default defineConfig({
routes
:
[
{
path
:
'./'
,
component
:
'./AccountManagement/account/Account'
},
{
path
:
'./edit'
,
component
:
'./AccountManagement/account/AccountEdit'
},
{
path
:
'./Add'
,
component
:
'./AccountManagement/account/AccountEdit'
},
{
path
:
'./reset'
,
component
:
'./AccountManagement/account/AccountReset'
},
],
},
...
...
config/proxy.ts
View file @
568b0654
...
...
@@ -22,7 +22,7 @@ export default {
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
'/cash/tos-manager/
bill/
'
:
{
'/cash/tos-manager/'
:
{
target
:
'http://acc-huahui.oss-cn-shenzhen.aliyuncs.com'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
...
...
@@ -54,7 +54,7 @@ export default {
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
'/cash/tos-manager/
bill/
'
:
{
'/cash/tos-manager/'
:
{
target
:
'http://acc-huahui.oss-cn-shenzhen.aliyuncs.com'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
...
...
@@ -81,7 +81,7 @@ export default {
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
'/cash/tos-manager/
bill/
'
:
{
'/cash/tos-manager/'
:
{
target
:
'http://acc-huahui.oss-cn-shenzhen.aliyuncs.com'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
...
...
src/components/PreView/index.tsx
View file @
568b0654
...
...
@@ -11,6 +11,8 @@ import IconNone from '@/assets/logo_icon_bg.png';
import
PDF
from
'react-pdf-js'
;
import
{
stringSplit
}
from
'@/utils/string'
;
const
PreView
=
(
props
:
any
)
=>
{
const
module
=
'CellList'
;
...
...
@@ -113,7 +115,7 @@ const PreView = (props: any) => {
{
ModalInfo
!=
null
&&
ModalInfo
.
type
==
'pdf'
?
(
<>
<
PDF
file=
{
ModalInfo
?
ModalInfo
.
url
:
''
}
file=
{
ModalInfo
?
stringSplit
(
ModalInfo
.
url
,
'm/cash'
)
:
''
}
page=
{
pageNumber
}
onDocumentComplete=
{
onDocumentLoadSuccess
}
/>
...
...
src/models/CommunityManagement/Contract.ts
View file @
568b0654
...
...
@@ -65,7 +65,7 @@ export default {
break
;
case
27
:
{
message
.
success
(
'
save s
uccess !'
);
message
.
success
(
'
Save S
uccess !'
);
var
tmp
=
resp
;
yield
put
({
type
:
'returnResult'
,
tmp
});
setTimeout
(
function
()
{
...
...
src/pages/AccountManagement/account/Account.tsx
View file @
568b0654
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Form
,
Input
,
Button
,
Pagination
,
message
,
Modal
}
from
'antd'
;
import
{
Form
,
Input
,
Button
,
Pagination
,
message
,
Modal
,
Tag
}
from
'antd'
;
import
{
connect
,
history
}
from
'umi'
;
import
{
SearchOutlined
,
ClearOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
ProTable
from
'@ant-design/pro-table'
;
...
...
@@ -28,13 +28,11 @@ const Account = (props: any) => {
}
},
[
Data
]);
//页面进来执行一次
// 拉取数据的条件存储
const
[
term
,
setTerm
]
=
useState
({}
as
any
);
// 关闭账号
const
[
over
,
setOver
]
=
useState
(
false
);
const
[
term
,
setTerm
]
=
useState
({}
as
any
);
// 拉取数据的条件存储
const
[
over
,
setOver
]
=
useState
(
false
);
// 关闭账号确认弹窗
const
[
accountName
,
setaccountName
]
=
useState
(
null
as
any
);
// 弹窗账号信息
// 表单标识
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
// 表单标识
// 表头
const
columns
=
[
...
...
@@ -49,11 +47,10 @@ const Account = (props: any) => {
key
:
'userLevel'
,
render
:
(
text
:
any
)
=>
(
<
span
>
{
text
==
5
||
text
==
0
?
'超级管理员'
:
''
}
{
text
==
4
?
'一级管理员'
:
''
}
{
text
==
3
?
'二级管理员'
:
''
}
{
text
==
2
?
'三级管理员'
:
''
}
{
text
==
1
?
'一级管理员'
:
''
}
{
text
==
0
?
'Administrator'
:
''
}
{
text
==
1
?
'First Level'
:
''
}
{
text
==
2
?
'Two Level'
:
''
}
{
text
==
3
?
'Three Level'
:
''
}
</
span
>
),
},
...
...
@@ -62,7 +59,13 @@ const Account = (props: any) => {
title
:
'Status'
,
dataIndex
:
'userStatus'
,
key
:
'userStatus'
,
render
:
(
text
:
any
)
=>
<
span
>
{
text
!=
1
?
'启用'
:
'禁用'
}
</
span
>,
render
:
(
text
:
any
)
=>
{
return
(
<
Tag
color=
{
text
!=
1
?
'#87d068'
:
'#f20'
}
key=
{
text
}
>
<
span
>
{
text
!=
1
?
'Enable'
:
'Close'
}
</
span
>
</
Tag
>
);
},
},
{
title
:
'Created By'
,
...
...
@@ -70,16 +73,13 @@ const Account = (props: any) => {
key
:
'createAccount'
,
width
:
280
,
ellipsis
:
true
,
// render: (text: any) => {
// <span>{text == 0 ? '启用' : '禁用'}</span>
// },
},
{
title
:
'Creation Time'
,
dataIndex
:
'createTime'
,
key
:
'createTime'
,
render
:
(
text
:
any
)
=>
{
return
moment
(
text
.
time
).
format
(
'YYYY-MM-DD'
);
return
moment
(
text
).
format
(
'YYYY-MM-DD'
);
},
},
...
...
@@ -87,7 +87,7 @@ const Account = (props: any) => {
title
:
'Actions'
,
dataIndex
:
'action'
,
key
:
'action'
,
render
:
(
record
:
any
)
=>
(
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
span
>
<
Button
type=
"link"
...
...
@@ -103,7 +103,7 @@ const Account = (props: any) => {
lockS
(
record
);
}
}
>
{
record
.
userStatus
==
1
?
'Lock'
:
'Unlock
'
}
{
record
.
userStatus
!=
1
?
'Close'
:
'Open
'
}
</
Button
>
{
/*{record.userID == 1||record.userID == this.props.currentUser.userid?'':
<Button style={{background: 'transparent', border: 0, color: '#1890FF'}}
...
...
@@ -116,12 +116,14 @@ const Account = (props: any) => {
// 编辑- 新增
const
edit
=
(
item
:
any
)
=>
{
history
.
push
(
'./account/edit'
);
item
==
1
?
history
.
push
(
'./account/Add'
)
:
history
.
push
(
'./account/edit'
);
};
// 停用账号
const
lockS
=
(
item
:
any
)
=>
{
setOver
(
true
);
setaccountName
(
item
);
console
.
log
(
item
);
};
// 表头单搜索
...
...
@@ -204,6 +206,7 @@ const Account = (props: any) => {
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
{
// Jump(0, 'Add');
edit
(
1
);
}
}
>
Add Account
...
...
@@ -233,10 +236,23 @@ const Account = (props: any) => {
</
div
>
{
/* 确认关闭账号 */
}
<
Modal
title=
"Basic Modal"
visible=
{
over
}
onOk=
{
handleOk
}
onCancel=
{
handleCancel
}
>
<
p
>
Some contents...
</
p
>
<
p
>
Some contents...
</
p
>
<
p
>
Some contents...
</
p
>
<
Modal
title=
"Operation Tips"
visible=
{
over
}
okText=
{
'Confirm'
}
cancelText=
{
'Cancel'
}
onOk=
{
handleOk
}
onCancel=
{
handleCancel
}
>
{
accountName
!=
null
?
(
<
p
>
Are You Sure To
{
' '
}
<
span
style=
{
{
color
:
'red'
}
}
>
{
accountName
.
userStatus
!=
1
?
'Close'
:
'Open'
}
</
span
>
{
' '
}
The Account '
<
span
style=
{
{
color
:
'red'
}
}
>
{
accountName
.
tosUserName
}
</
span
>
' ?
</
p
>
)
:
(
''
)
}
</
Modal
>
</>
);
...
...
src/pages/AccountManagement/account/AccountEdit.tsx
View file @
568b0654
...
...
@@ -19,7 +19,7 @@ import { zhCnFaci } from '@/utils/power';
import
{
AccountTip
}
from
'@/utils/tip'
;
import
SelectCommunity
from
'@/components/SelectCommunity'
;
import
{
getNumber
}
from
'@/utils/string'
;
// 正则
import
{
RA
}
from
'@/utils/method'
;
import
moment
from
'moment'
;
...
...
@@ -57,26 +57,37 @@ const Account = (props: any) => {
// 保存提交
const
onFinishContract
=
(
value
:
any
)
=>
{
value
.
tosUserServiceCellList
=
value
.
community
.
value
;
// 管辖小区
value
.
tosUserEmail
=
value
.
tosUserName
;
// 邮箱就是账号
value
.
tosUserLevel
=
values
;
//级别
value
.
creatorName
=
getCookie
(
'name'
);
//新建者账号
value
.
creatorId
=
getCookie
(
'id'
);
//新建者ID
delete
value
.
community
;
console
.
log
(
value
);
// 另传权限
let
obj
=
{
userName
:
value
.
tosUserName
,
userPassword
:
value
.
tosUserPwd
,
permissionArray
:
checkedKeys
.
sort
((
n1
,
n2
)
=>
{
return
parseInt
(
n1
)
-
parseInt
(
n2
);
}),
};
console
.
log
(
obj
);
RA
(
38
,
value
,
module
,
dispatch
);
// 信息上传
RA
(
42
,
obj
,
module
,
dispatch
);
// 权限上传
if
(
checkedKeys
.
length
==
0
)
{
message
.
error
(
'Please Select Permission!'
);
return
false
;
}
else
if
(
value
.
community
.
value
==
0
)
{
message
.
error
(
'Please Select The Jurisdiction Area!'
);
return
false
;
}
else
if
(
value
.
tosUserName
.
length
<
6
||
value
.
tosUserPwd
.
length
<
6
)
{
message
.
error
(
'The Account Password is Greater Than 6 Digits!'
);
return
false
;
}
else
{
value
.
tosUserServiceCellList
=
value
.
community
.
value
;
// 管辖小区
value
.
tosUserEmail
=
value
.
tosUserName
;
// 邮箱就是账号
value
.
tosUserLevel
=
values
;
//级别
value
.
creatorName
=
getCookie
(
'name'
);
//新建者账号
value
.
creatorId
=
getCookie
(
'id'
);
//新建者ID
delete
value
.
community
;
console
.
log
(
value
);
// 另传权限
let
obj
=
{
userName
:
value
.
tosUserName
,
userPassword
:
value
.
tosUserPwd
,
permissionArray
:
checkedKeys
.
sort
((
n1
,
n2
)
=>
{
return
parseInt
(
n1
)
-
parseInt
(
n2
);
}),
};
console
.
log
(
obj
);
// RA(38, value, module, dispatch); // 信息上传
// RA(42, obj, module, dispatch); // 权限上传
}
};
//goToReturn
const
goToReturn
=
()
=>
{};
...
...
@@ -115,6 +126,13 @@ const Account = (props: any) => {
setvalues
(
e
.
target
.
value
);
};
//手机号
const
keyup_communityManagerFee
=
(
e
:
any
)
=>
{
e
.
target
.
value
=
keyup_tool
(
e
.
target
.
value
);
};
const
keyup_tool
=
(
value
:
any
)
=>
{
return
getNumber
(
value
.
replace
(
/
[^\d
^
\.]
+/g
,
''
));
};
// 选择小区名字并赋值
return
(
...
...
@@ -143,50 +161,55 @@ const Account = (props: any) => {
>
<
Descriptions
column=
{
{
xs
:
1
,
sm
:
2
,
md
:
3
}
}
>
<
Descriptions
.
Item
>
<
Form
.
Item
name=
"tosAccountName"
label=
"
管理员姓名
"
rules=
{
AccountTip
[
0
]
}
>
<
Input
placeholder=
"
6 Postcode
"
className=
"input"
/>
<
Form
.
Item
name=
"tosAccountName"
label=
"
Name
"
rules=
{
AccountTip
[
0
]
}
>
<
Input
placeholder=
"
Name Of Administrator
"
className=
"input"
/>
</
Form
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
>
<
Form
.
Item
name=
"tosUserPhone"
label=
"联系方式"
>
<
Input
placeholder=
"6 Postcode"
className=
"input"
/>
<
Form
.
Item
name=
"tosUserPhone"
label=
"Phone"
rules=
{
AccountTip
[
1
]
}
>
<
Input
placeholder=
"Contact Information"
className=
"input"
maxLength=
{
11
}
onKeyUp=
{
keyup_communityManagerFee
}
/>
</
Form
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
>
<
Form
.
Item
name=
"tosUserToCompany"
label=
"
所属公司
"
>
<
Input
placeholder=
"
6 Postcode
"
className=
"input"
/>
<
Form
.
Item
name=
"tosUserToCompany"
label=
"
Company
"
>
<
Input
placeholder=
"
Affiliated Company
"
className=
"input"
/>
</
Form
.
Item
>
</
Descriptions
.
Item
>
</
Descriptions
>
<
Descriptions
column=
{
{
xs
:
1
,
sm
:
2
,
md
:
3
}
}
>
<
Descriptions
.
Item
>
<
Form
.
Item
name=
"tosUserName"
label=
"
账号ID"
>
<
Input
placeholder=
"
6 Postcode
"
className=
"input"
/>
<
Form
.
Item
name=
"tosUserName"
label=
"
Account ID"
rules=
{
AccountTip
[
2
]
}
>
<
Input
placeholder=
"
Login Account
"
className=
"input"
/>
</
Form
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
>
<
Form
.
Item
name=
"tosUserPwd"
label=
"
登录密码"
>
<
Input
placeholder=
"
6 Postcode
"
className=
"input"
/>
<
Form
.
Item
name=
"tosUserPwd"
label=
"
PassWord"
rules=
{
AccountTip
[
3
]
}
>
<
Input
placeholder=
"
Login PassWord
"
className=
"input"
/>
</
Form
.
Item
>
</
Descriptions
.
Item
>
</
Descriptions
>
<
Form
.
Item
name=
"community"
label=
"
服务小区
"
>
<
Form
.
Item
name=
"community"
label=
"
Community
"
>
<
SelectCommunity
/>
</
Form
.
Item
>
<
div
className=
"diy"
style=
{
{
marginBottom
:
'14px'
}
}
>
<
div
className=
"label"
>
<
span
className=
"title"
>
权限配置
:
</
span
>
<
span
className=
"title"
>
Privilege Level
:
</
span
>
</
div
>
<
div
className=
"label"
>
<
Radio
.
Group
defaultValue=
{
values
}
onChange=
{
onRadio
}
>
<
Radio
style=
{
radioStyle
}
value=
{
2
}
>
二级管理员
Two Level Administrator
</
Radio
>
<
Radio
style=
{
radioStyle
}
value=
{
3
}
>
三级管理员
Three Level Administrator
{
/* <Input placeholder="三级管理员" style={{ width: 160, marginLeft: 10 }} /> */
}
</
Radio
>
</
Radio
.
Group
>
...
...
@@ -195,7 +218,7 @@ const Account = (props: any) => {
<
div
className=
"diy"
style=
{
{
marginBottom
:
'24px'
}
}
>
<
div
className=
"label"
>
<
span
className=
"title"
>
权限选择
:
</
span
>
<
span
className=
"title"
>
Permission List
:
</
span
>
</
div
>
<
div
className=
"label"
>
<
Tree
...
...
@@ -215,7 +238,7 @@ const Account = (props: any) => {
<
div
className=
"diy"
>
<
div
className=
"label"
></
div
>
<
div
className=
"label"
>
<
Button
type=
"primary"
htmlType=
"submit"
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
loading
}
>
Submit
</
Button
>
</
div
>
...
...
src/pages/ContractManagement/ContractContent.tsx
View file @
568b0654
...
...
@@ -31,6 +31,7 @@ import { tipList } from '@/utils/tip';
import
FileViewer
from
'react-file-viewer'
;
import
PDF
from
'react-pdf-js'
;
import
{
stringSplit
}
from
'@/utils/string'
;
const
ContractContent
=
(
props
:
any
)
=>
{
const
{
ContractModel
,
dispatch
,
FileImg
,
loading
}
=
props
;
...
...
@@ -108,6 +109,7 @@ const ContractContent = (props: any) => {
type
:
FileImg
[
i
].
fileName
.
match
(
/
\.([^\.]
+
)
$/
)[
1
].
toLowerCase
(),
url
:
FileImg
[
i
].
fileUrl
,
};
console
.
log
();
obj
.
push
(
a
);
}
setFileList
([...
obj
]);
...
...
@@ -182,7 +184,6 @@ const ContractContent = (props: any) => {
//点击预览
const
onPreviews
=
(
file
:
any
)
=>
{
console
.
log
(
file
);
setfileInfo
(
file
);
// 设置选择的文件
settipModal
(
true
);
};
...
...
@@ -378,7 +379,7 @@ const ContractContent = (props: any) => {
// pdf 换一种
<>
<
PDF
file=
{
fileInfo
.
url
}
file=
{
stringSplit
(
fileInfo
.
url
,
'm/cash'
)
}
page=
{
pageNumber
}
onDocumentComplete=
{
onDocumentLoadSuccess
}
/>
...
...
@@ -392,13 +393,17 @@ const ContractContent = (props: any) => {
</>
)
:
fileInfo
.
type
==
'jpg'
||
fileInfo
.
type
==
'png'
?
(
// 图片用指定格式
<
Image
src=
{
fileInfo
.
url
}
src=
{
stringSplit
(
fileInfo
.
url
,
'm/cash'
)
}
preview=
{
false
}
style=
{
{
margin
:
'0 auto'
,
textAlign
:
'center'
}
}
/>
)
:
(
<
FileViewer
fileType=
{
fileInfo
.
type
}
filePath=
{
fileInfo
.
url
}
/>
<
FileViewer
fileType=
{
fileInfo
.
type
}
filePath=
{
stringSplit
(
fileInfo
.
url
,
'm/cash'
)
}
/>
)
)
:
(
''
...
...
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