Blame view

src/pages/pms/setting/components/ConfirmBnt.tsx 879 Bytes
e8ed4786   jiangwei   配件计划设置拆分
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
  import React from 'react';
  import { Button, Popconfirm } from 'antd';
  
  interface Props {
    disable: boolean
    onCancel: () => any
    onOk: () => any
    onEdit: () => any
  }
  export default function Index({disable = false, onCancel = () => null, onOk = () => null, onEdit = () => null}: Props) {
    return (
      <span style={{display: 'flex', justifyContent: 'center', marginTop: 30, fontSize: 30, marginBottom: 30}}>
        {disable ? (
          <>
            <Popconfirm
              placement="top"
              title="请确认数据是否填写正确!"
              onConfirm={onOk}
              onCancel={onCancel}
            >
              <Button style={{marginRight: 30 }} type="primary">保存</Button>
            </Popconfirm>
            <Button onClick={onCancel}>取消</Button>
          </>
          ) : (<Button type="primary" onClick={onEdit}>编辑</Button>)}
      </span>
    );
  }