index.jsx 22.5 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 86 87 88 89 90 91 92 93
  const [defaultFields1, setDefaultFields1] = useState([
    '事件表',
    '事件工单表',
    '工单表',
    '台账表',
    '设备表',
    '反馈表',
  ]);
  const [tableType, setTableType] = useState(defaultFields1[0]);
94 95
  const [groupPopVisible, setgGroupPopVisible] = useState(false);
  const [checkMsg, setCheckMsg] = useState();
邓超's avatar
邓超 committed
96 97

  const initNum = useRef(0);
98 99
  useEffect(
    record => {
邓超's avatar
邓超 committed
100 101 102 103 104 105 106
      if (props.history.location.query && initNum.current == 0) {
        loadTable(props.history.location.query.searchV);
        setSearchValue(props.history.location.query.searchV);
      } else {
        loadTable(searchValue);
      }

107 108 109 110 111 112 113 114 115 116 117
      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
118

邓超's avatar
邓超 committed
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
    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);
134
      const i = group.findIndex(item => item.type == selectValue);
135
      setTimeout(() => {
邓超's avatar
邓超 committed
136 137
        setSelect(selectValue);
        setPickIndex(i);
138
        console.log(group);
邓超's avatar
邓超 committed
139
        setGroupArr(group);
140 141
        document.querySelector('.ant-table-body').scrollTop = tableScroll;
      }, 0);
142 143
      setChooseLine(keepValue);
      setKeepValue(keepValue);
144
    }
145
  }, [allData]);
邓超's avatar
邓超 committed
146

147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
  // 附加
  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,
        });
      }
    });
  };
178

179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
  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({
199
      pathname: `/biz/account/fieldConfig`,
200
      state: {
201
        id: record.tableName,
202 203
        template: record,
        tableScroll: document.querySelector('.ant-table-body').scrollTop,
邓超's avatar
邓超 committed
204 205
        groupArr: groupArr,
        pickIndex: pickIndex,
邓超's avatar
邓超 committed
206 207
        searchValue: searchValue,
        select: select,
208
        keepValue: keepValue,
209 210
        keepTreeSelect: keepTreeSelect,
        keepTreeFirst: keepTreeFirst,
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
      },
    });
    // 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
228
    loadTable(text, 'search');
229
    setSearchValue(text);
邓超's avatar
邓超 committed
230
    setSelectTableName('');
邓超's avatar
邓超 committed
231 232
    setPickIndex(0);
    setSelect(groupArr[0].type);
皮倩雯's avatar
皮倩雯 committed
233
    setShowSearchStyle(true);
234 235 236 237
  };
  const getField = () => {
    loadUnattachedTables().then(res => {
      if (res.data.root && res.data.root.length) {
238
        setTableList(res.data.root.reverse());
239 240 241 242
      }
    });
  };
  // 加载表
邓超's avatar
邓超 committed
243
  const loadTable = (keyword, isSearch) => {
244 245 246 247 248 249 250 251
    setTreeLoading(true);
    CM_Table_LoadTable({
      _version: 9999,
      filter: keyword || '',
    })
      .then(res => {
        setTreeLoading(false);
        if (res.msg === 'Ok') {
邓超's avatar
邓超 committed
252
          // setTableData(res.data.root);
253 254
          let groupData = formateArrDataA(res.data.root, 'groupName');
          let newArr = [];
255 256
          let aa = [];
          let bb = [];
257 258
          console.log(groupData, 'groupData');
          // 对分组进行排序
259 260 261 262 263 264 265 266 267
          const sortNameArr = [
            '事件表',
            '事件工单表',
            '工单表',
            '台账表',
            '设备表',
            '反馈表',
            '其他表',
          ];
268 269 270 271 272 273 274 275 276
          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);
              }
            });
277
          });
278
          console.log(sortList, 'sortList');
279
          console.log(groupData);
邓超's avatar
邓超 committed
280
          setAllData(groupData);
邓超's avatar
邓超 committed
281 282 283 284 285 286 287
          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
288
          }
289 290
          setKeepTreeFirst(bb);
          setKeepTreeSelect(aa);
邓超's avatar
邓超 committed
291
          initNum.current += 1;
292 293 294
        }
      })
      .catch(e => {
邓超's avatar
邓超 committed
295
        setTreeLoading(false);
296 297 298 299 300 301
      });
  };
  const formateArrDataA = (initialArr, name) => {
    // 判定传参是否符合规则
    if (!(initialArr instanceof Array)) {
      return '请传入正确格式的数组';
302
    }
303 304
    if (!name) {
      return '请传入对象属性';
mayongxin's avatar
mayongxin committed
305
    }
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321
    // 先获取一下这个数组中有多少个"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]);
322
        }
323
      }
324
    }
325 326 327 328 329 330 331 332 333 334 335
    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 =>
336
    Object.entries(record).toString() === Object.entries(selectTableName).toString()
337 338
      ? styles.clickRowStyle
      : '';
邓超's avatar
邓超 committed
339 340 341 342 343 344 345 346 347 348 349 350
  // 模糊查询匹配的样式
  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 }} />;
351
  };
352

