import { FormType } from "@/components/form/interface";
import SimpleForm from "@/components/form/simple_form"
import { CompanyConfig } from "@/service/user_config";
import { FormInstance } from "antd";
import React from "react";

const Share = () => {
    const formRef = React.useRef<FormInstance>(null);
    const config: any = [
        {
            type: FormType.cehckbox,
            label: "分享类型",
            name: "share_type",
            value: [],
            selectList: [{ data_name: "事件", identity: 1 }, { data_name: "属性", identity: 2 }],
            rules: [{ required: true, message: "请选择默认数据" }],
        },
        {
            type: FormType.treeSelect,
            label: "分享至",
            name: "company_identity",
            value: 0,
            selectUrl: CompanyConfig.LIST,
            keys: "name",
            rules: [{ required: true, message: "单位不能为空" }],
        },
    ]
    return (
        <SimpleForm
            formName={"user_form"}
            formRef={formRef}
            colProps={25}
            onFinish={() => {
                formRef.current?.getFieldsValue()
            }}
            createCallback={() => {

            }}
            formDatas={config}
        ></SimpleForm>
    )
}

export default Share