import { ColItem } from '@/api/common'
import { ElTableColumn } from 'element-ui/types/table-column'
const elTableAlignLeft = (tooltips: boolean = true): Partial<ElTableColumn> => ({
    align: 'center',
    headerAlign: 'center',
    showOverflowTooltip: tooltips
})
//指标管理
export const IMTableColumns: ColItem[] = [
    { type: 'selection', width: '50px' },
    { type: 'index', label: '序号', width: '50px', ...elTableAlignLeft() },
    { prop: 'dataGroup', label: '分组', width: '150px', sortable: true, ...elTableAlignLeft() },
    { prop: 'projectCode', label: '项目编码', width: '150px', sortable: true, ...elTableAlignLeft() },
    { prop: 'projectName', label: '项目名称', width: '150px', sortable: true, ...elTableAlignLeft() },
    { prop: 'mangeField', label: '管理领域', width: '150px', sortable: true, ...elTableAlignLeft() },
    { prop: 'indexType', label: '指标分类', width: '150px', sortable: true, ...elTableAlignLeft() },
    { prop: 'indexCode', label: '指标代码', width: '150px', sortable: true, ...elTableAlignLeft() },
    { prop: 'indexName', label: '指标名称', width: '150px', sortable: true, ...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 },
]
//预警指标管理
export const IFWITableColumns: ColItem[] = [
    { type: 'selection', width: '50px' },
    { type: 'index', label: '序号', width: '50px', ...elTableAlignLeft() },
    { prop: 'warningMethod', label: '预警方式', width: '150px', ...elTableAlignLeft() },
    { prop: 'warningType', label: '预警类型', width: '150px', ...elTableAlignLeft() },
    { prop: 'warningGroup', label: '预警分组', width: '150px', ...elTableAlignLeft() },
    { prop: 'warningIndexCode', label: '预警指标代码', width: '150px', ...elTableAlignLeft() },
    { prop: 'warningIndexName', label: '预警指标名称', width: '150px', ...elTableAlignLeft() },
    { prop: 'warningIndexShortName', label: '预警指标简称', width: '150px', ...elTableAlignLeft() },
    { prop: 'explan', label: '说明', width: '150px', ...elTableAlignLeft() },
    { prop: 'dataSources', label: '数据来源', width: '150px', ...elTableAlignLeft() },
    { prop: 'linkedData', label: '关联数据', width: '150px', ...elTableAlignLeft() },
    { prop: 'isEnable', label: '是否启用', width: '150px', ...elTableAlignLeft() },
    { prop: 'createUserName', label: '操作人', width: '150px', ...elTableAlignLeft() },
    { prop: 'createDate', label: '操作时间', width: '150px', ...elTableAlignLeft() },
    { prop: 'operation', label: '操作', width: '150px', _slot: true, fixed: "right" },
]
//预警指标阈值管理
export const IFWITTableColumns: ColItem[] = [
    { type: 'selection', width: '50px' },
    { type: 'index', label: '序号', width: '50px', ...elTableAlignLeft() },
    { prop: 'warningType', label: '预警类型', width: '150px', ...elTableAlignLeft() },
    { prop: 'warningGroup', label: '预警分组', width: '150px', ...elTableAlignLeft() },
    { prop: 'warningIndexCode', label: '预警指标代码', width: '150px', ...elTableAlignLeft() },
    { prop: 'warningIndexName', label: '预警指标名称', width: '150px', ...elTableAlignLeft() },
    { prop: 'thresholdCode', label: '预警阈值编码', width: '150px', ...elTableAlignLeft() },
    { prop: 'concernExtent', label: '关注程度', width: '150px', ...elTableAlignLeft() },
    { prop: 'indexParam', label: '指标参数', width: '150px', ...elTableAlignLeft() },
    { prop: 'unit', label: '单位', width: '150px', ...elTableAlignLeft() },
    { prop: 'specialValue', label: '特定值', width: '150px', ...elTableAlignLeft() },
    { prop: 'flowe', label: '下限', width: '150px', ...elTableAlignLeft() },
    { prop: 'upper', label: '上限', width: '150px', ...elTableAlignLeft() },
    { prop: 'effectiveTime', label: '有效时段', width: '150px', ...elTableAlignLeft() },
    { prop: 'warningTipInfo', label: '预警提示信息', width: '150px', ...elTableAlignLeft() },
    { prop: 'detailInfo', label: '详细信息', width: '150px', ...elTableAlignLeft() },
    { prop: 'explain', label: '说明', width: '150px', ...elTableAlignLeft() },
    { prop: 'isEnable', label: '是否启用', width: '150px', ...elTableAlignLeft() },
    { prop: 'createUserName', label: '操作人', width: '150px', ...elTableAlignLeft() },
    { prop: 'createDate', label: '操作时间', width: '150px', ...elTableAlignLeft() },
    { prop: 'operation', label: '操作', width: '150px', _slot: true, fixed: "right" },
]
//预警信息管理
export const IFWIFTableColumns: ColItem[] = [
    { type: 'selection', width: '50px' },
    { type: 'index', label: '序号', width: '50px', ...elTableAlignLeft() },
    { prop: 'code', label: '编号', width: '150px', ...elTableAlignLeft() },
    { prop: 'warningIndexName', label: '预警指标名称', width: '150px', ...elTableAlignLeft() },
    { prop: 'concernExtent', label: '关注程度', width: '150px', ...elTableAlignLeft() },
    { prop: 'warningLevel', label: '预警等级', width: '150px', ...elTableAlignLeft() },
    { prop: 'warningTipInfo', label: '预警提示信息', width: '150px', ...elTableAlignLeft() },
    { prop: 'detailInfo', label: '预警详情', width: '150px', ...elTableAlignLeft() },
    { prop: 'location', label: '位置', width: '150px', ...elTableAlignLeft() },
    { prop: 'longitude', label: '经度', width: '150px', ...elTableAlignLeft() },
    { prop: 'latitude', label: '纬度', width: '150px', ...elTableAlignLeft() },
    { prop: 'warningExplain', label: '预警说明', width: '150px', ...elTableAlignLeft() },
    { prop: 'handleStatus', label: '处理状态', width: '150px', ...elTableAlignLeft() },
    { prop: 'handleStatusDetail', label: '处理状态详情', width: '150px', ...elTableAlignLeft() },
    { prop: 'explain', label: '说明', width: '150px', ...elTableAlignLeft() },
    { prop: 'dataSources', label: '数据来源', width: '150px', ...elTableAlignLeft() },
    { prop: 'linkedData', label: '关联数据', width: '150px', ...elTableAlignLeft() },
    { prop: 'findDate', label: '发现时间', width: '150px', ...elTableAlignLeft() },
    { prop: 'warningDate', label: '预警时间', width: '150px', ...elTableAlignLeft() },
    { prop: 'handleDate', label: '处理时间', width: '150px', ...elTableAlignLeft() },
    { prop: 'createDate', label: '操作时间', width: '150px', ...elTableAlignLeft() },
    { prop: 'createUserName', label: '操作人', width: '150px', ...elTableAlignLeft() },
    { prop: 'isShow', label: '是否显示', width: '100px', _slot: true, fixed: "right" },
    { prop: 'isValid', label: '是否有效', width: '100px', _slot: true, fixed: "right" },
]