Prechádzať zdrojové kódy

fix: BsUi组件修改

hanxiaohui 5 mesiacov pred
rodič
commit
8dec184b23
1 zmenil súbory, kde vykonal 4 pridanie a 15 odobranie
  1. 4 15
      src/components/BsUi/Table/index.js

+ 4 - 15
src/components/BsUi/Table/index.js

@@ -111,14 +111,11 @@ export const useBsTable = (options, tableRef) => {
       const searchParams = getSearchParams();
 
       if (isEmpty(tableOptions?.url)) {
-        setTimeout(() => {
-          setLoading(false);
-          setPageTotal(tableOptions.gridOptions.data.length);
-          setPagerVisible(false);
-          resolve(tableOptions.gridOptions.data);
-        }, 500);
+        setLoading(false);
+        setPageTotal(tableOptions.gridOptions.data.length);
+        setPagerVisible(false);
+        resolve(tableOptions.gridOptions.data);
       } else {
-
         const otherParams = !isEmpty(customParams) ? { ...customParams } : {};
         console.log("入参为 =====>", { pageNum, pageSize, ...searchParams, ...otherParams })
         const resData = await getTableDataApi(tableOptions?.url,{ pageNum, pageSize, ...searchParams, ...otherParams });
@@ -127,14 +124,6 @@ export const useBsTable = (options, tableRef) => {
         setTableData(data.list);
         setPageTotal(data.total);
         resolve(data);
-
-        // setTimeout(() => {
-        //   setLoading(false);
-        //   setTableData([{name: "12334"}]);
-        //   setPageTotal(1000);
-        //   resolve();
-        // }, 1000);
-
       }
     });
   };