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
fcb83a0a
Commit
fcb83a0a
authored
Jul 29, 2020
by
熊成伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
69652474
Pipeline
#16533
canceled with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
55 deletions
+56
-55
package.json
package.json
+4
-1
PeopleInfo.jsx
src/pages/Test/PeopleInfo.jsx
+10
-18
Receive.jsx
src/pages/Test/Receive.jsx
+27
-26
Send.jsx
src/pages/Test/Send.jsx
+15
-10
No files found.
package.json
View file @
fcb83a0a
...
...
@@ -47,7 +47,10 @@
"target"
:
"http://124.93.101.8:9988"
},
"/department"
:
{
"target"
:
"http://192.168.1.84:8889"
"target"
:
"http://192.168.2.101:8889"
},
"/demo"
:
{
"target"
:
"http://192.168.2.101:8889"
}
}
}
src/pages/Test/PeopleInfo.jsx
View file @
fcb83a0a
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Modal
,
Accordion
,
List
,
Checkbox
,
Button
}
from
"antd-mobile"
;
import
{
Modal
,
Accordion
,
List
,
Radio
,
Button
}
from
"antd-mobile"
;
import
'./index.less'
import
axios
from
"axios"
;
const
CheckboxItem
=
Checkbox
.
Checkbox
Item
;
const
RadioItem
=
Radio
.
Radio
Item
;
const
Send
=
(
props
)
=>
{
const
{
visible
,
onClose
}
=
props
;
const
{
visible
,
onClose
,
onSelect
}
=
props
;
const
[
data
,
setData
]
=
useState
([]);
useEffect
(()
=>
{
axios
({
method
:
'post'
,
url
:
'
http://192.168.1.84:8889
/department/tree'
,
url
:
'/department/tree'
,
data
:
{},
withCredentials
:
false
,
}).
then
(
res
=>
{
...
...
@@ -20,13 +20,10 @@ const Send = (props) => {
})
},
[]);
const
[
checked
,
setChecked
]
=
useState
(
[]
)
const
[
checked
,
setChecked
]
=
useState
(
{}
)
const
checkChange
=
(
e
,
val
)
=>
{
const
newChecked
=
[...
checked
];
const
index
=
newChecked
.
indexOf
(
val
);
e
.
target
.
checked
?
newChecked
.
push
(
val
)
:
newChecked
.
splice
(
index
,
1
);
setChecked
(
newChecked
);
const
checkChange
=
(
val
,
name
)
=>
{
setChecked
({
value
:
val
,
name
});
};
const
getProps
=
data
=>
(
<
Accordion
>
...
...
@@ -36,9 +33,9 @@ const Send = (props) => {
{
item
.
userList
&&
item
.
userList
.
length
>
0
&&
(
<
List
key=
{
item
.
name
}
>
{
item
.
userList
.
map
((
child
)
=>
(
<
CheckboxItem
key=
{
child
.
uid
}
onChange=
{
(
val
)
=>
checkChange
(
val
,
child
.
uid
)
}
>
<
RadioItem
key=
{
child
.
uid
}
checked=
{
checked
.
value
===
child
.
uid
}
onChange=
{
(
val
)
=>
checkChange
(
child
.
uid
,
child
.
name
)
}
>
{
child
.
name
}
</
Checkbox
Item
>
</
Radio
Item
>
))
}
</
List
>
)
}
...
...
@@ -57,18 +54,13 @@ const Send = (props) => {
transparent
onClose=
{
()
=>
onClose
(
false
)
}
>
{
/*<List>*/
}
{
/*<CheckboxItem onChange={(val) => console.log(val)}>*/
}
{
/*{11111}*/
}
{
/*</CheckboxItem>*/
}
{
/*</List>*/
}
<
div
className=
"test-box-auto"
>
{
getProps
(
data
)
}
</
div
>
<
div
className=
"modal-form-footer"
>
<
Button
className=
"date-button mr-12 bg-gray"
inline
onClick=
{
()
=>
onClose
(
false
)
}
>
取消
</
Button
>
<
Button
className=
"date-button"
inline
type=
"primary"
>
确认选择
</
Button
>
<
Button
className=
"date-button"
inline
type=
"primary"
onClick=
{
()
=>
{
onSelect
(
checked
);
onClose
(
false
)}
}
>
确认选择
</
Button
>
</
div
>
</
Modal
>
</
div
>
...
...
src/pages/Test/Receive.jsx
View file @
fcb83a0a
import
React
,
{
useEffect
}
from
'react'
;
import
{
WingBlank
,
List
,
InputItem
,
TextareaItem
,
WhiteSpace
,
Picker
}
from
'antd-mobile'
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
WingBlank
,
List
,
InputItem
,
WhiteSpace
,
Picker
,
Toast
}
from
'antd-mobile'
import
Document
from
'react-document-title'
;
import
moment
from
'moment'
import
axios
from
'axios'
import
{
createForm
}
from
'rc-form'
;
const
Send
=
(
props
)
=>
{
const
Receive
=
(
props
)
=>
{
const
{
id
}
=
props
.
match
.
params
;
const
{
getFieldProps
}
=
props
.
form
;
const
[
defaultV
,
setDefaultV
]
=
useState
({});
useEffect
(()
=>
{
axios
({
method
:
'
pos
t'
,
url
:
'http://192.168.1.84:8889/department/tree'
,
method
:
'
ge
t'
,
url
:
`/demo/leaveForm/
${
id
}
`
,
data
:
{},
withCredentials
:
tru
e
,
withCredentials
:
fals
e
,
}).
then
(
res
=>
{
console
.
log
(
res
)
setDefaultV
(
res
.
data
.
data
.
result
)
})
},
[]);
const
onSubmit
=
()
=>
{
props
.
form
.
validateFields
({
force
:
true
},
(
error
)
=>
{
const
values
=
props
.
form
.
getFieldsValue
();
const
keys
=
Object
.
keys
(
values
);
keys
.
map
(
item
=>
{
!
values
[
item
]
&&
(
delete
values
[
item
]);
Array
.
isArray
(
values
[
item
])
&&
values
[
item
].
length
===
1
&&
(
values
[
item
]
=
values
[
item
][
0
]);
values
[
item
]
instanceof
Date
&&
(
values
[
item
]
=
moment
(
values
[
item
]).
format
(
"YYYY-MM-DD HH:mm:ss"
))
return
null
;
});
if
(
!
error
)
{
console
.
log
(
values
)
console
.
log
(
values
);
axios
({
method
:
'patch'
,
url
:
`/demo/reviewAndApproval`
,
params
:
{
status
:
values
.
status
[
0
],
id
},
withCredentials
:
false
,
}).
then
(
res
=>
{
res
.
data
.
data
.
result
&&
Toast
.
success
(
'审核成功'
)
})
}
});
};
...
...
@@ -41,18 +45,15 @@ const Send = (props) => {
<
WhiteSpace
/>
<
form
>
<
List
>
<
InputItem
extra=
{
'1111'
}
>
标题
</
InputItem
>
<
InputItem
extra=
{
'1111'
}
>
发送人
</
InputItem
>
<
InputItem
extra=
{
'1111'
}
>
工作日期
</
InputItem
>
<
InputItem
extra=
{
'1111'
}
>
参会人员
</
InputItem
>
<
Picker
data=
{
[{
label
:
'是'
,
value
:
true
},
{
label
:
'否'
,
value
:
false
}]
}
cols=
{
1
}
{
...
getFieldProps
('
xb
')}
>
<
InputItem
disabled=
{
true
}
extra=
{
defaultV
.
title
&&
defaultV
.
title
}
>
标题
</
InputItem
>
<
InputItem
disabled=
{
true
}
extra=
{
'1111'
}
>
发送人
</
InputItem
>
<
InputItem
disabled=
{
true
}
extra=
{
defaultV
.
startTime
&&
moment
(
defaultV
.
startTime
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
>
请假开始时间
</
InputItem
>
<
InputItem
disabled=
{
true
}
extra=
{
defaultV
.
endTime
&&
moment
(
defaultV
.
endTime
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
>
请假结束时间
</
InputItem
>
{
/*<InputItem extra={'1111'}>参会人员</InputItem>*/
}
<
Picker
data=
{
[{
label
:
'审核通过'
,
value
:
2
},
{
label
:
'审核失败'
,
value
:
3
}]
}
cols=
{
1
}
{
...
getFieldProps
('
status
')}
>
<
List
.
Item
arrow=
"horizontal"
>
办理意见
</
List
.
Item
>
</
Picker
>
<
TextareaItem
title=
"内容"
rows=
{
4
}
{
...
getFieldProps
('
gzdh
')}
/>
</
List
>
</
form
>
<
div
className=
"event-footer"
>
...
...
@@ -63,4 +64,4 @@ const Send = (props) => {
);
};
export
default
createForm
()(
Send
);
export
default
createForm
()(
Receive
);
src/pages/Test/Send.jsx
View file @
fcb83a0a
import
React
,
{
useState
}
from
'react'
;
import
{
WingBlank
,
List
,
InputItem
,
WhiteSpace
,
DatePicker
}
from
'antd-mobile'
import
{
WingBlank
,
List
,
InputItem
,
WhiteSpace
,
DatePicker
,
Toast
}
from
'antd-mobile'
import
Document
from
'react-document-title'
;
import
moment
from
'moment'
import
axios
from
'axios'
...
...
@@ -19,17 +19,19 @@ const Send = (props) => {
keys
.
map
(
item
=>
{
!
values
[
item
]
&&
(
delete
values
[
item
]);
Array
.
isArray
(
values
[
item
])
&&
values
[
item
].
length
===
1
&&
(
values
[
item
]
=
values
[
item
][
0
]);
values
[
item
]
instanceof
Date
&&
(
values
[
item
]
=
moment
(
values
[
item
]).
format
(
"YYYY-MM-DD HH:mm:ss"
))
values
[
item
]
instanceof
Date
&&
(
values
[
item
]
=
moment
(
values
[
item
]).
valueOf
());
return
null
;
});
if
(
!
error
)
{
axios
.
post
(
'http://192.168.1.84:8889/department'
,
{}).
then
(
res
=>
{
console
.
log
(
res
)
values
.
toUid
=
sP
.
value
;
values
.
uid
=
'123fd'
;
axios
.
patch
(
'/demo/initiateApproval'
,
values
).
then
(
res
=>
{
res
.
data
.
success
&&
Toast
.
success
(
'提交成功'
)
})
}
});
};
const
[
sP
,
setSP
]
=
useState
(
[]
);
const
[
sP
,
setSP
]
=
useState
(
{}
);
const
[
personVisible
,
setPersonVisible
]
=
useState
(
false
);
return
(
<
Document
title=
"内部邮局"
>
...
...
@@ -43,18 +45,21 @@ const Send = (props) => {
<
WhiteSpace
/>
<
form
>
<
List
>
<
InputItem
>
标题
</
InputItem
>
<
InputItem
{
...
getFieldProps
('
title
')}
>
标题
</
InputItem
>
<
InputItem
value=
{
'123fd'
}
>
发送人
</
InputItem
>
<
DatePicker
mode=
"date"
className=
"send-date-style"
{
...
getFieldProps
('
gzrq
')}
>
<
List
.
Item
arrow=
"horizontal"
>
工作日期
</
List
.
Item
>
<
DatePicker
mode=
"date"
className=
"send-date-style"
{
...
getFieldProps
('
startTime
')}
>
<
List
.
Item
arrow=
"horizontal"
>
请假开始时间
</
List
.
Item
>
</
DatePicker
>
<
DatePicker
mode=
"date"
className=
"send-date-style"
{
...
getFieldProps
('
entTime
')}
>
<
List
.
Item
arrow=
"horizontal"
>
请假结束时间
</
List
.
Item
>
</
DatePicker
>
<
List
.
Item
className=
"auto-flex"
extra=
{
<
div
className=
"pos-aline"
>
<
div
className=
"meet-select-btn"
onClick=
{
()
=>
setPersonVisible
(
true
)
}
>
选择参会人员
</
div
>
<
div
className=
"ml-40 room-num"
>
{
sP
.
length
}
人
</
div
>
<
div
>
{
sP
.
name
}
</
div
>
</
div
>
}
>
参会人员
</
List
.
Item
>
<
InputItem
{
...
getFieldProps
('
gzdh
')}
>
工作电话
</
InputItem
>
{
/*<InputItem {...getFieldProps('gzdh')}>工作电话</InputItem>*/
}
</
List
>
</
form
>
<
div
className=
"event-footer"
>
...
...
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