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