Add permission

This commit is contained in:
2024-02-18 18:06:26 +08:00
parent 3c495cfa16
commit b478081600
2 changed files with 25 additions and 18 deletions

View File

@@ -24,6 +24,7 @@ import Icon from '@ant-design/icons'
import compiler from '@/components/Playground/compiler.ts'
import { base64ToFiles, IMPORT_MAP_FILE_NAME, strToBase64 } from '@/components/Playground/files.ts'
import { IImportMap } from '@/components/Playground/shared.ts'
import Permission from '@/components/common/Permission.tsx'
const Tools = () => {
const navigate = useNavigate()
@@ -125,28 +126,32 @@ const Tools = () => {
>
</a>
{record.review === 'PROCESSING' && (
<Permission operationCode={['system:tool:modify:tool']}>
{record.review === 'PROCESSING' && (
<a
style={{ color: COLOR_PRODUCTION }}
onClick={handleOnReviewBtnClick(record)}
>
</a>
)}
{record.review === 'PASS' && (
<a
style={{ color: COLOR_PRODUCTION }}
onClick={handleOnOffShelveBtnClick(record)}
>
</a>
)}
</Permission>
<Permission operationCode={['system:tool:delete:tool']}>
<a
style={{ color: COLOR_PRODUCTION }}
onClick={handleOnReviewBtnClick(record)}
onClick={handleOnDeleteBtnClick(record)}
>
</a>
)}
{record.review === 'PASS' && (
<a
style={{ color: COLOR_PRODUCTION }}
onClick={handleOnOffShelveBtnClick(record)}
>
</a>
)}
<a
style={{ color: COLOR_PRODUCTION }}
onClick={handleOnDeleteBtnClick(record)}
>
</a>
</Permission>
</AntdSpace>{' '}
</>
)