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

const { source, header } = dataJson;

export const option = {
  header: header,
  dataset: source,
  dataStyle:{
    backgroud: '#FFFFFF00',
    marginTop: 10,
    marginLeft: 20,
    listMarginTop: 0,
    listMarginLeft: 0,

    titleDotColor: '#C9FFC7',
    titleDotSize: 12,
    titleDotMarginRight: 10,
    titleWidth: 100,
    titleHeight: 20,
    titleFontcolor: '#CBE6CD',
    titleFontsize: 16,
    titleAlign: 'left',

    contentWidth: 250,
    contentFontcolor: '#FFFFFF',
    contentFontsize: 16,
    contentAlign: 'left',
  }
}

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