import { BasicColumn, FormSchema } from '@/components/Table';

export const indexColumns: BasicColumn[] = [
    {
        title: 'id',
        dataIndex: 'id',
        ifShow: false,
    },
    {
        title: '服务名称',
        dataIndex: 'serverName',
        width: 100,
    },
    {
        title: '数据表名',
        dataIndex: 'dataTable',
        width: 100,
    },
    {
        title: '服务地址',
        dataIndex: 'serverUrl',
        ifShow: false,
        width: 150,
    },
    {
        title: '空间参考',
        dataIndex: 'spatialRef',
        width: 80,
    },
    {
        title: '数据源类型',
        dataIndex: 'dataSourceType',
        ifShow: false,
        width: 100,
    },
    {
        title: '数据类型',
        dataIndex: 'dataType',
        width: 40,
    },
    {
        title: 'shp或者xls地址',
        dataIndex: 'shpPath',
        ifShow: false,
        width: 120,
    },
    {
        title: '图层样式地址',
        dataIndex: 'appendPath',
        ifShow: false,
        width: 120,
    },
    {
        title: '创建时间',
        dataIndex: 'createTime',
        width: 100,
    },
    {
        title: '修改时间',
        dataIndex: 'updateTime',
        width: 100,
    },
];

export const indexSearchFormSchema: FormSchema[] = [
    {
        field: 'SererName',
        label: '服务名称',
        component: 'Input',
        colProps: { span: 12 },
    },
];


export const headersColumns: BasicColumn[] = [
    {
        title: '原始字段名称',
        dataIndex: 'name',
        width: 120,
    },
    {
        title: '数据类型',
        dataIndex: 'type',
        width: 200,
    },
    {
        title: '数据长度',
        dataIndex: 'length',
        width: 80,
    },
    {
        title: '字段名',
        dataIndex: 'refName',
        width: 200,
    },
    {
        title: '字段描述',
        dataIndex: 'initName',
        width: 120,
    },
    {
        title: '',
        dataIndex: 'propType',
        ifShow: false,
    },
    {
        title: '操作',
        dataIndex: 'action',
        width: 120,
    },
];

export const headersSearchFormSchema: FormSchema[] = [
    {
        field: 'name',
        label: '原始字段名称',
        component: 'Input',
        colProps: { span: 12 },
    },
];

export const items_shp = [
    {
        title: '文件上传',
        description: '选择ShpFile格式模板文件并配置服务基础信息',
    },
    {
        title: '信息配置',
        description: '根据中文字段名称配置英文注释用于服务发布',
    },
    {
        title: '创建完成',
        description: '服务创建完成在服务列表中查看服务',
    },
];

export const items_excel = [
    {
        title: '文件上传',
        description: '选择ShpFile格式模板文件并配置服务基础信息',
    },
    {
        title: '创建完成',
        description: '服务创建完成在服务列表中查看服务',
    },
];

export const servicesColumns: BasicColumn[] = [
    {
        title: '地址',
        dataIndex: 'url',
        width: 220,
    },
    {
        title: '操作',
        dataIndex: 'action',
        width: 40,
    },
];

export const MAPBOX_TOKEN = "pk.eyJ1IjoiemhhbmcxMjM4ODk5OSIsImEiOiJja3N5Ync1cXcyMTR2Mm9xempmbGE4MnBtIn0.R-j78CRvbs6JZG-MDSoh8Q";

export const TINADITU_TOKEN = "b6585bc41ee16251dbe6b1af64f375d9";

