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

export const option = {
  textColors: ['#FFFFFF','#FFFFFF'],
  textSize: [11,10],
  backgroundColors: ["#05231A","#0A392A","#06281D","#00611A"],
  headerData:["乡镇/村庄","护林员姓名","在线状态","离线时长"],
  dataset: [
    { TownName: '探沂镇' , Name: '刘磊', State: '在线', OnLineTime: 10, Lng: '118.042384', Lat: '35.41264', CreateId: '11' },
    { TownName: '梁邱镇' , Name: '邵泽兰', State: '离线', OnLineTime: 10, Lng: '118.142384', Lat: '35.21264', CreateId: '22' },
    { TownName: '马庄镇' , Name: '邵泽兰', State: '在线', OnLineTime: 10 },
    { TownName: '探沂镇' , Name: '邵泽兰', State: '在线', OnLineTime: 10 },
    { TownName: '梁邱镇' , Name: '邵泽兰', State: '离线', OnLineTime: 10 },
    { TownName: '探沂镇' , Name: '邵泽兰', State: '离线', OnLineTime: 10 },
    { TownName: '马庄镇' , Name: '邵泽兰', State: '离线', OnLineTime: 10 },
    { TownName: '探沂镇' , Name: '邵泽兰', State: '在线', OnLineTime: 10 },
    { TownName: '探沂镇' , Name: '邵泽兰', State: '在线', OnLineTime: 10 },
  ],
}

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