index.jsx 22.2 KB
Newer Older
1
/* eslint-disable object-shorthand */
邓超's avatar
邓超 committed
2
import React, { useEffect, useState, useRef } from 'react';
shaoan123's avatar
shaoan123 committed
3
import classnames from 'classnames';
mayongxin's avatar
mayongxin committed
4
import {
5 6 7 8 9 10 11 12 13 14 15 16
  // Tree,
  Table,
  Space,
  Input,
  Button,
  Select,
  Popconfirm,
  notification,
  Spin,
  Tooltip,
  Badge,
  Spac,
邓超's avatar
邓超 committed
17
  Card,
18 19
  Dropdown,
  Menu,
20
  Modal,
mayongxin's avatar
mayongxin committed
21
} from 'antd';
22 23 24 25 26 27 28 29
import {
  EditOutlined,
  DeleteOutlined,
  FontColorsOutlined,
  PlusSquareOutlined,
  SortDescendingOutlined,
  PlusOutlined,
  BorderInnerOutlined,
邓超's avatar
邓超 committed
30 31
  DoubleLeftOutlined,
  DoubleRightOutlined,
32 33
  MenuOutlined,
  DatabaseOutlined,
34 35 36
  FunnelPlotOutlined,
  BranchesOutlined,
  ToolOutlined,
37
} from '@ant-design/icons';
38

mayongxin's avatar
mayongxin committed
39
import PageContainer from '@/components/BasePageContainer';
40 41 42 43
import {
  CM_Table_LoadTable,
  removeTable,
  loadUnattachedTables,
44 45
  checkTableType,
  regroupTableType,
邓超's avatar
邓超 committed
46
} from '@/services/tablemanager/tablemanager';
47
import { useHistory } from 'react-router-dom';
48
import { Ellipse } from 'bizcharts/lib/g-components';
49

50
import Editor from './components/Field/editor';
51 52
// import AddTablelList from './components/Field/addTable';
import AddTablelList from './components/TableView';
53 54
import AffiliateAdd from './components/Field/affiliateAdd';
import LoadGroup from './components/Field/loadGroup';
55
import LoadGroupNew from './components/Field/loadGroupNew';
56
import { defaultFields } from './components/defaultFields';
57
import styles from './index.less';
mayongxin's avatar
mayongxin committed
58 59
const { Search } = Input;
const { Option } = Select;
60
const placeholder = '请输入表名';
61

