import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';

// 访客新增数据类型定义
export interface VisitorAddData {
  id: number;
  taskName: string; // 任务名称
  station: string; // 油站
  executor: string; // 执行人
  position: string; // 岗位
  comment: string; // 评论
  deadline: string; // 截止时间
  processTime: string; // 处理时间
  status: string; // 完成状态
  creator: string; // 创建人
}

// 访客新增表格配置
export const tableColumns: VxeGridProps['columns'] = [
  { title: '任务名称', field: 'taskName', minWidth: 150, align: 'center' },
  { title: '油站', field: 'station', minWidth: 120, align: 'center' },
  { title: '执行人', field: 'executor', minWidth: 100, align: 'center' },
  { title: '岗位', field: 'position', minWidth: 100, align: 'center' },
  { title: '评论', field: 'comment', minWidth: 150, align: 'center' },
  { title: '截止时间', field: 'deadline', minWidth: 150, align: 'center' },
  { title: '处理时间', field: 'processTime', minWidth: 150, align: 'center' },
  { title: '完成状态', field: 'status', minWidth: 100, align: 'center' },
  { title: '创建人', field: 'creator', minWidth: 100, align: 'center' },
  {
    title: '操作',
    minWidth: 100,
    align: 'center',
    fixed: 'right',
    slots: {
      default: 'action',
    },
  },
];

// 访客新增虚拟数据
export const WORK_REPORT_MOCK_DATA: VisitorAddData[] = [
  {
    id: 1,
    taskName: '访客信息录入',
    station: '北京东加油站',
    executor: '张三',
    position: '站长',
    comment: '已完成访客信息录入',
    deadline: '2024-01-15 18:00:00',
    processTime: '2024-01-15 16:30:00',
    status: '已完成',
    creator: '李四',
  },
  {
    id: 2,
    taskName: '访客权限设置',
    station: '北京西加油站',
    executor: '王五',
    position: '安全员',
    comment: '已为访客设置临时权限',
    deadline: '2024-01-16 12:00:00',
    processTime: '2024-01-16 10:45:00',
    status: '已完成',
    creator: '赵六',
  },
  {
    id: 3,
    taskName: '访客引导服务',
    station: '机场油站',
    executor: '孙七',
    position: '服务员',
    comment: '已完成访客引导',
    deadline: '2024-01-17 14:00:00',
    processTime: '2024-01-17 13:20:00',
    status: '已完成',
    creator: '周八',
  },
  {
    id: 4,
    taskName: '访客记录归档',
    station: '北京南加油站',
    executor: '吴九',
    position: '资料员',
    comment: '正在整理访客记录',
    deadline: '2024-01-18 17:00:00',
    processTime: '',
    status: '进行中',
    creator: '郑十',
  },
  {
    id: 5,
    taskName: '访客车辆登记',
    station: '北京北加油站',
    executor: '冯一',
    position: '保安',
    comment: '已完成车辆登记',
    deadline: '2024-01-19 09:00:00',
    processTime: '2024-01-19 08:30:00',
    status: '已完成',
    creator: '陈二',
  },
  {
    id: 6,
    taskName: '访客培训',
    station: '龙飞虎加油站',
    executor: '褚三',
    position: '培训员',
    comment: '已安排访客培训',
    deadline: '2024-01-20 15:00:00',
    processTime: '',
    status: '进行中',
    creator: '卫四',
  },
  {
    id: 7,
    taskName: '访客离场确认',
    station: '法站加油站',
    executor: '蒋五',
    position: '管理员',
    comment: '已确认访客离场',
    deadline: '2024-01-21 11:00:00',
    processTime: '2024-01-21 10:15:00',
    status: '已完成',
    creator: '沈六',
  },
  {
    id: 8,
    taskName: '访客满意度调查',
    station: '河北油站',
    executor: '韩七',
    position: '客服',
    comment: '正在收集满意度反馈',
    deadline: '2024-01-22 16:00:00',
    processTime: '',
    status: '进行中',
    creator: '杨八',
  },
];

export const queryFormSchema: FormSchemaGetter = () => QUERY_FORM_SCHEMA;

// 查询表单模式配置
const QUERY_FORM_SCHEMA = [
  {
    component: 'Select',
    fieldName: 'area',
    label: '片区',
    componentProps: {
      placeholder: '请选择片区',
      options: [
        { label: '默认片区', value: '默认片区' },
        { label: '片区1', value: '片区1' },
        { label: '片区2', value: '片区2' },
        { label: '片区3', value: '片区3' },
      ],
    },
  },
  {
    component: 'Select',
    fieldName: 'station',
    label: '油站',
    componentProps: {
      placeholder: '请选择油站',
      options: [
        { label: '机场油站', value: '机场油站' },
        { label: '北京东加油站', value: '北京东加油站' },
        { label: '北京西加油站', value: '北京西加油站' },
        { label: '北京南加油站', value: '北京南加油站' },
        { label: '北京北加油站', value: '北京北加油站' },
        { label: '河北油站', value: '河北油站' },
        { label: '龙飞虎加油站', value: '龙飞虎加油站' },
        { label: '法站加油站', value: '法站加油站' },
      ],
    },
  },
  {
    component: 'Select',
    fieldName: 'status',
    label: '完成状态',
    componentProps: {
      placeholder: '请选择完成状态',
      options: [
        { label: '已完成', value: '已完成' },
        { label: '进行中', value: '进行中' },
        { label: '未开始', value: '未开始' },
      ],
    },
  },
  {
    component: 'Select',
    fieldName: 'position',
    label: '岗位',
    componentProps: {
      placeholder: '请选择岗位',
      options: [
        { label: '站长', value: '站长' },
        { label: '安全员', value: '安全员' },
        { label: '服务员', value: '服务员' },
        { label: '资料员', value: '资料员' },
        { label: '保安', value: '保安' },
        { label: '培训员', value: '培训员' },
        { label: '管理员', value: '管理员' },
        { label: '客服', value: '客服' },
      ],
    },
  },
  {
    component: 'Select',
    fieldName: 'comment',
    label: '评论',
    componentProps: {
      placeholder: '请选择评论',
      options: [
        { label: '已完成访客信息录入', value: '已完成访客信息录入' },
        { label: '已为访客设置临时权限', value: '已为访客设置临时权限' },
        { label: '已完成访客引导', value: '已完成访客引导' },
        { label: '正在整理访客记录', value: '正在整理访客记录' },
        { label: '已完成车辆登记', value: '已完成车辆登记' },
      ],
    },
  },
  {
    component: 'Select',
    fieldName: 'creator',
    label: '创建人',
    componentProps: {
      placeholder: '请选择创建人',
      options: [
        { label: '李四', value: '李四' },
        { label: '赵六', value: '赵六' },
        { label: '周八', value: '周八' },
        { label: '郑十', value: '郑十' },
        { label: '陈二', value: '陈二' },
      ],
    },
  },
  {
    component: 'DatePicker',
    fieldName: 'processTimeRange',
    label: '处理时间',
    componentProps: {
      placeholder: '请选择时间范围',
      type: 'daterange',
      rangeSeparator: '至',
      startPlaceholder: '开始时间',
      endPlaceholder: '结束时间',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
    },
  },
  {
    component: 'Input',
    fieldName: 'executor',
    label: '执行人',
    componentProps: {
      placeholder: '请输入执行人',
    },
  },
  {
    component: 'Input',
    fieldName: 'taskName',
    label: '任务名称',
    componentProps: {
      placeholder: '请输入任务名称',
    },
  },
];
