Commit d475cdd7 authored by cellee's avatar cellee

PDF优化,限制增大

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 1608b66d
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-02-01 14:54:48 * @Date: 2021-02-01 14:54:48
* @LastEditTime: 2021-02-20 15:59:43 * @LastEditTime: 2021-02-22 16:54:18
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \tostumi\src\components\Form\PdfUpload.tsx * @FilePath: \tostumi\src\components\Form\PdfUpload.tsx
...@@ -33,7 +33,28 @@ const PdfUpload: React.FC<PriceInputProps> = ({ ...@@ -33,7 +33,28 @@ const PdfUpload: React.FC<PriceInputProps> = ({
action, action,
data, data,
}) => { }) => {
const [loading, setLoading] = useState([false, false, false, false, false]); // 上传中控制 const [loading, setLoading] = useState([
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
]); // 上传中控制
const [idx, setIdx] = useState(0); // 点击的第几个 const [idx, setIdx] = useState(0); // 点击的第几个
const [imgList, setImgList] = useState([] as any); // 列表 const [imgList, setImgList] = useState([] as any); // 列表
...@@ -62,6 +83,7 @@ const PdfUpload: React.FC<PriceInputProps> = ({ ...@@ -62,6 +83,7 @@ const PdfUpload: React.FC<PriceInputProps> = ({
], ],
tip: false, tip: false,
message: 'Required', message: 'Required',
descriptionId: detailvalue[i].descriptionId,
}; };
// 抽取相同的属性合并 // 抽取相同的属性合并
if (obj.length > 0) { if (obj.length > 0) {
...@@ -70,13 +92,18 @@ const PdfUpload: React.FC<PriceInputProps> = ({ ...@@ -70,13 +92,18 @@ const PdfUpload: React.FC<PriceInputProps> = ({
}); });
if (filterValue.length > 0) { if (filterValue.length > 0) {
obj.forEach((n: any) => { obj.forEach((n: any) => {
if (n.name == detailvalue[i].description) { if (
n.name == detailvalue[i].description &&
n.descriptionId == detailvalue[i].descriptionId
) {
n.fileList.push({ n.fileList.push({
uid: i, uid: i,
name: detailvalue[i].pdfName, name: detailvalue[i].pdfName,
status: 'done', status: 'done',
url: detailvalue[i].pdfUrl, url: detailvalue[i].pdfUrl,
}); });
} else {
obj.push(item);
} }
}); });
} else { } else {
...@@ -323,7 +350,7 @@ const PdfUpload: React.FC<PriceInputProps> = ({ ...@@ -323,7 +350,7 @@ const PdfUpload: React.FC<PriceInputProps> = ({
); );
})} })}
{imgList.length < 5 ? ( {imgList.length < 20 ? (
<div className="pdf-add"> <div className="pdf-add">
<Button <Button
type="dashed" type="dashed"
......
...@@ -48,16 +48,27 @@ export default { ...@@ -48,16 +48,27 @@ export default {
//标准请求 //标准请求
*RA({ playload }, { call, put }) { *RA({ playload }, { call, put }) {
const resp = yield call(service.RA, playload); const resp = yield call(service.RA, playload);
if (resp.error_code != '0000') { if (resp.error_code != '0000' && resp.error_code != '0002') {
getObjectInfo(playload.body); getObjectInfo(playload.body);
printf(playload, resp); printf(playload, resp);
message.error(`${resp.error_code}:${resp.error_msg}`); message.error(`${resp.error_code}:${resp.error_msg}`);
} else if (resp.error_code == '0002') {
// 小区被关闭后清空小区列表和缓存并返回列表重新获取
// 列表
let Data = null;
let village = null;
yield put({ type: 'returnPage', Data });
yield put({ type: 'returnVillage', village });
// 小区
let CommunityList = null;
yield put({ type: 'Init/returnCommunityList', CommunityList });
message.error(`${resp.error_code}:${resp.error_msg}`);
history.push('/CommunityManagement/CellList');
} else { } else {
switch (playload.index) { switch (playload.index) {
case 24: case 24:
{ {
let CommunityList = null; let CommunityList = null;
yield put({ type: 'Init/returnCommunityList', CommunityList });
let Data = resp.data; let Data = resp.data;
CommunityList = resp.data.communityList; CommunityList = resp.data.communityList;
yield put({ type: 'returnPage', Data }); yield put({ type: 'returnPage', Data });
......
...@@ -207,7 +207,7 @@ const Adds = (props: any) => { ...@@ -207,7 +207,7 @@ const Adds = (props: any) => {
: values.residentialPhone; : values.residentialPhone;
values.residentialHotlineName = residentialHotlineName values.residentialHotlineName = residentialHotlineName
? undeFi(residentialHotlineName) ? undeFi(residentialHotlineName)
: values.residentialManagerUserName; : 'Community Hotline';
// 没选的话就上面小区时间 // 没选的话就上面小区时间
if (time) { if (time) {
...@@ -413,6 +413,7 @@ const Adds = (props: any) => { ...@@ -413,6 +413,7 @@ const Adds = (props: any) => {
extends: codename, extends: codename,
}} }}
limitNums={1} limitNums={1}
over={codeStrat}
CommunityValue={Data && detailData && detailData.banner ? detailData.banner : null} CommunityValue={Data && detailData && detailData.banner ? detailData.banner : null}
// imgs={ImageSrc} // imgs={ImageSrc}
// disabled={codeStrat} // disabled={codeStrat}
...@@ -487,6 +488,7 @@ const Adds = (props: any) => { ...@@ -487,6 +488,7 @@ const Adds = (props: any) => {
name={'formsPdfList'} name={'formsPdfList'}
label="" label=""
colon={false} colon={false}
wrapperCol={{ span: 24 }}
style={{ marginBottom: 0 }} style={{ marginBottom: 0 }}
> >
<PdfUpload <PdfUpload
......
...@@ -235,6 +235,7 @@ const Detail = (props: any) => { ...@@ -235,6 +235,7 @@ const Detail = (props: any) => {
// extends: codename, // extends: codename,
}} }}
limitNums={1} limitNums={1}
over={true}
CommunityValue={detailData && detailData.banner ? detailData.banner : null} CommunityValue={detailData && detailData.banner ? detailData.banner : null}
// imgs={ImageSrc} // imgs={ImageSrc}
// disabled={codeStrat} // disabled={codeStrat}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment