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

export const columns: BasicColumn[] = [

    {
        title: '知识库分类名称',
        dataIndex: 'name',
        resizable: true,
        width: '15%'

    },
    {
        title: '顺序',
        dataIndex: 'sort',
        resizable: true,
        width: '50%'
    },
];
export const searchFormSchema: FormSchema[] = [
    {
        label: '分档分类查询',
        field: 'userId',
        component: 'Input',

    },
]

// 文件管理
export const columnsFile: BasicColumn[] = [

    {
        title: '名称',
        dataIndex: 'name',
        resizable: true,

    },

    {
        title: '描述',
        dataIndex: 'remark',
        resizable: true,
    },
    {
        title: '文件类型',
        dataIndex: 'type',
        resizable: true,
        customRender: ({ record }: any) => {
            if (record.type == 1)
                return '法律法规'
            else if (record.type == 2)
                return '部门规章'
            else if (record.type == 3)
                return '技术规范'
            else return ''
        },
    },
    {
        title: '文件大小',
        dataIndex: 'wjdx',
        resizable: true,
        customRender: ({ record }: any) => {
            const size = (record.wjdx / (2 * 1024)).toFixed(2);
            return `${size}KB`
        },
    },
    // {
    //     title: '文件状态',
    //     dataIndex: 'wjzt',
    //     resizable: true,
    // },
    {
        title: '创建人',
        dataIndex: 'createBy',
        resizable: true,
    },
    {
        title: '上传时间',
        dataIndex: 'updateTsamp',
        resizable: true,
    },

];
export const searchFlieFormSchema: FormSchema[] = [
    {
        label: '文件名称',
        field: 'name',
        component: 'Input',
    },
    {
        label: '文件描述',
        field: 'remark',
        component: 'Input',
    },
    {
        label: '文件类型',
        field: 'type',
        component: 'Select',
        componentProps: {
            options: [
                { value: '1', label: '法律法规' },
                { value: '2', label: '部门规章' },
                { value: '3', label: '技术规范' },
            ],
        }
    },
    {
        label: '查询日期',
        field: 'data',
        component: 'RangeDate',
        componentProps: {
            format: 'YYYY-MM-DD',
            //范围文本描述用集合
            placeholder: ['请选择开始日期', '请选择结束日期']
        },
    },
]