import { DEFAULT_FONT, DEFAULT_COLOR, DATE_FILTER_TYPE } from "@/constants";
const border = {
  width: 0,
  color: "",
  type: "solid",
};

export const shufflTableStyle = {
  row: {
    odd: { background: "rgba(46, 116, 255, 0.05)" },
    even: { background: "rgb(255, 255, 255)" },
    border,
  },
  theme: {
    show: true,
    mainColor: "#1C76FD",
    basicColors: [
      "#2F3440",
      "#FFFFFFFF",
      "#E1EAFE",
      "#F6F7FB",
      "#F2F7FF",
      "#2C60D4",
      "#000000",
      "#3471F9",
      "#F7F9FA",
      "#EBF0F5",
      "#00000000",
      "#EBF0F500",
      "#EBF0F5",
      "#2F3440",
      "#2F3440",
    ],
  },

  columns: [
    {
      width: 100,
      contentType: "text",
      img: { width: 100, paddingLeft: 7, paddingTop: 10 },
    },
    {
      width: 100,
      contentType: "text",
      img: { width: 100, paddingLeft: 7, paddingTop: 10 },
    },
    {
      width: 100,
      contentType: "text",
      img: { width: 100, paddingLeft: 7, paddingTop: 10 },
    },
    {
      width: 100,
      contentType: "text",
      img: { width: 100, paddingLeft: 7, paddingTop: 10 },
    },
    {
      width: 100,
      contentType: "text",
      img: { width: 100, paddingLeft: 7, paddingTop: 10 },
    },
  ],
  header: {
    fontSize: 12,
    fontWeight: "bold",
    align: "left",
    show: true,

    height: 40,
    fontFamily: "PingFang SC",
    border,
    color: "#fff",
  },
  content: {
    fontSize: 12,
    fontWeight: "normal",
    align: "left",
    horizon: true,
    vertical: true,
  },
  indexColumn: {
    isHighlight: true,
    show: false,
  },
  pagination: {
    show: true,
    pageSize: 20,
    autoHide: true,
  },
  superTitle: {
    show: false,
    group: [],
  },
  colWidth: {
    mode: "auto",
    config: {},
  },
};
export const crosstabStyle = {
  theme: {
    show: true,
    mainColor: "#1C76FD",
    basicColors: [
      "#2F3440",
      "#FFFFFFFF",
      "#E1EAFE",
      "#F6F7FB",
      "#F2F7FF",
      "#2C60D4",
      "#000000",
      "#3471F9",
      "#F7F9FA",
      "#EBF0F5",
      "#00000000",
      "#EBF0F500",
      "#EBF0F5",
      "#2F3440",
      "#2F3440",
    ],
  },
  header: {
    fontSize: 12,
    fontWeight: "normal",
    align: "right",
    show: true,

    height: 40,
    fontFamily: "PingFang SC",
    border,
    color: "#fff",
  },
  content: {
    fontSize: 12,
    fontWeight: "normal",
    align: "right",
  },
  indexColumn: {
    show: false,
  },
  pagination: {
    show: true,
    pageSize: 20,
    autoHide: true,
  },
  totals: {
    row: {
      showGrandTotals: false,
      showSubTotals: true,
      reverseLayout: false,
      reverseSubLayout: true,
      label: "总计",
      subLabel: "小计",
    },
    col: {
      showGrandTotals: false,
      showSubTotals: true,
      reverseLayout: true,
      reverseSubLayout: true,
      label: "总计",
      subLabel: "小计",
    },
  },
};
export const metricCardStyle = {
  content: {
    align: "center",
    show: true,
    fontSize: 14,
    color: "#000",
    fontWeight: "normal",
  },
  compareName: {
    name1: "环比",
    name2: "同比",
    fontSize: 14,
    color: "#000",
    fontWeight: "normal",
  },
  compareValue: {
    format: "percent",
    decimalPlaces: 2,
    signal: true,
    fontSize: 14,
    fontWeight: "normal",
  },
};

export const imageContent = {
  title: "图片",
  base: {
    w: 6,
    h: 6,
    x: 0,
    y: 0,
    rotate: 0,
    backgroundColor: DEFAULT_COLOR,
    border: {
      borderWidth: 1,
      borderColor: "#fff",
    },
  },
  options: {
    style: {
      backgroundSize: "contain",
      opacity: 1,
      borderRadius: "0",
      sourceUrl: "",
    },
    dataset: null,
  },
};
export const progressContent = {
  title: "进度条",
  base: {
    w: 6,
    h: 6,
    x: 0,
    y: 0,
    rotate: 0,
    backgroundColor: DEFAULT_COLOR,
    border: {
      borderWidth: 1,
      borderColor: "#fff",
    },
  },
  options: {
    dataset: [
      {
        value: "0.6",
        name: "",
      },
    ],
    style: {
      whole: { background: "#1c76fd33", height: 6 },
      progress: { background: "#1C76FD", borderRadius: "0" },
      label: {
        position: "outer",
        fontFamily: DEFAULT_FONT,
        color: "#000",
        fontSize: "16",
        fontWeight: "normal",
      },
    },
  },
};
export const selectFilterContent = {
  title: "列表",
  base: {
    w: 2,
    h: 1,
    x: 0,
    y: 0,
    rotate: 0,
    backgroundColor: DEFAULT_COLOR,
    border: {
      borderWidth: 1,
      borderColor: "#fff",
    },
  },
  options: {
    style: {
      fontFamily: DEFAULT_FONT,
      fontSize: 14,
      fontWeight: "normal",
      color: "#000",
    },
    config: {
      operatType: "select", // 选择方式 select下拉
      mode: "single", // multiple 多选
    },
  },
};
export const dateFilterContent = {
  title: "日期",
  base: {
    w: 2,
    h: 1,
    x: 0,
    y: 0,
    rotate: 0,
    backgroundColor: DEFAULT_COLOR,
    border: {
      borderWidth: 1,
      borderColor: "#fff",
    },
  },
  options: {
    style: {
      fontFamily: DEFAULT_FONT,
      fontSize: 14,
      fontWeight: "normal",
      color: "#000",
    },
    config: {
      mode: DATE_FILTER_TYPE.RANGE, // range 时间范围，yearAndMonth：年月，singleDay：单日
    },
  },
};
export const numberFilterContent = {
  title: "日期",
  base: {
    w: 3,
    h: 1,
    x: 0,
    y: 0,
    rotate: 0,
    backgroundColor: DEFAULT_COLOR,
    border: {
      borderWidth: 1,
      borderColor: "#fff",
    },
  },
  options: {
    style: {
      fontFamily: DEFAULT_FONT,
      fontSize: 14,
      fontWeight: "normal",
      color: "#000",
    },
    config: {},
  },
};