62 63 64 65 66 67
const TableManager = props => {
  const history = useHistory();
  const [visible, setVisible] = useState(false); // 弹窗
  const [type, setType] = useState(''); // 弹窗类型
  const [formObj, setFormObj] = useState({});
  const [flag, setFlag] = useState(0); // 弹窗类型
邓超's avatar
邓超 committed
68
  // const [initNum, setIntNum] = useState(0);
69 70 71 72 73 74
  const [searchValue, setSearchValue] = useState('');
  const [treeLoading, setTreeLoading] = useState(true);
  const [tableList, setTableList] = useState([]);
  const [groupArr, setGroupArr] = useState([]);
  const [allData, setAllData] = useState([]);
  const [tableData, setTableData] = useState([]);
邓超's avatar
邓超 committed
75
  const [select, setSelect] = useState();
76
  const [selectTableName, setSelectTableName] = useState('');
皮倩雯's avatar
皮倩雯 committed
77
  const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
78 79
  const [chooseLine, setChooseLine] = useState([0]);
  const [keepValue, setKeepValue] = useState([0]);
80 81
  const [keepTreeSelect, setKeepTreeSelect] = useState([]);
  const [keepTreeFirst, setKeepTreeFirst] = useState([]);
邓超's avatar
邓超 committed
82 83 84
  const [treeVisible, setTreeVisible] = useState(true); // 是否显示左侧树
  const [hoverItemIndex, setHoverItemIndex] = useState(0); // hover流程索引
  const [pickIndex, setPickIndex] = useState(0);
85
  const [tableType, setTableType] = useState(defaultFields[0].value);
86 87
  const [groupPopVisible, setgGroupPopVisible] = useState(false);
  const [checkMsg, setCheckMsg] = useState();
邓超's avatar
邓超 committed
88 89

  const initNum = useRef(0);
90 91
  useEffect(
    record => {
邓超's avatar
邓超 committed
92 93 94 95 96 97 98
      if (props.history.location.query && initNum.current == 0) {
        loadTable(props.history.location.query.searchV);
        setSearchValue(props.history.location.query.searchV);
      } else {
        loadTable(searchValue);
      }

99 100 101 102 103 104 105 106 107 108 109
      getField();
      //   if (props.history.location.query && selectTableName !== {}) {
      //     let { template } = props.history.location.query;
      //     setSelectTableName(template);
      //   }
    },
    [flag],
  );
  // 重字段配置返回后需要返回到原来的位置
  useEffect(() => {
    let arr = Object.keys(allData);
邓超's avatar
邓超 committed
110

邓超's avatar
邓超 committed
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
    if (
      arr.length > 0 &&
      props.history.location.query &&
      selectTableName == '' &&
      initNum.current == 0
    ) {
      let {
        tableScroll,
        template,
        keepValue,
        group,
        backIndex,
        selectValue,
      } = props.history.location.query;
      setSelectTableName(template);
126
      const i = group.findIndex(item => item.type == selectValue);
127
      setTimeout(() => {
邓超's avatar
邓超 committed
128 129
        setSelect(selectValue);
        setPickIndex(i);
邓超's avatar
邓超 committed
130
        setGroupArr(group);
131 132
        document.querySelector('.ant-table-body').scrollTop = tableScroll;
      }, 0);
133 134
      setChooseLine(keepValue);
      setKeepValue(keepValue);
135
    }
136
  }, [allData]);
邓超's avatar
邓超 committed
137

138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
  // 附加
  const add = record => {
    setFormObj(record);
    setType('affiliateAdd');
    setVisible(true);
  };
  // 修改表名
  const changeDesc = record => {
    setType('edit');
    setVisible(true);
    setFormObj(record);
  };
  // 删除表
  const deleteChart = record => {
    removeTable({ tableID: record.tableID, removeFields: true }).then(res => {
      if (res.msg === 'Ok' || res.msg === '') {
        notification.success({
          message: '提示',
          duration: 3,
          description: '删除成功',
        });
        setFlag(flag + 1);
      } else {
        notification.error({
          message: '提示',
          duration: 3,
          description: res.msg,
        });
      }
    });
  };
169

170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
  const onSubmit = prop => {
    setVisible(false);
    setFlag(flag + 1);
  };
  // 建表
  const AddTable = () => {
    setType('add');
    setVisible(true);
  };
  // 附加表
  const AffiliateAddTable = () => {
    setType('affiliateAdd');
    setFormObj({});
    setVisible(true);
  };
  // 字段配置
  const fieldsConfig = (record, e) => {
    e.stopPropagation();
    setFormObj(record);
    history.push({
190
      pathname: `/biz/account/fieldConfig`,
191
      state: {
192
        id: record.tableName,
193 194
        template: record,
        tableScroll: document.querySelector('.ant-table-body').scrollTop,
邓超's avatar
邓超 committed
195 196
        groupArr: groupArr,
        pickIndex: pickIndex,
邓超's avatar
邓超 committed
197 198
        searchValue: searchValue,
        select: select,
199
        keepValue: keepValue,
200 201
        keepTreeSelect: keepTreeSelect,
        keepTreeFirst: keepTreeFirst,
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
      },
    });
    // setType('config');
    // setVisible(true);
  };
  // 分组与排序
  const sort = record => {
    setFormObj(record);
    setType('sort');
    setVisible(true);
  };
  // 搜索框改变时存储输入的值
  const handleChange = e => {
    setSearchValue(e.target.value);
  };
  // 搜索
  const handleSearch = text => {
邓超's avatar
邓超 committed
219
    loadTable(text, 'search');
220
    setSearchValue(text);
邓超's avatar
邓超 committed
221
    setSelectTableName('');
邓超's avatar
邓超 committed
222 223
    setPickIndex(0);
    setSelect(groupArr[0].type);
皮倩雯's avatar
皮倩雯 committed
224
    setShowSearchStyle(true);
225 226 227 228
  };
  const getField = () => {
    loadUnattachedTables().then(res => {
      if (res.data.root && res.data.root.length) {
229
        setTableList(res.data.root.reverse());
230 231 232 233
      }
    });
  };
  // 加载表
邓超's avatar
邓超 committed
234
  const loadTable = (keyword, isSearch) => {
235 236 237 238 239 240 241 242
    setTreeLoading(true);
    CM_Table_LoadTable({
      _version: 9999,
      filter: keyword || '',
    })
      .then(res => {
        setTreeLoading(false);
        if (res.msg === 'Ok') {
邓超's avatar
邓超 committed
243
          // setTableData(res.data.root);
244 245
          let groupData = formateArrDataA(res.data.root, 'groupName');
          let newArr = [];
246 247
          let aa = [];
          let bb = [];
248 249 250 251 252 253 254 255 256 257 258 259
          console.log(groupData, 'groupData');
          // 对分组进行排序
          const sortNameArr = ['事件表', '工单表', '台账表', '设备表', '反馈表', '其他表'];
          const sortList = [];
          sortNameArr.forEach(ele => {
            Object.keys(groupData).map((item, index) => {
              if (item === ele) {
                newArr.push({ type: item, key: index, page: 1, pageSize: 20 });
                aa.push({ name: item, key: index, ID: index, children: groupData[item] });
                bb.push(item);
              }
            });
260
          });
261
          console.log(sortList, 'sortList');
262
          console.log(groupData);
邓超's avatar
邓超 committed
263
          setAllData(groupData);
邓超's avatar
邓超 committed
264 265 266 267 268 269 270
          if (!props.history.location.query || initNum.current > 0) {
            if (newArr.length > 0 && (!select || isSearch)) {
              setSelect(newArr[0].type);
            }
            if (groupArr.length == 0 || isSearch) {
              setGroupArr(newArr);
            }
邓超's avatar
邓超 committed
271
          }
272 273
          setKeepTreeFirst(bb);
          setKeepTreeSelect(aa);
邓超's avatar
邓超 committed
274
          initNum.current += 1;
275 276 277
        }
      })
      .catch(e => {
邓超's avatar
邓超 committed
278
        setTreeLoading(false);
279 280 281 282 283 284
      });
  };
  const formateArrDataA = (initialArr, name) => {
    // 判定传参是否符合规则
    if (!(initialArr instanceof Array)) {
      return '请传入正确格式的数组';
285
    }
286 287
    if (!name) {
      return '请传入对象属性';
mayongxin's avatar
mayongxin committed
288
    }
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
    // 先获取一下这个数组中有多少个"name"
    let nameArr = [];
    for (let i in initialArr) {
      if (nameArr.indexOf(initialArr[i][`${name}`]) === -1) {
        nameArr.push(initialArr[i][`${name}`]);
      }
    }
    // 新建一个包含多个list的结果对象
    let tempObj = {};
    // 根据不同的"name"生成多个数组
    for (let k in nameArr) {
      for (let j in initialArr) {
        if (initialArr[j][`${name}`] == nameArr[k]) {
          // 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
          tempObj[nameArr[k]] = tempObj[nameArr[k]] || [];
          tempObj[nameArr[k]].push(initialArr[j]);
305
        }
306
      }
307
    }
308 309 310 311 312 313 314 315 316 317 318
    for (let keys in tempObj) {
      let arr = [];
      tempObj[keys].map((item, index) => {
        tempObj[keys] = arr;
        item.key = index;
        arr.push(item);
      });
    }
    return tempObj;
  };
  const setRowClassName = record =>
319
    Object.entries(record).toString() === Object.entries(selectTableName).toString()
320 321
      ? styles.clickRowStyle
      : '';
邓超's avatar
邓超 committed
322 323 324 325 326 327 328 329 330 331 332 333
  // 模糊查询匹配的样式
  const searchStyle = val => {
    let n;
    if (showSearchStyle) {
      n = val.replace(
        new RegExp(searchValue, 'g'),
        `<span style='color:red'>${searchValue}</span>`,
      );
    } else {
      n = val;
    }
    return <div dangerouslySetInnerHTML={{ __html: n }} />;
334
  };
335

336 337 338
  const columns = [
    {
      title: '名称',
邓超's avatar
邓超 committed
339 340
      dataIndex: 'tableName',
      key: 'tableName',
邓超's avatar
邓超 committed
341
      width: 400,
邓超's avatar
邓超 committed
342 343
      render: (text, record) => (
        <div onClick={e => fieldsConfig(record, e)}>{searchStyle(text)}</div>
344
      ),
345 346 347 348 349 350
    },
    {
      title: '别名',
      dataIndex: 'tableAlias',
      key: 'tableAlias',
      align: 'center',
邓超's avatar
邓超 committed
351
      render: text => <div>{text || '(无)'}</div>,
352 353 354 355 356 357
    },
    {
      title: '表格样式',
      dataIndex: 'tableStyle',
      key: 'tableStyle',
      align: 'center',
358
      width: 80,
359
      render: text => <div>{text}</div>,
360 361 362 363 364 365
    },
    {
      title: '附加字段',
      dataIndex: 'fieldCount',
      key: 'fieldCount',
      align: 'center',
366
      width: 80,
367 368 369 370 371 372
    },
    {
      title: '缺少字段',
      dataIndex: 'missingFieldCount',
      key: 'missingFieldCount',
      align: 'center',
373
      width: 80,
邓超's avatar
邓超 committed
374 375 376 377 378 379 380 381 382
      render: text => (
        <div
          className={classnames({
            [styles.lack]: text !== '(无)',
          })}
        >
          {text}
        </div>
      ),
383 384 385 386 387 388
    },
    {
      title: '未附加',
      dataIndex: 'extraFieldCount',
      key: 'extraFieldCount',
      align: 'center',
389
      width: 80,
390 391 392 393 394 395
    },
    {
      title: '分组数量',
      dataIndex: 'groupCount',
      key: 'groupCount',
      align: 'center',
396
      width: 80,
397
    },
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
    {
      title: '接口',
      dataIndex: 'interfaceText',
      key: 'interfaceText',
      align: 'center',
      width: 80,
      render: record => {
        if (record) {
          return (
            <Tooltip title={record}>
              <span style={{ color: '#50aefc', cursor: 'pointer' }}></span>
            </Tooltip>
          );
        }
        return <span></span>;
      },
    },
415 416
    {
      title: '操作',
邓超's avatar
邓超 committed
417 418
      ellipsis: true,
      key: 'tableID',
419
      align: 'center',
420
      width: 100,
邓超's avatar
邓超 committed
421 422 423 424 425 426 427 428
      render: (text, record) => (
        <Space>
          <Tooltip title="修改">
            <EditOutlined
              onClick={() => changeDesc(record)}
              style={{ fontSize: '20px', color: '#1890FF' }}
            />
          </Tooltip>
429
          <Tooltip title="表配置">
430
            <MenuOutlined
431 432 433 434 435 436 437 438
              onClick={() => {
                setType('tableEdit');
                setVisible(true);
                setFormObj(record);
              }}
              style={{ fontSize: '20px', color: '#1890FF' }}
            />
          </Tooltip>
邓超's avatar
邓超 committed
439
          {/* <Tooltip title="字段配置">
邓超's avatar
邓超 committed
440 441 442 443
            <FontColorsOutlined
              onClick={e => fieldsConfig(record, e)}
              style={{ fontSize: '16px', color: '#1890FF' }}
            />
邓超's avatar
邓超 committed
444 445
          </Tooltip> */}
          {/* <Tooltip title="附加">
邓超's avatar
邓超 committed
446 447 448 449
            <PlusSquareOutlined
              onClick={() => add(record)}
              style={{ fontSize: '16px', color: '#1890FF' }}
            />
邓超's avatar
邓超 committed
450 451
          </Tooltip> */}
          {/* <Tooltip title="分组与排序">
邓超's avatar
邓超 committed
452 453 454 455
            <SortDescendingOutlined
              onClick={() => sort(record)}
              style={{ fontSize: '16px', color: '#1890FF' }}
            />
邓超's avatar
邓超 committed
456
          </Tooltip> */}
邓超's avatar
邓超 committed
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472
          <div onClick={e => e.stopPropagation()}>
            <Popconfirm
              title="是否删除该表?"
              okText="确认"
              cancelText="取消"
              onConfirm={() => {
                deleteChart(record);
              }}
            >
              <Tooltip title="删除">
                <DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }} />
              </Tooltip>
            </Popconfirm>
          </div>
        </Space>
      ),
473 474
    },
  ];
