|
|
|
@ -1,4 +1,4 @@
@@ -1,4 +1,4 @@
|
|
|
|
|
import React, { useEffect, useState } from "react"; |
|
|
|
|
import React, { useEffect, useState } from "react"; |
|
|
|
|
import ReactDataGrid from "react-data-grid"; |
|
|
|
|
import "./style.scss"; |
|
|
|
|
import "react-data-grid/dist/react-data-grid.css"; |
|
|
|
@ -7,7 +7,6 @@ import { Input, Spin, Pagination, Select } from "antd";
@@ -7,7 +7,6 @@ import { Input, Spin, Pagination, Select } from "antd";
|
|
|
|
|
import { EUserStatus, IColumn, IIps, IPListType } from "@/shared"; |
|
|
|
|
import { ActionBottomBar } from "./components"; |
|
|
|
|
import { voidColumn, VOID_COLUMN_KEY } from "./configs"; |
|
|
|
|
import _ from "lodash"; |
|
|
|
|
|
|
|
|
|
interface IProps { |
|
|
|
|
tableName: string; |
|
|
|
@ -76,6 +75,8 @@ export const Table = ({
@@ -76,6 +75,8 @@ export const Table = ({
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const onRowsEmpty = () => { |
|
|
|
|
if (!paginationList.items.length) { |
|
|
|
|
const preparedRows: any = [] |
|
|
|
@ -97,6 +98,11 @@ export const Table = ({
@@ -97,6 +98,11 @@ export const Table = ({
|
|
|
|
|
setRows(paginationList.items) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
initTableSettings(); |
|
|
|
|
}, []); |
|
|
|
@ -116,11 +122,12 @@ export const Table = ({
@@ -116,11 +122,12 @@ export const Table = ({
|
|
|
|
|
}) |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const columnsRender = () => { |
|
|
|
|
const preparedColumns = columnsSort |
|
|
|
|
.map((key) => { |
|
|
|
|
const index = columns.findIndex((it) => it.key === key); |
|
|
|
|
const index = columns.findIndex((it) => it.key === key) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
...columns[index], |
|
|
|
|
width: |
|
|
|
@ -273,7 +280,7 @@ export const Table = ({
@@ -273,7 +280,7 @@ export const Table = ({
|
|
|
|
|
|
|
|
|
|
return preparedColumns.length ? preparedColumns : [voidColumn]; |
|
|
|
|
}; |
|
|
|
|
console.log("rows", rows); |
|
|
|
|
console.log('tablename', props.tableName) |
|
|
|
|
return ( |
|
|
|
|
<div className="table-grid_custom" id="table-el"> |
|
|
|
|
{paginationList.isLoading && ( |
|
|
|
@ -336,6 +343,7 @@ export const Table = ({
@@ -336,6 +343,7 @@ export const Table = ({
|
|
|
|
|
activeColumns={activeColumns} |
|
|
|
|
onChangeColumns={setActiveColumns} |
|
|
|
|
onSaveColumnsSort={setColumnsSort} |
|
|
|
|
tableName={props.tableName} |
|
|
|
|
/> |
|
|
|
|
</div> : <div /> |
|
|
|
|
} |
|
|
|
|