Commit d475cdd7 authored by cellee's avatar cellee

PDF优化,限制增大

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 1608b66d
/*
* @Author: your name
* @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
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\components\Form\PdfUpload.tsx
......@@ -33,7 +33,28 @@ const PdfUpload: React.FC<PriceInputProps> = ({
action,
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 [imgList, setImgList] = useState([] as any); // 列表
......@@ -62,6 +83,7 @@ const PdfUpload: React.FC<PriceInputProps> = ({
],
tip: false,
message: 'Required',
descriptionId: detailvalue[i].descriptionId,
};
// 抽取相同的属性合并
if (obj.length > 0) {
......@@ -70,13 +92,18 @@ const PdfUpload: React.FC<PriceInputProps> = ({
});
if (filterValue.length > 0) {
obj.forEach((n: any) => {
if (n.name == detailvalue[i].description) {
if (
n.name == detailvalue[i].description &&
n.descriptionId == detailvalue[i].descriptionId
) {
n.fileList.push({
uid: i,
name: detailvalue[i].pdfName,
status: 'done',
url: detailvalue[i].pdfUrl,
});
} else {
obj.push(item);
}
});
} else {
......@@ -323,7 +350,7 @@ const PdfUpload: React.FC<PriceInputProps> = ({
);
})}
{imgList.length < 5 ? (
{imgList.length < 20 ? (
<div className="pdf-add">
<Button
type="dashed"
......
......@@ -48,16 +48,27 @@ export default {
//标准请求
*RA({ playload }, { call, put }) {
const resp = yield call(service.RA, playload);
if (resp.error_code != '0000') {
if (resp.error_code != '0000' && resp.error_code != '0002') {
getObjectInfo(playload.body);
printf(playload, resp);
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 {
switch (playload.index) {
case 24:
{
let CommunityList = null;
yield put({ type: 'Init/returnCommunityList', CommunityList });
let Data = resp.data;
CommunityList = resp.data.communityList;
yield put({ type: 'returnPage', Data });
......
......@@ -207,7 +207,7 @@ const Adds = (props: any) => {
: values.residentialPhone;
values.residentialHotlineName = residentialHotlineName
? undeFi(residentialHotlineName)
: values.residentialManagerUserName;
: 'Community Hotline';
// 没选的话就上面小区时间
if (time) {
......@@ -413,6 +413,7 @@ const Adds = (props: any) => {
extends: codename,
}}
limitNums={1}
over={codeStrat}
CommunityValue={Data && detailData && detailData.banner ? detailData.banner : null}
// imgs={ImageSrc}
// disabled={codeStrat}
......@@ -487,6 +488,7 @@ const Adds = (props: any) => {
name={'formsPdfList'}
label=""
colon={false}
wrapperCol={{ span: 24 }}
style={{ marginBottom: 0 }}
>
<PdfUpload
......
......@@ -235,6 +235,7 @@ const Detail = (props: any) => {
// extends: codename,
}}
limitNums={1}
over={true}
CommunityValue={detailData && detailData.banner ? detailData.banner : null}
// imgs={ImageSrc}
// 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