邓超's avatar
邓超 committed
475 476 477 478 479
  const pageChage = (page, pageSize) => {
    const list = JSON.parse(JSON.stringify(groupArr));
    list[pickIndex].page = page;
    list[pickIndex].pageSize = pageSize;
    setGroupArr(list);
480
  };
481 482 483 484 485
  const onMenuClick = e => {
    console.log('click', e);
    setTableType(e.key);
    AddTable();
  };
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500
  // 检查表类型重分组
  const checkGroup = () => {
    checkTableType().then(res => {
      console.log(res);
      if (res.data === '检查完成,一切正常!') {
        notification.success({ message: '提示', duration: 3, description: res.data });
      } else {
        setCheckMsg(res.data);
        setgGroupPopVisible(true);
      }
    });
  };
  const getNewGroup = () => {
    regroupTableType().then(res => {
      if (res.code === 0) {
501
        // setFlag(flag + 1);
502
        setgGroupPopVisible(false);
503 504 505 506
        loadTable(searchValue, 'search');
        setSelectTableName('');
        setPickIndex(0);
        setSelect(groupArr[0].type);
507 508 509 510
        notification.success({ message: '提示', duration: 3, description: '执行成功' });
      }
    });
  };
511 512 513 514 515 516
  const menu = (
    <Menu
      onClick={onMenuClick}
      items={defaultFields.map(item => ({ key: item.value, label: item.value }))}
    />
  );
