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

const { source } = dataJson;

export const option = {
  dataset: source,
  dataStyle: {
    margintop: 10,
    marginbottom: 20,
    marginleft: 20,
    marginright: 20,
    listWidth: 360,
    listHeight: 110,
    titleColor: '#ffffff',
    titleFontSize: 20,
    typeColor: '#FA521D',
    typeFontSize: 16,
    positionColor: '#ffffff',
    positionFontSize: 16,
    timeColor: '#ffffff',
    timeFontSize: 16,
    listMarginbottom: 0,
    sortOrder: '1'
  }
}

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