UserManage.js 49.9 KB
Newer Older
1
import React, { useState, useEffect } from 'react';
陈前坚's avatar
陈前坚 committed
2
import {
3
  // Tree,
陈前坚's avatar
陈前坚 committed
4 5 6 7 8 9 10
  Table,
  Space,
  message,
  Modal,
  Input,
  notification,
  Tooltip,
陈前坚's avatar
陈前坚 committed
11
  Card,
陈前坚's avatar
陈前坚 committed
12
  Button,
13
  Spin,
陈前坚's avatar
陈前坚 committed
14 15
  Dropdown,
  Menu,
皮倩雯's avatar
皮倩雯 committed
16
  Popconfirm,
17 18
  Form,
  Radio,
陈前坚's avatar
陈前坚 committed
19 20
} from 'antd';
import {
21
  UserOutlined,
陈前坚's avatar
陈前坚 committed
22
  UserAddOutlined,
陈前坚's avatar
陈前坚 committed
23
  UsergroupAddOutlined,
陈前坚's avatar
陈前坚 committed
24
  EditOutlined,
陈前坚's avatar
陈前坚 committed
25
  EditTwoTone,
陈前坚's avatar
陈前坚 committed
26
  DeleteOutlined,
27
  IdcardOutlined,
陈前坚's avatar
陈前坚 committed
28
  UnlockOutlined,
陈前坚's avatar
陈前坚 committed
29
  ApartmentOutlined,
陈前坚's avatar
陈前坚 committed
30
  StopOutlined,
陈前坚's avatar
陈前坚 committed
31 32
  DoubleLeftOutlined,
  DoubleRightOutlined,
陈前坚's avatar
陈前坚 committed
33
  DownOutlined,
mayongxin's avatar
mayongxin committed
34
  BorderlessTableOutlined,
皮倩雯's avatar
皮倩雯 committed
35 36 37 38 39
  LockOutlined,
  PlusSquareFilled,
  EllipsisOutlined,
  PlusOutlined,
  SyncOutlined,
陈前坚's avatar
陈前坚 committed
40
} from '@ant-design/icons';
41
import PageContainer from '@/components/BasePageContainer';
陈前坚's avatar
陈前坚 committed
42 43
import voca from 'voca';
import zhCN from 'antd/es/locale/zh_CN';
44 45
import {
  addToOrg,
陈前坚's avatar
陈前坚 committed
46
  addToOrgs,
47 48 49
  getOneOUUserListNew,
  getUserRelationList,
  getUserTree,
张烨's avatar
张烨 committed
50 51
  deleteUser as postDeleteUser,
  setUserState as postSetUserState,
陈前坚's avatar
陈前坚 committed
52
  multiDeleteUsers,
mayongxin's avatar
mayongxin committed
53
  setOrgArea,
mayongxin's avatar
mayongxin committed
54
  getOrgArea,
mayongxin's avatar
mayongxin committed
55
  GetMapSetByGroupID,
mayongxin's avatar
mayongxin committed
56 57 58 59 60 61 62 63 64 65 66 67
  GetOUTreeNew,
  GetUserRelationListNew,
  GetUserByKeyNew,
  AddUserNew,
  AddOUNew,
  EditOneOUInfoNew,
  EditUserNew,
  UserStateOUNew,
  DeleteOUNew,
  SetUserRelationListNew,
  JumpToAnotherOUNew,
  DeleteUserNew,
68
  loadAllUserRole
69
} from '@/services/userCenter/userManage/api';
70
import { AddUserAuthSetting, GetUserAuthSet } from '@/services/database/api';
71
import Tree from '@/components/ExpendableTree';
陈前坚's avatar
陈前坚 committed
72
import classnames from 'classnames';
73
import DraggleLayout from 'components/DraggleLayout';
陈前坚's avatar
陈前坚 committed
74
import AddUserModal from './AddUserModal';
75 76 77 78 79 80
import AddSubOrgModal from './AddSubOrgModal';
import EditOrgModal from './EditOrgModal';
import DeleteOrgModal from './DeleteOrgModal';
import RelateRoleModal from './RelateRoleModal';
import EditUserModal from './EditUserModal';
import ChangePasswordModal from './ChangePasswordModal';
皮倩雯's avatar
皮倩雯 committed
81 82
import MapScopeEditModal from '@/components/MapScope';
import AuthModal from './AuthModal';
陈前坚's avatar
陈前坚 committed
83
import styles from './UserManage.less';
皮倩雯's avatar
皮倩雯 committed
84
import { createGuid } from '@/utils/transformUtil';
陈前坚's avatar
陈前坚 committed
85 86

