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

export const option = {
  dataset: [
    [
      {
        title: '防火通道',
        color: '#1A1775',
        lineWidth: 40,
        lineHeight: 3,
        borderColor: '#1A1775',
        borderWidth: 0,
      },
      {
        title: '三轮车道',
        color: '#537DFF',
        lineWidth: 40,
        lineHeight: 3,
        borderColor: '#537DFF',
        borderWidth: 0,
      },
      {
        title: '步行道',
        color: '#9B9B95',
        lineWidth: 40,
        lineHeight: 3,
        borderColor: '#9B9B95',
        borderWidth: 0,
      },
      {
        title: '生态隔离网',
        color: '#AE0022',
        lineWidth: 40,
        lineHeight: 3,
        borderColor: '#AE0022',
        borderWidth: 0,
      },
      {
        title: '针叶林',
        color: '#B0DE8A',
        lineWidth: 40,
        lineHeight: 10,
        borderColor: '#43A939',
        borderWidth: 2,
      },
    ],
    [
      {
        title: '水源',
        url: '@/assets/images/chart/zhichu/component/TuLi_ShuiYuan.png',
        imageWidth: 35,
        imageHeight: 35,
      },
      {
        title: '物资',
        url: '@/assets/images/chart/zhichu/component/TuLi_WuZi.png',
        imageWidth: 35,
        imageHeight: 35,
      },
      {
        title: '营房',
        url: '@/assets/images/chart/zhichu/component/TuLi_YingFang.png',
        imageWidth: 35,
        imageHeight: 35,
      },
      {
        title: '山体标注',
        url: '@/assets/images/chart/zhichu/component/TuLi_ShanTi.png',
        imageWidth: 35,
        imageHeight: 35,
      },
      {
        title: '生态隔离网',
        url: '@/assets/images/chart/zhichu/component/TuLi_ShengTai.png',
        imageWidth: 35,
        imageHeight: 35,
      },
    ],
  ],
  dataStyle:{    
    backgroud: '#FFFFFF00',
    marginTop: 10,
    marginLeft: 20,

    name: '图例',
    nameHeight: 30,
    nameSpanWidth: 58,
    nameFontColor1: '#ffffff',
    nameFontColor2: '#019042',
    nameFontSize: 20,

    nameBorderWidth: 1,
    nameBorderColor: '#FFFFFF9E',
    nameFontBorderDistance: 10,

    tupianMarginTop: 5,
    tupianHeight: 35,
    tupianWidth: 180,

    // 线图的宽长，调节则调节全部
    lineLeftWidth: 40,
    lineLeftHeight: 5,
    imageLeftWidth: 35,
    imageLeftHeight: 35,

    titleMarginLeft: 10,
    titleFontColor: '#FFFFFF',
    titleFontSize: 16,
  },
}

export default class Config extends PublicConfigClass implements CreateComponentType {
  public key = ZhiChu_TuLiConfig.key
  public attr = { ...chartInitConfig, w: 400, h: 260, zIndex: -1 }
  public chartConfig = cloneDeep(ZhiChu_TuLiConfig)
  public option = cloneDeep(option)
  public filter = "return res.result;"
}