import { PublicConfigClass } from '@/packages/public';
import { CreateComponentType } from '@/packages/index.d';
import { MapPlotHistoryConfig } from './index';
import cloneDeep from 'lodash/cloneDeep';
import dataJson from './data.json';
import { getAppEnvConfig } from '@/utils/env';

const { VITE_GLOB_API_URL } = getAppEnvConfig();

export const option = {
  dataset: { ...dataJson },
};

export default class Config extends PublicConfigClass implements CreateComponentType {
  public key = MapPlotHistoryConfig.key;
  public chartConfig = cloneDeep(MapPlotHistoryConfig);
  public option = cloneDeep(option);
  constructor() {
    super();
    this.attr.w = 546;
    this.attr.h = 748;
    this.request.requestDataType = 1;
    this.request.requestHttpType = 'post';
    this.request.requestUrl = VITE_GLOB_API_URL + '/api/FireResources/GetDataBySql';
    this.request.requestSQLContent.sql = 'select * from  zg_meirishangbaoshuliangtongji';
    this.filter = 'return res.result';
  }
}
