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

var _dec, _class;
let PlaceTreeWithPlaceFile = (_dec = inject('place'), _dec(_class = observer(_class = class PlaceTreeWithPlaceFile extends React__default.Component {
  constructor(props) {
    super(props);
    this.onChange = value => {
      this.setState({
        keyword: value
      });
    };
    this.renderPrefix = node => {
      return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, node.level * 1 >= 5 ? /*#__PURE__*/React__default.createElement("span", {
        className: "tree-node-prefix"
      }, /*#__PURE__*/React__default.createElement(IconFont, {
        type: 'icon-L_Place_Place'
      }), ' ') : null);
    };
    /**
     * 场所树-自定义title
     */
    this.renderHeader = () => {
      const {
        renderHeader
      } = this.props;
      return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
        className: "lm-c-tree-title-serach"
      }, /*#__PURE__*/React__default.createElement(SearchInput, {
        className: "input-keword",
        placeholder: '请输入场所名称进行查找',
        onChange: this.onChange
      })), /*#__PURE__*/React__default.createElement(Row, {
        className: "place-file-tree-title"
        // type="flex" justify={"center"} align={"middle"} gutter={20}
      }, /*#__PURE__*/React__default.createElement(Col, {
        span: 8,
        className: "place-info-item"
      }, /*#__PURE__*/React__default.createElement(IconFont, {
        type: 'icon-S_Point_Camera'
      }), " \u8BBE\u5907\u6570\u91CF"), /*#__PURE__*/React__default.createElement(Col, {
        span: 8,
        className: "place-info-item"
      }, /*#__PURE__*/React__default.createElement(IconFont, {
        type: 'icon-S_Edit_User'
      }), " \u4EBA\u5458\u6570\u91CF"), /*#__PURE__*/React__default.createElement(Col, {
        span: 8,
        className: "place-info-item"
      }, /*#__PURE__*/React__default.createElement(IconFont, {
        type: 'icon-S_Place_Place'
      }), " \u573A\u6240\u6570\u91CF"), renderHeader && renderHeader()));
    };
    this.RenderTreeTitle = ({
      node,
      nameKey,
      keyword
    }) => {
      return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
        className: "place-tree-title",
        title: node[nameKey]
      }, /*#__PURE__*/React__default.createElement(HightLevel, {
        keyword: keyword,
        name: node[nameKey]
      })), /*#__PURE__*/React__default.createElement(Row, {
        className: "place-tree-title-info"
      }, /*#__PURE__*/React__default.createElement(Col, {
        className: "place-info-item"
      }, /*#__PURE__*/React__default.createElement(IconFont, {
        type: 'icon-S_Point_Camera'
      }), " ", node.deviceCount ? thousand(node.deviceCount.count) : 0), /*#__PURE__*/React__default.createElement(Col, {
        className: "place-info-item"
      }, /*#__PURE__*/React__default.createElement(IconFont, {
        type: 'icon-S_Edit_User'
      }), " ", node.personCount ? thousand(node.personCount) : 0), /*#__PURE__*/React__default.createElement(Col, {
        className: "place-info-item"
      }, /*#__PURE__*/React__default.createElement(IconFont, {
        type: 'icon-S_Place_Place'
      }), " ", node.childrenPlaceCount ? thousand(node.childrenPlaceCount) : 0)));
    };
    this.state = {
      keyword: null
    };
  }
  render() {
    const {
      className,
      expandedKeys = null,
      ...props
    } = this.props;
    const {
      keyword
    } = this.state;
    return /*#__PURE__*/React__default.createElement(PlaceTree, _extends({
      keyword: keyword,
      className: `${className} lm-c-place-file-tree`,
      title: false,
      inputPlaceholder: '请输入场所名称进行查找',
      disableCheckbox: false,
      showIcon: true,
      expandedKeys: expandedKeys,
      renderHeader: this.renderHeader,
      RenderTreeTitle: this.RenderTreeTitle
    }, props));
  }
}) || _class) || _class);

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