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

const { typeOptions, source } = dataJson;

export const option = {
  type: typeOptions[0].value,
  typeOptions: typeOptions,
  typeStyle: {
    typeColor1: '#FFC600',
    typeTitle1: '已处置',
    typeColor2: '#08B47A',
    typeTitle2: '总数',
    typeFontColor: '#FFFFFF',
    typeFontSize: 16,
  },
  dataset: source,
  dataStyle: {
    fontSize1: 13,
    fontSize2: 10,
    fontSize3: 13,
    fontColor1: '#FFFFFF',
    fontColor2: '#FFFFFF',
  }
}

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