保存代码

dev
陈博文 3 years ago
parent 201ad07cd0
commit 008dd0f51c

@ -14,16 +14,22 @@
}
}
.box {
height: 500px;
margin-top: 20px;
.btn {
padding: 13px 20px;
i {
font-size: 14px;
margin-right: 5px;
}
}
.btn {
border-top: 1px solid #ebf3ff;
height: 58px;
display: flex;
align-items: center;
padding: 0 20px;
.action {
cursor: pointer;
color: #6b758b;
padding: 0 10px;
&:hover {
color: @primary-color;
}
}
}

@ -1,48 +1,150 @@
import styles from './index.less';
import {
InputNumber,
Input,
Button,
Select,
Row,
Modal,
Form,
message,
Empty,
Spin,
} from 'antd';
import { Button, Select, Row, Modal, Form, message, Empty, Table } from 'antd';
import Fetch from '@/utils/fetch';
import { useEffect, useState, FC, useRef } from 'react';
import { Link } from 'umi';
import { downLoadLink } from '@/utils/download';
import url from '@/utils/url';
import ReactEcharts from 'echarts-for-react';
import { ColumnsType } from 'antd/lib/table';
interface PageProps {}
const Page: FC<PageProps> = () => {
const [data, setData] = useState<any>([]);
const [loading, setLoading] = useState<boolean>(true);
const [total, setTotal] = useState<number>(0);
const [params, setParams] = useState<any>({
pageNumber: 1,
pageSize: 20,
});
useEffect(() => {
getData();
getData(params);
}, []);
const getData = async () => {
const res = await Fetch('/openi/secretKey/statistics', {
const getData = async (record: any) => {
setLoading(true);
const res = await Fetch('/openi/producer/page', {
method: 'get',
params: {},
params: record,
});
if (res.result === 'success') {
setData(res?.data?.[0]);
setData(res?.data?.[0]?.list);
setTotal(res?.data?.[0]?.total);
}
setLoading(false);
};
const columns: ColumnsType<any> = [
{
title: '序号',
align: 'center',
dataIndex: 'index',
render: (text: string, record: any, index: number) =>
params.pageSize * (params.pageNumber - 1) + index + 1,
},
{
title: '厂商编号',
dataIndex: 'producerNumber',
},
{
title: '生产厂商全名',
dataIndex: 'name',
},
{
title: '生产厂商简称',
dataIndex: 'simpleName',
},
{
title: '生产厂商地址',
dataIndex: 'address',
},
{
title: '联系人1姓名',
dataIndex: 'contacts1',
},
{
title: '联系人1电话',
dataIndex: 'phone1',
},
{
title: '联系人1手机',
dataIndex: 'tel1',
},
{
title: '联系人2姓名',
dataIndex: 'contacts2',
render: (text: string) => text || '--',
},
{
title: '联系人2电话',
dataIndex: 'phone2',
render: (text: string) => text || '--',
},
{
title: '联系人2手机',
dataIndex: 'tel2',
render: (text: string) => text || '--',
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
fixed: 'right',
width: 110,
render: () => (
<span>
<i
title="修改"
className={'iconfont icon-xiugaikucundixian ' + styles.action}
/>
<i
title="删除"
className={'iconfont icon-shanchuzhuangbeixinghao ' + styles.action}
/>
</span>
),
},
];
const handleChangePage = (param: any) => {
params.pageNumber = param?.current;
params.pageSize = param?.pageSize;
setParams({ ...params });
getData(params);
};
return (
<div className={styles.page}>
<div className={styles.title}>
<span> </span>
<i onClick={() => getData()} className="iconfont icon-a-shuaxin2" />
<span></span>
<i
onClick={() => getData(params)}
className="iconfont icon-a-shuaxin2"
/>
</div>
<Row justify="end" className={styles.btn}>
<Button icon={<i className="iconfont icon-tianjia" />}></Button>
{/* <Button icon={<i className='iconfont icon-daorushuju2' />} className='ml10'>导出厂商信息</Button> */}
</Row>
<Table
dataSource={data}
bordered={false}
rowKey="id"
columns={columns}
scroll={{ x: 1800 }}
loading={loading}
className="pr20 pl20"
onChange={handleChangePage}
pagination={{
pageSize: params.per_page,
total: total,
current: params.page,
showQuickJumper: true,
hideOnSinglePage: true,
position: ['bottomCenter'],
// showTotal: total => <span className="mr10">共<span>{total}</span>条数据</span>
}}
/>
</div>
);
};

@ -11,12 +11,12 @@ const Page = ({ ...props }) => {
key: '/register',
},
{
icon: 'iconfont icon-peifaguanli',
icon: 'iconfont icon-xinghaoguanli',
name: '型号管理',
key: '/model',
},
{
icon: 'iconfont icon-suanfacanshuziyuan',
icon: 'iconfont icon-peifaguanli',
name: '配发管理',
key: '/allotment',
},

@ -46,7 +46,7 @@ const Page: FC<PageProps> = () => {
const item: any = [
{
icon: 'iconfont icon-yuzhimiyuejiami',
icon: 'iconfont icon-yuzhiziyuan',
name: '预制资源',
key: '1',
},

Loading…
Cancel
Save