const UserManage = () => {
皮倩雯's avatar
皮倩雯 committed
87 88
  const { TreeNode } = Tree;

89 90
  const [form] = Form.useForm();
  const { Item } = Form;
91
  const [selectValue, setSelctValue] = useState(); // 用户鉴权
92 93

  const [width, setWidth] = useState(50);
陈前坚's avatar
陈前坚 committed
94
  const [treeLoading, setTreeLoading] = useState(false);
陈前坚's avatar
陈前坚 committed
95
  const [tableLoading, setTableLoading] = useState(false);
陈前坚's avatar
陈前坚 committed
96
  const [loading, setLoading] = useState(true);
97
  const [currentOrgOperate, setCurrentOrgOperate] = useState(false); // 是否禁用当前机构操作
陈前坚's avatar
陈前坚 committed
98 99
  const [multiOperate, setMultiOperate] = useState(true); // 是否禁用用户批量操作
  const [multiOperateButtonType, setMultiOperateButtonType] = useState(''); // 更改批量操作按钮样式
陈前坚's avatar
陈前坚 committed
100

陈前坚's avatar
陈前坚 committed
101
  const [treeData, setTreeData] = useState([]); // 用户机构树
陈前坚's avatar
陈前坚 committed
102
  const [treeDataCopy, setTreeDataCopy] = useState([]); // 机构树数据备份,用于更改机构
陈前坚's avatar
陈前坚 committed
103 104
  const [treeState, setTreeState] = useState(true); // 树第一次加载
  const [treeVisible, setTreeVisible] = useState(true); // 树是否可见
陈前坚's avatar
陈前坚 committed
105
  const [tableData, setTableData] = useState([]); // 用户表
106
  const [selectColor, setSelectColor] = useState({}); // 当前选中颜色,操作时设置
陈前坚's avatar
陈前坚 committed
107
  const [orgFilters, setOrgFilters] = useState([]); // 用户列筛选
陈前坚's avatar
陈前坚 committed
108
  const [searchWord, setSearchWord] = useState(''); // 关键字
皮倩雯's avatar
皮倩雯 committed
109
  const [currentSelectOrg1, setCurrentSelectOrg1] = useState('-1');
110
  const [currentSelectOrg, setCurrentSelectOrg] = useState('-1'); // 左侧机构树-选中组织,字符串类型默认全部机构'-1',注意用户表中的OUID是数字
陈前坚's avatar
陈前坚 committed
111
  const [currentSelectOldOrg, setCurrentSelectOldOrg] = useState([]); // 更改机构时的树-原先选中组织
皮倩雯's avatar
皮倩雯 committed
112
  const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
陈前坚's avatar
陈前坚 committed
113

陈前坚's avatar
陈前坚 committed
114 115 116 117 118
  /** ***Modal弹框,是否可视**** */
  const [userVisible, setUserVisible] = useState(false); // 添加用户
  const [addOrgVisible, setAddOrgVisible] = useState(false); // 添加机构
  const [editOrgVisible, setEditOrgVisible] = useState(false); // 编辑机构
  const [deleteOrgVisible, setDeleteOrgVisible] = useState(false); // 删除机构
mayongxin's avatar
mayongxin committed
119
  const [editOrgExtentVisible, setEditOrgExtentVisible] = useState(false); // 删除机构
陈前坚's avatar
陈前坚 committed
120
  const [roleVisible, setRoleVisible] = useState(false); // 关联角色
陈前坚's avatar
陈前坚 committed
121 122 123
  const [changeOrgVisible, setChangeOrgVisible] = useState(false); // 更改机构
  const [passwordVisible, setPasswordVisible] = useState(false); // 修改密码
  const [editUserVisible, setEditUserVisible] = useState(false); // 编辑用户
皮倩雯's avatar
皮倩雯 committed
124
  // const [freezeUserVisible, setFreezeUserVisible] = useState(false); // 冻结用户
陈前坚's avatar
陈前坚 committed
125
  const [deleteUserVisible, setDeleteUserVisible] = useState(false); // 删除用户
mayongxin's avatar
mayongxin committed
126
  const [authUserVisible, setAuthUserVisible] = useState(false); // 鉴权用户
陈前坚's avatar
陈前坚 committed
127

陈前坚's avatar
陈前坚 committed
128
  const [orgTitle, setOrgTitle] = useState('当前机构'); // 弹框标题
皮倩雯's avatar
皮倩雯 committed
129
  const [orgTitle1, setOrgTitle1] = useState('当前机构'); // 弹框标题
130
  const [description, setDescription] = useState(''); // 机构描述信息
131 132
  const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 已选用户数,机构改变时重置
  const [tableLength, setTableLength] = useState(0); // 当前机构用户总数
陈前坚's avatar
陈前坚 committed
133
  const [orgID, setOrgID] = useState(); // 当前选择的机构ID
陈前坚's avatar
陈前坚 committed
134 135
  const [newOrgID, setNewOrgID] = useState(); // 更改机构新选择的ID
  const [currentUser, setCurrentUser] = useState({}); // 当前用户
136

137 138 139
  const [mult, setMult] = useState('')//判断是否是批量关联
  const [multiRoleList, setMultiRoleList] = useState([])
  const [multistationList, setMultiStationList] = useState([])
陈前坚's avatar
陈前坚 committed
140 141 142 143
  const [userIDs, setUserIDs] = useState(''); // 批量删除的用户
  const [orgIDs, setOrgIDs] = useState(''); // 批量操作的机构
  const [multiDelete, setMultiDelete] = useState(false); // 是否批量删除用户
  const [multiChangeOrgs, setMultiChangeOrgs] = useState(false); // 是否批量更改机构
陈前坚's avatar
陈前坚 committed
144
  const [multiRelateRoles, setMultiRelateRoles] = useState(false); // 是否批量更改机构
陈前坚's avatar
陈前坚 committed
145

陈前坚's avatar
陈前坚 committed
146 147
  const [rolelist, setRolelist] = useState([]); // 角色列表
  const [stationlist, setStationlist] = useState([]); // 站点列表
mayongxin's avatar
mayongxin committed
148

皮倩雯's avatar
皮倩雯 committed
149 150 151 152
  const [orgAreas, setOrgAreas] = useState([]);
  const [currentOrgArea, setCurrentOrgArea] = useState('');
  const [currentOrgDistinct, setCurrentOrgDistinct] = useState('');
  const [saveExtentFlag, setSaveExtentFlag] = useState(0);
皮倩雯's avatar
皮倩雯 committed
153
  const [filteredValue, setFilteredValue] = useState([]);
皮倩雯's avatar
皮倩雯 committed
154 155
  const [keep1, setKeep1] = useState([4]); // 存储树选择
  const [id, setId] = useState('');
陈前坚's avatar
陈前坚 committed
156
  const { Search } = Input;
157 158
  const setRowClassName = record =>
    record.userID === selectColor.userID ? styles.clickRowStyle : '';
陈前坚's avatar
陈前坚 committed
159 160 161 162 163 164
  // 用户表列名
  const columns = [
    {
      title: '登录名',
      dataIndex: 'loginName',
      key: 'loginName',
165
      width: 150,
166
      // fixed: 'left',
皮倩雯's avatar
皮倩雯 committed
167
      render: item => searchStyle(item),
陈前坚's avatar
陈前坚 committed
168 169 170 171 172
    },
    {
      title: '用户姓名',
      dataIndex: 'userName',
      key: 'userName',
173
      width: 150,
皮倩雯's avatar
皮倩雯 committed
174
      render: item => searchStyle(item),
陈前坚's avatar
陈前坚 committed
175
    },
176 177 178 179
    {
      title: '所在机构',
      dataIndex: 'OUName',
      key: 'OUName',
180
      width: 150,
181
      ellipsis: true,
陈前坚's avatar
陈前坚 committed
182
      filters: orgFilters,
183
      filteredValue,
陈前坚's avatar
陈前坚 committed
184
      onFilter: (value, record) => record.OUName === value,
185
    },
陈前坚's avatar
陈前坚 committed
186 187 188 189
    {
      title: '手机号码',
      dataIndex: 'phone',
      key: 'phone',
陈前坚's avatar
陈前坚 committed
190
      width: 150,
陈前坚's avatar
陈前坚 committed
191
      ellipsis: true,
皮倩雯's avatar
皮倩雯 committed
192 193 194
      render: text => {
        if (text) {
          return searchStyle(text);
195
        }
tianfen's avatar
tianfen committed
196
        return <span>未绑定</span>;
197
      },
陈前坚's avatar
陈前坚 committed
198 199 200 201 202
    },
    {
      title: '钉钉账户',
      dataIndex: 'ddid',
      key: 'ddid',
陈前坚's avatar
陈前坚 committed
203
      width: 150,
陈前坚's avatar
陈前坚 committed
204 205 206 207 208 209 210 211 212 213
      render: record => {
        if (record) {
          return (
            <Tooltip title={record}>
              <span style={{ color: '#50aefc', cursor: 'pointer' }}>
                已绑定
              </span>
            </Tooltip>
          );
        }
tianfen's avatar
tianfen committed
214
        return <span>未绑定</span>;
陈前坚's avatar
陈前坚 committed
215
      },
陈前坚's avatar
陈前坚 committed
216 217 218 219 220
    },
    {
      title: '微信账户',
      dataIndex: 'wxid',
      key: 'wxid',
陈前坚's avatar
陈前坚 committed
221
      width: 140,
陈前坚's avatar
陈前坚 committed
222 223 224 225 226 227 228 229 230 231
      render: record => {
        if (record) {
          return (
            <Tooltip title={record}>
              <span style={{ color: '#50aefc', cursor: 'pointer' }}>
                已绑定
              </span>
            </Tooltip>
          );
        }
tianfen's avatar
tianfen committed
232
        return <span>未绑定</span>;
陈前坚's avatar
陈前坚 committed
233
      },
陈前坚's avatar
陈前坚 committed
234 235 236 237
    },
    {
      title: '操作',
      key: 'action',
陈前坚's avatar
陈前坚 committed
238
      // fixed: 'right',
陈前坚's avatar
陈前坚 committed
239
      width: 250,
240
      align: 'center',
陈前坚's avatar
陈前坚 committed
241
      render: record => (
陈前坚's avatar
陈前坚 committed
242
        <Space size="middle">
陈前坚's avatar
陈前坚 committed
243
          <Tooltip title="关联角色">
244
            <IdcardOutlined
陈前坚's avatar
陈前坚 committed
245
              onClick={() => relateRole(record)}
246
              style={{ fontSize: '20px', color: '#1890FF' }}
陈前坚's avatar
陈前坚 committed
247 248 249 250 251 252 253 254 255
            />
          </Tooltip>
          <Tooltip title="更改机构">
            <ApartmentOutlined
              onClick={() => changeOrg(record)}
              style={{ fontSize: '16px', color: '#1890FF' }}
            />
          </Tooltip>
          <Tooltip title="修改密码">
陈前坚's avatar
陈前坚 committed
256
            <UnlockOutlined
陈前坚's avatar
陈前坚 committed
257 258 259 260 261 262 263 264 265 266
              onClick={() => changePassword(record)}
              style={{ fontSize: '16px', color: '#1890FF' }}
            />
          </Tooltip>
          <Tooltip title="编辑用户">
            <EditTwoTone
              onClick={() => editUser(record)}
              style={{ fontSize: '16px' }}
            />
          </Tooltip>
皮倩雯's avatar
皮倩雯 committed
267
          {(record.state == 0 || record.state == null) && (
268
            <>
269
              {/* {     console.log(record.state,'record.state')} */}
270
              <Tooltip title="冻结用户">
皮倩雯's avatar
皮倩雯 committed
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289
                <Popconfirm
                  placement="bottomRight"
                  title={
                    <p>
                      即将冻结用户{' '}
                      <span className={styles.redText}>
                        {voca.stripTags(record.loginName)}
                      </span>
                      ,是否确认冻结?
                    </p>
                  }
                  okText="确认"
                  cancelText="取消"
                  onConfirm={() => freezeUser(record)}
                >
                  <StopOutlined
                    style={{ fontSize: '16px', color: '#e86060' }}
                  />
                </Popconfirm>
290 291 292
              </Tooltip>
            </>
          )}
皮倩雯's avatar
皮倩雯 committed
293
          {record.state == 1 && (
294
            <>
295
              {console.log(record.state, 'record.state1')}
296
              <Tooltip title="解冻用户">
皮倩雯's avatar
皮倩雯 committed
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
                <Popconfirm
                  placement="bottomRight"
                  title={
                    <p>
                      即将解冻用户{' '}
                      <span className={styles.redText}>
                        {voca.stripTags(record.loginName)}
                      </span>
                      ,是否确认解冻?
                    </p>
                  }
                  okText="确认"
                  cancelText="取消"
                  onConfirm={() => freezeUser(record)}
                >
                  <UserOutlined
                    style={{ fontSize: '16px', color: '#1890ff' }}
                  />
                </Popconfirm>
316 317 318
              </Tooltip>
            </>
          )}
mayongxin's avatar
mayongxin committed
319
          <Tooltip title="用户鉴权">
320
            <Popconfirm
321 322 323
              placement="bottomRight"
              title={
                <div style={{ width: '130px' }}>
324 325
                  <Form form={form}>
                    <Item>
皮倩雯's avatar
皮倩雯 committed
326
                      <Radio.Group value={selectValue} onChange={onTypeChange}>
327 328 329 330 331 332 333
                        <Space direction="vertical">
                          <Radio value={0}>访客</Radio>
                          <Radio value={1}>普通用户</Radio>
                          <Radio value={2}>管理员</Radio>
                          <Radio value={3}>超级管理员</Radio>
                        </Space>
                      </Radio.Group>
334
                    </Item>
335 336
                  </Form>
                </div>
337 338 339 340 341
              }
              okText="确认"
              cancelText="取消"
              onConfirm={() => authUser(record)}
            >
342 343 344 345
              <LockOutlined
                onClick={() => jianquan(record)}
                style={{ fontSize: '16px', color: '#1890ff' }}
              />
346
            </Popconfirm>
mayongxin's avatar
mayongxin committed
347
          </Tooltip>
陈前坚's avatar
陈前坚 committed
348
          <Tooltip title="删除用户">
皮倩雯's avatar
皮倩雯 committed
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366
            <Popconfirm
              placement="bottomRight"
              title={
                <p>
                  即将删除用户{' '}
                  <span className={styles.redText}>
                    {voca.stripTags(record.loginName)}
                  </span>
                  ,是否确认删除?
                </p>
              }
              // title={`确认删除用户${currentUser}`}
              okText="确认"
              cancelText="取消"
              onConfirm={() => deleteUser(record)}
            >
              <DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }} />
            </Popconfirm>
陈前坚's avatar
陈前坚 committed
367
          </Tooltip>
陈前坚's avatar
陈前坚 committed
368 369 370 371
        </Space>
      ),
    },
  ];
