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
efdf776a
Commit
efdf776a
authored
Nov 19, 2020
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复bug
Signed-off-by:
cellee
<
893264950@qq.com
>
parent
0182b877
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
344 additions
and
152 deletions
+344
-152
PictureOptionsRow.tsx
src/components/PictureOptions/PictureOptionsRow.tsx
+14
-8
index.jsx
src/components/SelectOptions/index.jsx
+18
-0
Add.tsx
src/pages/CommunityManagement/CommunityAnnouncement/Add.tsx
+4
-4
CommunityAnnouncement.tsx
...anagement/CommunityAnnouncement/CommunityAnnouncement.tsx
+9
-19
Detail copy.tsx
...CommunityManagement/CommunityAnnouncement/Detail copy.tsx
+150
-0
Detail.tsx
...ages/CommunityManagement/CommunityAnnouncement/Detail.tsx
+124
-113
ContractContent.tsx
src/pages/ContractManagement/ContractContent.tsx
+25
-8
No files found.
src/components/PictureOptions/PictureOptionsRow.tsx
View file @
efdf776a
...
...
@@ -118,14 +118,20 @@ const PictureOptionsRow = (props: any) => {
onChange
(
result
);
};
const
beforeUpload
=
(
file
:
any
)
=>
{
if
(
file
.
type
===
'image/png'
||
file
.
type
===
'image/jpeg'
||
file
.
type
===
'image/jpg'
)
{
return
true
;
}
else
{
message
.
error
(
`
${
file
.
name
}
is not a png/jpeg/jpg file`
);
return
false
;
function
beforeUpload
(
file
:
any
)
{
// 文件类型判断
const
isJpgOrPng
=
file
.
type
===
'image/jpeg'
||
file
.
type
===
'image/png'
||
file
.
type
===
'image/jpg'
;
if
(
!
isJpgOrPng
)
{
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
(
<
div
>
...
...
@@ -136,9 +142,9 @@ const PictureOptionsRow = (props: any) => {
data=
{
props
.
data
}
fileList=
{
fileList
}
onPreview=
{
handlePreview
}
beforeUpload=
{
beforeUpload
}
onChange=
{
handleChange
}
disabled=
{
props
.
over
}
beforeUpload=
{
beforeUpload
}
>
{
fileList
.
length
>=
limitNum
?
null
:
props
.
disabled
?
null
:
uploadButton
}
</
Upload
>
...
...
src/components/SelectOptions/index.jsx
View file @
efdf776a
...
...
@@ -264,6 +264,22 @@ class SelectOptions extends React.PureComponent {
this
.
setState
({
checkedListOptions
:
tempAarry
,
});
//小区内部搜索框键盘回车事件阻止冒泡
// e.domEvent.stopPropagation();
};
// 小区内部搜索框回车事件
onPressEnter
=
(
e
)
=>
{
this
.
getSearchValue
(
this
.
state
.
inputText
);
e
.
preventDefault
();
};
//小区内部搜索框输入赋值
SearchChange
=
(
e
)
=>
{
this
.
setState
({
inputText
:
e
.
target
.
value
,
});
};
render
()
{
...
...
@@ -380,6 +396,8 @@ class SelectOptions extends React.PureComponent {
placeholder=
{
this
.
state
.
selectoptionsSearchCell
}
onSearch=
{
this
.
getSearchValue
.
bind
(
this
)
}
style=
{
{
width
:
200
,
margin
:
'10px'
}
}
onPressEnter=
{
this
.
onPressEnter
}
onChange=
{
this
.
SearchChange
}
/>
<
CheckboxGroup
options=
{
this
.
state
.
checkedListOptions
}
// 所有数组
...
...
src/pages/CommunityManagement/CommunityAnnouncement/Add.tsx
View file @
efdf776a
...
...
@@ -54,7 +54,7 @@ const Add = (props: any) => {
// 解除结束时间不可选
settimeT
(
false
);
// 图片名
setImageName
(
DataSave
.
noticImageName
.
split
(
','
)
);
setImageName
(
DataSave
.
noticImageName
);
}
},
[
DataSave
]);
...
...
@@ -115,12 +115,12 @@ const Add = (props: any) => {
tmp
.
creatorId
=
getCookie
(
'id'
);
// 管理员 ID
tmp
.
communityNum
=
values
.
community
.
value
;
tmp
.
noticScope
=
''
+
values
.
community
.
index
;
delete
tmp
.
community
;
// 文件名 如果动了。 新增删除 就传新的, 否则传旧的
tmp
.
noticImageName
=
values
.
file
?
values
.
file
:
ImageName
.
join
(
','
)
;
// 传递来的 和 表单的在一起
tmp
.
noticImageName
=
values
.
file
?
values
.
file
:
ImageName
;
// 传递来的 和 表单的在一起
tmp
.
noticStartTime
=
values
.
noticStartTime
.
format
(
'YYYY-MM-DD'
);
tmp
.
noticEndTime
=
values
.
noticEndTime
?
values
.
noticEndTime
.
format
(
'YYYY-MM-DD'
)
:
null
;
delete
tmp
.
community
;
delete
tmp
.
file
;
RA
(
28
,
tmp
,
module
,
dispatch
);
};
...
...
src/pages/CommunityManagement/CommunityAnnouncement/CommunityAnnouncement.tsx
View file @
efdf776a
...
...
@@ -10,22 +10,6 @@ import { RA, SA } from '@/utils/method';
import
{
timestampToTime3
,
timestampToTime
}
from
'@/utils/time'
;
import
SearchOptionsCommnity
from
'@/components/SearchOptions/SearchOptionsCommnity'
;
// communityNum: "A7"
// count: 0
// createTime: "Jul 8, 2020 7:38:37 PM"
// deleted: 0
// extend: ""
// id: "2f9b5e98a2ea4b79b75242b1b34301bd"
// noticEndTime: "Aug 23, 2020 7:38:29 PM"
// noticImageName: "3.jpg"
// noticScope: 0
// noticStartTime: "Aug 20, 2020 7:38:26 PM"
// noticText: "噶防范发更好覅单号梵蒂冈很反感辅导班梵蒂冈房管局覅北京饭店个法币发动机盖我甲方的GV第八届发第十九GIF大锅饭"
// noticTitlel: "大家好,今年端午节不放假"
// updateTime: "Jun 28, 2020 7:38:39 PM"
// import { RA } from '@/utils/method';
const
module
=
'CommunityAnnouncement'
;
const
CommunityAnnouncement
=
(
props
:
any
)
=>
{
const
{
dispatch
,
Data
,
curString
,
userListLoading
,
DataSaveDetail
}
=
props
;
...
...
@@ -192,6 +176,11 @@ const CommunityAnnouncement = (props: any) => {
SA
(
DetailPage
(
mlist
),
module
,
dispatch
);
};
const
onKeyUp
=
(
value
)
=>
{
console
.
log
(
value
);
return
false
;
};
return
(
<>
<
div
style=
{
{
width
:
'100%'
,
padding
:
20
,
marginBottom
:
15
,
backgroundColor
:
'#ffffff'
}
}
>
...
...
@@ -201,6 +190,7 @@ const CommunityAnnouncement = (props: any) => {
form=
{
form
}
name=
"contract"
onFinish=
{
onFinishContract
}
onKeyUp=
{
onKeyUp
}
>
<
Form
.
Item
name=
"communityNumList"
>
<
SearchOptionsCommnity
...
...
@@ -258,8 +248,8 @@ const CommunityAnnouncement = (props: any) => {
</
Button
>,
]
}
options=
{
{
density
:
tru
e
,
fullScreen
:
tru
e
,
density
:
fals
e
,
fullScreen
:
fals
e
,
reload
:
()
=>
{
onReset
();
},
...
...
@@ -272,7 +262,7 @@ const CommunityAnnouncement = (props: any) => {
current=
{
Data
?
Data
.
page
.
currentPage
:
0
}
total=
{
Data
?
Data
.
page
.
totalRow
:
0
}
onChange=
{
paginationHandler
}
pageSizeOptions=
{
[
'15'
]
}
showSizeChanger=
{
false
}
// showSizeChanger={false}
pageSize=
{
Data
?
Data
.
page
.
curPageSize
:
10
}
/>
...
...
src/pages/CommunityManagement/CommunityAnnouncement/Detail copy.tsx
0 → 100644
View file @
efdf776a
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
connect
,
history
}
from
'umi'
;
import
{
Button
,
Row
,
Col
,
Descriptions
,
Image
,
Badge
,
Tag
,
Spin
}
from
'antd'
;
import
{
LeftOutlined
,
EyeOutlined
}
from
'@ant-design/icons'
;
import
'./ann.less'
;
import
moment
from
'moment'
;
import
imgs
from
'@/assets/logo_icon_bg.png'
;
import
{
RA
}
from
'@/utils/method'
;
import
{
getDetailCommunityList
}
from
'@/services/tosUser'
;
const
module
=
'CommunityAnnouncement'
;
const
Detail
=
(
props
:
any
)
=>
{
const
{
dispatch
,
loading
,
DataSave
,
ImgSrc
}
=
props
;
// 返回
const
goToReturn
=
()
=>
{
history
.
go
(
-
1
);
};
// 监听传递过来的值
useEffect
(()
=>
{
if
(
DataSave
==
null
)
{
history
.
push
(
'/CommunityManagement/CommunityAnnouncement'
);
}
else
{
// 发起请求图片地址
let
msg
=
{
// userToken: '',
// type: ans.substr(ans.lastIndexOf('.') + 1),
type
:
'tosCommunityNoticePreview'
,
fileName
:
DataSave
.
noticImageName
,
};
RA
(
47
,
msg
,
module
,
dispatch
);
}
},
[
DataSave
]);
// 图片地址
const
[
ImageSrc
,
setImageSrc
]
=
useState
(
imgs
);
// 监听图片状态 ImgSrc
useEffect
(()
=>
{
if
(
ImgSrc
!=
null
)
{
setImageSrc
(
ImgSrc
);
}
},
[
ImgSrc
]);
// 状态返回
function
hanFunStart
(
start
:
any
)
{
switch
(
start
)
{
case
1
:
return
<
Badge
status=
"success"
text=
"Take effect"
/>;
// <Tag color="green">Publishing</Tag>; // 发布中
break
;
case
2
:
return
<
Badge
status=
"error"
text=
"Invalid"
/>;
// 已过期
break
;
default
:
return
<
Badge
status=
"processing"
text=
"Waiting For Release"
/>;
// 等待发布
break
;
}
}
//小区返回
function
CommunityLists
(
list
:
any
)
{
let
listBack
=
list
.
split
(
','
).
map
((
item
:
any
,
index
:
any
)
=>
{
let
last
:
number
=
parseInt
(
index
%
10
);
return
(
<
Tag
color=
{
`#${last}b0`
}
style=
{
{
marginBottom
:
3
}
}
key=
{
index
}
>
{
item
}
</
Tag
>
);
});
return
listBack
;
}
return
(
<>
{
DataSave
!=
null
?
(
<
div
className=
"form"
>
{
/* 头部 */
}
<
h3
>
<
EyeOutlined
/>
Notice Details
<
div
className=
"back"
>
<
Button
onClick=
{
goToReturn
}
>
<
LeftOutlined
/>
Back
</
Button
>
</
div
>
</
h3
>
<
hr
/>
{
/* 内容 */
}
<
Row
>
<
Col
span=
{
12
}
>
<
Descriptions
title=
"Notice Info"
layout=
"vertical"
bordered
>
{
/* 标题 */
}
<
Descriptions
.
Item
label=
"Title:"
span=
{
2
}
>
{
DataSave
.
noticTitlel
}
</
Descriptions
.
Item
>
{
/* 发布者 */
}
<
Descriptions
.
Item
label=
"Publisher:"
>
{
DataSave
.
creator
}
</
Descriptions
.
Item
>
{
/* 生效时间 */
}
<
Descriptions
.
Item
label=
"Effective Dates:"
>
{
moment
(
DataSave
.
noticStartTime
.
time
).
format
(
'YYYY-MM-DD'
)
}
</
Descriptions
.
Item
>
{
/* 结束时间 */
}
<
Descriptions
.
Item
label=
"Expiration Date:"
>
{
DataSave
.
noticEndTime
!=
null
?
moment
(
DataSave
.
noticEndTime
.
time
).
format
(
'YYYY-MM-DD'
)
:
'Permanent'
}
</
Descriptions
.
Item
>
{
/* 状态 */
}
<
Descriptions
.
Item
label=
"NoticScope:"
span=
{
3
}
>
{
hanFunStart
(
DataSave
.
noticStatus
)
}
</
Descriptions
.
Item
>
{
/* 生效小区 */
}
<
Descriptions
.
Item
label=
"Effective Community:"
span=
{
3
}
>
{
CommunityLists
(
DataSave
.
communityNum
)
}
</
Descriptions
.
Item
>
{
/* 内容 */
}
<
Descriptions
.
Item
label=
"Notice Content:"
span=
{
3
}
>
<
p
>
{
DataSave
.
noticText
}
</
p
>
</
Descriptions
.
Item
>
</
Descriptions
>
</
Col
>
<
Col
span=
{
12
}
style=
{
{
textAlign
:
'center'
}
}
>
<
div
className=
"famg"
>
<
div
>
<
Spin
spinning=
{
loading
}
>
<
Image
width=
{
200
}
src=
{
ImageSrc
}
/>
</
Spin
>
<
p
>
Enclosure
</
p
>
</
div
>
</
div
>
</
Col
>
</
Row
>
</
div
>
)
:
(
''
)
}
</>
);
};
function
map
(
state
:
any
)
{
// console.log(state);
const
{
DataSave
,
ImgSrc
}
=
state
[
module
];
const
loading
=
state
.
loading
.
models
.
CommunityAnnouncement
;
return
{
loading
,
DataSave
,
ImgSrc
};
}
export
default
connect
(
map
)(
Detail
);
src/pages/CommunityManagement/CommunityAnnouncement/Detail.tsx
View file @
efdf776a
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Input
,
Tabs
,
message
,
Form
,
Button
,
DatePicker
,
Spin
}
from
'antd'
;
const
{
TabPane
}
=
Tabs
;
import
{
connect
,
history
}
from
'umi'
;
import
{
Button
,
Row
,
Col
,
Descriptions
,
Image
,
Badge
,
Tag
,
Spin
}
from
'antd'
;
import
{
LeftOutlined
,
EyeOutlined
}
from
'@ant-design/icons'
;
import
{
RA
,
SA
}
from
'@/utils/method'
;
import
TitleBack
from
'@/components/TitleBack/TitleBack'
;
// import FileUpload from '@/components/FileUpload/FileUpload';
import
{
validateMessages
}
from
'@/utils/params'
;
import
PictureOptionsRow
from
'@/components/PictureOptions/PictureOptionsRow'
;
import
TextArea
from
'antd/lib/input/TextArea'
;
import
SelectCommunity
from
'@/components/SelectCommunity'
;
// import Line from '@/components/Line/Line';
// import TimeComfirm from '@/components/TimeComfirm/TimeComfirm';
import
imgs
from
'@/assets/logo_icon_bg.png'
;
import
'./ann.less'
;
import
{
Notice
}
from
'@/utils/tip'
;
import
{
getCookie
}
from
'@/utils/method'
;
import
moment
from
'moment'
;
import
imgs
from
'@/assets/logo_icon_bg.png'
;
import
{
RA
}
from
'@/utils/method'
;
import
{
getDetailCommunityList
}
from
'@/services/tosUser'
;
import
ShowOptions
from
'@/components/ShowOptions/index'
;
const
module
=
'CommunityAnnouncement'
;
const
Detail
=
(
props
:
any
)
=>
{
const
{
dispatch
,
loading
,
DataSave
,
ImgSrc
}
=
props
;
const
Add
=
(
props
:
any
)
=>
{
const
{
dispatch
,
Result
,
loading
,
DataSave
,
ImgSrc
}
=
props
;
const
formRef
=
useRef
(
null
);
const
[
form
]
=
Form
.
useForm
();
// 返回
const
goToReturn
=
()
=>
{
history
.
go
(
-
1
);
};
const
[
ImageSrc
,
setImageSrc
]
=
useState
([]
as
any
);
// 图片显示地址
const
[
ImageName
,
setImageName
]
=
useState
([]
as
any
);
// 全部图片名称
const
[
timeT
,
settimeT
]
=
useState
(
true
);
// 结束时间是否禁止选择
const
[
timeOver
,
settimeOver
]
=
useState
(
1
);
// 结束时间禁止天数
// 监听传递过来的值
useEffect
(()
=>
{
if
(
DataSave
==
null
)
{
history
.
push
(
'/CommunityManagement/CommunityAnnouncement'
);
}
else
{
// 发起请求图片地址
let
day
=
moment
(
DataSave
.
noticStartTime
.
time
);
let
day2
=
DataSave
.
noticEndTime
?
moment
(
DataSave
.
noticEndTime
.
time
)
:
null
;
// 赋值
form
.
setFieldsValue
({
noticTitle
:
DataSave
.
noticTitlel
,
noticText
:
DataSave
.
noticText
,
noticStartTime
:
day
,
noticEndTime
:
day2
,
});
// 发起请求图片
let
msg
=
{
// userToken: '',
// type: ans.substr(ans.lastIndexOf('.') + 1),
type
:
'tosCommunityNoticePreview'
,
fileName
:
DataSave
.
noticImageName
,
};
RA
(
47
,
msg
,
module
,
dispatch
);
// 解除结束时间不可选
settimeT
(
false
);
// 图片名
setImageName
(
DataSave
.
noticImageName
);
}
},
[
DataSave
]);
// 图片地址
const
[
ImageSrc
,
setImageSrc
]
=
useState
(
imgs
);
// 监听图片状态 ImgSrc
useEffect
(()
=>
{
if
(
ImgSrc
!=
null
)
{
setImageSrc
(
ImgSrc
);
}
},
[
ImgSrc
]);
let
a
=
ImgSrc
.
map
((
item
:
any
,
index
:
number
)
=>
{
let
key
=
Object
.
keys
(
item
)[
0
];
return
{
uid
:
index
,
name
:
key
,
status
:
'done'
,
url
:
item
[
key
],
};
});
// 状态返回
function
hanFunStart
(
start
:
any
)
{
switch
(
start
)
{
case
1
:
return
<
Badge
status=
"success"
text=
"Take effect"
/>;
// <Tag color="green">Publishing</Tag>; // 发布中
break
;
case
2
:
return
<
Badge
status=
"error"
text=
"Invalid"
/>;
// 已过期
break
;
default
:
return
<
Badge
status=
"processing"
text=
"Waiting For Release"
/>;
// 等待发布
break
;
// 图片列表
setImageSrc
(
a
);
}
}
//小区返回
function
CommunityLists
(
list
:
any
)
{
let
listBack
=
list
.
split
(
','
).
map
((
item
:
any
,
index
:
any
)
=>
{
let
last
:
number
=
parseInt
(
index
%
10
);
return
(
<
Tag
color=
{
`#${last}b0`
}
style=
{
{
marginBottom
:
3
}
}
key=
{
index
}
>
{
item
}
</
Tag
>
);
});
return
listBack
;
}
},
[
ImgSrc
]);
return
(
<>
{
DataSave
!=
null
?
(
<
div
className=
"form"
>
{
/* 头部 */
}
<
h3
>
<
EyeOutlined
/>
Notice Details
<
div
className=
"back"
>
<
Button
onClick=
{
goToReturn
}
>
<
LeftOutlined
/>
Back
<
Spin
spinning=
{
loading
}
>
<
div
style=
{
{
width
:
'100%'
,
padding
:
20
,
backgroundColor
:
'#ffffff'
}
}
>
<
TitleBack
title=
{
'Detail Announcement'
}
></
TitleBack
>
<
Form
ref=
{
formRef
}
form=
{
form
}
// {...layout}
validateMessages=
{
validateMessages
}
>
<
Form
.
Item
name=
{
'community'
}
className=
"diyItem"
label=
"Community"
rules=
{
Notice
[
0
]
}
>
<
ShowOptions
list=
{
DataSave
?
DataSave
.
communityNum
.
split
(
','
)
:
[]
}
defaultValue=
{
'Put It Away'
}
></
ShowOptions
>
</
Form
.
Item
>
<
Form
.
Item
name=
"noticTitle"
className=
"diyItem"
label=
"Notice Title"
rules=
{
Notice
[
1
]
}
>
<
Input
style=
{
{
width
:
200
}
}
placeholder=
"Please input the notice title"
disabled
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"noticText"
className=
"diyItem"
label=
"Notice Content"
rules=
{
Notice
[
2
]
}
>
<
TextArea
style=
{
{
height
:
100
,
maxWidth
:
600
}
}
maxLength=
{
1000
}
showCount=
{
true
}
disabled
placeholder=
"Please input the announcement content"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
{
'file'
}
className=
"diyItem"
label=
" "
colon=
{
false
}
>
<
PictureOptionsRow
action=
"/tos/image/upload"
data=
{
{
imageType
:
'tosNotice'
,
}
}
limitNums=
{
5
}
over=
{
true
}
defaultValue=
{
ImageSrc
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"noticStartTime"
className=
"diyItem"
label=
"Effective Dates"
rules=
{
Notice
[
3
]
}
>
<
DatePicker
style=
{
{
width
:
200
}
}
placeholder=
"Effective Dates"
disabled
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"noticEndTime"
className=
"diyItem"
label=
"Expiration Date"
rules=
{
[]
}
>
<
DatePicker
style=
{
{
width
:
200
}
}
placeholder=
"Expiration Dates"
disabled
/>
</
Form
.
Item
>
<
hr
/>
<
Form
.
Item
style=
{
{
marginBottom
:
5
}
}
className=
"diyItem"
label=
" "
colon=
{
false
}
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
loading
}
disabled
>
Submit
</
Button
>
</
div
>
</
h3
>
<
hr
/>
{
/* 内容 */
}
<
Row
>
<
Col
span=
{
12
}
>
<
Descriptions
title=
"Notice Info"
layout=
"vertical"
bordered
>
{
/* 标题 */
}
<
Descriptions
.
Item
label=
"Title:"
span=
{
2
}
>
{
DataSave
.
noticTitlel
}
</
Descriptions
.
Item
>
{
/* 发布者 */
}
<
Descriptions
.
Item
label=
"Publisher:"
>
{
DataSave
.
creator
}
</
Descriptions
.
Item
>
{
/* 生效时间 */
}
<
Descriptions
.
Item
label=
"Effective Dates:"
>
{
moment
(
DataSave
.
noticStartTime
.
time
).
format
(
'YYYY-MM-DD'
)
}
</
Descriptions
.
Item
>
{
/* 结束时间 */
}
<
Descriptions
.
Item
label=
"Expiration Date:"
>
{
DataSave
.
noticEndTime
!=
null
?
moment
(
DataSave
.
noticEndTime
.
time
).
format
(
'YYYY-MM-DD'
)
:
'Permanent'
}
</
Descriptions
.
Item
>
{
/* 状态 */
}
<
Descriptions
.
Item
label=
"NoticScope:"
span=
{
3
}
>
{
hanFunStart
(
DataSave
.
noticStatus
)
}
</
Descriptions
.
Item
>
{
/* 生效小区 */
}
<
Descriptions
.
Item
label=
"Effective Community:"
span=
{
3
}
>
{
CommunityLists
(
DataSave
.
communityNum
)
}
</
Descriptions
.
Item
>
{
/* 内容 */
}
<
Descriptions
.
Item
label=
"Notice Content:"
span=
{
3
}
>
<
p
>
{
DataSave
.
noticText
}
</
p
>
</
Descriptions
.
Item
>
</
Descriptions
>
</
Col
>
<
Col
span=
{
12
}
style=
{
{
textAlign
:
'center'
}
}
>
<
div
className=
"famg"
>
<
div
>
<
Spin
spinning=
{
loading
}
>
<
Image
width=
{
200
}
src=
{
ImageSrc
}
/>
</
Spin
>
<
p
>
Enclosure
</
p
>
</
div
>
</
div
>
</
Col
>
</
Row
>
</
Form
.
Item
>
</
Form
>
</
div
>
)
:
(
''
)
}
</
Spin
>
</>
);
};
function
map
(
state
:
any
)
{
// console.log(state);
const
{
DataSave
,
ImgSrc
}
=
state
[
module
];
const
loading
=
state
.
loading
.
models
.
CommunityAnnouncement
;
return
{
loading
,
DataSave
,
ImgSrc
};
const
{
Result
,
DataSave
,
ImgSrc
}
=
state
[
module
];
const
loading
=
state
.
loading
.
models
.
CommunityAnnouncement
?
state
.
loading
.
models
.
CommunityAnnouncement
:
false
;
return
{
Result
,
loading
,
DataSave
,
ImgSrc
};
}
export
default
connect
(
map
)(
Detail
);
export
default
connect
(
map
)(
Add
);
src/pages/ContractManagement/ContractContent.tsx
View file @
efdf776a
...
...
@@ -165,16 +165,14 @@ const ContractContent = (props: any) => {
action
:
'/tos/image/upload'
,
data
:
{
imageType
:
'tosContract'
,
extends
:
comtyName
},
fileList
:
fileList
,
onChange
({
file
,
fileList
}:
{
file
:
any
;
fileList
:
any
})
{
setFileList
(
fileList
);
// 添加到表单
form
.
setFieldsValue
({
upload
:
'ok'
,
});
onChange
:
({
file
,
fileList
}:
{
file
:
any
;
fileList
:
any
})
=>
{
if
(
file
.
status
==
'done'
)
{
message
.
success
(
file
.
name
,
3
);
setFileList
(
fileList
);
// 添加到表单
form
.
setFieldsValue
({
upload
:
'ok'
,
});
}
},
};
...
...
@@ -248,6 +246,24 @@ const ContractContent = (props: any) => {
setPageNumber
(
page
);
};
// 文件上传判断
function
beforeUpload
(
file
:
any
)
{
// 文件类型判断
const
isJpgOrPng
=
file
.
type
===
'image/jpeg'
||
file
.
type
===
'image/png'
||
file
.
type
===
'image/jpg'
;
if
(
!
isJpgOrPng
)
{
message
.
error
(
'You can only upload JPG/PNG file!'
);
return
false
;
}
// 文件大小判断
const
isLt2M
=
file
.
size
/
1024
/
1024
<
2
;
if
(
!
isLt2M
)
{
message
.
error
(
'Image must smaller than 2MB!'
);
return
false
;
}
return
isJpgOrPng
&&
isLt2M
;
}
return
(
<>
<
Spin
spinning=
{
loading
}
>
...
...
@@ -360,6 +376,7 @@ const ContractContent = (props: any) => {
{
...
uploadProps
}
listType=
{
'picture-card'
}
disabled=
{
uploadUp
}
beforeUpload=
{
beforeUpload
}
onPreview=
{
onPreviews
}
>
{
fileList
.
length
>=
3
?
null
:
<
PlusOutlined
/>
}
...
...
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