更新部分功能
This commit is contained in:
@ -2,9 +2,17 @@ import React, { useRef, useEffect, useState } from 'react';
|
||||
import { Table, Form, Input, Button, Row, Col, DatePicker, Tabs, Space, message } from 'antd';
|
||||
import { SearchOutlined, ReloadOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import { getPageAgent } from './services';
|
||||
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import SupplierViewModal from './components/SupplierViewModal';
|
||||
const { RangePicker } = DatePicker;
|
||||
const { TabPane } = Tabs;
|
||||
interface Columns {
|
||||
name: string;
|
||||
enterpriseType: string;
|
||||
deptId: string;
|
||||
createTime: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
const SupplierRegisterAgent: React.FC = () => {
|
||||
const [form] = Form.useForm();
|
||||
@ -12,7 +20,10 @@ const SupplierRegisterAgent: React.FC = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
|
||||
const [tabKey, setTabKey] = useState('dvs');
|
||||
|
||||
//查看是否显示状态
|
||||
const [viewVisible, setViewVisible] = useState(false);
|
||||
//查看 参数传递
|
||||
const [currentRecord, setCurrentRecord] = useState('');
|
||||
// 查询数据
|
||||
const fetchData = async (page = 1, pageSize = 10) => {
|
||||
setLoading(true);
|
||||
@ -67,7 +78,7 @@ const SupplierRegisterAgent: React.FC = () => {
|
||||
};
|
||||
|
||||
// 列
|
||||
const columns = [
|
||||
const columns: ColumnsType<Columns> = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
@ -108,7 +119,7 @@ const SupplierRegisterAgent: React.FC = () => {
|
||||
align: 'center',
|
||||
render: (_: any, record: any) => (
|
||||
<Space>
|
||||
<a onClick={() => message.info(`查看:${record.name}`)}>查看</a>
|
||||
<a onClick={() => { setCurrentRecord(record.id); setViewVisible(true); }}>查看</a>
|
||||
<a onClick={() => message.info(`编辑:${record.name}`)}>编辑</a>
|
||||
</Space>
|
||||
),
|
||||
@ -161,7 +172,12 @@ const SupplierRegisterAgent: React.FC = () => {
|
||||
showSizeChanger: true,
|
||||
onChange: (current, pageSize) => handleTableChange({ current, pageSize }),
|
||||
}}
|
||||
bordered
|
||||
/>
|
||||
{/* 查看组件 */}
|
||||
<SupplierViewModal
|
||||
visible={viewVisible}
|
||||
record={currentRecord}
|
||||
onCancel={() => setViewVisible(false)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
Reference in New Issue
Block a user