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
0c4521f1
Commit
0c4521f1
authored
Nov 23, 2020
by
cellee
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'final' of
http://120.77.240.215:9701/Maple/tostumi.git
into final
parents
43ce00ec
d49960c9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
20 deletions
+37
-20
PictureOptionsRow.tsx
src/components/PictureOptions/PictureOptionsRow.tsx
+13
-16
CommunityService.ts
src/models/CommunityManagement/CommunityService.ts
+22
-4
Users.tsx
src/pages/UserManagement/LIFEUserManagement/Users.tsx
+1
-0
ServiceProviderManagement.tsx
...t/ServiceProviderManagement/ServiceProviderManagement.tsx
+1
-0
No files found.
src/components/PictureOptions/PictureOptionsRow.tsx
View file @
0c4521f1
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
styles
from
'./index.less'
;
import
{
Upload
,
Modal
,
Row
,
Col
,
Input
,
List
,
Card
,
Button
,
message
}
from
'antd'
;
import
{
PlusOutlined
,
PictureFilled
}
from
'@ant-design/icons'
;
import
{
Upload
,
Modal
,
message
}
from
'antd'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
function
getBase64
(
file
)
{
function
getBase64
(
file
:
File
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
reader
=
new
FileReader
();
reader
.
readAsDataURL
(
file
);
...
...
@@ -21,7 +20,7 @@ const uploadButton = (
);
import
{
getUrlPicName
}
from
'../../utils/string'
;
const
PictureOptionsRow
=
(
props
:
any
)
=>
{
const
{
value
,
onChange
,
limitNums
,
over
}
=
props
;
const
{
value
,
onChange
,
limitNums
}
=
props
;
const
[
fileList
,
setFileList
]
=
useState
([]
as
any
);
const
[
previewVisible
,
setPreviewVisible
]
=
useState
(
false
);
const
[
previewImage
,
setPreviewImage
]
=
useState
(
''
);
...
...
@@ -98,7 +97,7 @@ const PictureOptionsRow = (props: any) => {
// }
// }, [value])
const
handlePreview
=
async
(
file
)
=>
{
const
handlePreview
=
async
(
file
:
any
)
=>
{
if
(
!
file
.
url
&&
!
file
.
preview
)
{
file
.
preview
=
await
getBase64
(
file
.
originFileObj
);
}
...
...
@@ -106,16 +105,15 @@ const PictureOptionsRow = (props: any) => {
setPreviewVisible
(
true
);
};
const
handleChange
=
({
file
,
fileList
})
=>
{
const
handleChange
=
({
file
,
fileList
}
:
any
)
=>
{
// 给传递的附加名字
// props.data.fileName = fileList[0].name;
let
tmp
=
fileList
;
setFileList
(
tmp
.
filter
((
file
)
=>
!!
file
.
status
||
file
.
status
==
null
));
setFileList
(
tmp
.
filter
((
file
:
any
)
=>
!!
file
.
status
||
file
.
status
==
null
));
var
result
=
new
Array
();
fileList
.
map
((
item
,
index
)
=>
{
fileList
.
map
((
item
:
{
name
:
string
},
index
:
number
)
=>
{
result
.
push
(
item
.
name
);
});
onChange
(
result
);
};
function
beforeUpload
(
file
:
any
)
{
...
...
@@ -126,12 +124,11 @@ const PictureOptionsRow = (props: any) => {
message
.
error
(
'You can only upload JPG/PNG file!'
);
}
// 文件大小判断
// const isLt2M = file.size / 1024 / 1024 < 2;
// if (!isLt2M) {
// message.error('Image must smaller than 2MB!');
// }
// return isJpgOrPng && isLt2M;
return
isJpgOrPng
;
const
isLt2M
=
file
.
size
/
1024
/
1024
<
2
;
if
(
!
isLt2M
)
{
message
.
error
(
'Image must smaller than 2MB!'
);
}
return
isJpgOrPng
&&
isLt2M
;
}
return
(
...
...
src/models/CommunityManagement/CommunityService.ts
View file @
0c4521f1
...
...
@@ -74,16 +74,34 @@ export default {
var
tmp
=
resp
.
data
.
tosOwerModel
;
var
tmp2
=
resp
.
data
;
console
.
log
(
resp
);
var
CurDataDetail
=
{
if
(
!
tmp
)
{
message
.
error
(
'Data loading error!'
);
history
.
go
(
-
1
);
return
;
}
var
CurDataDetail
:
{
community
:
string
;
address
:
string
;
home
:
string
;
name
:
string
;
phone
:
string
;
email
:
string
;
content
:
string
;
replyContent
:
string
;
replyImgUrl
:
string
[];
status
:
number
;
pictrues
:
string
[];
time
:
string
;
}
=
{
community
:
tmp
.
communityName
,
address
:
tmp
.
addressAndpostalCode
,
home
:
tmp
.
buildingNumber
+
' #'
+
tmp
.
floorNumber
+
'-'
+
tmp
.
roomNumber
,
name
:
tmp
.
owerName
,
phone
:
tmp
.
owerPhone
,
email
:
tmp
.
owerEmail
,
content
:
resp
.
data
.
serviceContent
,
replyContent
:
resp
.
data
.
replyContent
,
replyImgUrl
:
Fromate
(
resp
.
data
.
replyImgUrl
,
[[
'url'
,
null
]]),
content
:
tmp2
.
serviceContent
,
replyContent
:
tmp2
.
replyContent
,
replyImgUrl
:
Fromate
(
tmp2
.
replyImgUrl
,
[[
'url'
,
null
]]),
status
:
tmp2
.
handleStatus
,
pictrues
:
picFromate
(
tmp2
.
imgUrl
),
time
:
timestampToTime4
(
tmp2
.
createTime
.
time
),
...
...
src/pages/UserManagement/LIFEUserManagement/Users.tsx
View file @
0c4521f1
...
...
@@ -145,6 +145,7 @@ const Users = (props: any) => {
// 监听小区列表是否回来
useEffect
(()
=>
{
if
(
CommunityList
&&
flag
===
false
)
{
readyData
.
serviceCommunityList
=
[];
flag
=
true
;
getList
(
CommunityList
);
}
...
...
src/pages/UserManagement/ServiceProviderManagement/ServiceProviderManagement.tsx
View file @
0c4521f1
...
...
@@ -172,6 +172,7 @@ const ServiceProviderManagement = (props: propsType) => {
// 监听小区数据
useEffect
(()
=>
{
if
(
CommunityList
&&
flag
===
false
)
{
readyData
.
serviceCommunityList
=
[];
flag
=
true
;
setLoading
(
true
);
TosTosServiceProviderGet
();
...
...
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