import dayjs from 'dayjs';

export const columns = [
  {
    title: 'ID',
    dataIndex: 'id',
    ifShow: false,
  },
  {
    title: '名称',
    dataIndex: 'name',
    width: 80,
  },
  {
    title: '云查询分类',
    dataIndex: 'code',
    width: 90,
  },
  {
    title: '图层',
    dataIndex: 'layer',
    width: 150,
  },
  {
    title: '图层区县',
    dataIndex: 'countyName',
    width: 100,
  },
  {
    title: '数据表',
    dataIndex: 'tableName',
    // width: 120,
  },
  {
    title: '叠加图层',
    dataIndex: 'overlayList',
    width: 200,
  },
  {
    title: '是否分类',
    dataIndex: 'isClass',
    width: 80,
  },
  {
    title: '分类字段',
    dataIndex: 'classField',
    width: 100,
  },
  {
    title: '分类名称',
    dataIndex: 'className',
    width: 100,
  },
  {
    title: '选择面积计算字段',
    dataIndex: 'areaField',
    // width: 100,
  },
  {
    title: '是否合计',
    dataIndex: 'isSum',
    width: 80,
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    // width: 100,
  }
];

export const emptyTreeItem = {
  itemName: '',
  itemValue: '',
};
export const emptyTableItem = {
  id: '',
  name: '',
  layer: undefined,
  tableName: '',
  overlayList: ['天地图'],
  isClass: false,
  classField: undefined,
  className: undefined,
  areaField: undefined,
  isSum: false,
};

export const searchFormSchema_1 = [
  {
    field: 'key',
    label: '名称',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: '[StartTime, EndTime]',
    label: '日期范围',
    component: 'RangePicker',
    colProps: { span: 8 },
    componentProps: {
      format: 'YYYY-MM-DD',
      placeholder: ['开始日期', '结束日期'],
    },
  },
];

export const searchFormSchema_2 = [
  {
    field: 'key',
    label: '名称',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: '[StartTime, EndTime]',
    helpMessage: '查询范围只包含时序影像大类',
    label: '日期范围',
    component: 'RangePicker',
    colProps: { span: 8 },
    componentProps: {
      format: 'YYYY-MM-DD',
      placeholder: ['开始日期', '结束日期'],
    },
  },
];
