/*
 *    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.
 *
 */

import {comeFrom} from "@/const/crud/safety/cloudcarrecognition";
import global from "@/components/tools/commondict";

export const speedDict=[
  {
    label:'全部',
    value:'0'
  },
  {
    label:'36及以上',
    value:'36'
  },
  {
    label:'45及以上',
    value:'45'
  },
  {
    label:'51及以上',
    value:'51'
  },
]
export const blackDict=[
  {
    label:'正常',
    value:'0'
  },
  {
    label:'已拉黑',
    value:'1'
  },
]

export const userTypeDict=[
  {
    label:'教职工',
    value:'1'
  },
  {
    label:'驻校人员',
    value:'3'
  },
  {
    label:'二期驻校单位',
    value:'5'
  },
  {
    label:'访客',
    value:'9'
  },
  {
    label:'临时车牌',
    value:'6'
  },
  {
    label:'未匹配',
    value:'10'
  },
]
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  editBtn: false,
  delBtn: false,
  addBtn: false,
  dic: [],
  column: [
	  {
      label: '时间',
      prop: 'createTime',
      labelWidth:120,
      span:24,
      type: 'datetime',
      rules: [
        {
          required: true,
          trigger: 'blur',
          message:"请选择时间"
        }
      ],
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
    },
	  {
      label: '车牌',
      prop: 'carCode',
      span:24,

      labelWidth:120,
      search: true,
      rules: [
        {
          required: true,
          trigger: 'blur',
          message:"车牌不能为空"
        }
      ],
    },
    {
      label: '照片',
      prop: 'img',
      labelWidth:120,
      slot: true,
      formslot: true,
      editDisabled: true,
      editDisplay: false,
      addDisplay: true,
    },

	  {
      label: '位置',
      prop: 'name',
      editDisabled: true,
      search: true,
      labelWidth:120,
      span:24,
      type: 'select',
      dicUrl: '/safety/cloudcarspeedheart/list',
      props: {
        label: 'name',
        value: 'name'
      },
      rules: [
        {
          required: true,
          trigger: 'blur',
          message:"请选择位置"
        }
      ],
    },
    {
      label: '速度范围',
      prop: 'speedStart',
      search: true,
      labelWidth:120,
      editDisabled: true,
      editDisplay: false,
      addDisplay: false,
      // slot:true,
      hide:true,
      type: 'select',
      dicData:speedDict,
      props:{
        label:'label',
        value:'value'
      },
    },
    {
      label: '速度',
      prop: 'speed',
      labelWidth:120,
      editDisabled: true,
      search: true,
      rules: [
        {
          required: true,
          trigger: 'blur',
          message:"速度不能为空"
        }
      ],
    },
    {
      label: '电话',
      prop: 'phone',
      labelWidth:120,
      rules: [
        {
          required: true,
          message: '请输入手机号',
          trigger: 'blur'
        },
        {
          pattern: /^1[3-9]\d{9}$/,
          message: '手机号格式不正确',
          trigger: 'blur'
        }
      ]
    },{
      label: '来源',
      prop: 'userType',
      type: 'select',
      span:24,
      dicData:userTypeDict,
      search:true,
      props:{
        value:'value',
        label:'label'
      },
      labelWidth:120,
      editDisabled: true,
      addDisplay: false,
      rules: [
        {
          required: true,
          trigger: 'blur',
          message:"来源不能为空"
        }
      ],
    },
    {
      label: '部门',
      prop: 'deptName',
      labelWidth:120,
      addDisplay: false,
      editDisabled: true,
    },
    {
      label: '姓名',
      prop: 'realName',
      labelWidth:120,
      addDisplay: false,
      editDisabled: true,
    },

    {
      label: '黑名单状态',
      prop: 'isBlack',
      search: true,
      labelWidth:120,
      span:24,
      addDisplay: false,
      slot:true,
      type: 'select',
      dicData: blackDict,
      props:{
        label:'label',
        value:'value'
      },
    },
    {
      label: '40-50km/h次数',
      prop: 'speedCountOne',
      width: 180,
      addDisplay: false,
      editDisplay: false
    },
    {
      label: '大于50km/h次数',
      prop: 'speedCountTwo',
      addDisplay: false,
      width: 180,
      editDisplay: false
    },
    {
      label: '时间范围',
      prop: 'timeRange',
      type: 'daterange',
      addDisplay: false,
      editDisabled: true,
      editDisplay: false,
      search: true,
      hide: true,
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
    },
    {
      label: '备注',
      type:'textarea',
      row:true,
      span:24,
      labelWidth:120,
      prop: 'remark'
    },
  ]
}
