Blame view

src/pages/crm_new/TargetAndProportion/index.tsx 1.02 KB
5dae0393   舒述军   目标和占比设置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  import React, {useEffect, useState} from 'react';
  import { Card, Button, Row } from 'antd';
  import { PageHeaderWrapper } from '@ant-design/pro-layout';
  import { createStore } from '@/hooks/moz';
  import store from './store';
  import List from './components/List';
  import { history } from 'umi';
  import ShopModal from './components/ShopModal';
  import TargetModal from './components/TargetModal';
  
  export const { Provider, useStore } = createStore(store);
  
  function Index() {
    const { loading } = useStore();
    function handleToAdd() {
      const state = { operationType: 1};
      history.push({pathname: '/crm/addTragetProportion', state});
    }
  
    return (
      <PageHeaderWrapper loading={loading} title="目标和占比设置">
        <Card>
          <Row justify="end" style={{ marginBottom: 20 }}>
            <Button type="primary" onClick={() => handleToAdd()}>新增</Button>
          </Row>
          <List />
        </Card>
        <ShopModal />
        <TargetModal />
      </PageHeaderWrapper>
    );
  }
  
  export default () => <Provider><Index /></Provider>;