Commit 9ec4b3bf authored by cellee's avatar cellee

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

parents 78b37d55 30079d9b
import { Tag, Input, Tooltip, Modal } from 'antd';
import { Tag, Input, Tooltip, Modal, message } from 'antd';
import { PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
const { confirm } = Modal;
import styles from './index.less';
......@@ -35,10 +35,7 @@ class TagSelect extends React.Component {
icon: <ExclamationCircleOutlined />,
content: 'Some descriptions',
onOk() {
// console.log('OK');
// console.log(removedTag);
const value = that.state.value.filter((tag) => tag !== removedTag);
// console.log(value);
that.props.onRemove(removedTag);
that.setState({ value });
that.props.onChange(value);
......@@ -61,11 +58,17 @@ class TagSelect extends React.Component {
const { inputValue } = this.state;
let { value } = this.state;
console.log(value);
console.log(inputValue);
if (!inputValue.trim()) {
message.error('Not Null!!!');
return;
}
if (inputValue && value.indexOf(inputValue) === -1) {
this.props.onAdd(inputValue);
value = [...value, inputValue];
// value = [...value, inputValue];
}
// console.log(value);
this.props.onChange(value);
this.setState({
value,
......@@ -134,16 +137,16 @@ class TagSelect extends React.Component {
onClose={(e) => this.handleClose(tag, e)}
visible={true}
>
<span
{/* <span
onDoubleClick={(e) => {
this.setState({ editInputIndex: index, editInputValue: tag.serviceName }, () => {
this.editInput.focus();
});
e.preventDefault();
}}
>
{isLongTag ? `${value.slice(0, 20)}...` : tag.serviceName}
</span>
> */}
{isLongTag ? `${value.slice(0, 20)}...` : tag.serviceName}
{/* </span> */}
</Tag>
);
return isLongTag ? (
......
......@@ -133,6 +133,12 @@ export default {
}
yield put({ type: 'returnData4Error', Data4Error });
break;
case 53:
{
Result = resp;
yield put({ type: 'returnResult', Result });
}
break;
}
} else {
switch (playload.index) {
......@@ -182,6 +188,10 @@ export default {
yield put({ type: 'returnDataServices', DataServices });
}
break;
case 44: {
let Result = resp;
yield put({ type: 'returnResult', Result });
}
}
}
},
......@@ -234,5 +244,10 @@ export default {
let Data4Error = null;
yield put({ type: 'returnData4Error', Data4Error });
},
*ClearResult({}, { put }) {
let Result = null;
yield put({ type: 'returnResult', Result });
},
},
};
......@@ -105,5 +105,12 @@ export default {
let Result = null;
yield put({ type: 'returnResult', Result });
},
*DelGuarder({ playload }: any, { call, put }: any) {
console.log('删除保安');
console.log(playload);
const res = yield call(service.TosGuarderDel, playload);
console.log(res);
},
},
};
......@@ -293,12 +293,12 @@ const UsersDetail = (props: any) => {
<>
<div>
<TitleBack
title={'Member Detail'}
title={'Family/Tenant Details'}
url="none"
titleBack={titleBackCallBack}
></TitleBack>
<Row>
<Col span={4}>Customer Type</Col>
<Col span={4}>User Type</Col>
<Col span={4}>
{memberData.owner_relationship != null
? user_status[memberData.owner_relationship - 1][1]
......
......@@ -13,6 +13,8 @@ const { confirm } = Modal;
const Detail = (props: any) => {
const { dispatch, Data, CurDataFollow, location, SaveChooseData, Result } = props;
const status = ['Normal', 'Cancelled'];
const [loading, setLoding] = useState(false);
const TosSecurityGuarderGet = (values: any) => {
......@@ -32,31 +34,48 @@ const Detail = (props: any) => {
}
}, []);
// 监听保安数据
// useEffect(() => {
// if (CurDataFollow) {
// // 处理数据
// }
// }, [CurDataFollow]);
// 保安详情页
const goToGuard = (values: any, e: any) => {
GuarderById(values);
history.push(location.pathname + '/Guard?saferName=' + values.saferName);
};
// 分页配置
const pagination = {
current: 1,
total: CurDataFollow != null ? CurDataFollow.length : CurDataFollow,
};
// 列表数据
const columns = [
{ title: 'User Name', dataIndex: 'saferName' },
{ title: 'Service Community', dataIndex: 'projectName' },
{ title: 'Job Title', dataIndex: 'cdkCode' },
{ title: 'User Status', dataIndex: 'cdkStatus' },
{ title: 'Job Title', dataIndex: 'jobTitle' },
{
title: 'User Status',
dataIndex: 'cdkStatus',
render: (text: number, record: any) => <div>{status[text]}</div>,
},
{
title: 'Actions',
render: (text: any, record: any) => (
<Space size="middle">
{' '}
<a onClick={goToGuard.bind(this, record)}>Detail</a>
</Space>
),
},
];
// 注销
const handleClick = (id: string) => {
const permissionArr = JSON.parse(localStorage.getItem('permission') || '');
if (permissionArr.indexOf('9') < 0) {
......@@ -77,6 +96,7 @@ const Detail = (props: any) => {
});
};
// 监听注销结果
useEffect(() => {
console.log(Result);
if (Result !== null) {
......@@ -162,7 +182,9 @@ const Detail = (props: any) => {
<Table
rowKey={'id'}
style={{ marginTop: 16 }}
dataSource={CurDataFollow}
dataSource={
CurDataFollow && CurDataFollow.filter((v: { deleted: number }) => v.deleted !== 1)
}
columns={columns}
pagination={pagination}
/>
......
......@@ -7,15 +7,20 @@ import { Link, useIntl, connect, Dispatch } from 'umi';
import Line from '../../../components/Line/Line';
import BackButton from '../../../components/BackButton/BackButton';
import TitleGet from '../../../components/TitleGet/TitleGet';
import { timestampToTime } from '../../../utils/time';
const Guard = (props: any) => {
const { CurDataFollowDetail } = props;
const { CurDataFollowDetail, dispatch } = props;
console.log(CurDataFollowDetail);
const handleClickBtn = () => {};
// 删除保安
const handleClickBtn = (id: string) => {
dispatch({
type: 'ServiceProvider/DelGuarder',
playload: { id },
});
};
return (
<div className={styles.base}>
......@@ -50,7 +55,7 @@ const Guard = (props: any) => {
<Line />
<Button onClick={handleClickBtn}>Cancellation</Button>
<Button onClick={handleClickBtn.bind(this, CurDataFollowDetail.id)}>Cancellation</Button>
</div>
);
};
......
......@@ -5,13 +5,13 @@ import { connect } from 'umi';
import Line from '../../../components/Line/Line';
import TagSelect from '../../../components/TagSelect/index';
import { RA } from '@/utils/method';
import { RA, ClearResult } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack';
const module = 'User';
const Services = (props: any) => {
const { dispatch, DataServices } = props;
const { dispatch, DataServices, Result } = props;
const formRef = useRef(null as any);
useEffect(() => {
......@@ -42,10 +42,6 @@ const Services = (props: any) => {
// 添加服务范围
const Add = (values: string) => {
console.log(values);
if (!values.trim()) {
message.error('Not Null!!!');
return;
}
RA(
44,
{
......@@ -69,6 +65,19 @@ const Services = (props: any) => {
);
};
useEffect(() => {
console.log(Result);
if (Result) {
if (Result.error_code !== '0000') {
message.error('Failed: binding service provider!!!');
} else {
message.success(Result.error_msg);
}
ClearResult('User', dispatch);
RA(43, {}, module, dispatch);
}
}, [Result]);
return (
<div className={styles.base}>
<TitleBack title={'Services Available Management'}></TitleBack>
......@@ -86,9 +95,10 @@ const Services = (props: any) => {
};
function mapStateToProps(state: any) {
const { DataServices } = state.User;
const { DataServices, Result } = state.User;
return {
DataServices,
Result,
};
}
export default connect(mapStateToProps)(Services);
......@@ -77,6 +77,14 @@ export function TosTosServiceProviderDel(values: any) {
headers: { 'Content-Type': 'application/json' },
});
}
export function TosGuarderDel(values: any) {
return request('/tos/securityGuarder/Cancel', {
method: 'POST',
body: JSON.stringify(values),
headers: { 'Content-Type': 'application/json' },
});
}
// /tos/community/facilities/fuzzy/query
//配置文件
// const yellowcolor ="\033[40;33m"
......
......@@ -88,6 +88,10 @@ export const DataSaveClear = (module: string, dispatch: any) => {
export const Data4ErrorClear = (module: string, dispatch: any) => {
dispatch({ type: module + '/Data4ErrorClear' });
};
export const ClearResult = (module: string, dispatch: any) => {
dispatch({ type: module + '/ClearResult' });
};
// const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]]
// const values = [{ categoriesImageUrl: "http://url", categoriesName: "A9" },{ categoriesImageUrl: "http://url...", categoriesName: "A8" }]
export const Fromate = (values: any, reg: any) => {
......
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