Commit 6468af23 authored by cellee's avatar cellee

修复登录过期二次弹窗问题、

设施文案更改、
保存Cookie 到根节点,防止刷新消失、
Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent ce938bda
...@@ -49,7 +49,6 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout ...@@ -49,7 +49,6 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
{ key: '41', path: '/ContractManagement/Add' }, { key: '41', path: '/ContractManagement/Add' },
{ key: '42', path: '/ContractManagement/Edit' }, { key: '42', path: '/ContractManagement/Edit' },
// 小区 // 小区
{ path: '/CommunityManagement/CellList', title: '小区列表', key: '44' },
{ path: '/CommunityManagement/CellList/Detail', title: '查看小区', key: '44' }, { path: '/CommunityManagement/CellList/Detail', title: '查看小区', key: '44' },
{ path: '/CommunityManagement/CellList/Add', title: '编辑小区', key: '45' }, { path: '/CommunityManagement/CellList/Add', title: '编辑小区', key: '45' },
{ path: '/CommunityManagement/CellList/Add', title: '添加小区', key: '46' }, { path: '/CommunityManagement/CellList/Add', title: '添加小区', key: '46' },
...@@ -122,10 +121,14 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout ...@@ -122,10 +121,14 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
localStorage.setItem('loginTime', JSON.stringify(moment().format('YYYY-MM-DD HH:mm:ss'))); localStorage.setItem('loginTime', JSON.stringify(moment().format('YYYY-MM-DD HH:mm:ss')));
} else if (tokenLogin && moment().diff(moment(tokenLogin), 'minutes') >= 30) { } else if (tokenLogin && moment().diff(moment(tokenLogin), 'minutes') >= 30) {
// 退出登录 // 退出登录
message.warning('Expired login !'); const key = 'outLogin';
message.warning({ content: 'Expired login !', key });
setTimeout(function () { setTimeout(function () {
logOut(); logOut();
}, 1000); }, 1000);
// 防止二次弹窗
return false;
} else { } else {
// 其他状态返回登录页 (没登陆) // 其他状态返回登录页 (没登陆)
const queryString = stringify({ const queryString = stringify({
......
...@@ -329,10 +329,10 @@ const Account = (props: any) => { ...@@ -329,10 +329,10 @@ const Account = (props: any) => {
<div className="label"> <div className="label">
<Radio.Group value={values} onChange={onRadio}> <Radio.Group value={values} onChange={onRadio}>
<Radio style={radioStyle} disabled={disab} value={2}> <Radio style={radioStyle} disabled={disab} value={2}>
Two Level Administrator Second Level Administrator
</Radio> </Radio>
<Radio style={radioStyle} value={3}> <Radio style={radioStyle} value={3}>
Three Level Administrator Third Level Administrator
</Radio> </Radio>
</Radio.Group> </Radio.Group>
......
...@@ -462,10 +462,10 @@ const Account = (props: any) => { ...@@ -462,10 +462,10 @@ const Account = (props: any) => {
<div className="label"> <div className="label">
<Radio.Group value={values} onChange={onRadio}> <Radio.Group value={values} onChange={onRadio}>
<Radio style={radioStyle} disabled value={2}> <Radio style={radioStyle} disabled value={2}>
Two Level Administrator Second Level Administrator
</Radio> </Radio>
<Radio style={radioStyle} disabled value={3}> <Radio style={radioStyle} disabled value={3}>
Three Level Administrator Third Level Administrator
</Radio> </Radio>
</Radio.Group> </Radio.Group>
......
...@@ -184,6 +184,7 @@ const Account = (props: any) => { ...@@ -184,6 +184,7 @@ const Account = (props: any) => {
value.userLeader = towAccountId; value.userLeader = towAccountId;
} }
delete value.community; delete value.community;
// 编辑的时候传id 新增则没有
DataSave ? (value.id = DataSave.id) : ''; DataSave ? (value.id = DataSave.id) : '';
// 判断有没有 0 有就删除 // 判断有没有 0 有就删除
...@@ -416,10 +417,10 @@ const Account = (props: any) => { ...@@ -416,10 +417,10 @@ const Account = (props: any) => {
<div className="label"> <div className="label">
<Radio.Group value={values} onChange={onRadio}> <Radio.Group value={values} onChange={onRadio}>
<Radio style={radioStyle} disabled value={2}> <Radio style={radioStyle} disabled value={2}>
Two Level Administrator Second Level Administrator
</Radio> </Radio>
<Radio style={radioStyle} disabled value={3}> <Radio style={radioStyle} disabled value={3}>
Three Level Administrator Third Level Administrator
</Radio> </Radio>
</Radio.Group> </Radio.Group>
......
...@@ -22,13 +22,11 @@ const BookingDetail = (props: any) => { ...@@ -22,13 +22,11 @@ const BookingDetail = (props: any) => {
if (DataSave != null) { if (DataSave != null) {
// 已预约时间段 // 已预约时间段
let arr = DataSave.subscribeTime.split(','); let arr = DataSave.subscribeTime.split(',');
let time1 = parseInt(moment(arr[0], 'HH:mm').format('HH')); console.log(arr[0]);
let time2 = parseInt(moment(arr[arr.length - 1], 'HH:mm').format('HH')); console.log(arr[arr.length - 1]);
let Time = ''; let start = ampm(arr[0]);
for (let i = time1; i <= time2; i++) { let over = ampm(arr[arr.length - 1]);
i < 10 ? (Time = `${Time}0${i}:00,`) : (Time = `${Time}${i}:00,`); setExtractTime(`${start} To ${over}`);
}
setExtractTime(Time);
if (DataSave.managerFeeStatus != 0) { if (DataSave.managerFeeStatus != 0) {
RA(2, { accountCategoriesId: DataSave.id }); RA(2, { accountCategoriesId: DataSave.id });
} }
...@@ -67,6 +65,15 @@ const BookingDetail = (props: any) => { ...@@ -67,6 +65,15 @@ const BookingDetail = (props: any) => {
} }
}; };
// 看是AM还是PM
const ampm = (time: any) => {
if (time.substring(0, 2) < 12) {
return `${time} AM`;
} else {
return `${time} PM`;
}
};
// 点击退款 // 点击退款
const onFinish = (values: any) => { const onFinish = (values: any) => {
var val = values; var val = values;
...@@ -133,13 +140,13 @@ const BookingDetail = (props: any) => { ...@@ -133,13 +140,13 @@ const BookingDetail = (props: any) => {
<div className={styles.base}> <div className={styles.base}>
<TitleBack <TitleBack
title={'View Facility Bookings'} title={'View Facility Bookings'}
url={getUrlLast(location.pathname) + '?Facility=false'} // url={getUrlLast(location.pathname) + '?Facility=false'}
/> />
<Descriptions> <Descriptions>
<Descriptions.Item label="Booking Status"> <Descriptions.Item label="Booking Status">
{statusDes[DataSave.status]} {statusDes[DataSave.status]}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="Order Time"> <Descriptions.Item label="Booking Time">
{/* {timestampToTime3(DataSave.createTime.time)} */} {/* {timestampToTime3(DataSave.createTime.time)} */}
{moment(DataSave.createTime.time).format('MM-DD HH:mm')} {moment(DataSave.createTime.time).format('MM-DD HH:mm')}
</Descriptions.Item> </Descriptions.Item>
...@@ -148,18 +155,14 @@ const BookingDetail = (props: any) => { ...@@ -148,18 +155,14 @@ const BookingDetail = (props: any) => {
<hr /> <hr />
<Descriptions> <Descriptions>
<Descriptions.Item label="Service Community"> <Descriptions.Item label="Community">{DataSave.communityName}</Descriptions.Item>
{DataSave.communityName} <Descriptions.Item label="Facility">{DataSave.categoriesName}</Descriptions.Item>
</Descriptions.Item>
<Descriptions.Item label="Booking Facilities">
{DataSave.categoriesName}
</Descriptions.Item>
<Descriptions.Item label="Booking Time"> <Descriptions.Item label="Booking Time">
{DataSave.subscribeDate} {ExtractTime} {DataSave.subscribeDate} {ExtractTime}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="User Name">{DataSave.accountName}</Descriptions.Item> <Descriptions.Item label="User Name">{DataSave.accountName}</Descriptions.Item>
<Descriptions.Item label="Contact Number">{DataSave.accountPhone}</Descriptions.Item> <Descriptions.Item label="Contact Number">{DataSave.accountPhone}</Descriptions.Item>
<Descriptions.Item label="Unit"> <Descriptions.Item label="Unit No.">
{DataSave.buildNumber} #{DataSave.floorNumber}-{DataSave.roomNumber} {DataSave.buildNumber} #{DataSave.floorNumber}-{DataSave.roomNumber}
</Descriptions.Item> </Descriptions.Item>
</Descriptions> </Descriptions>
......
...@@ -96,22 +96,26 @@ const FacilityBookings = (props: any) => { ...@@ -96,22 +96,26 @@ const FacilityBookings = (props: any) => {
useEffect(() => { useEffect(() => {
const key = [ const key = [
['Service Community', 'communityName'], ['Community', 'communityName'],
['User Name', 'accountName'], ['User Name', 'accountName'],
['Facility Bookings', 'categoriesName'], ['Facility', 'categoriesName'],
[ [
'Order Time', 'Schedule',
null, 'subscribeDate',
(text: any, record: any) => ( (text: any, record: any) => (
<div>{moment(record.createTime.time).format('YYYY-MM-DD')}</div> <div>
{moment(text).format('YYYY-MM-DD')} {record.subscribeTime.substring(0, 5)}
{record.subscribeTime.substring(0, 2) < 12 ? 'AM' : 'PM'} To{' '}
{record.subscribeTime.substring(record.subscribeTime.length - 5)}
{record.subscribeTime.substring(
record.subscribeTime.length - 5,
record.subscribeTime.length - 3,
) < 12
? 'AM'
: 'PM'}
</div>
), ),
], ],
[
'Booking Schedule',
'subscribeDate',
(text: any) => <div>{moment(text).format('YYYY-MM-DD')}</div>,
],
['Fee', 'managerFeeStatus', (text: any) => <div>{managerFeeStatusDes[text]}</div>], ['Fee', 'managerFeeStatus', (text: any) => <div>{managerFeeStatusDes[text]}</div>],
['Deposit', 'marginFeeStatus', (text: any) => <div>{marginFeeStatusDes[text]}</div>], ['Deposit', 'marginFeeStatus', (text: any) => <div>{marginFeeStatusDes[text]}</div>],
['Status', 'status', (text: any) => <div>{statusDes[text]}</div>], ['Status', 'status', (text: any) => <div>{statusDes[text]}</div>],
......
...@@ -79,7 +79,7 @@ const Guard = (props: any) => { ...@@ -79,7 +79,7 @@ const Guard = (props: any) => {
<Line /> <Line />
<Button onClick={handleClickBtn.bind(this, CurDataFollowDetail.id)}>Cancellation</Button> <Button onClick={handleClickBtn.bind(this, CurDataFollowDetail.id)}>Delete</Button>
</div> </div>
) : ( ) : (
<></> <></>
......
...@@ -22,7 +22,7 @@ const Guard = (props: any) => { ...@@ -22,7 +22,7 @@ const Guard = (props: any) => {
return ( return (
<div className={styles.base}> <div className={styles.base}>
<TitleGet title={'Version 1.5.7'} /> <TitleGet title={'Version 1.5.8'} />
{/* <p> {/* <p>
token:{page.token} token:{page.token}
name:{getCookie('name')} name:{getCookie('name')}
......
...@@ -53,7 +53,7 @@ export const setCookie = (key: string, value: string) => { ...@@ -53,7 +53,7 @@ export const setCookie = (key: string, value: string) => {
var d = new Date(); var d = new Date();
d.setTime(d.getTime() + 1 * 24 * 60 * 60 * 1000); d.setTime(d.getTime() + 1 * 24 * 60 * 60 * 1000);
var expires = 'expires=' + d.toUTCString(); var expires = 'expires=' + d.toUTCString();
document.cookie = key + '=' + value + '; ' + expires; document.cookie = key + '=' + value + '; ' + expires + ';path=/';
}; };
export const RA = (index: number, values: object, module: string, dispatch: any) => { export const RA = (index: number, values: object, module: string, dispatch: any) => {
......
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