File tree Expand file tree Collapse file tree
packages/platform/src/app/routes/list/standard-table Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,14 +28,15 @@ export default function StandardTable(): JSX.Element | null {
2828 const { t } = useTranslation ( ) ;
2929 const modelApi = useAPI ( '/device/model' ) ;
3030 const deviceApi = useAPI ( '/device' ) ;
31- const [ deviceQuery , setDeviceQuery ] = useQueryParams < DeviceQueryParams > ( {
31+ const [ initDeviceQuery , saveDeviceQuery ] = useQueryParams < DeviceQueryParams > ( {
3232 keyword : '' ,
3333 sort : '-id' ,
3434 model : null ,
3535 status : [ ] ,
3636 page : 1 ,
3737 pageSize : 10 ,
3838 } ) ;
39+ const [ deviceQuery , setDeviceQuery ] = useImmer ( initDeviceQuery ) ;
3940 const [ deviceTable , setDeviceTable ] = useImmer ( {
4041 loading : true ,
4142 list : [ ] as DeviceDoc [ ] ,
@@ -73,6 +74,8 @@ export default function StandardTable(): JSX.Element | null {
7374
7475 const [ updateDeviceTable , setUpdateDeviceTable ] = useState ( 0 ) ;
7576 useEffect ( ( ) => {
77+ saveDeviceQuery ( deviceQuery ) ;
78+
7679 const apiQuery : any = {
7780 page : deviceQuery . page ,
7881 page_size : deviceQuery . pageSize ,
You can’t perform that action at this time.
0 commit comments