import { ref, reactive } from "vue";
import type { FormInstance, FormRules } from "element-plus";
import { isArray, validUpperCase } from "/@/utils/validate";
const ruleFormRef = ref<FormInstance>();
export const projectFormRules = reactive<FormRules>({
  group_id: [
    { required: true, message: "请选择公司卡类型", trigger: "change" }
  ],
  code: [
    {
      required: true,
      message: "请输入主题编码",
      trigger: "blur"
    }
  ],
  modular1_status: [
    {
      required: true,
      message: "请选择首页轮播是否启用",
      trigger: "change"
    }
  ],
  modular1_data: [
    {
      type: "array",
      required: true,
      message: "数据不能为空",
      trigger: "change"
    }
  ],
  modular2_status: [
    {
      required: true,
      message: "请选择产品宣传是否启用",
      trigger: "change"
    }
  ],
  // modular2_title: [
  //   {
  //     required: true,
  //     message: "请输入产品宣传名称",
  //     trigger: "blur"
  //   }
  // ],
  modular2_data: [
    {
      type: "array",
      required: true,
      message: "数据不能为空",
      trigger: "change"
    }
  ],
  modular3_status: [
    {
      required: true,
      message: "请选择产品展示是否启用",
      trigger: "change"
    }
  ],
  modular3_title: [
    {
      required: true,
      message: "请输入区域名称",
      trigger: "blur"
    }
  ],
  modular3_data: [
    {
      type: "array",
      required: true,
      message: "数据不能为空",
      trigger: "change"
    }
  ],
  modular4_status: [
    {
      required: true,
      message: "请选择产品优势是否启用",
      trigger: "change"
    }
  ],
  modular4_title: [
    {
      required: true,
      message: "请输入区域名称",
      trigger: "blur"
    }
  ],
  modular4_data: [
    {
      type: "array",
      required: true,
      message: "数据不能为空",
      trigger: "change"
    }
  ]
});
export const ladderFormRules: FormRules = {
  img: {
    trigger: "change",
    required: true,
    message: "请上传图片"
  },
  jump_type: {
    trigger: "change",
    required: true,
    message: "请选择跳转类型"
  },
  jump_param: {
    trigger: "change",
    required: true,
    message: "请输入跳转地址"
  },
  style_type: {
    trigger: "change",
    required: true,
    message: "请选择样式类型"
  }
};
