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