Commit 6ab76183 authored by Sixiang_Zzb's avatar Sixiang_Zzb

测试bug修复

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