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

const {header, source} = dataJson;

export const option = {
  header: header,
  dataset: source,
  dataStyle: {
    colLeft: 4,
    mapListValue: ['water', 'goods', 'barrack'],
    buttonValue: '0',
    distanceradio: '1',

    // 筛选项
    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,
    tableSize: 'small',
    tableAlign: 'center',
    // 表头
    tableHeaderShow: false,
    // 序号
    tableOrderBumberShow: false,
    // 操作
    tableButtonDivShow: true,
    tableButtonWidth: 22,
    tableButtonHeight: 22,
    // 宽度
    tableOrderDivWidth: 50,
    tableButtonDivWidth: 100,
    // 字体
    tableHeaderBackgroud: '#FFFFFF',
    tableHeaderFontSize: 20,
    tableHeaderFontColor: '#000000',
    tableDataFontSize: 20,
    tableDataFontColor: '#FFFFFF',

    // 物资-队列
    goodsMarginTop: 20,
    goodsMarginLeft: 20,
    goodsDivMarginTop: 20,
    goodsDivMarginLeft: 20,
    // 标题
    goodsTitleFontSize1: 18,
    goodsTitleFontColor1: '#FFFFFF',
    goodsTitleFontSize2: 14,
    goodsTitleFontColor2: '#FFFFFF',
    goodsTitleFontSize3: 16,
    goodsTitleFontColor3: '#FFFFFF',
    // 按钮
    goodsButtonBackgroud: '#409EFF',
    goodsButtonFontSize: 16,
    goodsButtonFontColor: '#FFFFFF',
    // 线
    goodsLineStartColor: '#4DFFB5',
    goodsLineEndColor: '#0B4D2C',
    // text
    goodsTextFontSize: 16,
    goodsTextFontColor: '#FFFFFF',

    // 营房-队列
    barrackMarginTop: 20,
    barrackMarginLeft: 20,
    barrackDivMarginTop: 20,
    barrackDivMarginLeft: 20,
    // 标题
    barrackTitleFontSize1: 18,
    barrackTitleFontColor1: '#FFFFFF',
    barrackTitleFontSize2: 14,
    barrackTitleFontColor2: '#FFFFFF',
    barrackTitleFontSize3: 16,
    barrackTitleFontColor3: '#FFFFFF',
    // 按钮
    barrackButtonBackgroud: '#409EFF',
    barrackButtonFontSize: 16,
    barrackButtonFontColor: '#FFFFFF',
    // 线
    barrackLineStartColor: '#4DFFB5',
    barrackLineEndColor: '#0B4D2C',
    // text
    barrackTextFontSize: 16,
    barrackTextFontColor: '#FFFFFF',
  },
}

export default class Config extends PublicConfigClass implements CreateComponentType {
  public key = ZhiChu_ModalTableConfig.key
  public attr = { ...chartInitConfig, w: 1060, h: 570, zIndex: -1 }
  public chartConfig = cloneDeep(ZhiChu_ModalTableConfig)
  public option = cloneDeep(option)
  public filter = "return res.result;"
}
