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

// 员工评价记录类型定义
export interface ValuationRecordData {
  id: number;
  evaluatedPerson: string; // 被评人
  evaluatedPosition: string; // 被评人岗位
  station: string; // 油站
  evaluator: string; // 评分人
  evaluatorPosition: string; // 评分人岗位
  customerService: number; // 顾客服务(30分)
  safetyAssessment: number; // 安全考核(15分)
  dailyPerformance: number; // 日常综合表现(25分)
  performance: number; // 业绩表现(20分)
  selfAssessment: number; // 自主评分(10分)
  totalScore: number; // 总分
  comments: string; // 评语
  evaluationTime: string; // 评价时间
}

// 员工评价记录表格配置
export const tableColumns: VxeGridProps['columns'] = [
  { title: '被评人', field: 'evaluatedPerson', minWidth: 120, align: 'center' },
  { title: '被评人岗位', field: 'evaluatedPosition', minWidth: 120, align: 'center' },
  { title: '油站', field: 'station', minWidth: 150, align: 'center' },
  { title: '评分人', field: 'evaluator', minWidth: 120, align: 'center' },
  { title: '评分人岗位', field: 'evaluatorPosition', minWidth: 120, align: 'center' },
  { title: '顾客服务(30分)', field: 'customerService', minWidth: 130, align: 'center' },
  { title: '安全考核(15分)', field: 'safetyAssessment', minWidth: 130, align: 'center' },
  { title: '日常综合表现(25分)', field: 'dailyPerformance', minWidth: 150, align: 'center' },
  { title: '业绩表现(20分)', field: 'performance', minWidth: 130, align: 'center' },
  { title: '自主评分(10分)', field: 'selfAssessment', minWidth: 130, align: 'center' },
  { title: '总分', field: 'totalScore', minWidth: 100, align: 'center' },
  { title: '评语', field: 'comments', minWidth: 200, align: 'left' },
  { title: '评价时间', field: 'evaluationTime', minWidth: 160, align: 'center' },
];

// 员工评价记录虚拟数据
export const VALUATION_RECORD_MOCK_DATA: ValuationRecordData[] = [
  { 
    id: 1, 
    evaluatedPerson: '张三', 
    evaluatedPosition: '加油员', 
    station: '北京东加油站', 
    evaluator: '李四', 
    evaluatorPosition: '站长', 
    customerService: 28, 
    safetyAssessment: 15, 
    dailyPerformance: 23, 
    performance: 18, 
    selfAssessment: 9, 
    totalScore: 93, 
    comments: '服务态度良好，安全意识强，业绩表现突出', 
    evaluationTime: '2025-01-15 14:30:00'
  },
  { 
    id: 2, 
    evaluatedPerson: '王五', 
    evaluatedPosition: '收银员', 
    station: '北京西加油站', 
    evaluator: '赵六', 
    evaluatorPosition: '副站长', 
    customerService: 27, 
    safetyAssessment: 14, 
    dailyPerformance: 22, 
    performance: 17, 
    selfAssessment: 8, 
    totalScore: 88, 
    comments: '工作认真负责，收银准确率高，服务热情', 
    evaluationTime: '2025-01-16 10:20:00'
  },
  { 
    id: 3, 
    evaluatedPerson: '孙七', 
    evaluatedPosition: '加油员', 
    station: '机场油站', 
    evaluator: '周八', 
    evaluatorPosition: '站长', 
    customerService: 26, 
    safetyAssessment: 15, 
    dailyPerformance: 24, 
    performance: 19, 
    selfAssessment: 10, 
    totalScore: 94, 
    comments: '工作积极主动，业绩优秀，安全考核满分', 
    evaluationTime: '2025-01-17 09:45:00'
  },
  { 
    id: 4, 
    evaluatedPerson: '吴九', 
    evaluatedPosition: '加油员', 
    station: '北京南加油站', 
    evaluator: '郑十', 
    evaluatorPosition: '站长', 
    customerService: 25, 
    safetyAssessment: 13, 
    dailyPerformance: 21, 
    performance: 16, 
    selfAssessment: 8, 
    totalScore: 83, 
    comments: '工作态度良好，需加强安全意识和业绩表现', 
    evaluationTime: '2025-01-18 15:10:00'
  },
  { 
    id: 5, 
    evaluatedPerson: '钱一', 
    evaluatedPosition: '副站长', 
    station: '北京北加油站', 
    evaluator: '孙二', 
    evaluatorPosition: '区域经理', 
    customerService: 29, 
    safetyAssessment: 15, 
    dailyPerformance: 25, 
    performance: 20, 
    selfAssessment: 9, 
    totalScore: 98, 
    comments: '管理能力强，团队协调良好，各项指标优秀', 
    evaluationTime: '2025-01-19 11:30:00'
  },
  { 
    id: 6, 
    evaluatedPerson: '周叁', 
    evaluatedPosition: '加油员', 
    station: '龙飞虎加油站', 
    evaluator: '吴肆', 
    evaluatorPosition: '站长', 
    customerService: 24, 
    safetyAssessment: 14, 
    dailyPerformance: 20, 
    performance: 15, 
    selfAssessment: 7, 
    totalScore: 80, 
    comments: '需提升服务质量和业绩表现，加强学习', 
    evaluationTime: '2025-01-20 16:45:00'
  },
  { 
    id: 7, 
    evaluatedPerson: '郑伍', 
    evaluatedPosition: '收银员', 
    station: '法站加油站', 
    evaluator: '王陆', 
    evaluatorPosition: '副站长', 
    customerService: 28, 
    safetyAssessment: 15, 
    dailyPerformance: 23, 
    performance: 18, 
    selfAssessment: 9, 
    totalScore: 93, 
    comments: '服务热情，收银效率高，团队协作良好', 
    evaluationTime: '2025-01-21 09:15:00'
  },
  { 
    id: 8, 
    evaluatedPerson: '赵柒', 
    evaluatedPosition: '加油员', 
    station: '河北油站', 
    evaluator: '孙捌', 
    evaluatorPosition: '站长', 
    customerService: 27, 
    safetyAssessment: 13, 
    dailyPerformance: 22, 
    performance: 17, 
    selfAssessment: 8, 
    totalScore: 87, 
    comments: '工作认真，需加强安全操作规范学习', 
    evaluationTime: '2025-01-22 14:20:00'
  },
];

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

// 查询表单模式配置
const QUERY_FORM_SCHEMA = [
  {
    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: 'DatePicker',
    fieldName: 'evaluationTime',
    label: '评价时间',
   componentProps: {
      placeholder: '请选择时间范围',
      type: 'daterange',
      rangeSeparator: '至',
      startPlaceholder: '开始时间',
      endPlaceholder: '结束时间',
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    component: 'Input',
    fieldName: 'evaluatedPerson',
    label: '被评人',
    componentProps: {
      placeholder: '请输入被评人',
    },
  },
  {
    component: 'Select',
    fieldName: 'evaluatedPosition',
    label: '被评人岗位',
    componentProps: {
      placeholder: '请选择被评人岗位',
      options: [
        { label: '站长', value: '站长' },
        { label: '副站长', value: '副站长' },
        { label: '加油员', value: '加油员' },
        { label: '收银员', value: '收银员' },
        { label: '其他', value: '其他' },
      ],
    },
  },
];
