全局下拉修改
This commit is contained in:
@ -1,21 +1,30 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Select } from 'antd';
|
import { Select } from 'antd';
|
||||||
|
|
||||||
interface options {
|
interface Option {
|
||||||
label: string;
|
label: string;
|
||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AdmissionTypeSelect = () => {
|
const AdmissionTypeSelect: React.FC<any> = (props) => {
|
||||||
const [options, setOptions] = useState<options[]>([]);
|
const [options, setOptions] = useState<Option[]>([]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setOptions([
|
setOptions([
|
||||||
{ label: '未准入', value: '0' },
|
{ label: '未准入', value: '0' },
|
||||||
{ label: '已准入', value: '1' },
|
{ label: '已准入', value: '1' },
|
||||||
{ label: '退出', value: '2' },
|
{ label: '退出', value: '2' },
|
||||||
])
|
]);
|
||||||
}, []);
|
}, []);
|
||||||
return <Select style={{ width: 150 }} placeholder="请选择准入状态" options={options} allowClear />;
|
|
||||||
|
return (
|
||||||
|
<Select
|
||||||
|
style={{ width: 150 }}
|
||||||
|
placeholder="请选择准入状态"
|
||||||
|
options={options}
|
||||||
|
allowClear
|
||||||
|
{...props} // ⭐ 透传
|
||||||
|
/>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AdmissionTypeSelect;
|
export default AdmissionTypeSelect;
|
||||||
|
@ -1,21 +1,30 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Select } from 'antd';
|
import { Select } from 'antd';
|
||||||
|
|
||||||
interface options {
|
interface Option {
|
||||||
label: string;
|
label: string;
|
||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AdmissionTypeSelect = () => {
|
const AdmissionTypeSelect: React.FC<any> = (props) => {
|
||||||
const [options, setOptions] = useState<options[]>([]);
|
const [options, setOptions] = useState<Option[]>([]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setOptions([
|
setOptions([
|
||||||
{ label: '线上准入', value: 'online' },
|
{ label: '线上准入', value: 'online' },
|
||||||
{ label: '线下准入', value: 'offline' },
|
{ label: '线下准入', value: 'offline' },
|
||||||
{ label: '零星采购/应急采购/个人供应商', value: 'scattered' },
|
{ label: '零星采购/应急采购/个人供应商', value: 'scattered' },
|
||||||
])
|
]);
|
||||||
}, []);
|
}, []);
|
||||||
return <Select style={{ width: 150 }} placeholder="请选择准入方式" options={options} allowClear />;
|
|
||||||
|
return (
|
||||||
|
<Select
|
||||||
|
style={{ width: 150 }}
|
||||||
|
placeholder="请选择准入方式"
|
||||||
|
options={options}
|
||||||
|
allowClear
|
||||||
|
{...props} // 关键点,props 透传!
|
||||||
|
/>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AdmissionTypeSelect;
|
export default AdmissionTypeSelect;
|
||||||
|
@ -1,23 +1,33 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Select } from 'antd';
|
import { Select } from 'antd';
|
||||||
|
|
||||||
interface options {
|
interface Option {
|
||||||
label: string;
|
label: string;
|
||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AdmissionTypeSelect = () => {
|
// 1. 传入 props
|
||||||
const [options, setOptions] = useState<options[]>([]);
|
const AdmissionTypeSelect: React.FC<any> = (props) => {
|
||||||
|
const [options, setOptions] = useState<Option[]>([]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setOptions([
|
setOptions([
|
||||||
{ label: '未开始', value: '0' },
|
{ label: '未开始', value: '0' },
|
||||||
{ label: '进行中', value: '1' },
|
{ label: '进行中', value: '1' },
|
||||||
{ label: '结果汇总中', value: '2' },
|
{ label: '结果汇总中', value: '2' },
|
||||||
{ label: '已完成', value: '3' },
|
{ label: '已完成', value: '3' },
|
||||||
])
|
]);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return <Select style={{ width: 150 }} placeholder="请选择审批状态" options={options} allowClear />;
|
// 2. 透传 props
|
||||||
|
return (
|
||||||
|
<Select
|
||||||
|
style={{ width: 150 }}
|
||||||
|
placeholder="请选择审批状态"
|
||||||
|
options={options}
|
||||||
|
allowClear
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AdmissionTypeSelect;
|
export default AdmissionTypeSelect;
|
||||||
|
@ -1,21 +1,30 @@
|
|||||||
|
// AdmissionTypeSelect.jsx
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Select } from 'antd';
|
import { Select } from 'antd';
|
||||||
|
|
||||||
interface options {
|
interface Option {
|
||||||
label: string;
|
label: string;
|
||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AdmissionTypeSelect = () => {
|
const AdmissionTypeSelect: React.FC<any> = (props) => {
|
||||||
const [options, setOptions] = useState<options[]>([]);
|
const [options, setOptions] = useState<Option[]>([]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setOptions([
|
setOptions([
|
||||||
{ label: '境内企业', value: 'dvs' },
|
{ label: '境内企业', value: 'dvs' },
|
||||||
{ label: '境外企业', value: 'ovs' },
|
{ label: '境外企业', value: 'ovs' },
|
||||||
{ label: '个人', value: 'pe' },
|
{ label: '个人', value: 'pe' },
|
||||||
])
|
]);
|
||||||
}, []);
|
}, []);
|
||||||
return <Select style={{ width: 150 }} placeholder="请选择企业类型" options={options} allowClear />;
|
return (
|
||||||
|
<Select
|
||||||
|
style={{ width: 150 }}
|
||||||
|
placeholder="请选择企业类型"
|
||||||
|
options={options}
|
||||||
|
allowClear
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AdmissionTypeSelect;
|
export default AdmissionTypeSelect;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Modal, Form, Input, Select, Button, Upload, message, Row, Col, Descriptions } from 'antd';
|
import { Modal, Form, Input, Button, Upload, message, Row, Col, Descriptions } from 'antd';
|
||||||
import type { UploadProps } from 'antd';
|
import type { UploadProps } from 'antd';
|
||||||
import { UploadOutlined } from '@ant-design/icons';
|
import { UploadOutlined } from '@ant-design/icons';
|
||||||
import { uploadFile, attachmentskView, attachmentsAdd, attachmentsEdit } from '../services';
|
import { uploadFile, attachmentskView, attachmentsAdd, attachmentsEdit } from '../services';
|
||||||
|
@ -62,18 +62,6 @@ const OtherAttachmentsTab: React.FC<Props> = (props) => {
|
|||||||
setIsViewMode(false);
|
setIsViewMode(false);
|
||||||
setFormVisible(true);
|
setFormVisible(true);
|
||||||
};
|
};
|
||||||
// 作废 修改
|
|
||||||
const handleEdit = (record: attachmentsAdd) => {
|
|
||||||
setEditingRecord(record);
|
|
||||||
setIsViewMode(false);
|
|
||||||
setFormVisible(true);
|
|
||||||
};
|
|
||||||
// 作废 查看
|
|
||||||
const handleView = (record: attachmentsAdd) => {
|
|
||||||
setEditingRecord(record);
|
|
||||||
setIsViewMode(true);
|
|
||||||
setFormVisible(true);
|
|
||||||
};
|
|
||||||
//是否作废
|
//是否作废
|
||||||
const handleObsoleteChange = async (checked: boolean, id:string) => {
|
const handleObsoleteChange = async (checked: boolean, id:string) => {
|
||||||
// 调用你的作废接口
|
// 调用你的作废接口
|
||||||
@ -128,20 +116,6 @@ const OtherAttachmentsTab: React.FC<Props> = (props) => {
|
|||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// ...(viewType ? [] : [
|
|
||||||
// {
|
|
||||||
// title: 'page.workbench.attachments.action',
|
|
||||||
// dataIndex: 'option',
|
|
||||||
// width: 120,
|
|
||||||
// render: (_: any, record: attachmentsAdd) => (
|
|
||||||
// <>
|
|
||||||
// <a style={{ marginRight: 8 }} onClick={() => handleView(record)}>查看</a>
|
|
||||||
// <a onClick={() => handleEdit(record)}>修改</a>
|
|
||||||
// </>
|
|
||||||
// ),
|
|
||||||
// },
|
|
||||||
// ]),
|
|
||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
<div style={{ padding: '0 30px 0 0' }}>
|
<div style={{ padding: '0 30px 0 0' }}>
|
||||||
|
@ -1,18 +1,8 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Modal, Form, Input, message, Row, Col, Descriptions } from 'antd';
|
import { Modal, Form, Input, message, Row, Col, Descriptions } from 'antd';
|
||||||
import { getDictList } from '@/servers/api/dicts';
|
|
||||||
import { coscoSupplierUserView, coscoSupplierUserAdd, coscoSupplierUserEdit } from '../services';
|
import { coscoSupplierUserView, coscoSupplierUserAdd, coscoSupplierUserEdit } from '../services';
|
||||||
import { getRegionTree } from '@/servers/api/register';
|
|
||||||
import type { DictItem } from '@/servers/api/dicts';
|
|
||||||
|
|
||||||
// 地区字段转换
|
|
||||||
function convertToCascaderOptions(data: any[]): any[] {
|
|
||||||
return data.map(item => ({
|
|
||||||
label: item.name,
|
|
||||||
value: item.id,
|
|
||||||
children: item.children && item.children.length > 0 ? convertToCascaderOptions(item.children) : undefined,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
interface props {
|
interface props {
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
onOk: () => void;
|
onOk: () => void;
|
||||||
|
@ -7,7 +7,6 @@ import { uploadFile } from '../services';
|
|||||||
import type { UploadFile } from 'antd/es/upload/interface';
|
import type { UploadFile } from 'antd/es/upload/interface';
|
||||||
import { getDictList } from '@/servers/api/dicts';
|
import { getDictList } from '@/servers/api/dicts';
|
||||||
import type { DictItem } from '@/servers/api/dicts';
|
import type { DictItem } from '@/servers/api/dicts';
|
||||||
const { Option } = Select;
|
|
||||||
interface ForeignFormProps {
|
interface ForeignFormProps {
|
||||||
form: any;
|
form: any;
|
||||||
countdown: number;
|
countdown: number;
|
||||||
|
Reference in New Issue
Block a user