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

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

// const { shopLevelItems } = services.ShopLevelController;
// const { shopItems } = services.ShopController;
export default ({ values, modalOpenState, onModalOpenState, onSubmit }) => {
  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="username"
            label="用户名"
            placeholder="请输入"
          />
          <ProFormText
            rules={[{ required: true, message: '请输入' }]}
            width="md"
            name="mobile"
            label="手机号"
            placeholder="请输入"
          />
          <ProFormText
            rules={[{ required: true, message: '请输入' }]}
            width="md"
            name="org_name"
            label="运营中心"
            placeholder="请输入"
          />
        </ProForm.Group>
      </ModalForm>
    </>
  );
};

