/*
 *    Copyright (c) 2018-2025, cyweb All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 */

export const userTypeDict=[
  {
    label:'教职工',
    value:'1'
  },
  {
    label:'驻校人员',
    value:'3'
  },
  {
    label:'二期驻校单位',
    value:'5'
  },
  //todo userType校准
  {
    label:'访客',
    value:'9'
  },
  {
    label:'未匹配',
    value:'10'
  },
  {
    label:'临时车牌',
    value:'临时车牌'
  },
]
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  editBtn: true,
  delBtn: false,
  addBtn: false,
  menu:true,
  dic: [],
  column: [
    {
      label: '照片',
      prop: 'img',
      labelWidth:120,
      slot: true,
      editDisplay: false,
    },
    {
      label: '抓拍时间',
      labelWidth:120,
      prop: 'createTime',
      editDisplay: false
    },
    {
      label: '位置',
      labelWidth:120,
      prop: 'address',
      editDisplay: false
    },
	  {
      label: '车牌',
      prop: 'carCode',
      labelWidth:120,
      search: true,
      editDisabled:true
    },
    {
      label: '速度km/h',
      prop: 'speed',
      labelWidth:120,
      editDisabled: true,
      rules: [{
        required: true,
        message: '速度不能为空',
        trigger: 'blur'
      },
        {
          pattern: /^(?:[0-9]|[1-9][0-9]{0,2}|999)$/,
          message: '请输入 0 到 999 之间的数字',
          trigger: 'blur'
        }
        ]
    },
    {
      label: '超速',
      labelWidth:120,
      prop: 'overRatio',
      editDisabled:true
    },
    {
      label: '车牌来源',
      prop: 'userType',
      labelWidth:120,
      editDisabled:true,
      search: true,
      slot: true,
      type: 'select',
      dicData: userTypeDict,
      props: {
        label: 'label',
        value: 'value'
      }
    },
    {
      label: '部门',
      labelWidth:120,
      prop: 'companyName',
      search: true,
      editDisabled:true,

    },
    {
      label: '姓名',
      labelWidth:120,
      prop: 'realName',
      search: true,
      editDisabled:true,

    },
	  {
      label: '电话',
      labelWidth:120,
      span:24,
      prop: 'phone',
      editDisabled: true,
      rules: [{
        required: true,
        message: '电话不能为空',
        trigger: 'blur'
      }, {
        pattern: /^1[345789]\d{9}$/,
        message: '请输入有效的中国大陆手机号码',
        trigger: 'blur'
      }
      ]
    },
	  {
      label: '40-50km/h次数',
      prop: 'speedCountOne',
      width: 120,
      editDisplay: false
    },
    {
      label: '大于50km/h次数',
      prop: 'speedCountTwo',
      width: 120,
      editDisplay: false
    },
    {
      label: '黑名单状态',
      prop: 'isBlack',
      editDisplay: false
    },
    {
      label: '日期范围',
      prop: 'timeRange',
      type: 'daterange',
      search: true,
      hide: true,
      editDisplay: false,
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
      rangeSeparator: '至',
    },
    {
      label: '备注',
      prop: 'remarks',
      width: 120,
      editDisabled: false,
      editDisplay: true
    }
  ]
}
