Commit 841925d4 authored by cellee's avatar cellee

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

parents 16513394 7c658770
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
// message.error("Service scope selection error!!!") // message.error("Service scope selection error!!!")
Modal.error({ Modal.error({
title: 'Service selection error', title: 'Service selection error',
content: 'No multiple selection are allowed once Accounting or Security server is being selected!', content: 'No multiple selection are allowed once Accounting or Security Service is being selected!',
}); });
return; return;
} }
...@@ -91,9 +91,9 @@ export default { ...@@ -91,9 +91,9 @@ export default {
// 创建成功 // 创建成功
if (resp.error_code === "0000") { if (resp.error_code === "0000") {
message.success('Operator Success!', 1.5, () => { // message.success('Operator Success!', 1.5, () => {
window.location.href = '/UserManagement/ServiceProviderManagement'; // });
}); window.location.href = '/UserManagement/ServiceProviderManagement';
let CurData: Boolean = true; let CurData: Boolean = true;
yield put({ type: 'returnCurData', CurData }); yield put({ type: 'returnCurData', CurData });
return; return;
......
...@@ -81,7 +81,6 @@ const Model: LoginModelType = { ...@@ -81,7 +81,6 @@ const Model: LoginModelType = {
effects: { effects: {
*login({ payload }, { call, put }) { *login({ payload }, { call, put }) {
console.log(payload);
const response = yield call(AccountLogin, payload.values); const response = yield call(AccountLogin, payload.values);
if (response.status === 'resetPwd') { if (response.status === 'resetPwd') {
// console.log('跳转到修改密码页面'); // console.log('跳转到修改密码页面');
...@@ -153,8 +152,7 @@ const Model: LoginModelType = { ...@@ -153,8 +152,7 @@ const Model: LoginModelType = {
// 只跳到首页 // 只跳到首页
history.replace('/'); history.replace('/');
} else { } else {
// message.error('Login Error! Username or Password is wrong!', 3); message.error("Wrong account or password!");
yield put({ yield put({
type: "setResultLogin", type: "setResultLogin",
resultLogin: true, resultLogin: true,
......
...@@ -108,7 +108,11 @@ const CardAdd = (props: any) => { ...@@ -108,7 +108,11 @@ const CardAdd = (props: any) => {
style={{ marginRight: 16 }} style={{ marginRight: 16 }}
className={styles.buildNumber} className={styles.buildNumber}
rules={[ rules={[
{ required: true, pattern: /^\d+$/, message: 'Only number can be entered' }, {
required: true,
pattern: /^\d+$/,
message: 'Only numbers and letters can be entered',
},
]} ]}
> >
<Input style={{ width: 80 }} placeholder={'BLK'} /> <Input style={{ width: 80 }} placeholder={'BLK'} />
...@@ -119,7 +123,11 @@ const CardAdd = (props: any) => { ...@@ -119,7 +123,11 @@ const CardAdd = (props: any) => {
style={{ marginRight: 16 }} style={{ marginRight: 16 }}
className={styles.floorNumber} className={styles.floorNumber}
rules={[ rules={[
{ required: true, pattern: /^\d+$/, message: 'Only number can be entered' }, {
required: true,
pattern: /^\d+$/,
message: 'Only numbers and letters can be entered',
},
]} ]}
> >
<Input style={{ width: 80 }} placeholder={'Floor'} /> <Input style={{ width: 80 }} placeholder={'Floor'} />
...@@ -128,7 +136,13 @@ const CardAdd = (props: any) => { ...@@ -128,7 +136,13 @@ const CardAdd = (props: any) => {
<Form.Item <Form.Item
name="roomNumber" name="roomNumber"
className={styles.roomNumber} className={styles.roomNumber}
rules={[{ required: true, validator: checkData2 }]} rules={[
{
required: true,
pattern: /^\d+$/,
message: 'Only numbers and letters can be entered',
},
]}
> >
<Input style={{ width: 120 }} placeholder={'Room'} /> <Input style={{ width: 120 }} placeholder={'Room'} />
</Form.Item> </Form.Item>
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
position: absolute; position: absolute;
top: 34px; top: 34px;
left: 33px; left: 33px;
width: 180px; width: 260px;
z-index: 10; z-index: 10;
background-color: #fff; background-color: #fff;
min-height: 20px; min-height: 20px;
...@@ -71,21 +71,21 @@ ...@@ -71,21 +71,21 @@
position: absolute; position: absolute;
top: 34px; top: 34px;
left: -87px; left: -87px;
width: 180px; width: 260px;
z-index: 20; z-index: 20;
background-color: #fff; background-color: #fff;
min-height: 20px; min-height: 20px;
} }
} }
// .roomNumber { .roomNumber {
// :global(.ant-form-item-explain) { :global(.ant-form-item-explain) {
// position: absolute; position: absolute;
// top: 34px; top: 34px;
// left: -205px; left: -205px;
// width: 260px; width: 260px;
// z-index: 30; z-index: 30;
// background-color: #fff; background-color: #fff;
// min-height: 20px; min-height: 20px;
// } }
// } }
...@@ -101,34 +101,32 @@ const Users = (props: any) => { ...@@ -101,34 +101,32 @@ const Users = (props: any) => {
message.error('No permissions'); message.error('No permissions');
return false; return false;
} }
if ( if (file.name.indexOf('.xlsx') === -1 && file.name.indexOf('.xls') === -1) {
file.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' &&
file.type !== 'application/vnd.ms-excel'
) {
message.error(`${file.name} file format is incorrect!`); message.error(`${file.name} file format is incorrect!`);
return false;
} else {
return true;
} }
return (
file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ||
file.type === 'application/vnd.ms-excel'
);
}, },
onChange(info: any) { onChange(info: any) {
if (info.file.status == 'uploading') { if (info.file.status == 'uploading') {
setFileUploading(true); setFileUploading(true);
} }
console.log(info);
if (info.file.status === 'done') { if (info.file.status === 'done') {
if (info.file.response.error_code == '0000') { if (info.file.response.error_code == '0000') {
history.push(location.pathname + '/Result'); history.push(location.pathname + '/Result');
} else if (info.file.response.error_code == '0002') { } else if (info.file.response.error_code == '0002') {
message.error(info.file.response.error_msg); message.error(info.file.response.error_msg);
} else { } else if (info.file.response.error_code == '0001') {
history.push(location.pathname + '/ResultFailed'); history.push(location.pathname + '/ResultFailed');
message.error( message.error(
`${info.file.name} file upload failed.` + `${info.file.name} file upload failed.` +
'failed count is ' + 'failed count is ' +
info.file.response.data.count, info.file.response.data.count,
); );
} else {
message.error('File upload failed');
setFileUploading(false);
} }
setFileUploading(false); setFileUploading(false);
} else if (info.file.status === 'error') { } else if (info.file.status === 'error') {
......
...@@ -142,3 +142,38 @@ ...@@ -142,3 +142,38 @@
.ant-form-item-explain { .ant-form-item-explain {
margin-top: 5px; margin-top: 5px;
} }
.buildNumber {
:global(.ant-form-item-explain) {
position: absolute;
top: 34px;
left: 33px;
width: 260px;
z-index: 10;
background-color: #fff;
min-height: 20px;
}
}
.floorNumber {
:global(.ant-form-item-explain) {
position: absolute;
top: 34px;
left: -87px;
width: 260px;
z-index: 20;
background-color: #fff;
min-height: 20px;
}
}
.roomNumber {
:global(.ant-form-item-explain) {
position: absolute;
top: 34px;
left: -205px;
width: 260px;
z-index: 30;
background-color: #fff;
min-height: 20px;
}
}
...@@ -39,6 +39,7 @@ const UsersAdd = (props: any) => { ...@@ -39,6 +39,7 @@ const UsersAdd = (props: any) => {
values.owerPhone = null; values.owerPhone = null;
values.owerEmail = null; values.owerEmail = null;
values.buildingNumber = 'BLK ' + values.buildingNumber; values.buildingNumber = 'BLK ' + values.buildingNumber;
console.log(values);
RA(14, values, module, dispatch); RA(14, values, module, dispatch);
setLoading(true); setLoading(true);
} else { } else {
...@@ -67,23 +68,12 @@ const UsersAdd = (props: any) => { ...@@ -67,23 +68,12 @@ const UsersAdd = (props: any) => {
} }
}, [communityInfo]); }, [communityInfo]);
const checkData = (rule: any, value: any, callback: any) => { const checkData = (rule: any, value: string, callback: (arg0?: string) => void) => {
if (value) { if (value) {
if (/^[a-zA-Z0-9]+$/g.test(value)) { if (/^[a-zA-Z0-9]+$/g.test(value)) {
callback(); callback();
} else { } else {
callback(new Error('Only numbers and letters can be entered!')); callback('Only numbers and letters can be entered!');
}
}
callback();
};
const checkData1 = (rule: any, value: any, callback: any) => {
if (value) {
if (/^[0-9]+$/g.test(value)) {
callback();
} else {
callback(new Error('Only numbers!'));
} }
} }
callback(); callback();
...@@ -104,12 +94,6 @@ const UsersAdd = (props: any) => { ...@@ -104,12 +94,6 @@ const UsersAdd = (props: any) => {
</div> </div>
</div> </div>
{/* <div className={styles.box4}>
<div className={styles.box4item0}>Contact Details</div>
<div className={styles.box4item1}><Form.Item name="owerPhone" ><Input placeholder="Phone Number" /></Form.Item></div>
<div className={styles.box4item2}><Form.Item name="owerEmail" ><Input placeholder="Email" /></Form.Item></div>
</div> */}
<div className={styles.box2}> <div className={styles.box2}>
<div className={styles.box2item1}>Contact Details</div> <div className={styles.box2item1}>Contact Details</div>
<div className={styles.box2item2}> <div className={styles.box2item2}>
...@@ -119,13 +103,21 @@ const UsersAdd = (props: any) => { ...@@ -119,13 +103,21 @@ const UsersAdd = (props: any) => {
<Form.Item> <Form.Item>
<Input.Group> <Input.Group>
<div className={styles.box2item3}> <div className={styles.box2item3}>
<Form.Item name="buildingNumber" rules={[{ validator: checkData1 }]}> <Form.Item
name="buildingNumber"
className={styles.buildNumber}
rules={[{ validator: checkData }]}
>
<Input placeholder="BLK" style={{ width: 94 }} /> <Input placeholder="BLK" style={{ width: 94 }} />
</Form.Item> </Form.Item>
</div> </div>
<div className={styles.box2item4}>#</div> <div className={styles.box2item4}>#</div>
<div className={styles.box2item5}> <div className={styles.box2item5}>
<Form.Item name="floorNumber" rules={[{ validator: checkData1 }]}> <Form.Item
name="floorNumber"
className={styles.floorNumber}
rules={[{ validator: checkData }]}
>
<Input placeholder="Floor" style={{ width: 80 }} /> <Input placeholder="Floor" style={{ width: 80 }} />
</Form.Item> </Form.Item>
</div> </div>
...@@ -134,6 +126,7 @@ const UsersAdd = (props: any) => { ...@@ -134,6 +126,7 @@ const UsersAdd = (props: any) => {
<Form.Item <Form.Item
name="roomNumber" name="roomNumber"
rules={[{ validator: checkData }]} rules={[{ validator: checkData }]}
className={styles.roomNumber}
style={{ width: 260 }} style={{ width: 260 }}
> >
<Input placeholder="Room" style={{ width: 112 }} /> <Input placeholder="Room" style={{ width: 112 }} />
......
...@@ -38,7 +38,6 @@ const Edit = (props: any) => { ...@@ -38,7 +38,6 @@ const Edit = (props: any) => {
// 处理服务范围数据 // 处理服务范围数据
useEffect(() => { useEffect(() => {
if (DataServices != null) { if (DataServices != null) {
console.log(DataServices);
options = DataServices.data.rows.map((v: any) => { options = DataServices.data.rows.map((v: any) => {
return { return {
label: v.serviceName, label: v.serviceName,
...@@ -103,7 +102,6 @@ const Edit = (props: any) => { ...@@ -103,7 +102,6 @@ const Edit = (props: any) => {
if (SaveChooseData) { if (SaveChooseData) {
val.id = SaveChooseData.id; val.id = SaveChooseData.id;
} }
console.log(val);
setload(true); setload(true);
TosTosServiceProviderSave(val); TosTosServiceProviderSave(val);
......
...@@ -18,8 +18,8 @@ interface LoginProps { ...@@ -18,8 +18,8 @@ interface LoginProps {
} }
const Login: React.FC<LoginProps> = (props) => { const Login: React.FC<LoginProps> = (props) => {
const { userLogin = {}, submitting, dispatch } = props; const { userLogin = {}, dispatch } = props;
const { status, type: loginType, resultLogin } = userLogin; const { resultLogin } = userLogin;
const [userName, setUsername] = useState(''); const [userName, setUsername] = useState('');
const [forgetflag, setForgetFlag] = useState(false); const [forgetflag, setForgetFlag] = useState(false);
...@@ -36,7 +36,6 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -36,7 +36,6 @@ const Login: React.FC<LoginProps> = (props) => {
if (location.pathname === '/user/login') { if (location.pathname === '/user/login') {
const name = getCookie('remenberUserName'); const name = getCookie('remenberUserName');
const Pwd = getCookie('remenberPwd'); const Pwd = getCookie('remenberPwd');
console.log(name, Pwd);
if (Pwd && name) { if (Pwd && name) {
setRemenber(true); setRemenber(true);
const values = { const values = {
...@@ -63,7 +62,7 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -63,7 +62,7 @@ const Login: React.FC<LoginProps> = (props) => {
payload: userName, payload: userName,
}); });
} else { } else {
message.error('MemberCode!'); message.error('MemberCode!!!');
dispatch({ dispatch({
type: 'login/setResult', type: 'login/setResult',
payload: { payload: {
...@@ -105,7 +104,6 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -105,7 +104,6 @@ const Login: React.FC<LoginProps> = (props) => {
userName !== '' && userName !== '' &&
/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(userName) /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(userName)
) { ) {
console.log('邮箱正确!');
onGetCaptcha(userName); onGetCaptcha(userName);
} else { } else {
message.warning('Please enter the correct email address!'); message.warning('Please enter the correct email address!');
...@@ -123,7 +121,6 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -123,7 +121,6 @@ const Login: React.FC<LoginProps> = (props) => {
// getCaptcha // getCaptcha
setTiming(true); setTiming(true);
const result = await getCaptcha({ account: email }); const result = await getCaptcha({ account: email });
console.log(result);
if (result.error_code === '0000') { if (result.error_code === '0000') {
message.success('Has Been Sent!'); message.success('Has Been Sent!');
} else { } else {
......
...@@ -21,8 +21,6 @@ export interface PwdType { ...@@ -21,8 +21,6 @@ export interface PwdType {
} }
export async function AccountLogin(params: LoginParamsType) { export async function AccountLogin(params: LoginParamsType) {
console.log('登录请求');
console.log(params);
return request('/tos/user/login', { method: 'POST', data: params }); return request('/tos/user/login', { method: 'POST', data: params });
} }
......
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