Commit b9d2af18 authored by cellee's avatar cellee

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

parents b8ae18d8 2db5bd87
......@@ -12,6 +12,9 @@ const SearchOptionsTow = (porps: any) => {
));
function onChange(value: any) {
// console.log(`selected ${value}`);
if (!value) {
value = '';
}
extendName(value);
}
return (
......
......@@ -5,7 +5,7 @@ import styles from './index.less';
class TagSelect extends React.Component {
state = {
value: this.props.value!=null?this.props.value:[],
value: this.props.value != null ? this.props.value : [],
inputVisible: false,
inputValue: '',
editInputIndex: -1,
......@@ -19,19 +19,18 @@ class TagSelect extends React.Component {
// console.log("--组件加载完成--")
// console.log(this.state.value)
// }
handleClose = removedTag => {
const value = this.state.value.filter(tag => tag !== removedTag);
handleClose = (removedTag) => {
const value = this.state.value.filter((tag) => tag !== removedTag);
console.log(value);
this.setState({ value });
this.props.onChange(value)
this.props.onChange(value);
};
showInput = () => {
this.setState({ inputVisible: true }, () => this.input.focus());
};
handleInputChange = e => {
handleInputChange = (e) => {
this.setState({ inputValue: e.target.value });
};
......@@ -44,7 +43,7 @@ class TagSelect extends React.Component {
value = [...value, inputValue];
}
console.log(value);
this.props.onChange(value)
this.props.onChange(value);
this.setState({
value,
inputVisible: false,
......@@ -52,7 +51,7 @@ class TagSelect extends React.Component {
});
};
handleEditInputChange = e => {
handleEditInputChange = (e) => {
this.setState({ editInputValue: e.target.value });
};
......@@ -60,7 +59,7 @@ class TagSelect extends React.Component {
this.setState(({ value, editInputIndex, editInputValue }) => {
const newTags = [...value];
newTags[editInputIndex] = editInputValue;
this.props.onChange(newTags)
this.props.onChange(newTags);
return {
value: newTags,
editInputIndex: -1,
......@@ -69,20 +68,26 @@ class TagSelect extends React.Component {
});
};
saveInputRef = input => {
saveInputRef = (input) => {
this.input = input;
};
saveEditInputRef = input => {
saveEditInputRef = (input) => {
this.editInput = input;
};
render() {
const { value, inputVisible, inputValue, editInputIndex, editInputValue } = this.state;
console.log(value);
return (
<>
{
value.map((tag, index) => {
<Tag className="editTag" key="Accountant">
Accountant
</Tag>
{value.map((tag, index) => {
if (editInputIndex === index) {
return (
<Input
......@@ -108,13 +113,11 @@ class TagSelect extends React.Component {
onClose={() => this.handleClose(tag)}
>
<span
onDoubleClick={e => {
onDoubleClick={(e) => {
this.setState({ editInputIndex: index, editInputValue: tag }, () => {
this.editInput.focus();
});
e.preventDefault();
}}
>
{isLongTag ? `${tag.slice(0, 20)}...` : tag}
......@@ -128,8 +131,7 @@ class TagSelect extends React.Component {
) : (
tagElem
);
})
}
})}
{inputVisible && (
<Input
......
......@@ -62,7 +62,7 @@ export default {
} else {
let CurData = true;
yield put({ type: 'returnCurData' }, CurData);
message.success('operator success!', 1.5, () => {
message.success('Operator Success!', 1.5, () => {
window.location.href = '/UserManagement/ServiceProviderManagement';
});
}
......
import React, { useState, useEffect, useRef } from 'react';
import { Input, Tabs, Table, Space, Button, Form, Row, Col, Layout, message, Spin } from 'antd';
const { TabPane } = Tabs;
import React, { useState, useEffect } from 'react';
import { Input, Button, Form, message, Spin } from 'antd';
import { connect, history } from 'umi';
......@@ -10,7 +9,6 @@ import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommn
import Line from '@/components/Line/Line';
import TextArea from 'antd/lib/input/TextArea';
import Relationship from '@/components/Relationship/Relationship';
import { useForm } from 'antd/es/form/util';
import { validateMessages } from '@/utils/params';
import styles from './css/index.less';
......@@ -69,23 +67,59 @@ const CardAdd = (props: any) => {
form.resetFields();
}, []);
const checkData = (rule: any, value: any, callback: any) => {
// const checkData: (rule: any, value: string, callback: any) => void = (
// rule: any,
// value: any,
// callback: any,
// ) => {
// if (value) {
// if (/^\d$/) {
// } else {
// }
// }
// callback()
// };
const checkData2: (rule: any, value: string, cb: any) => void = (rule, value, cb) => {
if (value) {
if (/^[a-zA-Z0-9]+$/g.test(value)) {
callback();
cb();
} else {
callback(new Error('Only numbers and letters can be entered!'));
cb(new Error('Only numbers and letters can be entered!'));
}
}
callback();
cb();
};
const checkName = (rule: any, value: any, callback: any) => {
if (!value || !value.trim()) {
callback(new Error('*it is required!'));
// const checkName: (rule: any, value: string, callback: any) => void = (
// rule: any,
// value: any,
// callback: any,
// ) => {
// if (value) {
// if () {
// } else {
// callback(new Error(''));
// }
// }
// callback();
// };
// 手机号码验证
const phoneNumber: (rule: any, value: string, cb: any) => void = (rule, value, cb) => {
if (value) {
if (/^\d{8}$|^1[3|5|7|8|9]\d{9}$/.test(value)) {
cb();
} else {
cb(new Error('The format is incorrect!'));
}
}
callback();
cb();
};
return (
<div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}>
<TitleBack title={'Apply Card Add'}></TitleBack>
......@@ -101,7 +135,7 @@ const CardAdd = (props: any) => {
name="buildNumber"
style={{ marginRight: 16 }}
className={styles.buildNumber}
rules={[{ required: true, validator: checkData }]}
rules={[{ required: true, type: 'number', message: 'Only number can be entered' }]}
>
<Input style={{ width: 80 }} placeholder={'BLK'} />
</Form.Item>
......@@ -110,7 +144,7 @@ const CardAdd = (props: any) => {
name="floorNumber"
style={{ marginRight: 16 }}
className={styles.floorNumber}
rules={[{ required: true, validator: checkData }]}
rules={[{ required: true, type: 'number', message: 'Only number can be entered' }]}
>
<Input style={{ width: 80 }} placeholder={'Floor'} />
</Form.Item>
......@@ -118,18 +152,14 @@ const CardAdd = (props: any) => {
<Form.Item
name="roomNumber"
className={styles.roomNumber}
rules={[{ required: true, validator: checkData }]}
rules={[{ required: true, validator: checkData2 }]}
>
<Input style={{ width: 120 }} placeholder={'Room'} />
</Form.Item>
</Input.Group>
</Form.Item>
<Form.Item
name="zipCode"
wrapperCol={{ ...Layout.wrapperCol, offset: 3 }}
rules={[{ required: true }]}
>
<Form.Item name="zipCode" wrapperCol={{ offset: 3 }} rules={[{ required: true }]}>
<Input
style={{ width: 580 }}
placeholder={'Display the address and postcode automatically according to the'}
......@@ -142,14 +172,18 @@ const CardAdd = (props: any) => {
<Form.Item
name="communityOwner"
style={{ marginRight: 20 }}
rules={[{ required: true, validator: checkName }]}
rules={[{ required: true, max: 8, min: 2 }]}
>
<Input placeholder={'Name'} />
</Form.Item>
<Form.Item style={{ marginRight: 20 }} label={'Contact Information'}>
<Input hidden={true} />
</Form.Item>
<Form.Item name="communityOwnerPhone" style={{ marginRight: 20 }}>
<Form.Item
name="communityOwnerPhone"
style={{ marginRight: 20 }}
rules={[{ validator: phoneNumber }]}
>
<Input placeholder={'Phone number'} />
</Form.Item>
<Form.Item name="communityOwnerEmail" rules={[{ required: true, type: 'email' }]}>
......@@ -165,14 +199,18 @@ const CardAdd = (props: any) => {
<Form.Item
name="applyName"
style={{ marginRight: 20 }}
rules={[{ required: true, validator: checkName }]}
rules={[{ required: true, max: 8, min: 2 }]}
>
<Input placeholder={'Name'} />
</Form.Item>
<Form.Item style={{ marginRight: 20 }} label={'Contact Information'}>
<Input hidden={true} />
</Form.Item>
<Form.Item name="applyNamePhone" style={{ marginRight: 20 }}>
<Form.Item
name="applyNamePhone"
style={{ marginRight: 20 }}
rules={[{ validator: phoneNumber }]}
>
<Input placeholder={'Phone number'} />
</Form.Item>
<Form.Item name="applyNameEmail" rules={[{ required: true, type: 'email' }]}>
......@@ -194,7 +232,7 @@ const CardAdd = (props: any) => {
<TextArea style={{ width: 400 }}></TextArea>
</Form.Item>
<Line></Line>
<Form.Item wrapperCol={{ ...Layout.wrapperCol, offset: 3 }}>
<Form.Item wrapperCol={{ offset: 3 }}>
<Button type="primary" htmlType="submit">
Submit
</Button>
......
......@@ -80,7 +80,7 @@ const CardDetail = (props: any) => {
<Row gutter={8} style={{ marginTop: 16 }}>
<Col>Address:</Col>
<Col>
{DataSave.zip_address} {DataSave.zip_code}
{DataSave.zip_address},{DataSave.zip_code}
</Col>
</Row>
......
......@@ -20,7 +20,6 @@ const ChargeDetail = (props: any) => {
useEffect(() => {
console.log(CurData);
console.log(stringSplit(CurData.billFileUrl, 'm/cash'));
if (!CurData) {
history.back();
}
......
......@@ -11,11 +11,27 @@ import { filterObj, urlEncode, filterObjbyTg } from '@/utils/method';
import TitleSearch from '../../components/TitleSearch/TitleSearch';
import ProTable, { ProColumns, TableDropdown, ActionType } from '@ant-design/pro-table';
import ProTable, { ProColumns } from '@ant-design/pro-table';
interface readyData {
[key: string]: any;
}
interface GithubIssueItem {
url: string;
id: number;
number: number;
title: string;
labels: {
name: string;
color: string;
}[];
state: string;
comments: number;
created_at: string;
updated_at: string;
closed_at?: string;
}
let readyData = {
tosOwnerName: '',
communityName: '',
......@@ -24,16 +40,9 @@ let readyData = {
const ChargeManager = (props: any) => {
const { dispatch, location, Data } = props;
const { formatMessage } = useIntl();
const username = formatMessage({ id: 'R.charge.username' });
const project = formatMessage({ id: 'R.charge.project' });
const unit = formatMessage({ id: 'R.charge.unit' });
const submissionTime = formatMessage({ id: 'R.charge.submissionTime' });
const actions = formatMessage({ id: 'R.charge.actions' });
const [loading, setLoading] = useState(false);
// 详情页
const goToDetail = (values: any) => {
const permissionArr = JSON.parse(localStorage.getItem('permission') || '');
if (permissionArr.indexOf('10') < 0) {
......@@ -44,22 +53,24 @@ const ChargeManager = (props: any) => {
history.push('/PropertyManagementDetail');
};
// 存储详情页数据
const getById = (values: any) => {
dispatch({ type: 'PropertyManagement/getById', playload: values });
};
// 获取数据
const get = (values: any) => {
dispatch({ type: 'PropertyManagement/get', playload: values });
};
// 进入页面先请求一次
useEffect(() => {
setLoading(true);
get({
communityName: '',
tosOwnerName: '',
pageNum: 1,
});
}, [1]);
readyData = {
...readyData,
...location.query,
};
get(readyData);
}, [location]);
// 监听数据返回
useEffect(() => {
......@@ -71,29 +82,19 @@ const ChargeManager = (props: any) => {
// 搜索按钮
const TitleSearchContent = (comment: any) => {
setLoading(true);
get({
communityName: comment.communityName,
tosOwnerName: comment.tosOwnerName,
console.log(comment);
history.push(
location.pathname +
urlEncode(
filterObj({
...comment,
pageNum: 1,
});
}),
),
);
};
interface GithubIssueItem {
url: string;
id: number;
number: number;
title: string;
labels: {
name: string;
color: string;
}[];
state: string;
comments: number;
created_at: string;
updated_at: string;
closed_at?: string;
}
// 列表数据
const columns: ProColumns<GithubIssueItem>[] = [
{
title: 'User Name',
......@@ -132,18 +133,21 @@ const ChargeManager = (props: any) => {
pageNum: 1,
tosOwnerName: '',
};
get({
...readyData,
});
history.push(location.pathname + urlEncode(filterObj(readyData)));
};
// 切换页码
const changePage = (value: any) => {
readyData.pageNum = value.current;
setLoading(true);
get({
history.push(
location.pathname +
urlEncode(
filterObj({
...readyData,
});
pageNum: value.current,
}),
),
);
};
return (
......@@ -153,21 +157,22 @@ const ChargeManager = (props: any) => {
list={['TosOwnerName']}
communitySelect={true}
onSubmit={TitleSearchContent}
// defaultValue={{ ...readyData }}
defaultValue={readyData}
/>
{Data !== null ? (
<ProTable<GithubIssueItem>
columns={columns}
dataSource={Data !== null ? Data.list : []}
dataSource={Data.list}
rowKey={'id'}
search={false}
loading={loading}
onChange={changePage}
pagination={{
pageSize: Data !== null ? Data.page.curPageSize : 0,
pageSize: Data.page.curPageSize,
showSizeChanger: false,
total: Data !== null ? Data.page.totalRow : '',
current: Data !== null ? Data.page.currentPage : 1,
total: Data.page.totalRow,
current: +readyData.pageNum,
}}
options={{
density: true,
......@@ -178,6 +183,9 @@ const ChargeManager = (props: any) => {
setting: false,
}}
/>
) : (
<></>
)}
</div>
);
};
......
......@@ -155,7 +155,7 @@ const UsersDetail = (props: any) => {
};
const deleteUnit = (values: any) => {
const permissionArr = JSON.parse(localStorage.getItem('permission'));
const permissionArr = JSON.parse(localStorage.getItem('permission') || '[]');
if (permissionArr.indexOf('5') < 0) {
message.error('No Permissions!!!', 3);
return;
......@@ -205,10 +205,10 @@ const UsersDetail = (props: any) => {
const checkData = (rule: any, value: any, callback: any) => {
if (value) {
if (/^\d{8}|1[3|5|7|8]\d{9}$/g.test(value)) {
if (/^\d{8}$|^1[3|5|7|8]\d{9}$/.test(value)) {
callback();
} else {
callback(new Error('Incorrect format of mobile phone number!'));
callback(new Error('The format is incorrect!'));
}
}
callback('*it is required!');
......
import React, { useEffect } from 'react';
import React, { useEffect, useState } from 'react';
import styles from './AccoutingContent.less';
import { Button, Modal, message } from 'antd';
import { Button, Modal, message, Spin } from 'antd';
import { connect } from 'umi';
......@@ -17,6 +17,8 @@ const AccoutingContent = (props: {
}) => {
const { SaveChooseData, dispatch, Result, history } = props;
const [loading, setLoading] = useState(false);
const goToReturn = () => {
history.goBack();
};
......@@ -39,6 +41,7 @@ const AccoutingContent = (props: {
icon: <ExclamationCircleOutlined />,
content: 'Are you sure want to write off?',
onOk() {
setLoading(true);
dispatch({ type: 'ServiceProvider/DelServiceProvider', playload: { id } });
},
onCancel() {
......@@ -50,6 +53,7 @@ const AccoutingContent = (props: {
useEffect(() => {
console.log(Result);
if (Result !== null) {
setLoading(false);
if (Result) {
dispatch({ type: 'ServiceProvider/ResultClear' });
message.success('Logout successful!', 3, () => {
......@@ -62,8 +66,25 @@ const AccoutingContent = (props: {
}
}, [Result]);
const copy = () => {
const copyEle = document.querySelector('#copy'); // 获取要复制的节点
const range = document.createRange(); // 创造range
window.getSelection()?.removeAllRanges(); //清除页面中已有的selection
range.selectNode(copyEle as any); // 选中需要复制的节点
window.getSelection()?.addRange(range); // 执行选中元素
const copyStatus = document.execCommand('Copy'); // 执行copy操作
// 对成功与否定进行提示
if (copyStatus) {
message.success('Copy Success');
} else {
message.error('Copy Failure,Please copy manually');
}
window.getSelection()?.removeAllRanges(); //清除页面中已有的selection
};
return (
<div className={styles.base}>
<Spin spinning={loading}>
{/* 头部组件 */}
<div className={styles.box}>
<div className={styles.item1}>Accounting information</div>
......@@ -113,8 +134,14 @@ const AccoutingContent = (props: {
</div>
<div className={styles.box4}>
<div className={styles.box3item1}>Upload the address</div>
<div className={styles.box3item2}>http://bill.huahuico.com/</div>
<div className={styles.box3item2} id="copy">
http://bill.huahuico.com/
</div>
<Button size="small" className={styles.box3item3} onClick={copy.bind(this)}>
复制
</Button>
</div>
</Spin>
</div>
);
};
......
import React, { useState, useEffect } from 'react';
import styles from './Detail.less';
import { Button, Table, Space, message, Modal } from 'antd';
import { Button, Table, Space, message, Modal, Spin } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
......@@ -13,6 +13,8 @@ const { confirm } = Modal;
const Detail = (props: any) => {
const { dispatch, Data, CurDataFollow, location, SaveChooseData, Result } = props;
const [loading, setLoding] = useState(false);
const TosSecurityGuarderGet = (values: any) => {
dispatch({ type: 'ServiceProvider/TosSecurityGuarderGet', playload: values });
};
......@@ -66,6 +68,7 @@ const Detail = (props: any) => {
icon: <ExclamationCircleOutlined />,
content: 'Are you sure want to write off?',
onOk() {
setLoding(true);
dispatch({ type: 'ServiceProvider/DelServiceProvider', playload: { id } });
},
onCancel() {
......@@ -77,9 +80,10 @@ const Detail = (props: any) => {
useEffect(() => {
console.log(Result);
if (Result !== null) {
setLoding(false);
if (Result) {
dispatch({ type: 'ServiceProvider/ResultClear' });
message.success('Logout successful!', 3, () => {
message.success('Logout successful!', 2, () => {
history.goBack();
});
} else {
......@@ -91,6 +95,7 @@ const Detail = (props: any) => {
return (
<div className={styles.base}>
<Spin spinning={loading}>
{SaveChooseData !== null ? (
<>
<TitleBack title="Service Provider Details" />
......@@ -131,7 +136,8 @@ const Detail = (props: any) => {
<div className={styles.box4}>
<div className={styles.box4item1}>Contact Details</div>
<div className={styles.box4item2}>
{SaveChooseData.contactPhone} &nbsp;&nbsp;&nbsp;&nbsp; {SaveChooseData.contactEmail}
{SaveChooseData.contactPhone} &nbsp;&nbsp;&nbsp;&nbsp;{' '}
{SaveChooseData.contactEmail}
</div>
</div>
......@@ -165,6 +171,7 @@ const Detail = (props: any) => {
/>
</>
) : null}
</Spin>
</div>
);
};
......
......@@ -16,8 +16,8 @@ const Services = (props: any) => {
const formRef = useRef(null as any);
useEffect(() => {
RA(43, { serviceName: '' }, module, dispatch);
}, [location]);
RA(43, {}, module, dispatch);
}, []);
useEffect(() => {
if (DataServices != null) {
......@@ -26,10 +26,14 @@ const Services = (props: any) => {
return v['serviceName'];
});
console.log(tmp);
tmp = tmp.filter((v: string) => {
return v !== 'Accountant';
});
formRef.current['setFieldsValue']({ serviceName: tmp });
}
}, [DataServices]);
// 提交服务范围
const onFinish = (values: any) => {
console.log(values);
// RA(
......@@ -42,10 +46,15 @@ const Services = (props: any) => {
// dispatch,
// );
};
// 添加服务范围
const Add = (values: any) => {
console.log(values);
};
// 删除服务范围
const Remove = (values: any) => {};
return (
<div className={styles.base}>
<TitleBack title={'Services Available Management'}></TitleBack>
......@@ -57,7 +66,11 @@ const Services = (props: any) => {
</Form.Item>
) : null}
<Line />
{/* <Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item> */}
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Form>
</div>
);
......
......@@ -106,21 +106,8 @@ export const requestList = [
permissionArray: ['2', '1', '3', '4'],
},
],
[
'/tos/tosServiceScope/get',
'43 获取服务范围',
{
serviceName: '',
},
],
[
'/tos/tosServiceScope/save',
'44 添加服务范围',
{
id: '5',
serviceName: '律政',
},
],
['/tos/tosServiceScope/get', '43 获取服务范围'],
['/tos/tosServiceScope/save', '44 添加服务范围'],
[
'/tos/user/getAllInfrom',
'45 获取后台列表',
......
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