Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
frontend
Project
Project
Details
Activity
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
Schedules
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
h5-communicate
frontend
Commits
6b7d7290
Commit
6b7d7290
authored
Jul 21, 2020
by
熊成伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
3ad67e50
Pipeline
#16380
failed with stages
in 36 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
117 additions
and
3 deletions
+117
-3
User.jsx
src/pages/User/User.jsx
+101
-0
router.js
src/router.js
+2
-1
instance.js
src/utils/instance.js
+14
-2
No files found.
src/pages/User/User.jsx
0 → 100644
View file @
6b7d7290
import
React
,
{
useState
}
from
'react'
;
import
{
WingBlank
,
List
,
InputItem
,
TextareaItem
,
WhiteSpace
,
Toast
,
DatePicker
,
Picker
}
from
'antd-mobile'
import
Document
from
'react-document-title'
;
import
'../index.less'
;
import
fileRequest
from
'../../utils/fileRequest'
;
import
Upload
from
'rc-upload'
;
import
{
createForm
}
from
'rc-form'
;
const
Send
=
(
props
)
=>
{
const
{
getFieldProps
}
=
props
.
form
;
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
onSubmit
=
()
=>
{
props
.
form
.
validateFields
({
force
:
true
},
(
error
)
=>
{
const
values
=
props
.
form
.
getFieldsValue
();
const
jsonParam
=
{...
values
,
_mail_option
:
'send'
,
_mail_has_blob
:
upload
.
length
>
0
};
setLoading
(
true
);
const
formData
=
new
FormData
();
upload
.
length
>
0
&&
upload
.
forEach
(
file
=>
{
formData
.
append
(
'blob'
,
file
);
});
if
(
!
error
)
{
fileRequest
({
method
:
'post'
,
url
:
'/idtAppServiceV6/jspmail/sendMail'
,
body
:
{
jsonParam
:
JSON
.
stringify
(
jsonParam
)},
payload
:
formData
}).
then
(
res
=>
{
Toast
.
success
(
'发送成功'
);
props
.
history
.
push
(
'/blank/mail'
);
setLoading
(
true
)
});
}
else
{
Toast
.
fail
(
'请输入完整的主题、收件人、内容'
)
}
});
};
const
[
upload
,
setUpload
]
=
useState
([]);
const
uploaderProps
=
{
multiple
:
true
,
beforeUpload
(
file
)
{
const
newUpload
=
[...
upload
,
file
];
setUpload
(
newUpload
);
return
false
}
};
const
uploadDelete
=
uid
=>
{
const
newData
=
[...
upload
];
const
Index
=
newData
.
findIndex
(
item
=>
item
.
uid
===
uid
);
Index
>
-
1
&&
newData
.
splice
(
Index
,
1
);
setUpload
(
newData
)
};
const
userInfo
=
localStorage
.
getItem
(
'userInfo'
)
return
(
<
Document
title=
"内部邮局"
>
<
WingBlank
>
<
WhiteSpace
/>
<
form
>
<
List
>
{
/*<WingBlank>*/
}
{
/*{upload.length > 0 && upload.map((item, index) => (*/
}
{
/*<div>1111</div>*/
}
{
/*))}*/
}
{
/*</WingBlank>*/
}
{
/*<Upload className="auto-upload" {...uploaderProps}>*/
}
{
/*<a className="auto-upload">上传附件 +</a>*/
}
{
/*</Upload>*/
}
<
InputItem
disabled=
{
true
}
value=
"11111"
>
姓名
</
InputItem
>
<
InputItem
disabled=
{
true
}
value=
"11111"
>
账号
</
InputItem
>
<
Picker
data=
{
[{
label
:
'男'
,
value
:
'男'
},
{
label
:
'女'
,
value
:
'女'
}]
}
cols=
{
1
}
{
...
getFieldProps
('
xb
')}
>
<
List
.
Item
arrow=
"horizontal"
>
性别
</
List
.
Item
>
</
Picker
>
<
DatePicker
mode=
"date"
className=
"send-date-style"
{
...
getFieldProps
('
gzrq
')}
>
<
List
.
Item
arrow=
"horizontal"
>
工作日期
</
List
.
Item
>
</
DatePicker
>
<
DatePicker
mode=
"date"
className=
"send-date-style"
{
...
getFieldProps
('
csrq
')}
onChange=
{
val
=>
console
.
log
(
val
)
}
>
<
List
.
Item
arrow=
"horizontal"
>
出生日期
</
List
.
Item
>
</
DatePicker
>
<
InputItem
{
...
getFieldProps
('
gzdh
')}
>
工作电话
</
InputItem
>
<
InputItem
{
...
getFieldProps
('
yddh
')}
>
手机号码
</
InputItem
>
<
InputItem
{
...
getFieldProps
('
sjxh
')}
>
手机小号
</
InputItem
>
<
InputItem
{
...
getFieldProps
('
email
')}
>
邮箱地址
</
InputItem
>
</
List
>
</
form
>
<
div
className=
"event-footer"
>
<
div
className=
"event-footer-button"
onClick=
{
onSubmit
}
>
保存
</
div
>
</
div
>
</
WingBlank
>
</
Document
>
);
};
export
default
createForm
()(
Send
);
src/router.js
View file @
6b7d7290
...
@@ -21,8 +21,8 @@ import MainSend from './pages/UnCommon/Mail/Send'
...
@@ -21,8 +21,8 @@ import MainSend from './pages/UnCommon/Mail/Send'
import
People
from
'./pages/EventProcessing/UnCommon/People'
import
People
from
'./pages/EventProcessing/UnCommon/People'
import
Login
from
'./pages/Login'
import
Login
from
'./pages/Login'
import
MeetInfo
from
'./pages/Work/components/MeetInfo'
import
MeetInfo
from
'./pages/Work/components/MeetInfo'
import
NoFound
from
'./pages/NoFound'
import
NoFound
from
'./pages/NoFound'
import
User
from
'./pages/User/User'
const
ReactRouter
=
()
=>
{
const
ReactRouter
=
()
=>
{
return
(
return
(
...
@@ -55,6 +55,7 @@ const ReactRouter = () => {
...
@@ -55,6 +55,7 @@ const ReactRouter = () => {
<
Route
path
=
"/blank/work-add/:name"
component
=
{
WorkAdd
}
/
>
<
Route
path
=
"/blank/work-add/:name"
component
=
{
WorkAdd
}
/
>
<
Route
path
=
"/blank/submit/:flowNodeId/:uuid/:flowTbId"
component
=
{
SubmitDetail
}
/
>
<
Route
path
=
"/blank/submit/:flowNodeId/:uuid/:flowTbId"
component
=
{
SubmitDetail
}
/
>
<
Route
path
=
"/blank/info/:id/:uuid/:FLOWTBID"
component
=
{
Process
}
/
>
<
Route
path
=
"/blank/info/:id/:uuid/:FLOWTBID"
component
=
{
Process
}
/
>
<
Route
path
=
"/blank/user"
component
=
{
User
}
/
>
<
/BlankLayout
>
<
/BlankLayout
>
}
/
>
}
/
>
<
Route
component
=
{
NoFound
}
/
>
<
Route
component
=
{
NoFound
}
/
>
...
...
src/utils/instance.js
View file @
6b7d7290
import
axios
from
'axios'
;
import
axios
from
'axios'
;
import
{
Toast
}
from
'antd-mobile'
;
import
{
Toast
}
from
'antd-mobile'
;
var
qs
=
require
(
'qs'
)
var
qs
=
require
(
'qs'
)
;
const
instance
=
axios
.
create
();
const
instance
=
axios
.
create
();
const
token
=
localStorage
.
getItem
(
"token"
);
const
token
=
localStorage
.
getItem
(
"token"
);
...
@@ -63,9 +63,21 @@ export const createAPI = (baseURL) => {
...
@@ -63,9 +63,21 @@ export const createAPI = (baseURL) => {
}
}
// 保存到本地
// 保存到本地
if
(
response
&&
response
.
data
&&
response
.
data
.
token
)
{
if
(
response
&&
response
.
data
&&
response
.
data
.
token
)
{
const
userInfo
=
{
userealname
:
response
.
data
.
userealname
,
useName
:
response
.
data
.
userName
,
xb
:
response
.
data
.
xb
,
gzrq
:
new
Date
(
response
.
data
.
gzrq
),
csrq
:
new
Date
(
response
.
data
.
csrq
),
gzdh
:
response
.
data
.
gzdh
,
yddh
:
response
.
data
.
yddh
,
sjxh
:
response
.
data
.
sjxh
,
email
:
response
.
data
.
email
,
};
localStorage
.
setItem
(
'userInfo'
,
JSON
.
stringify
(
userInfo
))
defaultHeaders
=
{
defaultHeaders
=
{
token
:
response
.
data
.
token
,
token
:
response
.
data
.
token
,
}
}
;
localStorage
.
setItem
(
"token"
,
response
.
data
.
token
);
localStorage
.
setItem
(
"token"
,
response
.
data
.
token
);
}
}
if
(
response
&&
response
.
data
&&
response
.
data
.
developer
)
{
if
(
response
&&
response
.
data
&&
response
.
data
.
developer
)
{
...
...
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