353 354 355
  const columns = [
    {
      title: '名称',
邓超's avatar
邓超 committed
356 357
      dataIndex: 'tableName',
      key: 'tableName',
邓超's avatar
邓超 committed
358
      width: 400,
邓超's avatar
邓超 committed
359 360
      render: (text, record) => (
        <div onClick={e => fieldsConfig(record, e)}>{searchStyle(text)}</div>
361
      ),
362 363 364 365 366 367
    },
    {
      title: '别名',
      dataIndex: 'tableAlias',
      key: 'tableAlias',
      align: 'center',
邓超's avatar
邓超 committed
368
      render: text => <div>{text || '(无)'}</div>,
369 370 371 372 373 374
    },
    {
      title: '表格样式',
      dataIndex: 'tableStyle',
      key: 'tableStyle',
      align: 'center',
375
      width: 80,
376
      render: text => <div>{text}</div>,
377 378 379 380 381 382
    },
    {
      title: '附加字段',
      dataIndex: 'fieldCount',
      key: 'fieldCount',
      align: 'center',
383
      width: 80,
384 385 386 387 388 389
    },
    {
      title: '缺少字段',
      dataIndex: 'missingFieldCount',
      key: 'missingFieldCount',
      align: 'center',
390
      width: 80,
邓超's avatar
邓超 committed
391 392 393 394 395 396 397 398 399
      render: text => (
        <div
          className={classnames({
            [styles.lack]: text !== '(无)',
          })}
        >
          {text}
        </div>
      ),
400 401 402 403 404 405
    },
    {
      title: '未附加',
      dataIndex: 'extraFieldCount',
      key: 'extraFieldCount',
      align: 'center',
406
      width: 80,
407 408 409 410 411 412
    },
    {
      title: '分组数量',
      dataIndex: 'groupCount',
      key: 'groupCount',
      align: 'center',
413
      width: 80,
414
    },
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431
    {
      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>;
      },
    },
432 433
    {
      title: '操作',
邓超's avatar
邓超 committed
434 435
      ellipsis: true,
      key: 'tableID',
436
      align: 'center',
437
      width: 100,
邓超's avatar
邓超 committed
438 439 440 441 442 443 444 445
      render: (text, record) => (
        <Space>
          <Tooltip title="修改">
            <EditOutlined
              onClick={() => changeDesc(record)}
              style={{ fontSize: '20px', color: '#1890FF' }}
            />
          </Tooltip>
446
          <Tooltip title="表配置">
447
            <MenuOutlined
448 449 450 451 452 453 454 455
              onClick={() => {
                setType('tableEdit');
                setVisible(true);
                setFormObj(record);
              }}
              style={{ fontSize: '20px', color: '#1890FF' }}
            />
          </Tooltip>
邓超's avatar
邓超 committed
456
          {/* <Tooltip title="字段配置">
邓超's avatar
邓超 committed
457 458 459 460
            <FontColorsOutlined
              onClick={e => fieldsConfig(record, e)}
              style={{ fontSize: '16px', color: '#1890FF' }}
            />
邓超's avatar
邓超 committed
461 462
          </Tooltip> */}
          {/* <Tooltip title="附加">
邓超's avatar
邓超 committed
463 464 465 466
            <PlusSquareOutlined
              onClick={() => add(record)}
              style={{ fontSize: '16px', color: '#1890FF' }}
            />
邓超's avatar
邓超 committed
467 468
          </Tooltip> */}
          {/* <Tooltip title="分组与排序">
邓超's avatar
邓超 committed
469 470 471 472
            <SortDescendingOutlined
              onClick={() => sort(record)}
              style={{ fontSize: '16px', color: '#1890FF' }}
            />
邓超's avatar
邓超 committed
473
          </Tooltip> */}
邓超's avatar
邓超 committed
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
          <div onClick={e => e.stopPropagation()}>
            <Popconfirm
              title="是否删除该表?"
              okText="确认"
              cancelText="取消"
              onConfirm={() => {
                deleteChart(record);
              }}
            >
              <Tooltip title="删除">
                <DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }} />
              </Tooltip>
            </Popconfirm>
          </div>
        </Space>
      ),
490 491
    },
  ];
邓超's avatar
邓超 committed
492 493 494 495 496
  const pageChage = (page, pageSize) => {
    const list = JSON.parse(JSON.stringify(groupArr));
    list[pickIndex].page = page;
    list[pickIndex].pageSize = pageSize;
    setGroupArr(list);
497
  };
498 499 500 501 502
  const onMenuClick = e => {
    console.log('click', e);
    setTableType(e.key);
    AddTable();
  };
503 504 505 506 507 508 509 510 511 512 513 514 515 516 517
  // 检查表类型重分组
  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) {
518
        // setFlag(flag + 1);
519
        setgGroupPopVisible(false);
520 521 522 523
        loadTable(searchValue, 'search');
        setSelectTableName('');
        setPickIndex(0);
        setSelect(groupArr[0].type);
524 525 526 527
        notification.success({ message: '提示', duration: 3, description: '执行成功' });
      }
    });
  };
