/*
 * @Note:
 * @Author: 2058827620@qq.com
 * @Date: 2022-04-03 17:02:15
 */

import { ProForm, ModalForm, ProFormRadio, ProFormText, ProFormDigit } from '@ant-design/pro-components';
import { Tree } from 'antd';
import { useEffect, useRef } from 'react';
import FilesManager from '@/components/FilesManage/index';

export default ({ values, modalOpenState, onModalOpenState, onSubmit, permissionTreeData }) => {
  const restFormRef = useRef();

  useEffect(() => {
    restFormRef.current?.setFieldsValue(values);
  }, [values]);

  return (
    <>
      <ModalForm
        title="核销卷-添加"
        formRef={restFormRef}
        submitter={{
          searchConfig: {
            resetText: '重置',
          },
          resetButtonProps: {
            onClick: () => {
              restFormRef.current?.resetFields();
            },
          },
        }}
        initialValues={values}
        onFinish={onSubmit}
        open={modalOpenState}
        onOpenChange={onModalOpenState}
      >
        <ProFormText hidden={true} width="md" name="id" />
        <ProForm.Group>
          {/* <ProFormText
            rules={[{ required: true, message: '请输入' }]}
            width="md"
            name="couponCode"
            label="核销卷编码"
            placeholder="请输入"
          /> */}
          <ProFormText
            rules={[{ required: true, message: '请输入' }]}
            width="md"
            name="couponName"
            label="核销卷名称"
            placeholder="请输入"
          />
        </ProForm.Group>
        <ProForm.Group>

          <ProFormDigit
            fieldProps={{
              prefix: '￥',
            }}
            label="面值"
            name="price"
            min={0}
          />
        </ProForm.Group>
        {/* <ProFormRadio.Group
          name="status"
          radioType="button"
          label="状态"
          options={[
            {
              label: '正常',
              value: 0,
            },
            {
              label: '冻结',
              value: 1,
            },
            {
              label: '禁用',
              value: 2,
            },
          ]}
        /> */}
      </ModalForm>
    </>
  );
};

