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

const { typeOptions, source } = dataJson;

export const option = {
  type: typeOptions[0].value,
  typeOptions: typeOptions,
  dataset: source,
  dataStyle: {
    backgroud: '#FFFFFF00',
    typeColor1: '#FFC600',
    typeTitle1: '已处置',
    typeColor2: '#08B47A',
    typeTitle2: '总数',
    typeFontColor: '#FFFFFF',
    typeFontSize: 13,

    listTitlePathStrokeColor: '#049D73',
    listTitlePathFillColor: '#05A074',
    listTitlePathStrokeColor2: '#049D72',
    listTitleRectFillColor: '#05A074',
    listTypePathStrokeColor: '#06A475',
    listTypePathFillColor: '#FFFFFF00',
    listTypeRactFillColor: '#06A475',

    fontSize1: 13,
    fontSize2: 10,
    fontSize3: 13,
    fontColor1: '#FFFFFF',
    fontColor2: '#FFFFFF',
    fontColor3: '#FFFFFF',
    sortOrder: "0",

    typeTop: 5,
    listTop: 5,
    listLeft: 15,
    listTitleWidth: 106,
    listTitleHeight: 30,
    listProgressHeight: 15,
    listTypeWidth: 66,
    listTypeHeight: 30,
  },
}

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