import { _ as _extends } from '../_rollupPluginBabelHelpers-736b301a.js';
import React__default from 'react';
import { inject } from 'mobx-react';
import OrgTree from '../OrgTree/index.js';
import { Row, Col, Checkbox, Radio } from 'antd';
import '../Tree/index.js';
import '../index-71189681.js';
import '../_commonjsHelpers-e7b0df42.js';
import 'react-is';
import '../IconFont/index.js';
import '@zenview/micro-utils';
import '../HightLevel/index.js';
import 'lodash';
import '../TreeTitle/index.js';
import '../SearchInput/index.js';
import '../CBox/index.js';

var _dec, _class;
let OrgTreeWithSystem = (_dec = inject('org'), _dec(_class = class OrgTreeWithSystem extends React__default.Component {
  constructor(props) {
    super(props);
    this.onChange = flag => {
      // const { org } = this.props;
      // const ids = flag ? org.orgList.map(v => v.id) : [org.orgList[0].id];
      // this.onExpand(ids);
      this.setState({
        flag
      });
    };
    this.onExpand = expandKeys => {
      this.treeRef.current.onExpand(expandKeys);
    };
    this.renderHeader = () => {
      const {
        isInclude,
        isIncludeChange
      } = this.props;
      return /*#__PURE__*/React__default.createElement("div", {
        className: "system-org-tree-header"
      }, /*#__PURE__*/React__default.createElement(Row, null, /*#__PURE__*/React__default.createElement(Col, {
        sm: 24,
        xl: 8
      }, /*#__PURE__*/React__default.createElement(Checkbox, {
        onChange: e => this.onChange(e.target.checked)
      }, "\u5C55\u5F00\u5168\u90E8")), isIncludeChange && /*#__PURE__*/React__default.createElement(Col, {
        sm: 24,
        xl: 16,
        className: "system-org-has-include"
      }, /*#__PURE__*/React__default.createElement("span", null, "\u5B50\u7EC4\u7EC7 :"), /*#__PURE__*/React__default.createElement(Radio.Group, {
        value: isInclude,
        onChange: e => isIncludeChange(e.target.value)
      }, /*#__PURE__*/React__default.createElement(Radio, {
        value: 1
      }, "\u5305\u542B"), /*#__PURE__*/React__default.createElement(Radio, {
        value: 0
      }, "\u4E0D\u5305\u542B")))));
    };
    this.treeRef = /*#__PURE__*/React__default.createRef();
    this.state = {
      flag: false
    };
  }
  render() {
    return /*#__PURE__*/React__default.createElement(OrgTree, _extends({}, this.props, {
      launchFlag: this.state.flag,
      ref: this.treeRef,
      renderHeader: this.renderHeader,
      className: "lm-org-tree-with-system"
    }));
  }
}) || _class);

export { OrgTreeWithSystem as default };
//# sourceMappingURL=index.js.map
