import { ColItem } from '@/api/common'
import { ElTableColumn } from 'element-ui/types/table-column'
const elTableAlignLeft = (tooltips: boolean = true): Partial<ElTableColumn> => ({
    align: 'left',
    headerAlign: 'left',
    showOverflowTooltip: tooltips
})
export const IMTableColumns: ColItem[] = [
    { type: 'selection', width: '50px' },
    { type: 'index', label: '序号', width: '50px', ...elTableAlignLeft() },
    { prop: 'dataGroup', label: '分组', width: '150px', ...elTableAlignLeft() },
    { prop: 'projectCode', label: '项目编码', width: '150px', ...elTableAlignLeft() },
    { prop: 'projectName', label: '项目名称', width: '150px', ...elTableAlignLeft() },
    { prop: 'mangeField', label: '管理领域', width: '150px', ...elTableAlignLeft() },
    { prop: 'indexType', label: '指标分类', width: '150px', ...elTableAlignLeft() },
    { prop: 'indexCode', label: '指标代码', width: '150px', ...elTableAlignLeft() },
    { prop: 'indexName', label: '指标名称', width: '150px', ...elTableAlignLeft() },
    { prop: 'indexValue', label: '值', width: '150px', ...elTableAlignLeft() },
    { prop: 'unit', label: '单位', width: '150px', ...elTableAlignLeft() },
    { prop: 'floatTips', label: '提示信息', width: '150px', ...elTableAlignLeft() },
    { prop: 'note', label: '指标说明', width: '150px', ...elTableAlignLeft() },
    { prop: 'isNew', label: '是否最新', width: '150px' },
    { prop: 'stsDate', label: '统计日期', width: '150px' },
    { prop: 'source', label: '数据来源', width: '150px' },
    { prop: 'createUser', label: '操作人', width: '150px' },
    { prop: 'createDate', label: '操作时间', width: '150px', ...elTableAlignLeft() },
    { prop: 'operation', label: '操作', width: '150px', _slot: true, fixed: "right" },
]
export const PMTableColumns: ColItem[] = [
    { type: 'index', label: '序号', width: '50px' },
    { prop: 'code', label: '工程编号' },
    { prop: 'name', label: '工程名称' },
    { prop: 'projectType', label: '工程类型' },
    { prop: 'projectStatus', label: '工程状态' },
    { prop: 'planBeginDate', label: '计划开始时间' },
    { prop: 'planEndDate', label: '计划结束时间' },
    { prop: 'longitude', label: '经度' },
    { prop: 'latitude', label: '纬度' },
    { prop: 'area', label: '工程面积（km²）', ...elTableAlignLeft() },
    { prop: 'operation', label: '操作', _slot: true },
]