import Api from "@/api/product/cons-group";


import { returnOptions, switchAttr } from "./config";
import type { IModalConfig } from "@/components/CURD/types";

const modalConfig: IModalConfig = {
  pageName: "sys:user",
  dialog: {
    title: "添加耗材分类",
    width: 800,
    draggable: true,
  },
  form: {
    labelWidth: 140,
  },
  formAction: function (data) {
    return Api.add({ ...data });
  },
  beforeSubmit(data) {
    console.log("提交之前处理", data);
  },
  formItems: [

    {
      label: "耗材类型名称",
      prop: "name",
      rules: [{ required: true, message: "请输入耗材类型名称", trigger: "blur" }],
      attrs: {
        placeholder: "请输入耗材类型名称",
      },
    },
    {
      type: "switch",
      label: "是否启用",
      prop: "status",
      attrs: {
        activeValue: 1,
        inactiveValue: 0
      },
      col: {
        xs: 24,
        sm: 12,
      },
      initialValue: 0

    },

  ],
};

// 如果有异步数据会修改配置的，推荐用reactive包裹，而纯静态配置的可以直接导出
export default reactive(modalConfig);
