|
|
@@ -21,12 +21,6 @@ const PlatformAccount: React.FC = () => {
|
|
|
const [platformOptions, setPlatformOptions] = useState<
|
|
|
{ label: string; value: number }[]
|
|
|
>([]);
|
|
|
- const [regionOptions, setRegionOptions] = useState<
|
|
|
- { label: string; value: number }[]
|
|
|
- >([]);
|
|
|
- const [selectedPlatform, setSelectedPlatform] = useState<
|
|
|
- number | undefined
|
|
|
- >();
|
|
|
|
|
|
useEffect(() => {
|
|
|
API.CollectPlatform.selectOptions().then((res: any) => {
|
|
|
@@ -36,19 +30,6 @@ const PlatformAccount: React.FC = () => {
|
|
|
});
|
|
|
}, []);
|
|
|
|
|
|
- // 当平台变化时,重新加载区域选项
|
|
|
- useEffect(() => {
|
|
|
- if (selectedPlatform) {
|
|
|
- API.CollectRegion.selectOptions(selectedPlatform).then((res: any) => {
|
|
|
- if (res?.code === 'success') {
|
|
|
- setRegionOptions(res.data || []);
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- setRegionOptions([]);
|
|
|
- }
|
|
|
- }, [selectedPlatform]);
|
|
|
-
|
|
|
const columns: ProColumns[] = [
|
|
|
{
|
|
|
title: 'ID',
|
|
|
@@ -65,23 +46,9 @@ const PlatformAccount: React.FC = () => {
|
|
|
fieldProps: {
|
|
|
options: platformOptions,
|
|
|
allowClear: true,
|
|
|
- onChange: (val: number | undefined) => {
|
|
|
- setSelectedPlatform(val);
|
|
|
- },
|
|
|
},
|
|
|
renderText: (_, record: any) => record?.platform_name ?? '-',
|
|
|
},
|
|
|
- {
|
|
|
- title: '区域',
|
|
|
- dataIndex: 'region_id',
|
|
|
- key: 'region_id',
|
|
|
- valueType: 'select',
|
|
|
- fieldProps: { options: regionOptions },
|
|
|
- renderText: (_, record: any) => {
|
|
|
- if (!record?.region_id || record.region_id === 0) return '不限区域';
|
|
|
- return record?.region_name ?? '-';
|
|
|
- },
|
|
|
- },
|
|
|
{
|
|
|
title: '账号名称',
|
|
|
dataIndex: 'account_username',
|