皮倩雯's avatar
皮倩雯 committed
372 373 374 375 376 377 378 379 380 381 382 383 384
  // 模糊查询匹配的样式
  const searchStyle = val => {
    let n;
    if (showSearchStyle) {
      n = val.replace(
        new RegExp(searchWord, 'g'),
        `<span style='color:red'>${searchWord}</span>`,
      );
    } else {
      n = val;
    }
    return <div dangerouslySetInnerHTML={{ __html: n }} />;
  };
385 386 387 388
  // 获取搜索框的值
  const handleSearch = e => {
    setSearchWord(e.target.value);
  };
皮倩雯's avatar
皮倩雯 committed
389
  // 复选框
陈前坚's avatar
陈前坚 committed
390
  const rowSelection = {
391 392 393
    selectedRowKeys,
    onChange: (RowKeys, Rows) => {
      setSelectedRowKeys(RowKeys);
394
      getCheckList(RowKeys)
395 396
      setUserIDs(RowKeys.toString()); // 数组转字符串,逗号连接
      setOrgIDs(Rows.map(item => item.OUID).toString());
陈前坚's avatar
陈前坚 committed
397
      // 选中行数大于0时设置批量操作可行
398
      if (RowKeys.length > 0) {
399
        setSelectColor({});
陈前坚's avatar
陈前坚 committed
400 401 402 403 404 405
        setMultiOperate(false);
        setMultiOperateButtonType('primary');
      } else {
        setMultiOperate(true);
        setMultiOperateButtonType('default');
      }
陈前坚's avatar
陈前坚 committed
406 407
    },
  };
陈前坚's avatar
陈前坚 committed
408 409 410 411
  // 渲染机构树
  const mapTree = org => {
    const haveChildren = Array.isArray(org.children) && org.children.length > 0;
    return {
皮倩雯's avatar
皮倩雯 committed
412
      title: (
皮倩雯's avatar
皮倩雯 committed
413
        <div className={styles.title1}>
皮倩雯's avatar
皮倩雯 committed
414
          <span className={styles.titleText}>{org.text}</span>
皮倩雯's avatar
皮倩雯 committed
415 416
          <span className={styles.tip1}>
            <Tooltip title="" className={styles.fs1}>
皮倩雯's avatar
皮倩雯 committed
417
              <Dropdown overlay={orgButtonMenu} disabled={currentOrgOperate}>
418 419 420
                <PlusOutlined
                  style={{ marginLeft: 20 }}
                  onClick={e => e.stopPropagation()}
皮倩雯's avatar
皮倩雯 committed
421 422 423 424 425
                  onMouseEnter={e => {
                    setOrgID(org);
                    setOrgTitle1(org.text);
                    console.log(org);
                  }}
426
                />
皮倩雯's avatar
皮倩雯 committed
427 428 429 430
              </Dropdown>
            </Tooltip>

            <Dropdown overlay={orgButtonMenu1} disabled={currentOrgOperate}>
431 432 433
              <EllipsisOutlined
                style={{ marginLeft: 10, fontSize: '20px' }}
                onClick={e => e.stopPropagation()}
皮倩雯's avatar
皮倩雯 committed
434 435 436 437 438 439 440 441 442
                onMouseEnter={e => {
                  setOrgID(org);
                  setOrgTitle1(org.text);
                  getDescription(org.id);
                  getMapSetByGroupID(org.id);
                  setCurrentSelectOrg1(org.id);
                  setId(org.text);
                  console.log(org);
                }}
443
              />
皮倩雯's avatar
皮倩雯 committed
444 445 446 447
            </Dropdown>
          </span>
        </div>
      ),
陈前坚's avatar
陈前坚 committed
448 449 450 451 452
      key: org.id,
      // 判断它是否存在子集,若果存在就进行再次进行遍历操作,知道不存在子集便对其他的元素进行操作
      children: haveChildren ? org.children.map(i => mapTree(i)) : [],
    };
  };
453

皮倩雯's avatar
皮倩雯 committed
454 455 456 457 458 459 460 461 462 463
  const mapTree1 = org => {
    const haveChildren = Array.isArray(org.children) && org.children.length > 0;
    return {
      title: org.text,
      key: org.id,
      // 判断它是否存在子集,若果存在就进行再次进行遍历操作,知道不存在子集便对其他的元素进行操作
      children: haveChildren ? org.children.map(i => mapTree1(i)) : [],
    };
  };

陈前坚's avatar
陈前坚 committed
464
  // 重新渲染树
陈前坚's avatar
陈前坚 committed
465 466
  const updateTrees = () => {
    setTreeLoading(true);
mayongxin's avatar
mayongxin committed
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
    // getUserTree(-1, -1)
    //   .then(res => {
    //     if (res.length > 0) {
    //       setTreeLoading(false);
    //       setTreeData(res);
    //       setTreeDataCopy(res);
    //       // 第一次加载,默认选择第一个组织
    //       if (treeState) {
    //         onSelect([res[0].id], false);
    //         setTreeState(false);
    //       }
    //     } else {
    //       setTreeLoading(false);
    //       notification.error({
    //         message: '获取失败',
    //         description: res.message,
    //       });
    //     }
    //   })
    //   .catch(err => {
    //     setTreeLoading(false);
    //     message.error(err);
    //   });
皮倩雯's avatar
皮倩雯 committed
490 491 492 493
    GetOUTreeNew({ selectOU: -1 })
      .then(newres => {
        if (newres.code === 0) {
          let res = newres.data;
皮倩雯's avatar
皮倩雯 committed
494
          console.log(res);
陈前坚's avatar
陈前坚 committed
495
          setTreeLoading(false);
496
          setTreeData(res);
陈前坚's avatar
陈前坚 committed
497
          setTreeDataCopy(res);
498 499
          // 第一次加载,默认选择第一个组织
          if (treeState) {
陈前坚's avatar
陈前坚 committed
500
            onSelect([res[0].id], false);
501 502
            setTreeState(false);
          }
陈前坚's avatar
陈前坚 committed
503 504 505 506
        } else {
          setTreeLoading(false);
          notification.error({
            message: '获取失败',
皮倩雯's avatar
皮倩雯 committed
507
            // eslint-disable-next-line no-undef
陈前坚's avatar
陈前坚 committed
508 509
            description: res.message,
          });
陈前坚's avatar
陈前坚 committed
510 511 512
        }
      })
      .catch(err => {
陈前坚's avatar
陈前坚 committed
513
        setTreeLoading(false);
陈前坚's avatar
陈前坚 committed
514 515
        message.error(err);
      });
陈前坚's avatar
陈前坚 committed
516
  };
张烨's avatar
张烨 committed
517 518 519 520

  // 获取用户机构树
  useEffect(() => {
    updateTrees();
521
  }, []);
皮倩雯's avatar
皮倩雯 committed
522 523
  // 更新获取初始范围
  useEffect(() => {
mayongxin's avatar
mayongxin committed
524
    getOrgArea().then(res => {
525
      if (res.msg === 'Ok') {
皮倩雯's avatar
皮倩雯 committed
526
        console.log(res);
皮倩雯's avatar
皮倩雯 committed
527
        setOrgAreas(res.Results);
mayongxin's avatar
mayongxin committed
528
      }
皮倩雯's avatar
皮倩雯 committed
529 530
    });
  }, [saveExtentFlag]);
陈前坚's avatar
陈前坚 committed
531

陈前坚's avatar
陈前坚 committed
532
  // 点击树节点,获取当前机构下所有用户
