BookConfigNew.jsx 24.1 KB
Newer Older
涂伟's avatar
涂伟 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/* eslint-disable no-lonely-if */
/* eslint-disable no-else-return */
/* eslint-disable prefer-promise-reject-errors */
/* eslint-disable camelcase */
import React, { useState, useEffect, useRef } from 'react';
import {
  Form,
  Input,
  Select,
  Tooltip,
  Button,
  notification,
  Drawer,
  Space,
  Modal,
  Row,
  Col,
  Switch,
} from 'antd';
20
import { PlusOutlined, InfoCircleOutlined, EyeOutlined } from '@ant-design/icons';
涂伟's avatar
涂伟 committed
21 22 23 24 25 26 27 28
import { LoadEventFields } from '@/services/tablemanager/tablemanager';
import {
  GetCM_Ledger_LoadLedgerTable,
  GetCMLedger_QueryLedgers,
  Ledger_ReloadLedgerFields,
  Ledger_QueryLedger,
  Ledger_SaveLedger,
} from '@/services/standingBook/api';
29
import { Account, getFieldInfo } from 'panda-xform';
涂伟's avatar
涂伟 committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
import ChangeAdd from './changeAdd';
import EditTable from './EditTable';
import styles from './BookConfigNew.less';

const { Option } = Select;
const { TextArea } = Input;
const BookConfigNew = props => {
  const {
    callBackSubmit,
    type,
    formObj,
    visible,
    tableData,
    pickItem1,
    onCancel,
    data,
    maxLength,
    keepTableData,
  } = props;
  const [standingTable, setStandingTable] = useState([]);
  const [isVisible, setIsVisible] = useState(false); // 弹窗
  const [pickItem, setPickItem] = useState(''); // 选择的字段
  const [Order, setOrder] = useState(''); // 当前编辑序号
  const [filed, setFiled] = useState({}); // 传给子组件列表数据
  const [checkedList, setCheckedList] = useState([]);
  const [allFileds, setAllFileds] = useState([]); // 当前表所有的字段
  const [tbData, setTbData] = useState([]); // 当前表所有的字段
  const [tableShow, setTableShow] = useState(false); // 当前表所有的字段
  const [allData, setAllData] = useState([]); // 当前表所有的字段
  const [formJosn, setFormJosn] = useState([]); // 形态解析
60 61 62 63
  const [accountVisile, setAccountVisile] = useState(false); // 表单预览弹窗
  const [submitObj, setSubmitObj] = useState({}); // 表单预览弹窗
  const [modalLoading, setModalLoading] = useState(false); // 提交数据
  const [viewModalLoading, setViewModalLoading] = useState(false); // 表单预览弹窗
涂伟's avatar
涂伟 committed
64
  const [form] = Form.useForm();
65 66
  const tableRef = useRef(null);
  const accountRef = useRef(null);
涂伟's avatar
涂伟 committed
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
  const desabledArr = [
    'FileUpload',
    'Coordinate',
    'DrawPath',
    'DrawArea',
    'Device',
    'RelationForm',
  ];
  const layout = {
    layout: 'horizontal',
    labelCol: {
      span: 5,
    },
    wrapperCol: {
      span: 19,
    },
  };
  const formItemLayout = {
    labelCol: {
      span: 5,
    },
    wrapperCol: {
      span: 19,
    },
  };
  const switchLayout = {
    labelCol: {
      span: 10,
    },
    wrapperCol: {
      span: 14,
    },
  };
  const { Item } = Form;
  // 提交
  const onSubmit = () => {
103
    setModalLoading(true);
涂伟's avatar
涂伟 committed
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
    form.validateFields().then(validate => {
      // return;
      if (validate) {
        let aa = form.getFieldsValue().Type;
        if (aa == '全部') {
          notification.warning({
            message: '提示',
            duration: 3,
            description: '分组名称不能为全部',
          });
        } else {
          let datas = JSON.parse(JSON.stringify(validate));
          for (let key in datas) {
            if (datas[key] === false) {
              datas[key] = 0;
            } else if (datas[key] === true) {
              datas[key] = 1;
            }
          }
          let obj =
            type === 'add' ? { ...datas, Order: maxLength } : { ...datas, Order, ID: formObj.ID };
          obj.LedgerFieids = tableRef.current.onFinish();
126
          setSubmitObj(obj);
涂伟's avatar
涂伟 committed
127 128
          Ledger_SaveLedger(obj)
            .then(res => {
129
              setModalLoading(false);
涂伟's avatar
涂伟 committed
130
              if (res.code === 0) {
131 132
                // form.resetFields();
                // callBackSubmit();
涂伟's avatar
涂伟 committed
133 134 135 136 137
                notification.success({
                  message: '提示',
                  duration: 3,
                  description: type === 'add' ? '新增成功' : '编辑成功',
                });
138
                setAccountVisile(true);
涂伟's avatar
涂伟 committed
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
              } else {
                notification.error({
                  message: '提示',
                  duration: 3,
                  description: res.msg,
                });
              }
            })
            .catch(() => {
              notification.error({
                message: '提示',
                duration: 3,
                description: '网络异常请稍后再试',
              });
            });
        }
      }
    });
  };
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
  // 预览提交
  const viewSubmit = () => {
    setViewModalLoading(true);
    let arr = accountRef.current.getTableColumns();
    let viewArr = tableRef.current.onFinish();
    arr.map(item => {
      viewArr.map(ele => {
        if (item.dataIndex === ele.FieldName) {
          ele.ColumnWidth = item.width;
        }
      });
    });
    Ledger_SaveLedger({ ...submitObj, LedgerFieids: viewArr })
      .then(res => {
        setViewModalLoading(false);
        if (res.code === 0) {
          setAccountVisile(false);
          form.resetFields();
          callBackSubmit();
          notification.success({
            message: '提示',
            duration: 3,
            description: type === 'add' ? '新增成功' : '编辑成功',
          });
        } else {
          notification.error({
            message: '提示',
            duration: 3,
            description: res.msg,
          });
        }
      })
      .catch(() => {
        notification.error({
          message: '提示',
          duration: 3,
          description: '网络异常请稍后再试',
        });
      });
  };
涂伟's avatar
涂伟 committed
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
  useEffect(() => {
    console.log(pickItem1);
    console.log(data[0]);
    if (visible) {
      // 获取台账表
      getTableData();
      if (type === 'edit') {
        Ledger_QueryLedger({ ledgerId: formObj.ID }).then(res => {
          if (res.code === 0) {
            // setTableShow(true)
            form.setFieldsValue(res.data);
            setOrder(res.data.Order);
            let editArr = res.data.LedgerFieids;
            changTable(res.data.TableName, editArr);
            // tableRef.current.setTableData(false, res.data.LedgerFieids);
          }
        });
      } else {
        if (!pickItem1 || pickItem1 == '全部') {
          form.setFieldsValue({ Type: data[0] });
        } else {
          form.setFieldsValue({ Type: pickItem1 });
        }
        form.setFieldsValue({ EnableTimeFilter: true });
        form.setFieldsValue({ EnableQuickSearch: true });
        form.setFieldsValue({ EnableBatchOperation: true });
        form.setFieldsValue({ EnableImportExport: true });
      }
    } else {
      setFiled({});
      form.resetFields();
      form.setFieldsValue({ AccountType: '台账' });
      setTbData([]);
      setAllData([]);
    }
  }, [visible]);

  // 获取台账表
  const getTableData = () => {
    GetCM_Ledger_LoadLedgerTable().then(res => {
      if (res.code === 0) {
        setStandingTable(res.data.root);
        if (type !== 'edit') {
          tableRef.current.setTableData(false, []);
        }
      }
    });
  };
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358
  // const getFieldInfo = formJson => {
  //   let obj = {};
  //   let parent = formJson?.properties;
  //   if (isObject(parent)) {
  //     for (let v in parent) {
  //       let child = parent[v]?.properties;
  //       if (isObject(child)) {
  //         for (let s in child) {
  //           obj[s] = { ...child[s], ...widgetData[(child?.[s]?.widget)] };
  //         }
  //       }
  //     }
  //   }
  //   return obj;
  // };
  // const widgetData = {
  //   TextInput: {
  //     name: '文本',
  //     type: '文本控件',
  //   },
  //   TextArea: {
  //     name: '多行文本',
  //     type: '文本控件',
  //   },
  //   NumberInput: {
  //     name: '数值',
  //     type: '文本控件',
  //   },
  //   RichText: {
  //     name: '富文本',
  //     type: '文本控件',
  //   },
  //   Coding: {
  //     name: '编码',
  //     type: '文本控件',
  //   },
  //   SearchLocation: {
  //     name: '地址位置',
  //     type: '文本控件',
  //   },
  //   ComboBox: {
  //     name: '下拉框',
  //     type: '选择器控件',
  //   },
  //   RadioButton: {
  //     name: '单选框',
  //     type: '选择器控件',
  //   },
  //   CheckBox: {
  //     name: '复选框',
  //     type: '选择器控件',
  //   },
  //   SwitchSelector: {
  //     name: '开关按钮',
  //     type: '选择器控件',
  //   },
  //   RelevanceSelect: {
  //     name: '关联选择',
  //     type: '选择器控件',
  //   },
  //   CascadeSelector: {
  //     name: '联级选择',
  //     type: '选择器控件',
  //   },
  //   PersonSelector: {
  //     name: '人员选择',
  //     type: '业务控件',
  //   },
  //   DeptSelector: {
  //     name: '部门选择',
  //     type: '业务控件',
  //   },
  //   AccountSelector: {
  //     name: '台账选择',
  //     type: '业务控件',
  //   },
  //   DateTime: {
  //     name: '日期选择',
  //     type: '时间控件',
  //   },
  //   Time: {
  //     name: '时间选择',
  //     type: '时间控件',
  //   },
  //   FileUpload: {
  //     name: '附件',
  //     type: '附件控件',
  //   },
  //   Coordinate: {
  //     name: '地图坐标',
  //     type: 'GIS控件',
  //   },
  //   DrawPath: {
  //     name: '路径控件',
  //     type: 'GIS控件',
  //   },
  //   DrawArea: {
  //     name: '区域控件',
  //     type: 'GIS控件',
  //   },
  //   Device: {
  //     name: '设备选择',
  //     type: 'GIS控件',
  //   },
  //   RelationForm: {
  //     name: '关联表单',
  //     type: '高级控件',
  //   },
  //   AutoCalculate: {
  //     name: '自动计算',
  //     type: '高级控件',
  //   },
  // };
359 360
  const isObject = obj => typeof obj === 'object';

涂伟's avatar
涂伟 committed
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393
  // 切换表后数据处理为对应格式
  const changTable = (value, editArr = []) => {
    Ledger_ReloadLedgerFields({ tableName: value }).then(res => {
      if (res.data.LedgerFieids) {
        let fileMap = new Map();
        let initList = [];
        // 处理为子组件需要的格式
        res.data.LedgerFieids.forEach(item => {
          initList.push(item.FieldName);
          if (fileMap.has(item.Group)) {
            let list = [...fileMap.get(item.Group)];
            list.push(item.FieldName);
            fileMap.set(item.Group, list);
          } else {
            fileMap.set(item.Group, [item.FieldName]);
          }
        });

        const FormJson = getFieldInfo(JSON.parse(res.data.FormJson));
        let arr = res.data.LedgerFieids;
        arr.forEach(item => {
          item.Shape = FormJson[item.FieldName]?.name || item.Shape;
          item.widget = FormJson[item.FieldName]?.widget || 'TextInput';
          if (desabledArr.includes(item.widget)) {
            item.IsSort = 0;
            item.AccurateSearch = 0;
            item.LikeSearch = 0;
          }
        });
        if (editArr.length) {
          editArr.forEach(item => {
            item.Shape = FormJson[item.FieldName] ? FormJson[item.FieldName].name : item.Shape;
            item.widget = FormJson[item.FieldName]?.widget || 'TextInput';
394
            item.type = FormJson[item.FieldName]?.type || '文本控件';
涂伟's avatar
涂伟 committed
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450
            if (desabledArr.includes(item.widget)) {
              item.IsSort = 0;
              item.AccurateSearch = 0;
              item.LikeSearch = 0;
            }
          });
          tableRef.current.setTableData(false, editArr);
        } else {
          // Fields 切换表后清空台账字段和表数据
          form.setFieldsValue({ Fields: [] });
          tableRef.current.setTableData(false, []);
        }
        setFormJosn(FormJson);
        setAllData(arr);
        // FormJson
        // 给Map格式转为对象
        fileMap = Object.fromEntries(fileMap.entries());
        // 处理外部字段
        Object.keys(form.getFieldsValue()).forEach(key => {
          saveOutFieldsLength(key, initList);
        });
        setAllFileds(initList);
        setFiled(fileMap);
      }
    });
  };
  // 保存外部字段个数
  const saveOutFieldsLength = (key, initList) => {
    switch (key) {
      case 'Fields':
        form.setFieldsValue({ outListFileds: dealExternal(key, initList) });
        break;
      case 'SearchFields':
        form.setFieldsValue({ outSearchFields: dealExternal(key, initList) });
        break;
      case 'AddFields':
        form.setFieldsValue({ outAddFields: dealExternal(key, initList) });
        break;
      case 'EditFields':
        form.setFieldsValue({ outEditFields: dealExternal(key, initList) });
        break;
      case 'WebFields':
        form.setFieldsValue({ outWebFields: dealExternal(key, initList) });
        break;
      case 'MobileFields':
        form.setFieldsValue({ outMobileFields: dealExternal(key, initList) });
        break;
      default:
        break;
    }
  };
  // 选择字段回调函数
  const onOK = prop => {
    setIsVisible(false);
    let obj = {};
    obj[prop.pickItem] = prop.str;
451
    let allArr = prop.str.split(',');
涂伟's avatar
涂伟 committed
452 453 454 455 456 457 458
    let showArr = prop.str.split(',');
    let editArr = tableRef.current.onFinish().map(item => {
      return item.FieldName;
    });
    showArr = showArr.filter(item => {
      return !editArr.includes(item);
    });
459 460 461 462 463 464 465 466 467 468 469 470 471
    let tableArr = tableRef.current.onFinish().concat(
      allData.filter(item => {
        return showArr.includes(item.FieldName);
      }),
    );
    let arr = [];
    allArr.map(item => {
      tableArr.map(ele => {
        if (item === ele.FieldName) {
          arr.push(ele);
        }
      });
    });
涂伟's avatar
涂伟 committed
472 473
    tableRef.current.setTableData(
      false,
474 475 476 477
      // tableArr.filter(item => {
      //   return allArr.includes(item.FieldName);
      // }),
      arr,
涂伟's avatar
涂伟 committed
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534
    );
    form.setFieldsValue(obj);
    saveOutFieldsLength(prop.pickItem, allFileds);
  };
  // 处理外部字段
  const dealExternal = (fileds, list) => {
    let isExternal;
    let externalLength = 0;
    if (form.getFieldValue(fileds).length) {
      form
        .getFieldValue(fileds)
        .split(',')
        .forEach(item => {
          isExternal = list.some(val => val === item);
          if (!isExternal && item !== '') {
            // eslint-disable-next-line no-plusplus
            externalLength++;
          }
        });
    }

    return externalLength;
  };
  // 勾选字段
  const pickFiled = fileds => {
    if (!form.getFieldValue('TableName')) {
      notification.error({ message: '提示', duration: 3, description: '请选择台账表' });
      return;
    }
    // 添加外部字段
    let fil = { ...filed };
    fil['外部字段'] = [];
    let isExternal;
    let list = form.getFieldValue(fileds).length ? form.getFieldValue(fileds).split(',') : [];
    list.forEach(item => {
      isExternal = allFileds.some(val => val === item);
      if (!isExternal && item !== '') {
        fil['外部字段'].push(item);
      }
    });
    if (fil['外部字段'].length === 0) {
      delete fil['外部字段'];
    }
    setFiled(fil);
    setCheckedList(list);
    setPickItem(fileds);
    setIsVisible(true);
  };
  // 搜索框监听
  const onSearch = value => {
    if (value) {
      form.setFieldsValue({ Type: value });
    }
  };

  return (
    <Modal
535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550
      title={
        <div className={styles.modalTitle}>
          <div>{type === 'add' ? '台账配置' : '台账编辑'}</div>
          {/* <div>
            <Button
              type="primary"
              ghost
              icon={<EyeOutlined />}
              onClick={() => setAccountVisile(true)}
              style={{ marginLeft: '10px' }}
            >
              预览
            </Button>
          </div> */}
        </div>
      }
涂伟's avatar
涂伟 committed
551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569
      visible={visible}
      destroyOnClose
      onOk={onSubmit}
      onCancel={onCancel}
      centered
      bodyStyle={{ width: '100%', height: '800px', overflowY: 'scorll' }}
      width="1600px"
      // style={{ top: '-20px' }}
      getContainer={false}
      // style={{
      //   maxWidth: '100vw',
      //   top: 0,
      //   paddingBottom: 0,
      // }}
      // bodyStyle={{
      //   height: 'calc(100vh - 55px - 53px)',
      //   overflowY: 'auto',
      // }}
      // width="100vw"
570
      confirmLoading={modalLoading}
571
      okText="保存并查看"
涂伟's avatar
涂伟 committed
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 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648
    >
      <div className={styles.top}>
        <Form form={form} {...layout}>
          <Row>
            <Col span={8}>
              <Item
                label="台账名称"
                name="Name"
                rules={[
                  {
                    required: true,
                    validator: (rule, value) => {
                      if (
                        keepTableData.find(i => i.name == form.getFieldsValue().Name) &&
                        form.getFieldsValue().Name != formObj.name
                      ) {
                        return Promise.reject('台账名称已存在');
                      } else if (form.getFieldsValue().Name == '') {
                        return Promise.reject('台账名称不能为空');
                      }
                      return Promise.resolve();
                    },
                  },
                ]}
              >
                <Input placeholder="台账名称不可重复" allowClear />
              </Item>
            </Col>
            <Col span={8}>
              <Item
                label="台账分组"
                name="Type"
                rules={[{ required: true, message: '请选择分组' }]}
              >
                <Select
                  showSearch
                  filterOption={false}
                  onSearch={onSearch}
                  placeholder="请输入分组名称"
                  allowClear
                >
                  {data.map((item, index) => (
                    <Option value={item} key={index}>
                      {item}
                    </Option>
                  ))}
                </Select>
              </Item>
            </Col>
            <Col span={8}>
              <Item
                label="台账类型"
                name="AccountType"
                rules={[{ required: true, message: '请选择类型' }]}
              >
                <Select placeholder="请选择台账类型">
                  <Option value="台账">台账</Option>
                  <Option value="反馈">反馈</Option>
                  <Option value="设备">设备</Option>
                </Select>
              </Item>
            </Col>
            <Col span={8}>
              <Item
                label="台账主表"
                name="TableName"
                rules={[{ required: true, message: '请选择台账表' }]}
              >
                <Select
                  placeholder=""
                  optionFilterProp="children"
                  onChange={changTable}
                  showSearch
                  disabled={type !== 'add'}
                >
                  {standingTable.map((item, index) => (
                    <Option key={index} value={item.value}>
649
                      {item.value}
涂伟's avatar
涂伟 committed
650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 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 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780
                    </Option>
                  ))}
                </Select>
              </Item>
            </Col>
            <Col span={8}>
              <Item
                {...formItemLayout}
                label={
                  <>
                    {form.getFieldValue('outListFileds') > 0 ? (
                      <Tooltip title={`外部字段${form.getFieldValue('outListFileds')}个`}>
                        <InfoCircleOutlined style={{ color: 'red', margin: '2px 3px 0 3px' }} />
                      </Tooltip>
                    ) : (
                      ''
                    )}
                    <span>台账字段</span>
                  </>
                }
                name="Fields"
                rules={[{ required: true, message: '请选择台账字段' }]}
              >
                <div style={{ display: 'flex' }}>
                  <Form.Item name="Fields" style={{ marginBottom: 0, width: '100%' }}>
                    <TextArea
                      placeholder="前端详情查看字段"
                      allowClear
                      style={{ height: '32px' }}
                    />
                  </Form.Item>
                  <Button
                    type="dashed"
                    style={{ width: '50px', marginLeft: '10px' }}
                    icon={<PlusOutlined />}
                    onClick={() => {
                      pickFiled('Fields');
                    }}
                  />
                </div>
              </Item>
            </Col>
            <Col span={8}>
              <Item label="接口配置" name="Interface">
                <Input placeholder="服务项目dll库" allowClear />
              </Item>
            </Col>
            <Col span={4}>
              <Form.Item
                {...switchLayout}
                valuePropName="checked"
                // style={{ marginBottom: '0', padding: '2px', borderBottom: '1px solid #ccc' }}
                label="时间筛选"
                name="EnableTimeFilter"
              >
                <Switch checkedChildren="是" unCheckedChildren="否" />
              </Form.Item>
            </Col>
            <Col span={4}>
              <Form.Item
                {...switchLayout}
                valuePropName="checked"
                // style={{ marginBottom: '0', padding: '2px', borderBottom: '1px solid #ccc' }}
                label="快速检索"
                name="EnableQuickSearch"
              >
                <Switch checkedChildren="是" unCheckedChildren="否" />
              </Form.Item>
            </Col>
            <Col span={4}>
              <Form.Item
                {...switchLayout}
                valuePropName="checked"
                // style={{ marginBottom: '0', padding: '2px', borderBottom: '1px solid #ccc' }}
                label="站点过滤"
                name="EnableSiteFilter"
              >
                <Switch checkedChildren="是" unCheckedChildren="否" />
              </Form.Item>
            </Col>
            <Col span={4}>
              <Form.Item
                {...switchLayout}
                valuePropName="checked"
                // style={{ marginBottom: '0', padding: '2px', borderBottom: '1px solid #ccc' }}
                label="导入导出"
                name="EnableImportExport"
              >
                <Switch checkedChildren="是" unCheckedChildren="否" />
              </Form.Item>
            </Col>
            <Col span={4}>
              <Form.Item
                {...switchLayout}
                valuePropName="checked"
                // style={{ marginBottom: '0', padding: '2px', borderBottom: '1px solid #ccc' }}
                label="批量操作"
                name="EnableBatchOperation"
              >
                <Switch checkedChildren="是" unCheckedChildren="否" />
              </Form.Item>
            </Col>
            <Col span={4}>
              <Form.Item
                {...switchLayout}
                valuePropName="checked"
                // style={{ marginBottom: '0', padding: '2px', borderBottom: '1px solid #ccc' }}
                label="打印功能"
                name="EnablePrint"
              >
                <Switch checkedChildren="是" unCheckedChildren="否" />
              </Form.Item>
            </Col>
          </Row>
        </Form>
        <ChangeAdd
          visible={isVisible}
          onCancel={() => {
            setIsVisible(false);
            setCheckedList([]);
          }}
          callBackSubmit={onOK}
          newCheckedList={checkedList}
          filed={filed}
          pickItem={pickItem}
          formObj={formObj}
        />
      </div>
      <div className={styles.bottom}>
        <EditTable visible={tableShow} ref={tableRef} tbData={tbData} formObj={formObj} />
      </div>
781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796
      <Modal
        title="台账预览"
        visible={accountVisile}
        destroyOnClose
        onOk={viewSubmit}
        onCancel={() => {
          setAccountVisile(false);
        }}
        centered
        bodyStyle={{ width: '100%', height: '800px', overflowY: 'scorll' }}
        width="1600px"
        confirmLoading={viewModalLoading}
        // okText=
      >
        <Account ref={accountRef} accountName={form.getFieldValue('Name')} readOnly />
      </Modal>
涂伟's avatar
涂伟 committed
797 798 799 800
    </Modal>
  );
};
export default BookConfigNew;