import { BasicColumn } from '/@/components/Table';

export const columns: BasicColumn[] = [

    {
        title: '地块名称',
        dataIndex: 'wrdkmc',
        resizable: true,
    },
    {
        title: '地块编码',
        dataIndex: 'wrdkbm',
        resizable: true,
    },

    {
        title: '状态',
        dataIndex: 'flag',
        resizable: true,
        customRender: ({ record }: any) => {
            if (record.flag == '-1')
                return '未填写'
            if (record.flag === 0)
                return '保存'
            if (record.flag == 1)
                return '提交'
            if (record.flag == 2)
                return '已接受'
            if (record.flag == 3)
                return '退回'
        },
    },
    {
        title: '土壤转运时间',
        dataIndex: 'trzysj',
        resizable: true,
    },
    {
        title: '污染土壤转运总量',
        dataIndex: 'wrtryzzl',
        resizable: true,
    },
    {
        title: '计划处置完成期限',
        dataIndex: 'jhczwcqx',
        resizable: true,
    },
    {
        title: '地块所在地主管部门',
        dataIndex: 'szdRealname',
        resizable: true,
    },
    {
        title: '地块所在地主管部门是否确认',
        dataIndex: 'szdFlag',
        customRender: ({ record }: any) => {
            return (record.szdFlag || record.szdFlag === 0) ? (record.szdFlag == '1' ? '是' : '否') : '';
        },
        resizable: true,
    },
    {
        title: '接收地主管部门',
        dataIndex: 'jsdRealname',
        resizable: true,
    },
    {
        title: '接收地主管部门是否确认',
        dataIndex: 'jsdFlag',
        customRender: ({ record }: any) => {
            return (record.jsdFlag || record.jsdFlag === 0) ? (record.jsdFlag == '1' ? '是' : '否') : '';
        },
        resizable: true,
    },
];

export const CZwccolumns: BasicColumn[] = [

    {
        title: '地块名称',
        dataIndex: 'wrdkmc',
        resizable: true,
    },
    {
        title: '地块编码',
        dataIndex: 'wrdkbm',
        resizable: true,
    },
    {
        title: '状态',
        dataIndex: 'flag',
        resizable: true,
        customRender: ({ record }: any) => {
            if (record.flag == '-1')
                return '未填写'
            if (record.flag === 0)
                return '保存'
            if (record.flag == 1)
                return '提交'
            if (record.flag == 2)
                return '已接受'
            if (record.flag == 3)
                return '退回'
        },
    },
    {
        title: '实际转运时间',
        dataIndex: 'sjzysj',
        resizable: true,
    },
    {
        title: '实际转运总量',
        dataIndex: 'sjzyzl',
        resizable: true,
    },
    {
        title: '处置时间',
        dataIndex: 'czsj',
        resizable: true,
    },
    {
        title: '处置总量',
        dataIndex: 'czzl',
        resizable: true,
    },
    {
        title: '地块所在地主管部门',
        dataIndex: 'szdRealname',
        resizable: true,
    },
    {
        title: '地块所在地主管部门是否确认',
        dataIndex: 'szdFlag',
        customRender: ({ record }: any) => {
            return (record.szdFlag || record.szdFlag === 0) ? (record.szdFlag == '1' ? '是' : '否') : '';
        },
        resizable: true,
    },
    {
        title: '接收地主管部门',
        dataIndex: 'jsdRealname',
        resizable: true,
    },
    {
        title: '接收地主管部门是否确认',
        dataIndex: 'jsdFlag',
        customRender: ({ record }: any) => {
            return (record.jsdFlag || record.jsdFlag === 0) ? (record.jsdFlag == '1' ? '是' : '否') : '';
        },
        resizable: true,
    },
];

export const historyColumns: BasicColumn[] = [
  {
    title: '次数',
    dataIndex: 'sort',
  },
  {
    title: '更新时间',
    dataIndex: 'tsamp',
  },
  {
    title: '操作',
    dataIndex: 'action',
    align: 'center',
    fixed: 'right',
    width: 100,
    slots: { customRender: 'action' },
  },
];