陈前坚's avatar
陈前坚 committed
533
  const onSelect = (props, e) => {
皮倩雯's avatar
皮倩雯 committed
534 535
    console.log(e);
    console.log(props);
皮倩雯's avatar
皮倩雯 committed
536 537
    setKeep1(props);
    console.log(keep1);
陈前坚's avatar
陈前坚 committed
538
    setTableLoading(true);
陈前坚's avatar
陈前坚 committed
539
    if (e) {
皮倩雯's avatar
皮倩雯 committed
540
      setOrgTitle(e.node.title.props.children[0].props.children);
陈前坚's avatar
陈前坚 committed
541
    }
陈前坚's avatar
陈前坚 committed
542
    if (!props[0]) {
张烨's avatar
张烨 committed
543
      setCurrentSelectOrg(currentSelectOrg);
皮倩雯's avatar
皮倩雯 committed
544
      setCurrentSelectOrg1(currentSelectOrg);
陈前坚's avatar
陈前坚 committed
545
    } else {
张烨's avatar
张烨 committed
546
      setCurrentSelectOrg(props[0]);
皮倩雯's avatar
皮倩雯 committed
547
      setCurrentSelectOrg1(props[0]);
陈前坚's avatar
陈前坚 committed
548
    }
mayongxin's avatar
mayongxin committed
549
    // orgAreas.map((item)=>{
皮倩雯's avatar
皮倩雯 committed
550

mayongxin's avatar
mayongxin committed
551 552 553 554 555 556
    //     if(item.OUID == props[0]){
    //       setCurrentOrgArea(item.Extent)
    //       setCurrentOrgDistinct(item.AreaName)
    //     }
    // })
    GetMapSetByGroupID({
皮倩雯's avatar
皮倩雯 committed
557 558 559
      groupID: props[0],
    }).then(res => {
      if (res.code === 0) {
皮倩雯's avatar
皮倩雯 committed
560
        console.log(res);
皮倩雯's avatar
皮倩雯 committed
561 562
        setCurrentOrgArea(res.data.MapRange);
        setCurrentOrgDistinct(res.data.AreeName);
mayongxin's avatar
mayongxin committed
563
      }
皮倩雯's avatar
皮倩雯 committed
564
    });
张烨's avatar
张烨 committed
565
    setOrgID(props[0] || currentSelectOrg);
陈前坚's avatar
陈前坚 committed
566 567
    // 树节点变化(即props不为空)时才请求,避免重复请求
    if (props[0]) {
皮倩雯's avatar
皮倩雯 committed
568
      // eslint-disable-next-line no-console
陈前坚's avatar
陈前坚 committed
569 570
      getOneOUUserListNew(props[0] || currentSelectOrg)
        .then(res => {
571
          setCurrentOrgOperate(false); // 重置禁用当前机构操作为false
572
          setMultiOperate(true); // 重新禁止用户批量操作
573
          setSelectedRowKeys([]); // 重置选中用户数
陈前坚's avatar
陈前坚 committed
574 575 576 577
          if (res.code === 0) {
            setTableLoading(false);
            setSearchWord(''); // 搜索框置空
            setOrgTitle(res.data.GroupName);
578
            setDescription(res.data.Description);
陈前坚's avatar
陈前坚 committed
579 580 581 582 583 584 585 586 587 588 589
            // 返回用户表数据结构处理,扁平化
            const temp = flatten(getUsers(res.data));
            // 设置过滤字段
            let arr = temp.map(item => item.OUName);
            arr = arr.filter((value, index) => arr.indexOf(value) === index);
            setOrgFilters(arr.map(item => ({ text: item, value: item })));
            setTableLength(temp.length);
            const table = temp.map((item, index) => {
              item.key = index;
              return item;
            });
皮倩雯's avatar
皮倩雯 committed
590
            setShowSearchStyle(false);
陈前坚's avatar
陈前坚 committed
591 592 593
            setTableData(table);
          } else {
            setTableLoading(false);
皮倩雯's avatar
皮倩雯 committed
594 595 596 597
            // notification.error({
            //   message: '获取失败',
            //   description: res.msg,
            // });
陈前坚's avatar
陈前坚 committed
598 599 600
          }
        })
        .catch(err => {
陈前坚's avatar
陈前坚 committed
601
          setTableLoading(false);
陈前坚's avatar
陈前坚 committed
602 603 604 605 606
          message.error(err);
        });
    } else {
      setTableLoading(false);
    }
陈前坚's avatar
陈前坚 committed
607
  };
陈前坚's avatar
陈前坚 committed
608

皮倩雯's avatar
皮倩雯 committed
609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627
  const getDescription = e => {
    getOneOUUserListNew(e).then(res => {
      if (res.code === 0) {
        setDescription(res.data.Description);
      }
    });
  };

  const getMapSetByGroupID = e => {
    GetMapSetByGroupID({
      groupID: e,
    }).then(res => {
      if (res.code === 0) {
        console.log(res);
        setCurrentOrgArea(res.data.MapRange);
        setCurrentOrgDistinct(res.data.AreeName);
      }
    });
  };
陈前坚's avatar
陈前坚 committed
628
  // 返回用户表数据结构处理,扁平化
629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645
  const getUsers = orgObj => {
    let result = orgObj.Users;
    result.map(item => {
      item.OUID = orgObj.GroupId;
      item.OUName = orgObj.GroupName;
      return item;
    });
    if (orgObj.Childs.length > 0)
      result = [...result, ...orgObj.Childs.map(o => getUsers(o))];
    return result;
  };
  const flatten = arr => {
    while (arr.some(item => Array.isArray(item))) {
      arr = [].concat(...arr);
    }
    return arr;
  };
陈前坚's avatar
陈前坚 committed
646
  // 添加用户
647
  const addUser = e => {
陈前坚's avatar
陈前坚 committed
648 649
    setUserVisible(true);
  };
陈前坚's avatar
陈前坚 committed
650 651
  // 添加顶级机构
  const addOrg = () => {
陈前坚's avatar
陈前坚 committed
652
    setAddOrgVisible(true);
陈前坚's avatar
陈前坚 committed
653
    setOrgID('-1');
陈前坚's avatar
陈前坚 committed
654
  };
陈前坚's avatar
陈前坚 committed
655
  // 添加下级机构
656
  const addSubOrg = e => {
陈前坚's avatar
陈前坚 committed
657 658 659 660
    setAddOrgVisible(true);
  };
  // 编辑机构
  const editOrg = () => {
陈前坚's avatar
陈前坚 committed
661
    setEditOrgVisible(true);
陈前坚's avatar
陈前坚 committed
662
  };
陈前坚's avatar
陈前坚 committed
663 664
  // 删除机构
  const deleteOrg = () => {
陈前坚's avatar
陈前坚 committed
665
    setDeleteOrgVisible(true);
666 667
    // 删除后默认选择第一个组织
    setTreeState(true);
陈前坚's avatar
陈前坚 committed
668
  };
皮倩雯's avatar
皮倩雯 committed
669
  // 编辑机构范围
mayongxin's avatar
mayongxin committed
670
  const EditOrgScope = () => {
皮倩雯's avatar
皮倩雯 committed
671 672
    setEditOrgExtentVisible(true);
  };
陈前坚's avatar
陈前坚 committed
673

陈前坚's avatar
陈前坚 committed
674
  // 在currentUser变化后获取角色列表
675 676 677 678 679
  // useEffect(() => {
  //   if (currentUser && currentUser.userID) {
  //     getRoleList();
  //   }
  // }, [currentUser]);
陈前坚's avatar
陈前坚 committed
680

陈前坚's avatar
陈前坚 committed
681
  /** ***用户批量操作****** */
陈前坚's avatar
陈前坚 committed
682
  // 关联角色
陈前坚's avatar
陈前坚 committed
683
  const relateRoles = () => {
684
    setMult('Yes')
陈前坚's avatar
陈前坚 committed
685
    getEmptyRoleList();
686
    // getCheckList()
陈前坚's avatar
陈前坚 committed
687
    setRoleVisible(true);
陈前坚's avatar
陈前坚 committed
688
    setMultiRelateRoles(true);
陈前坚's avatar
陈前坚 committed
689 690 691 692 693 694 695 696 697 698 699 700
  };
  // 更改机构
  const changeOrgs = () => {
    setChangeOrgVisible(true);
    setMultiChangeOrgs(true);
  };
  // 删除用户
  const deleteUsers = () => {
    setDeleteUserVisible(true);
    setMultiDelete(true);
  };

陈前坚's avatar
陈前坚 committed
701
  /** ***右侧表格相关操作****** */
陈前坚's avatar
陈前坚 committed
702
  // 关联角色
陈前坚's avatar
陈前坚 committed
703
  const relateRole = record => {
704 705 706 707
    // getEmptyRoleList(record.userID);
    setMult('No')
    console.log(record)
    getRoleList(record)
陈前坚's avatar
陈前坚 committed
708
    setRoleVisible(true);
张烨's avatar
张烨 committed
709
    setCurrentUser(record);
710
    setSelectColor(record);
陈前坚's avatar
陈前坚 committed
711
  };
陈前坚's avatar
陈前坚 committed
712
  // 更改机构
陈前坚's avatar
陈前坚 committed
713
  const changeOrg = record => {
714
    setChangeOrgVisible(true);
张烨's avatar
张烨 committed
715
    setCurrentUser(record);
716
    setSelectColor(record);
陈前坚's avatar
陈前坚 committed
717
    setCurrentSelectOldOrg(record.OUID);
陈前坚's avatar
陈前坚 committed
718
  };
陈前坚's avatar
陈前坚 committed
719
  // 修改密码
陈前坚's avatar
陈前坚 committed
720 721
  const changePassword = record => {
    setPasswordVisible(true);
张烨's avatar
张烨 committed
722
    setCurrentUser(record);
723
    setSelectColor(record);
陈前坚's avatar
陈前坚 committed
724
  };
陈前坚's avatar
陈前坚 committed
725
  // 编辑用户
陈前坚's avatar
陈前坚 committed
726 727
  const editUser = record => {
    setEditUserVisible(true);
张烨's avatar
张烨 committed
728
    setCurrentUser(record);
729
    setSelectColor(record);
陈前坚's avatar
陈前坚 committed
730
  };
陈前坚's avatar
陈前坚 committed
731
  // 冻结用户
陈前坚's avatar
陈前坚 committed
732
  const freezeUser = record => {
皮倩雯's avatar
皮倩雯 committed
733
    // setFreezeUserVisible(true);
张烨's avatar
张烨 committed
734
    setCurrentUser(record);
735
    setSelectColor(record);
皮倩雯's avatar
皮倩雯 committed
736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765
    let state = '';
    console.log(record);
    if (record.state === '0' || record.state === null) {
      state = '1';
    } else {
      state = '0';
    }
    UserStateOUNew({ ouid: record.userID })
      .then(res => {
        if (res.code === 0) {
          // 重新获取用户表
          // eslint-disable-next-line no-unused-expressions
          currentSelectOrg === '-1'
            ? submitSearchUser()
            : onSelect([currentSelectOrg]);
          notification.success({
            message: '提交成功',
            duration: 2,
          });
        } else {
          notification.error({
            message: '提交失败',
            description: res.msg,
          });
        }
      })
      .catch(err => {
        setTableLoading(false);
        message.error(err);
      });
陈前坚's avatar
陈前坚 committed
766
  };