export const defaultPaint = {
    'fill-opacity': 1,
    'fill-color': [
        'case',
        ['==', ['get', 'dlbm'], '0602'],
        '#30123b',
        ['==', ['get', 'dlbm'], '1004'],
        '#38266a',
        ['==', ['get', 'dlbm'], '0701'],
        '#3e3892',
        ['==', ['get', 'dlbm'], '1107A'],
        '#424ab4',
        ['==', ['get', 'dlbm'], '08H2A'],
        '#455dd0',
        ['==', ['get', 'dlbm'], '0601'],
        '#476de5',
        ['==', ['get', 'dlbm'], '1003'],
        '#467ef5',
        ['==', ['get', 'dlbm'], '0809'],
        '#448ffe',
        ['==', ['get', 'dlbm'], '0810'],
        '#3c9ffd',
        ['==', ['get', 'dlbm'], '1107'],
        '#31aff5',
        ['==', ['get', 'dlbm'], '0305'],
        '#26bfe8',
        ['==', ['get', 'dlbm'], '0810A'],
        '#1cced7',
        ['==', ['get', 'dlbm'], '0201'],
        '#18dbc6',
        ['==', ['get', 'dlbm'], '0103'],
        '#1be5b5',
        ['==', ['get', 'dlbm'], '1101'],
        '#27eea4',
        ['==', ['get', 'dlbm'], '1007'],
        '#3af490',
        ['==', ['get', 'dlbm'], '08H1'],
        '#52fa7a',
        ['==', ['get', 'dlbm'], '1005'],
        '#6bfe64',
        ['==', ['get', 'dlbm'], '08H2'],
        '#85ff51',
        ['==', ['get', 'dlbm'], '1104'],
        '#9bfe41',
        ['==', ['get', 'dlbm'], '1206'],
        '#adfb38',
        ['==', ['get', 'dlbm'], '1106'],
        '#bef434',
        ['==', ['get', 'dlbm'], '1006'],
        '#ceeb34',
        ['==', ['get', 'dlbm'], '0702'],
        '#dde037',
        ['==', ['get', 'dlbm'], '0404'],
        '#ead439',
        ['==', ['get', 'dlbm'], '0307'],
        '#f4c73a',
        ['==', ['get', 'dlbm'], '0204'],
        '#fbb938',
        ['==', ['get', 'dlbm'], '0301'],
        '#fea933',
        ['==', ['get', 'dlbm'], '05H1'],
        '#fe972b',
        ['==', ['get', 'dlbm'], '1202'],
        '#fc8323',
        ['==', ['get', 'dlbm'], '1109'],
        '#f76f1a',
        ['==', ['get', 'dlbm'], '0102'],
        '#f15c13',
        ['==', ['get', 'dlbm'], '1103'],
        '#e84b0c',
        ['==', ['get', 'dlbm'], '0101'],
        '#de3e08',
        ['==', ['get', 'dlbm'], '09'],
        '#d23105',
        ['==', ['get', 'dlbm'], '1001'],
        '#c42503',
        ['==', ['get', 'dlbm'], '0508'],
        '#b31b01',
        ['==', ['get', 'dlbm'], '1104A'],
        '#a11201',
        ['==', ['get', 'dlbm'], '0302'],
        '#8d0a01',
        '#7a0403',
    ],
    'fill-outline-color': '#232323',
};

export const defaultPaint2 = {
    'fill-opacity': 0.1,
    'fill-color': '#ffffff',
    'fill-outline-color': '#ffff30',
};

export const geoserverCodeValue = [
    {
      code: '0307',
      value: '其他林地',
    },
    {
      code: '0602',
      value: '采矿用地',
    },
    {
      code: '08H1',
      value: '机关团体新闻出版用地',
    },
    {
      code: '1109',
      value: '水工建筑用地',
    },
    {
      code: '0701',
      value: '城镇住宅用地',
    },
    {
      code: '1104',
      value: '坑塘水面',
    },
    {
      code: '1103',
      value: '水库水面',
    },
    {
      code: '1104A',
      value: '养殖坑塘',
    },
    {
      code: '1107A',
      value: '干渠',
    },
    {
      code: '0102',
      value: '水浇地',
    },
    {
      code: '1107',
      value: '沟渠',
    },
    {
      code: '0201',
      value: '果园',
    },
    {
      code: '1003',
      value: '公路用地',
    },
    {
      code: '08H2',
      value: '科教文卫用地',
    },
    {
      code: '1101',
      value: '河流水面',
    },
    {
      code: '1004',
      value: '城镇村道路用地',
    },
    {
      code: '09',
      value: '特殊用地',
    },
    {
      code: '0809',
      value: '公用设施用地',
    },
    {
      code: '0702',
      value: '农村宅基地',
    },
    {
      code: '1202',
      value: '设施农用地',
    },
    {
      code: '1006',
      value: '农村道路',
    },
    {
      code: '1005',
      value: '交通服务场站用地',
    },
    {
      code: '0301',
      value: '乔木林地',
    },
    {
      code: '0404',
      value: '其他草地',
    },
    {
      code: '0305',
      value: '灌木林地',
    },
    {
      code: '1001',
      value: '铁路用地',
    },
    {
      code: '0204',
      value: '其他园地',
    },
    {
      code: '0101',
      value: '水田',
    },
    {
      code: '0103',
      value: '旱地',
    },
    {
      code: '1106',
      value: '内陆滩涂',
    },
    {
      code: '0601',
      value: '工业用地',
    },
    {
      code: '1007',
      value: '机场用地',
    },
    {
      code: '0508',
      value: '物流仓储用地',
    },
    {
      code: '0810A',
      value: '广场用地',
    },
    {
      code: '1206',
      value: '裸土地',
    },
    {
      code: '08H2A',
      value: '高教用地',
    },
    {
      code: '05H1',
      value: '商业服务业设施用地',
    },
    {
      code: '0302',
      value: '竹林地',
    },
    {
      code: '0810',
      value: '公园与绿地',
    },
  ];
	