528
  const menu = (
529
    <Menu onClick={onMenuClick} items={defaultFields1.map(item => ({ key: item, label: item }))} />
530
  );
531 532 533
  return (
    <Spin tip="loading..." spinning={treeLoading}>
      <PageContainer>
邓超's avatar
邓超 committed
534 535 536 537 538 539 540 541 542 543
        <div className={styles.content}>
          {/* 左侧树 */}
          <Spin spinning={treeLoading} tip="loading...">
            <Card
              className={classnames({
                [styles.orgContainer]: true,
                [styles.orgContainerHide]: !treeVisible,
              })}
            >
              <div style={{ display: `${treeVisible ? 'block' : 'none'}` }}>
544 545
                <span className={styles.processTitle}>
                  表分组
546
                  <Tooltip title="表类型重新分组检查">
547 548 549 550 551 552 553 554 555 556 557
                    <ToolOutlined
                      onClick={() => checkGroup()}
                      style={{
                        fontSize: '20px',
                        color: '#1890FF',
                        cursor: 'pointer',
                        marginLeft: '130px',
                      }}
                    />
                  </Tooltip>
                </span>
邓超's avatar
邓超 committed
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 607 608 609 610 611 612 613 614 615 616 617 618 619 620
                <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>
621 622 623 624 625 626 627 628 629
              <Dropdown overlay={menu} arrow>
                <Button
                  type="primary"
                  icon={<BorderInnerOutlined />}
                  style={{ marginLeft: '10px' }}
                >
                  建表
                </Button>
              </Dropdown>
邓超's avatar
邓超 committed
630 631 632 633 634 635 636 637 638
              <Button
                type="primary"
                style={{ marginLeft: '10px' }}
                icon={<PlusOutlined />}
                onClick={AffiliateAddTable}
              >
                附加表
              </Button>
            </div>
639
            <div style={{ flex: 1, position: 'relative', width: '100%', background: '#fff' }}>
邓超's avatar
邓超 committed
640 641 642 643 644 645 646
              <Table
                rowKey={record => record.key}
                size="small"
                bordered
                style={{ position: 'absolute' }}
                columns={columns}
                dataSource={allData[select]}
647
                scroll={{ x: 'max-content', y: 'calc(100% - 50px)' }}
邓超's avatar
邓超 committed
648 649 650 651 652
                rowClassName={setRowClassName}
                onRow={record => ({
                  onDoubleClick: event => {
                    event.stopPropagation();
                    history.push({
653
                      pathname: `/biz/account/fieldConfig`,
邓超's avatar
邓超 committed
654
                      state: {
655
                        id: record.tableName,
邓超's avatar
邓超 committed
656 657 658 659
                        template: record,
                        tableScroll: document.querySelector('.ant-table-body').scrollTop,
                        groupArr: groupArr,
                        pickIndex: pickIndex,
邓超's avatar
邓超 committed
660 661
                        searchValue: searchValue,
                        select: select,
邓超's avatar
邓超 committed
662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682
                        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),
                }}
683 684 685 686 687 688 689 690 691 692 693 694 695
              />
            </div>
          </div>
        </div>
        {visible && type == 'edit' && (
          <Editor
            visible={visible}
            onCancel={() => setVisible(false)}
            callBackSubmit={onSubmit}
            type={type}
            formObj={formObj}
          />
        )}
696
        {/* {visible && type === 'add' && (
697
          <AddTablelList type={type} onCancel={() => setVisible(false)} callBackSubmit={onSubmit} />
698 699 700 701 702 703 704 705 706
        )} */}
        <AddTablelList
          visible={visible && (type === 'add' || type === 'tableEdit')}
          type={type}
          onCancel={() => setVisible(false)}
          formObj={formObj}
          callBackSubmit={onSubmit}
          tableType={tableType}
        />
707 708 709 710 711 712 713 714 715 716
        {visible && type === 'affiliateAdd' && (
          <AffiliateAdd
            visible={visible}
            tableList={tableList}
            type={type}
            onCancel={() => setVisible(false)}
            callBackSubmit={onSubmit}
            formObj={formObj}
          />
        )}
mayongxin's avatar
mayongxin committed
717

718
        {/* {visible && type === 'sort' && (
719 720 721 722 723 724 725
          <LoadGroup
            visible={visible}
            type={type}
            formObj={formObj}
            onCancel={() => setVisible(false)}
            callBackSubmit={onSubmit}
          />
726 727 728 729 730 731 732 733 734
        )} */}
        {visible && type === 'sort' && (
          <LoadGroupNew
            visible={visible}
            type={type}
            formObj={formObj}
            onCancel={() => setVisible(false)}
            callBackSubmit={onSubmit}
          />
735
        )}
736
        <Modal
737
          title="确定要进行表类型重新分组吗?"
738 739 740 741 742 743
          visible={groupPopVisible}
          onOk={getNewGroup}
          onCancel={() => setgGroupPopVisible(false)}
        >
          <div style={{ whiteSpace: 'pre-line', textAlign: 'justify' }}>{checkMsg}</div>
        </Modal>
744 745 746 747 748
      </PageContainer>
    </Spin>
  );
};
export default TableManager;