陈前坚's avatar
陈前坚 committed
767
  // 删除用户
陈前坚's avatar
陈前坚 committed
768
  const deleteUser = record => {
皮倩雯's avatar
皮倩雯 committed
769 770
    console.log(record.userName);
    setCurrentUser(record.userName);
771
    setSelectColor(record);
皮倩雯's avatar
皮倩雯 committed
772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796
    DeleteUserNew({
      userID: record.userID,
      ouID: record.OUID,
    })
      .then(res => {
        if (res.code === 0) {
          notification.success({
            message: '提交成功',
            duration: 2,
          });
          // eslint-disable-next-line no-unused-expressions
          currentSelectOrg === '-1'
            ? submitSearchUser()
            : onSelect([currentSelectOrg]);
        } else {
          notification.error({
            message: '提交失败',
            description: res.msg,
          });
        }
      })
      .catch(err => {
        setTableLoading(false);
        message.error(err);
      });
陈前坚's avatar
陈前坚 committed
797
  };
798

皮倩雯's avatar
皮倩雯 committed
799
  // 用户鉴权
800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824
  //   useEffect(() => {
  //     currentUser.userID
  //     GetUserAuthSet({
  //         UserId: currentUser.userID
  //     }).then(
  //         res => {
  //             if(res.code == 0){
  //                 setSelctValue(res.data)
  //                 console.log(selectValue);
  //                 console.log(res.data);
  //             }
  //         }
  //     )
  // }, [currentUser])
  const jianquan = record => {
    GetUserAuthSet({
      UserId: record.userID,
    }).then(res => {
      if (res.code == 0) {
        setSelctValue(res.data);
        console.log(res.data);
      }
    });
  };
  const onTypeChange = value => {
825
    setSelctValue(value.target.value);
826
  };
皮倩雯's avatar
皮倩雯 committed
827
  const authUser = record => {
mayongxin's avatar
mayongxin committed
828
    setCurrentUser(record);
皮倩雯's avatar
皮倩雯 committed
829 830
    console.log(selectValue);
    AddUserAuthSetting({
831
      userId: record.userID,
皮倩雯's avatar
皮倩雯 committed
832
      userLevel: selectValue,
833 834
    }).then(res => {
      if (res.code === 0) {
835
        message.info('提交成功');
836
      }
837
    });
皮倩雯's avatar
皮倩雯 committed
838
  };
839

陈前坚's avatar
陈前坚 committed
840 841
  // 查找用户
  const submitSearchUser = () => {
mayongxin's avatar
mayongxin committed
842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861
    // getUserByKey(searchWord)
    //   .then(res => {
    //     if (res.success) {
    //       setSelectedRowKeys([]); // 重置选中用户数
    //       setCurrentOrgOperate(true); // 禁止当前机构操作
    //       setMultiOperate(true); // 禁用批量操作
    //       setOrgTitle('全部机构搜索结果'); // 设置表头
    //       setCurrentSelectOrg('-1'); // 清空选中机构
    //       setTableData(res.root);
    //       setTableLength(res.root.length);
    //     } else {
    //       notification.error({
    //         message: '提交失败',
    //         description: res.message,
    //       });
    //     }
    //   })
    //   .catch(err => {
    //     message.error(err);
    //   });
皮倩雯's avatar
皮倩雯 committed
862
    GetUserByKeyNew({ key: searchWord })
陈前坚's avatar
陈前坚 committed
863
      .then(res => {
皮倩雯's avatar
皮倩雯 committed
864
        if (res.code === 0) {
865
          setSelectedRowKeys([]); // 重置选中用户数
866
          setCurrentOrgOperate(true); // 禁止当前机构操作
867
          setMultiOperate(true); // 禁用批量操作
868
          setOrgTitle('全部机构搜索结果'); // 设置表头
869
          setCurrentSelectOrg('-1'); // 清空选中机构
皮倩雯's avatar
皮倩雯 committed
870
          console.log(res.data);
皮倩雯's avatar
皮倩雯 committed
871
          setShowSearchStyle(true);
mayongxin's avatar
mayongxin committed
872 873
          setTableData(res.data);
          setTableLength(res.data.length);
陈前坚's avatar
陈前坚 committed
874 875
        } else {
          notification.error({
皮倩雯's avatar
皮倩雯 committed
876 877 878
            message: '提示',
            duration: 3,
            description: res.msg,
陈前坚's avatar
陈前坚 committed
879 880 881 882 883 884 885
          });
        }
      })
      .catch(err => {
        message.error(err);
      });
  };
张烨's avatar
张烨 committed
886

陈前坚's avatar
陈前坚 committed
887 888
  /** ***表单提交相关操作****** */
  // 根据当前 userID 获取用户关联角色
889
  const getRoleList = e => {
890
    setLoading(true);
mayongxin's avatar
mayongxin committed
891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909
    // getUserRelationList(currentUser.userID)
    //   .then(res => {
    //     setLoading(false);
    //     if (res.success) {
    //       const { roleList, stationList } = res;
    //       setRolelist(roleList);
    //       setStationlist(stationList);
    //     } else {
    //       notification.error({
    //         message: '提交失败',
    //         description: res.message,
    //       });
    //     }
    //   })
    //   .catch(err => {
    //     setLoading(false);
    //     setTableLoading(false);
    //     message.error(err);
    //   });
910
    GetUserRelationListNew({ userID: e.userID })
陈前坚's avatar
陈前坚 committed
911
      .then(res => {
912 913
        console.log(111)
        
皮倩雯's avatar
皮倩雯 committed
914
        if (res.code === 0) {
mayongxin's avatar
mayongxin committed
915
          const { roleList, stationList } = res.data;
916
          console.log(roleList)
917 918
          setRolelist(roleList);
          setStationlist(stationList);
919
          setLoading(false);
陈前坚's avatar
陈前坚 committed
920
        } else {
921 922
          console.log(res)
          setLoading(false);
陈前坚's avatar
陈前坚 committed
923 924 925
        }
      })
      .catch(err => {
926
        setLoading(false);
陈前坚's avatar
陈前坚 committed
927 928 929 930
        setTableLoading(false);
        message.error(err);
      });
  };
陈前坚's avatar
陈前坚 committed
931 932 933
  // 获取全部未勾选的角色列表与站点列表
  const getEmptyRoleList = () => {
    setLoading(true);
mayongxin's avatar
mayongxin committed
934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952
    // getUserRelationList('')
    //   .then(res => {
    //     setLoading(false);
    //     if (res.roleList && res.roleList.length > 0) {
    //       const { roleList, stationList } = res;
    //       setRolelist(roleList);
    //       setStationlist(stationList);
    //     } else {
    //       notification.error({
    //         message: '提交失败',
    //         description: res.message,
    //       });
    //     }
    //   })
    //   .catch(err => {
    //     setLoading(false);
    //     setTableLoading(false);
    //     message.error(err);
    //   });
953
    GetUserRelationListNew({ userID: 0})
陈前坚's avatar
陈前坚 committed
954
      .then(res => {
955
        console.log(222)
皮倩雯's avatar
皮倩雯 committed
956
        if (res.code === 0) {
mayongxin's avatar
mayongxin committed
957
          const { roleList, stationList } = res.data;
陈前坚's avatar
陈前坚 committed
958 959
          setRolelist(roleList);
          setStationlist(stationList);
960
          setLoading(false);
陈前坚's avatar
陈前坚 committed
961
        } else {
962 963
          console.log(res.msg)
          setLoading(false);
陈前坚's avatar
陈前坚 committed
964 965 966 967 968 969 970 971
        }
      })
      .catch(err => {
        setLoading(false);
        setTableLoading(false);
        message.error(err);
      });
  };
972

973
  const getCheckList = e =>{
974 975
    let aa = []
    let bb = []
976
    loadAllUserRole(e).then(res =>{
977 978 979 980 981 982
      if(res.code === 0){
        if(res.data.roleList != undefined){
          Object.keys(res.data.roleList).map((item,index)=>{
            aa.push(item)
         })
        }
983 984
        if(res.data.siteList != undefined){
          Object.keys(res.data.siteList).map((item1,index1)=>{
985 986 987
            bb.push(item1)
         })
        }
988 989
        console.log(aa)
        console.log(bb)
990 991 992 993 994 995
       setMultiRoleList(aa)
       setMultiStationList(bb)
      }

    })
  }
陈前坚's avatar
陈前坚 committed
996
  // 提交-更改机构
