import styles from '../../../GLQ/index.less';
import { useState } from 'react';
import { ConfigProvider, DatePicker, Select, Table } from 'antd';

import { rowClassName } from '@/utils';
import ButtonComp from '@/components/ButtonComp';

export default function Page() {
  const [tableData, setTableData] = useState([]);

  const columns: any = [
    { title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center' },
    { title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center' },
    { title: '装配情况', dataIndex: 'name', key: 'name', align: 'center' }
  ]

  const columns1: any = [
    {
      title: '序号', key: 'index', align: 'center', width: 80,
      render: (a: any, b: any, c: any) => {
        return <span>{c + 1}</span>;
      },
    },
    { title: '设备名称', dataIndex: 'name', key: 'name', align: 'center' },
    { title: '管理实体标识', dataIndex: 'name', key: 'name', align: 'center' },
    { title: '000标识', dataIndex: 'name', key: 'name', align: 'center' },
    { title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center' },
    { title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center' },
    { title: '安装方式', dataIndex: 'name', key: 'name', align: 'center' },
    { title: '分发状态', dataIndex: 'name', key: 'name', align: 'center' },
    { title: '启用日期', dataIndex: 'name', key: 'name', align: 'center' },
    { title: '终止日期', dataIndex: 'name', key: 'name', align: 'center' },
    { title: '密钥套号', dataIndex: 'name', key: 'name', align: 'center' },
    { title: '载体类型', dataIndex: 'carrierType', key: 'carrierType', align: 'center' },
    { title: '输出日期', dataIndex: 'name', key: 'name', align: 'center' },
    { title: '协同管理标志', dataIndex: 'name', key: 'name', align: 'center' }
  ]

  return (
    <div className={`${styles.params_warp}`}>
      <ButtonComp type={'special'} text={'用户密钥装配'} onClick={() => { }} />

      <div className='flex_aiC mt20 mb20'>
        <div className='mr16'>密钥类型</div>
        <Select style={{ width: 260, marginRight: 20 }} placeholder="请选择密钥类型" onChange={(e) => { }} options={[{ label: '选项1', value: 1 }]} />

        <div className='mr16'>所属网络</div>
        <Select style={{ width: 260, marginRight: 20 }} placeholder="请选择所属网络" onChange={(e) => { }} options={[{ label: '选项1', value: 1 }]} />

        <div className='mr16'>启用日期</div>
        <DatePicker style={{ width: 260, marginRight: 20 }} />
      </div>

      <div className='flex_aiC mt20 mb20'>
        <div className='mr16'>终止日期</div>
        <DatePicker style={{ width: 260, marginRight: 20 }} />

        <div className='mr16'>应用系统</div>
        <Select style={{ width: 260 }} placeholder="请选择应用系统" onChange={(e) => { }} options={[{ label: '选项1', value: 1 }]} />
      </div>

      <div className='mb10'>可装配的密钥体列表</div>
      <Table
        scroll={tableData.length > 0 ? { y: 41 * 5 } : {}}
        pagination={false}
        bordered
        columns={columns}
        dataSource={tableData}
        rowKey={(record: any) => record?.id}
        rowClassName={rowClassName}
      />

      <div className='flex_jE mt20'>
        <ButtonComp text={'装配'} onClick={() => { }} />
      </div>

      <div className='mb10 mt30'>用户密钥装配列表</div>
      <Table
        scroll={tableData.length > 0 ? { y: 41 * 5 } : {}}
        pagination={false}
        bordered
        columns={columns1}
        dataSource={tableData}
        rowKey={(record: any) => record?.id}
        rowClassName={rowClassName}
      />

      <div className='flex_jE mt20'>
        <ButtonComp type='cancel' style={{ marginRight: 20 }} text={'过滤'} onClick={() => { }} />
        <ButtonComp type='cancel' style={{ marginRight: 20 }} text={'载体输出'} onClick={() => { }} />
        <ButtonComp type='cancel' text={'下载到邮箱'} onClick={() => { }} />
      </div>
    </div>
  );
}