From ea74fdad8764fad398fc36bcea92cc9fd184ce29 Mon Sep 17 00:00:00 2001 From: FatttSnake Date: Wed, 15 Nov 2023 15:32:40 +0800 Subject: [PATCH] Optimize role page --- src/pages/system/Role.tsx | 260 +++++++++++++++++++------------------- 1 file changed, 130 insertions(+), 130 deletions(-) diff --git a/src/pages/system/Role.tsx b/src/pages/system/Role.tsx index 237b0ea..7271be0 100644 --- a/src/pages/system/Role.tsx +++ b/src/pages/system/Role.tsx @@ -487,6 +487,132 @@ const Role: React.FC = () => { JSON.stringify(tableParams.pagination?.current) ]) + const toolbar = ( + + + + + + + + + + 名称 + + } + suffix={ + <> + {!isRegexLegal ? ( + 非法表达式 + ) : undefined} + + .* + + + } + allowClear + value={searchName} + onChange={handleOnSearchNameChange} + onKeyDown={handleOnSearchNameKeyDown} + status={isRegexLegal ? undefined : 'error'} + /> + + + + 查询 + + + + ) + + const table = ( + + record.id} + pagination={tableParams.pagination} + loading={isLoading} + onChange={handleOnTableChange} + rowSelection={{ + type: 'checkbox', + onChange: handleOnTableSelectChange + }} + /> + + ) + + const drawerToolbar = ( + + + + + + + + 取消 + + + 提交 + + + ) + + const addAndEditForm = ( + + + + + + + + + + + + + ) + return ( <> @@ -496,87 +622,8 @@ const Role: React.FC = () => { autoHideWaitingTime={500} > - - - - - - - - - - 名称 - - } - suffix={ - <> - {!isRegexLegal ? ( - - 非法表达式 - - ) : undefined} - - .* - - - } - allowClear - value={searchName} - onChange={handleOnSearchNameChange} - onKeyDown={handleOnSearchNameKeyDown} - status={isRegexLegal ? undefined : 'error'} - /> - - - - 查询 - - - - - record.id} - pagination={tableParams.pagination} - loading={isLoading} - onChange={handleOnTableChange} - rowSelection={{ - type: 'checkbox', - onChange: handleOnTableSelectChange - }} - /> - + {toolbar} + {table} @@ -587,56 +634,9 @@ const Role: React.FC = () => { open={isDrawerOpen} closable={!isSubmitting} maskClosable={!isSubmitting} - extra={ - - - - - - - - 取消 - - - 提交 - - - } + extra={drawerToolbar} > - - - - - - - - - - - - + {addAndEditForm} {contextHolder}