export const addressTypeOptions = [
  { label: '常规地址', value: '常规地址' },
  { label: '港口/码头', value: '港口/码头' },
  { label: '铁路车站', value: '铁路车站' },
  { label: '空港机场', value: '空港机场' },
];

export const createOption = () => ({
  height: 'auto',
  calcHeight: 32,
  dialogWidth: 980,
  labelPosition: 'right',
  labelWidth: 'auto',
  tip: false,
  searchShow: true,
  searchMenuSpan: 24,
  searchIcon: true,
  searchIndex: 4,
  searchMenuPosition: 'right',
  border: true,
  index: true,
  indexLabel: '序号',
  indexWidth: 70,
  selection: true,
  viewBtn: false,
  editBtn: false,
  delBtn: false,
  addBtn: false,
  dialogClickModal: false,
  menuFixed: 'right',
  menuWidth: 180,
  column: [
    {
      label: '地址名称',
      prop: 'addressName',
      search: true,
      searchOrder: 8,
      span: 24,
      minWidth: 150,
      showOverflowTooltip: true,
      placeholder: '请输入',
      maxlength: 100,
      showWordLimit: true,
      rules: [
        { required: true, message: '请输入地址名称', trigger: 'blur' },
        { max: 100, message: '地址名称不能超过100个字', trigger: 'blur' },
      ],
    },
    {
      label: '地址编号',
      prop: 'addressCode',
      minWidth: 120,
      addDisplay: false,
      editDisplay: false,
    },
    {
      label: '类型',
      prop: 'addressType',
      type: 'select',
      formslot: true,
      search: true,
      searchOrder: 7,
      span: 24,
      minWidth: 140,
      dicData: addressTypeOptions,
      rules: [{ required: true, message: '请选择类型', trigger: 'change' }],
    },
    {
      label: '站点编码',
      prop: 'siteCodeDisplay',
      search: false,
      minWidth: 120,
      addDisplay: false,
      editDisplay: false,
    },
    {
      label: '详细地址',
      prop: 'detailAddress',
      search: true,
      searchOrder: 5,
      formslot: true,
      type: 'textarea',
      minRows: 3,
      span: 24,
      minWidth: 220,
      showOverflowTooltip: true,
      rules: [
        { required: true, message: '请输入详细地址', trigger: 'blur' },
        { max: 255, message: '详细地址不能超过255个字', trigger: 'blur' },
      ],
    },
    {
      label: '经度',
      prop: 'longitude',
      minWidth: 120,
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
    },
    {
      label: '纬度',
      prop: 'latitude',
      minWidth: 120,
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
    },
    {
      label: '行政区划',
      prop: 'regionName',
      search: true,
      searchOrder: 4,
      display: false,
      minWidth: 150,
      rules: [{ required: true, message: '请选择行政区划', trigger: 'change' }],
    },
    {
      label: '联系人',
      prop: 'contactName',
      search: true,
      searchOrder: 2,
      minWidth: 110,
      placeholder: '请输入',
      maxlength: 50,
      rules: [{ max: 50, message: '联系人不能超过50个字', trigger: 'blur' }],
    },
    {
      label: '联系方式',
      prop: 'contactPhone',
      search: true,
      searchOrder: 1,
      minWidth: 130,
      placeholder: '请输入',
      maxlength: 20,
      rules: [{ max: 20, message: '联系方式不能超过20个字', trigger: 'blur' }],
    },
    {
      label: '组织',
      prop: 'deptName',
      minWidth: 150,
      addDisplay: false,
      editDisplay: false,
    },
    {
      label: '备注',
      prop: 'remark',
      type: 'textarea',
      minRows: 4,
      span: 24,
      minWidth: 160,
      overHidden: true,
      showOverflowTooltip: true,
      placeholder: '请输入',
      maxlength: 200,
      showWordLimit: true,
      rules: [{ max: 200, message: '备注不能超过200个字', trigger: 'blur' }],
    },
    {
      label: '更新时间',
      prop: 'updateTime',
      sortable: true,
      type: 'datetime',
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      width: 180,
      addDisplay: false,
      editDisplay: false,
    },
    {
      label: '创建时间',
      prop: 'createTime',
      sortable: true,
      type: 'datetime',
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      width: 180,
      addDisplay: false,
      editDisplay: false,
    },
    {
      label: '港口',
      prop: 'portId',
      formslot: true,
      hide: true,
      display: false,
      span: 12,
      rules: [{ required: true, message: '请选择港口', trigger: 'change' }],
    },
    {
      label: '码头',
      prop: 'terminalId',
      formslot: true,
      hide: true,
      display: false,
      span: 12,
      rules: [{ required: true, message: '请选择码头', trigger: 'change' }],
    },
    {
      label: '车站名称',
      prop: 'stationId',
      formslot: true,
      hide: true,
      display: false,
      span: 24,
      rules: [{ required: true, message: '请选择车站名称', trigger: 'change' }],
    },
    {
      label: '机场标准名称',
      prop: 'airportId',
      formslot: true,
      hide: true,
      display: false,
      span: 24,
      rules: [{ required: true, message: '请选择机场标准名称', trigger: 'change' }],
    },
    {
      label: '站点编码',
      prop: 'siteCode',
      search: true,
      searchOrder: 6,
      hide: true,
      addDisplay: false,
      editDisplay: false,
    },
    {
      label: '组织',
      prop: 'deptId',
      type: 'select',
      search: true,
      searchOrder: 3,
      hide: true,
      display: false,
      dicData: [],
    },
  ],
});
