Commit f7079474 authored by cellee's avatar cellee

Signed-off-by: cellee <893264950@qq.com>

parent b2039d32
/*
* @Author: your name
* @Date: 2020-11-24 11:24:06
* @LastEditTime: 2020-12-04 10:48:48
* @LastEditors: your name
* @Description: In User Settings Edit
* @FilePath: \tostumi\config\defaultSettings.ts
*/
import { Settings as ProSettings } from '@ant-design/pro-layout'; import { Settings as ProSettings } from '@ant-design/pro-layout';
type DefaultSettings = ProSettings & { type DefaultSettings = ProSettings & {
...@@ -16,7 +24,7 @@ const proSettings: DefaultSettings = { ...@@ -16,7 +24,7 @@ const proSettings: DefaultSettings = {
menu: { menu: {
locale: true, locale: true,
}, },
title: 'TOS Manager', title: 'TOS Management',
pwa: false, pwa: false,
iconfontUrl: '', iconfontUrl: '',
}; };
......
...@@ -134,7 +134,7 @@ const TitleSearch = (props: any) => { ...@@ -134,7 +134,7 @@ const TitleSearch = (props: any) => {
{/* 小区列表的管理员姓名搜索 */} {/* 小区列表的管理员姓名搜索 */}
{username != null ? ( {username != null ? (
<Col key={'username_' + username[0]}> <Col key={'username_' + username[0]}>
<Form.Item name={username[0]} style={{ marginBottom: 15, width: 240 }}> <Form.Item name={username[0]} style={{ width: 240 }}>
<Input placeholder={username[1]} allowClear /> <Input placeholder={username[1]} allowClear />
</Form.Item> </Form.Item>
</Col> </Col>
......
...@@ -18,6 +18,8 @@ import Authorized from '@/utils/Authorized'; ...@@ -18,6 +18,8 @@ import Authorized from '@/utils/Authorized';
import RightContent from '@/components/GlobalHeader/RightContent'; import RightContent from '@/components/GlobalHeader/RightContent';
import { ConnectState } from '@/models/connect'; import { ConnectState } from '@/models/connect';
import { getAuthorityFromRouter } from '@/utils/utils'; import { getAuthorityFromRouter } from '@/utils/utils';
import style from './logo.less';
import logo from '../assets/logo.svg'; import logo from '../assets/logo.svg';
import tsIcon from '../assets/logo.png'; import tsIcon from '../assets/logo.png';
...@@ -110,34 +112,19 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => { ...@@ -110,34 +112,19 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
return ( return (
<ProLayout <ProLayout
logo={logo} logo={tsIcon}
contentStyle={{ backgroundColor: '#fff' }}
formatMessage={formatMessage} formatMessage={formatMessage}
menuHeaderRender={(logoDom, titleDom) => ( menuHeaderRender={(logo, title) => (
<div <div id={style.customize_menu_header}>
style={{ <Link to="/">
marginLeft: -25, {logo}
width: 260, {title}
height: 64, </Link>
backgroundColor: '#ffffff',
paddingLeft: 16,
paddingTop: 10,
}}
>
<img src={tsIcon} style={{ width: 50, height: 50 }} />
<span
style={{
fontSize: 18,
fontFamily: 'Source Han Sans CN',
fontWeight: 'bold',
color: 'rgba(51,51,51,1)',
}}
>
{' '}
TOS Management
</span>
</div> </div>
// <Link to="/"> // <Link to="/">
// {/* {logoDom} */} // {logoDom}
// {titleDom} // {titleDom}
// </Link> // </Link>
)} )}
......
#customize_menu_header {
margin-left: -24px;
width: 256px;
height: 64px;
line-height: 64px;
background-color: #ffffff;
padding-left: 24px;
h1 {
font-weight: bold;
color: rgb(51, 51, 51);
}
}
...@@ -93,6 +93,8 @@ const Model: LoginModelType = { ...@@ -93,6 +93,8 @@ const Model: LoginModelType = {
setCookie('id', userMessage.userModel.id); setCookie('id', userMessage.userModel.id);
setCookie('name', userMessage.userModel.tosUserName); setCookie('name', userMessage.userModel.tosUserName);
setCookie('phone', userMessage.userModel.tosUserPhone); setCookie('phone', userMessage.userModel.tosUserPhone);
// 更新用户信息
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'));
yield put({ yield put({
...@@ -102,22 +104,26 @@ const Model: LoginModelType = { ...@@ -102,22 +104,26 @@ const Model: LoginModelType = {
password: payload.password, password: payload.password,
result: false, result: false,
}); });
const urlParams = new URL(window.location.href);
const params = getPageQuery(); // 路由缓存 再次登录回到上次打开页面
let { redirect } = params as { redirect: string }; // const urlParams = new URL(window.location.href);
if (redirect) { // const params = getPageQuery();
const redirectUrlParams = new URL(redirect); // let { redirect } = params as { redirect: string };
if (redirectUrlParams.origin === urlParams.origin) { // if (redirect) {
redirect = redirect.substr(urlParams.origin.length); // const redirectUrlParams = new URL(redirect);
if (redirect.match(/^\/.*#/)) { // if (redirectUrlParams.origin === urlParams.origin) {
redirect = redirect.substr(redirect.indexOf('#') + 1); // redirect = redirect.substr(urlParams.origin.length);
} // if (redirect.match(/^\/.*#/)) {
} else { // redirect = redirect.substr(redirect.indexOf('#') + 1);
window.location.href = '/'; // }
return; // } else {
} // window.location.href = '/';
} // return;
history.replace(redirect || '/'); // }
// }
// history.replace(redirect || '/');
// 只跳到首页
history.replace('/');
} else { } else {
message.error('Login Error! Username or Password is wrong!', 3); message.error('Login Error! Username or Password is wrong!', 3);
} }
...@@ -129,6 +135,7 @@ const Model: LoginModelType = { ...@@ -129,6 +135,7 @@ const Model: LoginModelType = {
// const response = yield call(AccountOut, payload); // const response = yield call(AccountOut, payload);
if (window.location.pathname !== '/user/login' && !redirect) { if (window.location.pathname !== '/user/login' && !redirect) {
// 清楚用户信息 // 清楚用户信息
localStorage.removeItem('userInfo');
localStorage.removeItem('permission'); localStorage.removeItem('permission');
setCookie('token', ''); setCookie('token', '');
setCookie('id', ''); setCookie('id', '');
......
...@@ -8,7 +8,7 @@ hr { ...@@ -8,7 +8,7 @@ hr {
background: #fff; background: #fff;
padding: 20px; padding: 20px;
border-right: 4px; border-right: 4px;
margin-bottom: 15px; margin-bottom: 0;
h3 { h3 {
margin-bottom: 15px; margin-bottom: 15px;
position: relative; position: relative;
......
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { Form, Input, Button, Pagination, message, Descriptions, Spin, Tree, Radio } from 'antd'; import { Form, Input, Button, message, Descriptions, Spin, Tree, Radio } from 'antd';
import { connect, history } from 'umi'; import { connect, history } from 'umi';
import { SearchOutlined, ClearOutlined, EditOutlined, LeftOutlined } from '@ant-design/icons'; import { EditOutlined, LeftOutlined } from '@ant-design/icons';
import { getCookie } from '@/utils/method'; import { getCookie } from '@/utils/method';
import './Account.less'; import './Account.less';
...@@ -12,12 +12,10 @@ import SelectCommunity from '@/components/SelectCommunity'; ...@@ -12,12 +12,10 @@ import SelectCommunity from '@/components/SelectCommunity';
import { getNumber } from '@/utils/string'; // 正则 import { getNumber } from '@/utils/string'; // 正则
import { RA } from '@/utils/method'; import { RA } from '@/utils/method';
import moment from 'moment';
const Account = (props: any) => { const Account = (props: any) => {
const module = 'Account'; const module = 'Account';
const { dispatch, Data, DataSave, SubResult, CommunityList, loading, user } = props; const { dispatch, SubResult, CommunityList, loading, user } = props;
// 权限列表 // 权限列表
const treeData = enUsFaci || zhCnFaci; const treeData = enUsFaci || zhCnFaci;
...@@ -119,13 +117,14 @@ const Account = (props: any) => { ...@@ -119,13 +117,14 @@ const Account = (props: any) => {
let obj = { let obj = {
userName: value.tosUserName, userName: value.tosUserName,
userPassword: value.tosUserPwd, userPassword: value.tosUserPwd,
permissionArray: checkedKeys.sort((n1, n2) => { permissionArray: checkedKeys.sort((n1: any, n2: any) => {
return parseInt(n1) - parseInt(n2); return parseInt(n1) - parseInt(n2);
}), }),
}; };
RA(38, value, module, dispatch); // 信息上传 RA(38, value, module, dispatch); // 信息上传
RA(42, obj, module, dispatch); // 权限上传 RA(42, obj, module, dispatch); // 权限上传
return true;
} }
}; };
...@@ -199,7 +198,7 @@ const Account = (props: any) => { ...@@ -199,7 +198,7 @@ const Account = (props: any) => {
> >
<Descriptions column={{ xs: 1, sm: 2, md: 3 }}> <Descriptions column={{ xs: 1, sm: 2, md: 3 }}>
<Descriptions.Item> <Descriptions.Item>
<Form.Item name="tosUserName" label="Account ID" rules={AccountTip[0]}> <Form.Item name="tosUserName" label="Account ID" rules={AccountTip[0] as any}>
<Input placeholder="Login Account" className="input" /> <Input placeholder="Login Account" className="input" />
</Form.Item> </Form.Item>
</Descriptions.Item> </Descriptions.Item>
...@@ -207,12 +206,12 @@ const Account = (props: any) => { ...@@ -207,12 +206,12 @@ const Account = (props: any) => {
<Descriptions column={{ xs: 1, sm: 2, md: 3 }}> <Descriptions column={{ xs: 1, sm: 2, md: 3 }}>
<Descriptions.Item> <Descriptions.Item>
<Form.Item name="tosAccountName" label="Name" rules={AccountTip[1]}> <Form.Item name="tosAccountName" label="Name" rules={AccountTip[1] as any}>
<Input placeholder="Name Of Administrator" className="input" /> <Input placeholder="Name Of Administrator" className="input" />
</Form.Item> </Form.Item>
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item> <Descriptions.Item>
<Form.Item name="tosUserPhone" label="Phone" rules={AccountTip[2]}> <Form.Item name="tosUserPhone" label="Phone" rules={AccountTip[2] as any}>
<Input <Input
placeholder="Contact Information" placeholder="Contact Information"
className="input" className="input"
......
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { Input, Tabs, Form, InputNumber, Col, Button, Row, message } from 'antd'; import { Input, Form, Button, message } from 'antd';
const { TabPane } = Tabs;
import { connect } from 'umi'; import { connect } from 'umi';
...@@ -119,7 +118,7 @@ const Add = (props: any) => { ...@@ -119,7 +118,7 @@ const Add = (props: any) => {
<Line /> <Line />
{extend.length > 0 ? ( {extend.length > 0 ? (
<> <>
<Form.Item wrapperCol={{ ...layout.wrapperCol, offset: 2 }} style={{ marginBottom: 0 }}> <Form.Item wrapperCol={{ offset: 2 }} style={{ marginBottom: 0 }}>
<Form.Item <Form.Item
style={{ display: 'inline-block', width: '200' }} style={{ display: 'inline-block', width: '200' }}
name={'balouscheduleFile'} name={'balouscheduleFile'}
...@@ -157,7 +156,7 @@ const Add = (props: any) => { ...@@ -157,7 +156,7 @@ const Add = (props: any) => {
</> </>
) : null} ) : null}
<Form.Item wrapperCol={{ ...layout.wrapperCol, offset: 2 }}> <Form.Item wrapperCol={{ offset: 2 }}>
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
Submit Submit
</Button> </Button>
......
...@@ -28,9 +28,6 @@ import PDF from 'react-pdf-js'; ...@@ -28,9 +28,6 @@ import PDF from 'react-pdf-js';
const { RangePicker } = TimePicker; const { RangePicker } = TimePicker;
// 接口申明
interface objc {}
const Adds = (props: any) => { const Adds = (props: any) => {
const module = 'CellList'; const module = 'CellList';
...@@ -195,7 +192,7 @@ const Adds = (props: any) => { ...@@ -195,7 +192,7 @@ const Adds = (props: any) => {
// 保质期上传 // 保质期上传
const upload3 = { const upload3 = {
onChange({ file, fileList }: any) { onChange({ file }: any) {
file.status === 'uploading' ? setimgLoad(true) : setimgLoad(false); file.status === 'uploading' ? setimgLoad(true) : setimgLoad(false);
if (file.status === 'done') { if (file.status === 'done') {
setPeriod(BackFormat(file.name, file.response.data)); setPeriod(BackFormat(file.name, file.response.data));
...@@ -233,7 +230,7 @@ const Adds = (props: any) => { ...@@ -233,7 +230,7 @@ const Adds = (props: any) => {
// 表单验证 // 表单验证
const onFinish = (values: any) => { const onFinish = (values: any) => {
let { residentialZipCode, residentialAddress, residentialName } = values.des; let { residentialZipCode } = values.des;
let tel = values.info.tel; let tel = values.info.tel;
if (values.residentialManagerUserName.length < 2) { if (values.residentialManagerUserName.length < 2) {
message.error('Please Enter 2-digit Zip Code!'); message.error('Please Enter 2-digit Zip Code!');
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Space, Button, Form, message, Pagination, Tag } from 'antd'; import { Space, Button, message, Pagination } from 'antd';
import { connect, history } from 'umi'; import { connect, history } from 'umi';
// 图标 // 图标
...@@ -9,7 +9,6 @@ import ProTable from '@ant-design/pro-table'; ...@@ -9,7 +9,6 @@ import ProTable from '@ant-design/pro-table';
import TitleSearch from '@/components/TitleSearch/TitleSearch'; import TitleSearch from '@/components/TitleSearch/TitleSearch';
import { RA, SA } from '@/utils/method'; import { RA, SA } from '@/utils/method';
import { objectColumns } from '@/utils/string'; import { objectColumns } from '@/utils/string';
import { Prompt } from 'react-router';
const module = 'CellList'; const module = 'CellList';
import './celllist.less'; import './celllist.less';
...@@ -63,14 +62,14 @@ const CellLists = (props: any) => { ...@@ -63,14 +62,14 @@ const CellLists = (props: any) => {
const [term, setTerm] = useState({} as any); // 拉取数据的条件存储 const [term, setTerm] = useState({} as any); // 拉取数据的条件存储
// 翻页数据 // 翻页数据
function pagesList(name: string, list: any, num: number) { // function pagesList(name: string, list: any, num: number) {
let msg = { // let msg = {
residentialManagerUserName: name ? name : '', // residentialManagerUserName: name ? name : '',
communityNameList: list, // communityNameList: list,
pageNum: num, // pageNum: num,
}; // };
return msg; // return msg;
} // }
// 监听是否有小区列表 // 监听是否有小区列表
useEffect(() => { useEffect(() => {
...@@ -93,11 +92,8 @@ const CellLists = (props: any) => { ...@@ -93,11 +92,8 @@ const CellLists = (props: any) => {
} }
}, [village]); }, [village]);
const CallbackSearch = (values: any) => {
RA(24, { communityName: values }, module, dispatch);
};
const goToAdd = () => { const goToAdd = () => {
SA(null, module, dispatch); // 清空之前传递的数据 SA(null as any, module, dispatch); // 清空之前传递的数据
dispatch({ type: module + '/urlRemove' }); // 清掉图片信息 dispatch({ type: module + '/urlRemove' }); // 清掉图片信息
history.push('/CommunityManagement/CellList/Add'); history.push('/CommunityManagement/CellList/Add');
}; };
......
...@@ -2,7 +2,7 @@ li { ...@@ -2,7 +2,7 @@ li {
list-style: none; list-style: none;
} }
.contop { .contop {
padding: 16px; padding: 15px 15px 10px;
background: #fff; background: #fff;
margin-bottom: 15px; margin-bottom: 15px;
} }
......
import React, { useState, useEffect } from 'react'; import React, { useEffect } from 'react';
import { connect, history, useModel, Loading } from 'umi'; import { connect, history } from 'umi';
import { Input, Tabs, Table, Space, Button, Tooltip, Form, message, Pagination, Tag } from 'antd'; import { Input, Space, Button, Form, message, Pagination, Tag } from 'antd';
const { TabPane } = Tabs;
import moment from 'moment'; import moment from 'moment';
import { PlusOutlined, SearchOutlined, ClearOutlined } from '@ant-design/icons'; import { PlusOutlined, SearchOutlined, ClearOutlined } from '@ant-design/icons';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import { RA, SA } from '@/utils/method'; import { RA, SA } from '@/utils/method';
// import { objectColumns } from '@/utils/string'; // import { objectColumns } from '@/utils/string';
import { timestampToTime3, timestampToTime } from '@/utils/time';
import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity'; import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity';
const module = 'CommunityAnnouncement'; const module = 'CommunityAnnouncement';
const CommunityAnnouncement = (props: any) => { const CommunityAnnouncement = (props: any) => {
const { dispatch, Data, curString, userListLoading, DataSaveDetail } = props; const { dispatch, Data, userListLoading, DataSaveDetail } = props;
// 先清空 其他信息 // 先清空 其他信息
useEffect(() => { useEffect(() => {
...@@ -176,14 +174,14 @@ const CommunityAnnouncement = (props: any) => { ...@@ -176,14 +174,14 @@ const CommunityAnnouncement = (props: any) => {
SA(DetailPage(mlist), module, dispatch); SA(DetailPage(mlist), module, dispatch);
}; };
const onKeyUp = (value) => { const onKeyUp = (value: any) => {
console.log(value); console.log(value);
return false; return false;
}; };
return ( return (
<> <>
<div style={{ width: '100%', padding: 20, marginBottom: 15, backgroundColor: '#ffffff' }}> <div style={{ width: '100%', padding: 20, marginBottom: 0, backgroundColor: '#ffffff' }}>
<Form <Form
autoComplete="off" autoComplete="off"
layout="inline" layout="inline"
......
...@@ -198,7 +198,7 @@ const BookingDetail = (props: any) => { ...@@ -198,7 +198,7 @@ const BookingDetail = (props: any) => {
<InputNumber <InputNumber
placeholder="00.00" placeholder="00.00"
min={0} min={0}
max={parseInt(DataSave.communityMargin).toFixed(2)} max={parseInt(DataSave.communityMargin).toFixed(2) as any}
maxLength={6} maxLength={6}
step={0.01} step={0.01}
prefix="$" prefix="$"
......
import React, { useState, useEffect, useRef } from 'react';
import './css/index.less';
import {
Input,
TimePicker,
InputNumber,
Button,
Space,
Pagination,
Tooltip,
Upload,
Form,
Select,
message,
} from 'antd';
const { RangePicker } = TimePicker;
const { Option } = Select;
import { PlusOutlined, MinusCircleOutlined, ClearOutlined } from '@ant-design/icons';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { FieldTimeOutlined } from '@ant-design/icons';
import PictureOptions from '../../../components/PictureOptions/PictureOptions';
import PictureOptionsRow from '../../../components/PictureOptions/PictureOptionsRow';
import TitleBack from '../../../components/TitleBack/TitleBack';
import TimeSelect from '../../../components/TimeSelect/TimeSelect';
import Line from '../../../components/Line/Line';
import { getNumber } from '../../../utils/string';
import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
import { NewFaci } from '@/utils/tip';
// categoriesDetailsImageName: ["test.jpg"],
// categoriesName: ["篮球场A&test.jpg"],
// reservationQuantumTime: ["09:00-07:00"]
import Facilitys from '@/components/Facilitys/Facilitys';
import { getUrlLast, numberToString } from '../../../utils/string';
import { checkParam, timeForm } from '@/utils/method';
import { validateMessages } from '@/utils/params';
const module = 'FacilityBookings';
import moment from 'moment';
const Facility = (props: any) => {
const { dispatch, location, token, sourceData, DataSave, Result, imgList, load } = props;
const RA = (index: any, values: any) => {
dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } });
};
const ResultClear = () => {
dispatch({ type: 'FacilityBookings/ResultClear' });
};
const openCheck = true;
const [Ref3, setRef3] = useState([]);
const [extend, setExtend] = useState(null);
const [timeExtend, setTimeExtend] = useState(null);
const [pictrueExtend, setPictrueExtend] = useState({ pic: null, pics: null, tab: 3 });
const [facilityDetail, setFacilityDetail] = useState(false);
const [PATHNAME, setPATHNAME] = useState('');
const formRef = useRef(null);
// 再监听列表
const [extImgList, setextImgList] = useState(imgList);
useEffect(() => {
console.log('变化');
console.log(imgList);
if (imgList != null) {
setextImgList(imgList);
}
}, [imgList]);
useEffect(() => {
if (Result != null) {
console.log('页面结果');
console.log(Result);
ResultClear();
history.push('/CommunityManagement/FacilityBookings');
}
}, [Result]);
const RA_S = () => {
if (DataSave != null) {
console.log('请求的设施ID为:' + DataSave.id);
RA(7, {
userToken: token,
facilitieId: DataSave.id,
});
} else {
history.go(-1);
}
};
useEffect(() => {
if (sourceData != null) {
console.log('【传入详情,当前数据不为空】');
console.log(sourceData);
setExtend(sourceData.communityName);
setTimeExtend(sourceData.reservationQuantumTime);
// 中断
// setPictrueExtend({tab:null,pic:null,pics:null})
console.log('重点检查');
console.log(sourceData);
formRef.current.setFieldsValue(sourceData);
}
}, [sourceData]);
useEffect(() => {
var tmp = pictrueExtend;
if (location.pathname.indexOf('FacilityEdit') > -1) {
setPATHNAME('Edit Facility');
tmp.tab = 1;
setPictrueExtend(tmp);
RA_S();
} else if (location.pathname.indexOf('FacilityDetail') > -1) {
setFacilityDetail(true);
tmp.tab = 2;
setPictrueExtend(tmp);
setPATHNAME('Facility Detail');
RA_S();
} else {
tmp.tab = 3;
setPictrueExtend(tmp);
setPATHNAME('Add Facility');
}
}, []);
// const TimeSelectRef = (values:any) => {
// setRef3(values)
// }
// 提交
const onFinish = (values: any) => {
var result = values;
// 过滤表单;
let imgs = extImgList.filter((item: any) => (Object.keys(item).length == 0 ? false : true));
console.log(imgs.length);
// 开放时间判断
if (imgs.length == 0) {
message.error('Please upload at least one facility!');
} else if (!result.endTime && !result.startTime) {
message.error('Please select the opening time!');
} else {
// 先处理设施和时间
let categoriesName: any = [];
let reservationQuantumTime: any = [
moment(result.startTime, 'HH:mm').format('HH:mm'),
moment(result.endTime, 'HH:mm').format('HH:mm'),
];
for (var i in imgs) {
if (imgs[i].name && imgs[i].pic) {
categoriesName[i] = `${imgs[i].name}&${imgs[i].pic}`;
} else {
message.error('Please fill in the name of the facility!');
return;
}
}
result.categoriesName = categoriesName; // 设施内容
result.reservationQuantumTime = reservationQuantumTime; // 开放时间段
result.categoriesOpenTime = `${result.startTime}-${result.endTime}`; // 预约时间段 二开需要
delete result.startTime;
delete result.periodType;
delete result.picList;
console.log(reservationQuantumTime);
console.log(result);
RA(6, result);
// 如果有了 开始上传
// if (categoriesName) {
// }
}
return false;
// if (Ref3.length!=0) {
// result.reservationQuantumTime = Ref3
// } else {
result.reservationQuantumTime = [timeForm(result.categoriesOpenTime, 'HH:mm')];
var categoriesOpenTime = timeForm(result.categoriesOpenTime, 'HH:mm');
result.categoriesOpenTime = categoriesOpenTime;
// }
// console.log(timeForm(result.categoriesOpenTime,'HH:mm'))
// result.categoriesOpenTime = "09:00-20:00"
if (result.communityManagerFee == null) {
result.communityManagerFee = numberToString(0);
} else {
result.communityManagerFee = numberToString(result.communityManagerFee);
}
if (result.communityMargin == null) {
result.communityMargin = numberToString(0);
} else {
result.communityMargin = numberToString(result.communityMargin);
}
if (
result.canReservationDay <= result.cancelReservationDay ||
result.canReservationDay <= result.nomarginCancelReservationDay
) {
message.error('can Reservation Day is invaild!', 3);
result.canReservationDay = null;
} else {
console.log('Should be check:', result);
if (checkParam(result)) {
//中断
if (pictrueExtend.tab == 3) {
if (Result == null) {
console.log('提交');
RA(6, result);
}
} else {
result.id = DataSave.id;
console.log('编辑');
if (Result == null) {
RA(17, result);
}
}
} else {
message.error('Error,Please finish it,not empty!', 3);
}
}
};
const onFinishFailed = (errorInfo: any) => {
console.log('Failed:', errorInfo);
};
const Subscribe = () => {
history.push(getUrlLast(location.pathname) + '/FacilityApply');
};
const keyup_tool = (value: any) => {
return getNumber(value.replace(/[^\d^\.]+/g, ''));
};
const keyup_communityManagerFee = (e: any) => {
e.target.value = keyup_tool(e.target.value);
formRef.current.setFieldsValue({ communityManagerFee: e.target.value });
};
const keyup_communityMargin = (e: any) => {
e.target.value = keyup_tool(e.target.value);
formRef.current.setFieldsValue({ communityMargin: e.target.value });
};
const keyup = (keyname: any, e: any) => {
e.target.value = e.target.value.replace(/[^\d^\.]+/g, '');
var tmp = {};
tmp[keyname] = e.target.value;
formRef.current.setFieldsValue(tmp);
};
// 监听是否选择了小区
const [imgOpen, setImgOpen] = useState(true);
const [ctyName, setCtyName] = useState(null);
// 生成数组 -- 时间
const createArray = (num: any) => {
var arr = [];
for (let i = 1; i < num; i++) {
if (i < 10) {
arr[i] = `0${i}`;
} else {
arr[i] = i;
}
}
return arr;
};
const Option = Select.Option;
//小时
const hourS = createArray(24).map((item) => (
<Option value={item + ':00'} key={item}>{`${item}:00`}</Option>
));
// 图片列表
const fileList: any = [];
// 表单标识
const [form] = Form.useForm();
// 选择小区名字并赋值
const opname = (value: any) => {
if (value) {
setImgOpen(false); // 允许图片上传
setCtyName(value); // 给小区赋值
form.setFieldsValue({
communityName: value, // 给表单赋值
});
} else {
// 设置是否能点击上传
setImgOpen(true);
}
};
return (
<div className={'base basediy'}>
{/* 头部组件v1.2 */}
<TitleBack title={PATHNAME} url={getUrlLast(location.pathname) + '?Facility=true'} />
<Form
ref={formRef}
form={form}
name="basic"
onFinish={onFinish}
onFinishFailed={onFinishFailed}
validateMessages={validateMessages}
>
{/* 选择小区 */}
<Form.Item label="Community" name="communityName" rules={NewFaci[0]}>
<SearchOptionsCommnity
// ubmit={extendName}
opname={opname}
/>
</Form.Item>
{/* 设施名称 以及费用 */}
<Input.Group>
<Form.Item label="Facility" name="facilityName" rules={NewFaci[1]}>
<Input placeholder="Facility Name" />
</Form.Item>
<Form.Item label="Fee($)" name="communityManagerFee" rules={NewFaci[2]}>
<span className="divIconMoney">$</span>
<InputNumber
onKeyUp={keyup_communityManagerFee}
prefix="$"
placeholder="00.00"
disabled={facilityDetail}
min={0}
max={999}
step={0.01}
style={{ paddingLeft: '12px', width: '120px' }}
/>
</Form.Item>
<Form.Item label="Deposit" name="communityMargin" rules={NewFaci[3]}>
<span className="divIconMoney">$</span>
<InputNumber
onKeyUp={keyup_communityMargin}
prefix="$"
placeholder="00.00"
disabled={facilityDetail}
min={0}
max={999}
step={0.01}
style={{ paddingLeft: '12px', width: '120px' }}
/>
</Form.Item>
</Input.Group>
<hr></hr>
{/* 设施品类上传 */}
<Form.Item label="Facility Classification" className="flex required">
<Facilitys
disabled={imgOpen}
updata={{
// userToken: token,
imageType: 'categoriesImageName',
extends: ctyName,
}}
></Facilitys>
</Form.Item>
{/* 设施详情上传 */}
<Form.Item name="categoriesDetailsImageName" label="Facility Details" rules={NewFaci[4]}>
<PictureOptionsRow
over={imgOpen}
data={{
userToken: token,
imageType: 'categoriesDetailsImageName',
extends: ctyName,
}}
/>
</Form.Item>
{/* 时间 */}
<Form.Item label="Opening Hours" className="required">
<Form.Item name="startTime" noStyle>
<Select style={{ width: 140 }} placeholder="Start Time">
{hourS}
</Select>
</Form.Item>
<span className="diyspan">-</span>
<Form.Item name="endTime" noStyle>
<Select style={{ width: 140 }} placeholder="Closing Time">
{hourS}
</Select>
</Form.Item>
</Form.Item>
<hr></hr>
{/* ------------- */}
<p className="diyp">Appointment Settings : </p>
{/* 预约设置 */}
<Input.Group>
<Form.Item name="cancelReservationDay" label="Early Cancellation" rules={NewFaci[5]}>
<Input
onKeyUp={keyup.bind(this, 'cancelReservationDay')}
disabled={facilityDetail}
prefix="Advance"
suffix="Day"
style={{ width: 160, textAlign: 'center' }}
placeholder="0"
/>
</Form.Item>
<Form.Item
label="No deposit to cancel reservation"
name="nomarginCancelReservationDay"
rules={NewFaci[6]}
>
<Input
onKeyUp={keyup.bind(this, 'nomarginCancelReservationDay')}
disabled={facilityDetail}
prefix="Advance"
suffix="Day"
style={{ width: 160, textAlign: 'center' }}
placeholder="0"
/>
</Form.Item>
<Form.Item label="Booking" name="canReservationDay" rules={NewFaci[7]}>
<Input
onKeyUp={keyup.bind(this, 'canReservationDay')}
placeholder="0"
style={{ width: 160, textAlign: 'center' }}
disabled={facilityDetail}
prefix="Advance"
suffix="Day"
/>
</Form.Item>
</Input.Group>
{/* 设置次数 */}
<Input.Group>
<Form.Item label="Appointment Cycle" name="periodType" rules={NewFaci[8]}>
<Select
placeholder="Period"
allowClear
style={{ width: 120 }}
disabled={facilityDetail}
>
<Option value="1">Week</Option>
<Option value="2">Month</Option>
<Option value="3">Year</Option>
</Select>
</Form.Item>
<Form.Item name="canReservationNum" rules={NewFaci[9]}>
<Input
onKeyUp={keyup.bind(this, 'canReservationNum')}
placeholder="second"
style={{ width: 120 }}
disabled={facilityDetail}
suffix="second"
/>
</Form.Item>
</Input.Group>
<hr></hr>
{/* <Row gutter={32} style={{ marginTop: 28 }}>
<Col>Appointment Period</Col>
<Col><TimeSelect putSubmit={TimeSelectRef} defaultValue={timeExtend} disabled={facilityDetail}/></Col>
</Row> */}
{facilityDetail ? (
<>
<Button type="primary" onClick={Subscribe} loading={load}>
Subscribe
</Button>
</>
) : (
<>
<Button type="primary" htmlType="submit" loading={load}>
Submit
</Button>
</>
)}
</Form>
</div>
);
};
function mapStateToProps(state: any) {
const { sourceData, DataSave, Result, imgList } = state.FacilityBookings;
const { token } = state.login;
const load =
typeof state.loading.models.FacilityBookings == 'undefined'
? true
: state.loading.models.FacilityBookings;
return {
DataSave,
sourceData,
token,
Result,
imgList,
load,
};
}
export default connect(mapStateToProps)(Facility);
// ["10:00-12:00","13:00-14:00"]
// defultValue={[{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", name: "篮球场A"},{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", name: "篮球场B" }]}
// defultValue={[{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png" }]}
// const Data = {
// canReservationDay: "5",
// canReservationNum: "6",
// cancelReservationDay: "3",
// categoriesOpenTime: "09:00-20:00",
// communityManagerFee: "18",
// communityMargin: "20",
// communityName: "A9",
// facilityName: "篮球场",
// nomarginCancelReservationDay: "4",
// periodType: "2",
// }
import React, { useState, useEffect, useRef } from 'react';
import styles from './css/index.less';
import {
Input,
TimePicker,
Modal,
Button,
Space,
Pagination,
Tooltip,
Radio,
Form,
Row,
Col,
Select,
message,
} from 'antd';
const { RangePicker } = TimePicker;
const { Option } = Select;
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { FieldTimeOutlined } from '@ant-design/icons';
import PictureOptions from '../../../components/PictureOptions/PictureOptions';
import PictureOptionsRow from '../../../components/PictureOptions/PictureOptionsRow';
import TitleBack from '../../../components/TitleBack/TitleBack';
import TimeSelect from '../../../components/TimeSelect/TimeSelect';
import Line from '../../../components/Line/Line';
import { getNumber } from '../../../utils/string';
import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
// categoriesDetailsImageName: ["test.jpg"],
// categoriesName: ["篮球场A&test.jpg"],
// reservationQuantumTime: ["09:00-07:00"]
import { getUrlLast, numberToString } from '../../../utils/string';
import { checkParam, timeForm } from '@/utils/method';
import { validateMessages } from '@/utils/params';
const Facility = (props: any) => {
const { dispatch, location, token, sourceData, DataSave, Result } = props;
const RA = (index: any, values: any) => {
dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } });
};
const ResultClear = () => {
dispatch({ type: 'FacilityBookings/ResultClear' });
};
const openCheck = true;
const [Ref3, setRef3] = useState([]);
const [extend, setExtend] = useState(null);
const [timeExtend, setTimeExtend] = useState(null);
const [pictrueExtend, setPictrueExtend] = useState({ pic: null, pics: null, tab: 3 });
const [facilityDetail, setFacilityDetail] = useState(false);
const [PATHNAME, setPATHNAME] = useState('');
const formRef = useRef(null);
useEffect(() => {
if (Result != null) {
console.log('页面结果');
console.log(Result);
ResultClear();
history.push('/CommunityManagement/FacilityBookings');
}
}, [Result]);
const RA_S = () => {
if (DataSave != null) {
console.log('请求的设施ID为:' + DataSave.id);
RA(7, {
userToken: token,
facilitieId: DataSave.id,
});
} else {
history.go(-1);
}
};
useEffect(() => {
if (sourceData != null) {
console.log('【传入详情,当前数据不为空】');
console.log(sourceData);
setExtend(sourceData.communityName);
setTimeExtend(sourceData.reservationQuantumTime);
// 中断
// setPictrueExtend({tab:null,pic:null,pics:null})
console.log('重点检查');
console.log(sourceData);
formRef.current.setFieldsValue(sourceData);
}
}, [sourceData]);
useEffect(() => {
var tmp = pictrueExtend;
if (location.pathname.indexOf('FacilityEdit') > -1) {
setPATHNAME('Edit Facility');
tmp.tab = 1;
setPictrueExtend(tmp);
RA_S();
} else if (location.pathname.indexOf('FacilityDetail') > -1) {
setFacilityDetail(true);
tmp.tab = 2;
setPictrueExtend(tmp);
setPATHNAME('Facility Detail');
RA_S();
} else {
tmp.tab = 3;
setPictrueExtend(tmp);
setPATHNAME('Add Facility');
}
}, []);
// const TimeSelectRef = (values:any) => {
// setRef3(values)
// }
const onFinish = (values: any) => {
var result = values;
// if (Ref3.length!=0) {
// result.reservationQuantumTime = Ref3
// } else {
result.reservationQuantumTime = [timeForm(result.categoriesOpenTime, 'HH:mm')];
var categoriesOpenTime = timeForm(result.categoriesOpenTime, 'HH:mm');
result.categoriesOpenTime = categoriesOpenTime;
// }
// console.log(timeForm(result.categoriesOpenTime,'HH:mm'))
// result.categoriesOpenTime = "09:00-20:00"
if (result.communityManagerFee == null) {
result.communityManagerFee = numberToString(0);
} else {
result.communityManagerFee = numberToString(result.communityManagerFee);
}
if (result.communityMargin == null) {
result.communityMargin = numberToString(0);
} else {
result.communityMargin = numberToString(result.communityMargin);
}
if (
result.canReservationDay <= result.cancelReservationDay ||
result.canReservationDay <= result.nomarginCancelReservationDay
) {
message.error('can Reservation Day is invaild!', 3);
result.canReservationDay = null;
} else {
console.log('Should be check:', result);
if (checkParam(result)) {
//中断
if (pictrueExtend.tab == 3) {
if (Result == null) {
console.log('提交');
RA(6, result);
}
} else {
result.id = DataSave.id;
console.log('编辑');
if (Result == null) {
RA(17, result);
}
}
} else {
message.error('Error,Please finish it,not empty!', 3);
}
}
};
const onBillChange = (values: any, allValues: any) => {
if (values['communityName'] != null) {
setExtend(values['communityName']);
}
};
const onFinishFailed = (errorInfo: any) => {
console.log('Failed:', errorInfo);
};
const Subscribe = () => {
history.push(getUrlLast(location.pathname) + '/FacilityApply');
};
const keyup_tool = (value: any) => {
return getNumber(value.replace(/[^\d^\.]+/g, ''));
};
const keyup_communityManagerFee = (e: any) => {
e.target.value = keyup_tool(e.target.value);
formRef.current.setFieldsValue({ communityManagerFee: e.target.value });
};
const keyup_communityMargin = (e: any) => {
e.target.value = keyup_tool(e.target.value);
formRef.current.setFieldsValue({ communityMargin: e.target.value });
};
const keyup = (keyname: any, e: any) => {
e.target.value = e.target.value.replace(/[^\d^\.]+/g, '');
var tmp = {};
tmp[keyname] = e.target.value;
formRef.current.setFieldsValue(tmp);
};
return (
<div className={styles.base}>
{/* 头部组件v1.2 */}
<TitleBack title={PATHNAME} url={getUrlLast(location.pathname) + '?Facility=true'} />
<Form
ref={formRef}
name="basic"
onFinish={onFinish}
onFinishFailed={onFinishFailed}
onValuesChange={onBillChange}
validateMessages={validateMessages}
>
<Row gutter={32}>
<Col>Community</Col>
<Col>
<Form.Item name="communityName">
<SearchOptionsCommnity disabled={pictrueExtend.tab != 3 ? true : false} />
</Form.Item>
</Col>
</Row>
<Row gutter={32} style={{ marginTop: 28 }}>
<Col>Facility</Col>
<Col>
<Form.Item name="facilityName" rules={[{ required: openCheck }]}>
<Input placeholder="Facility Name" disabled={facilityDetail} />
</Form.Item>
</Col>
<Col>Fee($)</Col>
<Col>
<Form.Item name="communityManagerFee" rules={[{ required: openCheck }]}>
<Input
onKeyUp={keyup_communityManagerFee}
prefix="$"
placeholder="00.00"
disabled={facilityDetail}
allowClear
/>
</Form.Item>
</Col>
<Col>Deposit</Col>
<Col>
<Form.Item name="communityMargin" rules={[{ required: openCheck }]}>
<Input
onKeyUp={keyup_communityMargin}
prefix="$"
placeholder="00.00"
disabled={facilityDetail}
allowClear
/>
</Form.Item>
</Col>
</Row>
<Row gutter={32} style={{ marginTop: 28 }}>
{extend != null ? (
<>
<Col>Category Of Facilities</Col>
<Col>
<Form.Item name="categoriesName">
<PictureOptions
disabled={facilityDetail}
data={{
userToken: token,
imageType: 'categoriesImageName',
extends: extend,
}}
/>
</Form.Item>{' '}
</Col>
</>
) : null}
</Row>
<Row gutter={32} style={{ marginTop: 28 }}>
{extend != null ? (
<>
<Col>Facility Details</Col>
<Col>
<Form.Item name="categoriesDetailsImageName">
<PictureOptionsRow
disabled={facilityDetail}
data={{
userToken: token,
imageType: 'categoriesDetailsImageName',
extends: extend,
}}
/>
</Form.Item>
</Col>
</>
) : null}
</Row>
<Line />
<Row gutter={32} style={{ marginTop: 28 }}>
<Col>Opening Hours</Col>
{/* <Input placeholder="09:00-20:00" suffix={<FieldTimeOutlined />} style={{width:160}}/> */}
<Col>
<Form.Item name="categoriesOpenTime" rules={[{ required: openCheck }]}>
<RangePicker format={'HH'} hourStep={1} />
</Form.Item>
</Col>
</Row>
<Row gutter={32} style={{}}>
<Col>Appointment Settings</Col>
<Col>
<Row gutter={20}>
<Col>
<Form.Item
name="cancelReservationDay"
rules={[{ required: openCheck }]}
label="Early cancellation"
>
<Input
onKeyUp={keyup.bind(this, 'cancelReservationDay')}
placeholder="Cancel the reservation"
style={{ width: 160 }}
disabled={facilityDetail}
suffix="Day"
/>
</Form.Item>
</Col>
<Col>
<Form.Item
name="nomarginCancelReservationDay"
rules={[{ required: openCheck }]}
label="Automatic cancellation without deposit"
>
<Input
onKeyUp={keyup.bind(this, 'nomarginCancelReservationDay')}
placeholder="No deposit,cancellation"
style={{ width: 160 }}
disabled={facilityDetail}
suffix="Day"
/>
</Form.Item>
</Col>
<Col>
<Form.Item
name="canReservationDay"
rules={[{ required: openCheck }]}
label="Advance booking is available"
>
<Input
onKeyUp={keyup.bind(this, 'canReservationDay')}
placeholder="Bookable"
style={{ width: 160 }}
disabled={facilityDetail}
suffix="Day"
/>
</Form.Item>
</Col>
</Row>
<Row gutter={8}>
<Col>
<Form.Item
name="periodType"
rules={[{ required: openCheck }]}
label="Appointment Cycle"
>
<Select
placeholder="period"
allowClear
style={{ width: 120 }}
disabled={facilityDetail}
>
<Option value="1">Week</Option>
<Option value="2">Month</Option>
<Option value="3">Year</Option>
</Select>
</Form.Item>
</Col>
<Col>
<Form.Item name="canReservationNum" rules={[{ required: openCheck }]}>
<Input
onKeyUp={keyup.bind(this, 'canReservationNum')}
placeholder="times"
style={{ width: 120 }}
disabled={facilityDetail}
suffix="Times"
/>
</Form.Item>
</Col>
</Row>
</Col>
</Row>
{/* <Row gutter={32} style={{ marginTop: 28 }}>
<Col>Appointment Period</Col>
<Col><TimeSelect putSubmit={TimeSelectRef} defaultValue={timeExtend} disabled={facilityDetail}/></Col>
</Row> */}
{facilityDetail ? (
<>
<Line />
<Button type="primary" onClick={Subscribe}>
Subscribe
</Button>
</>
) : (
<>
<Line />
<Button type="primary" htmlType="submit">
Submit
</Button>
</>
)}
</Form>
</div>
);
};
function mapStateToProps(state: any) {
const { sourceData, DataSave, Result } = state.FacilityBookings;
const { token } = state.login;
return {
DataSave,
sourceData,
token,
Result,
};
}
export default connect(mapStateToProps)(Facility);
// ["10:00-12:00","13:00-14:00"]
// defultValue={[{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", name: "篮球场A"},{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", name: "篮球场B" }]}
// defultValue={[{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png" }]}
// const Data = {
// canReservationDay: "5",
// canReservationNum: "6",
// cancelReservationDay: "3",
// categoriesOpenTime: "09:00-20:00",
// communityManagerFee: "18",
// communityMargin: "20",
// communityName: "A9",
// facilityName: "篮球场",
// nomarginCancelReservationDay: "4",
// periodType: "2",
// }
import React, { useState, useEffect } from 'react';
import { Input, Tabs, Pagination, Space, Button } from 'antd';
const { TabPane } = Tabs;
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { objectColumns } from '../../../utils/string';
import { timestampToTime } from '../../../utils/time';
import TitleSearch from '../../../components/TitleSearch/TitleSearch';
// const managerFeeStatusDes= ["未交", "已交", "已退"]
// const marginFeeStatusDes = ["未交", "已交", "未退", "已退部分", "已退全部"]
// const statusDes = ["全部", "已申请", "已预订", "已使用", "已取消", "已完成"]
const managerFeeStatusDes = ['Not paid', 'Paid', 'Returned'];
const marginFeeStatusDes = ['Not paid', 'Paid', 'Not Returned', 'Returned part', 'Returned all'];
const statusDes = ['All', 'Applied', 'Reserved', 'Used', 'Cancelled', 'Completed'];
import { getUrlLastParams } from '../../../utils/string';
import './css/index.less';
import ProTable from '@ant-design/pro-table';
import { PlusOutlined, ClockCircleOutlined, ClearOutlined } from '@ant-design/icons';
import moment from 'moment';
const FacilityBookings = (props: any) => {
const { formatMessage } = useIntl();
const { dispatch, location, Data, Data2, token, DataSave, curString, Result, loading } = props;
const RA = (index: any, values: any) => {
console.log(values);
dispatch({
type: 'FacilityBookings/RA',
playload: { index: index, body: values },
});
};
const SA = (values: any) => {
dispatch({ type: 'FacilityBookings/SA', playload: values });
};
const QA = (values: any) => {
dispatch({ type: 'FacilityBookings/QA', playload: values });
};
const CA = () => {
dispatch({ type: 'FacilityBookings/CA', playload: null });
};
const [columns, setColumns] = useState([]);
const [columns2, setColumns2] = useState([]);
const goToFunction = () => {
if (curString.tab == 2) {
CA();
// 先清空上传图片列表
dispatch({ type: 'FacilityBookings/overAllImgList' });
} else {
// 清空之前的数据
let Data3 = null;
dispatch({ type: 'FacilityBookings/returnPage3', Data3 });
}
history.push(location.pathname + (curString.tab == 1 ? '/Booking' : '/Adding'));
};
// 预约详情跳转
const goToDetail = (values: any) => {
SA(values);
history.push(location.pathname + '/Detail');
};
// 列表2 点击跳转
const makeOperator = (values: any, index: any) => {
const path = ['/FacilityDetail', '/FacilityEdit', '/FacilityApply'];
SA(values);
console.log('准备页面跳转');
console.log(curString);
history.push(location.pathname + path[index]);
};
useEffect(() => {
const key = [
['Service Community', 'communityName'],
['User Name', 'accountName'],
['Facility Bookings', 'facilityTitle'],
[
'Order Time',
null,
(text: any, record: any) => (
<div>
<ClockCircleOutlined style={{ color: '#666' }} />
&nbsp;
{moment(record.createTime.time).format('YYYY-MM-DD')}
</div>
),
],
[
'Booking Schedule',
'subscribeDate',
(text: any) => (
<div>
<ClockCircleOutlined style={{ color: '#666' }} />
&nbsp;
{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>],
[
'Actions',
null,
(text: any, record: any) => (
<Space size="middle">
{' '}
<a onClick={goToDetail.bind(this, record)}>Detail</a>
</Space>
),
],
];
const key2 = [
['Community', 'communityName'],
['Facilty', 'facilityName'],
['Open Time', 'categoriesOpenTime'],
[
'Action',
null,
(text: any, record: any) => (
<Space size="middle">
<a onClick={() => makeOperator(record, 0)}>Detail</a>
<a onClick={() => makeOperator(record, 1)}>Edit</a>
<a onClick={() => makeOperator(record, 2)}>Booking</a>
</Space>
),
],
];
setColumns(objectColumns(key));
setColumns2(objectColumns(key2));
console.log('页面刷新');
console.log(DataSave);
console.log(curString);
if (curString.tab == 1) {
RA(9, {
userToken: token,
pageNum: curString.curPage,
subscribeDate: curString.subscribeDate,
status: curString.status,
communityNameList: curString.communityNameList,
});
} else {
RA(8, { userToken: token, pageNum: curString.curPage2 });
}
}, []);
const CallBackTitleSearch = (comment: any) => {
console.log(comment);
if (curString.tab == 1) {
if (comment.communityName != null || comment.key != null || comment.status != null) {
var tmp = curString;
tmp.subscribeDate = comment.key;
if (comment.status == null || comment.status == undefined) {
tmp.status = 0;
} else {
tmp.status = comment.status;
}
tmp.communityNameList = comment.communityName;
tmp.curPage = 1;
QA(tmp);
console.log(tmp);
//中断
RA(9, {
userToken: token,
pageNum: '1',
subscribeDate: tmp.subscribeDate,
status: tmp.status,
communityNameList: comment.communityName,
});
}
} else {
if (comment.communityName != null || comment.facilityName != null) {
var tmp = curString;
tmp.communityNameList = comment.communityName;
tmp.facilityName = comment.facilityName;
tmp.curPage = 1;
QA(tmp);
RA(8, {
communityNameList: comment.communityName,
facilityName: comment.facilityName,
pageNum: '1',
});
}
}
};
function TabCallback(tab: any) {
var tmp = curString;
tmp.tab = tab;
QA(tmp);
if (tab == 1) {
RA(9, {
userToken: token,
status: curString.status,
subscribeDate: curString.subscribeDate,
pageNum: curString.curPage,
communityNameList: curString.communityNameList,
});
} else {
RA(8, { userToken: token, pageNum: curString.curPage2 });
}
}
function Pagechange(current: any, pageSize: any) {
if (curString.tab == 1) {
var tmp = curString;
tmp.curPage = current;
QA(tmp);
RA(9, {
userToken: token,
pageNum: current,
subscribeDate: curString.subscribeDate,
status: curString.status,
communityNameList: curString.communityNameList,
});
} else {
var tmp = curString;
tmp.curPage2 = current;
QA(tmp);
if (curString.communityNameList != null) {
RA(8, {
userToken: token,
pageNum: current,
communityNameList: curString.communityNameList,
});
} else {
RA(8, { userToken: token, pageNum: current });
}
}
}
return (
<>
<div className="base">
{/* 头部组件 */}
{curString.tab == 1 ? (
<>
<TitleSearch
status={[
{
name: ['status', 'Order status'],
data: [
[0, 'All'],
[1, 'Applied'],
[2, 'Reserved'],
[3, 'Used'],
[4, 'Cancelled'],
],
},
]}
time={['key', 'Booking time ']}
community={'communityName'}
checklist={curString.communityNameList != null ? curString.communityNameList : null}
onSubmit={CallBackTitleSearch}
/>
</>
) : (
<>
<TitleSearch
listkey={['facilityName']}
list={['Facility name']}
community={'communityName'}
onSubmit={CallBackTitleSearch}
/>
</>
)}
</div>
{/* 下方及搜索 */}
<div className={'base'}>
{/* <div style={{ position: 'relative', height: 40 }}>
<Button type="primary" style={{ position: 'absolute', right: 0 }} onClick={goToFunction}>
{curString.tab == 1 ? 'Booking' : 'Add Facility'}
</Button>
</div> */}
<Tabs
defaultActiveKey={curString.tab.toString()}
onChange={TabCallback}
className="diytabs"
>
<TabPane tab="Facility Bookings" key="1">
<ProTable
loading={loading}
rowKey="id"
dataSource={Data.data}
columns={columns}
// pagination={{
// current: curString.curPage,
// total: Data.total.totalRow,
// showSizeChanger: false,
// onChange: Pagechange,
// }}
pagination={false}
search={false}
toolBarRender={() => [
<Button key="3" type="primary" onClick={goToFunction}>
<PlusOutlined />
添加预约
</Button>,
]}
options={{
density: true,
fullScreen: true,
reload: () => {
// onReset();
},
setting: false,
}}
headerTitle="预约列表"
/>
{curString ? (
<div className="pages">
<Pagination
current={curString.curPage}
total={Data.total.totalRow}
// pageSizeOptions={[]}
showSizeChanger={false}
// pageSize={village.page.curPageSize}
onChange={Pagechange}
/>
</div>
) : (
''
)}
</TabPane>
<TabPane tab="Facility Management" key="2">
<ProTable
loading={loading}
rowKey="id"
dataSource={Data2.data}
columns={columns2}
pagination={{
current: curString.curPage2,
total: Data2.total.totalRow,
showSizeChanger: false,
onChange: Pagechange,
}}
// pagination={false} // 隐藏默认分页
search={false}
toolBarRender={() => [
<Button key="3" type="primary" onClick={goToFunction}>
<PlusOutlined />
添加设施
</Button>,
]}
options={{
density: true,
fullScreen: true,
reload: () => {
// onReset();
},
setting: false,
}}
headerTitle="设施列表"
/>
</TabPane>
</Tabs>
</div>
</>
);
};
function mapStateToProps(state: any) {
const { Data, Data2, DataSave, curString, Result } = state.FacilityBookings;
const { token } = state.login;
const loading =
typeof state.loading.models.FacilityBookings == 'undefined'
? true
: state.loading.models.FacilityBookings;
return {
Data,
Data2,
DataSave,
curString,
Result,
token,
loading,
};
}
export default connect(mapStateToProps)(FacilityBookings);
// status:预约设施状态 0:全部 1:已申请 2:已预订 3:已使用 4:已取消 5:已完成
// manager_fee_status:管理费 0:未 1:已交 2:已退
// margin_fee_status:押金 0:未 1:已交 2:未退 3:已退部分 4:已退全部 5:
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
.base { .base {
width: 100%; width: 100%;
background-color: #ffffff; background-color: #ffffff;
padding: 20px; padding: 15px;
} }
//头部组件 //头部组件
......
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { Input, Tabs, Table, Form, Button, message, DatePicker } from 'antd'; import { Input, Tabs, Tag, Form, Button, message, DatePicker } from 'antd';
const { TabPane } = Tabs; const { TabPane } = Tabs;
import { connect } from 'umi'; import { connect } from 'umi';
import { objectColumns } from '@/utils/string'; import { objectColumns } from '@/utils/string';
...@@ -39,7 +39,22 @@ const VisitorRecord = (props: any) => { ...@@ -39,7 +39,22 @@ const VisitorRecord = (props: any) => {
{ title: 'Security Guard', dataIndex: 'securityGuardName' }, { title: 'Security Guard', dataIndex: 'securityGuardName' },
{ title: 'Number Plate', dataIndex: 'numberPlate' }, { title: 'Number Plate', dataIndex: 'numberPlate' },
// 隐藏的搜索框 // 隐藏的搜索框
{ title: 'Visitor Time', dataIndex: 'updateTime', valueType: 'date' }, {
title: 'Visitor Time',
dataIndex: 'updateTime',
valueType: 'date',
render: (text: any, record: any) => {
if (record.linkStatus == 1) {
return text;
} else {
return (
<>
{text} <Tag color="red">Temporary</Tag>
</>
);
}
},
},
{ title: 'Community', dataIndex: 'visitorCommunity' }, { title: 'Community', dataIndex: 'visitorCommunity' },
// { title: 'Unit', dataIndex: 'inviterAddress' }, // { title: 'Unit', dataIndex: 'inviterAddress' },
{ {
...@@ -236,14 +251,14 @@ const VisitorRecord = (props: any) => { ...@@ -236,14 +251,14 @@ const VisitorRecord = (props: any) => {
Reset Reset
</Button> </Button>
</Form.Item> </Form.Item>
<div style={{ maxWidth: '100%', marginTop: 15, width: '100%' }}> <div style={{ marginTop: 24, marginRight: -16 }}>
<Form.Item name="community" label=""> <Form.Item name="community" label="">
<SelectCommunity /> <SelectCommunity />
</Form.Item> </Form.Item>
</div> </div>
</Form> </Form>
</div> </div>
<div style={{ width: '100%', padding: 16, backgroundColor: '#ffffff' }}> <div style={{ width: '100%', padding: '0px 15px 15px 15px', backgroundColor: '#ffffff' }}>
<ProTable <ProTable
loading={loading} loading={loading}
rowKey="id" rowKey="id"
......
...@@ -5,5 +5,5 @@ ...@@ -5,5 +5,5 @@
.VisitorRecord { .VisitorRecord {
padding: 15px; padding: 15px;
background: #fff; background: #fff;
margin-bottom: 15px; margin-bottom: 0;
} }
import React from 'react'; import React from 'react';
import {connect, routerRedux} from 'dva'; import { connect, routerRedux } from 'dva';
import {Table, Button, Input, Select, Modal, Tooltip, Upload, Icon, Checkbox, Row, Radio, Tag} from "antd"; import {
Table,
Button,
Input,
Select,
Modal,
Tooltip,
Upload,
Icon,
Checkbox,
Row,
Radio,
Tag,
} from 'antd';
import styles from './style.less'; import styles from './style.less';
import {ConnectState} from "@/models/connect"; import { ConnectState } from '@/models/connect';
// import XLSX from "@/pages/account/xlsx.core.min"; // import XLSX from "@/pages/account/xlsx.core.min";
import {router} from "umi"; import { router } from 'umi';
import 'moment/locale/zh-cn'; import 'moment/locale/zh-cn';
class CommunityNotice extends React.Component { class CommunityNotice extends React.Component {
//构造 //构造
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -23,11 +34,15 @@ class CommunityNotice extends React.Component { ...@@ -23,11 +34,15 @@ class CommunityNotice extends React.Component {
name: '', name: '',
model: '', model: '',
status: undefined, status: undefined,
statusList: [{label:"在线",value:"1"}, {label:"故障",value:"3"},{label:"未激活",value:"4"}], statusList: [
{ label: '在线', value: '1' },
{ label: '故障', value: '3' },
{ label: '未激活', value: '4' },
],
provinceList: [], provinceList: [],
cityList: [{name: "未选择省"}], cityList: [{ name: '未选择省' }],
districtList: [{name: "未选择市"}], districtList: [{ name: '未选择市' }],
streetList: [{name: "未选择区"}], streetList: [{ name: '未选择区' }],
delData: [], delData: [],
visible: false, visible: false,
deviceStatus: '', deviceStatus: '',
...@@ -36,147 +51,150 @@ class CommunityNotice extends React.Component { ...@@ -36,147 +51,150 @@ class CommunityNotice extends React.Component {
used: null, used: null,
newAdd: null, newAdd: null,
strList: [], strList: [],
newList:[], newList: [],
authorityList:[ authorityList: [
{ {
"children": [ children: [
{ {
"children": [], children: [],
"hasChildren": false, hasChildren: false,
"is_admin": 1, is_admin: 1,
"menuid": 5, menuid: 5,
"name": "组织架构", name: '组织架构',
"parentid": 1, parentid: 1,
"sort": 10, sort: 10,
"state": "", state: '',
"is_checked": true is_checked: true,
}, },
{ {
"children": [], children: [],
"hasChildren": false, hasChildren: false,
"is_admin": 1, is_admin: 1,
"menuid": 6, menuid: 6,
"name": "员工管理", name: '员工管理',
"parentid": 1, parentid: 1,
"sort": 20, sort: 20,
"state": "", state: '',
"is_checked": true is_checked: true,
}, },
{ {
"children": [], children: [],
"hasChildren": false, hasChildren: false,
"is_admin": 1, is_admin: 1,
"menuid": 11, menuid: 11,
"name": "角色管理", name: '角色管理',
"parentid": 1, parentid: 1,
"sort": 30, sort: 30,
"state": "", state: '',
"is_checked": false is_checked: false,
}, },
{ {
"children": [], children: [],
"hasChildren": false, hasChildren: false,
"is_admin": 1, is_admin: 1,
"menuid": 17, menuid: 17,
"name": "企业设置", name: '企业设置',
"parentid": 1, parentid: 1,
"sort": 2, sort: 2,
"state": "", state: '',
"is_checked": true is_checked: true,
}, },
{ {
"children": [], children: [],
"hasChildren": false, hasChildren: false,
"is_admin": 1, is_admin: 1,
"menuid": 26, menuid: 26,
"name": "员工管理", name: '员工管理',
"parentid": 1, parentid: 1,
"sort": 1, sort: 1,
"state": "", state: '',
"is_checked": false is_checked: false,
} },
], ],
"hasChildren": true, hasChildren: true,
"is_admin": 1, is_admin: 1,
"menuid": 1, menuid: 1,
"name": "企业", name: '企业',
"parentid": 0, parentid: 0,
"sort": 20, sort: 20,
"state": "closed", state: 'closed',
"is_checked": true is_checked: true,
}, },
{ {
"children": [ children: [
{ {
"children": [], children: [],
"hasChildren": false, hasChildren: false,
"is_admin": 1, is_admin: 1,
"menuid": 12, menuid: 12,
"name": "供应商订单", name: '供应商订单',
"parentid": 4, parentid: 4,
"sort": 10, sort: 10,
"state": "", state: '',
"is_checked": true is_checked: true,
}, },
{ {
"children": [], children: [],
"hasChildren": false, hasChildren: false,
"is_admin": 1, is_admin: 1,
"menuid": 15, menuid: 15,
"name": "供应商管理", name: '供应商管理',
"parentid": 4, parentid: 4,
"sort": 20, sort: 20,
"state": "", state: '',
"is_checked": false is_checked: false,
}, },
{ {
"children": [], children: [],
"hasChildren": false, hasChildren: false,
"is_admin": 1, is_admin: 1,
"menuid": 16, menuid: 16,
"name": "成为供应商", name: '成为供应商',
"parentid": 4, parentid: 4,
"sort": 30, sort: 30,
"state": "", state: '',
"is_checked": true is_checked: true,
} },
], ],
"hasChildren": true, hasChildren: true,
"is_admin": 1, is_admin: 1,
"menuid": 4, menuid: 4,
"name": "供应商", name: '供应商',
"parentid": 0, parentid: 0,
"sort": 11, sort: 11,
"state": "closed", state: 'closed',
"is_checked": true is_checked: true,
} },
], ],
} };
} }
/*----------------- 方法集 ------------------*/ /*----------------- 方法集 ------------------*/
//重置 //重置
reset = () => { reset = () => {
this.setState({ this.setState(
province: undefined, {
city: undefined, province: undefined,
district: undefined, city: undefined,
street: undefined, district: undefined,
status: undefined, street: undefined,
name: '', status: undefined,
},() => { name: '',
this.getDevice(); },
}); () => {
this.getDevice();
},
);
}; };
//模态框相关 //模态框相关
showModal = () => { showModal = () => {
let flag = 0; let flag = 0;
const nowUser = this.props.currentUser; const nowUser = this.props.currentUser;
if(nowUser.permission!=null){ if (nowUser.permission != null) {
for(let i=0;i<nowUser.permission.length;i++){ for (let i = 0; i < nowUser.permission.length; i++) {
if(nowUser.permission[i]=="4"){ if (nowUser.permission[i] == '4') {
if(this.state.delData==null||this.state.delData.length<=0){ if (this.state.delData == null || this.state.delData.length <= 0) {
alert("未选中删除项!"); alert('未选中删除项!');
return; return;
} }
flag = 1; flag = 1;
...@@ -185,12 +203,12 @@ class CommunityNotice extends React.Component { ...@@ -185,12 +203,12 @@ class CommunityNotice extends React.Component {
}); });
} }
} }
}else{ } else {
// alert("找不到用户权限记录!"); // alert("找不到用户权限记录!");
// return; // return;
} }
if(flag == 0){ if (flag == 0) {
alert("缺少设备删除权限!"); alert('缺少设备删除权限!');
} }
}; };
handleOk = () => { handleOk = () => {
...@@ -215,30 +233,29 @@ class CommunityNotice extends React.Component { ...@@ -215,30 +233,29 @@ class CommunityNotice extends React.Component {
model: this.state.model, model: this.state.model,
status: this.state.status, status: this.state.status,
id: this.props.currentUser.userid, id: this.props.currentUser.userid,
userPhone:"18813787835" userPhone: '18813787835',
}; };
this.props.dispatch({ this.props.dispatch({
type: 'communityNoticeModel/getAllNotice', type: 'communityNoticeModel/getAllNotice',
payload: params, payload: params,
callback: (res) => { callback: (res) => {
if (res) { if (res) {
/* this.setState({
/* this.setState({
data: res.rows, data: res.rows,
total: res.total, total: res.total,
})*/ })*/
if(res.error_code == "0000"){ if (res.error_code == '0000') {
this.setState({ this.setState({
data: res.data.rows, data: res.data.rows,
total: res.data.total, total: res.data.total,
}) });
} }
if(res.error_code == "0001"){ if (res.error_code == '0001') {
alert(res.error_msg); alert(res.error_msg);
}else if(res.error_code == "0002"){ } else if (res.error_code == '0002') {
alert(res.error_msg); alert(res.error_msg);
}else if(res.error_code == "0008"){ } else if (res.error_code == '0008') {
alert(res.error_msg); alert(res.error_msg);
window.location.href = '/'; window.location.href = '/';
router.replace('/'); router.replace('/');
...@@ -247,40 +264,46 @@ class CommunityNotice extends React.Component { ...@@ -247,40 +264,46 @@ class CommunityNotice extends React.Component {
// alert("Tos查询出错!未知错误!"); // alert("Tos查询出错!未知错误!");
// } // }
} }
} },
}); });
}; };
//跳转到编辑页面 //跳转到编辑页面
edit = (params) => { edit = (params) => {
let flag = 0; let flag = 0;
const nowUser = this.props.currentUser; const nowUser = this.props.currentUser;
this.props.dispatch(routerRedux.push({ this.props.dispatch(
pathname: '/CommunityManagement/CommunityAnnouncement/Create', routerRedux.push({
query: params, pathname: '/CommunityManagement/CommunityAnnouncement/Create',
})) query: params,
if(nowUser.permission!=null){ }),
if(params==null){ );
for(let i=0;i<nowUser.permission.length;i++){ if (nowUser.permission != null) {
if(nowUser.permission[i]=="3"){ if (params == null) {
for (let i = 0; i < nowUser.permission.length; i++) {
if (nowUser.permission[i] == '3') {
flag = 1; flag = 1;
this.props.dispatch(routerRedux.push({ this.props.dispatch(
pathname: '/CommunityManagement/CommunityAnnouncement/Create', routerRedux.push({
query: params, pathname: '/CommunityManagement/CommunityAnnouncement/Create',
})) query: params,
}),
);
} }
} }
}else{ } else {
for(let i=0;i<nowUser.permission.length;i++){ for (let i = 0; i < nowUser.permission.length; i++) {
if(nowUser.permission[i]=="2"){ if (nowUser.permission[i] == '2') {
flag = 1; flag = 1;
this.props.dispatch(routerRedux.push({ this.props.dispatch(
pathname: '/CommunityManagement/CommunityAnnouncement/Edit', routerRedux.push({
query: params, pathname: '/CommunityManagement/CommunityAnnouncement/Edit',
})) query: params,
}),
);
} }
} }
} }
}else{ } else {
// alert("找不到用户权限记录!"); // alert("找不到用户权限记录!");
// return; // return;
} }
...@@ -297,87 +320,93 @@ class CommunityNotice extends React.Component { ...@@ -297,87 +320,93 @@ class CommunityNotice extends React.Component {
edit2 = (params) => { edit2 = (params) => {
let flag = 0; let flag = 0;
const nowUser = this.props.currentUser; const nowUser = this.props.currentUser;
if(nowUser.permission!=null){ if (nowUser.permission != null) {
if(params==null){ if (params == null) {
for(let i=0;i<nowUser.permission.length;i++){ for (let i = 0; i < nowUser.permission.length; i++) {
if(nowUser.permission[i]=="3"){ if (nowUser.permission[i] == '3') {
flag = 1; flag = 1;
this.props.dispatch(routerRedux.push({ this.props.dispatch(
pathname: 'tosUser/edit', routerRedux.push({
query: params, pathname: 'tosUser/edit',
})) query: params,
}),
);
} }
} }
}else{ } else {
for(let i=0;i<nowUser.permission.length;i++){ for (let i = 0; i < nowUser.permission.length; i++) {
if(nowUser.permission[i]=="2"){ if (nowUser.permission[i] == '2') {
flag = 1; flag = 1;
this.props.dispatch(routerRedux.push({ this.props.dispatch(
pathname: '/tosUser/edit', routerRedux.push({
query: params, pathname: '/tosUser/edit',
})) query: params,
}),
);
} }
} }
} }
}else{ } else {
// alert("找不到用户权限记录!"); // alert("找不到用户权限记录!");
// return; // return;
} }
if(flag == 0){ if (flag == 0) {
if(params==null){ if (params == null) {
alert("缺少设备添加权限!"); alert('缺少设备添加权限!');
}else{ } else {
alert("缺少设备修改权限!"); alert('缺少设备修改权限!');
} }
} }
}; };
//跳转到详情页面 //跳转到详情页面
details = (params) => { details = (params) => {
this.props.dispatch(routerRedux.push({ this.props.dispatch(
pathname: '/CommunityManagement/CommunityAnnouncement/Detail', routerRedux.push({
query: params, pathname: '/CommunityManagement/CommunityAnnouncement/Detail',
})) query: params,
}),
);
}; };
//设备状态变更 //设备状态变更
statusChange = (e) => { statusChange = (e) => {
this.setState({status: e == undefined ? undefined : e}); this.setState({ status: e == undefined ? undefined : e });
}; };
//设备名称和型号修改 //设备名称和型号修改
nameAndModelChange = (e) => { nameAndModelChange = (e) => {
this.setState({name: e.target.value}); this.setState({ name: e.target.value });
}; };
//加载省 //加载省
provinceload = (code) => { provinceload = (code) => {
this.props.dispatch({ this.props.dispatch({
type: 'deviceModel/getRegion', type: 'deviceModel/getRegion',
payload: {code: code,}, payload: { code: code },
callback: (res) => { callback: (res) => {
if (res) { if (res) {
this.setState({ this.setState({
provinceList: res.data, provinceList: res.data,
}); });
} }
} },
}); });
}; };
//省变更 //省变更
provinceChange = (e) => { provinceChange = (e) => {
if (e == undefined) { if (e == undefined) {
this.setState({ this.setState({
cityList: [{name: "未选择省"}], cityList: [{ name: '未选择省' }],
districtList: [{name: "未选择市"}], districtList: [{ name: '未选择市' }],
streetList: [{name: "未选择区"}], streetList: [{ name: '未选择区' }],
province: undefined, province: undefined,
city: undefined, city: undefined,
district: undefined, district: undefined,
street: undefined, street: undefined,
}) });
} else { } else {
this.setState({province: {label: e.label,}}); this.setState({ province: { label: e.label } });
this.props.dispatch({ this.props.dispatch({
type: 'deviceModel/getRegion', type: 'deviceModel/getRegion',
payload: {code: e.key,}, payload: { code: e.key },
callback: (res) => { callback: (res) => {
if (res) { if (res) {
this.setState({ this.setState({
...@@ -387,7 +416,7 @@ class CommunityNotice extends React.Component { ...@@ -387,7 +416,7 @@ class CommunityNotice extends React.Component {
street: undefined, street: undefined,
}); });
} }
} },
}); });
} }
}; };
...@@ -395,17 +424,17 @@ class CommunityNotice extends React.Component { ...@@ -395,17 +424,17 @@ class CommunityNotice extends React.Component {
cityChange = (e) => { cityChange = (e) => {
if (e == undefined) { if (e == undefined) {
this.setState({ this.setState({
districtList: [{name: "未选择市"}], districtList: [{ name: '未选择市' }],
streetList: [{name: "未选择区"}], streetList: [{ name: '未选择区' }],
city: undefined, city: undefined,
district: undefined, district: undefined,
street: undefined, street: undefined,
}) });
} else { } else {
this.setState({city: {label: e.label,}}); this.setState({ city: { label: e.label } });
this.props.dispatch({ this.props.dispatch({
type: 'deviceModel/getRegion', type: 'deviceModel/getRegion',
payload: {code: e.key,}, payload: { code: e.key },
callback: (res) => { callback: (res) => {
if (res) { if (res) {
this.setState({ this.setState({
...@@ -414,7 +443,7 @@ class CommunityNotice extends React.Component { ...@@ -414,7 +443,7 @@ class CommunityNotice extends React.Component {
street: undefined, street: undefined,
}); });
} }
} },
}); });
} }
}; };
...@@ -422,15 +451,15 @@ class CommunityNotice extends React.Component { ...@@ -422,15 +451,15 @@ class CommunityNotice extends React.Component {
districtChange = (e) => { districtChange = (e) => {
if (e == undefined) { if (e == undefined) {
this.setState({ this.setState({
streetList: [{name: "未选择区"}], streetList: [{ name: '未选择区' }],
district: undefined, district: undefined,
street: undefined, street: undefined,
}) });
} else { } else {
this.setState({district: {label: e.label,}}); this.setState({ district: { label: e.label } });
this.props.dispatch({ this.props.dispatch({
type: 'deviceModel/getRegion', type: 'deviceModel/getRegion',
payload: {code: e.key,}, payload: { code: e.key },
callback: (res) => { callback: (res) => {
if (res) { if (res) {
this.setState({ this.setState({
...@@ -438,7 +467,7 @@ class CommunityNotice extends React.Component { ...@@ -438,7 +467,7 @@ class CommunityNotice extends React.Component {
street: undefined, street: undefined,
}); });
} }
} },
}); });
} }
}; };
...@@ -449,36 +478,36 @@ class CommunityNotice extends React.Component { ...@@ -449,36 +478,36 @@ class CommunityNotice extends React.Component {
payload: this.state.delData, payload: this.state.delData,
callback: (res) => { callback: (res) => {
if (res) { if (res) {
if (res.error_code == "0000") { if (res.error_code == '0000') {
alert(res.error_msg); alert(res.error_msg);
this.getDevice(); this.getDevice();
} else if(res.error_code == "0001") { } else if (res.error_code == '0001') {
alert(res.error_msg); alert(res.error_msg);
} else if(res.error_code == "0002"){ } else if (res.error_code == '0002') {
alert(res.error_msg); alert(res.error_msg);
} else if(res.error_code == "0008"){ } else if (res.error_code == '0008') {
alert(res.error_msg); alert(res.error_msg);
window.location.href = '/'; window.location.href = '/';
router.replace('/'); router.replace('/');
} else { } else {
alert("删除失败!未知错误!"); alert('删除失败!未知错误!');
} }
} }
} },
}); });
}; }
//显示信息 //显示信息
info() { info() {
const { used, newAdd, strList} = this.state; const { used, newAdd, strList } = this.state;
const strSelect = strList.map((item) => ( const strSelect = strList.map((item) => <p>{item}</p>);
<p>{item}</p>
));
Modal.info({ Modal.info({
title: '批量导入结果', title: '批量导入结果',
content: ( content: (
<div> <div>
<p>绑定<span style={{color:"lightgreen",fontSize:24}}>{newAdd}</span>台设备, <p>
以下<span style={{color:"red",fontSize:24}}>{used}</span>台设备已被占用</p> 绑定<span style={{ color: 'lightgreen', fontSize: 24 }}>{newAdd}</span>台设备, 以下
<span style={{ color: 'red', fontSize: 24 }}>{used}</span>台设备已被占用
</p>
{strSelect} {strSelect}
</div> </div>
), ),
...@@ -514,14 +543,11 @@ class CommunityNotice extends React.Component { ...@@ -514,14 +543,11 @@ class CommunityNotice extends React.Component {
key: 'noticStartTime', key: 'noticStartTime',
}, },
{ {
title: 'Status', title: 'Status',
dataIndex: 'noticScope', dataIndex: 'noticScope',
key: 'noticScope', key: 'noticScope',
render: (text, record) => ( render: (text, record) => <span>{record.noticScope == '1' ? '全部小区' : '对应小区'}</span>,
<span>{record.noticScope == '1' ? "全部小区" : "对应小区"}</span>
),
/* render: (text, record) => ( /* render: (text, record) => (
<> <>
...@@ -541,7 +567,6 @@ class CommunityNotice extends React.Component { ...@@ -541,7 +567,6 @@ class CommunityNotice extends React.Component {
} }
</> </>
),*/ ),*/
}, },
/*{ /*{
...@@ -565,27 +590,46 @@ class CommunityNotice extends React.Component { ...@@ -565,27 +590,46 @@ class CommunityNotice extends React.Component {
key: 'action', key: 'action',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Button style={{background: 'transparent', border: 0, color: '#1890FF'}} <Button
onClick={() => this.details(record)}>Details</Button> style={{ background: 'transparent', border: 0, color: '#1890FF' }}
<Button style={{background: 'transparent', border: 0, color: '#1890FF'}} onClick={() => this.details(record)}
onClick={() => this.edit(record)}>Edit</Button> >
Details
</Button>
<Button
style={{ background: 'transparent', border: 0, color: '#1890FF' }}
onClick={() => this.edit(record)}
>
Edit
</Button>
</span> </span>
), ),
}, },
]; ];
//行选择 //行选择
rowSelection = { rowSelection = {
onChange: (selectedRowKeys , selectedRows) => { onChange: (selectedRowKeys, selectedRows) => {
this.setState({ this.setState({
delData: selectedRows delData: selectedRows,
}); });
}, },
}; };
//渲染 //渲染
render() { render() {
const { const {
data, total, statusList, provinceList, cityList, districtList, data,
province, city, district, status, name,newList,authorityList total,
statusList,
provinceList,
cityList,
districtList,
province,
city,
district,
status,
name,
newList,
authorityList,
} = this.state; } = this.state;
const uploadprops = { const uploadprops = {
// 这里我们只接受excel2007以后版本的文件,accept就是指定文件选择框的文件类型 // 这里我们只接受excel2007以后版本的文件,accept就是指定文件选择框的文件类型
...@@ -601,7 +645,7 @@ class CommunityNotice extends React.Component { ...@@ -601,7 +645,7 @@ class CommunityNotice extends React.Component {
const rABS = true; const rABS = true;
const f = fileList[0]; const f = fileList[0];
const reader = new FileReader(); const reader = new FileReader();
reader.onload = e => { reader.onload = (e) => {
let dataResult = e.target.result; let dataResult = e.target.result;
if (!rABS) dataResult = new Uint8Array(dataResult); if (!rABS) dataResult = new Uint8Array(dataResult);
const workbook = XLSX.read(dataResult, { const workbook = XLSX.read(dataResult, {
...@@ -610,12 +654,17 @@ class CommunityNotice extends React.Component { ...@@ -610,12 +654,17 @@ class CommunityNotice extends React.Component {
// 假设我们的数据在第一个标签 // 假设我们的数据在第一个标签
const firstWorksheet = workbook.Sheets[workbook.SheetNames[0]]; const firstWorksheet = workbook.Sheets[workbook.SheetNames[0]];
// XLSX自带了一个工具把导入的数据转成json // XLSX自带了一个工具把导入的数据转成json
const jsonArr = XLSX.utils.sheet_to_json(firstWorksheet, {header: 1}); const jsonArr = XLSX.utils.sheet_to_json(firstWorksheet, { header: 1 });
// 通过自定义的方法处理Json,得到Excel原始数据传给后端,后端统一处理 // 通过自定义的方法处理Json,得到Excel原始数据传给后端,后端统一处理
const oldDeviceList = []; const oldDeviceList = [];
for (let i = 0; i < jsonArr.length; i++) { for (let i = 0; i < jsonArr.length; i++) {
//去重 //去重
if (!oldDeviceList.includes(jsonArr[i][0]) && jsonArr[i][0] != '' && jsonArr[i][0] != null && jsonArr[i][0] != undefined) { if (
!oldDeviceList.includes(jsonArr[i][0]) &&
jsonArr[i][0] != '' &&
jsonArr[i][0] != null &&
jsonArr[i][0] != undefined
) {
oldDeviceList.push(jsonArr[i][0]); oldDeviceList.push(jsonArr[i][0]);
} }
} }
...@@ -627,16 +676,19 @@ class CommunityNotice extends React.Component { ...@@ -627,16 +676,19 @@ class CommunityNotice extends React.Component {
}, },
callback: (res) => { callback: (res) => {
if (res) { if (res) {
this.setState({ this.setState(
used: res.data.used, {
newAdd: res.data.integer, used: res.data.used,
strList: res.data.strList, newAdd: res.data.integer,
},() => { strList: res.data.strList,
this.getDevice(); },
this.info(); () => {
}); this.getDevice();
this.info();
},
);
} }
} },
}); });
}; };
if (rABS) reader.readAsBinaryString(f); if (rABS) reader.readAsBinaryString(f);
...@@ -659,10 +711,12 @@ class CommunityNotice extends React.Component { ...@@ -659,10 +711,12 @@ class CommunityNotice extends React.Component {
return ( return (
<div className={styles.body}> <div className={styles.body}>
<div className={styles.inputBox}> <div className={styles.inputBox}>
<Input className={styles.input} <Input
placeholder="User Name" className={styles.input}
value={name} placeholder="User Name"
onChange={(e) => this.nameAndModelChange(e)}/> value={name}
onChange={(e) => this.nameAndModelChange(e)}
/>
{/*<Select className={styles.input}*/} {/*<Select className={styles.input}*/}
{/* placeholder="设备状态"*/} {/* placeholder="设备状态"*/}
{/* onChange={(e) => this.statusChange(e)}*/} {/* onChange={(e) => this.statusChange(e)}*/}
...@@ -692,48 +746,54 @@ class CommunityNotice extends React.Component { ...@@ -692,48 +746,54 @@ class CommunityNotice extends React.Component {
{/* value={district}>*/} {/* value={district}>*/}
{/* {districtSelect}*/} {/* {districtSelect}*/}
{/*</Select>*/} {/*</Select>*/}
</div> </div>
<div> <div>
<Button className={styles.button1} onClick={() => this.getDevice()}>Search</Button> <Button className={styles.button1} onClick={() => this.getDevice()}>
Search
</Button>
{/*<Button className={styles.button} onClick={() => this.reset()}>重置</Button>*/} {/*<Button className={styles.button} onClick={() => this.reset()}>重置</Button>*/}
<Button className={styles.button2} onClick={() => this.edit(null)}>Create Notice</Button> <Button className={styles.button2} onClick={() => this.edit(null)}>
Create Notice
</Button>
<Upload {...uploadprops}> <Upload {...uploadprops}>
<Tooltip title=""> <Tooltip title="">
<Button className={styles.button2} <Button className={styles.button2} style={{ width: 150 }}>
style={{width: 150}}> <Icon type="upload" />
<Icon type="upload"/>Batch Upload Batch Upload
</Button> </Button>
</Tooltip> </Tooltip>
</Upload> </Upload>
</div> </div>
<div> <div>
<Table <Table
rowKey={record => record.deviceID} rowKey={(record) => record.deviceID}
className={styles.table} className={styles.table}
rowSelection={this.rowSelection} rowSelection={this.rowSelection}
columns={this.columns} columns={this.columns}
dataSource={data} dataSource={data}
size="small" size="small"
pagination={{showQuickJumper: true, pageSize: 10, total: total}} pagination={{ showQuickJumper: true, pageSize: 10, total: total }}
/> />
<Button className={styles.button3} onClick={() => this.showModal()}>Delete</Button> <Button className={styles.button3} onClick={() => this.showModal()}>
Delete
</Button>
</div> </div>
<Modal <Modal
title="确认删除?" title="确认删除?"
visible={this.state.visible} visible={this.state.visible}
onOk={this.handleOk} onOk={this.handleOk}
onCancel={this.handleCancel}> onCancel={this.handleCancel}
<div style={{textAlign: "center"}}><p style={{fontSize: 18}}>删除信息将不可恢复</p></div> >
<div style={{ textAlign: 'center' }}>
<p style={{ fontSize: 18 }}>删除信息将不可恢复</p>
</div>
</Modal> </Modal>
</div> </div>
); );
} }
} }
export default connect(({user}: ConnectState) => ({ export default connect(({ user }: ConnectState) => ({
currentUser: user.currentUser, currentUser: user.currentUser,
}))(CommunityNotice); }))(CommunityNotice);
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { Input, Tabs, Table, Form, Button, message, DatePicker } from 'antd'; import { Input, Tabs, Tag, Form, Button, message, DatePicker } from 'antd';
const { TabPane } = Tabs; const { TabPane } = Tabs;
import { connect } from 'umi'; import { connect } from 'umi';
import { objectColumns } from '@/utils/string'; import { objectColumns } from '@/utils/string';
...@@ -39,7 +39,22 @@ const VisitorRecord = (props: any) => { ...@@ -39,7 +39,22 @@ const VisitorRecord = (props: any) => {
{ title: 'Security Guard', dataIndex: 'securityGuardName' }, { title: 'Security Guard', dataIndex: 'securityGuardName' },
{ title: 'Number Plate', dataIndex: 'numberPlate' }, { title: 'Number Plate', dataIndex: 'numberPlate' },
// 隐藏的搜索框 // 隐藏的搜索框
{ title: 'Visitor Time', dataIndex: 'updateTime', valueType: 'date' }, {
title: 'Visitor Time',
dataIndex: 'updateTime',
valueType: 'date',
render: (text: any, record: any) => {
if (record.linkStatus == 1) {
return text;
} else {
return (
<>
{text} <Tag color="red">Temporary</Tag>
</>
);
}
},
},
{ title: 'Community', dataIndex: 'visitorCommunity' }, { title: 'Community', dataIndex: 'visitorCommunity' },
// { title: 'Unit', dataIndex: 'inviterAddress' }, // { title: 'Unit', dataIndex: 'inviterAddress' },
{ {
...@@ -236,14 +251,14 @@ const VisitorRecord = (props: any) => { ...@@ -236,14 +251,14 @@ const VisitorRecord = (props: any) => {
Reset Reset
</Button> </Button>
</Form.Item> </Form.Item>
<div style={{ maxWidth: '100%', marginTop: 15, width: '100%' }}> <div style={{ marginTop: 24, marginRight: -16 }}>
<Form.Item name="community" label=""> <Form.Item name="community" label="">
<SelectCommunity /> <SelectCommunity />
</Form.Item> </Form.Item>
</div> </div>
</Form> </Form>
</div> </div>
<div style={{ width: '100%', padding: 16, backgroundColor: '#ffffff' }}> <div style={{ width: '100%', padding: '0px 15px 15px 15px', backgroundColor: '#ffffff' }}>
<ProTable <ProTable
loading={loading} loading={loading}
rowKey="id" rowKey="id"
......
...@@ -2,231 +2,227 @@ ...@@ -2,231 +2,227 @@
//基石 //基石
.base { .base {
width: 100%; width: 100%;
background-color: #ffffff; background-color: #ffffff;
padding: 20px; padding: 20px;
} }
//头部组件 //头部组件
.box{ .box {
width: 100%; width: 100%;
height: 64px; height: 64px;
position: relative; position: relative;
}
.item1{
position: absolute;
width: 400px;
text-indent: 15px;
border-left: 5px solid rgba(24,144,255,1);
font-family:'Source Han Sans CN';
font-size: 18px;
font-weight: 600;
color: #000000;
}
.item3{
width:80px;
height: 32px;
position: absolute;
right: 0;
outline: none;
background:none;
cursor: pointer;
border:1px solid rgba(217,217,217,1);
border-radius:2px;
}
.box1{
width: 100%;
height: 34px;
position: relative;
margin-bottom: 28px;
line-height: 34px;
}
.box1item1{
position: absolute;
}
.box1item2{
position: absolute;
left: 164px;
} }
.box1item3{ .item1 {
position: absolute; position: absolute;
left: 373px; width: 400px;
text-indent: 15px;
border-left: 5px solid rgba(24, 144, 255, 1);
font-family: 'Source Han Sans CN';
font-size: 18px;
font-weight: 600;
color: #000000;
}
.item3 {
width: 80px;
height: 32px;
position: absolute;
right: 0;
outline: none;
background: none;
cursor: pointer;
border: 1px solid rgba(217, 217, 217, 1);
border-radius: 2px;
}
.box1 {
width: 100%;
height: 34px;
position: relative;
margin-bottom: 28px;
line-height: 34px;
}
.box1item1 {
position: absolute;
}
.box1item2 {
position: absolute;
left: 164px;
}
.box1item3 {
position: absolute;
left: 373px;
}
.box1item4 {
position: absolute;
left: 530px;
}
.box1item5 {
position: absolute;
left: 740px;
}
.box1item6 {
position: absolute;
left: 890px;
}
.box4 {
width: 100%;
height: 34px;
position: relative;
margin-bottom: 28px;
}
.box4item1 {
position: absolute;
}
.box4item2 {
position: absolute;
left: 164px;
}
.box5 {
width: 100%;
height: 34px;
position: relative;
margin-bottom: 28px;
} }
.box1item4{ .box5item1 {
position: absolute; position: absolute;
left: 530px;
} }
.box1item5{ .box5item2 {
position: absolute; position: absolute;
left: 740px; left: 164px;
} }
.box1item6{
position: absolute;
left: 890px;
}
.box4{ .box6 {
width: 100%; width: 100%;
height: 34px; height: 34px;
position: relative; position: relative;
margin-bottom: 28px; margin-bottom: 28px;
} }
.box4item1{ .box6item1 {
position: absolute; position: absolute;
} }
.box4item2{ .box6item2 {
position: absolute; position: absolute;
left: 164px; left: 164px;
} }
.box5{ .box6item3 {
width: 100%; position: absolute;
height: 34px; left: 330px;
position: relative;
margin-bottom: 28px;
} }
.box5item1{ .box6item2x1 {
position: absolute; width: 120px;
} height: 34px;
.box5item2{ background: rgba(255, 255, 255, 1);
position: absolute; border: 1px solid rgba(217, 217, 217, 1);
left: 164px; border-radius: 2px;
text-align: center;
font-family: 'Source Han Sans CN';
font-weight: 400;
color: rgba(191, 191, 191, 1);
line-height: 34px;
} }
.box6{ .box7 {
width: 100%; width: 100%;
height: 34px; height: 34px;
position: relative; position: relative;
margin-bottom: 28px; margin-bottom: 28px;
} }
.box6item1{ .box7p {
position: absolute; width: 100%;
position: relative;
margin-bottom: 28px;
} }
.box6item2{ .box7item0 {
position: absolute; padding-left: 164px;
left: 164px; width: 400px;
} }
.box7item1 {
.box6item3{ position: absolute;
position: absolute; width: 100%;
left: 330px; height: 34px;
}
.box6item2x1{
width:120px;
height:34px;
background:rgba(255,255,255,1);
border:1px solid rgba(217,217,217,1);
border-radius:2px;
text-align: center;
font-family:'Source Han Sans CN';
font-weight:400;
color:rgba(191,191,191,1);
line-height:34px;
} }
.box7item2 {
.box7{ position: absolute;
width: 100%; left: 164px;
height: 34px; }
position: relative; .box7item3 {
margin-bottom: 28px; position: absolute;
} margin-left: 330px;
.box7p{
width: 100%;
position: relative;
margin-bottom: 28px;
}
.box7item0{
padding-left: 164px;
width: 400px;
}
.box7item1{
position: absolute;
width: 100%;
height: 34px;
}
.box7item2{
position: absolute;
left: 164px;
}
.box7item3{
position: absolute;
margin-left: 330px;
} }
.box8{ .box8 {
width: 100%; width: 100%;
height:194px; height: 194px;
position: relative; position: relative;
margin-bottom: 56px; margin-bottom: 56px;
} }
.box8item1{ .box8item1 {
position: absolute; position: absolute;
} }
.box8item2{ .box8item2 {
position: absolute; position: absolute;
left: 164px; left: 164px;
} }
.box8item2x2{ .box8item2x2 {
font-size: 12px;
font-size:12px; font-family: 'Source Han Sans CN';
font-family:'Source Han Sans CN'; font-weight: 400;
font-weight:400; color: rgba(153, 153, 153, 1);
color:rgba(153,153,153,1); line-height: 30px;
line-height:30px;
} }
.contop {
.contop{ padding: 20px 20px 10px;
padding: 20px; background: #fff;
background: #fff; margin-bottom: 0;
margin-bottom: 20px;
} }
// 字符串变红 // 字符串变红
.red{ .red {
color: red; color: red;
} }
// 合同详情 // 合同详情
.contract_box{ .contract_box {
overflow: hidden; overflow: hidden;
.list_1{ .list_1 {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
justify-items: center; justify-items: center;
flex-wrap: wrap; flex-wrap: wrap;
.item_1{ .item_1 {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
justify-items: center; justify-items: center;
line-height: 34px; line-height: 34px;
margin-right: 20px; margin-right: 20px;
label{ label {
display: inline-block;
width: 150px;
line-height: 32px;
}
}
}
.ant-form-item-label > label,.label{
display: inline-block; display: inline-block;
width: 150px; width: 150px;
line-height: 32px; line-height: 32px;
}
} }
}
.ant-form-item-label > label,
.label {
display: inline-block;
width: 150px;
line-height: 32px;
}
} }
.listbox{ .listbox {
width: 100%; width: 100%;
background-color: #ffffff; background-color: #ffffff;
padding: 10px; padding: 10px;
} }
.pages{ .pages {
text-align: right; text-align: right;
padding: 10px ; padding: 10px;
} }
\ No newline at end of file
/* /*
* @Author: your name * @Author: your name
* @Date: 2020-11-19 16:54:53 * @Date: 2020-11-19 16:54:53
* @LastEditTime: 2020-12-02 16:32:42 * @LastEditTime: 2020-12-04 11:41:39
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\tip.ts * @FilePath: \tostumi\src\utils\tip.ts
*/ */
// 只能输入字母数字限制
const inputNumberStr = (rule: any, value: any, callback: any) => {
if (value) {
if (/^[a-zA-Z0-9]+$/g.test(value)) {
callback();
} else {
callback(new Error('Only numbers and letters can be entered!'));
}
}
callback();
};
// 只能输入数字限制
const inputNumber = (rule: any, value: any, callback: any) => {
if (value) {
if (/^[0-9]+$/g.test(value)) {
callback();
} else {
callback(new Error('Only numbers!'));
}
}
callback();
};
const reqMes = (msg: string) => {
return {
required: true,
message: msg,
};
};
// 合同提示 // 合同提示
export const tipList = [ export const tipList = [
['Please Input Contract Numbe!'], [reqMes('Please Input Contract Numbe!')],
['Please Input Contract Party A!'], [reqMes('Please Input Contract Party A!')],
['Please Input Contract Party B!'], [reqMes('Please Input Contract Party B!')],
['Please Choice CommunityName!'], [reqMes('Please Choice CommunityName!')],
['Please Choice Contract Title!'], [reqMes('Please Choice Contract Title!')],
['Please Choice Contract Time!'], [reqMes('Please Choice Contract Time!')],
['Please upload Contract Annex!'], [reqMes('Please upload Contract Annex!')],
// ['Please Input Contract Remarks!'], // [reqMes('Please Input Contract Remarks!')],
]; ];
// 小区提示 // 小区提示
export const village = [ export const village = [
[{ required: true, message: 'Please enter the postcode' }], [reqMes('Please enter the postcode !')],
[{ required: true, message: 'Please enter the address of the community !' }], [reqMes('Please enter the address of the community !')],
[{ required: true, message: 'Please enter the cell name !' }], [reqMes('Please enter the cell name !')],
[{ required: true, message: 'Please select the time !' }], [reqMes('Please select the time !')],
[{ required: true, message: 'Please enter your mobile phone number !' }], [reqMes('Please enter your mobile phone number !')],
[ [{ ...reqMes('Please enter the correct email address !'), type: 'email' }],
{ [reqMes('Please enter the name of the community administrator !')],
required: true,
type: 'email',
message: 'Please enter the correct email address !',
},
],
[{ required: true, message: 'Please enter the name of the community administrator !' }],
]; ];
//公告提示 //公告提示
export const Notice = [ export const Notice = [
[{ required: true, message: 'Please select community' }], [reqMes('Please select community')],
[{ required: true, message: 'Please input the notice title.' }], [reqMes('Please input the notice title.')],
[{ required: true, message: 'Please input the announcement content.' }], [reqMes('Please input the announcement content.')],
[{ required: true, message: 'Please choose the effective time of the announcement.' }], [reqMes('Please choose the effective time of the announcement.')],
]; ];
// 新增设施 // 新增设施
export const NewFaci = [ export const NewFaci = [
[{ required: true, message: 'Please select community' }], [reqMes('Please select community')],
[{ required: true, message: 'Please input Facility Name' }], [reqMes('Please input Facility Name')],
[{ required: false, message: 'Please Set management fee' }], [reqMes('Please Set management fee')],
[{ required: false, message: 'Please Set Setting deposit' }], [reqMes('Please Set Setting deposit')],
[{ required: true, message: 'Please Upload facility photos' }], [reqMes('Please Upload facility photos')],
[{ required: true, message: 'Required' }], [reqMes('Required')],
[{ required: true, message: 'Required' }], [reqMes('Required')],
[{ required: true, message: 'Required' }], [reqMes('Required')],
[{ required: true, message: 'Required' }], [reqMes('Required')],
[{ required: true, message: 'Required' }], [reqMes('Required')],
]; ];
// 设施预订 // 设施预订
export const BookingsTip = [ export const BookingsTip = [
[{ required: true, message: 'Please input Name ' }], [reqMes('Please input Name ')],
[{ required: true, message: 'Please input Contact Details' }], [reqMes('Please input Contact Details')],
[{ required: true, pattern: new RegExp(/^[1-9]\d*$/, 'g'), message: 'Only numbers!' }], // [{ required: true, pattern: new RegExp(/^[1-9]\d*$/, 'g'), message: 'Only numbers!')],
[{ required: true, pattern: new RegExp(/^[1-9]\d*$/, 'g'), message: 'Only numbers!' }], [{ ...reqMes(''), validator: inputNumber }],
[{ required: true, message: 'Required' }], [{ ...reqMes(''), validator: inputNumber }],
[{ required: true, message: 'Please Select The Date' }], [{ ...reqMes(''), validator: inputNumberStr }],
[reqMes('Please Select The Date')],
]; ];
// 账号新增编辑 // 账号新增编辑
export const AccountTip = [ export const AccountTip = [
[{ required: true, type: 'email', message: 'Please enter email address !' }], [{ ...reqMes('Please enter email address !'), type: 'email' }],
[{ required: true, message: 'Required' }], [reqMes('Required')],
[{ required: true, message: 'Please enter the correct contact information !' }], [reqMes('Please enter the correct contact information !')],
[{ required: true, message: 'Required' }],
[{ required: true, message: 'Required' }],
[{ required: true, message: 'Required' }],
[{ required: true, message: 'Required' }],
]; ];
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