搜索弄成全局
This commit is contained in:
@ -9,6 +9,8 @@ import { useIntl, connect } from 'umi';
|
||||
//本地组件、弹窗、业务逻辑
|
||||
import SupplierViewModal from './components/SupplierViewModal';
|
||||
import SupplierDetailModal from './components/SupplierDetailModal';
|
||||
import RegionTypeSelect from '@/components/CommonSelect/RegionTypeSelect'
|
||||
import AccessStatusSelect from '@/components/CommonSelect/AccessStatusSelect'
|
||||
//本地服务/接口
|
||||
import { getRegisterPage } from './services';
|
||||
//统一列表分页
|
||||
@ -23,15 +25,12 @@ interface Data {
|
||||
regTime: string;
|
||||
status: string;
|
||||
}
|
||||
//下拉数据接口
|
||||
type OptionType = { label: string; value: string };
|
||||
//准入状态
|
||||
const statusColor = (status: string) => {
|
||||
if (status === '已驳回' || status === '已退出') return '#ef6969';
|
||||
if (status === '已准入') return '#004f8e';
|
||||
return undefined;
|
||||
};
|
||||
|
||||
interface RegistrationQueryProps {
|
||||
dispatch: any;
|
||||
}
|
||||
@ -54,10 +53,6 @@ const RegistrationQuery: React.FC<RegistrationQueryProps> = ({ dispatch }) => {
|
||||
const [detailVisible, setDetailVisible] = useState(false);
|
||||
//查看、准入明细 参数传递
|
||||
const [currentRecord, setCurrentRecord] = useState('');
|
||||
// 境内/境外下拉数据
|
||||
const [regionOptions, setRegionOptions] = useState<OptionType[]>([]);
|
||||
//状态 下拉数据
|
||||
const [statusOptions, setStatusOptions] = useState<OptionType[]>([]);
|
||||
// 搜索
|
||||
const handleSearch = () => {
|
||||
setPagination({ ...pagination, current: 1 });
|
||||
@ -87,18 +82,6 @@ const RegistrationQuery: React.FC<RegistrationQueryProps> = ({ dispatch }) => {
|
||||
};
|
||||
//初始化
|
||||
useEffect(() => {
|
||||
// 境内/境外 下拉
|
||||
setRegionOptions([
|
||||
{ label: '境内企业', value: 'dvs' },
|
||||
{ label: '境外企业', value: 'ovs' },
|
||||
{ label: '个人', value: 'pe' },
|
||||
])
|
||||
//状态 下拉
|
||||
setStatusOptions([
|
||||
{ label: '未准入', value: '0' },
|
||||
{ label: '已准入', value: '1' },
|
||||
{ label: '退出', value: '2' },
|
||||
])
|
||||
//列表
|
||||
getList();
|
||||
}, [])
|
||||
@ -199,19 +182,11 @@ const RegistrationQuery: React.FC<RegistrationQueryProps> = ({ dispatch }) => {
|
||||
<Form.Item name="name" label="供应商名称">
|
||||
<Input placeholder="请输入供应商名称关键字" style={{ width: 220 }} allowClear maxLength={20} />
|
||||
</Form.Item>
|
||||
<Form.Item name="supplierType" label="境内/境外">
|
||||
<Select style={{ width: 160 }} placeholder="请选择境内/境外" allowClear>
|
||||
{regionOptions.map(opt => (
|
||||
<Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
<Form.Item name="supplierType" label="企业类型">
|
||||
<RegionTypeSelect />
|
||||
</Form.Item>
|
||||
<Form.Item name="accessStatus" label="准入状态">
|
||||
<Select style={{ width: 160 }} placeholder="请选择状态" allowClear>
|
||||
{statusOptions.map(opt => (
|
||||
<Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
<AccessStatusSelect />
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button className="buttonSubmit" type="primary" htmlType="submit" icon={<SearchOutlined />}>查询</Button>
|
||||
|
Reference in New Issue
Block a user