260716_01_ENH: 본 서버에서 기동 후 중간 테스트를 위한 커밋
This commit is contained in:
@@ -36,6 +36,7 @@ import {
|
||||
type ListFilter,
|
||||
type ListFilterTarget,
|
||||
type listHeader,
|
||||
type ListSearchUiState,
|
||||
ListResetMode,
|
||||
type ListResetScope,
|
||||
type ListUploadRequest,
|
||||
@@ -64,6 +65,15 @@ const downloadArrayBuffer = (buffer: ArrayBuffer, filename: string, type = 'appl
|
||||
downloadFile(new Blob([buffer], { type }), filename)
|
||||
}
|
||||
|
||||
const createEmptySearchUiState = (): ListSearchUiState => ({
|
||||
searchText: '',
|
||||
searchContactResult: [],
|
||||
searchInterviewResult: [],
|
||||
searchSurveyResult: [],
|
||||
filterRows: [],
|
||||
sorting: [],
|
||||
})
|
||||
|
||||
const ListManagePage = () => {
|
||||
const router = useRouter()
|
||||
const mounted = useMounted()
|
||||
@@ -75,6 +85,8 @@ const ListManagePage = () => {
|
||||
const [messageSendMode, setMessageSendMode] = useState<MessageSendMode>('email')
|
||||
const [selectedRows, setSelectedRows] = useState<ListTableRow[]>([])
|
||||
const [currentListFilter, setCurrentListFilter] = useState<ListFilter>(() => createEmptyListFilter())
|
||||
const [filterSummary, setFilterSummary] = useState<string[]>([])
|
||||
const [searchUiState, setSearchUiState] = useState<ListSearchUiState>(createEmptySearchUiState)
|
||||
const [listRefreshKey, setListRefreshKey] = useState(0)
|
||||
const [pagination, setPagination] = useState<PaginationState>({ pageIndex: 0, pageSize: 25 })
|
||||
const [restoredVisit, setRestoredVisit] = useState<LastListVisit | null>(null)
|
||||
@@ -155,7 +167,13 @@ const ListManagePage = () => {
|
||||
|
||||
const handleStartContact = (row: ListTableRow) => {
|
||||
const sid = String(row.sid ?? '')
|
||||
setLastListVisit({ prjctIdx, sid, pageIndex: pagination.pageIndex, pageSize: pagination.pageSize })
|
||||
setLastListVisit({
|
||||
prjctIdx,
|
||||
sid,
|
||||
pageIndex: pagination.pageIndex,
|
||||
pageSize: pagination.pageSize,
|
||||
...searchUiState,
|
||||
})
|
||||
router.push(`/list/contact?sid=${encodeURIComponent(sid)}`)
|
||||
}
|
||||
|
||||
@@ -171,10 +189,11 @@ const ListManagePage = () => {
|
||||
|
||||
const handleResetConfirm = async (payload: { target: ListFilterTarget; scope: ListResetScope }) => {
|
||||
const listFilter = buildTargetFilter(payload.target)
|
||||
await resetListMutation.mutateAsync({
|
||||
const resetCount = await resetListMutation.mutateAsync({
|
||||
resetMode: payload.scope === 'result-and-history' ? ListResetMode.HIST : ListResetMode.ALL,
|
||||
listFilter,
|
||||
})
|
||||
alert(`${resetCount}건 삭제 되었습니다.`)
|
||||
refreshList()
|
||||
}
|
||||
|
||||
@@ -262,6 +281,7 @@ const ListManagePage = () => {
|
||||
enableBatchEdit={canManageList}
|
||||
refreshKey={listRefreshKey}
|
||||
onCurrentFilterChange={setCurrentListFilter}
|
||||
onFilterSummaryChange={setFilterSummary}
|
||||
onSelectedRowsChange={setSelectedRows}
|
||||
onRowClick={!canManageList ? handleStartContact : undefined}
|
||||
onRowDoubleClick={canManageList ? handleStartContact : undefined}
|
||||
@@ -271,12 +291,14 @@ const ListManagePage = () => {
|
||||
: undefined
|
||||
}
|
||||
onPaginationChange={setPagination}
|
||||
initialSearchState={restoredForThisProject}
|
||||
onSearchStateChange={setSearchUiState}
|
||||
focusRowId={restoredForThisProject?.sid}
|
||||
/>
|
||||
|
||||
{canManageList && (
|
||||
<>
|
||||
<ListResetDialog onConfirm={handleResetConfirm} />
|
||||
<ListResetDialog filterSummary={filterSummary} onConfirm={handleResetConfirm} />
|
||||
<ListUploadDialog
|
||||
onUpload={handleUploadConfirm}
|
||||
onDownloadTemplate={handleDownloadTemplate}
|
||||
@@ -288,12 +310,13 @@ const ListManagePage = () => {
|
||||
headerRows={headerManageRows}
|
||||
/>
|
||||
<ListHeaderManageDialog prjctIdx={prjctIdx} rows={headerManageRows} onConfirm={handleHeaderManageConfirm} />
|
||||
<ListDownloadDialog mode={downloadMode} onDownload={handleDownloadConfirm} />
|
||||
<ListDownloadDialog mode={downloadMode} filterSummary={filterSummary} onDownload={handleDownloadConfirm} />
|
||||
<MessageSendDialog
|
||||
mode={messageSendMode}
|
||||
listHeaders={headerManageRows}
|
||||
currentFilter={currentListFilter}
|
||||
selectedRows={selectedRows}
|
||||
filterSummary={filterSummary}
|
||||
onSent={refreshList}
|
||||
/>
|
||||
<MessageHistoryDialog />
|
||||
|
||||
@@ -219,7 +219,7 @@ const UserManagePage = () => {
|
||||
columns={columns}
|
||||
data={viewList}
|
||||
isClient={true}
|
||||
selectMode='single'
|
||||
selectMode='none'
|
||||
defaultPageSize={10}
|
||||
pageSizeOptions={[10, 20, 30, 50]}
|
||||
getRowId={(row) => row.userId} // row.id = userId
|
||||
|
||||
Reference in New Issue
Block a user