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