From ac4341ea6b66ae02427d39d35f41d42d78b2eb2e Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期五, 14 二月 2025 10:08:32 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/system/role/components/scope.jsx |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/zy-asrs-flow/src/pages/system/role/components/scope.jsx b/zy-asrs-flow/src/pages/system/role/components/scope.jsx
index e260ac9..b6b5d89 100644
--- a/zy-asrs-flow/src/pages/system/role/components/scope.jsx
+++ b/zy-asrs-flow/src/pages/system/role/components/scope.jsx
@@ -3,11 +3,14 @@
     ProForm,
     ProFormDigit,
 } from '@ant-design/pro-components';
+import { DownOutlined } from '@ant-design/icons';
 import { Col, Form, Modal, Row, Checkbox, Skeleton, Tree, Drawer, Space, Button, Card } from 'antd';
 import Http from '@/utils/http';
+import { FormattedMessage, useIntl } from '@umijs/max';
 import { transformTreeData, getTreeAllKeys } from '@/utils/tree-util'
 
 const Scope = (props) => {
+    const intl = useIntl();
     const [form] = Form.useForm();
     const { originMenuIds, values: { name } } = props;
     const [menuTreeLoading, setMenuTreeLoading] = useState(false);
@@ -51,14 +54,13 @@
     }
 
     const handleFinish = async (values) => {
-        console.log({ ...values, menuIds }); return
         props.onSubmit({ ...values, menuIds });
     }
 
     return (
         <>
             <Drawer
-                title={`${name}`}
+                title={`${intl.formatMessage({ id: 'page.assign.permission', defaultMessage: '鍒嗛厤鏉冮檺' })} - ${name ? name : '-'}`}
                 width={640}
                 forceRender
                 destroyOnClose
@@ -94,16 +96,15 @@
 
                         <ProForm.Item
                             name="deptIds"
-                            label="鑿滃崟鏉冮檺"
+                            label={intl.formatMessage({ id: 'page.permission.menu', defaultMessage: '鏉冮檺鑿滃崟' })}
                             colProps={{ md: 24, xl: 24 }}
                         >
-
                             <Row gutter={[16, 16]}>
                                 <Col md={24}>
                                     <Checkbox.Group
                                         options={[
-                                            { label: '灞曞紑/鎶樺彔', value: 'expandAll' },
-                                            { label: '鍏ㄩ��/鍏ㄤ笉閫�', value: 'checkAll' },
+                                            { label: intl.formatMessage({ id: 'page.role.assign.ec', defaultMessage: '灞曞紑/鎶樺彔' }), value: 'expandAll' },
+                                            { label: intl.formatMessage({ id: 'page.role.assign.sd', defaultMessage: '鍏ㄩ��/鍏ㄤ笉閫�' }), value: 'checkAll' },
                                         ]}
                                         defaultValue={['expandAll']}
                                         onChange={(values) => {
@@ -113,9 +114,9 @@
                                                 setMenuExpandedKeys([]);
                                             }
                                             if (values.includes('checkAll')) {
-
+                                                setMenuIds(menuTreeAllKeys)
                                             } else {
-
+                                                setMenuIds([]);
                                             }
                                         }} />
                                 </Col>
@@ -124,7 +125,10 @@
                                         <Skeleton active />
                                     ) : (
                                         <Tree
+                                            showLine
+                                            blockNode
                                             checkable
+                                            switcherIcon={<DownOutlined />}
                                             treeData={menuTreeData}
                                             expandedKeys={menuExpandedKeys}
                                             onExpand={(expandedKeys) => {
@@ -137,12 +141,10 @@
                                                     halfChecked: checkInfo.halfCheckedKeys  // 鐖惰妭鐐�
                                                 });
                                             }}
-                                        // defaultCheckedKeys={onSelect}
                                         />
                                     )}
                                 </Col>
                             </Row>
-
                         </ProForm.Item>
                     </ProForm>
                 </Card>

--
Gitblit v1.9.1