Commit 28241246 authored by cellee's avatar cellee

Signed-off-by: cellee <893264950@qq.com>

parent b853f935
......@@ -50,8 +50,20 @@ const CellLists = (props: any) => {
null,
(text: any, record: any) => (
<Space size="middle">
<a onClick={goToEdit.bind(this, record)}>Edit</a>
<a onClick={goToDetail.bind(this, record)}>Detail</a>
<a
onClick={() => {
emptys(record, '/CommunityManagement/CellList/Add');
}}
>
Edit
</a>
<a
onClick={() => {
emptys(record, '/CommunityManagement/CellList/Detail');
}}
>
Detail
</a>
</Space>
),
],
......@@ -74,24 +86,12 @@ const CellLists = (props: any) => {
}
}, [village]);
const goToAdd = () => {
emptys(null);
history.push('/CommunityManagement/CellList/Add');
};
const goToEdit = (values: any, e: any) => {
emptys(values);
history.push('/CommunityManagement/CellList/Add');
};
const goToDetail = (values: any, e: any) => {
emptys(values);
history.push('/CommunityManagement/CellList/Detail');
};
// 清除操作之前的数据
const emptys = (data: any) => {
const emptys = (data: any, url: any) => {
dispatch({ type: module + '/urlRemove' }); // 清掉图片信息
SA(data, module, dispatch);
dispatch({ type: module + '/ResultClear' }); // 清空之前保存成功的结果
history.push(url);
};
// 点击搜索
......@@ -147,7 +147,11 @@ const CellLists = (props: any) => {
search={false}
loading={loading}
toolBarRender={() => [
<Button key="3" type="primary" onClick={goToAdd}>
<Button
key="3"
type="primary"
onClick={() => emptys(null, '/CommunityManagement/CellList/Add')}
>
<PlusOutlined />
Create New Community
</Button>,
......
......@@ -137,7 +137,7 @@ const Detail = (props: any) => {
<div className="code">
<li>Community Activation Code</li>
<div
style={{ width: 122, height: 122, border: '1px solid #f0f0f0', margin: 'auto' }}
style={{ width: 122, height: 122, border: '1px solid #f0f0f0', margin: '0 auto' }}
>
<Image width={120} src={detailData.visitorUrl} />
</div>
......
import React, { useState, useEffect, useRef } from 'react';
import { Input, Tabs, Tag, Form, Button, message, DatePicker } from 'antd';
const { TabPane } = Tabs;
import React, { useEffect } from 'react';
import { Input, Form, Button, DatePicker } from 'antd';
import { connect } from 'umi';
import { objectColumns } from '@/utils/string';
import ProTable from '@ant-design/pro-table';
import { RA, SA } from '@/utils/method';
import { PlusOutlined, SearchOutlined, ClearOutlined } from '@ant-design/icons';
import { SearchOutlined, ClearOutlined } from '@ant-design/icons';
import './index.less';
import moment from 'moment';
import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity';
import SelectCommunity from '@/components/SelectCommunity';
......@@ -17,10 +14,6 @@ const module = 'VisitorRecord';
const VisitorRecord = (props: any) => {
const { dispatch, Data, DataSave, loading } = props;
const TosVisitorRecordGet = (values: any) => {
dispatch({ type: 'tosVisitorRecord/get', playload: values });
};
// 新增搜索的时间 原来时间是时间戳格式
useEffect(() => {
if (Data != null) {
......@@ -28,7 +21,12 @@ const VisitorRecord = (props: any) => {
item.showTime = moment(item.updateTime).format('YYYY-MM-DD');
});
} else {
RA(26, { inviterAddress: '', visitorCommunity: '' }, module, dispatch);
RA(
26,
{ communityNames: JSON.parse(localStorage.getItem('CommunityList') as any) },
module,
dispatch,
);
}
}, [Data]);
......@@ -65,13 +63,6 @@ const VisitorRecord = (props: any) => {
size: 'default',
};
// 搜索配置
// const searchInfo = {
// filterType: 'light',
// searchText: 'Search',
// resetText: 'Reset',
// };
// 多条件筛选
//@param condition 过滤条件
//@param data 需要过滤的数据
......@@ -132,7 +123,12 @@ const VisitorRecord = (props: any) => {
// 刷新
const onReset = () => {
SA(DataSave, module, dispatch);
RA(26, { inviterAddress: '', visitorCommunity: '' }, module, dispatch);
RA(
26,
{ communityNames: JSON.parse(localStorage.getItem('CommunityList') as any) },
module,
dispatch,
);
};
// 去掉null undefined 无效字段
......
import React, { useState, useEffect, useRef } from 'react';
import { Input, Tabs, Tag, Form, Button, message, DatePicker } from 'antd';
const { TabPane } = Tabs;
import React, { useEffect } from 'react';
import { Input, Form, Button, DatePicker } from 'antd';
import { connect } from 'umi';
import { objectColumns } from '@/utils/string';
import ProTable from '@ant-design/pro-table';
import { RA, SA } from '@/utils/method';
import { PlusOutlined, SearchOutlined, ClearOutlined } from '@ant-design/icons';
import { SearchOutlined, ClearOutlined } from '@ant-design/icons';
import './index.less';
import moment from 'moment';
import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity';
import SelectCommunity from '@/components/SelectCommunity';
......@@ -17,10 +14,6 @@ const module = 'VisitorRecord';
const VisitorRecord = (props: any) => {
const { dispatch, Data, DataSave, loading } = props;
const TosVisitorRecordGet = (values: any) => {
dispatch({ type: 'tosVisitorRecord/get', playload: values });
};
// 新增搜索的时间 原来时间是时间戳格式
useEffect(() => {
if (Data != null) {
......@@ -28,7 +21,12 @@ const VisitorRecord = (props: any) => {
item.showTime = moment(item.updateTime).format('YYYY-MM-DD');
});
} else {
RA(26, { inviterAddress: '', visitorCommunity: '' }, module, dispatch);
RA(
26,
{ communityNames: JSON.parse(localStorage.getItem('CommunityList') as any) },
module,
dispatch,
);
}
}, [Data]);
......@@ -65,13 +63,6 @@ const VisitorRecord = (props: any) => {
size: 'default',
};
// 搜索配置
// const searchInfo = {
// filterType: 'light',
// searchText: 'Search',
// resetText: 'Reset',
// };
// 多条件筛选
//@param condition 过滤条件
//@param data 需要过滤的数据
......@@ -132,7 +123,12 @@ const VisitorRecord = (props: any) => {
// 刷新
const onReset = () => {
SA(DataSave, module, dispatch);
RA(26, { inviterAddress: '', visitorCommunity: '' }, module, dispatch);
RA(
26,
{ communityNames: JSON.parse(localStorage.getItem('CommunityList') as any) },
module,
dispatch,
);
};
// 去掉null undefined 无效字段
......
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