Commit f48f02f4 authored by Sixiang_Zzb's avatar Sixiang_Zzb

Merge branch 'final' of http://120.77.240.215:9701/Maple/tostumi into final

parents 01e4a8da 89d56b21
...@@ -5,7 +5,7 @@ import { stringify } from 'querystring'; ...@@ -5,7 +5,7 @@ import { stringify } from 'querystring';
import { ConnectState } from '@/models/connect'; import { ConnectState } from '@/models/connect';
import { CurrentUser } from '@/models/user'; import { CurrentUser } from '@/models/user';
import { getCookie } from '@/utils/method'; import { getCookie } from '@/utils/method';
import { Result, Button } from 'antd'; import { message } from 'antd';
interface SecurityLayoutProps extends ConnectProps { interface SecurityLayoutProps extends ConnectProps {
loading?: boolean; loading?: boolean;
...@@ -105,6 +105,13 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout ...@@ -105,6 +105,13 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
const permission = JSON.parse(localStorage.getItem('permission') || '[]'); const permission = JSON.parse(localStorage.getItem('permission') || '[]');
// 用户重新打开需要重新登录
const tokenLogin = JSON.parse(sessionStorage.getItem('token') || '[]');
if (tokenLogin.length == 0) {
message.warning('Login Expired !');
return <Redirect to={`/user/login`} />;
}
let perObj = perList.filter((obj) => { let perObj = perList.filter((obj) => {
return obj.path === location.pathname; return obj.path === location.pathname;
}); });
......
...@@ -97,6 +97,9 @@ const Model: LoginModelType = { ...@@ -97,6 +97,9 @@ const Model: LoginModelType = {
localStorage.setItem('userInfo', JSON.stringify(userMessage)); localStorage.setItem('userInfo', JSON.stringify(userMessage));
localStorage.setItem('permission', JSON.stringify(userMessage.permission)); localStorage.setItem('permission', JSON.stringify(userMessage.permission));
console.log('获取到Token:' + getCookie('token')); console.log('获取到Token:' + getCookie('token'));
// 设置 session 登录 token
sessionStorage.setItem('token', JSON.stringify(userMessage.token));
yield put({ yield put({
type: 'saveToken', type: 'saveToken',
token: userMessage.token, token: userMessage.token,
......
...@@ -152,7 +152,7 @@ const BookingDetail = (props: any) => { ...@@ -152,7 +152,7 @@ const BookingDetail = (props: any) => {
{DataSave.communityName} {DataSave.communityName}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="Booking Facilities"> <Descriptions.Item label="Booking Facilities">
{DataSave.facilityTitle} {DataSave.categoriesName}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="Booking Time"> <Descriptions.Item label="Booking Time">
{DataSave.subscribeDate} {ExtractTime} {DataSave.subscribeDate} {ExtractTime}
......
...@@ -124,11 +124,6 @@ const Contract = (props: any) => { ...@@ -124,11 +124,6 @@ const Contract = (props: any) => {
RA(19, obj); RA(19, obj);
}; };
// 刷新
const onReset2 = () => {
RA(19, term);
};
// 表单提交 // 表单提交
const onFinishContract = (value: any) => { const onFinishContract = (value: any) => {
if (!value.communityName && !value.contractNumber && !value.contractTitle) { if (!value.communityName && !value.contractNumber && !value.contractTitle) {
...@@ -213,7 +208,7 @@ const Contract = (props: any) => { ...@@ -213,7 +208,7 @@ const Contract = (props: any) => {
density: false, density: false,
fullScreen: false, fullScreen: false,
reload: () => { reload: () => {
onReset2(); onReset();
}, },
setting: false, setting: false,
}} }}
......
This diff is collapsed.
...@@ -5,7 +5,8 @@ import { LeftOutlined } from '@ant-design/icons'; ...@@ -5,7 +5,8 @@ import { LeftOutlined } from '@ant-design/icons';
import { connect, history } from 'umi'; import { connect, history } from 'umi';
import LINE from '../../components/Line/Line'; import LINE from '../../components/Line/Line';
import TextArea from 'antd/lib/input/TextArea';
const { TextArea } = Input;
import PDF from 'react-pdf-js'; import PDF from 'react-pdf-js';
import moment from 'moment'; import moment from 'moment';
...@@ -119,30 +120,6 @@ const ContractContent = (props: any) => { ...@@ -119,30 +120,6 @@ const ContractContent = (props: any) => {
history.go(-1); history.go(-1);
}; };
// 提交
const onFinish = (values: any) => {
// 判断有没有文件
if (fileList.length == 0) {
message.error('Please upload the attachment!');
} else {
values.contractValidStartDate = values.time[0].format('YYYY-MM-DD');
values.contractValidEndDate = values.time[1].format('YYYY-MM-DD');
let data = new Array();
for (let i = 0; i < fileList.length; i++) {
data.push(fileList[i].name);
}
values.contractFileNameList = data;
// 编辑
if (DataSaveDetail != null) {
values.id = DataSaveDetail.id;
}
RA(27, values);
// RA(27, values)
}
};
// 上传文件设置 // 上传文件设置
const uploadProps = { const uploadProps = {
accept: '.docx,.jpg,.png,.pdf', accept: '.docx,.jpg,.png,.pdf',
...@@ -163,30 +140,6 @@ const ContractContent = (props: any) => { ...@@ -163,30 +140,6 @@ const ContractContent = (props: any) => {
}, },
}; };
// // 设置提示倒计时
const changeTime = (data: any, dateStrings: any) => {
if (data != null) {
let a1 = moment(data[1]).subtract(2, 'month').format('YYYY-MM-DD');
let a2 = moment(data[1]).subtract(1, 'month').format('YYYY-MM-DD');
setTipTime([a1, a2]);
}
console.log(dateStrings);
};
// 选择小区名字并赋值
const opname = (value: any) => {
// 打开上传 如果选择了 小区就打开 否则 禁止上传
value ? setUploadUp(false) : setUploadUp(true);
// 如果切换了 清掉上传的图片
if (value != comtyName) {
setFileList([]);
}
setComtyName(value); // 赋值小区名字 给到上传
form.setFieldsValue({
communityName: value,
});
};
//本地图预览处理 //本地图预览处理
function getBase64(file: any) { function getBase64(file: any) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -251,8 +204,6 @@ const ContractContent = (props: any) => { ...@@ -251,8 +204,6 @@ const ContractContent = (props: any) => {
form={form} form={form}
name="basic" name="basic"
initialValues={DataSaveDetail} initialValues={DataSaveDetail}
onFinish={onFinish}
// initialValues={defForm}
> >
<div className="contract_box"> <div className="contract_box">
<div className="list2"> <div className="list2">
...@@ -296,8 +247,6 @@ const ContractContent = (props: any) => { ...@@ -296,8 +247,6 @@ const ContractContent = (props: any) => {
> >
<SearchOptionsCommnity <SearchOptionsCommnity
defaultName={DataSaveDetail ? DataSaveDetail.communityName : null} defaultName={DataSaveDetail ? DataSaveDetail.communityName : null}
// ubmit={extendName}
opname={opname}
disabled={true} disabled={true}
/> />
</Form.Item> </Form.Item>
...@@ -327,7 +276,6 @@ const ContractContent = (props: any) => { ...@@ -327,7 +276,6 @@ const ContractContent = (props: any) => {
defaultValue={DataSaveDetail ? DataSaveDetail.time : null} defaultValue={DataSaveDetail ? DataSaveDetail.time : null}
disabledDate={disabledDate} disabledDate={disabledDate}
placeholder={['Effective Date', 'Expiration Date']} placeholder={['Effective Date', 'Expiration Date']}
onChange={changeTime}
disabled disabled
/> />
</Form.Item> </Form.Item>
......
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