feat: add role fetching functionality to DetailUser component

This commit is contained in:
2025-10-10 14:49:16 +07:00
parent c312577d50
commit 5f6c156c12
2 changed files with 52 additions and 12 deletions

View File

@@ -4,7 +4,14 @@ import { Modal, Form, Input, Select, Row, Col } from 'antd';
const { TextArea } = Input;
const { Option } = Select;
const DetailRole = memo(function DetailRole({ visible, onCancel, onOk, form, editingKey, readOnly }) {
const DetailRole = memo(function DetailRole({
visible,
onCancel,
onOk,
form,
editingKey,
readOnly,
}) {
const getModalTitle = () => {
if (readOnly) return 'Detail Role';
if (editingKey) return 'Edit Role';
@@ -22,12 +29,7 @@ const DetailRole = memo(function DetailRole({ visible, onCancel, onOk, form, edi
width={600}
cancelButtonProps={{ style: readOnly ? { display: 'none' } : {} }}
>
<Form
form={form}
layout="vertical"
name="roleForm"
disabled={readOnly}
>
<Form form={form} layout="vertical" name="roleForm" disabled={readOnly}>
<Row gutter={16}>
<Col span={24}>
<Form.Item
@@ -61,6 +63,7 @@ const DetailRole = memo(function DetailRole({ visible, onCancel, onOk, form, edi
<Option value={1}>Level 1</Option>
<Option value={2}>Level 2</Option>
<Option value={3}>Level 3</Option>
<Option value={4}>Level 4</Option>
</Select>
</Form.Item>
</Col>