import { BasicColumn } from '/@/components/Table/src/types/table'
import { projectStatusTextColorMap, projectStatusTextMap } from '/@/enums/statusEnum'

export function getProjectTableColumns(): BasicColumn[] {
  return [
    {
      title: '项目编号',
      dataIndex: 'code',
      width: 100,
      fixed: 'left',
      customRender: ({ text, record }) => (
        <router-link to={`/dashboard/project/${record.id}`}>
          <span class="text-primary">{text}</span>
        </router-link>
      )
    },
    {
      title: '项目名称',
      dataIndex: 'name'
    },
    {
      title: '办事处',
      dataIndex: 'category',
      width: 200,
      slots: { filterDropdown: 'filterDropdown' },
      filterMultiple: false
    },
    {
      title: '负责人',
      dataIndex: 'staffName',
      width: 100
    },
    {
      title: '电话',
      dataIndex: 'staffPhone'
    },
    {
      title: 'QQ',
      dataIndex: 'staffQq'
    },
    {
      title: '座机',
      dataIndex: 'staffTelephone'
    },
    {
      title: '创建时间',
      dataIndex: 'createTime',
      width: 200
      // sorter: true
    },
    {
      title: '状态',
      dataIndex: 'status',
      width: 100,
      customRender: ({ text }) => (
        <span class={projectStatusTextColorMap.get(text)}>{projectStatusTextMap.get(text)}</span>
      )
    }
  ]
}
