import cloneDeep from 'lodash/cloneDeep'
import { PublicConfigClass } from '@/packages/public'
import { CreateComponentType } from '@/packages/index.d'
import { chartInitConfig } from '@/settings/designSetting'
import { TableFilterConfig } from './index'
import dataJson from './data.json'

const {header, source, filterset} = dataJson;

export const option = {
  header: header,
  dataset: source,
  filterset: filterset,
  dataStyle: {
    colLeft: 4,

    filterMarginTop: 20,
    filterMarginLeft: 50,
    filterItemHeight: 45,

    filterTitleAlign: 'left',
    filterTitleFontSize: 24,
    filterTitleFontColor: '#ADFFC0',

    filterContentAlign: 'left',
    filterChooseFontSize: 18,
    filterChooseFontColor: '#FFFFFF',

    tableMarginTop: 20,
    tableMarginLeft: 20,
    tableBordered: false,
    tableSigleColumn: true,
    tableSingleLine: true,
    tableStriped: false,
    tableSize: 'small',
    tableAlign: 'center',
    // 表头
    tableHeaderShow: false,
    // 序号
    orderBumberShow: false,
    // 操作
    buttonDivShow: true,
    buttonDivShow1: true,
    buttonDivShow2: true,
    buttonWidth: 22,
    buttonHeight: 22,
    // 宽度
    orderDivWidth: 50,
    buttonDivWidth: 100,
    // 字体
    tableHeaderBackgroud: '#FFFFFF',
    tableHeaderFontSize: 20,
    tableHeaderFontColor: '#000000',

    tableDataBackgroudShow: false,
    tableDataBackgroud: '#FFFFFF',
    tableDataFontSize: 20,
    tableDataFontColor: '#FFFFFF',
  },
}

export default class Config extends PublicConfigClass implements CreateComponentType {
  public key = TableFilterConfig.key
  public attr = { ...chartInitConfig, w: 1060, h: 570, zIndex: -1 }
  public chartConfig = cloneDeep(TableFilterConfig)
  public option = cloneDeep(option)
}
