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

const { source } = dataJson;

export const option = {
  dataset: source,
  dataStyle: {
    searchPaddingTop: 25,
    searchPaddingLeft: 20,
    searchInputWidth: 303,
    searchButtonWidth: 57,
    searchDivHeight: 35,

    buttonPaddingTop: 20,
    buttonPaddingLeft: 20,
    buttonDivHeight: 37,
    buttonLeftIconColor: '#',
    buttonLeftFontColor: '#58FF95',
    buttonLeftFontSize: 20,
    buttonRightFontColor: '#FFFFFF',
    buttonRightFontSize: 16,
    buttonRightIconColor: '#57FF94',
    buttonRightIconSize: 20,

    listMarginTop: 20,
    listMarginBottom: 30,
    listPaddingLeft: 20,
    listWidth: 356,
    listHeight: 105,
    listbottom: 5,

    titleColor: '#ffffff',
    titleFontSize: 20,
    typeColor: '#FA521D',
    typeFontSize: 16,
    positionColor: '#ffffff',
    positionFontSize: 16,
    timeColor: '#ffffff',
    timeFontSize: 16,

    sortOrder: '1',

    backColorList : [
      {label: 'type', value: '特大火情' , color: '#F01919'},
      {label: 'title', value: '手机上报' , color: '#19F0D1'},
    ],
    filedColorList : [
      {label: 'type', value: '特大火情' , color: '#F01919'},
      {label: 'title', value: '手机上报' , color: '#19F0D1'},
    ]
  }
}

export default class Config extends PublicConfigClass implements CreateComponentType {
  public key = HuoQingListConfig.key
  public attr = { ...chartInitConfig, w: 400, h: 800, zIndex: -1 }
  public chartConfig = cloneDeep(HuoQingListConfig)
  public option = cloneDeep(option)
  public request = { ...requestSqlConfig, requestSQLContent: { sql: "SELECT \"Id\", \"Describe\" as title, \"DegreeType\" as type, \"Address\" as position, \"ReportTime\" as time, \"Lng\" as lng, \"Lat\" as lat FROM fm_fireclueinfo WHERE \"SourceType\" = 3" }, }
  public filter = "return res.result;"
}