皮倩雯's avatar
皮倩雯 committed
997
  const submitChangeOrg = () => {
mayongxin's avatar
mayongxin committed
998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019
    // addToOrg(currentUser.userID, currentUser.OUID, newOrgID)
    // .then(res => {
    //   if (res.success) {
    //     setChangeOrgVisible(false);
    //     // 跳转到新组织机构下的用户表
    //     onSelect([newOrgID]);
    //     // setExpandedKeys([`${newOrgID}`]);
    //     notification.success({
    //       message: '提交成功',
    //       duration: 2,
    //     });
    //   } else {
    //     notification.error({
    //       message: '提交失败',
    //       description: res.message,
    //     });
    //   }
    // })
    // .catch(err => {
    //   message.error(err);
    // });
    JumpToAnotherOUNew({
皮倩雯's avatar
皮倩雯 committed
1020 1021 1022
      userID: currentUser.userID,
      oldOUID: currentUser.OUID,
      newOUID: newOrgID,
mayongxin's avatar
mayongxin committed
1023
    })
陈前坚's avatar
陈前坚 committed
1024
      .then(res => {
陈前坚's avatar
陈前坚 committed
1025 1026 1027 1028
        if (res.code === 0) {
          setChangeOrgVisible(false);
          // 跳转到新组织机构下的用户表
          onSelect([newOrgID]);
皮倩雯's avatar
皮倩雯 committed
1029
          // setExpandedKeys([`${newOrgID}`]);
陈前坚's avatar
陈前坚 committed
1030 1031
          notification.success({
            message: '提交成功',
1032
            duration: 2,
陈前坚's avatar
陈前坚 committed
1033 1034 1035 1036
          });
        } else {
          notification.error({
            message: '提交失败',
陈前坚's avatar
陈前坚 committed
1037
            description: res.msg,
陈前坚's avatar
陈前坚 committed
1038 1039 1040 1041 1042 1043
          });
        }
      })
      .catch(err => {
        message.error(err);
      });
皮倩雯's avatar
皮倩雯 committed
1044
  };
1045

皮倩雯's avatar
皮倩雯 committed
1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056
  // 提交-批量更改机构
  const submitChangeOrgs = () =>
    addToOrgs(userIDs, orgIDs, newOrgID)
      .then(res => {
        if (res.code === 0) {
          setChangeOrgVisible(false);
          // 跳转到新组织机构下的用户表
          const temp = orgIDs.split(',');
          // 批量更改机构成功后设置老的orgIDs为全部是newOrgID的数组,并转字符串
          setOrgIDs(temp.map(() => newOrgID).toString());
          onSelect([newOrgID]);
陈前坚's avatar
陈前坚 committed
1057 1058
          notification.success({
            message: '提交成功',
1059
            duration: 2,
陈前坚's avatar
陈前坚 committed
1060 1061 1062 1063
          });
        } else {
          notification.error({
            message: '提交失败',
mayongxin's avatar
mayongxin committed
1064
            description: res.msg,
陈前坚's avatar
陈前坚 committed
1065 1066 1067 1068 1069 1070
          });
        }
      })
      .catch(err => {
        message.error(err);
      });
皮倩雯's avatar
皮倩雯 committed
1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128

  // 提交-冻结用户
  // const submitFreezeUser = () => {
  //   let state = '';
  //   if (currentUser.state === '0' || currentUser.state === null) {
  //     state = '1';
  //   } else {
  //     state = '0';
  //   }
  //   // postSetUserState(currentUser.userID, state)
  //   //   .then(res => {
  //   //     if (res.success) {
  //   //       setFreezeUserVisible(false);
  //   //       // 重新获取用户表
  //   //       // eslint-disable-next-line no-unused-expressions
  //   //       currentSelectOrg === '-1'
  //   //         ? submitSearchUser()
  //   //         : onSelect([currentSelectOrg]);
  //   //       notification.success({
  //   //         message: '提交成功',
  //   //         duration: 2,
  //   //       });
  //   //     } else {
  //   //       notification.error({
  //   //         message: '提交失败',
  //   //         description: res.message,
  //   //       });
  //   //     }
  //   //   })
  //   //   .catch(err => {
  //   //     setTableLoading(false);
  //   //     message.error(err);
  //   //   });
  //   UserStateOUNew({ ouid: currentUser.userID, state })
  //     .then(res => {
  //       if (res.code === 0) {
  //         // setFreezeUserVisible(false);
  //         // 重新获取用户表
  //         // eslint-disable-next-line no-unused-expressions
  //         currentSelectOrg === '-1'
  //           ? submitSearchUser()
  //           : onSelect([currentSelectOrg]);
  //         notification.success({
  //           message: '提交成功',
  //           duration: 2,
  //         });
  //       } else {
  //         notification.error({
  //           message: '提交失败',
  //           description: res.msg,
  //         });
  //       }
  //     })
  //     .catch(err => {
  //       setTableLoading(false);
  //       message.error(err);
  //     });
  // };
陈前坚's avatar
陈前坚 committed
1129
  // 提交-删除用户
陈前坚's avatar
陈前坚 committed
1130
  const submitDeleteUser = () => {
mayongxin's avatar
mayongxin committed
1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153
    // postDeleteUser(currentUser.userID)
    //   .then(res => {
    //     if (res.success) {
    //       setDeleteUserVisible(false);
    //       notification.success({
    //         message: '提交成功',
    //         duration: 2,
    //       });
    //       // eslint-disable-next-line no-unused-expressions
    //       currentSelectOrg === '-1'
    //         ? submitSearchUser()
    //         : onSelect([currentSelectOrg]);
    //     } else {
    //       notification.error({
    //         message: '提交失败',
    //         description: res.message,
    //       });
    //     }
    //   })
    //   .catch(err => {
    //     setTableLoading(false);
    //     message.error(err);
    //   });
皮倩雯's avatar
皮倩雯 committed
1154 1155 1156 1157 1158 1159
    DeleteUserNew({
      userID: currentUser.userID,
      ouID: currentUser.OUID,
    })
      .then(res => {
        if (res.code === 0) {
陈前坚's avatar
陈前坚 committed
1160 1161
          notification.success({
            message: '提交成功',
1162
            duration: 2,
陈前坚's avatar
陈前坚 committed
1163
          });
1164 1165 1166 1167
          // eslint-disable-next-line no-unused-expressions
          currentSelectOrg === '-1'
            ? submitSearchUser()
            : onSelect([currentSelectOrg]);
陈前坚's avatar
陈前坚 committed
1168 1169 1170
        } else {
          notification.error({
            message: '提交失败',
mayongxin's avatar
mayongxin committed
1171
            description: res.msg,
陈前坚's avatar
陈前坚 committed
1172 1173 1174 1175 1176 1177 1178 1179 1180 1181
          });
        }
      })
      .catch(err => {
        setTableLoading(false);
        message.error(err);
      });
  };
  // 提交-批量删除用户
  const submitDeleteUsers = () => {
陈前坚's avatar
陈前坚 committed
1182
    multiDeleteUsers(userIDs)
陈前坚's avatar
陈前坚 committed
1183 1184 1185 1186 1187
      .then(res => {
        if (res.code === 0) {
          setDeleteUserVisible(false);
          notification.success({
            message: '提交成功',
1188
            duration: 2,
陈前坚's avatar
陈前坚 committed
1189
          });
1190
          // 重新获取用户表,查找用户时currentSelectOrg为'-1',无需跳转
1191
          // eslint-disable-next-line no-unused-expressions
1192
          currentSelectOrg === '-1'
1193 1194
            ? submitSearchUser()
            : onSelect([currentSelectOrg]);
陈前坚's avatar
陈前坚 committed
1195
        } else {
陈前坚's avatar
陈前坚 committed
1196 1197
          notification.error({
            message: '提交失败',
陈前坚's avatar
陈前坚 committed
1198
            description: res.msg,
陈前坚's avatar
陈前坚 committed
1199 1200 1201 1202 1203 1204 1205
          });
        }
      })
      .catch(err => {
        setTableLoading(false);
        message.error(err);
      });
陈前坚's avatar
陈前坚 committed
1206
  };
1207
  // 重置默认第一个
1208
  const handleReset = () => {
1209 1210 1211 1212 1213 1214
    GetOUTreeNew({ selectOU: -1 })
      .then(newres => {
        if (newres.code === 0) {
          let res = newres.data;
          setTreeLoading(false);
          setSearchWord('');
皮倩雯's avatar
皮倩雯 committed
1215
          setFilteredValue([]);
1216
          // 第一次加载,默认选择第一个组织
1217
          onSelect([res[0].id], false);
1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230
        } else {
          setTreeLoading(false);
          notification.error({
            message: '获取失败',
            // eslint-disable-next-line no-undef
            description: res.message,
          });
        }
      })
      .catch(err => {
        setTreeLoading(false);
        message.error(err);
      });
1231
  };
皮倩雯's avatar
皮倩雯 committed
1232
  const onChangeInput = filters => {
1233
    setFilteredValue(filters.OUName);
皮倩雯's avatar
皮倩雯 committed
1234
  };
1235

皮倩雯's avatar
皮倩雯 committed
1236
  // 更改机构范围
1237
  const submitExtent = (extent, areaName, flag) => {
皮倩雯's avatar
皮倩雯 committed
1238 1239 1240
    setTreeLoading(true);
    console.log(extent);
    console.log(areaName);
1241
    console.log(flag)
皮倩雯's avatar
皮倩雯 committed
1242
    console.log(currentSelectOrg1);
1243 1244 1245 1246 1247
    if(flag == 0){
      setTreeLoading(false);
      notification.warn({
        message: '提交失败',
        description: '请框选范围',
皮倩雯's avatar
皮倩雯 committed
1248
      });
1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267
    }else{
      if (extent) {
        setOrgArea({
          OUID: currentSelectOrg1,
          areaName,
          extent,
        }).then(res => {
          if (res.msg === '') {
            setTreeLoading(false);
            setEditOrgExtentVisible(false);
            setSaveExtentFlag(saveExtentFlag + 1);
            message.success('机构范围设置成功!');
          } else {
            setTreeLoading(false);
            setEditOrgExtentVisible(false);
            message.warn(res.Message);
          }
        });
      }
mayongxin's avatar
mayongxin committed
1268
    }
皮倩雯's avatar
皮倩雯 committed
1269
  };
陈前坚's avatar
陈前坚 committed
1270

皮倩雯's avatar
皮倩雯 committed
1271 1272 1273
  const addChange = e => {
    e.domEvent.stopPropagation();
  };
