Commit de1b8180 authored by cellee's avatar cellee

修复bug 以及在线预览

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 3ed477eb
declare module 'react-file-viewer'; declare module 'react-file-viewer';
declare module 'react-pdf';
...@@ -290,27 +290,6 @@ const Account = (props: any) => { ...@@ -290,27 +290,6 @@ const Account = (props: any) => {
/> />
</div> </div>
</div> </div>
{/* 确认关闭账号 */}
<Modal
title="Operation Tips"
visible={over}
okText={'Confirm'}
cancelText={'Cancel'}
onOk={handleOk}
onCancel={handleCancel}
confirmLoading={loading}
>
{accountName != null ? (
<p>
Are You Sure To{' '}
<span style={{ color: 'red' }}>{accountName.userStatus != 1 ? 'Close' : 'Open'}</span>{' '}
The Account '<span style={{ color: 'red' }}> {accountName.tosUserName} </span>' ?
</p>
) : (
''
)}
</Modal>
</> </>
); );
}; };
......
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { Form, Input, Button, Spin, message, Descriptions, Checkbox, Tree, Radio } from 'antd'; import { Form, Input, Button, Spin, message, Descriptions, Modal, Tree, Radio } from 'antd';
import { connect, history } from 'umi'; import { connect, history } from 'umi';
import { SearchOutlined, PoweroffOutlined, EditOutlined, LeftOutlined } from '@ant-design/icons'; import { SearchOutlined, PoweroffOutlined, EditOutlined, LeftOutlined } from '@ant-design/icons';
import { getCookie } from '@/utils/method'; import { getCookie } from '@/utils/method';
...@@ -33,6 +33,9 @@ const Account = (props: any) => { ...@@ -33,6 +33,9 @@ const Account = (props: any) => {
// 已选小区 // 已选小区
const [ServiceCell, setServiceCell] = useState(null as any); const [ServiceCell, setServiceCell] = useState(null as any);
const [over, setOver] = useState(false); // 关闭账号确认弹窗
const [accountName, setaccountName] = useState(null as any); // 弹窗账号信息
// 表单标识 // 表单标识
const [form] = Form.useForm(); const [form] = Form.useForm();
const formRef = useRef(null); const formRef = useRef(null);
...@@ -110,6 +113,25 @@ const Account = (props: any) => { ...@@ -110,6 +113,25 @@ const Account = (props: any) => {
} }
}, [Permission]); }, [Permission]);
// 监听改变状态提交结果
useEffect(() => {
if (Result != null) {
// console.log('改变取消弹窗重新加载,在清空结果');
// let obj = {
// userStatus: accountName.userStatus == 0 ? 1 : 0,
// userID: accountName.tosUserId,
// };
// RA(52, obj);
message.success('Successful Operation !');
setOver(false);
// 清除结果
dispatch({ type: 'Account/ResultClear' });
dispatch({ type: 'Account/ReData' });
// 退回列表
history.push('/AccountManagement/account');
}
}, [Result]);
// 保存提交 // 保存提交
const onFinishContract = async (value: any) => { const onFinishContract = async (value: any) => {
// console.log(value); // console.log(value);
...@@ -133,7 +155,7 @@ const Account = (props: any) => { ...@@ -133,7 +155,7 @@ const Account = (props: any) => {
value.creatorId = getCookie('id'); //新建者ID value.creatorId = getCookie('id'); //新建者ID
delete value.community; delete value.community;
// console.log(value); // console.log(value);
value.id = DataSave.id;
// 另传权限 // 另传权限
let obj = { let obj = {
userName: value.tosUserName, userName: value.tosUserName,
...@@ -195,7 +217,28 @@ const Account = (props: any) => { ...@@ -195,7 +217,28 @@ const Account = (props: any) => {
const keyup_tool = (value: any) => { const keyup_tool = (value: any) => {
return getNumber(value.replace(/[^\d^\.]+/g, '')); return getNumber(value.replace(/[^\d^\.]+/g, ''));
}; };
// 选择小区名字并赋值 // 停用账号弹窗
const lockS = () => {
setOver(true);
setaccountName(DataSave);
console.log(DataSave);
};
// 关闭弹窗
const handleCancel = (e: any) => {
setOver(false);
};
// 弹窗 提交确认账号打开关闭
const handleOk = (e: any) => {
//
let obj = {
userStatus: accountName.userStatus == 0 ? 1 : 0,
userID: accountName.tosUserId,
};
RA(52, obj, module, dispatch);
// setOver(false);
};
return ( return (
<Spin spinning={loading}> <Spin spinning={loading}>
...@@ -204,7 +247,7 @@ const Account = (props: any) => { ...@@ -204,7 +247,7 @@ const Account = (props: any) => {
<EditOutlined /> <EditOutlined />
&nbsp; Edit Account &nbsp; Edit Account
<div className="back"> <div className="back">
<Button type="primary" danger style={{ marginRight: 15 }}> <Button type="primary" danger style={{ marginRight: 15 }} onClick={lockS}>
<PoweroffOutlined /> <PoweroffOutlined />
Close Account Close Account
</Button> </Button>
...@@ -301,6 +344,26 @@ const Account = (props: any) => { ...@@ -301,6 +344,26 @@ const Account = (props: any) => {
</div> </div>
</Form> </Form>
</div> </div>
{/* 确认关闭账号 */}
<Modal
title="Operation Tips"
visible={over}
okText={'Confirm'}
cancelText={'Cancel'}
onOk={handleOk}
onCancel={handleCancel}
confirmLoading={loading}
>
{accountName != null ? (
<p>
Are You Sure To{' '}
<span style={{ color: 'red' }}>{accountName.userStatus != 1 ? 'Close' : 'Open'}</span>{' '}
The Account '<span style={{ color: 'red' }}> {accountName.tosUserName} </span>' ?
</p>
) : (
''
)}
</Modal>
</Spin> </Spin>
); );
}; };
......
...@@ -319,6 +319,7 @@ const Bookings = (props: any) => { ...@@ -319,6 +319,7 @@ const Bookings = (props: any) => {
style={{ width: 200 }} style={{ width: 200 }}
placeholder="Name Of Subscriber" placeholder="Name Of Subscriber"
disabled={prohibit} disabled={prohibit}
maxLength={30}
/> />
</Form.Item> </Form.Item>
</div> </div>
......
...@@ -306,7 +306,7 @@ const Facility = (props: any) => { ...@@ -306,7 +306,7 @@ const Facility = (props: any) => {
{/* 设施名称 以及费用 */} {/* 设施名称 以及费用 */}
<Input.Group> <Input.Group>
<Form.Item label="Facility" name="facilityName" rules={NewFaci[1]}> <Form.Item label="Facility" name="facilityName" rules={NewFaci[1]}>
<Input placeholder="Facility Name" disabled={facilityDetail} /> <Input placeholder="Facility Name" disabled={facilityDetail} maxLength={30} />
</Form.Item> </Form.Item>
<Form.Item label="Fee($)" name="communityManagerFee" rules={NewFaci[2]}> <Form.Item label="Fee($)" name="communityManagerFee" rules={NewFaci[2]}>
{/* <span className="divIconMoney">$</span> */} {/* <span className="divIconMoney">$</span> */}
......
This diff is collapsed.
...@@ -31,6 +31,9 @@ import { tipList } from '@/utils/tip'; ...@@ -31,6 +31,9 @@ import { tipList } from '@/utils/tip';
import FileViewer from 'react-file-viewer'; import FileViewer from 'react-file-viewer';
import PDF from 'react-pdf-js'; import PDF from 'react-pdf-js';
import { Document, Page } from 'react-pdf';
import { stringSplit } from '@/utils/string'; import { stringSplit } from '@/utils/string';
const ContractContent = (props: any) => { const ContractContent = (props: any) => {
...@@ -242,8 +245,14 @@ const ContractContent = (props: any) => { ...@@ -242,8 +245,14 @@ const ContractContent = (props: any) => {
}; };
// pdf 总页数 // pdf 总页数
const onDocumentLoadSuccess = (pages: any) => { // const onDocumentLoadSuccess = (pages: any) => {
setNumPages(pages); // setNumPages(pages);
// setNumPages()
// };
const onDocumentLoadSuccess = ({ numPages }: any) => {
//numPages是总页数
setNumPages(numPages);
}; };
// 切换pdf 总数 // 切换pdf 总数
...@@ -458,12 +467,34 @@ const ContractContent = (props: any) => { ...@@ -458,12 +467,34 @@ const ContractContent = (props: any) => {
fileInfo.type == 'pdf' ? ( fileInfo.type == 'pdf' ? (
// pdf 换一种 // pdf 换一种
<> <>
<PDF {/* <PDF
file={stringSplit(fileInfo.url, 'm/cash')} file={stringSplit(fileInfo.url, 'm/cash')}
page={pageNumber} page={pageNumber}
scale={1.25} scale={1.25}
onDocumentComplete={onDocumentLoadSuccess} onDocumentComplete={onDocumentLoadSuccess}
/> />
<Pagination
style={{ textAlign: 'center', marginTop: 10, display: 'block' }}
simple
defaultCurrent={pageNumber}
total={numPages * 10}
onChange={onChangePage}
/> */}
<Document
// file={stringSplit(fileInfo.url, 'm/cash')} //文档地址
file={stringSplit(fileInfo.url, 'm/cash')} //文档地址
onLoadSuccess={onDocumentLoadSuccess}
scale={1.25}
>
<Page
key={numPages}
defaultCurrent={numPages} //当前页页码
pageNumber={pageNumber}
scale={1.25}
// width={800}
/>
</Document>
<Pagination <Pagination
style={{ textAlign: 'center', marginTop: 10, display: 'block' }} style={{ textAlign: 'center', marginTop: 10, display: 'block' }}
simple simple
......
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