517 518 519
  return (
    <Spin tip="loading..." spinning={treeLoading}>
      <PageContainer>
邓超's avatar
邓超 committed
520 521 522 523 524 525 526 527 528 529
        <div className={styles.content}>
          {/* 左侧树 */}
          <Spin spinning={treeLoading} tip="loading...">
            <Card
              className={classnames({
                [styles.orgContainer]: true,
                [styles.orgContainerHide]: !treeVisible,
              })}
            >
              <div style={{ display: `${treeVisible ? 'block' : 'none'}` }}>
530 531
                <span className={styles.processTitle}>
                  表分组
532
                  <Tooltip title="表类型重新分组检查">
533 534 535 536 537 538 539 540 541 542 543
                    <ToolOutlined
                      onClick={() => checkGroup()}
                      style={{
                        fontSize: '20px',
                        color: '#1890FF',
                        cursor: 'pointer',
                        marginLeft: '130px',
                      }}
                    />
                  </Tooltip>
                </span>
邓超's avatar
邓超 committed
544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606
                <hr className={styles.splitLine} />

                <div
                  style={{
                    overflowY: 'scroll',
                    height: 'calc(100vh - 150px)',
                    overflowX: 'hidden',
                  }}
                >
                  {groupArr.length > 0 &&
                    groupArr.map((item, index) => (
                      <div
                        key={index}
                        className={classnames({
                          [styles.listItem]: true,
                          [styles.pickItem]: item.type === select,
                          [styles.listHover]: item.type !== select && item.type === hoverItemIndex,
                        })}
                        onMouseEnter={() => {
                          setHoverItemIndex(item.type);
                        }}
                        onMouseLeave={() => {
                          setHoverItemIndex('');
                        }}
                        onClick={() => {
                          setPickIndex(index);
                          setSelect(item.type);
                          setTableData(item.root);
                        }}
                      >
                        {item.type}{allData[item.type]?.length}
                      </div>
                    ))}
                </div>
              </div>
              <div className={styles.switcher}>
                {treeVisible && (
                  <Tooltip title="隐藏分组列表">
                    <DoubleLeftOutlined onClick={() => setTreeVisible(false)} />
                  </Tooltip>
                )}
                {!treeVisible && (
                  <Tooltip title="显示分组列表">
                    <DoubleRightOutlined onClick={() => setTreeVisible(true)} />
                  </Tooltip>
                )}
              </div>
            </Card>
          </Spin>
          <div className={styles.tablemanager_container}>
            <div className={styles.operate_bar}>
              <div className={styles.fast_search}>
                <div className={styles.title}>快速检索</div>
                <Search
                  allowClear
                  placeholder={placeholder}
                  onSearch={handleSearch}
                  onChange={handleChange}
                  value={searchValue}
                  enterButton
                  style={{ width: '300px' }}
                />
              </div>
607 608 609 610 611 612 613 614 615
              <Dropdown overlay={menu} arrow>
                <Button
                  type="primary"
                  icon={<BorderInnerOutlined />}
                  style={{ marginLeft: '10px' }}
                >
                  建表
                </Button>
              </Dropdown>
邓超's avatar
邓超 committed
616 617 618 619 620 621 622 623 624
              <Button
                type="primary"
                style={{ marginLeft: '10px' }}
                icon={<PlusOutlined />}
                onClick={AffiliateAddTable}
              >
                附加表
              </Button>
            </div>
625
            <div style={{ flex: 1, position: 'relative', width: '100%', background: '#fff' }}>
邓超's avatar
邓超 committed
626 627 628 629 630 631 632
              <Table
                rowKey={record => record.key}
                size="small"
                bordered
                style={{ position: 'absolute' }}
                columns={columns}
                dataSource={allData[select]}
633
                scroll={{ x: 'max-content', y: 'calc(100% - 50px)' }}
邓超's avatar
邓超 committed
634 635 636 637 638
                rowClassName={setRowClassName}
                onRow={record => ({
                  onDoubleClick: event => {
                    event.stopPropagation();
                    history.push({
639
                      pathname: `/biz/account/fieldConfig`,
邓超's avatar
邓超 committed
640
                      state: {
641
                        id: record.tableName,
邓超's avatar
邓超 committed
642 643 644 645
                        template: record,
                        tableScroll: document.querySelector('.ant-table-body').scrollTop,
                        groupArr: groupArr,
                        pickIndex: pickIndex,
邓超's avatar
邓超 committed
646 647
                        searchValue: searchValue,
                        select: select,
邓超's avatar
邓超 committed
648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668
                        keepValue: keepValue,
                        keepTreeSelect: keepTreeSelect,
                        keepTreeFirst: keepTreeFirst,
                      },
                    });
                  },
                  onClick: event => {
                    event.stopPropagation();
                    setSelectTableName(record);
                  }, // 点击行
                })}
                pagination={{
                  showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条`,
                  pageSizeOptions: [10, 20, 50, 100],
                  defaultPageSize: 20,
                  showQuickJumper: true,
                  showSizeChanger: true,
                  current: groupArr[pickIndex] ? groupArr[pickIndex].page : 1,
                  pageSize: groupArr[pickIndex] ? groupArr[pickIndex].pageSize : 20,
                  onChange: (page, pageSize) => pageChage(page, pageSize),
                }}
669 670 671 672 673 674 675 676 677 678 679 680 681
              />
            </div>
          </div>
        </div>
        {visible && type == 'edit' && (
          <Editor
            visible={visible}
            onCancel={() => setVisible(false)}
            callBackSubmit={onSubmit}
            type={type}
            formObj={formObj}
          />
        )}
682
        {/* {visible && type === 'add' && (
683
          <AddTablelList type={type} onCancel={() => setVisible(false)} callBackSubmit={onSubmit} />
684 685 686 687 688 689 690 691 692
        )} */}
        <AddTablelList
          visible={visible && (type === 'add' || type === 'tableEdit')}
          type={type}
          onCancel={() => setVisible(false)}
          formObj={formObj}
          callBackSubmit={onSubmit}
          tableType={tableType}
        />
693 694 695 696 697 698 699 700 701 702
        {visible && type === 'affiliateAdd' && (
          <AffiliateAdd
            visible={visible}
            tableList={tableList}
            type={type}
            onCancel={() => setVisible(false)}
            callBackSubmit={onSubmit}
            formObj={formObj}
          />
        )}
mayongxin's avatar
mayongxin committed
703

704
        {/* {visible && type === 'sort' && (
705 706 707 708 709 710 711
          <LoadGroup
            visible={visible}
            type={type}
            formObj={formObj}
            onCancel={() => setVisible(false)}
            callBackSubmit={onSubmit}
          />
712 713 714 715 716 717 718 719 720
        )} */}
        {visible && type === 'sort' && (
          <LoadGroupNew
            visible={visible}
            type={type}
            formObj={formObj}
            onCancel={() => setVisible(false)}
            callBackSubmit={onSubmit}
          />
721
        )}
722
        <Modal
723
          title="确定要进行表类型重新分组吗?"
724 725 726 727 728 729
          visible={groupPopVisible}
          onOk={getNewGroup}
          onCancel={() => setgGroupPopVisible(false)}
        >
          <div style={{ whiteSpace: 'pre-line', textAlign: 'justify' }}>{checkMsg}</div>
        </Modal>
730 731 732 733 734
      </PageContainer>
    </Spin>
  );
};
export default TableManager;