modal 반영 1차

main
minuk926 3 years ago
parent a8da06253d
commit a66f9f8653

@ -1,4 +1,4 @@
import { BOARD_LIST_URL, SIMSA_LIST_URL } from 'commons/ApiUrl';
import { BOARD_LIST_URL, SIMSA_DETAILS_LIST_URL, SIMSA_LIST_URL } from 'commons/ApiUrl';
import axios from 'utils/axios';
class OpstBizService {
@ -28,5 +28,14 @@ class OpstBizService {
}
return res;
};
getSimsa680DetailList = async (params) => {
const res = await axios.get(SIMSA_DETAILS_LIST_URL, { params });
if (res.success) {
res.data = res.data.map((d, idx) => ({ ...d, rowId: idx }));
return res;
}
return res;
};
}
export default new OpstBizService();

@ -2,13 +2,20 @@ import PropTypes from 'prop-types';
// material-ui
// import type { GridColumns } from '@mui/x-data-grid/colDef';
import { DataGrid } from '@mui/x-data-grid';
import { DataGrid, koKR } from '@mui/x-data-grid';
import { Box } from '@mui/material';
import { useTheme } from '@mui/material/styles';
import dataGridKoKR from './defaultDataGridLocale';
// project imports
const MuiGridList = ({ setRowId, columns, rowsState, totalCount, setRowsState }) => {
const MuiGridList = ({
setRowId,
columns,
rowsState = { page: 0, pageSize: 1000, rows: [] },
totalCount = 0,
setRowsState = () => {},
handleCellClick = () => {}
}) => {
// const { columns, rowsState, totalCount, setRowsState } = props;
const theme = useTheme();
@ -33,6 +40,8 @@ const MuiGridList = ({ setRowId, columns, rowsState, totalCount, setRowsState })
}}
>
<DataGrid
// localeText={koKR.components.MuiDataGrid.defaultProps.localeText}
localeText={dataGridKoKR}
paginationMode="server"
getRowId={(row) => row.rowId}
rowCount={totalCount}
@ -47,6 +56,7 @@ const MuiGridList = ({ setRowId, columns, rowsState, totalCount, setRowsState })
onPageSizeChange={(pageSize) => setRowsState((prev) => ({ ...prev, page: 0, pageSize }))}
rowsPerPageOptions={[10, 50, 100]}
pagination
onCellClick={handleCellClick}
/>
</Box>
);
@ -57,7 +67,8 @@ MuiGridList.propTypes = {
columns: PropTypes.array,
rowsState: PropTypes.any,
totalCount: PropTypes.number,
setRowsState: PropTypes.func
setRowsState: PropTypes.func,
handleCellClick: PropTypes.func
};
export default MuiGridList;

@ -0,0 +1,87 @@
import { GridLocaleText } from '@mui/x-data-grid';
const dataGridKoKR = {
// Root
noRowsLabel: '조회된 데이타가 없습니다',
// noResultsOverlayLabel: 'No results found.',
errorOverlayDefaultLabel: '오류가 발생했습니다. ',
// Density selector toolbar button text
toolbarDensity: '행 간격',
toolbarDensityLabel: '행 간격',
toolbarDensityCompact: '컴팩트',
toolbarDensityStandard: '표준',
toolbarDensityComfortable: '히로메',
// Columns selector toolbar button text
toolbarColumns: '열 목록',
toolbarColumnsLabel: '열 선택',
// Filters toolbar button text
toolbarFilters: '필터',
toolbarFiltersLabel: '필터 표시',
toolbarFiltersTooltipHide: '필터 숨기기',
toolbarFiltersTooltipShow: '필터 표시',
toolbarFiltersTooltipActive: (count) => `${count}개의 필터 적용 중`,
// Export selector toolbar button text
toolbarExport: '내보내기',
toolbarExportLabel: '내보내기',
toolbarExportCSV: 'CSV 다운로드',
// Columns panel text
columnsPanelTextFieldLabel: '열 찾기',
columnsPanelTextFieldPlaceholder: '검색 쿼리 입력...',
columnsPanelDragIconLabel: '열 정렬',
columnsPanelShowAllButton: '모두 표시',
columnsPanelHideAllButton: '모두 숨기기',
// Filter panel text
filterPanelAddFilter: '필터 추가',
filterPanelDeleteIconLabel: '삭제',
filterPanelOperators: '운영자',
filterPanelOperatorAnd: 'And',
filterPanelOperatorOr: 'Or',
filterPanelColumns: '열',
filterPanelInputLabel: '값',
filterPanelInputPlaceholder: '값 입력...',
// Filter operators text
filterOperatorContains: '... 포함',
filterOperatorEquals: '...와 같음',
filterOperatorStartsWith: '...로 시작',
filterOperatorEndsWith: '...로 끝나는',
filterOperatorIs: '...이다',
filterOperatorNot: '...아니오',
filterOperatorAfter: '...다음',
filterOperatorOnOrAfter: '...이후',
filterOperatorBefore: '... 이전',
filterOperatorOnOrBefore: '...이전',
// filterOperatorIsEmpty: 'is empty',
// filterOperatorIsNotEmpty: 'is not empty',
// Column menu text
columnMenuLabel: '메뉴',
columnMenuShowColumns: '열 표시',
columnMenuFilter: '필터',
columnMenuHideColumn: '열 숨기기',
columnMenuUnsort: '정렬 해제',
columnMenuSortAsc: '오름차순 정렬',
columnMenuSortDesc: '내림차순 정렬',
// Column header text
columnHeaderFiltersTooltipActive: (count) => `${count}개의 필터 적용 중`,
columnHeaderFiltersLabel: '필터 표시',
columnHeaderSortIconLabel: '정렬',
// Rows selected footer text
footerRowSelected: (count) => `${count} 행 선택`,
// Total rows footer text
footerTotalRows: '총 행 수:',
// Total visible rows footer text
footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} of ${totalCount.toLocaleString()}`
};
export default dataGridKoKR;
Loading…
Cancel
Save