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

export const option = {
  colors: ['#457453', '#00611A', '#00CC13', '#C9FFC7'],
  titleColor: '#CBE6CD',
  titleSize: 15,
  desColor: '#FFFFFF',
  desSize: 15,
  dataset: {
    data: [
      {
        title: '预警描述',
        desc: '费县马庄镇牛田村村委东北方向375.75° 1.197公里处发现火情',
      },
      {
        title: '水平角',
        desc: '375.75°',
      },
      {
        title: '俯视角',
        desc: '98.5°',
      },
      {
        title: '经纬度',
        desc: '117.90911,3012349',
      },
      {
        title: '预警时间',
        desc: '2024.12.24 13:08:07',
      },
      {
        title: '线索来源',
        desc: '无人机上报',
      },
    ],
    imgArr: [
      '@/assets/images/chart/tasks/bannerimg1.png',
      '@/assets/images/chart/tasks/bannerimg1.png',
      '@/assets/images/chart/tasks/bannerimg1.png',
    ],
  },
  primaryKey: 'id',
  showColumns: [
    {
      type: 'text',
      en_name: 'ReportPerson',
      zh_name: '人员名称',
    },
    {
      type: 'text',
      en_name: 'ReportTime',
      zh_name: '上报时间',
    },
    {
      type: 'text',
      en_name: 'Describe',
      zh_name: '火情描述',
    },
    {
      type: 'text',
      en_name: 'Address',
      zh_name: '位置地点',
    },
  ],
};

export default class Config extends PublicConfigClass implements CreateComponentType {
  public key = TaskBannerConfig.key;
  public attr = { ...chartInitConfig, w: 400, h: 527, zIndex: 1 };
  public chartConfig = cloneDeep(TaskBannerConfig);
  public option = cloneDeep(option);
  public request = {
    ...requestSqlConfig,
    requestSQLContent: {
      sql: 'update fm_fireclueinfo set "status" = #{Status} where "Id" = #{Id}',
    },
  };
  public filter = 'return res.result;';
}
