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

const { source } = dataJson;

export const option = {
  dataset: source,
  dataStyle: {
    backgroud: '#FFFFFF00',
    margintop: 15,
    marginleft: 20,
    gap: 16,

    iconColor1: '#B8FDB4',
    iconColor2: '#60EC8D',
    topWidth: 80,
    topHeight: 80,
    rectStrokeColor: '#00611A',
    rectFillColor: '#0A251E',
    gFillColor: '#4FE985',

    bottomFontColor1: '#A4F9AB',
    bottomFontSize1: 20,
    bottomFontColor2: '#FFFFFF',
    bottomFontSize2: 12,
    lineColor: '#A4F9AB',
    lineFontSize: 12,
    bottomFontColor3: '#FFFFFF',
    bottomFontSize3: 12,
    bottomMarginTop: 16,
    bottomWidth: 80,
    bottomHeight: 80 * 97 / 71,

    bottomLineColor1: '#337D4E',
    bottomLineColor2: '#2D593B',
    bottomComponentColor1: '#6FEF94',
    bottomComponentColor2: '#A8F8C6',
  },
}

export default class Config extends PublicConfigClass implements CreateComponentType {
  public key = ZhiGan_WuRenJiFeiXingShuJuConfig.key
  public attr = { ...chartInitConfig, w: 400, h: 240, zIndex: -1 }
  public request = { ...requestSqlConfig, requestSQLContent: { sql: 'select * from zg_wurenjifeixinghuamian' }, }
  public filter = "return res.result;"
  public chartConfig = cloneDeep(ZhiGan_WuRenJiFeiXingShuJuConfig)
  public option = cloneDeep(option)
}
