diff --git a/src/components/alert-info/block.tsx b/src/components/alert-info/block.tsx index 774cc87b..13c0d79e 100644 --- a/src/components/alert-info/block.tsx +++ b/src/components/alert-info/block.tsx @@ -30,6 +30,7 @@ const ContentWrapper = styled.div<{ $hasTitle: boolean }>` ? 'var(--ant-color-text-secondary)' : 'var(--ant-color-text)'}; font-weight: var(--font-weight-500); + white-space: pre-line; `; const AlertInfo: React.FC = (props) => { diff --git a/src/components/echarts/config.ts b/src/components/echarts/config.ts index f08eecdc..9e5e1f1a 100644 --- a/src/components/echarts/config.ts +++ b/src/components/echarts/config.ts @@ -6,7 +6,7 @@ import { useMemo } from 'react'; export const grid = { left: 0, - right: 20, + right: 0, bottom: 20, containLabel: true }; diff --git a/src/hooks/use-table-fetch.ts b/src/hooks/use-table-fetch.ts index f28edb4b..ad6cb519 100644 --- a/src/hooks/use-table-fetch.ts +++ b/src/hooks/use-table-fetch.ts @@ -7,6 +7,8 @@ import _ from 'lodash'; import qs from 'query-string'; import { useEffect, useRef, useState } from 'react'; +type EventsType = 'CREATE' | 'UPDATE' | 'DELETE' | 'INSERT'; + type WatchConfig = | { watch?: false | undefined; API?: string; polling?: boolean } | { watch: true; API: string; polling?: false | undefined } @@ -18,6 +20,7 @@ export default function useTableFetch( deleteAPI?: (id: number, params?: any) => Promise; contentForDelete?: string; defaultData?: any[]; + events?: EventsType[]; } & WatchConfig ) { const { @@ -27,7 +30,8 @@ export default function useTableFetch( API, polling = false, watch, - defaultData = [] + defaultData = [], + events = ['UPDATE', 'DELETE', 'INSERT'] } = options; const pollingRef = useRef(null); const chunkRequedtRef = useRef(null); @@ -57,7 +61,7 @@ export default function useTableFetch( }); const { setChunkRequest } = useSetChunkRequest(); const { updateChunkedList, cacheDataListRef } = useUpdateChunkedList({ - events: ['UPDATE', 'DELETE', 'INSERT'], + events: events, dataList: dataSource.dataList, setDataList(list, opts?: any) { setDataSource((pre) => {