common.tsx 2.15 KB
// 判断条件下拉
export const CONDITION_DATA = [
  {
    label: "等于",
    value: "===",
  },
  {
    label: "不等于",
    value: "!=",
  },

  {
    label: "大于",
    value: ">",
  },
  {
    label: "小于",
    value: "<",
  },
  {
    label: "大于等于",
    value: ">=",
  },
  {
    label: "小于等于",
    value: "<=",
  },
  {
    label: "包含",
    value: "includes",
  },
  {
    label: "不包含",
    value: "!includes",
  },
  {
    label: "为(空/0)",
    value: "empty",
  },
  {
    label: "不为(空/0)",
    value: "!empty",
  },
];

// 判断条件下拉 按钮非主表 b类型
export const CONDITION_DATA_TYPEB = [
  {
    label: "全部为true",
    value: "trueAll",
  },
  {
    label: "全部为false",
    value: "falseAll",
  },
  {
    label: "至少一个为true",
    value: "trueOne",
  },
  {
    label: "至少一个为false",
    value: "falseOne",
  },
];

// 判断条件下拉 按钮非主表 非b类型
export const CONDITION_DATA_TYPE_NOTB = CONDITION_DATA.reduce((pre, item): any => {
  const { label, value } = item;
  if (value.includes("includes")) {
    return pre;
  }
  pre.push({
    label: `全部${label}`,
    value: `${value}All`,
  });
  pre.push({
    label: `至少一个${label}`,
    value: `${value}One`,
  });
  return pre;
}, []);

// 且或组件rowValues默认值
export const INIT_ROW_VALUES = {
  pre1: undefined,
  value1: "",
  condition: undefined,
  pre2: undefined,
  value2: "",
};

// 且或组件表名下拉固定类型
export const ROW_PRE_OPTIONS = [
  {
    label: "字符串",
    value: "string",
  },
  {
    label: "数字",
    value: "number",
  },
];

// props
export const PROPS_OPTIONS = [
  {
    label: "全局变量",
    value: "props",
  },
];

// 简易筛选数据集
export const SIMPLE_DATASET_FILTER_OPTIONS = [
  {
    label: "全部数据",
    value: "",
  },
  {
    label: "选中数据",
    value: "sec",
  },
  {
    label: "首条数据",
    value: "first",
  },
  {
    label: "末条数据",
    value: "last",
  },
];

// radio是否选项
export const RADIO_OPTIONS = [
  {
    label: "是",
    value: "!empty",
  },
  {
    label: "否",
    value: "empty",
  },
];