Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
cybertriton committed May 31, 2020
2 parents b627c16 + 7ea6e91 commit c6eec30
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 41 deletions.
3 changes: 3 additions & 0 deletions src/components/FrameOut/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
margin: 0 10px;
}
}
.ant-layout-sider-zero-width-trigger{
top:11px;
}
@media screen and (max-width:500px){
.btnText{ display:none; }
.collapsedUI{
Expand Down
83 changes: 44 additions & 39 deletions src/views/campaign/campaignMerchant.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ const { confirm } = Modal;
class CampaignMerchant extends Component {
state = {
currentPage: 1,
currentListPage: 1,
listSize: 10,
size: 10,
size: 7,
total: 10,
data: [],
selectedRowKeys: [], // Check here to configure the default column
Expand All @@ -40,7 +41,6 @@ class CampaignMerchant extends Component {
};
componentDidMount() {
let id = this.props.id;
console.log("JoinOrg -> componentDidMount -> id", id);
this.initColumns();
if (id) {
this.setState({
Expand Down Expand Up @@ -91,7 +91,7 @@ class CampaignMerchant extends Component {
}}
className="ant-pink-link cursor"
>
<DeleteOutlined/>
<DeleteOutlined />
</b>
</span>
);
Expand Down Expand Up @@ -187,10 +187,19 @@ class CampaignMerchant extends Component {
getMarket = async (id) => {
let curInfo = await reqShowParties(id);
let cont = curInfo.data ? curInfo.data : [];
this.parties = cont.parties ? cont.parties : [];
this.setState({
parties: cont.parties,
loading: false,
});
let page = parseInt((cont.parties.length - 1) / this.state.listSize) + 1;
this.setState({
inited: true,
currentListPage:
this.state.currentListPage > page
? this.state.currentListPage - 1
: this.state.currentListPage,
});
};

onSelectChange = (selectedRowKeys) => {
Expand All @@ -216,20 +225,20 @@ class CampaignMerchant extends Component {
});
this.handleCancel();
};
addOneItem = async (id) => {
this.setState({ loading: true });
let params = {
parts: [{ partyId: id, type: "MERCHANT" }],
};
const result = await reqPostParties(this.state.id, params);
this.setState({
visible: false,
parties: [],
currentPage: 1,
});
// addOneItem = async (id) => {
// this.setState({ loading: true });
// let params = {
// parts: [{ partyId: id, type: "MERCHANT" }],
// };
// const result = await reqPostParties(this.state.id, params);
// this.setState({
// visible: false,
// parties: [],
// currentPage: 1,
// });

this.getMarket(this.state.id);
};
// this.getMarket(this.state.id);
// };

addItem = async (newList) => {
this.setState({ loading: true });
Expand All @@ -239,18 +248,18 @@ class CampaignMerchant extends Component {
const result = await reqPostParties(this.state.id, params);
this.setState({
visible: false,
parties: [],
// parties: [],
currentPage: 1,
});

this.getMarket(this.state.id);
};

delItem = async (partyId) => {
const result = await reqDelParty(this.state.id, partyId);
this.setState({
parties: [],
inited: false,
});
const result = await reqDelParty(this.state.id, partyId);
this.getMarket(this.state.id);
};
backHome = () => {
Expand All @@ -262,6 +271,11 @@ class CampaignMerchant extends Component {
});
this.getOrgs(page);
};
handleListTableChange = (page, pageSize) => {
this.setState({
currentListPage: page,
});
};
// onShowSizeChange = (current, pageSize) => {
// this.setState({
// currentPage: current,
Expand All @@ -273,6 +287,7 @@ class CampaignMerchant extends Component {
this.setState({
searchTxt: e.target.value,
});
this.getMarket(this.state.id);
};
searchValue = (value) => {
this.setState({
Expand All @@ -294,6 +309,7 @@ class CampaignMerchant extends Component {
pageSize,
totalList,
searchTxt,
currentListPage,
} = this.state;
const rowSelection = {
selectedRowKeys,
Expand All @@ -313,18 +329,19 @@ class CampaignMerchant extends Component {
></PageHeader>
<Table
size="small"
className="tableFont"
className="tableFont"
columns={this.columns}
dataSource={parties}
dataSource={this.parties}
pagination={false}
pagination={{
current: currentListPage,
pageSize: listSize,
//showQuickJumper: true,
total: parties.length,
total: this.parties,
onChange: this.handleListTableChange,
}}
/>
</div>
<div style={{ marginBottom: 16, marginTop: 16 }}>
<div>
<Button type="primary" onClick={this.backHome}>
提交
</Button>
Expand Down Expand Up @@ -364,19 +381,19 @@ class CampaignMerchant extends Component {

<Table
size="small"
className="tableFont"
className="tableFont"
columns={this.listColumns}
dataSource={data}
pagination={{
current:currentPage,
current: currentPage,
pageSize: size,
total: this.totalPages,
onChange: this.handleTableChange,
showTotal: (total) => `总共 ${total} 条数据`,
}}
rowSelection={rowSelection}
/>
<div style={{ marginBottom: 8, marginTop: 8 }}>
<div>
<Button
type="primary"
onClick={this.backHome}
Expand All @@ -390,18 +407,6 @@ class CampaignMerchant extends Component {
{hasSelected ? `选择了 ${selectedRowKeys.length} 个商户` : ""}
</span>
</div>
{/* <div className="pagination">
<Pagination
pageSize={size}
current={currentPage}
current={currentPage}
onChange={this.handleTableChange}
total={this.totalPages}
showTotal={(total) => `总共 ${total} 条数据`}
//showSizeChanger={false}
//onShowSizeChange={this.onShowSizeChange}
/>
</div> */}
</div>
) : (
<Loading />
Expand Down
3 changes: 3 additions & 0 deletions src/views/campaign/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ class Campaign extends Component {

delItem = async (id) => {
const result = await reqDelCampaign(id);
this.setState({
currentPage:1
})
this.getCampaigns(null, 1);
};
publishItem = async (id) => {
Expand Down
4 changes: 4 additions & 0 deletions src/views/campaign/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,8 @@
}
.tableFont .ant-table-cell{
font-size: 12px;
}
.tableFont .ant-pagination{
font-size: 12px;
padding: 6px!important;
}
5 changes: 3 additions & 2 deletions src/views/coupon/couponHome.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CouponHome extends Component {
visible: false,
/**发布客户 */
current: 1,
listSize: 5,
listSize: 8,
listTotal: 0,
listData: [],
partyId: "",
Expand Down Expand Up @@ -510,7 +510,7 @@ class CouponHome extends Component {
name="searchClientTxt"
value={searchClientTxt}
onChange={this.handleClientChange}
placeholder="请输入客户姓名、手机号搜索"
placeholder="输入姓名、手机号或客户标签搜索"
allowClear
/>
</Col>
Expand All @@ -526,6 +526,7 @@ class CouponHome extends Component {
</Row>
<Table
size="small"
className='tableFont'
columns={this.listColumns}
dataSource={listData}
pagination={false}
Expand Down
4 changes: 4 additions & 0 deletions src/views/coupon/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@

.tableFont .ant-table-cell{
font-size: 12px;
}
.tableFont .ant-pagination{
font-size: 12px;
padding: 6px!important;
}
3 changes: 3 additions & 0 deletions src/views/employee/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ class Employee extends Component {

deleteItem = async (id) => {
let resultDel = await reqDelEmployee(id);
this.setState({
currentPage:1
})
if (resultDel.data.retcode === 0) {
notification.success({ message: "删除成功" });
this.getEmployees(1);
Expand Down
3 changes: 3 additions & 0 deletions src/views/group/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ class Groups extends Component {
//删除分组
deleteItem = async (id) => {
let result = await reqDelGroup(id);
this.setState({
currentPage:1
})
if (result.data.retcode === 0) {
notification.success({ message: "删除成功" });
this.getGroups(1);
Expand Down
3 changes: 3 additions & 0 deletions src/views/merchant/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ class Merchant extends Component {
return false;
}
const result = await reqDelMerchant(uid);
this.setState({
currentPage:1
})
this.getMerchant(1);
};
onFinish = async (values) => {
Expand Down
3 changes: 3 additions & 0 deletions src/views/tag/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ class TagManager extends Component {
};
deleteItem = async (id) => {
let resultDel = await reqDelTag(id);
this.setState({
currentPage:1
})
if (resultDel.data.retcode === 0) {
notification.success({ message: "删除成功" });
this.getTags(1);
Expand Down

0 comments on commit c6eec30

Please sign in to comment.