import type { FormSchemaGetter } from '#/adapter/form';

import { DictEnum } from '@vben/constants';

import { getDictOptions } from '#/utils/dict';

export const formSchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    fieldName: 'name',
    label: '油站名称',
    placeholder: '请输入油站名称',
  },
  {
    component: 'Input',
    fieldName: 'location',
    label: '地理位置',
    placeholder: '请输入地理位置',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.OIL_LOCATION_TYPE),
    },
    fieldName: 'oilLocationType',
    label: '位置类型',
    placeholder: '请选择位置类型',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.OIL_NETWORK_TYPE),
    },
    fieldName: 'oilNetworkType',
    label: '网络类型',
    placeholder: '请选择网络类型',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.OIL_MARKET_TYPE),
    },
    fieldName: 'marketType',
    label: '市场类型',
    placeholder: '请选择市场类型',
  },
  {
    component: 'DatePicker',
    componentProps: {
      type: 'date',
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
    },
    fieldName: 'openingDate',
    label: '开业日期',
    placeholder: '选择开业日期',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 2,
    },
    fieldName: 'totalArea',
    label: '油站总面积（㎡）',
    placeholder: '请输入油站总面积',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 2,
    },
    fieldName: 'frontArea',
    label: '前庭面积（㎡）',
    placeholder: '请输入前庭面积',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 2,
    },
    fieldName: 'stationBuildingArea',
    label: '站房面积（㎡）',
    placeholder: '请输入站房面积',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 2,
    },
    fieldName: 'convenienceStoreArea',
    label: '便利店面积（㎡）',
    placeholder: '请输入便利店面积',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 2,
    },
    fieldName: 'canopyArea',
    label: '雨棚面积（㎡）',
    placeholder: '请输入雨棚面积',
  },
  {
    component: 'RadioGroup',
    componentProps: {
      options: [
        { label: '有', value: 'true' },
        { label: '无', value: 'false' },
      ],
    },
    fieldName: 'mainSign',
    label: '主标牌',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.OIL_FIBER),
    },
    fieldName: 'internalFiber',
    label: '内网光纤',
    placeholder: '请选择内网光纤',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.OIL_FIBER),
    },
    fieldName: 'externalFiber',
    label: '外网光纤',
    placeholder: '请选择外网光纤',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 2,
    },
    fieldName: 'entranceWidth',
    label: '进口宽度（m）',
    placeholder: '请输入进口宽度',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 2,
    },
    fieldName: 'exitWidth',
    label: '出口宽度（m）',
    placeholder: '请输入出口宽度',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'speedBumpCount',
    label: '站内减速带数量（条）',
    placeholder: '请输入减速带数量',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.OIL_ADDED_SERVICE),
      clearable: true,
      multiple: true,
      collapseTags: true,
      collapseTagsTooltip: true,
    },
    fieldName: 'valueAddedServices',
    label: '增值服务',
  },

  // 消防配置
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'fireCabinets',
    label: '消防柜(个)',
    placeholder: '0',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'fireExtinguishers35kg',
    label: '35kg推车式灭火器(个)',
    placeholder: '0',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'fireExtinguishers4kg',
    label: '4kg干粉灭火器(个）',
    placeholder: '0',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'co2Extinguishers3kg',
    label: '3kg二氧化碳灭火器(个)',
    placeholder: '0',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'fireBlankets',
    label: '玻璃纤维灭火毯(张)',
    placeholder: '0',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'fireSandBuckets',
    label: '消防沙桶(个)',
    placeholder: '0',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'fireSandPits',
    label: '消防沙池(个)',
    placeholder: '0',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 2,
    },
    fieldName: 'fireSandVolume',
    label: '消防沙(m³)',
    placeholder: '0',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'fireHydrants',
    label: '消水栓(个)',
    placeholder: '0',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'fireHoses',
    label: '消防水带(盘)',
    placeholder: '0',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'fireHydrantWrenches',
    label: '消水栓扳手(个)',
    placeholder: '0',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'fireHydrantNozzles',
    label: '消水栓水枪(只)',
    placeholder: '0',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'fireShovels',
    label: '消防铲(把)',
    placeholder: '0',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'fireHammers',
    label: '消防锤(把)',
    placeholder: '0',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'fireEmergencyLights',
    label: '消防应急灯(个)',
    placeholder: '0',
  },
  {
    component: 'InputNumber',
    componentProps: {
      min: 0,
      precision: 0,
    },
    fieldName: 'explosionProofFlashlights',
    label: '防爆手电筒(个)',
    placeholder: '0',
  },
  {
    component: 'Input',
    componentProps: {
      type: 'textarea',
      rows: 4,
    },
    fieldName: 'specialNotes',
    label: '特殊备注',
    placeholder: '请输入特殊备注',
    span: 24,
  },
];
