Commit b692d874 authored by cellee's avatar cellee

文案修复,展示调整

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 7f010f33
/*
* @Author: your name
* @Date: 2020-11-19 16:54:53
* @LastEditTime: 2020-11-26 16:33:11
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\models\CommunityManagement\CommunityAnnouncement.ts
*/
import * as service from '../../services/tos'; import * as service from '../../services/tos';
import { message } from 'antd'; import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi'; import { Link, useIntl, connect, Dispatch, history } from 'umi';
...@@ -46,8 +54,8 @@ export default { ...@@ -46,8 +54,8 @@ export default {
if (resp.error_code != '0000') { if (resp.error_code != '0000') {
printf(playload, resp); printf(playload, resp);
} message.error(`${resp.error_code}:${resp.error_msg}`);
} else {
switch (playload.index) { switch (playload.index) {
case 25: case 25:
{ {
...@@ -66,9 +74,9 @@ export default { ...@@ -66,9 +74,9 @@ export default {
let ImgSrc = resp.data; let ImgSrc = resp.data;
yield put({ type: 'returnImg', ImgSrc }); yield put({ type: 'returnImg', ImgSrc });
} }
console.log('图片请求成功');
break; break;
} }
}
}, },
*ResultClear({}, { put }) { *ResultClear({}, { put }) {
......
...@@ -258,7 +258,7 @@ const Account = (props: any) => { ...@@ -258,7 +258,7 @@ const Account = (props: any) => {
<ProTable <ProTable
// request={requestHeadl} // request={requestHeadl}
rowKey={'id'} rowKey={'id'}
dataSource={Data ? Data.list : null} dataSource={Data ? Data.list.filter((item: any) => item.userStatus != 1) : null}
columns={columns} columns={columns}
pagination={false} // 隐藏默认分页 pagination={false} // 隐藏默认分页
search={false} search={false}
......
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { Form, Input, Button, Spin, message, Descriptions, Checkbox, Tree, Radio } from 'antd'; import { Form, Input, Button, Spin, message, Descriptions, Modal, 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, PoweroffOutlined } from '@ant-design/icons';
import { getCookie } from '@/utils/method'; import { getCookie } from '@/utils/method';
import './Account.less'; import './Account.less';
import { zhCnFaci, enUsFaci } from '@/utils/power'; import { zhCnFaci, enUsFaci } from '@/utils/power';
import { AccountTip } from '@/utils/tip'; import { AccountTip } from '@/utils/tip';
import SelectCommunity from '@/components/SelectCommunity'; // import SelectCommunity from '@/components/SelectCommunity';
import ShowOptions from '@/components/ShowOptions/index';
import { getNumber } from '@/utils/string'; // 正则 import { getNumber } from '@/utils/string'; // 正则
import { RA } from '@/utils/method'; import { RA } from '@/utils/method';
...@@ -33,6 +35,9 @@ const Account = (props: any) => { ...@@ -33,6 +35,9 @@ const Account = (props: any) => {
// 已选小区 // 已选小区
const [ServiceCell, setServiceCell] = useState(null as any); const [ServiceCell, setServiceCell] = useState(null as any);
const [over, setOver] = useState(false); // 关闭账号确认弹窗
const [accountName, setaccountName] = useState(null as any); // 弹窗账号信息
// 表单标识 // 表单标识
const [form] = Form.useForm(); const [form] = Form.useForm();
const formRef = useRef(null); const formRef = useRef(null);
...@@ -183,6 +188,19 @@ const Account = (props: any) => { ...@@ -183,6 +188,19 @@ const Account = (props: any) => {
marginBottom: '15px', marginBottom: '15px',
}; };
// 监听改变状态提交结果
useEffect(() => {
if (Result != null) {
message.success('Successful Operation !');
setOver(false);
// 清除结果
dispatch({ type: 'Account/ResultClear' });
dispatch({ type: 'Account/ReData' });
// 退回列表
history.push('/AccountManagement/account');
}
}, [Result]);
//级别切换 //级别切换
const onRadio = (e: any) => { const onRadio = (e: any) => {
setvalues(e.target.value); setvalues(e.target.value);
...@@ -197,6 +215,29 @@ const Account = (props: any) => { ...@@ -197,6 +215,29 @@ const Account = (props: any) => {
}; };
// 选择小区名字并赋值 // 选择小区名字并赋值
// 停用账号弹窗
const lockS = () => {
setOver(true);
setaccountName(DataSave);
console.log(DataSave);
};
// 关闭弹窗
const handleCancel = (e: any) => {
setOver(false);
};
// 弹窗 提交确认账号打开关闭
const handleOk = (e: any) => {
//
let obj = {
userStatus: accountName.userStatus == 0 ? 1 : 0,
userID: accountName.tosUserId,
};
RA(52, obj, module, dispatch);
// setOver(false);
};
return ( return (
<Spin spinning={loading}> <Spin spinning={loading}>
<div className="contop" style={{ padding: '12px 20px' }}> <div className="contop" style={{ padding: '12px 20px' }}>
...@@ -204,6 +245,10 @@ const Account = (props: any) => { ...@@ -204,6 +245,10 @@ const Account = (props: any) => {
<EditOutlined /> <EditOutlined />
&nbsp; Detail Account &nbsp; Detail Account
<div className="back"> <div className="back">
<Button type="primary" danger style={{ marginRight: 15 }} onClick={lockS}>
<PoweroffOutlined />
Close Account
</Button>
<Button onClick={goToReturn}> <Button onClick={goToReturn}>
<LeftOutlined /> <LeftOutlined />
Back Back
...@@ -249,9 +294,14 @@ const Account = (props: any) => { ...@@ -249,9 +294,14 @@ const Account = (props: any) => {
</Descriptions> </Descriptions>
<Form.Item name="community" label="Community"> <Form.Item name="community" label="Community">
<SelectCommunity {/* <SelectCommunity
checklist={DataSave == null ? null : DataSave.tosUserServiceCell.split(',')} checklist={DataSave == null ? null : DataSave.tosUserServiceCell.split(',')}
/> /> */}
<ShowOptions
list={DataSave ? DataSave.tosUserServiceCell.split(',') : []}
defaultValue={'Put It Away'}
></ShowOptions>
</Form.Item> </Form.Item>
<div className="diy" style={{ marginBottom: '14px' }}> <div className="diy" style={{ marginBottom: '14px' }}>
...@@ -300,6 +350,27 @@ const Account = (props: any) => { ...@@ -300,6 +350,27 @@ const Account = (props: any) => {
</div> </div>
</div> </div>
</Form> </Form>
{/* 确认关闭账号 */}
<Modal
title="Operation Tips"
visible={over}
okText={'Confirm'}
cancelText={'Cancel'}
onOk={handleOk}
onCancel={handleCancel}
confirmLoading={loading}
>
{accountName != null ? (
<p>
Are You Sure To{' '}
<span style={{ color: 'red' }}>{accountName.userStatus != 1 ? 'Close' : 'Open'}</span>{' '}
The Account '<span style={{ color: 'red' }}> {accountName.tosUserName} </span>' ?
</p>
) : (
''
)}
</Modal>
</div> </div>
</Spin> </Spin>
); );
......
...@@ -30,9 +30,6 @@ const Account = (props: any) => { ...@@ -30,9 +30,6 @@ const Account = (props: any) => {
// 单选 二级还是三级管理员 // 单选 二级还是三级管理员
const [values, setvalues] = useState(2); // 树形菜单展开关闭 const [values, setvalues] = useState(2); // 树形菜单展开关闭
const [over, setOver] = useState(false); // 关闭账号确认弹窗
const [accountName, setaccountName] = useState(null as any); // 弹窗账号信息
// 表单标识 // 表单标识
const [form] = Form.useForm(); const [form] = Form.useForm();
const formRef = useRef(null); const formRef = useRef(null);
...@@ -112,14 +109,8 @@ const Account = (props: any) => { ...@@ -112,14 +109,8 @@ const Account = (props: any) => {
// 监听改变状态提交结果 // 监听改变状态提交结果
useEffect(() => { useEffect(() => {
if (Result != null) { if (Result != null) {
// console.log('改变取消弹窗重新加载,在清空结果');
// let obj = {
// userStatus: accountName.userStatus == 0 ? 1 : 0,
// userID: accountName.tosUserId,
// };
// RA(52, obj);
message.success('Successful Operation !'); message.success('Successful Operation !');
setOver(false); // setOver(false);
// 清除结果 // 清除结果
dispatch({ type: 'Account/ResultClear' }); dispatch({ type: 'Account/ResultClear' });
dispatch({ type: 'Account/ReData' }); dispatch({ type: 'Account/ReData' });
...@@ -222,28 +213,6 @@ const Account = (props: any) => { ...@@ -222,28 +213,6 @@ const Account = (props: any) => {
const keyup_tool = (value: any) => { const keyup_tool = (value: any) => {
return getNumber(value.replace(/[^\d^\.]+/g, '')); return getNumber(value.replace(/[^\d^\.]+/g, ''));
}; };
// 停用账号弹窗
const lockS = () => {
setOver(true);
setaccountName(DataSave);
console.log(DataSave);
};
// 关闭弹窗
const handleCancel = (e: any) => {
setOver(false);
};
// 弹窗 提交确认账号打开关闭
const handleOk = (e: any) => {
//
let obj = {
userStatus: accountName.userStatus == 0 ? 1 : 0,
userID: accountName.tosUserId,
};
RA(52, obj, module, dispatch);
// setOver(false);
};
return ( return (
<Spin spinning={loading}> <Spin spinning={loading}>
...@@ -252,10 +221,6 @@ const Account = (props: any) => { ...@@ -252,10 +221,6 @@ const Account = (props: any) => {
<EditOutlined /> <EditOutlined />
&nbsp; Edit Account &nbsp; Edit Account
<div className="back"> <div className="back">
<Button type="primary" danger style={{ marginRight: 15 }} onClick={lockS}>
<PoweroffOutlined />
Close Account
</Button>
<Button onClick={goToReturn}> <Button onClick={goToReturn}>
<LeftOutlined /> <LeftOutlined />
Back Back
...@@ -351,26 +316,6 @@ const Account = (props: any) => { ...@@ -351,26 +316,6 @@ const Account = (props: any) => {
</div> </div>
</Form> </Form>
</div> </div>
{/* 确认关闭账号 */}
<Modal
title="Operation Tips"
visible={over}
okText={'Confirm'}
cancelText={'Cancel'}
onOk={handleOk}
onCancel={handleCancel}
confirmLoading={loading}
>
{accountName != null ? (
<p>
Are You Sure To{' '}
<span style={{ color: 'red' }}>{accountName.userStatus != 1 ? 'Close' : 'Open'}</span>{' '}
The Account '<span style={{ color: 'red' }}> {accountName.tosUserName} </span>' ?
</p>
) : (
''
)}
</Modal>
</Spin> </Spin>
); );
}; };
......
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