陈前坚's avatar
陈前坚 committed
1274 1275 1276
  /** ***操作按钮**** */
  // 机构操作
  const orgButtonMenu = (
皮倩雯's avatar
皮倩雯 committed
1277
    <Menu onClick={e => addChange(e)}>
皮倩雯's avatar
皮倩雯 committed
1278
      <Menu.Item key="1" onClick={addUser} icon={<UserAddOutlined />}>
陈前坚's avatar
陈前坚 committed
1279 1280 1281
        添加用户
      </Menu.Item>
      <Menu.Item key="2" onClick={addSubOrg} icon={<UsergroupAddOutlined />}>
陈前坚's avatar
陈前坚 committed
1282
        添加下级机构
陈前坚's avatar
陈前坚 committed
1283
      </Menu.Item>
皮倩雯's avatar
皮倩雯 committed
1284 1285 1286
    </Menu>
  );
  const orgButtonMenu1 = (
皮倩雯's avatar
皮倩雯 committed
1287
    <Menu onClick={e => addChange(e)}>
陈前坚's avatar
陈前坚 committed
1288
      <Menu.Item key="3" onClick={editOrg} icon={<EditOutlined />}>
陈前坚's avatar
陈前坚 committed
1289
        编辑当前机构
陈前坚's avatar
陈前坚 committed
1290 1291
      </Menu.Item>
      <Menu.Item key="4" onClick={deleteOrg} icon={<DeleteOutlined />}>
陈前坚's avatar
陈前坚 committed
1292
        删除当前机构
陈前坚's avatar
陈前坚 committed
1293
      </Menu.Item>
皮倩雯's avatar
皮倩雯 committed
1294 1295 1296 1297 1298
      <Menu.Item
        key="5"
        onClick={EditOrgScope}
        icon={<BorderlessTableOutlined />}
      >
mayongxin's avatar
mayongxin committed
1299 1300
        编辑机构范围
      </Menu.Item>
陈前坚's avatar
陈前坚 committed
1301 1302 1303 1304 1305
    </Menu>
  );
  // 用户批量操作
  const userButtonMenu = (
    <Menu>
1306
      <Menu.Item key="1" onClick={relateRoles} icon={<IdcardOutlined />}>
陈前坚's avatar
陈前坚 committed
1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317
        批量关联角色
      </Menu.Item>
      <Menu.Item key="2" onClick={changeOrgs} icon={<ApartmentOutlined />}>
        批量更改机构
      </Menu.Item>
      <Menu.Item key="3" onClick={deleteUsers} icon={<DeleteOutlined />}>
        批量删除用户
      </Menu.Item>
    </Menu>
  );

皮倩雯's avatar
皮倩雯 committed
1318 1319 1320 1321 1322
  const kee = () => {
    console.log(keep1);
    setUserVisible(false);
    onSelect(keep1);
  };
