Просмотр исходного кода

refactor: PlatformAccount页面去掉区域列和筛选

hechuanqi 4 недель назад
Родитель
Сommit
77128739a0
2 измененных файлов с 3 добавлено и 33 удалено
  1. 3 0
      .idea/.gitignore
  2. 0 33
      src/pages/PlatformAccount/index.tsx

+ 3 - 0
.idea/.gitignore

@@ -0,0 +1,3 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml

+ 0 - 33
src/pages/PlatformAccount/index.tsx

@@ -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',