Commit 37cbbb33 authored by cellee's avatar cellee

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

parents 807940a0 6ab76183
import React, { useEffect } from 'react';
import styles from './index.less';
import { Row, Col, Table, Space, Tabs, Button } from 'antd';
const { TabPane } = Tabs;
import { objectColumns } from '@/utils/string';
import { size } from 'lodash';
import Toast from '../Toast/Toast';
const TableShow = (props: any) => {
const { data } = props;
......@@ -34,9 +31,9 @@ const TableShow = (props: any) => {
const user_code = ['Not Used', 'Used'];
const key = objectColumns([
['User Name', 'ower_name'],
['Contact Details', 'ower_phone'],
['Email', 'ower_email'],
['User Name', 'owner_family_name'],
['Contact Details', 'owner_family_phone'],
['Email', 'owner_family_email'],
[
'RelationShip',
null,
......@@ -66,7 +63,7 @@ const TableShow = (props: any) => {
return (
<>
<Tabs defaultActiveKey="0">
{dataRow.map((item, index) => {
{dataRow.map((item: any, index: number) => {
return (
<TabPane tab={item.name} key={index}>
<Row gutter={16}>
......
import { Tag, Input, Tooltip } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { Tag, Input, Tooltip, Modal } from 'antd';
import { PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
const { confirm } = Modal;
import styles from './index.less';
class TagSelect extends React.Component {
state = {
value: this.props.value != null ? this.props.value : [],
......@@ -11,19 +10,43 @@ class TagSelect extends React.Component {
editInputIndex: -1,
editInputValue: '',
};
// componentDidUpdate(){
// console.log("--组件更新--")
// console.log(this.props.value)
// componentDidUpdate(value) {
// console.log('--组件更新--');
// console.log(this.props.value);
// console.log(value);
// }
// componentDidMount(){
// console.log("--组件加载完成--")
// console.log(this.state.value)
// componentDidMount(value) {
// console.log('--组件加载完成--');
// console.log(this.state.value);
// console.log(value);
// }
handleClose = (removedTag) => {
const value = this.state.value.filter((tag) => tag !== removedTag);
console.log(value);
this.setState({ value });
this.props.onChange(value);
componentWillReceiveProps(value) {
this.setState({ value: value.value });
}
handleClose = (removedTag, e) => {
console.log(removedTag, e);
const that = this;
confirm({
title: 'Do you Want to delete these items?',
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);
},
onCancel() {
console.log('Cancel');
},
});
};
showInput = () => {
......@@ -42,7 +65,7 @@ class TagSelect extends React.Component {
this.props.onAdd(inputValue);
value = [...value, inputValue];
}
console.log(value);
// console.log(value);
this.props.onChange(value);
this.setState({
value,
......@@ -77,10 +100,9 @@ class TagSelect extends React.Component {
};
render() {
const { value, inputVisible, inputValue, editInputIndex, editInputValue } = this.state;
const { value, inputVisible, inputValue, editInputIndex, editInputValue, visible } = this.state;
console.log(this.props.value);
console.log(value);
return (
<>
<Tag className="editTag" key="Accountant">
......@@ -110,7 +132,8 @@ class TagSelect extends React.Component {
className="editTag"
key={tag}
closable={index !== -1}
onClose={() => this.handleClose(tag)}
onClose={(e) => this.handleClose(tag, e)}
visible={true}
>
<span
onDoubleClick={(e) => {
......
import React, { useState, useEffect, useRef } from 'react';
import {
Input,
Tabs,
Modal,
Space,
Pagination,
Tooltip,
Button,
Form,
Row,
Col,
message,
Spin,
} from 'antd';
import { Input, Modal, Button, Form, Row, Col, message, Spin } from 'antd';
const { confirm } = Modal;
const { TabPane } = Tabs;
import { ExclamationCircleOutlined } from '@ant-design/icons';
import { Link, useIntl, connect, Dispatch } from 'umi';
import { connect } from 'umi';
import styles from './UsersAdd.less';
import Line from '../../../components/Line/Line';
import TitleBack from '../../../components/TitleBack/TitleBack';
import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
import { checkParam } from '../../../utils/method';
import TableShow from '@/components/TableShow/TableShow';
import { values, fromPairs } from 'lodash';
import { timestampToTime } from '@/utils/time';
import { validateMessages } from '@/utils/params';
......
......@@ -100,6 +100,6 @@
.writeOff {
position: absolute;
top: 34px;
top: 0;
right: 150px;
}
......@@ -170,6 +170,6 @@
.writeOff {
position: absolute;
top: 34px;
top: 0;
right: 150px;
}
......@@ -215,22 +215,22 @@ const ServiceProviderManagement = (props: propsType) => {
};
// 数据处理
const dataSource = (values: any) => {
let tmp = values;
for (let items in tmp) {
switch (tmp[items].enable) {
case 0:
tmp[items].enable = 'Normal';
break;
case 1:
tmp[items].enable = 'Deregistered';
break;
case 2:
break;
}
}
return tmp;
};
// const dataSource = (values: any) => {
// let tmp = values;
// for (let items in tmp) {
// switch (tmp[items].enable) {
// case 0:
// tmp[items].enable = 'Normal';
// break;
// case 1:
// tmp[items].enable = 'Deregistered';
// break;
// case 2:
// break;
// }
// }
// return tmp;
// };
return (
<div className={styles.base}>
......
import React, { useState, useEffect, useRef } from 'react';
import styles from './Services.less';
import { Form, Button, Modal, Space, Pagination, Tooltip, Checkbox } from 'antd';
import { Form, message } from 'antd';
import { connect } from 'umi';
import Line from '../../../components/Line/Line';
......@@ -33,45 +32,48 @@ const Services = (props: any) => {
}
}, [DataServices]);
// 提交服务范围
const onFinish = (values: any) => {
console.log(values);
// RA(
// 44,
// {
// id: '5',
// serviceName: '律政',
// },
// module,
// dispatch,
// );
};
// 添加服务范围
const Add = (values: any) => {
const Add = (values: string) => {
console.log(values);
if (!values.trim()) {
message.error('Not Null!!!');
return;
}
RA(
44,
{
serviceName: values,
},
module,
dispatch,
);
};
// 删除服务范围
const Remove = (values: any) => {};
const Remove = (values: string) => {
console.log(values);
RA(
53,
{
serviceName: values,
},
module,
dispatch,
);
};
return (
<div className={styles.base}>
<TitleBack title={'Services Available Management'}></TitleBack>
<Form ref={formRef} name="basic" onFinish={onFinish}>
{DataServices != null ? (
{DataServices !== null ? (
<Form ref={formRef} name="basic">
<Form.Item label="Available Services" name="serviceName">
<TagSelect onAdd={Add} onRemove={Remove} />
</Form.Item>
) : null}
<Line />
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Form>
<Line />
</Form>
) : null}
</div>
);
};
......
......@@ -126,12 +126,5 @@ export const requestList = [
['/tos/community/facilities/subscribeTime/query', '50 设施预订时间段查询', {}],
['/tos/user/infromation/get', '51 获取后台所有账号', {}],
['/tos/users/quitAndUser', '52 修改账号状态', {}],
];
const params = [
{ communityName: '' },
{ communityNum: '', noticTitlel: '' },
{ inviterAddress: '', visitorCommunity: '' },
[26, {}],
[28, {}],
['/tos/tosServiceScope/cancel', '53 删除服务范围'],
];
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