陈前坚's avatar
陈前坚 committed
1323
  return (
1324 1325
    <PageContainer className={styles.userManageContainer}>
      <div className={styles.contentContainer}>
陈前坚's avatar
陈前坚 committed
1326
        {/* 左侧机构树 */}
陈前坚's avatar
陈前坚 committed
1327
        <Spin spinning={treeLoading} tip="loading...">
陈前坚's avatar
陈前坚 committed
1328
          <Card
皮倩雯's avatar
皮倩雯 committed
1329
            style={{ overflowY: 'hidden' }}
陈前坚's avatar
陈前坚 committed
1330 1331 1332 1333 1334 1335
            className={classnames({
              [styles.orgContainer]: true,
              [styles.orgContainerHide]: !treeVisible,
            })}
          >
            <div>
皮倩雯's avatar
皮倩雯 committed
1336 1337
              <span
                style={{
1338
                  fontSize: '15px ',
皮倩雯's avatar
皮倩雯 committed
1339
                  fontWeight: 'bold',
皮倩雯's avatar
皮倩雯 committed
1340
                  marginLeft: '15px',
皮倩雯's avatar
皮倩雯 committed
1341 1342 1343 1344
                }}
              >
                机构列表
              </span>
陈前坚's avatar
陈前坚 committed
1345
              <Tooltip title="添加顶级机构">
皮倩雯's avatar
皮倩雯 committed
1346
                <PlusSquareFilled
陈前坚's avatar
陈前坚 committed
1347 1348 1349
                  onClick={() => addOrg()}
                  style={{
                    color: '#1890FF',
1350
                    fontSize: '25px',
皮倩雯's avatar
皮倩雯 committed
1351
                    verticalAlign: 'middle',
皮倩雯's avatar
皮倩雯 committed
1352
                    marginLeft: '67%',
陈前坚's avatar
陈前坚 committed
1353 1354 1355
                  }}
                />
              </Tooltip>
皮倩雯's avatar
皮倩雯 committed
1356 1357 1358
              <hr
                style={{ width: '95%', color: '#eeecec', marginLeft: '15px' }}
              />
陈前坚's avatar
陈前坚 committed
1359 1360 1361
              {treeData.length > 0 && (
                <Tree
                  showIcon="true"
皮倩雯's avatar
皮倩雯 committed
1362
                  // showLine={{ showLeafIcon: false }}
陈前坚's avatar
陈前坚 committed
1363 1364
                  blockNode
                  autoExpandParent
陈前坚's avatar
陈前坚 committed
1365
                  // expandedKeys={[currentSelectOrg]}
1366
                  // defaultExpandAll
陈前坚's avatar
陈前坚 committed
1367 1368
                  selectedKeys={[currentSelectOrg]}
                  onSelect={onSelect}
1369 1370
                  height={
                    treeData.length && treeData.length > 30
皮倩雯's avatar
皮倩雯 committed
1371
                      ? treeData.length * 18 + 50
1372 1373
                      : 1000
                  }
陈前坚's avatar
陈前坚 committed
1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389
                  treeData={treeData.map(t => mapTree(t))}
                />
              )}
            </div>
            <div className={styles.switcher}>
              {treeVisible && (
                <Tooltip title="隐藏机构列表">
                  <DoubleLeftOutlined onClick={() => setTreeVisible(false)} />
                </Tooltip>
              )}
              {!treeVisible && (
                <Tooltip title="显示机构列表">
                  <DoubleRightOutlined onClick={() => setTreeVisible(true)} />
                </Tooltip>
              )}
            </div>
陈前坚's avatar
陈前坚 committed
1390
          </Card>
陈前坚's avatar
陈前坚 committed
1391
        </Spin>
1392

陈前坚's avatar
陈前坚 committed
1393
        {/* 右侧用户表 */}
陈前坚's avatar
陈前坚 committed
1394 1395 1396 1397 1398 1399
        <div
          className={classnames({
            [styles.userContainer]: true,
            [styles.userContainerHide]: !treeVisible,
          })}
        >
陈前坚's avatar
陈前坚 committed
1400
          <div style={{ height: '50px' }}>
1401
            <span
1402
              className={styles.title}
1403 1404 1405
              title={`${orgTitle}(已选${
                selectedRowKeys.length
              }/共${tableLength}人)`}
1406 1407
            >
              {orgTitle}(已选{selectedRowKeys.length}/共{tableLength}人
1408
            </span>
陈前坚's avatar
陈前坚 committed
1409
            <span style={{ float: 'right', margin: '10px' }}>
陈前坚's avatar
陈前坚 committed
1410
              <Search
1411 1412
                style={{ width: 260 }}
                placeholder="搜索登录名/用户姓名/手机号"
陈前坚's avatar
陈前坚 committed
1413 1414 1415 1416 1417
                onSearch={submitSearchUser}
                onChange={e => handleSearch(e)}
                enterButton
                value={searchWord}
              />
皮倩雯's avatar
皮倩雯 committed
1418

1419 1420 1421
              <Button icon={<SyncOutlined />} onClick={handleReset}>
                重置
              </Button>
皮倩雯's avatar
皮倩雯 committed
1422

陈前坚's avatar
陈前坚 committed
1423 1424 1425 1426 1427
              <Dropdown overlay={userButtonMenu} disabled={multiOperate}>
                <Button type={multiOperateButtonType}>
                  用户批量操作 <DownOutlined />
                </Button>
              </Dropdown>
陈前坚's avatar
陈前坚 committed
1428 1429
            </span>
          </div>
1430
          <Table
陈前坚's avatar
陈前坚 committed
1431
            rowSelection={{
1432
              type: 'checkbox',
陈前坚's avatar
陈前坚 committed
1433 1434
              ...rowSelection,
            }}
1435
            rowClassName={setRowClassName}
陈前坚's avatar
陈前坚 committed
1436
            size="small"
陈前坚's avatar
陈前坚 committed
1437
            rowKey={record => record.userID}
陈前坚's avatar
陈前坚 committed
1438
            locale={zhCN}
陈前坚's avatar
陈前坚 committed
1439
            bordered
1440 1441 1442
            columns={columns}
            dataSource={tableData}
            loading={tableLoading}
1443 1444
            scroll={{ x: 'max-content', y: 'calc(100vh - 210px)' }}
            // scroll={{ x: 'max-content' }}
陈前坚's avatar
陈前坚 committed
1445
            pagination={{
陈前坚's avatar
陈前坚 committed
1446 1447
              showTotal: (total, range) =>
                `第${range[0]}-${range[1]} 条/共 ${total} 条`,
陈前坚's avatar
陈前坚 committed
1448
              pageSizeOptions: [10, 20, 50, 100],
陈前坚's avatar
陈前坚 committed
1449
              defaultPageSize: 20,
陈前坚's avatar
陈前坚 committed
1450 1451 1452
              showQuickJumper: true,
              showSizeChanger: true,
            }}
1453
            onChange={onChangeInput}
1454
          />
1455
        </div>
1456

陈前坚's avatar
陈前坚 committed
1457
        {/* Modal弹框 */}
1458
        {/* 添加用户 */}
陈前坚's avatar
陈前坚 committed
1459
        <AddUserModal
皮倩雯's avatar
皮倩雯 committed
1460
          title={`在${orgTitle1}下添加用户`}
陈前坚's avatar
陈前坚 committed
1461 1462
          visible={userVisible}
          orgID={orgID}
皮倩雯's avatar
皮倩雯 committed
1463 1464
          onCancel={kee}
          // onSelect={() => onSelect([orgID])}
陈前坚's avatar
陈前坚 committed
1465
        />
1466
        {/* 添加下级机构 */}
1467
        <AddSubOrgModal
皮倩雯's avatar
皮倩雯 committed
1468
          title={orgID === '-1' ? '添加顶级机构' : `在${orgTitle1}下添加机构`}
1469
          visible={addOrgVisible}
1470
          orgID={orgID}
1471
          onCancel={() => setAddOrgVisible(false)}
皮倩雯's avatar
皮倩雯 committed
1472
          // onSelect={onSelect}
1473 1474
          updateTrees={updateTrees}
        />
1475
        {/* 编辑机构 */}
1476
        <EditOrgModal
皮倩雯's avatar
皮倩雯 committed
1477
          title={`编辑${orgTitle1}`}
1478
          visible={editOrgVisible}
1479
          orgID={orgID}
皮倩雯's avatar
皮倩雯 committed
1480
          orgTitle={orgTitle1}
1481
          description={description}
1482
          onCancel={() => setEditOrgVisible(false)}
皮倩雯's avatar
皮倩雯 committed
1483
          // onSelect={onSelect}
1484 1485 1486 1487
          updateTrees={updateTrees}
        />
        {/* 删除机构 */}
        <DeleteOrgModal
1488
          title='删除机构'
1489
          visible={deleteOrgVisible}
1490
          orgTitle={orgTitle1}
1491 1492
          orgID={orgID}
          updateTrees={updateTrees}
1493
          onCancel={() => setDeleteOrgVisible(false)}
1494
        />
陈前坚's avatar
陈前坚 committed
1495
        {/* 关联角色 */}
1496 1497 1498 1499
        <RelateRoleModal
          currentUser={currentUser}
          userIDs={userIDs}
          currentSelectOrg={currentSelectOrg}
陈前坚's avatar
陈前坚 committed
1500
          visible={roleVisible}
1501
          rolelist={rolelist}
1502 1503 1504
          multiRoleList={multiRoleList}
          multistationList={multistationList}
          mult={mult}
1505 1506 1507 1508
          loading={loading}
          stationlist={stationlist}
          multiRelateRoles={multiRelateRoles}
          onSelect={onSelect}
陈前坚's avatar
陈前坚 committed
1509 1510 1511 1512
          onCancel={() => {
            setRoleVisible(false);
            setMultiRelateRoles(false);
          }}
1513
        />
陈前坚's avatar
陈前坚 committed
1514
        {/* 更改机构 */}
1515 1516 1517
        <Modal
          title="更改机构"
          visible={changeOrgVisible}
陈前坚's avatar
陈前坚 committed
1518 1519 1520 1521 1522
          onOk={multiChangeOrgs ? submitChangeOrgs : submitChangeOrg}
          onCancel={() => {
            setChangeOrgVisible(false);
            setMultiChangeOrgs(false);
          }}
1523 1524
          okText="确认"
          cancelText="取消"
1525
          width="500px"
1526
        >
张烨's avatar
张烨 committed
1527
          <span>请选择要更改的目标机构:</span>
陈前坚's avatar
陈前坚 committed
1528
          {changeOrgVisible && treeDataCopy.length > 0 && (
陈前坚's avatar
陈前坚 committed
1529 1530
            <Tree
              showIcon="true"
陈前坚's avatar
陈前坚 committed
1531
              showLine={{ showLeafIcon: false }}
1532
              // defaultExpandAll
陈前坚's avatar
陈前坚 committed
1533 1534 1535 1536 1537 1538
              // 未切换时原先的节点,注意要转字符串
              selectedKeys={[`${currentSelectOldOrg}`]}
              onSelect={value => {
                setNewOrgID(value[0]);
                // 切换后选中的节点
                setCurrentSelectOldOrg(value[0]);
陈前坚's avatar
陈前坚 committed
1539
              }}
皮倩雯's avatar
皮倩雯 committed
1540
              treeData={treeDataCopy.map(t => mapTree1(t))}
陈前坚's avatar
陈前坚 committed
1541 1542
            />
          )}
1543
        </Modal>
陈前坚's avatar
陈前坚 committed
1544
        {/* 修改密码 */}
1545
        <ChangePasswordModal
陈前坚's avatar
陈前坚 committed
1546
          visible={passwordVisible}
1547
          currentUser={currentUser}
1548 1549
          submitSearchUser={submitSearchUser}
          currentSelectOrg={currentSelectOrg}
1550
          onSelect={onSelect}
陈前坚's avatar
陈前坚 committed
1551
          onCancel={() => setPasswordVisible(false)}
1552
        />
陈前坚's avatar
陈前坚 committed
1553
        {/* 编辑用户 */}
1554
        <EditUserModal
陈前坚's avatar
陈前坚 committed
1555
          visible={editUserVisible}
1556
          currentUser={currentUser}
1557 1558
          submitSearchUser={submitSearchUser}
          currentSelectOrg={currentSelectOrg}
1559
          onSelect={onSelect}
陈前坚's avatar
陈前坚 committed
1560
          onCancel={() => setEditUserVisible(false)}
1561
        />
陈前坚's avatar
陈前坚 committed
1562
        {/* 冻结用户 */}
皮倩雯's avatar
皮倩雯 committed
1563
        {/* <Modal
1564
          title="请确认"
陈前坚's avatar
陈前坚 committed
1565 1566 1567 1568 1569 1570
          visible={freezeUserVisible}
          onOk={submitFreezeUser}
          onCancel={() => setFreezeUserVisible(false)}
          okText="确认"
          cancelText="取消"
        >
张烨's avatar
张烨 committed
1571 1572
          <p>
            即将{+currentUser.state ? '激活' : '冻结'}用户{' '}
1573 1574 1575
            <span className={styles.redText}>
              {voca.stripTags(currentUser.loginName)}
            </span>
张烨's avatar
张烨 committed
1576 1577 1578
            ,是否确认
            {+currentUser.state ? '激活' : '冻结'}?
          </p>
皮倩雯's avatar
皮倩雯 committed
1579
        </Modal> */}
1580
        {/* 多选删除用户 */}
1581 1582 1583
        <Modal
          title="确认删除用户"
          visible={deleteUserVisible}
陈前坚's avatar
陈前坚 committed
1584 1585 1586 1587 1588
          onOk={multiDelete ? submitDeleteUsers : submitDeleteUser}
          onCancel={() => {
            setDeleteUserVisible(false);
            setMultiDelete(false);
          }}
1589 1590 1591
          okText="确认"
          cancelText="取消"
        >
1592
          <p>将删除多个用户, 是否确认删除?</p>
1593
        </Modal>
mayongxin's avatar
mayongxin committed
1594
        <MapScopeEditModal
皮倩雯's avatar
皮倩雯 committed
1595
          title={id}
mayongxin's avatar
mayongxin committed
1596
          mapId={createGuid()}
mayongxin's avatar
mayongxin committed
1597
          visible={editOrgExtentVisible}
皮倩雯's avatar
皮倩雯 committed
1598
          stationId={currentSelectOrg1}
mayongxin's avatar
mayongxin committed
1599 1600 1601 1602 1603
          onCancel={() => setEditOrgExtentVisible(false)}
          confirmModal={submitExtent}
          distinct={currentOrgDistinct}
          extent={currentOrgArea}
        />
1604
        {/* <AuthModal
皮倩雯's avatar
皮倩雯 committed
1605 1606 1607
          visible={authUserVisible}
          currentUser={currentUser}
          onCancel={() => setAuthUserVisible(false)}
1608
        /> */}
陈前坚's avatar
陈前坚 committed
1609 1610
      </div>
    </PageContainer>
1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652
    // <DraggleLayout
    //     containerWidth={550}
    //     containerHeight={220}
    //     min={50}
    //     max={500}
    //     initLeftWidth={100}
    //     onWidthChange={w => setWidth(w)}
    //     handler={
    //       <div
    //         style={{
    //           width: 4,
    //           height: '100%',
    //           background: 'rgb(77, 81, 100)',
    //         }}
    //       />
    //     }
    //   >
    //     <div
    //       style={{
    //         backgroundColor: `rgb(36, 205, 208)`,
    //         color: `#fff`,
    //         height: '100%',
    //         display: 'flex',
    //         alignItems: 'center',
    //         justifyContent: 'center',
    //       }}
    //     >
    //       left
    //     </div>
    //     <div
    //       style={{
    //         backgroundColor: `rgb(116, 140, 253)`,
    //         color: `#fff`,
    //         height: '100%',
    //         display: 'flex',
    //         alignItems: 'center',
    //         justifyContent: 'center',
    //       }}
    //     >
    //       right
    //     </div>
    //   </DraggleLayout>
陈前坚's avatar
陈前坚 committed
1653 1654 1655 1656
  );
};

export default UserManage;