瀏覽代碼

Merge branch 'master' into dev

lanjianrong 4 年之前
父節點
當前提交
78c516e67c

+ 32 - 35
src/pages/Customer/Company/components/ConnectCompany/index.less

@@ -1,44 +1,41 @@
 .inputSearch {
   width: 95%;
 }
-.modalContainer {
-  // height: 63vh;
-  .modalContent {
-    max-height: 63vh;
-    padding: 0;
-    overflow-y: auto;
-    :global(.ant-transfer-operation > .ant-btn) {
-      height: 20rem;
-      padding: 0 5px;
-    }
-    :global(.ant-transfer-operation > .ant-btn-sm > .anticon) {
-      display: none;
-    }
-    :global(.ant-transfer-operation > .ant-btn-sm > span:last-of-type) {
-      margin: 0;
-      -webkit-writing-mode: vertical-rl;
-      writing-mode: vertical-rl;
-    }
-    .card {
-      display: flex;
-      align-items: center;
-      justify-content: space-between;
-      padding: 1rem;
-      word-wrap: break-word;
-      background-color: #ffffff;
-      background-clip: border-box;
-      border: 1px solid rgba(0, 0, 0, 0.08);
-      border-radius: 4px;
-      box-shadow: 0 0 13px 0 rgba(74, 53, 107, 0.08);
-      &:not(:last-of-type) {
-        margin-bottom: 1rem;
-      }
+.modalContent {
+  max-height: 63vh;
+  padding: 0;
+  overflow-y: auto;
+  :global(.ant-transfer-operation > .ant-btn) {
+    height: 20rem;
+    padding: 0 5px;
+  }
+  :global(.ant-transfer-operation > .ant-btn-sm > .anticon) {
+    display: none;
+  }
+  :global(.ant-transfer-operation > .ant-btn-sm > span:last-of-type) {
+    margin: 0;
+    -webkit-writing-mode: vertical-rl;
+    writing-mode: vertical-rl;
+  }
+  .card {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 1rem;
+    word-wrap: break-word;
+    background-color: #ffffff;
+    background-clip: border-box;
+    border: 1px solid rgba(0, 0, 0, 0.08);
+    border-radius: 4px;
+    box-shadow: 0 0 13px 0 rgba(74, 53, 107, 0.08);
+    &:not(:last-of-type) {
+      margin-bottom: 1rem;
     }
   }
+}
 
-  .modalFooter {
-    padding: 1rem 1rem 0 1rem;
-  }
+.modalFooter {
+  padding: 1rem 1rem 0 1rem;
 }
 
 .removeTreeSwitcher {

+ 15 - 7
src/pages/Customer/Company/components/CustomPerm.jsx

@@ -133,7 +133,9 @@ const CustomPerm = ({ onConfirm, defaultValues = [], onCancel, ...resetModalProp
     // options-用于处理右侧自定义删除逻辑中,防止两个setState合并从而导致更新失败
     const node = state.transferDataSource.find(item => item.key === key)
     if (node?.isDepartment) {
-      const filterKeys = state.transferDataSource.filter(item => item.parentId === node.key).map(item => item.key)
+      const filterKeys = state.transferDataSource
+        .filter(item => item.parentId === node.key)
+        .map(item => item.key)
       setState({
         ...state,
         ...options,
@@ -195,10 +197,9 @@ const CustomPerm = ({ onConfirm, defaultValues = [], onCancel, ...resetModalProp
       getContainer={() => document.getElementById('root')}
       footer={
         <>
-          <Button className="mr-4" onClick={onCancel}>
+          <Button className="mr-2" onClick={onCancel}>
             取消
           </Button>
-
           <Button
             type="primary"
             onClick={() => {
@@ -209,11 +210,13 @@ const CustomPerm = ({ onConfirm, defaultValues = [], onCancel, ...resetModalProp
                 onConfirm({ staffIds: state.targetKeys, dataPermission: 'custom' })
               }
               onCancel()
-            }}>
+            }}
+          >
             确定
           </Button>
         </>
-      }>
+      }
+    >
       <div className={styles.modalContent}>
         <Transfer
           showSearch
@@ -221,12 +224,16 @@ const CustomPerm = ({ onConfirm, defaultValues = [], onCancel, ...resetModalProp
           titles={['部门栏', '目标栏']}
           operations={['点击添加']}
           className="h-full"
+          listStyle={{
+            height: 500
+          }}
           render={item => item.title}
           onSearch={handleOnSearch}
           dataSource={state.transferDataSource}
           targetKeys={state.targetKeys}
           onChange={onChange}
-          showSelectAll={false}>
+          showSelectAll={false}
+        >
           {({ direction, onItemSelectAll, onItemSelect }) => {
             if (direction === 'left') {
               return state.dataSource?.length ? (
@@ -330,7 +337,8 @@ const CustomPerm = ({ onConfirm, defaultValues = [], onCancel, ...resetModalProp
                           onClick={() => {
                             const currKeys = state.targetKeys.filter(i => i !== item.key)
                             handleUnCheckItem(state.treeKeys, item.key, { targetKeys: currKeys })
-                          }}>
+                          }}
+                        >
                           <DeleteOutlined />
                         </span>
                       </li>

+ 4 - 3
src/pages/Hr/Employee/components/EmployeeDetail/index.jsx

@@ -8,7 +8,7 @@ import EmployeeTabList from './TabList.jsx'
 import { apiStaffDetail } from '@/services/staff'
 
 const EmployeeDetail = props => {
-  const { visible, onClose, dispatch, refresh, updateKey = 'staff', dataId } = props
+  const { visible, dispatch, refresh, updateKey = 'staff', dataId, ...resetDrawerProps } = props
   const shouldUpdate = refresh?.[dataId ?? updateKey] || false
   const [state, setState] = useState({
     loading: false,
@@ -42,10 +42,11 @@ const EmployeeDetail = props => {
   }, [visible])
   return (
     <Drawer
+      {...resetDrawerProps}
       visible={visible}
-      onClose={onClose}
       className="zh-drawer"
-      getContainer={() => document.getElementById('root')}>
+      getContainer={() => document.getElementById('root')}
+    >
       <div className="sheet-box">
         <Row>
           <Col span={12} className="sheet-box-left">