Kaynağa Gözat

Merge branch sagacare of http://39.106.8.246:3003/sagacloud/sagacloud-manager-control into sagacare

anxiaoxia 1 yıl önce
ebeveyn
işleme
7f66745bca

+ 3 - 3
src/app.tsx

@@ -27,16 +27,16 @@ export async function getInitialState(): Promise<{
   //debugger;
   let currentUser = {
     appId: 'wxda2ef261ac3cca32',
-    companyId: 'ff80c708fe72446eb790b764c3a7b66b',
+    companyId: '17fe48afcdde4d6797583c6d6270a035', // 'ff80c708fe72446eb790b764c3a7b66b',
     loginType: 'app',
     manageUserType: 3,
     name: '赵静',
     openId: 'oDcGY5Qq3Vk-7WKTNsn-lLGNT118',
     phone: '13810794283',
-    projectId: 'Pj1101099999',
+    projectId: 'Pj1101080259', //'Pj1101099999',
     userId: 'db445a9cd7be4341a14448928014605c',
   };
-  let projectId = 'Pj1101099999';
+  let projectId = 'Pj1101080259'; // 'Pj1101099999';
   if (location.pathname.indexOf('login') == -1 && token) {
     var localUser = localStorage.getItem('user') || '';
     currentUser = JSON.parse(localUser);

+ 53 - 0
src/pages/Member/components/importModal/index.jsx

@@ -0,0 +1,53 @@
+import React, { useState, useEffect } from 'react';
+import {
+  Modal,
+  Form,
+  Select,
+  Radio,
+  Checkbox,
+  Input,
+  Row,
+  Col,
+  Button,
+  InputNumber,
+  Tree,
+  Tooltip,
+  Dropdown,
+  message,
+} from 'antd';
+import Icon from '@/tenants-ui/SgIcon';
+import styles from './index.less';
+import cx from 'classnames';
+import { useModel, history } from 'umi';
+import { EllipsisOutlined } from '@ant-design/icons';
+import { ExclamationCircleOutlined } from '@ant-design/icons';
+import AreaTree from '../areaTree';
+
+import moment from 'moment';
+import { queryUserInfo, saveUserInfo, deleteUser } from '@/services/sagacare_service/member';
+
+const ImportModal = ({ onClose }) => {
+  const { initialState } = useModel('@@initialState');
+
+  return (
+    <>
+      <Modal open closable={false} footer={null} width={760}>
+        <div className={styles.modalmain}>
+          <div className={styles.header}>
+            <div
+              className={styles.close}
+              onClick={() => {
+                onClose();
+              }}
+            >
+              <Icon type="close" />
+            </div>
+          </div>
+          <div className={styles.content}></div>
+        </div>
+      </Modal>
+    </>
+  );
+};
+
+export default ImportModal;

+ 36 - 0
src/pages/Member/components/importModal/index.less

@@ -0,0 +1,36 @@
+.modalmain {
+  .header {
+    position: relative;
+    z-index: 1;
+    height: 120px;
+    background: #f3f3f3;
+    border-radius: 20px 20px 0 0;
+    .title {
+      color: #000;
+      font-weight: 400;
+      font-size: 22px;
+    }
+  }
+  .close {
+    position: absolute;
+    top: 15px;
+    right: 15px;
+    z-index: 2;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 36px;
+    height: 36px;
+    color: #c4c4c4;
+    font-size: 20px;
+    border-radius: 100%;
+    cursor: pointer;
+    transition: background-color 0.1s cubic-bezier(0.075, 0.82, 0.165, 1);
+    &:hover {
+      background-color: #fff;
+    }
+  }
+  .content {
+    padding: 50px 60px 20px;
+  }
+}

+ 8 - 10
src/pages/Member/components/personModal/index.jsx

@@ -18,7 +18,7 @@ import {
 import Icon from '@/tenants-ui/SgIcon';
 import styles from './index.less';
 import cx from 'classnames';
-import { useModel } from 'umi';
+import { useModel, history } from 'umi';
 import { EllipsisOutlined } from '@ant-design/icons';
 import { ExclamationCircleOutlined } from '@ant-design/icons';
 import AreaTree from '../areaTree';
@@ -28,7 +28,6 @@ import { queryUserInfo, saveUserInfo, deleteUser } from '@/services/sagacare_ser
 
 const PersonModal = ({
   spaceMap,
-  statusArr,
   checkUser,
   checkSign,
   setCheckSign,
@@ -135,8 +134,8 @@ const PersonModal = ({
   ];
   const UserTypeArr = {
     1: '普通成员',
-    2: '管理员',
-    3: '临时成员',
+    2: '临时成员',
+    3: '管理员',
   };
   const invalidPerson = () => {
     //填写的用户名不对
@@ -144,7 +143,7 @@ const PersonModal = ({
     deleteUser({ userId: checkUser.userId })
       .then((res) => {
         onClose();
-        refreshList();
+        history.push(`/member/invalid`);
       })
       .catch((err) => {});
   };
@@ -169,11 +168,10 @@ const PersonModal = ({
               <div className={styles.status}>
                 <span
                   className={cx(styles.circle, {
-                    [styles.activated]: checkUser.status == '3',
-                    [styles.invalid]: checkUser.status == '5',
+                    [styles.activated]: checkUser.status == '待激活',
                   })}
                 ></span>
-                <span className={styles.cont}>{statusArr[checkUser.status]}</span>
+                <span className={styles.cont}>{checkUser.status}</span>
                 {!checkUser.oaId && checkUser.status != 5 && (
                   <Dropdown menu={{ items: menuItems }}>
                     <EllipsisOutlined style={{ color: '#C4C4C4', fontSize: '20px' }} />
@@ -245,8 +243,8 @@ const PersonModal = ({
                         ) : (
                           <Select placeholder="选择成员类型" style={{ width: 300, height: 50 }}>
                             <Select.Option value="1">普通成员</Select.Option>
-                            <Select.Option value="2">管理员</Select.Option>
-                            <Select.Option value="3">临时成员</Select.Option>
+                            <Select.Option value="3">管理员</Select.Option>
+                            <Select.Option value="2">临时成员</Select.Option>
                           </Select>
                         )}
                       </Form.Item>

+ 1 - 1
src/pages/Member/index.less

@@ -4,7 +4,7 @@
     width: 8px;
     height: 8px;
     margin-right: 8px;
-    background: rgba(0, 220, 35, 1);
+    background: #00dc23;
     border-radius: 100%;
     &.activated {
       background: #c1ea6c;

+ 30 - 11
src/pages/Member/index.tsx

@@ -8,6 +8,7 @@ import Search from '@/sagacare_components/Search';
 import Table from '@/sagacare_components/Table';
 import Empty from './components/Empty';
 import PersonModal from './components/personModal';
+import ImportModal from './components/importModal';
 import { EllipsisOutlined } from '@ant-design/icons';
 
 import {
@@ -20,6 +21,7 @@ const Member: React.FC = () => {
   const { initialState } = useModel('@@initialState');
 
   const [perVisible, setPerVisible] = useState(false); //人员对话框显示
+  const [importVisible, setImportVisible] = useState(false); //人员对话框显示
   const [temporary, setTemporary] = useState(false); //是否是临时成员添加
   const [invalidSign, setInvalidSign] = useState(false); //显示作废
   const [spaceMap, setSpaceMap] = useState<any>();
@@ -36,11 +38,17 @@ const Member: React.FC = () => {
   const [checkUser, setCheckUser] = useState({}); //查看的人
   const [checkSign, setCheckSign] = useState('add'); // 三种状态 查看 编辑 新增
   const [refreshNum, setRefreshNum] = useState(0); //刷新列表
-  const statusArr = {
-    2: '正常',
-    3: '待激活',
-    5: '已作废',
+  // const statusArr = {
+  //   2: '正常',
+  //   3: '待激活',
+  //   5: '已作废',
+  // };
+  const userTpeyArr = {
+    1: '普通成员',
+    2: '临时成员',
+    3: '管理员',
   };
+
   const [sorter, setSorter] = useState<any>({
     updateDate: 'DESC', //'ASC' : 'DESC'
   });
@@ -57,10 +65,13 @@ const Member: React.FC = () => {
         filteredValue: [],
         single: true,
         filters: [
-          { value: '1', label: '正式成员' },
+          { value: '1', label: '普通成员' },
           { value: '2', label: '临时成员' },
           { value: '3', label: '管理员' },
         ],
+        render: function (content, item, index) {
+          return <span>{userTpeyArr[content]}</span>;
+        },
       },
       {
         title: '手机号',
@@ -96,11 +107,10 @@ const Member: React.FC = () => {
             <div>
               <span
                 className={cx(styles.circle, {
-                  [styles.activated]: content == '3',
-                  [styles.invalid]: content == '5',
+                  [styles.activated]: content == '待激活',
                 })}
               ></span>
-              <span>{statusArr[content]}</span>
+              <span>{content}</span>
             </div>
           );
         },
@@ -165,16 +175,23 @@ const Member: React.FC = () => {
   const refreshList = () => {
     setRefreshNum(refreshNum + 1);
   };
-  const onClose = (param) => {
+  const onClose = () => {
     setPerVisible(false);
   };
 
+  const onImClose = () => {
+    setImportVisible(false);
+  };
+  const showImport = () => {
+    setImportVisible(true);
+  };
   useEffect(() => {
     var paramObj = {
       criteria: {
         param: searchStr,
         status: 1,
         companyId: initialState?.currentUser?.companyId,
+        // manageUserType: [],
       },
       page: page.pageNum,
       size: page.pageSize,
@@ -283,7 +300,9 @@ const Member: React.FC = () => {
               </>
             ) : (
               <>
-                <div className={styles.allIn}>批量导入</div>
+                <div className={styles.allIn} onClick={showImport}>
+                  批量导入
+                </div>
                 <div
                   className={styles.invalid}
                   onClick={() => {
@@ -333,12 +352,12 @@ const Member: React.FC = () => {
           checkSign={checkSign}
           onClose={onClose}
           setCheckSign={setCheckSign}
-          statusArr={statusArr}
           setInvalidSign={setInvalidSign}
           spaceMap={spaceMap}
           refreshList={refreshList}
         ></PersonModal>
       )}
+      {importVisible && <ImportModal onClose={onImClose}></ImportModal>}
     </div>
   );
 };

+ 13 - 5
src/pages/Member/invalid/index.jsx

@@ -23,6 +23,11 @@ export default (props) => {
     updateDate: 'DESC', //'ASC' : 'DESC'
   });
   const [searchStr, setSearchStr] = useState();
+  const userTpeyArr = {
+    1: '普通成员',
+    2: '临时成员',
+    3: '管理员',
+  };
 
   useEffect(() => {
     var paramObj = {
@@ -64,14 +69,17 @@ export default (props) => {
       },
       {
         title: '类型',
-        dataIndex: 'type',
+        dataIndex: 'manageUserType',
         filteredValue: [],
         single: true,
         filters: [
-          { value: 'a', label: '普通成员' },
-          { value: 'b', label: '管理员' },
-          { value: 'c', label: '临时成员' },
+          { value: '1', label: '普通成员' },
+          { value: '2', label: '临时成员' },
+          { value: '3', label: '管理员' },
         ],
+        render: function (content, item, index) {
+          return <span>{userTpeyArr[content]}</span>;
+        },
       },
       {
         title: '手机号',
@@ -90,7 +98,7 @@ export default (props) => {
       },
       {
         title: '状态',
-        dataIndex: 'state',
+        dataIndex: 'status',
         render: function (content, item, index) {
           return (
             <div>

+ 1 - 1
src/pages/Member/invalid/index.less

@@ -4,7 +4,7 @@
     width: 8px;
     height: 8px;
     margin-right: 8px;
-    background: rgba(0, 220, 35, 1);
+    background: #ef6666;
     border-radius: 100%;
   }
   .bottomTable {

+ 2 - 2
src/sagacare_components/PageHeader/index.less

@@ -8,13 +8,13 @@
   }
   .ntitle {
     margin-right: 6px;
-    color: #ccc;
+    color: #656872;
     font-weight: 600;
     font-size: 24px;
     cursor: pointer;
     &::before {
       margin-right: 6px;
-      color: #ccc;
+      color: #656872;
       font-weight: normal;
       font-size: 32px;
       content: '/';

+ 0 - 11
src/sagacare_components/PageHeader/index.tsx

@@ -41,17 +41,6 @@ const PageHeader: React.FC<PageHeaderProps> = ({ title, action }) => {
     <>
       <div className={styles.navHeader}>
         <div className={styles.menuDiv}>
-          {/* {(menuList || []).map((item, index) => {
-            if (item.id == pathId) {
-              return (
-                <div className={cx(styles.ntitle, styles.selTitle)} key={index + 'nav'}>
-                  {item.name}
-                </div>
-              );
-            } else {
-              return null;
-            }
-          })} */}
           <div className={cx(styles.ntitle, styles.selTitle)}>{title}</div>
         </div>
         {action}

+ 2 - 2
src/sagacare_components/head/index.less

@@ -1,13 +1,13 @@
 .ntitle {
   //   margin-right: 6px;
-  color: #ccc;
+  color: #656872;
   font-weight: 600;
   font-size: 20px;
   cursor: pointer;
   &::before {
     margin-right: 5px;
     margin-left: 6px;
-    color: #ccc;
+    color: #656872;
     font-weight: normal;
     font-size: 23px;
     content: '/';